diff --git a/.gitattributes b/.gitattributes index 39d5ad6d0b23a59328e18723e04f051485fb9b7c..9b11c0a01f45c20cc352a2761705cbd7e666361d 100644 --- a/.gitattributes +++ b/.gitattributes @@ -32,6 +32,9 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text *.xz filter=lfs diff=lfs merge=lfs -text *.zip filter=lfs diff=lfs merge=lfs -text *.zst filter=lfs diff=lfs merge=lfs -text +*.so filter=lfs diff=lfs merge=lfs -text +*.o filter=lfs diff=lfs merge=lfs -text +*.obj filter=lfs diff=lfs merge=lfs -text *tfevents* filter=lfs diff=lfs merge=lfs -text checkpoints/face_0929/gaussianhead_latest filter=lfs diff=lfs merge=lfs -text checkpoints/face_0929/supres_latest filter=lfs diff=lfs merge=lfs -text @@ -40,3 +43,20 @@ checkpoints/pos_map_ys/body_mix/smpl_pos_map/cano_smpl_nml_map.exr filter=lfs di checkpoints/pos_map_ys/body_mix/smpl_pos_map/cano_smpl_pos_map.exr filter=lfs diff=lfs merge=lfs -text checkpoints/ref_gaussian/head/000000.ply filter=lfs diff=lfs merge=lfs -text checkpoints/ filter=lfs diff=lfs merge=lfs -text +AnimatableGaussians/network/styleunet/build/lib.linux-x86_64-cpython-310/fused.cpython-310-x86_64-linux-gnu.so filter=lfs diff=lfs merge=lfs -text +AnimatableGaussians/network/styleunet/build/lib.linux-x86_64-cpython-310/upfirdn2d.cpython-310-x86_64-linux-gnu.so filter=lfs diff=lfs merge=lfs -text +AnimatableGaussians/network/styleunet/build/temp.linux-x86_64-cpython-310/fused_bias_act.o filter=lfs diff=lfs merge=lfs -text +AnimatableGaussians/network/styleunet/build/temp.linux-x86_64-cpython-310/upfirdn2d.o filter=lfs diff=lfs merge=lfs -text +AnimatableGaussians/network/styleunet/build/temp.win-amd64-cpython-38/Release/fused_bias_act.obj filter=lfs diff=lfs merge=lfs -text +AnimatableGaussians/network/styleunet/build/temp.win-amd64-cpython-38/Release/upfirdn2d.obj filter=lfs diff=lfs merge=lfs -text +AnimatableGaussians/utils/posevocab_custom_ops/build/lib.linux-x86_64-cpython-38/posevocab_custom_ops.cpython-38-x86_64-linux-gnu.so filter=lfs diff=lfs merge=lfs -text +AnimatableGaussians/utils/posevocab_custom_ops/build/temp.linux-x86_64-cpython-38/bind.o filter=lfs diff=lfs merge=lfs -text +AnimatableGaussians/utils/root_finding/build/lib.linux-x86_64-cpython-38/root_finding.cpython-38-x86_64-linux-gnu.so filter=lfs diff=lfs merge=lfs -text +AnimatableGaussians/utils/root_finding/build/temp.linux-x86_64-cpython-38/bind.o filter=lfs diff=lfs merge=lfs -text +AnimatableGaussians/assets/avatarrex_dataset_demo.gif filter=lfs diff=lfs merge=lfs -text +AnimatableGaussians/network/styleunet/build/temp.win-amd64-cpython-38/Release/fused_bias_act_kernel.obj filter=lfs diff=lfs merge=lfs -text +AnimatableGaussians/network/styleunet/build/temp.win-amd64-cpython-38/Release/upfirdn2d_kernel.obj filter=lfs diff=lfs merge=lfs -text +AnimatableGaussians/network/styleunet/dist/fused-0.0.0-py3.10-linux-x86_64.egg filter=lfs diff=lfs merge=lfs -text +AnimatableGaussians/network/styleunet/dist/upfirdn2d-0.0.0-py3.10-linux-x86_64.egg filter=lfs diff=lfs merge=lfs -text +AnimatableGaussians/utils/posevocab_custom_ops/dist/posevocab_custom_ops-0.0.0-py3.8-linux-x86_64.egg filter=lfs diff=lfs merge=lfs -text +AnimatableGaussians/utils/root_finding/dist/root_finding-0.0.0-py3.8-linux-x86_64.egg filter=lfs diff=lfs merge=lfs -text diff --git a/AnimatableGaussians b/AnimatableGaussians deleted file mode 160000 index f92794c6aaaf7ee69de63afce579b5fddc9e5467..0000000000000000000000000000000000000000 --- a/AnimatableGaussians +++ /dev/null @@ -1 +0,0 @@ -Subproject commit f92794c6aaaf7ee69de63afce579b5fddc9e5467 diff --git a/AnimatableGaussians/.DS_Store b/AnimatableGaussians/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..7fc578bafb24761c77841c5e35005f1f60519992 Binary files /dev/null and b/AnimatableGaussians/.DS_Store differ diff --git a/AnimatableGaussians/AVATARREX_DATASET.md b/AnimatableGaussians/AVATARREX_DATASET.md new file mode 100644 index 0000000000000000000000000000000000000000..79e3ad7f4f60de0ab5e2179bf89d849f23bd31a1 --- /dev/null +++ b/AnimatableGaussians/AVATARREX_DATASET.md @@ -0,0 +1,168 @@ +# AvatarReX Dataset + +### AvatarReX: Real-time Expressive Full-body Avatars +Zerong Zheng, Xiaochen Zhao, Hongwen Zhang, Boning Liu, Yebin Liu. SIGGRAPH 2023 + +[[Project Page]](https://liuyebin.com/AvatarRex/) + +![teaser](./assets/avatarrex.jpg) + +This dataset contains four multi-view image sequences used in our paper "AvatarReX: Real-time Expressive Full-body Avatars". They are captured with 16 well-calibrated RGB cameras in 30 fps, with a resolution of 1500×2048 and lengths ranging from 1800 to 2000 frames. We use the data to evaluate our method for building animatable human body avatars. + +We also provide the SMPL-X fitting in the dataset. + + +## Agreement +1. The AvatarReX dataset (the "Dataset") is available for **non-commercial** research purposes only. Any other use, in particular any use for commercial purposes, is prohibited. This includes, without limitation, incorporation in a commercial product, use in a commercial service, as training data for a commercial product, for commercial ergonomic analysis (e.g. product design, architectural design, etc.), or production of other artifacts for commercial purposes including, for example, web services, movies, television programs, mobile applications, or video games. The dataset may not be used for pornographic purposes or to generate pornographic material whether commercial or not. The Dataset may not be reproduced, modified and/or made available in any form to any third party without Tsinghua University’s prior written permission. + +2. You agree **not to** reproduce, modified, duplicate, copy, sell, trade, resell or exploit any portion of the images and any portion of derived data in any form to any third party without Tsinghua University’s prior written permission. + +3. You agree **not to** further copy, publish or distribute any portion of the Dataset. Except, for internal use at a single site within the same organization it is allowed to make copies of the dataset. + +4. Tsinghua University reserves the right to terminate your access to the Dataset at any time. + + +## Download Instructions +The dataset can be directly downloaded from the following links. + +* avatarrex_zzr: [this link](https://drive.google.com/file/d/1sCQJ3YU-F3lY9p_HYNIQbT7QyfVKy0HT/view?usp=sharing), 2001 frames in total, ~21 GB +* avatarrex_zxc: [this link](https://drive.google.com/file/d/1pY1qRj2n6b2YOCmZRVM1D--CXKR02qXU/view?usp=sharing), 1801 frames in total, ~12 GB +* avatarrex_lbn1: [this link](https://drive.google.com/file/d/1DuESdA5YwvJKapyo7i_KoQxKHHFWzi-w/view?usp=sharing), 1901 frames in total, ~11 GB +* avatarrex_lbn2: [this link](https://drive.google.com/file/d/1J7ITsYhuWlqhoIkmYni8dL2KJw-wmcy_/view?usp=sharing), 1871 frames in total, ~16 GB + +Note again that by downloading the dataset you acknowledge that you have read the agreement, understand it, and agree to be bound by them. If you do not agree with these terms and conditions, you must not download and/or use the Dataset. + + +## Data Explanation +For each subject, we provide the multi-view images (```./avatarrex_zzr/********/```) as well as the foreground segmentation (```./avatarrex_zzr/********/mask/pha```), which are obtained using [BackgroundMattingV2](https://github.com/PeterL1n/BackgroundMattingV2). The calibration data is provided in ```calibration_full.json```, and the SMPL fitting in ```smpl_params.npz```. Some frames are losed during the capture process, and we provide their filename in ```missing_img_files.txt```. + +Here we provide a code snip to show how to parse and visualize the data: +```python +import os +import json +import numpy as np +import cv2 as cv +import torch +import smplx # (please setup the official SMPL-X model according to: https://pypi.org/project/smplx/) + +subject = './avatarrex_zzr' +# subject = './avatarrex_zxc' +# subject = './avatarrex_lbn1' +# subject = './avatarrex_lbn2' + +# initialize smpl model +smpl = smplx.SMPLX(model_path = './smplx', gender = 'neutral', use_pca = False, num_pca_comps = 45, flat_hand_mean = True, batch_size = 1) + +# load camera data +with open(os.path.join(subject, 'calibration_full.json'), 'r') as fp: + cam_data = json.load(fp) + +# load smpl data +smpl_data = np.load(os.path.join(subject, 'smpl_params.npz'), allow_pickle = True) +smpl_data = dict(smpl_data) +smpl_data = {k: torch.from_numpy(v.astype(np.float32)) for k, v in smpl_data.items()} + +frame_num = smpl_data['body_pose'].shape[0] +for frame_id in range(0, frame_num, 30): + smpl_out = smpl.forward( + global_orient = smpl_data['global_orient'][frame_id].unsqueeze(0), + transl = smpl_data['transl'][frame_id].unsqueeze(0), + body_pose = smpl_data['body_pose'][frame_id].unsqueeze(0), + jaw_pose = smpl_data['jaw_pose'][frame_id].unsqueeze(0), + betas = smpl_data['betas'][0].unsqueeze(0), + expression = smpl_data['expression'][frame_id].unsqueeze(0), + left_hand_pose = smpl_data['left_hand_pose'][frame_id].unsqueeze(0), + right_hand_pose = smpl_data['right_hand_pose'][frame_id].unsqueeze(0), + ) + smpl_verts = smpl_out.vertices # smpl vertices in live poses + smpl_verts = smpl_verts.detach().cpu().numpy().squeeze(0) + + smpl_proj_vis = [] + for cam_id in range(0, len(cam_data), 3): + cam_sn = list(cam_data.keys())[cam_id] + + img_fpath = os.path.join(subject, '%s/%08d.jpg' % (cam_sn, frame_id)) + msk_fpath = os.path.join(subject, '%s/mask/pha/%08d.jpg' % (cam_sn, frame_id)) + + if (not os.path.isfile(img_fpath)) or (not os.path.isfile(msk_fpath)): + break + + img = cv.imread(img_fpath, cv.IMREAD_UNCHANGED) + msk = cv.imread(msk_fpath, cv.IMREAD_GRAYSCALE) + img = img * np.uint8(msk > 128)[:, :, np.newaxis] # remove background + img_ = cv.resize(img, (img.shape[1] // 2, img.shape[0] // 2)) + + # transform smpl from world to camera + cam_R = np.array(cam_data[cam_sn]['R']).astype(np.float32).reshape((3, 3)) + cam_t = np.array(cam_data[cam_sn]['T']).astype(np.float32).reshape((3,)) + smpl_verts_cam = np.matmul(smpl_verts, cam_R.transpose()) + cam_t.reshape(1, 3) + + # project smpl vertices to the image + cam_K = np.array(cam_data[cam_sn]['K']).astype(np.float32).reshape((3, 3)) + cam_K *= np.array([img_.shape[1] / img.shape[1], img_.shape[0] / img.shape[0], 1.0], dtype = np.float32).reshape(3, 1) + smpl_verts_proj = np.matmul(smpl_verts_cam / smpl_verts_cam[:, 2:], cam_K.transpose()) + + # visualize the projection + smpl_verts_proj = np.round(smpl_verts_proj).astype(np.int32) + smpl_verts_proj[:, 0] = np.clip(smpl_verts_proj[:, 0], 0, img_.shape[1] - 1) + smpl_verts_proj[:, 1] = np.clip(smpl_verts_proj[:, 1], 0, img_.shape[0] - 1) + + for v in smpl_verts_proj: + img_[v[1], v[0], :] = np.array([255, 255, 255], dtype = np.uint8) + smpl_proj_vis.append(img_) + + if len(smpl_proj_vis) != 6: + continue + + vis = np.concatenate([ + np.concatenate(smpl_proj_vis[:3], axis = 1), + np.concatenate(smpl_proj_vis[3:], axis = 1), + ], axis = 0) + vis = cv.resize(vis, (0, 0), fx = 0.5, fy = 0.5) + cv.imshow('vis', vis) + cv.waitKey(1) +``` +If everything is setup properly, you can see an animation like this: +

+ +

+ + +## Related Datasets from THU3DV Lab [[Link]](https://liuyebin.com/dataset.html) +[[THuman4.0 Dataset]](https://github.com/ZhengZerong/THUman4.0-Dataset/) Containing 3 multi-view RGB sequences captured with 24 well-calibrated cameras as well as corresponding SMPL-X registration. + +[[THuman3.0 Dataset]](https://github.com/fwbx529/THuman3.0-Dataset) Containing 20 human-garment combinations, where each combination has 15 to 35 high-quality human scans captured by a dense DLSR rig. + +[[MultiHuman Dataset]](https://github.com/y-zheng18/MultiHuman-Dataset/) Containing 453 high-quality scans, each contains 1-3 persons. The dataset can be used to train and evaluate multi-person reconstruction algorithms. + +[[THuman2.0 Dataset]](https://github.com/ytrock/THuman2.0-Dataset) Containing 500 high-quality human scans captured by a dense DLSR rig, with SMPL annotations. + + + + +## Citation +If you use this dataset for your research, please consider citing: +```bibtex +@article{zheng2023avatarrex, + title={AvatarRex: Real-time Expressive Full-body Avatars}, + author={Zheng, Zerong and Zhao, Xiaochen and Zhang, Hongwen and Liu, Boning and Liu, Yebin}, + journal={ACM Transactions on Graphics (TOG)}, + volume={42}, + number={4}, + articleno={}, + year={2023}, + publisher={ACM New York, NY, USA} +} + +@inproceedings{li2023animatablegaussians, + title={Animatable Gaussians: Learning Pose-dependent Gaussian Maps for High-fidelity Human Avatar Modeling}, + author={Li, Zhe and Zheng, Zerong and Wang, Lizhen and Liu, Yebin}, + booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)}, + year={2024} +} +``` + +## Contact +- Zerong Zheng [(zrzheng1995@foxmail.com)](mailto:zrzheng1995@foxmail.com) +- Zhe Li [(lizhe_thu@126.com)](mailto:lizhe_thu@126.com) +- Yebin Liu [(liuyebin@mail.tsinghua.edu.cn)](mailto:liuyebin@mail.tsinghua.edu.cn) \ No newline at end of file diff --git a/AnimatableGaussians/LICENSE b/AnimatableGaussians/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..4a77ba443d30bd54f1f5feb57bdf9b0e0efeba49 --- /dev/null +++ b/AnimatableGaussians/LICENSE @@ -0,0 +1,39 @@ +Please read carefully the following terms and conditions and any accompanying documentation before you download and/or use Animatable Gaussians Software/Code/Data (the "Software"). By downloading and/or using the Software, you acknowledge that you have read these terms and conditions, understand them, and agree to be bound by them. If you do not agree with these terms and conditions, you must not download and/or use the Software. + +Ownership + +The Software has been developed at the Tsinghua University and is owned by and proprietary material of the Tsinghua University. + +License Grant + +Tsinghua University grants you a non-exclusive, non-transferable, free of charge right: + +To download the Software and use it on computers owned, leased or otherwise controlled by you and/or your organisation; + +To use the Software for the sole purpose of performing non-commercial scientific research, non-commercial education, or non-commercial artistic projects. + +Any other use, in particular any use for commercial purposes, is prohibited. This includes, without limitation, incorporation in a commercial product, use in a commercial service, as training data for a commercial product, for commercial ergonomic analysis (e.g. product design, architectural design, etc.), or production of other artifacts for commercial purposes including, for example, web services, movies, television programs, mobile applications, or video games. The Software may not be used for pornographic purposes or to generate pornographic material whether commercial or not. This license also prohibits the use of the Software to train methods/algorithms/neural networks/etc. for commercial use of any kind. The Software may not be reproduced, modified and/or made available in any form to any third party without Tsinghua University’s prior written permission. By downloading the Software, you agree not to reverse engineer it. + +Disclaimer of Representations and Warranties + +You expressly acknowledge and agree that the Software results from basic research, is provided “AS IS”, may contain errors, and that any use of the Software is at your sole risk. TSINGHUA UNIVERSITY MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE SOFTWARE, NEITHER EXPRESS NOR IMPLIED, AND THE ABSENCE OF ANY LEGAL OR ACTUAL DEFECTS, WHETHER DISCOVERABLE OR NOT. Specifically, and not to limit the foregoing, Tsinghua University makes no representations or warranties (i) regarding the merchantability or fitness for a particular purpose of the Software, (ii) that the use of the Software will not infringe any patents, copyrights or other intellectual property rights of a third party, and (iii) that the use of the Software will not cause any damage of any kind to you or a third party. + +Limitation of Liability + +Under no circumstances shall Tsinghua University be liable for any incidental, special, indirect or consequential damages arising out of or relating to this license, including but not limited to, any lost profits, business interruption, loss of programs or other data, or all other commercial damages or losses, even if advised of the possibility thereof. + +No Maintenance Services + +You understand and agree that Tsinghua University is under no obligation to provide either maintenance services, update services, notices of latent defects, or corrections of defects with regard to the Software. Tsinghua University nevertheless reserves the right to update, modify, or discontinue the Software at any time. + +Publication with the Software + +You agree to cite the paper describing the software and algorithm as specified on the download website. + +Media Projects with the Software + +When using the Software in a media project please give credit to Tsinghua University. For example: the Software was used for performance capture courtesy of the Tsinghua University. + +Commercial Licensing Opportunities + +For commercial use and commercial license please contact: liuyebin@mail.tsinghua.edu.cn. \ No newline at end of file diff --git a/AnimatableGaussians/PREPROCESSED_DATASET.md b/AnimatableGaussians/PREPROCESSED_DATASET.md new file mode 100644 index 0000000000000000000000000000000000000000..a11063af982d38d96ce7c6b824a302737fdcb164 --- /dev/null +++ b/AnimatableGaussians/PREPROCESSED_DATASET.md @@ -0,0 +1,48 @@ +
+ +# Preprocessed Dataset + +
+ +## AvatarReX Dataset + +
+ + + + + + + + + + + + + +
+Figure + + + + + + +
+Character + +avatarrex_zzr + +avatarrex_lbn1 + +avatarrex_lbn2 +
+
+ +## ActorsHQ Dataset + +Stay tuned. + +## THuman4.0 Dataset + +Stay tuned. \ No newline at end of file diff --git a/AnimatableGaussians/PRETRAINED_MODEL.md b/AnimatableGaussians/PRETRAINED_MODEL.md new file mode 100644 index 0000000000000000000000000000000000000000..9c549b370277ef5f9be1a75a12c56b6584d58a5b --- /dev/null +++ b/AnimatableGaussians/PRETRAINED_MODEL.md @@ -0,0 +1,48 @@ +
+ +# Pretrained Model + +
+ +## AvatarReX Dataset + +
+ + + + + + + + + + + + + +
+Figure + + + + + + +
+Character + +avatarrex_zzr + +avatarrex_lbn1 + +avatarrex_lbn2 +
+
+ +## ActorsHQ Dataset + +Stay tuned. + +## THuman4.0 Dataset + +Stay tuned. \ No newline at end of file diff --git a/AnimatableGaussians/README.md b/AnimatableGaussians/README.md new file mode 100644 index 0000000000000000000000000000000000000000..a4e36c39594a907b556fc1d5e07a4f882040b182 --- /dev/null +++ b/AnimatableGaussians/README.md @@ -0,0 +1,117 @@ +News +- `05/22/2024` :loudspeaker: An extension work of Animatable Gaussians for human avatar relighting is available at [here](https://animatable-gaussians.github.io/relight). Welcome to check it! +- `03/11/2024` The code has been released. Welcome to have a try! +- `03/11/2024` [AvatarReX](AVATARREX_DATASET.md) dataset, a high-resolution multi-view video dataset for avatar modeling, has been released. +- `02/27/2024` Animatable Gaussians is accepted by CVPR 2024! + +Todo +- [x] Release the code. +- [x] Release AvatarReX dataset. +- [ ] Release all the checkpoints and preprocessed dataset. + +
+ +# Animatable Gaussians: Learning Pose-dependent Gaussian Maps for High-fidelity Human Avatar Modeling + +

CVPR 2024

+ +[Zhe Li](https://lizhe00.github.io/) 1, [Zerong Zheng](https://zhengzerong.github.io/) 2, [Lizhen Wang](https://lizhenwangt.github.io/) 1, [Yebin Liu](https://www.liuyebin.com) 1 + +1Tsinghua Univserity 2NNKosmos Technology + +### [Projectpage](https://animatable-gaussians.github.io/) · [Paper](https://arxiv.org/pdf/2311.16096.pdf) · [Video](https://www.youtube.com/watch?v=kOmZxD0HxZI) + +
+ +https://github.com/lizhe00/AnimatableGaussians/assets/61936670/484e1263-06ed-409b-b9a1-790f5b514832 + +***Abstract**: Modeling animatable human avatars from RGB videos is a long-standing and challenging problem. Recent works usually adopt MLP-based neural radiance fields (NeRF) to represent 3D humans, but it remains difficult for pure MLPs to regress pose-dependent garment details. To this end, we introduce Animatable Gaussians, a new avatar representation that leverages powerful 2D CNNs and 3D Gaussian splatting to create high-fidelity avatars. To associate 3D Gaussians with the animatable avatar, we learn a parametric template from the input videos, and then parameterize the template on two front & back canonical Gaussian maps where each pixel represents a 3D Gaussian. The learned template is adaptive to the wearing garments for modeling looser clothes like dresses. Such template-guided 2D parameterization enables us to employ a powerful StyleGAN-based CNN to learn the pose-dependent Gaussian maps for modeling detailed dynamic appearances. Furthermore, we introduce a pose projection strategy for better generalization given novel poses. Overall, our method can create lifelike avatars with dynamic, realistic and generalized appearances. Experiments show that our method outperforms other state-of-the-art approaches.* + +## Demo Results +We show avatars animated by challenging motions from [AMASS](https://amass.is.tue.mpg.de/) dataset. + +https://github.com/lizhe00/AnimatableGaussians/assets/61936670/123b026a-3fac-473c-a263-c3dcdd2ecc4c +
More results (click to expand) + +https://github.com/lizhe00/AnimatableGaussians/assets/61936670/9abfa02f-65ec-46b3-9690-ac26191a5a7e + +https://github.com/lizhe00/AnimatableGaussians/assets/61936670/c4f1e499-9bea-419c-916b-8d9ec4169ac3 + +https://github.com/lizhe00/AnimatableGaussians/assets/61936670/47b08e6f-a1f2-4597-bb75-d85e784cd97c +
+ +# Installation +0. Clone this repo. +``` +git clone https://github.com/lizhe00/AnimatableGaussians.git +# or +git clone git@github.com:lizhe00/AnimatableGaussians.git +``` +1. Install environments. +``` +# install requirements +pip install -r requirements.txt + +# install diff-gaussian-rasterization-depth-alpha +cd gaussians/diff_gaussian_rasterization_depth_alpha +python setup.py install +cd ../.. + +# install styleunet +cd network/styleunet +python setup.py install +cd ../.. +``` +2. Download [SMPL-X](https://smpl-x.is.tue.mpg.de/download.php) model, and place pkl files to ```./smpl_files/smplx```. + +# Data Preparation +## AvatarReX, ActorsHQ or THuman4.0 Dataset +1. Download [AvatarReX](./AVATARREX_DATASET.md), [ActorsHQ](https://www.actors-hq.com/dataset), or [THuman4.0](https://github.com/ZhengZerong/THUman4.0-Dataset) datasets. +2. Data preprocessing. We provide two manners below. The first way is recommended if you plan to employ our pretrained models, because the renderer utilized in preprocessing may cause slight differences. + 1. (Recommended) Download our preprocessed files from [PREPROCESSED_DATASET.md](PREPROCESSED_DATASET.md), and unzip them to the root path of each character. + 2. Follow the instructions in [gen_data/GEN_DATA.md](gen_data/GEN_DATA.md#Preprocessing) to preprocess the dataset. + +*Note for ActorsHQ dataset: 1) **DATA PATH.** The subject from ActorsHQ dataset may include more than one sequences, but we only utilize the first sequence, i.e., ```Sequence1```. The root path is ```ActorsHQ/Actor0*/Sequence1```. 2) **SMPL-X Registration.** We provide SMPL-X fitting for ActorsHQ dataset. You can download it from [here](https://drive.google.com/file/d/1DVk3k-eNbVqVCkLhGJhD_e9ILLCwhspR/view?usp=sharing), and place `smpl_params.npz` at the corresponding root path of each subject.* + +## Customized Dataset +Please refer to [gen_data/GEN_DATA.md](gen_data/GEN_DATA.md) to run on your own data. + +# Avatar Training +Take `avatarrex_zzr` from AvatarReX dataset as an example, run: +``` +python main_avatar.py -c configs/avatarrex_zzr/avatar.yaml --mode=train +``` +After training, the checkpoint will be saved in `./results/avatarrex_zzr/avatar`. + +# Avatar Animation +1. Download pretrained checkpoint from [PRETRAINED_MODEL.md](./PRETRAINED_MODEL.md), unzip it to `./results/avatarrex_zzr/avatar`, or train the network from scratch. +2. Download [THuman4.0_POSE](https://drive.google.com/file/d/1pbToBV6klq6-dXCorwjjsmnINXZCG8n9/view?usp=sharing) or [AMASS](https://amass.is.tue.mpg.de/) dataset for acquiring driving pose sequences. +We list some awesome pose sequences from AMASS dataset in [configs/awesome_amass_poses.yaml](configs/awesome_amass_poses.yaml). +Specify the testing pose path in [configs/avatarrex_zzr/avatar.yaml#L57](configs/avatarrex_zzr/avatar.yaml#L57). +3. Run: +``` +python main_avatar.py -c configs/avatarrex_zzr/avatar.yaml --mode=test +``` +You will see the animation results like below in `./test_results/avatarrex_zzr/avatar`. + +https://github.com/lizhe00/AnimatableGaussians/assets/61936670/5aad39d2-2adb-4b7b-ab90-dea46240344a + +# Evaluation +We provide evaluation metrics and example codes of comparison with body-only avatars in [eval/comparison_body_only_avatars.py](eval/comparison_body_only_avatars.py). + +# Acknowledgement +Our code is based on these wonderful repos: +- [3D Gaussian Splatting](https://github.com/graphdeco-inria/diff-gaussian-rasterization) and its [adapted version](https://github.com/ashawkey/diff-gaussian-rasterization) +- [StyleAvatar](https://github.com/LizhenWangT/StyleAvatar) + +# Citation +If you find our code or data is helpful to your research, please consider citing our paper. +```bibtex +@inproceedings{li2024animatablegaussians, + title={Animatable Gaussians: Learning Pose-dependent Gaussian Maps for High-fidelity Human Avatar Modeling}, + author={Li, Zhe and Zheng, Zerong and Wang, Lizhen and Liu, Yebin}, + booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)}, + year={2024} +} +``` + diff --git a/AnimatableGaussians/__pycache__/config.cpython-310.pyc b/AnimatableGaussians/__pycache__/config.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3c1182e1dcbe35ac7b238231caab9f4eaaa1cd8e Binary files /dev/null and b/AnimatableGaussians/__pycache__/config.cpython-310.pyc differ diff --git a/AnimatableGaussians/assets/avatarrex.jpg b/AnimatableGaussians/assets/avatarrex.jpg new file mode 100644 index 0000000000000000000000000000000000000000..ac7bd884f3816fb05621cc578b1d4be69be7138e Binary files /dev/null and b/AnimatableGaussians/assets/avatarrex.jpg differ diff --git a/AnimatableGaussians/assets/avatarrex_dataset_demo.gif b/AnimatableGaussians/assets/avatarrex_dataset_demo.gif new file mode 100644 index 0000000000000000000000000000000000000000..69da5feb193ac774d0744b695ef9ee050a9c9953 --- /dev/null +++ b/AnimatableGaussians/assets/avatarrex_dataset_demo.gif @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c0473f05f976dac2e4900102ff08a328c53a44a7b0f3c9cfacd80420fcb822e4 +size 1690599 diff --git a/AnimatableGaussians/assets/avatarrex_lbn1.jpg b/AnimatableGaussians/assets/avatarrex_lbn1.jpg new file mode 100644 index 0000000000000000000000000000000000000000..d3d2863044e8563563abf3c68743b7c812f5a9f2 Binary files /dev/null and b/AnimatableGaussians/assets/avatarrex_lbn1.jpg differ diff --git a/AnimatableGaussians/assets/avatarrex_lbn2.jpg b/AnimatableGaussians/assets/avatarrex_lbn2.jpg new file mode 100644 index 0000000000000000000000000000000000000000..fdaec1da45e6417fd517bc1e925f7fd70180a221 Binary files /dev/null and b/AnimatableGaussians/assets/avatarrex_lbn2.jpg differ diff --git a/AnimatableGaussians/assets/avatarrex_zzr.jpg b/AnimatableGaussians/assets/avatarrex_zzr.jpg new file mode 100644 index 0000000000000000000000000000000000000000..361d26cc5c51243419a1a83c1dd3ddb78bfc9f10 Binary files /dev/null and b/AnimatableGaussians/assets/avatarrex_zzr.jpg differ diff --git a/AnimatableGaussians/assets/ball.obj b/AnimatableGaussians/assets/ball.obj new file mode 100644 index 0000000000000000000000000000000000000000..346f0351a9161e49acb046b733b5c25f9923c080 --- /dev/null +++ b/AnimatableGaussians/assets/ball.obj @@ -0,0 +1,2214 @@ +# Blender v2.74 (sub 0) OBJ File: '' +# www.blender.org +v 0.000000 0.500000 -0.000000 +v 0.065300 0.495700 -0.000000 +v 0.129400 0.483000 -0.000000 +v 0.191300 0.461900 -0.000000 +v 0.250000 0.433000 -0.000000 +v 0.304400 0.396700 -0.000000 +v 0.353600 0.353600 -0.000000 +v 0.396700 0.304400 -0.000000 +v 0.433000 0.250000 -0.000000 +v 0.461900 0.191300 -0.000000 +v 0.483000 0.129400 -0.000000 +v 0.495700 0.065300 -0.000000 +v 0.500000 0.000000 0.000000 +v 0.495700 -0.065300 0.000000 +v 0.483000 -0.129400 0.000000 +v 0.461900 -0.191300 0.000000 +v 0.433000 -0.250000 0.000000 +v 0.396700 -0.304400 0.000000 +v 0.353600 -0.353600 0.000000 +v 0.304400 -0.396700 0.000000 +v 0.250000 -0.433000 0.000000 +v 0.191300 -0.461900 0.000000 +v 0.129400 -0.483000 0.000000 +v 0.065300 -0.495700 0.000000 +v 0.000000 -0.500000 0.000000 +v 0.063000 0.495700 0.016900 +v 0.125000 0.483000 0.033500 +v 0.184800 0.461900 0.049500 +v 0.241500 0.433000 0.064700 +v 0.294000 0.396700 0.078800 +v 0.341500 0.353600 0.091500 +v 0.383200 0.304400 0.102700 +v 0.418300 0.250000 0.112100 +v 0.446200 0.191300 0.119600 +v 0.466500 0.129400 0.125000 +v 0.478800 0.065300 0.128300 +v 0.483000 0.000000 0.129400 +v 0.478800 -0.065300 0.128300 +v 0.466500 -0.129400 0.125000 +v 0.446200 -0.191300 0.119600 +v 0.418300 -0.250000 0.112100 +v 0.383200 -0.304400 0.102700 +v 0.341500 -0.353600 0.091500 +v 0.294000 -0.396700 0.078800 +v 0.241500 -0.433000 0.064700 +v 0.184800 -0.461900 0.049500 +v 0.125000 -0.483000 0.033500 +v 0.063000 -0.495700 0.016900 +v 0.056500 0.495700 0.032600 +v 0.112100 0.483000 0.064700 +v 0.165700 0.461900 0.095700 +v 0.216500 0.433000 0.125000 +v 0.263600 0.396700 0.152200 +v 0.306200 0.353600 0.176800 +v 0.343500 0.304400 0.198300 +v 0.375000 0.250000 0.216500 +v 0.400100 0.191300 0.231000 +v 0.418300 0.129400 0.241500 +v 0.429300 0.065300 0.247900 +v 0.433000 0.000000 0.250000 +v 0.429300 -0.065300 0.247900 +v 0.418300 -0.129400 0.241500 +v 0.400100 -0.191300 0.231000 +v 0.375000 -0.250000 0.216500 +v 0.343500 -0.304400 0.198300 +v 0.306200 -0.353600 0.176800 +v 0.263600 -0.396700 0.152200 +v 0.216500 -0.433000 0.125000 +v 0.165700 -0.461900 0.095700 +v 0.112100 -0.483000 0.064700 +v 0.056500 -0.495700 0.032600 +v 0.046100 0.495700 0.046100 +v 0.091500 0.483000 0.091500 +v 0.135300 0.461900 0.135300 +v 0.176800 0.433000 0.176800 +v 0.215200 0.396700 0.215200 +v 0.250000 0.353600 0.250000 +v 0.280500 0.304400 0.280500 +v 0.306200 0.250000 0.306200 +v 0.326600 0.191300 0.326600 +v 0.341500 0.129400 0.341500 +v 0.350500 0.065300 0.350500 +v 0.353600 0.000000 0.353600 +v 0.350500 -0.065300 0.350500 +v 0.341500 -0.129400 0.341500 +v 0.326600 -0.191300 0.326600 +v 0.306200 -0.250000 0.306200 +v 0.280500 -0.304400 0.280500 +v 0.250000 -0.353600 0.250000 +v 0.215200 -0.396700 0.215200 +v 0.176800 -0.433000 0.176800 +v 0.135300 -0.461900 0.135300 +v 0.091500 -0.483000 0.091500 +v 0.046100 -0.495700 0.046100 +v 0.032600 0.495700 0.056500 +v 0.064700 0.483000 0.112100 +v 0.095700 0.461900 0.165700 +v 0.125000 0.433000 0.216500 +v 0.152200 0.396700 0.263600 +v 0.176800 0.353600 0.306200 +v 0.198300 0.304400 0.343500 +v 0.216500 0.250000 0.375000 +v 0.231000 0.191300 0.400100 +v 0.241500 0.129400 0.418300 +v 0.247900 0.065300 0.429300 +v 0.250000 0.000000 0.433000 +v 0.247900 -0.065300 0.429300 +v 0.241500 -0.129400 0.418300 +v 0.231000 -0.191300 0.400100 +v 0.216500 -0.250000 0.375000 +v 0.198300 -0.304400 0.343500 +v 0.176800 -0.353600 0.306200 +v 0.152200 -0.396700 0.263600 +v 0.125000 -0.433000 0.216500 +v 0.095700 -0.461900 0.165700 +v 0.064700 -0.483000 0.112100 +v 0.032600 -0.495700 0.056500 +v 0.016900 0.495700 0.063000 +v 0.033500 0.483000 0.125000 +v 0.049500 0.461900 0.184800 +v 0.064700 0.433000 0.241500 +v 0.078800 0.396700 0.294000 +v 0.091500 0.353600 0.341500 +v 0.102700 0.304400 0.383200 +v 0.112100 0.250000 0.418300 +v 0.119600 0.191300 0.446200 +v 0.125000 0.129400 0.466500 +v 0.128300 0.065300 0.478800 +v 0.129400 0.000000 0.483000 +v 0.128300 -0.065300 0.478800 +v 0.125000 -0.129400 0.466500 +v 0.119600 -0.191300 0.446200 +v 0.112100 -0.250000 0.418300 +v 0.102700 -0.304400 0.383200 +v 0.091500 -0.353600 0.341500 +v 0.078800 -0.396700 0.294000 +v 0.064700 -0.433000 0.241500 +v 0.049500 -0.461900 0.184800 +v 0.033500 -0.483000 0.125000 +v 0.016900 -0.495700 0.063000 +v 0.000000 0.495700 0.065300 +v 0.000000 0.483000 0.129400 +v 0.000000 0.461900 0.191300 +v 0.000000 0.433000 0.250000 +v 0.000000 0.396700 0.304400 +v 0.000000 0.353600 0.353600 +v 0.000000 0.304400 0.396700 +v 0.000000 0.250000 0.433000 +v 0.000000 0.191300 0.461900 +v 0.000000 0.129400 0.483000 +v 0.000000 0.065300 0.495700 +v 0.000000 0.000000 0.500000 +v 0.000000 -0.065300 0.495700 +v 0.000000 -0.129400 0.483000 +v 0.000000 -0.191300 0.461900 +v 0.000000 -0.250000 0.433000 +v 0.000000 -0.304400 0.396700 +v 0.000000 -0.353600 0.353600 +v 0.000000 -0.396700 0.304400 +v 0.000000 -0.433000 0.250000 +v 0.000000 -0.461900 0.191300 +v 0.000000 -0.483000 0.129400 +v 0.000000 -0.495700 0.065300 +v -0.016900 0.495700 0.063000 +v -0.033500 0.483000 0.125000 +v -0.049500 0.461900 0.184800 +v -0.064700 0.433000 0.241500 +v -0.078800 0.396700 0.294000 +v -0.091500 0.353600 0.341500 +v -0.102700 0.304400 0.383200 +v -0.112100 0.250000 0.418300 +v -0.119600 0.191300 0.446200 +v -0.125000 0.129400 0.466500 +v -0.128300 0.065300 0.478800 +v -0.129400 0.000000 0.483000 +v -0.128300 -0.065300 0.478800 +v -0.125000 -0.129400 0.466500 +v -0.119600 -0.191300 0.446200 +v -0.112100 -0.250000 0.418300 +v -0.102700 -0.304400 0.383200 +v -0.091500 -0.353600 0.341500 +v -0.078800 -0.396700 0.294000 +v -0.064700 -0.433000 0.241500 +v -0.049500 -0.461900 0.184800 +v -0.033500 -0.483000 0.125000 +v -0.016900 -0.495700 0.063000 +v -0.032600 0.495700 0.056500 +v -0.064700 0.483000 0.112100 +v -0.095700 0.461900 0.165700 +v -0.125000 0.433000 0.216500 +v -0.152200 0.396700 0.263600 +v -0.176800 0.353600 0.306200 +v -0.198300 0.304400 0.343500 +v -0.216500 0.250000 0.375000 +v -0.231000 0.191300 0.400100 +v -0.241500 0.129400 0.418300 +v -0.247900 0.065300 0.429300 +v -0.250000 0.000000 0.433000 +v -0.247900 -0.065300 0.429300 +v -0.241500 -0.129400 0.418300 +v -0.231000 -0.191300 0.400100 +v -0.216500 -0.250000 0.375000 +v -0.198300 -0.304400 0.343500 +v -0.176800 -0.353600 0.306200 +v -0.152200 -0.396700 0.263600 +v -0.125000 -0.433000 0.216500 +v -0.095700 -0.461900 0.165700 +v -0.064700 -0.483000 0.112100 +v -0.032600 -0.495700 0.056500 +v -0.046100 0.495700 0.046100 +v -0.091500 0.483000 0.091500 +v -0.135300 0.461900 0.135300 +v -0.176800 0.433000 0.176800 +v -0.215200 0.396700 0.215200 +v -0.250000 0.353600 0.250000 +v -0.280500 0.304400 0.280500 +v -0.306200 0.250000 0.306200 +v -0.326600 0.191300 0.326600 +v -0.341500 0.129400 0.341500 +v -0.350500 0.065300 0.350500 +v -0.353600 0.000000 0.353600 +v -0.350500 -0.065300 0.350500 +v -0.341500 -0.129400 0.341500 +v -0.326600 -0.191300 0.326600 +v -0.306200 -0.250000 0.306200 +v -0.280500 -0.304400 0.280500 +v -0.250000 -0.353600 0.250000 +v -0.215200 -0.396700 0.215200 +v -0.176800 -0.433000 0.176800 +v -0.135300 -0.461900 0.135300 +v -0.091500 -0.483000 0.091500 +v -0.046100 -0.495700 0.046100 +v -0.056500 0.495700 0.032600 +v -0.112100 0.483000 0.064700 +v -0.165700 0.461900 0.095700 +v -0.216500 0.433000 0.125000 +v -0.263600 0.396700 0.152200 +v -0.306200 0.353600 0.176800 +v -0.343500 0.304400 0.198300 +v -0.375000 0.250000 0.216500 +v -0.400100 0.191300 0.231000 +v -0.418300 0.129400 0.241500 +v -0.429300 0.065300 0.247900 +v -0.433000 0.000000 0.250000 +v -0.429300 -0.065300 0.247900 +v -0.418300 -0.129400 0.241500 +v -0.400100 -0.191300 0.231000 +v -0.375000 -0.250000 0.216500 +v -0.343500 -0.304400 0.198300 +v -0.306200 -0.353600 0.176800 +v -0.263600 -0.396700 0.152200 +v -0.216500 -0.433000 0.125000 +v -0.165700 -0.461900 0.095700 +v -0.112100 -0.483000 0.064700 +v -0.056500 -0.495700 0.032600 +v -0.063000 0.495700 0.016900 +v -0.125000 0.483000 0.033500 +v -0.184800 0.461900 0.049500 +v -0.241500 0.433000 0.064700 +v -0.294000 0.396700 0.078800 +v -0.341500 0.353600 0.091500 +v -0.383200 0.304400 0.102700 +v -0.418300 0.250000 0.112100 +v -0.446200 0.191300 0.119600 +v -0.466500 0.129400 0.125000 +v -0.478800 0.065300 0.128300 +v -0.483000 0.000000 0.129400 +v -0.478800 -0.065300 0.128300 +v -0.466500 -0.129400 0.125000 +v -0.446200 -0.191300 0.119600 +v -0.418300 -0.250000 0.112100 +v -0.383200 -0.304400 0.102700 +v -0.341500 -0.353600 0.091500 +v -0.294000 -0.396700 0.078800 +v -0.241500 -0.433000 0.064700 +v -0.184800 -0.461900 0.049500 +v -0.125000 -0.483000 0.033500 +v -0.063000 -0.495700 0.016900 +v -0.065300 0.495700 -0.000000 +v -0.129400 0.483000 -0.000000 +v -0.191300 0.461900 -0.000000 +v -0.250000 0.433000 -0.000000 +v -0.304400 0.396700 -0.000000 +v -0.353600 0.353600 -0.000000 +v -0.396700 0.304400 -0.000000 +v -0.433000 0.250000 -0.000000 +v -0.461900 0.191300 -0.000000 +v -0.483000 0.129400 -0.000000 +v -0.495700 0.065300 -0.000000 +v -0.500000 0.000000 0.000000 +v -0.495700 -0.065300 0.000000 +v -0.483000 -0.129400 0.000000 +v -0.461900 -0.191300 0.000000 +v -0.433000 -0.250000 0.000000 +v -0.396700 -0.304400 0.000000 +v -0.353600 -0.353600 0.000000 +v -0.304400 -0.396700 0.000000 +v -0.250000 -0.433000 0.000000 +v -0.191300 -0.461900 0.000000 +v -0.129400 -0.483000 0.000000 +v -0.065300 -0.495700 0.000000 +v -0.063000 0.495700 -0.016900 +v -0.125000 0.483000 -0.033500 +v -0.184800 0.461900 -0.049500 +v -0.241500 0.433000 -0.064700 +v -0.294000 0.396700 -0.078800 +v -0.341500 0.353600 -0.091500 +v -0.383200 0.304400 -0.102700 +v -0.418300 0.250000 -0.112100 +v -0.446200 0.191300 -0.119600 +v -0.466500 0.129400 -0.125000 +v -0.478800 0.065300 -0.128300 +v -0.483000 -0.000000 -0.129400 +v -0.478800 -0.065300 -0.128300 +v -0.466500 -0.129400 -0.125000 +v -0.446200 -0.191300 -0.119600 +v -0.418300 -0.250000 -0.112100 +v -0.383200 -0.304400 -0.102700 +v -0.341500 -0.353600 -0.091500 +v -0.294000 -0.396700 -0.078800 +v -0.241500 -0.433000 -0.064700 +v -0.184800 -0.461900 -0.049500 +v -0.125000 -0.483000 -0.033500 +v -0.063000 -0.495700 -0.016900 +v -0.056500 0.495700 -0.032600 +v -0.112100 0.483000 -0.064700 +v -0.165700 0.461900 -0.095700 +v -0.216500 0.433000 -0.125000 +v -0.263600 0.396700 -0.152200 +v -0.306200 0.353600 -0.176800 +v -0.343500 0.304400 -0.198300 +v -0.375000 0.250000 -0.216500 +v -0.400100 0.191300 -0.231000 +v -0.418300 0.129400 -0.241500 +v -0.429300 0.065300 -0.247900 +v -0.433000 -0.000000 -0.250000 +v -0.429300 -0.065300 -0.247900 +v -0.418300 -0.129400 -0.241500 +v -0.400100 -0.191300 -0.231000 +v -0.375000 -0.250000 -0.216500 +v -0.343500 -0.304400 -0.198300 +v -0.306200 -0.353600 -0.176800 +v -0.263600 -0.396700 -0.152200 +v -0.216500 -0.433000 -0.125000 +v -0.165700 -0.461900 -0.095700 +v -0.112100 -0.483000 -0.064700 +v -0.056500 -0.495700 -0.032600 +v -0.046100 0.495700 -0.046100 +v -0.091500 0.483000 -0.091500 +v -0.135300 0.461900 -0.135300 +v -0.176800 0.433000 -0.176800 +v -0.215200 0.396700 -0.215200 +v -0.250000 0.353600 -0.250000 +v -0.280500 0.304400 -0.280500 +v -0.306200 0.250000 -0.306200 +v -0.326600 0.191300 -0.326600 +v -0.341500 0.129400 -0.341500 +v -0.350500 0.065300 -0.350500 +v -0.353600 -0.000000 -0.353600 +v -0.350500 -0.065300 -0.350500 +v -0.341500 -0.129400 -0.341500 +v -0.326600 -0.191300 -0.326600 +v -0.306200 -0.250000 -0.306200 +v -0.280500 -0.304400 -0.280500 +v -0.250000 -0.353600 -0.250000 +v -0.215200 -0.396700 -0.215200 +v -0.176800 -0.433000 -0.176800 +v -0.135300 -0.461900 -0.135300 +v -0.091500 -0.483000 -0.091500 +v -0.046100 -0.495700 -0.046100 +v -0.032600 0.495700 -0.056500 +v -0.064700 0.483000 -0.112100 +v -0.095700 0.461900 -0.165700 +v -0.125000 0.433000 -0.216500 +v -0.152200 0.396700 -0.263600 +v -0.176800 0.353600 -0.306200 +v -0.198300 0.304400 -0.343500 +v -0.216500 0.250000 -0.375000 +v -0.231000 0.191300 -0.400100 +v -0.241500 0.129400 -0.418300 +v -0.247900 0.065300 -0.429300 +v -0.250000 -0.000000 -0.433000 +v -0.247900 -0.065300 -0.429300 +v -0.241500 -0.129400 -0.418300 +v -0.231000 -0.191300 -0.400100 +v -0.216500 -0.250000 -0.375000 +v -0.198300 -0.304400 -0.343500 +v -0.176800 -0.353600 -0.306200 +v -0.152200 -0.396700 -0.263600 +v -0.125000 -0.433000 -0.216500 +v -0.095700 -0.461900 -0.165700 +v -0.064700 -0.483000 -0.112100 +v -0.032600 -0.495700 -0.056500 +v -0.016900 0.495700 -0.063000 +v -0.033500 0.483000 -0.125000 +v -0.049500 0.461900 -0.184800 +v -0.064700 0.433000 -0.241500 +v -0.078800 0.396700 -0.294000 +v -0.091500 0.353600 -0.341500 +v -0.102700 0.304400 -0.383200 +v -0.112100 0.250000 -0.418300 +v -0.119600 0.191300 -0.446200 +v -0.125000 0.129400 -0.466500 +v -0.128300 0.065300 -0.478800 +v -0.129400 -0.000000 -0.483000 +v -0.128300 -0.065300 -0.478800 +v -0.125000 -0.129400 -0.466500 +v -0.119600 -0.191300 -0.446200 +v -0.112100 -0.250000 -0.418300 +v -0.102700 -0.304400 -0.383200 +v -0.091500 -0.353600 -0.341500 +v -0.078800 -0.396700 -0.294000 +v -0.064700 -0.433000 -0.241500 +v -0.049500 -0.461900 -0.184800 +v -0.033500 -0.483000 -0.125000 +v -0.016900 -0.495700 -0.063000 +v 0.000000 0.495700 -0.065300 +v 0.000000 0.483000 -0.129400 +v 0.000000 0.461900 -0.191300 +v 0.000000 0.433000 -0.250000 +v 0.000000 0.396700 -0.304400 +v 0.000000 0.353600 -0.353600 +v 0.000000 0.304400 -0.396700 +v 0.000000 0.250000 -0.433000 +v 0.000000 0.191300 -0.461900 +v 0.000000 0.129400 -0.483000 +v 0.000000 0.065300 -0.495700 +v 0.000000 -0.000000 -0.500000 +v 0.000000 -0.065300 -0.495700 +v 0.000000 -0.129400 -0.483000 +v 0.000000 -0.191300 -0.461900 +v 0.000000 -0.250000 -0.433000 +v 0.000000 -0.304400 -0.396700 +v 0.000000 -0.353600 -0.353600 +v 0.000000 -0.396700 -0.304400 +v 0.000000 -0.433000 -0.250000 +v 0.000000 -0.461900 -0.191300 +v 0.000000 -0.483000 -0.129400 +v 0.000000 -0.495700 -0.065300 +v 0.016900 0.495700 -0.063000 +v 0.033500 0.483000 -0.125000 +v 0.049500 0.461900 -0.184800 +v 0.064700 0.433000 -0.241500 +v 0.078800 0.396700 -0.294000 +v 0.091500 0.353600 -0.341500 +v 0.102700 0.304400 -0.383200 +v 0.112100 0.250000 -0.418300 +v 0.119600 0.191300 -0.446200 +v 0.125000 0.129400 -0.466500 +v 0.128300 0.065300 -0.478800 +v 0.129400 -0.000000 -0.483000 +v 0.128300 -0.065300 -0.478800 +v 0.125000 -0.129400 -0.466500 +v 0.119600 -0.191300 -0.446200 +v 0.112100 -0.250000 -0.418300 +v 0.102700 -0.304400 -0.383200 +v 0.091500 -0.353600 -0.341500 +v 0.078800 -0.396700 -0.294000 +v 0.064700 -0.433000 -0.241500 +v 0.049500 -0.461900 -0.184800 +v 0.033500 -0.483000 -0.125000 +v 0.016900 -0.495700 -0.063000 +v 0.032600 0.495700 -0.056500 +v 0.064700 0.483000 -0.112100 +v 0.095700 0.461900 -0.165700 +v 0.125000 0.433000 -0.216500 +v 0.152200 0.396700 -0.263600 +v 0.176800 0.353600 -0.306200 +v 0.198300 0.304400 -0.343500 +v 0.216500 0.250000 -0.375000 +v 0.231000 0.191300 -0.400100 +v 0.241500 0.129400 -0.418300 +v 0.247900 0.065300 -0.429300 +v 0.250000 -0.000000 -0.433000 +v 0.247900 -0.065300 -0.429300 +v 0.241500 -0.129400 -0.418300 +v 0.231000 -0.191300 -0.400100 +v 0.216500 -0.250000 -0.375000 +v 0.198300 -0.304400 -0.343500 +v 0.176800 -0.353600 -0.306200 +v 0.152200 -0.396700 -0.263600 +v 0.125000 -0.433000 -0.216500 +v 0.095700 -0.461900 -0.165700 +v 0.064700 -0.483000 -0.112100 +v 0.032600 -0.495700 -0.056500 +v 0.046100 0.495700 -0.046100 +v 0.091500 0.483000 -0.091500 +v 0.135300 0.461900 -0.135300 +v 0.176800 0.433000 -0.176800 +v 0.215200 0.396700 -0.215200 +v 0.250000 0.353600 -0.250000 +v 0.280500 0.304400 -0.280500 +v 0.306200 0.250000 -0.306200 +v 0.326600 0.191300 -0.326600 +v 0.341500 0.129400 -0.341500 +v 0.350500 0.065300 -0.350500 +v 0.353600 -0.000000 -0.353600 +v 0.350500 -0.065300 -0.350500 +v 0.341500 -0.129400 -0.341500 +v 0.326600 -0.191300 -0.326600 +v 0.306200 -0.250000 -0.306200 +v 0.280500 -0.304400 -0.280500 +v 0.250000 -0.353600 -0.250000 +v 0.215200 -0.396700 -0.215200 +v 0.176800 -0.433000 -0.176800 +v 0.135300 -0.461900 -0.135300 +v 0.091500 -0.483000 -0.091500 +v 0.046100 -0.495700 -0.046100 +v 0.056500 0.495700 -0.032600 +v 0.112100 0.483000 -0.064700 +v 0.165700 0.461900 -0.095700 +v 0.216500 0.433000 -0.125000 +v 0.263600 0.396700 -0.152200 +v 0.306200 0.353600 -0.176800 +v 0.343500 0.304400 -0.198300 +v 0.375000 0.250000 -0.216500 +v 0.400100 0.191300 -0.231000 +v 0.418300 0.129400 -0.241500 +v 0.429300 0.065300 -0.247900 +v 0.433000 -0.000000 -0.250000 +v 0.429300 -0.065300 -0.247900 +v 0.418300 -0.129400 -0.241500 +v 0.400100 -0.191300 -0.231000 +v 0.375000 -0.250000 -0.216500 +v 0.343500 -0.304400 -0.198300 +v 0.306200 -0.353600 -0.176800 +v 0.263600 -0.396700 -0.152200 +v 0.216500 -0.433000 -0.125000 +v 0.165700 -0.461900 -0.095700 +v 0.112100 -0.483000 -0.064700 +v 0.056500 -0.495700 -0.032600 +v 0.063000 0.495700 -0.016900 +v 0.125000 0.483000 -0.033500 +v 0.184800 0.461900 -0.049500 +v 0.241500 0.433000 -0.064700 +v 0.294000 0.396700 -0.078800 +v 0.341500 0.353600 -0.091500 +v 0.383200 0.304400 -0.102700 +v 0.418300 0.250000 -0.112100 +v 0.446200 0.191300 -0.119600 +v 0.466500 0.129400 -0.125000 +v 0.478800 0.065300 -0.128300 +v 0.483000 -0.000000 -0.129400 +v 0.478800 -0.065300 -0.128300 +v 0.466500 -0.129400 -0.125000 +v 0.446200 -0.191300 -0.119600 +v 0.418300 -0.250000 -0.112100 +v 0.383200 -0.304400 -0.102700 +v 0.341500 -0.353600 -0.091500 +v 0.294000 -0.396700 -0.078800 +v 0.241500 -0.433000 -0.064700 +v 0.184800 -0.461900 -0.049500 +v 0.125000 -0.483000 -0.033500 +v 0.063000 -0.495700 -0.016900 +vn 0.000000 1.000000 0.000000 +vn 0.130700 0.990800 0.035300 +vn 0.135700 0.990700 -0.000100 +vn 0.255100 0.964500 0.068300 +vn 0.264100 0.964500 -0.000000 +vn 0.374400 0.921800 0.100200 +vn 0.387500 0.921800 0.000000 +vn 0.486500 0.863900 0.130300 +vn 0.503500 0.863900 0.000000 +vn 0.591000 0.790900 0.158400 +vn 0.611700 0.791000 0.000100 +vn 0.685400 0.704500 0.183900 +vn 0.709800 0.704400 -0.000100 +vn 0.768100 0.606200 0.206100 +vn 0.795600 0.605800 -0.000100 +vn 0.838000 0.497300 0.224400 +vn 0.867700 0.497100 0.000000 +vn 0.893400 0.380400 0.239000 +vn 0.924600 0.381000 0.000100 +vn 0.933400 0.257400 0.249900 +vn 0.966200 0.257600 0.000000 +vn 0.957700 0.130000 0.256700 +vn 0.991500 0.129700 -0.000100 +vn 0.965900 0.000000 0.258800 +vn 1.000000 0.000000 0.000000 +vn 0.957700 -0.130100 0.256400 +vn 0.991500 -0.129700 0.000100 +vn 0.933400 -0.257300 0.250000 +vn 0.966200 -0.257600 -0.000000 +vn 0.893200 -0.380600 0.239300 +vn 0.924600 -0.381000 -0.000100 +vn 0.838000 -0.497300 0.224600 +vn 0.867700 -0.497100 0.000000 +vn 0.768200 -0.606100 0.206000 +vn 0.795600 -0.605800 0.000100 +vn 0.685400 -0.704600 0.183600 +vn 0.709800 -0.704400 0.000100 +vn 0.591000 -0.790900 0.158500 +vn 0.611700 -0.791000 -0.000100 +vn 0.486500 -0.863900 0.130400 +vn 0.503500 -0.863900 -0.000000 +vn 0.374300 -0.921800 0.100100 +vn 0.387500 -0.921800 0.000000 +vn 0.255100 -0.964500 0.068200 +vn 0.264100 -0.964500 0.000000 +vn 0.130800 -0.990800 0.035300 +vn 0.135700 -0.990700 0.000100 +vn 0.000000 -1.000000 0.000000 +vn 0.117300 0.990800 0.067800 +vn 0.228600 0.964500 0.132000 +vn 0.335800 0.921800 0.193700 +vn 0.436200 0.863900 0.251800 +vn 0.529700 0.791000 0.306000 +vn 0.614900 0.704200 0.354900 +vn 0.688900 0.606000 0.397800 +vn 0.750800 0.497900 0.433900 +vn 0.800500 0.381000 0.462500 +vn 0.836900 0.257300 0.483100 +vn 0.858700 0.129600 0.495700 +vn 0.866100 -0.000000 0.499900 +vn 0.858600 -0.129500 0.496000 +vn 0.836800 -0.257400 0.483200 +vn 0.800700 -0.380800 0.462400 +vn 0.751000 -0.497900 0.433500 +vn 0.688900 -0.605900 0.397800 +vn 0.614700 -0.704200 0.355100 +vn 0.529800 -0.790900 0.306000 +vn 0.436200 -0.863900 0.251700 +vn 0.335700 -0.921800 0.193800 +vn 0.228600 -0.964500 0.132000 +vn 0.117300 -0.990800 0.067800 +vn 0.095700 0.990800 0.095800 +vn 0.186600 0.964500 0.186700 +vn 0.274000 0.921800 0.274100 +vn 0.356300 0.863800 0.356200 +vn 0.432700 0.790900 0.432600 +vn 0.501700 0.704500 0.501900 +vn 0.562400 0.606000 0.562500 +vn 0.613700 0.497200 0.613300 +vn 0.653900 0.380700 0.653800 +vn 0.683200 0.257600 0.683300 +vn 0.700900 0.130300 0.701200 +vn 0.707100 0.000000 0.707100 +vn 0.701200 -0.130300 0.700900 +vn 0.683300 -0.257600 0.683200 +vn 0.653800 -0.380700 0.653900 +vn 0.613300 -0.497200 0.613700 +vn 0.562500 -0.606000 0.562400 +vn 0.501900 -0.704500 0.501700 +vn 0.432600 -0.790900 0.432700 +vn 0.356200 -0.863800 0.356300 +vn 0.274100 -0.921800 0.274000 +vn 0.186700 -0.964500 0.186600 +vn 0.095800 -0.990800 0.095700 +vn 0.067800 0.990800 0.117300 +vn 0.132000 0.964500 0.228600 +vn 0.193800 0.921800 0.335700 +vn 0.251700 0.863900 0.436200 +vn 0.306000 0.790900 0.529800 +vn 0.355100 0.704200 0.614700 +vn 0.397800 0.605900 0.688900 +vn 0.433500 0.497900 0.751000 +vn 0.462400 0.380800 0.800700 +vn 0.483200 0.257400 0.836800 +vn 0.496000 0.129500 0.858600 +vn 0.499900 0.000000 0.866100 +vn 0.495700 -0.129600 0.858700 +vn 0.483100 -0.257300 0.836900 +vn 0.462500 -0.381000 0.800500 +vn 0.433900 -0.497900 0.750800 +vn 0.397800 -0.606000 0.688900 +vn 0.354900 -0.704200 0.614900 +vn 0.306000 -0.791000 0.529700 +vn 0.251800 -0.863900 0.436200 +vn 0.193700 -0.921800 0.335800 +vn 0.132000 -0.964500 0.228600 +vn 0.067800 -0.990800 0.117300 +vn 0.035300 0.990800 0.130800 +vn 0.068200 0.964500 0.255100 +vn 0.100100 0.921800 0.374300 +vn 0.130400 0.863900 0.486500 +vn 0.158500 0.790900 0.591000 +vn 0.183600 0.704600 0.685400 +vn 0.206000 0.606100 0.768200 +vn 0.224600 0.497300 0.838000 +vn 0.239300 0.380600 0.893200 +vn 0.250000 0.257300 0.933400 +vn 0.256400 0.130100 0.957700 +vn 0.258800 -0.000000 0.965900 +vn 0.256700 -0.130000 0.957700 +vn 0.249900 -0.257400 0.933400 +vn 0.239000 -0.380400 0.893400 +vn 0.224400 -0.497300 0.838000 +vn 0.206100 -0.606200 0.768100 +vn 0.183900 -0.704500 0.685400 +vn 0.158400 -0.790900 0.591000 +vn 0.130300 -0.863900 0.486500 +vn 0.100200 -0.921800 0.374400 +vn 0.068200 -0.964500 0.255100 +vn 0.035300 -0.990800 0.130700 +vn 0.000100 0.990700 0.135700 +vn 0.000000 0.964500 0.264100 +vn 0.000000 0.921800 0.387500 +vn -0.000000 0.863900 0.503500 +vn -0.000100 0.791000 0.611700 +vn 0.000100 0.704400 0.709800 +vn 0.000100 0.605800 0.795600 +vn 0.000000 0.497100 0.867700 +vn -0.000100 0.381000 0.924600 +vn -0.000000 0.257600 0.966200 +vn 0.000100 0.129700 0.991500 +vn 0.000000 0.000000 1.000000 +vn -0.000100 -0.129700 0.991500 +vn 0.000000 -0.257600 0.966200 +vn 0.000100 -0.381000 0.924600 +vn 0.000000 -0.497100 0.867700 +vn -0.000100 -0.605800 0.795600 +vn -0.000100 -0.704400 0.709800 +vn 0.000100 -0.791000 0.611700 +vn 0.000000 -0.863900 0.503500 +vn 0.000000 -0.921800 0.387500 +vn -0.000000 -0.964500 0.264100 +vn -0.000100 -0.990700 0.135700 +vn -0.035300 0.990800 0.130700 +vn -0.068200 0.964500 0.255100 +vn -0.100200 0.921800 0.374400 +vn -0.130300 0.863900 0.486500 +vn -0.158400 0.790900 0.591000 +vn -0.183900 0.704500 0.685400 +vn -0.206100 0.606200 0.768100 +vn -0.224400 0.497300 0.838000 +vn -0.239000 0.380400 0.893400 +vn -0.249900 0.257400 0.933400 +vn -0.256700 0.130000 0.957700 +vn -0.258800 0.000000 0.965900 +vn -0.256400 -0.130100 0.957700 +vn -0.250000 -0.257300 0.933400 +vn -0.239300 -0.380600 0.893200 +vn -0.224600 -0.497300 0.838000 +vn -0.206000 -0.606100 0.768200 +vn -0.183600 -0.704600 0.685400 +vn -0.158500 -0.790900 0.591000 +vn -0.130400 -0.863900 0.486500 +vn -0.100100 -0.921800 0.374300 +vn -0.068200 -0.964500 0.255100 +vn -0.035300 -0.990800 0.130800 +vn -0.067800 0.990800 0.117300 +vn -0.132000 0.964500 0.228600 +vn -0.193700 0.921800 0.335800 +vn -0.251800 0.863900 0.436200 +vn -0.306000 0.791000 0.529700 +vn -0.354900 0.704200 0.614900 +vn -0.397800 0.606000 0.688900 +vn -0.433900 0.497900 0.750800 +vn -0.462500 0.381000 0.800500 +vn -0.483100 0.257300 0.836900 +vn -0.495700 0.129600 0.858700 +vn -0.499900 -0.000000 0.866100 +vn -0.496000 -0.129500 0.858600 +vn -0.483200 -0.257400 0.836800 +vn -0.462400 -0.380800 0.800700 +vn -0.433500 -0.497900 0.751000 +vn -0.397800 -0.605900 0.688900 +vn -0.355100 -0.704200 0.614700 +vn -0.306000 -0.790900 0.529800 +vn -0.251700 -0.863900 0.436200 +vn -0.193800 -0.921800 0.335700 +vn -0.132000 -0.964500 0.228600 +vn -0.067800 -0.990800 0.117300 +vn -0.095800 0.990800 0.095700 +vn -0.186700 0.964500 0.186600 +vn -0.274100 0.921800 0.274000 +vn -0.356200 0.863800 0.356300 +vn -0.432600 0.790900 0.432700 +vn -0.501900 0.704500 0.501700 +vn -0.562500 0.606000 0.562400 +vn -0.613300 0.497200 0.613700 +vn -0.653800 0.380700 0.653900 +vn -0.683300 0.257600 0.683200 +vn -0.701200 0.130300 0.700900 +vn -0.707100 0.000000 0.707100 +vn -0.700900 -0.130300 0.701200 +vn -0.683200 -0.257600 0.683300 +vn -0.653900 -0.380700 0.653800 +vn -0.613700 -0.497200 0.613300 +vn -0.562400 -0.606000 0.562500 +vn -0.501700 -0.704500 0.501900 +vn -0.432700 -0.790900 0.432600 +vn -0.356300 -0.863800 0.356200 +vn -0.274000 -0.921800 0.274100 +vn -0.186600 -0.964500 0.186700 +vn -0.095700 -0.990800 0.095800 +vn -0.117300 0.990800 0.067800 +vn -0.228600 0.964500 0.132000 +vn -0.335700 0.921800 0.193800 +vn -0.436200 0.863900 0.251700 +vn -0.529800 0.790900 0.306000 +vn -0.614700 0.704200 0.355100 +vn -0.688900 0.605900 0.397800 +vn -0.751000 0.497900 0.433500 +vn -0.800700 0.380800 0.462400 +vn -0.836800 0.257400 0.483200 +vn -0.858600 0.129500 0.496000 +vn -0.866100 0.000000 0.499900 +vn -0.858700 -0.129600 0.495700 +vn -0.836900 -0.257300 0.483100 +vn -0.800500 -0.381000 0.462500 +vn -0.750800 -0.497900 0.433900 +vn -0.688900 -0.606000 0.397800 +vn -0.614900 -0.704200 0.354900 +vn -0.529700 -0.791000 0.306000 +vn -0.436200 -0.863900 0.251800 +vn -0.335800 -0.921800 0.193700 +vn -0.228600 -0.964500 0.132000 +vn -0.117300 -0.990800 0.067800 +vn -0.130800 0.990800 0.035300 +vn -0.255100 0.964500 0.068200 +vn -0.374300 0.921800 0.100100 +vn -0.486500 0.863900 0.130400 +vn -0.591000 0.790900 0.158500 +vn -0.685400 0.704600 0.183600 +vn -0.768200 0.606100 0.206000 +vn -0.838000 0.497300 0.224600 +vn -0.893200 0.380600 0.239300 +vn -0.933400 0.257300 0.250000 +vn -0.957700 0.130100 0.256400 +vn -0.965900 -0.000000 0.258800 +vn -0.957700 -0.130000 0.256700 +vn -0.933400 -0.257400 0.249900 +vn -0.893400 -0.380400 0.239000 +vn -0.838000 -0.497300 0.224400 +vn -0.768100 -0.606200 0.206100 +vn -0.685400 -0.704500 0.183900 +vn -0.591000 -0.790900 0.158400 +vn -0.486500 -0.863900 0.130300 +vn -0.374400 -0.921800 0.100200 +vn -0.255100 -0.964500 0.068300 +vn -0.130700 -0.990800 0.035300 +vn -0.135700 0.990700 0.000100 +vn -0.264100 0.964500 0.000000 +vn -0.387500 0.921800 0.000000 +vn -0.503500 0.863900 -0.000000 +vn -0.611700 0.791000 -0.000100 +vn -0.709800 0.704400 0.000100 +vn -0.795600 0.605800 0.000100 +vn -0.867700 0.497100 0.000000 +vn -0.924600 0.381000 -0.000100 +vn -0.966200 0.257600 -0.000000 +vn -0.991500 0.129700 0.000100 +vn -1.000000 0.000000 0.000000 +vn -0.991500 -0.129700 -0.000100 +vn -0.966200 -0.257600 0.000000 +vn -0.924600 -0.381000 0.000100 +vn -0.867700 -0.497100 0.000000 +vn -0.795600 -0.605800 -0.000100 +vn -0.709800 -0.704400 -0.000100 +vn -0.611700 -0.791000 0.000100 +vn -0.503500 -0.863900 0.000000 +vn -0.387500 -0.921800 0.000000 +vn -0.264100 -0.964500 -0.000000 +vn -0.135700 -0.990700 -0.000100 +vn -0.130700 0.990800 -0.035300 +vn -0.255100 0.964500 -0.068300 +vn -0.374400 0.921800 -0.100200 +vn -0.486500 0.863900 -0.130300 +vn -0.591000 0.790900 -0.158400 +vn -0.685400 0.704500 -0.183900 +vn -0.768100 0.606200 -0.206100 +vn -0.838000 0.497300 -0.224400 +vn -0.893400 0.380400 -0.239000 +vn -0.933400 0.257400 -0.249900 +vn -0.957700 0.130000 -0.256700 +vn -0.965900 0.000000 -0.258800 +vn -0.957700 -0.130100 -0.256400 +vn -0.933400 -0.257300 -0.250000 +vn -0.893200 -0.380600 -0.239300 +vn -0.838000 -0.497300 -0.224600 +vn -0.768200 -0.606100 -0.206000 +vn -0.685400 -0.704600 -0.183600 +vn -0.591000 -0.790900 -0.158500 +vn -0.486500 -0.863900 -0.130400 +vn -0.374300 -0.921800 -0.100100 +vn -0.255100 -0.964500 -0.068200 +vn -0.130800 -0.990800 -0.035300 +vn -0.117300 0.990800 -0.067800 +vn -0.228600 0.964500 -0.132000 +vn -0.335800 0.921800 -0.193700 +vn -0.436200 0.863900 -0.251800 +vn -0.529700 0.791000 -0.306000 +vn -0.614900 0.704200 -0.354900 +vn -0.688900 0.606000 -0.397800 +vn -0.750800 0.497900 -0.433900 +vn -0.800500 0.381000 -0.462500 +vn -0.836900 0.257300 -0.483100 +vn -0.858700 0.129600 -0.495700 +vn -0.866100 -0.000000 -0.499900 +vn -0.858600 -0.129500 -0.496000 +vn -0.836800 -0.257400 -0.483200 +vn -0.800700 -0.380800 -0.462400 +vn -0.751000 -0.497900 -0.433500 +vn -0.688900 -0.605900 -0.397800 +vn -0.614700 -0.704200 -0.355100 +vn -0.529800 -0.790900 -0.306000 +vn -0.436200 -0.863900 -0.251700 +vn -0.335700 -0.921800 -0.193800 +vn -0.228600 -0.964500 -0.132000 +vn -0.117300 -0.990800 -0.067800 +vn -0.095700 0.990800 -0.095800 +vn -0.186600 0.964500 -0.186700 +vn -0.274000 0.921800 -0.274100 +vn -0.356300 0.863800 -0.356200 +vn -0.432700 0.790900 -0.432600 +vn -0.501700 0.704500 -0.501900 +vn -0.562400 0.606000 -0.562500 +vn -0.613700 0.497200 -0.613300 +vn -0.653900 0.380700 -0.653800 +vn -0.683200 0.257600 -0.683300 +vn -0.700900 0.130300 -0.701200 +vn -0.707100 0.000000 -0.707100 +vn -0.701200 -0.130300 -0.700900 +vn -0.683300 -0.257600 -0.683200 +vn -0.653800 -0.380700 -0.653900 +vn -0.613300 -0.497200 -0.613700 +vn -0.562500 -0.606000 -0.562400 +vn -0.501900 -0.704500 -0.501700 +vn -0.432600 -0.790900 -0.432700 +vn -0.356200 -0.863800 -0.356300 +vn -0.274100 -0.921800 -0.274000 +vn -0.186700 -0.964500 -0.186600 +vn -0.095800 -0.990800 -0.095700 +vn -0.067800 0.990800 -0.117300 +vn -0.132000 0.964500 -0.228600 +vn -0.193800 0.921800 -0.335700 +vn -0.251700 0.863900 -0.436200 +vn -0.306000 0.790900 -0.529800 +vn -0.355100 0.704200 -0.614700 +vn -0.397800 0.605900 -0.688900 +vn -0.433500 0.497900 -0.751000 +vn -0.462400 0.380800 -0.800700 +vn -0.483200 0.257400 -0.836800 +vn -0.496000 0.129500 -0.858600 +vn -0.499900 0.000000 -0.866100 +vn -0.495700 -0.129600 -0.858700 +vn -0.483100 -0.257300 -0.836900 +vn -0.462500 -0.381000 -0.800500 +vn -0.433900 -0.497900 -0.750800 +vn -0.397800 -0.606000 -0.688900 +vn -0.354900 -0.704200 -0.614900 +vn -0.306000 -0.791000 -0.529700 +vn -0.251800 -0.863900 -0.436200 +vn -0.193700 -0.921800 -0.335800 +vn -0.132000 -0.964500 -0.228600 +vn -0.067800 -0.990800 -0.117300 +vn -0.035300 0.990800 -0.130800 +vn -0.068200 0.964500 -0.255100 +vn -0.100100 0.921800 -0.374300 +vn -0.130400 0.863900 -0.486500 +vn -0.158500 0.790900 -0.591000 +vn -0.183600 0.704600 -0.685400 +vn -0.206000 0.606100 -0.768200 +vn -0.224600 0.497300 -0.838000 +vn -0.239300 0.380600 -0.893200 +vn -0.250000 0.257300 -0.933400 +vn -0.256400 0.130100 -0.957700 +vn -0.258800 -0.000000 -0.965900 +vn -0.256700 -0.130000 -0.957700 +vn -0.249900 -0.257400 -0.933400 +vn -0.239000 -0.380400 -0.893400 +vn -0.224400 -0.497300 -0.838000 +vn -0.206100 -0.606200 -0.768100 +vn -0.183900 -0.704500 -0.685400 +vn -0.158400 -0.790900 -0.591000 +vn -0.130300 -0.863900 -0.486500 +vn -0.100200 -0.921800 -0.374400 +vn -0.068200 -0.964500 -0.255100 +vn -0.035300 -0.990800 -0.130700 +vn -0.000100 0.990700 -0.135700 +vn -0.000000 0.964500 -0.264100 +vn 0.000000 0.921800 -0.387500 +vn 0.000000 0.863900 -0.503500 +vn 0.000100 0.791000 -0.611700 +vn -0.000100 0.704400 -0.709800 +vn -0.000100 0.605800 -0.795600 +vn 0.000000 0.497100 -0.867700 +vn 0.000100 0.381000 -0.924600 +vn 0.000000 0.257600 -0.966200 +vn -0.000100 0.129700 -0.991500 +vn 0.000000 0.000000 -1.000000 +vn 0.000100 -0.129700 -0.991500 +vn -0.000000 -0.257600 -0.966200 +vn -0.000100 -0.381000 -0.924600 +vn 0.000000 -0.497100 -0.867700 +vn 0.000100 -0.605800 -0.795600 +vn 0.000100 -0.704400 -0.709800 +vn -0.000100 -0.791000 -0.611700 +vn -0.000000 -0.863900 -0.503500 +vn 0.000000 -0.921800 -0.387500 +vn 0.000000 -0.964500 -0.264100 +vn 0.000100 -0.990700 -0.135700 +vn 0.035300 0.990800 -0.130700 +vn 0.068200 0.964500 -0.255100 +vn 0.100200 0.921800 -0.374400 +vn 0.130300 0.863900 -0.486500 +vn 0.158400 0.790900 -0.591000 +vn 0.183900 0.704500 -0.685400 +vn 0.206100 0.606200 -0.768100 +vn 0.224400 0.497300 -0.838000 +vn 0.239000 0.380400 -0.893400 +vn 0.249900 0.257400 -0.933400 +vn 0.256700 0.130000 -0.957700 +vn 0.258800 0.000000 -0.965900 +vn 0.256400 -0.130100 -0.957700 +vn 0.250000 -0.257300 -0.933400 +vn 0.239300 -0.380600 -0.893200 +vn 0.224600 -0.497300 -0.838000 +vn 0.206000 -0.606100 -0.768200 +vn 0.183600 -0.704600 -0.685400 +vn 0.158500 -0.790900 -0.591000 +vn 0.130400 -0.863900 -0.486500 +vn 0.100100 -0.921800 -0.374300 +vn 0.068200 -0.964500 -0.255100 +vn 0.035300 -0.990800 -0.130800 +vn 0.067800 0.990800 -0.117300 +vn 0.132000 0.964500 -0.228600 +vn 0.193700 0.921800 -0.335800 +vn 0.251800 0.863900 -0.436200 +vn 0.306000 0.791000 -0.529700 +vn 0.354900 0.704200 -0.614900 +vn 0.397800 0.606000 -0.688900 +vn 0.433900 0.497900 -0.750800 +vn 0.462500 0.381000 -0.800500 +vn 0.483100 0.257300 -0.836900 +vn 0.495700 0.129600 -0.858700 +vn 0.499900 -0.000000 -0.866100 +vn 0.496000 -0.129500 -0.858600 +vn 0.483200 -0.257400 -0.836800 +vn 0.462400 -0.380800 -0.800700 +vn 0.433500 -0.497900 -0.751000 +vn 0.397800 -0.605900 -0.688900 +vn 0.355100 -0.704200 -0.614700 +vn 0.306000 -0.790900 -0.529800 +vn 0.251700 -0.863900 -0.436200 +vn 0.193800 -0.921800 -0.335700 +vn 0.132000 -0.964500 -0.228600 +vn 0.067800 -0.990800 -0.117300 +vn 0.095800 0.990800 -0.095700 +vn 0.186700 0.964500 -0.186600 +vn 0.274100 0.921800 -0.274000 +vn 0.356200 0.863800 -0.356300 +vn 0.432600 0.790900 -0.432700 +vn 0.501900 0.704500 -0.501700 +vn 0.562500 0.606000 -0.562400 +vn 0.613300 0.497200 -0.613700 +vn 0.653800 0.380700 -0.653900 +vn 0.683300 0.257600 -0.683200 +vn 0.701200 0.130300 -0.700900 +vn 0.707100 0.000000 -0.707100 +vn 0.700900 -0.130300 -0.701200 +vn 0.683200 -0.257600 -0.683300 +vn 0.653900 -0.380700 -0.653800 +vn 0.613700 -0.497200 -0.613300 +vn 0.562400 -0.606000 -0.562500 +vn 0.501700 -0.704500 -0.501900 +vn 0.432700 -0.790900 -0.432600 +vn 0.356300 -0.863800 -0.356200 +vn 0.274000 -0.921800 -0.274100 +vn 0.186600 -0.964500 -0.186700 +vn 0.095700 -0.990800 -0.095800 +vn 0.117300 0.990800 -0.067800 +vn 0.228600 0.964500 -0.132000 +vn 0.335700 0.921800 -0.193800 +vn 0.436200 0.863900 -0.251700 +vn 0.529800 0.790900 -0.306000 +vn 0.614700 0.704200 -0.355100 +vn 0.688900 0.605900 -0.397800 +vn 0.751000 0.497900 -0.433500 +vn 0.800700 0.380800 -0.462400 +vn 0.836800 0.257400 -0.483200 +vn 0.858600 0.129500 -0.496000 +vn 0.866100 0.000000 -0.499900 +vn 0.858700 -0.129600 -0.495700 +vn 0.836900 -0.257300 -0.483100 +vn 0.800500 -0.381000 -0.462500 +vn 0.750800 -0.497900 -0.433900 +vn 0.688900 -0.606000 -0.397800 +vn 0.614900 -0.704200 -0.354900 +vn 0.529700 -0.791000 -0.306000 +vn 0.436200 -0.863900 -0.251800 +vn 0.335800 -0.921800 -0.193700 +vn 0.228600 -0.964500 -0.132000 +vn 0.117300 -0.990800 -0.067800 +vn 0.130800 0.990800 -0.035300 +vn 0.255100 0.964500 -0.068200 +vn 0.374300 0.921800 -0.100100 +vn 0.486500 0.863900 -0.130400 +vn 0.591000 0.790900 -0.158500 +vn 0.685400 0.704600 -0.183600 +vn 0.768200 0.606100 -0.206000 +vn 0.838000 0.497300 -0.224600 +vn 0.893200 0.380600 -0.239300 +vn 0.933400 0.257300 -0.250000 +vn 0.957700 0.130100 -0.256400 +vn 0.965900 -0.000000 -0.258800 +vn 0.957700 -0.130000 -0.256700 +vn 0.933400 -0.257400 -0.249900 +vn 0.893400 -0.380400 -0.239000 +vn 0.838000 -0.497300 -0.224400 +vn 0.768100 -0.606200 -0.206100 +vn 0.685400 -0.704500 -0.183900 +vn 0.591000 -0.790900 -0.158400 +vn 0.486500 -0.863900 -0.130300 +vn 0.374400 -0.921800 -0.100200 +vn 0.255100 -0.964500 -0.068300 +vn 0.130700 -0.990800 -0.035300 +f 1//1 26//2 2//3 +f 2//3 26//2 27//4 +f 2//3 27//4 3//5 +f 3//5 27//4 28//6 +f 3//5 28//6 4//7 +f 4//7 28//6 29//8 +f 4//7 29//8 5//9 +f 5//9 29//8 30//10 +f 5//9 30//10 6//11 +f 6//11 30//10 31//12 +f 6//11 31//12 7//13 +f 7//13 31//12 32//14 +f 7//13 32//14 8//15 +f 8//15 32//14 33//16 +f 8//15 33//16 9//17 +f 9//17 33//16 34//18 +f 9//17 34//18 10//19 +f 10//19 34//18 35//20 +f 10//19 35//20 11//21 +f 11//21 35//20 36//22 +f 11//21 36//22 12//23 +f 12//23 36//22 37//24 +f 12//23 37//24 13//25 +f 13//25 37//24 38//26 +f 13//25 38//26 14//27 +f 14//27 38//26 39//28 +f 14//27 39//28 15//29 +f 15//29 39//28 40//30 +f 15//29 40//30 16//31 +f 16//31 40//30 41//32 +f 16//31 41//32 17//33 +f 17//33 41//32 42//34 +f 17//33 42//34 18//35 +f 18//35 42//34 43//36 +f 18//35 43//36 19//37 +f 19//37 43//36 44//38 +f 19//37 44//38 20//39 +f 20//39 44//38 45//40 +f 20//39 45//40 21//41 +f 21//41 45//40 46//42 +f 21//41 46//42 22//43 +f 22//43 46//42 47//44 +f 22//43 47//44 23//45 +f 23//45 47//44 48//46 +f 23//45 48//46 24//47 +f 24//47 48//46 25//48 +f 1//1 49//49 26//2 +f 26//2 49//49 50//50 +f 26//2 50//50 27//4 +f 27//4 50//50 51//51 +f 27//4 51//51 28//6 +f 28//6 51//51 52//52 +f 28//6 52//52 29//8 +f 29//8 52//52 53//53 +f 29//8 53//53 30//10 +f 30//10 53//53 54//54 +f 30//10 54//54 31//12 +f 31//12 54//54 55//55 +f 31//12 55//55 32//14 +f 32//14 55//55 56//56 +f 32//14 56//56 33//16 +f 33//16 56//56 57//57 +f 33//16 57//57 34//18 +f 34//18 57//57 58//58 +f 34//18 58//58 35//20 +f 35//20 58//58 59//59 +f 35//20 59//59 36//22 +f 36//22 59//59 60//60 +f 36//22 60//60 37//24 +f 37//24 60//60 61//61 +f 37//24 61//61 38//26 +f 38//26 61//61 62//62 +f 38//26 62//62 39//28 +f 39//28 62//62 63//63 +f 39//28 63//63 40//30 +f 40//30 63//63 64//64 +f 40//30 64//64 41//32 +f 41//32 64//64 65//65 +f 41//32 65//65 42//34 +f 42//34 65//65 66//66 +f 42//34 66//66 43//36 +f 43//36 66//66 67//67 +f 43//36 67//67 44//38 +f 44//38 67//67 68//68 +f 44//38 68//68 45//40 +f 45//40 68//68 69//69 +f 45//40 69//69 46//42 +f 46//42 69//69 70//70 +f 46//42 70//70 47//44 +f 47//44 70//70 71//71 +f 47//44 71//71 48//46 +f 48//46 71//71 25//48 +f 1//1 72//72 49//49 +f 49//49 72//72 73//73 +f 49//49 73//73 50//50 +f 50//50 73//73 74//74 +f 50//50 74//74 51//51 +f 51//51 74//74 75//75 +f 51//51 75//75 52//52 +f 52//52 75//75 76//76 +f 52//52 76//76 53//53 +f 53//53 76//76 77//77 +f 53//53 77//77 54//54 +f 54//54 77//77 78//78 +f 54//54 78//78 55//55 +f 55//55 78//78 79//79 +f 55//55 79//79 56//56 +f 56//56 79//79 80//80 +f 56//56 80//80 57//57 +f 57//57 80//80 81//81 +f 57//57 81//81 58//58 +f 58//58 81//81 82//82 +f 58//58 82//82 59//59 +f 59//59 82//82 83//83 +f 59//59 83//83 60//60 +f 60//60 83//83 84//84 +f 60//60 84//84 61//61 +f 61//61 84//84 85//85 +f 61//61 85//85 62//62 +f 62//62 85//85 86//86 +f 62//62 86//86 63//63 +f 63//63 86//86 87//87 +f 63//63 87//87 64//64 +f 64//64 87//87 88//88 +f 64//64 88//88 65//65 +f 65//65 88//88 89//89 +f 65//65 89//89 66//66 +f 66//66 89//89 90//90 +f 66//66 90//90 67//67 +f 67//67 90//90 91//91 +f 67//67 91//91 68//68 +f 68//68 91//91 92//92 +f 68//68 92//92 69//69 +f 69//69 92//92 93//93 +f 69//69 93//93 70//70 +f 70//70 93//93 94//94 +f 70//70 94//94 71//71 +f 71//71 94//94 25//48 +f 1//1 95//95 72//72 +f 72//72 95//95 96//96 +f 72//72 96//96 73//73 +f 73//73 96//96 97//97 +f 73//73 97//97 74//74 +f 74//74 97//97 98//98 +f 74//74 98//98 75//75 +f 75//75 98//98 99//99 +f 75//75 99//99 76//76 +f 76//76 99//99 100//100 +f 76//76 100//100 77//77 +f 77//77 100//100 101//101 +f 77//77 101//101 78//78 +f 78//78 101//101 102//102 +f 78//78 102//102 79//79 +f 79//79 102//102 103//103 +f 79//79 103//103 80//80 +f 80//80 103//103 104//104 +f 80//80 104//104 81//81 +f 81//81 104//104 105//105 +f 81//81 105//105 82//82 +f 82//82 105//105 106//106 +f 82//82 106//106 83//83 +f 83//83 106//106 107//107 +f 83//83 107//107 84//84 +f 84//84 107//107 108//108 +f 84//84 108//108 85//85 +f 85//85 108//108 109//109 +f 85//85 109//109 86//86 +f 86//86 109//109 110//110 +f 86//86 110//110 87//87 +f 87//87 110//110 111//111 +f 87//87 111//111 88//88 +f 88//88 111//111 112//112 +f 88//88 112//112 89//89 +f 89//89 112//112 113//113 +f 89//89 113//113 90//90 +f 90//90 113//113 114//114 +f 90//90 114//114 91//91 +f 91//91 114//114 115//115 +f 91//91 115//115 92//92 +f 92//92 115//115 116//116 +f 92//92 116//116 93//93 +f 93//93 116//116 117//117 +f 93//93 117//117 94//94 +f 94//94 117//117 25//48 +f 1//1 118//118 95//95 +f 95//95 118//118 119//119 +f 95//95 119//119 96//96 +f 96//96 119//119 120//120 +f 96//96 120//120 97//97 +f 97//97 120//120 121//121 +f 97//97 121//121 98//98 +f 98//98 121//121 122//122 +f 98//98 122//122 99//99 +f 99//99 122//122 123//123 +f 99//99 123//123 100//100 +f 100//100 123//123 124//124 +f 100//100 124//124 101//101 +f 101//101 124//124 125//125 +f 101//101 125//125 102//102 +f 102//102 125//125 126//126 +f 102//102 126//126 103//103 +f 103//103 126//126 127//127 +f 103//103 127//127 104//104 +f 104//104 127//127 128//128 +f 104//104 128//128 105//105 +f 105//105 128//128 129//129 +f 105//105 129//129 106//106 +f 106//106 129//129 130//130 +f 106//106 130//130 107//107 +f 107//107 130//130 131//131 +f 107//107 131//131 108//108 +f 108//108 131//131 132//132 +f 108//108 132//132 109//109 +f 109//109 132//132 133//133 +f 109//109 133//133 110//110 +f 110//110 133//133 134//134 +f 110//110 134//134 111//111 +f 111//111 134//134 135//135 +f 111//111 135//135 112//112 +f 112//112 135//135 136//136 +f 112//112 136//136 113//113 +f 113//113 136//136 137//137 +f 113//113 137//137 114//114 +f 114//114 137//137 138//138 +f 114//114 138//138 115//115 +f 115//115 138//138 139//139 +f 115//115 139//139 116//116 +f 116//116 139//139 140//140 +f 116//116 140//140 117//117 +f 117//117 140//140 25//48 +f 1//1 141//141 118//118 +f 118//118 141//141 142//142 +f 118//118 142//142 119//119 +f 119//119 142//142 143//143 +f 119//119 143//143 120//120 +f 120//120 143//143 144//144 +f 120//120 144//144 121//121 +f 121//121 144//144 145//145 +f 121//121 145//145 122//122 +f 122//122 145//145 146//146 +f 122//122 146//146 123//123 +f 123//123 146//146 147//147 +f 123//123 147//147 124//124 +f 124//124 147//147 148//148 +f 124//124 148//148 125//125 +f 125//125 148//148 149//149 +f 125//125 149//149 126//126 +f 126//126 149//149 150//150 +f 126//126 150//150 127//127 +f 127//127 150//150 151//151 +f 127//127 151//151 128//128 +f 128//128 151//151 152//152 +f 128//128 152//152 129//129 +f 129//129 152//152 153//153 +f 129//129 153//153 130//130 +f 130//130 153//153 154//154 +f 130//130 154//154 131//131 +f 131//131 154//154 155//155 +f 131//131 155//155 132//132 +f 132//132 155//155 156//156 +f 132//132 156//156 133//133 +f 133//133 156//156 157//157 +f 133//133 157//157 134//134 +f 134//134 157//157 158//158 +f 134//134 158//158 135//135 +f 135//135 158//158 159//159 +f 135//135 159//159 136//136 +f 136//136 159//159 160//160 +f 136//136 160//160 137//137 +f 137//137 160//160 161//161 +f 137//137 161//161 138//138 +f 138//138 161//161 162//162 +f 138//138 162//162 139//139 +f 139//139 162//162 163//163 +f 139//139 163//163 140//140 +f 140//140 163//163 25//48 +f 1//1 164//164 141//141 +f 141//141 164//164 165//165 +f 141//141 165//165 142//142 +f 142//142 165//165 166//166 +f 142//142 166//166 143//143 +f 143//143 166//166 167//167 +f 143//143 167//167 144//144 +f 144//144 167//167 168//168 +f 144//144 168//168 145//145 +f 145//145 168//168 169//169 +f 145//145 169//169 146//146 +f 146//146 169//169 170//170 +f 146//146 170//170 147//147 +f 147//147 170//170 171//171 +f 147//147 171//171 148//148 +f 148//148 171//171 172//172 +f 148//148 172//172 149//149 +f 149//149 172//172 173//173 +f 149//149 173//173 150//150 +f 150//150 173//173 174//174 +f 150//150 174//174 151//151 +f 151//151 174//174 175//175 +f 151//151 175//175 152//152 +f 152//152 175//175 176//176 +f 152//152 176//176 153//153 +f 153//153 176//176 177//177 +f 153//153 177//177 154//154 +f 154//154 177//177 178//178 +f 154//154 178//178 155//155 +f 155//155 178//178 179//179 +f 155//155 179//179 156//156 +f 156//156 179//179 180//180 +f 156//156 180//180 157//157 +f 157//157 180//180 181//181 +f 157//157 181//181 158//158 +f 158//158 181//181 182//182 +f 158//158 182//182 159//159 +f 159//159 182//182 183//183 +f 159//159 183//183 160//160 +f 160//160 183//183 184//184 +f 160//160 184//184 161//161 +f 161//161 184//184 185//185 +f 161//161 185//185 162//162 +f 162//162 185//185 186//186 +f 162//162 186//186 163//163 +f 163//163 186//186 25//48 +f 1//1 187//187 164//164 +f 164//164 187//187 188//188 +f 164//164 188//188 165//165 +f 165//165 188//188 189//189 +f 165//165 189//189 166//166 +f 166//166 189//189 190//190 +f 166//166 190//190 167//167 +f 167//167 190//190 191//191 +f 167//167 191//191 168//168 +f 168//168 191//191 192//192 +f 168//168 192//192 169//169 +f 169//169 192//192 193//193 +f 169//169 193//193 170//170 +f 170//170 193//193 194//194 +f 170//170 194//194 171//171 +f 171//171 194//194 195//195 +f 171//171 195//195 172//172 +f 172//172 195//195 196//196 +f 172//172 196//196 173//173 +f 173//173 196//196 197//197 +f 173//173 197//197 174//174 +f 174//174 197//197 198//198 +f 174//174 198//198 175//175 +f 175//175 198//198 199//199 +f 175//175 199//199 176//176 +f 176//176 199//199 200//200 +f 176//176 200//200 177//177 +f 177//177 200//200 201//201 +f 177//177 201//201 178//178 +f 178//178 201//201 202//202 +f 178//178 202//202 179//179 +f 179//179 202//202 203//203 +f 179//179 203//203 180//180 +f 180//180 203//203 204//204 +f 180//180 204//204 181//181 +f 181//181 204//204 205//205 +f 181//181 205//205 182//182 +f 182//182 205//205 206//206 +f 182//182 206//206 183//183 +f 183//183 206//206 207//207 +f 183//183 207//207 184//184 +f 184//184 207//207 208//208 +f 184//184 208//208 185//185 +f 185//185 208//208 209//209 +f 185//185 209//209 186//186 +f 186//186 209//209 25//48 +f 1//1 210//210 187//187 +f 187//187 210//210 211//211 +f 187//187 211//211 188//188 +f 188//188 211//211 212//212 +f 188//188 212//212 189//189 +f 189//189 212//212 213//213 +f 189//189 213//213 190//190 +f 190//190 213//213 214//214 +f 190//190 214//214 191//191 +f 191//191 214//214 215//215 +f 191//191 215//215 192//192 +f 192//192 215//215 216//216 +f 192//192 216//216 193//193 +f 193//193 216//216 217//217 +f 193//193 217//217 194//194 +f 194//194 217//217 218//218 +f 194//194 218//218 195//195 +f 195//195 218//218 219//219 +f 195//195 219//219 196//196 +f 196//196 219//219 220//220 +f 196//196 220//220 197//197 +f 197//197 220//220 221//221 +f 197//197 221//221 198//198 +f 198//198 221//221 222//222 +f 198//198 222//222 199//199 +f 199//199 222//222 223//223 +f 199//199 223//223 200//200 +f 200//200 223//223 224//224 +f 200//200 224//224 201//201 +f 201//201 224//224 225//225 +f 201//201 225//225 202//202 +f 202//202 225//225 226//226 +f 202//202 226//226 203//203 +f 203//203 226//226 227//227 +f 203//203 227//227 204//204 +f 204//204 227//227 228//228 +f 204//204 228//228 205//205 +f 205//205 228//228 229//229 +f 205//205 229//229 206//206 +f 206//206 229//229 230//230 +f 206//206 230//230 207//207 +f 207//207 230//230 231//231 +f 207//207 231//231 208//208 +f 208//208 231//231 232//232 +f 208//208 232//232 209//209 +f 209//209 232//232 25//48 +f 1//1 233//233 210//210 +f 210//210 233//233 234//234 +f 210//210 234//234 211//211 +f 211//211 234//234 235//235 +f 211//211 235//235 212//212 +f 212//212 235//235 236//236 +f 212//212 236//236 213//213 +f 213//213 236//236 237//237 +f 213//213 237//237 214//214 +f 214//214 237//237 238//238 +f 214//214 238//238 215//215 +f 215//215 238//238 239//239 +f 215//215 239//239 216//216 +f 216//216 239//239 240//240 +f 216//216 240//240 217//217 +f 217//217 240//240 241//241 +f 217//217 241//241 218//218 +f 218//218 241//241 242//242 +f 218//218 242//242 219//219 +f 219//219 242//242 243//243 +f 219//219 243//243 220//220 +f 220//220 243//243 244//244 +f 220//220 244//244 221//221 +f 221//221 244//244 245//245 +f 221//221 245//245 222//222 +f 222//222 245//245 246//246 +f 222//222 246//246 223//223 +f 223//223 246//246 247//247 +f 223//223 247//247 224//224 +f 224//224 247//247 248//248 +f 224//224 248//248 225//225 +f 225//225 248//248 249//249 +f 225//225 249//249 226//226 +f 226//226 249//249 250//250 +f 226//226 250//250 227//227 +f 227//227 250//250 251//251 +f 227//227 251//251 228//228 +f 228//228 251//251 252//252 +f 228//228 252//252 229//229 +f 229//229 252//252 253//253 +f 229//229 253//253 230//230 +f 230//230 253//253 254//254 +f 230//230 254//254 231//231 +f 231//231 254//254 255//255 +f 231//231 255//255 232//232 +f 232//232 255//255 25//48 +f 1//1 256//256 233//233 +f 233//233 256//256 257//257 +f 233//233 257//257 234//234 +f 234//234 257//257 258//258 +f 234//234 258//258 235//235 +f 235//235 258//258 259//259 +f 235//235 259//259 236//236 +f 236//236 259//259 260//260 +f 236//236 260//260 237//237 +f 237//237 260//260 261//261 +f 237//237 261//261 238//238 +f 238//238 261//261 262//262 +f 238//238 262//262 239//239 +f 239//239 262//262 263//263 +f 239//239 263//263 240//240 +f 240//240 263//263 264//264 +f 240//240 264//264 241//241 +f 241//241 264//264 265//265 +f 241//241 265//265 242//242 +f 242//242 265//265 266//266 +f 242//242 266//266 243//243 +f 243//243 266//266 267//267 +f 243//243 267//267 244//244 +f 244//244 267//267 268//268 +f 244//244 268//268 245//245 +f 245//245 268//268 269//269 +f 245//245 269//269 246//246 +f 246//246 269//269 270//270 +f 246//246 270//270 247//247 +f 247//247 270//270 271//271 +f 247//247 271//271 248//248 +f 248//248 271//271 272//272 +f 248//248 272//272 249//249 +f 249//249 272//272 273//273 +f 249//249 273//273 250//250 +f 250//250 273//273 274//274 +f 250//250 274//274 251//251 +f 251//251 274//274 275//275 +f 251//251 275//275 252//252 +f 252//252 275//275 276//276 +f 252//252 276//276 253//253 +f 253//253 276//276 277//277 +f 253//253 277//277 254//254 +f 254//254 277//277 278//278 +f 254//254 278//278 255//255 +f 255//255 278//278 25//48 +f 1//1 279//279 256//256 +f 256//256 279//279 280//280 +f 256//256 280//280 257//257 +f 257//257 280//280 281//281 +f 257//257 281//281 258//258 +f 258//258 281//281 282//282 +f 258//258 282//282 259//259 +f 259//259 282//282 283//283 +f 259//259 283//283 260//260 +f 260//260 283//283 284//284 +f 260//260 284//284 261//261 +f 261//261 284//284 285//285 +f 261//261 285//285 262//262 +f 262//262 285//285 286//286 +f 262//262 286//286 263//263 +f 263//263 286//286 287//287 +f 263//263 287//287 264//264 +f 264//264 287//287 288//288 +f 264//264 288//288 265//265 +f 265//265 288//288 289//289 +f 265//265 289//289 266//266 +f 266//266 289//289 290//290 +f 266//266 290//290 267//267 +f 267//267 290//290 291//291 +f 267//267 291//291 268//268 +f 268//268 291//291 292//292 +f 268//268 292//292 269//269 +f 269//269 292//292 293//293 +f 269//269 293//293 270//270 +f 270//270 293//293 294//294 +f 270//270 294//294 271//271 +f 271//271 294//294 295//295 +f 271//271 295//295 272//272 +f 272//272 295//295 296//296 +f 272//272 296//296 273//273 +f 273//273 296//296 297//297 +f 273//273 297//297 274//274 +f 274//274 297//297 298//298 +f 274//274 298//298 275//275 +f 275//275 298//298 299//299 +f 275//275 299//299 276//276 +f 276//276 299//299 300//300 +f 276//276 300//300 277//277 +f 277//277 300//300 301//301 +f 277//277 301//301 278//278 +f 278//278 301//301 25//48 +f 1//1 302//302 279//279 +f 279//279 302//302 303//303 +f 279//279 303//303 280//280 +f 280//280 303//303 304//304 +f 280//280 304//304 281//281 +f 281//281 304//304 305//305 +f 281//281 305//305 282//282 +f 282//282 305//305 306//306 +f 282//282 306//306 283//283 +f 283//283 306//306 307//307 +f 283//283 307//307 284//284 +f 284//284 307//307 308//308 +f 284//284 308//308 285//285 +f 285//285 308//308 309//309 +f 285//285 309//309 286//286 +f 286//286 309//309 310//310 +f 286//286 310//310 287//287 +f 287//287 310//310 311//311 +f 287//287 311//311 288//288 +f 288//288 311//311 312//312 +f 288//288 312//312 289//289 +f 289//289 312//312 313//313 +f 289//289 313//313 290//290 +f 290//290 313//313 314//314 +f 290//290 314//314 291//291 +f 291//291 314//314 315//315 +f 291//291 315//315 292//292 +f 292//292 315//315 316//316 +f 292//292 316//316 293//293 +f 293//293 316//316 317//317 +f 293//293 317//317 294//294 +f 294//294 317//317 318//318 +f 294//294 318//318 295//295 +f 295//295 318//318 319//319 +f 295//295 319//319 296//296 +f 296//296 319//319 320//320 +f 296//296 320//320 297//297 +f 297//297 320//320 321//321 +f 297//297 321//321 298//298 +f 298//298 321//321 322//322 +f 298//298 322//322 299//299 +f 299//299 322//322 323//323 +f 299//299 323//323 300//300 +f 300//300 323//323 324//324 +f 300//300 324//324 301//301 +f 301//301 324//324 25//48 +f 1//1 325//325 302//302 +f 302//302 325//325 326//326 +f 302//302 326//326 303//303 +f 303//303 326//326 327//327 +f 303//303 327//327 304//304 +f 304//304 327//327 328//328 +f 304//304 328//328 305//305 +f 305//305 328//328 329//329 +f 305//305 329//329 306//306 +f 306//306 329//329 330//330 +f 306//306 330//330 307//307 +f 307//307 330//330 331//331 +f 307//307 331//331 308//308 +f 308//308 331//331 332//332 +f 308//308 332//332 309//309 +f 309//309 332//332 333//333 +f 309//309 333//333 310//310 +f 310//310 333//333 334//334 +f 310//310 334//334 311//311 +f 311//311 334//334 335//335 +f 311//311 335//335 312//312 +f 312//312 335//335 336//336 +f 312//312 336//336 313//313 +f 313//313 336//336 337//337 +f 313//313 337//337 314//314 +f 314//314 337//337 338//338 +f 314//314 338//338 315//315 +f 315//315 338//338 339//339 +f 315//315 339//339 316//316 +f 316//316 339//339 340//340 +f 316//316 340//340 317//317 +f 317//317 340//340 341//341 +f 317//317 341//341 318//318 +f 318//318 341//341 342//342 +f 318//318 342//342 319//319 +f 319//319 342//342 343//343 +f 319//319 343//343 320//320 +f 320//320 343//343 344//344 +f 320//320 344//344 321//321 +f 321//321 344//344 345//345 +f 321//321 345//345 322//322 +f 322//322 345//345 346//346 +f 322//322 346//346 323//323 +f 323//323 346//346 347//347 +f 323//323 347//347 324//324 +f 324//324 347//347 25//48 +f 1//1 348//348 325//325 +f 325//325 348//348 349//349 +f 325//325 349//349 326//326 +f 326//326 349//349 350//350 +f 326//326 350//350 327//327 +f 327//327 350//350 351//351 +f 327//327 351//351 328//328 +f 328//328 351//351 352//352 +f 328//328 352//352 329//329 +f 329//329 352//352 353//353 +f 329//329 353//353 330//330 +f 330//330 353//353 354//354 +f 330//330 354//354 331//331 +f 331//331 354//354 355//355 +f 331//331 355//355 332//332 +f 332//332 355//355 356//356 +f 332//332 356//356 333//333 +f 333//333 356//356 357//357 +f 333//333 357//357 334//334 +f 334//334 357//357 358//358 +f 334//334 358//358 335//335 +f 335//335 358//358 359//359 +f 335//335 359//359 336//336 +f 336//336 359//359 360//360 +f 336//336 360//360 337//337 +f 337//337 360//360 361//361 +f 337//337 361//361 338//338 +f 338//338 361//361 362//362 +f 338//338 362//362 339//339 +f 339//339 362//362 363//363 +f 339//339 363//363 340//340 +f 340//340 363//363 364//364 +f 340//340 364//364 341//341 +f 341//341 364//364 365//365 +f 341//341 365//365 342//342 +f 342//342 365//365 366//366 +f 342//342 366//366 343//343 +f 343//343 366//366 367//367 +f 343//343 367//367 344//344 +f 344//344 367//367 368//368 +f 344//344 368//368 345//345 +f 345//345 368//368 369//369 +f 345//345 369//369 346//346 +f 346//346 369//369 370//370 +f 346//346 370//370 347//347 +f 347//347 370//370 25//48 +f 1//1 371//371 348//348 +f 348//348 371//371 372//372 +f 348//348 372//372 349//349 +f 349//349 372//372 373//373 +f 349//349 373//373 350//350 +f 350//350 373//373 374//374 +f 350//350 374//374 351//351 +f 351//351 374//374 375//375 +f 351//351 375//375 352//352 +f 352//352 375//375 376//376 +f 352//352 376//376 353//353 +f 353//353 376//376 377//377 +f 353//353 377//377 354//354 +f 354//354 377//377 378//378 +f 354//354 378//378 355//355 +f 355//355 378//378 379//379 +f 355//355 379//379 356//356 +f 356//356 379//379 380//380 +f 356//356 380//380 357//357 +f 357//357 380//380 381//381 +f 357//357 381//381 358//358 +f 358//358 381//381 382//382 +f 358//358 382//382 359//359 +f 359//359 382//382 383//383 +f 359//359 383//383 360//360 +f 360//360 383//383 384//384 +f 360//360 384//384 361//361 +f 361//361 384//384 385//385 +f 361//361 385//385 362//362 +f 362//362 385//385 386//386 +f 362//362 386//386 363//363 +f 363//363 386//386 387//387 +f 363//363 387//387 364//364 +f 364//364 387//387 388//388 +f 364//364 388//388 365//365 +f 365//365 388//388 389//389 +f 365//365 389//389 366//366 +f 366//366 389//389 390//390 +f 366//366 390//390 367//367 +f 367//367 390//390 391//391 +f 367//367 391//391 368//368 +f 368//368 391//391 392//392 +f 368//368 392//392 369//369 +f 369//369 392//392 393//393 +f 369//369 393//393 370//370 +f 370//370 393//393 25//48 +f 1//1 394//394 371//371 +f 371//371 394//394 395//395 +f 371//371 395//395 372//372 +f 372//372 395//395 396//396 +f 372//372 396//396 373//373 +f 373//373 396//396 397//397 +f 373//373 397//397 374//374 +f 374//374 397//397 398//398 +f 374//374 398//398 375//375 +f 375//375 398//398 399//399 +f 375//375 399//399 376//376 +f 376//376 399//399 400//400 +f 376//376 400//400 377//377 +f 377//377 400//400 401//401 +f 377//377 401//401 378//378 +f 378//378 401//401 402//402 +f 378//378 402//402 379//379 +f 379//379 402//402 403//403 +f 379//379 403//403 380//380 +f 380//380 403//403 404//404 +f 380//380 404//404 381//381 +f 381//381 404//404 405//405 +f 381//381 405//405 382//382 +f 382//382 405//405 406//406 +f 382//382 406//406 383//383 +f 383//383 406//406 407//407 +f 383//383 407//407 384//384 +f 384//384 407//407 408//408 +f 384//384 408//408 385//385 +f 385//385 408//408 409//409 +f 385//385 409//409 386//386 +f 386//386 409//409 410//410 +f 386//386 410//410 387//387 +f 387//387 410//410 411//411 +f 387//387 411//411 388//388 +f 388//388 411//411 412//412 +f 388//388 412//412 389//389 +f 389//389 412//412 413//413 +f 389//389 413//413 390//390 +f 390//390 413//413 414//414 +f 390//390 414//414 391//391 +f 391//391 414//414 415//415 +f 391//391 415//415 392//392 +f 392//392 415//415 416//416 +f 392//392 416//416 393//393 +f 393//393 416//416 25//48 +f 1//1 417//417 394//394 +f 394//394 417//417 418//418 +f 394//394 418//418 395//395 +f 395//395 418//418 419//419 +f 395//395 419//419 396//396 +f 396//396 419//419 420//420 +f 396//396 420//420 397//397 +f 397//397 420//420 421//421 +f 397//397 421//421 398//398 +f 398//398 421//421 422//422 +f 398//398 422//422 399//399 +f 399//399 422//422 423//423 +f 399//399 423//423 400//400 +f 400//400 423//423 424//424 +f 400//400 424//424 401//401 +f 401//401 424//424 425//425 +f 401//401 425//425 402//402 +f 402//402 425//425 426//426 +f 402//402 426//426 403//403 +f 403//403 426//426 427//427 +f 403//403 427//427 404//404 +f 404//404 427//427 428//428 +f 404//404 428//428 405//405 +f 405//405 428//428 429//429 +f 405//405 429//429 406//406 +f 406//406 429//429 430//430 +f 406//406 430//430 407//407 +f 407//407 430//430 431//431 +f 407//407 431//431 408//408 +f 408//408 431//431 432//432 +f 408//408 432//432 409//409 +f 409//409 432//432 433//433 +f 409//409 433//433 410//410 +f 410//410 433//433 434//434 +f 410//410 434//434 411//411 +f 411//411 434//434 435//435 +f 411//411 435//435 412//412 +f 412//412 435//435 436//436 +f 412//412 436//436 413//413 +f 413//413 436//436 437//437 +f 413//413 437//437 414//414 +f 414//414 437//437 438//438 +f 414//414 438//438 415//415 +f 415//415 438//438 439//439 +f 415//415 439//439 416//416 +f 416//416 439//439 25//48 +f 1//1 440//440 417//417 +f 417//417 440//440 441//441 +f 417//417 441//441 418//418 +f 418//418 441//441 442//442 +f 418//418 442//442 419//419 +f 419//419 442//442 443//443 +f 419//419 443//443 420//420 +f 420//420 443//443 444//444 +f 420//420 444//444 421//421 +f 421//421 444//444 445//445 +f 421//421 445//445 422//422 +f 422//422 445//445 446//446 +f 422//422 446//446 423//423 +f 423//423 446//446 447//447 +f 423//423 447//447 424//424 +f 424//424 447//447 448//448 +f 424//424 448//448 425//425 +f 425//425 448//448 449//449 +f 425//425 449//449 426//426 +f 426//426 449//449 450//450 +f 426//426 450//450 427//427 +f 427//427 450//450 451//451 +f 427//427 451//451 428//428 +f 428//428 451//451 452//452 +f 428//428 452//452 429//429 +f 429//429 452//452 453//453 +f 429//429 453//453 430//430 +f 430//430 453//453 454//454 +f 430//430 454//454 431//431 +f 431//431 454//454 455//455 +f 431//431 455//455 432//432 +f 432//432 455//455 456//456 +f 432//432 456//456 433//433 +f 433//433 456//456 457//457 +f 433//433 457//457 434//434 +f 434//434 457//457 458//458 +f 434//434 458//458 435//435 +f 435//435 458//458 459//459 +f 435//435 459//459 436//436 +f 436//436 459//459 460//460 +f 436//436 460//460 437//437 +f 437//437 460//460 461//461 +f 437//437 461//461 438//438 +f 438//438 461//461 462//462 +f 438//438 462//462 439//439 +f 439//439 462//462 25//48 +f 1//1 463//463 440//440 +f 440//440 463//463 464//464 +f 440//440 464//464 441//441 +f 441//441 464//464 465//465 +f 441//441 465//465 442//442 +f 442//442 465//465 466//466 +f 442//442 466//466 443//443 +f 443//443 466//466 467//467 +f 443//443 467//467 444//444 +f 444//444 467//467 468//468 +f 444//444 468//468 445//445 +f 445//445 468//468 469//469 +f 445//445 469//469 446//446 +f 446//446 469//469 470//470 +f 446//446 470//470 447//447 +f 447//447 470//470 471//471 +f 447//447 471//471 448//448 +f 448//448 471//471 472//472 +f 448//448 472//472 449//449 +f 449//449 472//472 473//473 +f 449//449 473//473 450//450 +f 450//450 473//473 474//474 +f 450//450 474//474 451//451 +f 451//451 474//474 475//475 +f 451//451 475//475 452//452 +f 452//452 475//475 476//476 +f 452//452 476//476 453//453 +f 453//453 476//476 477//477 +f 453//453 477//477 454//454 +f 454//454 477//477 478//478 +f 454//454 478//478 455//455 +f 455//455 478//478 479//479 +f 455//455 479//479 456//456 +f 456//456 479//479 480//480 +f 456//456 480//480 457//457 +f 457//457 480//480 481//481 +f 457//457 481//481 458//458 +f 458//458 481//481 482//482 +f 458//458 482//482 459//459 +f 459//459 482//482 483//483 +f 459//459 483//483 460//460 +f 460//460 483//483 484//484 +f 460//460 484//484 461//461 +f 461//461 484//484 485//485 +f 461//461 485//485 462//462 +f 462//462 485//485 25//48 +f 1//1 486//486 463//463 +f 463//463 486//486 487//487 +f 463//463 487//487 464//464 +f 464//464 487//487 488//488 +f 464//464 488//488 465//465 +f 465//465 488//488 489//489 +f 465//465 489//489 466//466 +f 466//466 489//489 490//490 +f 466//466 490//490 467//467 +f 467//467 490//490 491//491 +f 467//467 491//491 468//468 +f 468//468 491//491 492//492 +f 468//468 492//492 469//469 +f 469//469 492//492 493//493 +f 469//469 493//493 470//470 +f 470//470 493//493 494//494 +f 470//470 494//494 471//471 +f 471//471 494//494 495//495 +f 471//471 495//495 472//472 +f 472//472 495//495 496//496 +f 472//472 496//496 473//473 +f 473//473 496//496 497//497 +f 473//473 497//497 474//474 +f 474//474 497//497 498//498 +f 474//474 498//498 475//475 +f 475//475 498//498 499//499 +f 475//475 499//499 476//476 +f 476//476 499//499 500//500 +f 476//476 500//500 477//477 +f 477//477 500//500 501//501 +f 477//477 501//501 478//478 +f 478//478 501//501 502//502 +f 478//478 502//502 479//479 +f 479//479 502//502 503//503 +f 479//479 503//503 480//480 +f 480//480 503//503 504//504 +f 480//480 504//504 481//481 +f 481//481 504//504 505//505 +f 481//481 505//505 482//482 +f 482//482 505//505 506//506 +f 482//482 506//506 483//483 +f 483//483 506//506 507//507 +f 483//483 507//507 484//484 +f 484//484 507//507 508//508 +f 484//484 508//508 485//485 +f 485//485 508//508 25//48 +f 1//1 509//509 486//486 +f 486//486 509//509 510//510 +f 486//486 510//510 487//487 +f 487//487 510//510 511//511 +f 487//487 511//511 488//488 +f 488//488 511//511 512//512 +f 488//488 512//512 489//489 +f 489//489 512//512 513//513 +f 489//489 513//513 490//490 +f 490//490 513//513 514//514 +f 490//490 514//514 491//491 +f 491//491 514//514 515//515 +f 491//491 515//515 492//492 +f 492//492 515//515 516//516 +f 492//492 516//516 493//493 +f 493//493 516//516 517//517 +f 493//493 517//517 494//494 +f 494//494 517//517 518//518 +f 494//494 518//518 495//495 +f 495//495 518//518 519//519 +f 495//495 519//519 496//496 +f 496//496 519//519 520//520 +f 496//496 520//520 497//497 +f 497//497 520//520 521//521 +f 497//497 521//521 498//498 +f 498//498 521//521 522//522 +f 498//498 522//522 499//499 +f 499//499 522//522 523//523 +f 499//499 523//523 500//500 +f 500//500 523//523 524//524 +f 500//500 524//524 501//501 +f 501//501 524//524 525//525 +f 501//501 525//525 502//502 +f 502//502 525//525 526//526 +f 502//502 526//526 503//503 +f 503//503 526//526 527//527 +f 503//503 527//527 504//504 +f 504//504 527//527 528//528 +f 504//504 528//528 505//505 +f 505//505 528//528 529//529 +f 505//505 529//529 506//506 +f 506//506 529//529 530//530 +f 506//506 530//530 507//507 +f 507//507 530//530 531//531 +f 507//507 531//531 508//508 +f 508//508 531//531 25//48 +f 1//1 532//532 509//509 +f 509//509 532//532 533//533 +f 509//509 533//533 510//510 +f 510//510 533//533 534//534 +f 510//510 534//534 511//511 +f 511//511 534//534 535//535 +f 511//511 535//535 512//512 +f 512//512 535//535 536//536 +f 512//512 536//536 513//513 +f 513//513 536//536 537//537 +f 513//513 537//537 514//514 +f 514//514 537//537 538//538 +f 514//514 538//538 515//515 +f 515//515 538//538 539//539 +f 515//515 539//539 516//516 +f 516//516 539//539 540//540 +f 516//516 540//540 517//517 +f 517//517 540//540 541//541 +f 517//517 541//541 518//518 +f 518//518 541//541 542//542 +f 518//518 542//542 519//519 +f 519//519 542//542 543//543 +f 519//519 543//543 520//520 +f 520//520 543//543 544//544 +f 520//520 544//544 521//521 +f 521//521 544//544 545//545 +f 521//521 545//545 522//522 +f 522//522 545//545 546//546 +f 522//522 546//546 523//523 +f 523//523 546//546 547//547 +f 523//523 547//547 524//524 +f 524//524 547//547 548//548 +f 524//524 548//548 525//525 +f 525//525 548//548 549//549 +f 525//525 549//549 526//526 +f 526//526 549//549 550//550 +f 526//526 550//550 527//527 +f 527//527 550//550 551//551 +f 527//527 551//551 528//528 +f 528//528 551//551 552//552 +f 528//528 552//552 529//529 +f 529//529 552//552 553//553 +f 529//529 553//553 530//530 +f 530//530 553//553 554//554 +f 530//530 554//554 531//531 +f 531//531 554//554 25//48 +f 1//1 2//3 532//532 +f 532//532 2//3 3//5 +f 532//532 3//5 533//533 +f 533//533 3//5 4//7 +f 533//533 4//7 534//534 +f 534//534 4//7 5//9 +f 534//534 5//9 535//535 +f 535//535 5//9 6//11 +f 535//535 6//11 536//536 +f 536//536 6//11 7//13 +f 536//536 7//13 537//537 +f 537//537 7//13 8//15 +f 537//537 8//15 538//538 +f 538//538 8//15 9//17 +f 538//538 9//17 539//539 +f 539//539 9//17 10//19 +f 539//539 10//19 540//540 +f 540//540 10//19 11//21 +f 540//540 11//21 541//541 +f 541//541 11//21 12//23 +f 541//541 12//23 542//542 +f 542//542 12//23 13//25 +f 542//542 13//25 543//543 +f 543//543 13//25 14//27 +f 543//543 14//27 544//544 +f 544//544 14//27 15//29 +f 544//544 15//29 545//545 +f 545//545 15//29 16//31 +f 545//545 16//31 546//546 +f 546//546 16//31 17//33 +f 546//546 17//33 547//547 +f 547//547 17//33 18//35 +f 547//547 18//35 548//548 +f 548//548 18//35 19//37 +f 548//548 19//37 549//549 +f 549//549 19//37 20//39 +f 549//549 20//39 550//550 +f 550//550 20//39 21//41 +f 550//550 21//41 551//551 +f 551//551 21//41 22//43 +f 551//551 22//43 552//552 +f 552//552 22//43 23//45 +f 552//552 23//45 553//553 +f 553//553 23//45 24//47 +f 553//553 24//47 554//554 +f 554//554 24//47 25//48 diff --git a/AnimatableGaussians/assets/cylinder.obj b/AnimatableGaussians/assets/cylinder.obj new file mode 100644 index 0000000000000000000000000000000000000000..77ce899b4526b7781a159467d8f976059c5e8d3a --- /dev/null +++ b/AnimatableGaussians/assets/cylinder.obj @@ -0,0 +1,198 @@ +# Blender v2.74 (sub 0) OBJ File: '' +# www.blender.org +v 0.000000 0.500000 0.500000 +v 0.129400 0.500000 0.483000 +v 0.250000 0.500000 0.433000 +v 0.353600 0.500000 0.353600 +v 0.433000 0.500000 0.250000 +v 0.483000 0.500000 0.129400 +v 0.500000 0.500000 0.000000 +v 0.483000 0.500000 -0.129400 +v 0.433000 0.500000 -0.250000 +v 0.353600 0.500000 -0.353600 +v 0.250000 0.500000 -0.433000 +v 0.129400 0.500000 -0.483000 +v 0.000000 0.500000 -0.500000 +v -0.129400 0.500000 -0.483000 +v -0.250000 0.500000 -0.433000 +v -0.353600 0.500000 -0.353600 +v -0.433000 0.500000 -0.250000 +v -0.483000 0.500000 -0.129400 +v -0.500000 0.500000 0.000000 +v -0.483000 0.500000 0.129400 +v -0.433000 0.500000 0.250000 +v -0.353600 0.500000 0.353600 +v -0.250000 0.500000 0.433000 +v -0.129400 0.500000 0.483000 +v 0.000000 -0.500000 0.500000 +v 0.129400 -0.500000 0.483000 +v 0.250000 -0.500000 0.433000 +v 0.353600 -0.500000 0.353600 +v 0.433000 -0.500000 0.250000 +v 0.483000 -0.500000 0.129400 +v 0.500000 -0.500000 0.000000 +v 0.483000 -0.500000 -0.129400 +v 0.433000 -0.500000 -0.250000 +v 0.353600 -0.500000 -0.353600 +v 0.250000 -0.500000 -0.433000 +v 0.129400 -0.500000 -0.483000 +v 0.000000 -0.500000 -0.500000 +v -0.129400 -0.500000 -0.483000 +v -0.250000 -0.500000 -0.433000 +v -0.353600 -0.500000 -0.353600 +v -0.433000 -0.500000 -0.250000 +v -0.483000 -0.500000 -0.129400 +v -0.500000 -0.500000 0.000000 +v -0.483000 -0.500000 0.129400 +v -0.433000 -0.500000 0.250000 +v -0.353600 -0.500000 0.353600 +v -0.250000 -0.500000 0.433000 +v -0.129400 -0.500000 0.483000 +v 0.000000 0.500000 0.000000 +v 0.000000 -0.500000 0.000000 +vn 0.000000 0.678900 0.734200 +vn 0.000000 -0.678900 0.734200 +vn 0.190100 -0.678800 0.709300 +vn 0.190100 0.678800 0.709300 +vn 0.367000 -0.678900 0.635900 +vn 0.367000 0.678900 0.635900 +vn 0.519300 -0.678700 0.519300 +vn 0.519300 0.678700 0.519300 +vn 0.635900 -0.678900 0.367000 +vn 0.635900 0.678900 0.367000 +vn 0.709300 -0.678800 0.190100 +vn 0.709300 0.678800 0.190100 +vn 0.734200 -0.678900 0.000000 +vn 0.734200 0.678900 0.000000 +vn 0.709300 -0.678800 -0.190100 +vn 0.709300 0.678800 -0.190100 +vn 0.635900 -0.678900 -0.367000 +vn 0.635900 0.678900 -0.367000 +vn 0.519300 -0.678700 -0.519300 +vn 0.519300 0.678700 -0.519300 +vn 0.367000 -0.678900 -0.635900 +vn 0.367000 0.678900 -0.635900 +vn 0.190100 -0.678800 -0.709300 +vn 0.190100 0.678800 -0.709300 +vn 0.000000 -0.678900 -0.734200 +vn 0.000000 0.678900 -0.734200 +vn -0.190100 -0.678800 -0.709300 +vn -0.190100 0.678800 -0.709300 +vn -0.367000 -0.678900 -0.635900 +vn -0.367000 0.678900 -0.635900 +vn -0.519300 -0.678700 -0.519300 +vn -0.519300 0.678700 -0.519300 +vn -0.635900 -0.678900 -0.367000 +vn -0.635900 0.678900 -0.367000 +vn -0.709300 -0.678800 -0.190100 +vn -0.709300 0.678800 -0.190100 +vn -0.734200 -0.678900 0.000000 +vn -0.734200 0.678900 0.000000 +vn -0.709300 -0.678800 0.190100 +vn -0.709300 0.678800 0.190100 +vn -0.635900 -0.678900 0.367000 +vn -0.635900 0.678900 0.367000 +vn -0.519300 -0.678700 0.519300 +vn -0.519300 0.678700 0.519300 +vn -0.367000 -0.678900 0.635900 +vn -0.367000 0.678900 0.635900 +vn -0.190100 -0.678800 0.709300 +vn -0.190100 0.678800 0.709300 +vn 0.000000 1.000000 0.000000 +vn 0.000000 -1.000000 0.000000 +f 1//1 25//2 26//3 +f 1//1 26//3 2//4 +f 2//4 26//3 27//5 +f 2//4 27//5 3//6 +f 3//6 27//5 28//7 +f 3//6 28//7 4//8 +f 4//8 28//7 29//9 +f 4//8 29//9 5//10 +f 5//10 29//9 30//11 +f 5//10 30//11 6//12 +f 6//12 30//11 31//13 +f 6//12 31//13 7//14 +f 7//14 31//13 32//15 +f 7//14 32//15 8//16 +f 8//16 32//15 33//17 +f 8//16 33//17 9//18 +f 9//18 33//17 34//19 +f 9//18 34//19 10//20 +f 10//20 34//19 35//21 +f 10//20 35//21 11//22 +f 11//22 35//21 36//23 +f 11//22 36//23 12//24 +f 12//24 36//23 37//25 +f 12//24 37//25 13//26 +f 13//26 37//25 38//27 +f 13//26 38//27 14//28 +f 14//28 38//27 39//29 +f 14//28 39//29 15//30 +f 15//30 39//29 40//31 +f 15//30 40//31 16//32 +f 16//32 40//31 41//33 +f 16//32 41//33 17//34 +f 17//34 41//33 42//35 +f 17//34 42//35 18//36 +f 18//36 42//35 43//37 +f 18//36 43//37 19//38 +f 19//38 43//37 44//39 +f 19//38 44//39 20//40 +f 20//40 44//39 45//41 +f 20//40 45//41 21//42 +f 21//42 45//41 46//43 +f 21//42 46//43 22//44 +f 22//44 46//43 47//45 +f 22//44 47//45 23//46 +f 23//46 47//45 48//47 +f 23//46 48//47 24//48 +f 24//48 48//47 25//2 +f 24//48 25//2 1//1 +f 1//1 2//4 49//49 +f 2//4 3//6 49//49 +f 3//6 4//8 49//49 +f 4//8 5//10 49//49 +f 5//10 6//12 49//49 +f 6//12 7//14 49//49 +f 7//14 8//16 49//49 +f 8//16 9//18 49//49 +f 9//18 10//20 49//49 +f 10//20 11//22 49//49 +f 11//22 12//24 49//49 +f 12//24 13//26 49//49 +f 13//26 14//28 49//49 +f 14//28 15//30 49//49 +f 15//30 16//32 49//49 +f 16//32 17//34 49//49 +f 17//34 18//36 49//49 +f 18//36 19//38 49//49 +f 19//38 20//40 49//49 +f 20//40 21//42 49//49 +f 21//42 22//44 49//49 +f 22//44 23//46 49//49 +f 23//46 24//48 49//49 +f 24//48 1//1 49//49 +f 26//3 25//2 50//50 +f 27//5 26//3 50//50 +f 28//7 27//5 50//50 +f 29//9 28//7 50//50 +f 30//11 29//9 50//50 +f 31//13 30//11 50//50 +f 32//15 31//13 50//50 +f 33//17 32//15 50//50 +f 34//19 33//17 50//50 +f 35//21 34//19 50//50 +f 36//23 35//21 50//50 +f 37//25 36//23 50//50 +f 38//27 37//25 50//50 +f 39//29 38//27 50//50 +f 40//31 39//29 50//50 +f 41//33 40//31 50//50 +f 42//35 41//33 50//50 +f 43//37 42//35 50//50 +f 44//39 43//37 50//50 +f 45//41 44//39 50//50 +f 46//43 45//41 50//50 +f 47//45 46//43 50//50 +f 48//47 47//45 50//50 +f 25//2 48//47 50//50 diff --git a/AnimatableGaussians/base_trainer.py b/AnimatableGaussians/base_trainer.py new file mode 100644 index 0000000000000000000000000000000000000000..ff1b9ae20824d385f811a8568c695991a1620b15 --- /dev/null +++ b/AnimatableGaussians/base_trainer.py @@ -0,0 +1,258 @@ +import os +import platform +import time +import yaml +import torch +import datetime +from torch.utils.tensorboard import SummaryWriter +import torch.utils.data +import numpy as np +import glob +import shutil + +from utils.net_util import to_cuda + + +def worker_init_fn(worker_id): # set numpy's random seed + seed = torch.initial_seed() + seed = seed % (2 ** 32) + np.random.seed(seed + worker_id) + + +class BaseTrainer: + def __init__(self, opt): + self.opt = opt + + self.dataset = None + self.network = None + self.net_dict = {} + self.optm_dict = {} + self.update_keys = None + self.lr_schedule_dict = {} + self.iter_idx = 0 + self.epoch_idx = 0 + self.iter_num = 9999999999 + + self.loss_weight = self.opt['train']['loss_weight'] + + @staticmethod + def load_pretrained(path, dict_): + data = torch.load(path) + for k in dict_: + if k in data: + print('# Loading %s...' % k) + dict_[k].load_state_dict(data[k]) + else: + print('# %s not found!' % k) + return data.get('epoch_idx', None) + + def load_ckpt(self, path, load_optm = True): + epoch_idx = self.load_pretrained(path + '/net.pt', self.net_dict) + if load_optm: + if os.path.exists(path + '/optm.pt'): + self.load_pretrained(path + '/optm.pt', self.optm_dict) + else: + print('# Optimizer not found!') + return epoch_idx + + # @staticmethod + def save_trained(self, path, dict_): + data = {} + for k in dict_: + data[k] = dict_[k].state_dict() + data.update({ + 'epoch_idx': self.epoch_idx, + }) + torch.save(data, path) + + def save_ckpt(self, path, save_optm = True): + self.save_trained(path + '/net.pt', self.net_dict) + if save_optm: + self.save_trained(path + '/optm.pt', self.optm_dict) + + def zero_grad(self): + if self.update_keys is None: + update_keys = self.optm_dict.keys() + else: + update_keys = self.update_keys + for k in update_keys: + self.optm_dict[k].zero_grad() + + def step(self): + if self.update_keys is None: + update_keys = self.optm_dict.keys() + else: + update_keys = self.update_keys + for k in update_keys: + self.optm_dict[k].step() + + def update_lr(self, iter_idx): + lr_dict = {} + if self.update_keys is None: + update_keys = self.optm_dict.keys() + else: + update_keys = self.update_keys + for k in update_keys: + lr = self.lr_schedule_dict[k].get_learning_rate(iter_idx) + for param_group in self.optm_dict[k].param_groups: + param_group['lr'] = lr + lr_dict[k] = lr + return lr_dict + + def set_dataset(self, dataset): + self.dataset = dataset + + def set_network(self, network): + self.network = network + + def set_net_dict(self, net_dict): + self.net_dict = net_dict + + def set_optm_dict(self, optm_dict): + self.optm_dict = optm_dict + + def set_update_keys(self, update_keys): + self.update_keys = update_keys + + def set_lr_schedule_dict(self, lr_schedule_dict): + self.lr_schedule_dict = lr_schedule_dict + + def set_train(self, flag = True): + if flag: + for k, net in self.net_dict.items(): + if k in self.update_keys: + net.train() + else: + net.eval() + else: + for k, net in self.net_dict.items(): + net.eval() + + def train(self): + # log + os.makedirs(self.opt['train']['net_ckpt_dir'], exist_ok = True) + log_dir = self.opt['train']['net_ckpt_dir'] + '/' + datetime.datetime.now().strftime('%Y_%m_%d_%H_%M_%S') + os.makedirs(log_dir, exist_ok = True) + writer = SummaryWriter(log_dir) + yaml.dump(self.opt, open(log_dir + '/config_bk.yaml', 'w'), sort_keys = False) + + self.set_train() + self.dataset.training = True + batch_size = self.opt['train'].get('batch_size', 1) + num_workers = self.opt['train'].get('num_workers', 0) + dataloader = torch.utils.data.DataLoader(self.dataset, + batch_size = batch_size, + shuffle = True, + num_workers = num_workers, + worker_init_fn = worker_init_fn, + drop_last = True) + self.batch_num = len(self.dataset) // batch_size + + if self.opt['train'].get('save_init_ckpt', False) and self.opt['train'].get('start_epoch', 0) == 0: + init_folder = self.opt['train']['net_ckpt_dir'] + '/init_ckpt' + if not os.path.exists(init_folder) or self.opt['train']['start_epoch'] == 0: + os.makedirs(init_folder, exist_ok = True) + self.save_ckpt(init_folder, False) + else: + print('# Init checkpoint has been saved!') + + if self.opt['train']['prev_ckpt'] is not None: + start_epoch = self.load_ckpt(self.opt['train']['prev_ckpt']) + 1 + else: + prev_ckpt_path = self.opt['train']['net_ckpt_dir'] + '/epoch_latest' + if os.path.exists(prev_ckpt_path): + start_epoch = self.load_ckpt(prev_ckpt_path) + 1 + else: + start_epoch = None + + if start_epoch is None: + start_epoch = self.opt['train'].get('start_epoch', 0) + end_epoch = self.opt['train'].get('end_epoch', 999) + + forward_one_pass = self.forward_one_pass + + for epoch_idx in range(start_epoch, end_epoch): + self.epoch_idx = epoch_idx + self.update_config_before_epoch(epoch_idx) + epoch_losses = dict() + + time0 = time.time() + for batch_idx, items in enumerate(dataloader): + iter_idx = batch_idx + self.batch_num * epoch_idx + self.iter_idx = iter_idx + lr_dict = self.update_lr(iter_idx) + items = to_cuda(items) + + loss, batch_losses = forward_one_pass(items) + # self.zero_grad() + # loss.backward() + # self.step() + + # record batch loss + log_info = 'epoch %d, batch %d, ' % (epoch_idx, batch_idx) + log_info += 'lr: ' + for k in lr_dict.keys(): + log_info += '%s %e, ' % (k, lr_dict[k]) + for key in batch_losses.keys(): + log_info = log_info + ('%s: %f, ' % (key, batch_losses[key])) + writer.add_scalar('%s/Batch' % key, batch_losses[key], iter_idx) + if key in epoch_losses: + epoch_losses[key] += batch_losses[key] + else: + epoch_losses[key] = batch_losses[key] + print(log_info) + + with open(os.path.join(log_dir, 'loss.txt'), 'a') as fp: + # record loss weight + if batch_idx == 0: + loss_weights_info = '' + for k in self.opt['train']['loss_weight'].keys(): + loss_weights_info += '%s: %f, ' % (k, self.opt['train']['loss_weight'][k]) + fp.write('# Loss weights: \n' + loss_weights_info + '\n') + fp.write(log_info + '\n') + + if iter_idx % self.opt['train']['ckpt_interval']['batch'] == 0 and iter_idx != 0: + for folder in glob.glob(self.opt['train']['net_ckpt_dir'] + '/batch_*'): + shutil.rmtree(folder) + model_folder = self.opt['train']['net_ckpt_dir'] + '/batch_%d' % iter_idx + os.makedirs(model_folder, exist_ok = True) + self.save_ckpt(model_folder, save_optm = False) + + if iter_idx % self.opt['train']['eval_interval'] == 0 and iter_idx != 0: + # if True: + self.mini_test() + self.set_train() + time1 = time.time() + print('One iteration costs %f secs' % (time1 - time0)) + time0 = time1 + + if iter_idx == self.iter_num: + return + + """ EPOCH """ + # record epoch loss + for key in epoch_losses.keys(): + epoch_losses[key] /= self.batch_num + writer.add_scalar('%s/Epoch' % key, epoch_losses[key], epoch_idx) + + if epoch_idx % self.opt['train']['ckpt_interval']['epoch'] == 0: + model_folder = self.opt['train']['net_ckpt_dir'] + '/epoch_%d' % epoch_idx + os.makedirs(model_folder, exist_ok = True) + self.save_ckpt(model_folder) + + if self.batch_num > 50: + latest_folder = self.opt['train']['net_ckpt_dir'] + '/epoch_latest' + os.makedirs(latest_folder, exist_ok = True) + self.save_ckpt(latest_folder) + writer.close() + + @torch.no_grad() + def mini_test(self): + """ Test during training """ + pass + + def forward_one_pass(self, items): + raise NotImplementedError('"forward_one_pass" method is not implemented!') + + def update_config_before_epoch(self, epoch_idx): + pass diff --git a/AnimatableGaussians/cat.sh b/AnimatableGaussians/cat.sh new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/AnimatableGaussians/config.py b/AnimatableGaussians/config.py new file mode 100644 index 0000000000000000000000000000000000000000..7057242c57f6e6c5bdff30aa5d1d0009093a3dc5 --- /dev/null +++ b/AnimatableGaussians/config.py @@ -0,0 +1,35 @@ +import torch +import numpy as np +import math +import os + +device = torch.device('cuda:0') + +# SMPL related +cano_smpl_pose = np.zeros(75, dtype = np.float32) +cano_smpl_pose[3+3*1+2] = math.radians(25) +cano_smpl_pose[3+3*2+2] = math.radians(-25) +cano_smpl_pose = torch.from_numpy(cano_smpl_pose) +cano_smpl_transl = cano_smpl_pose[:3] +cano_smpl_global_orient = cano_smpl_pose[3:6] +cano_smpl_body_pose = cano_smpl_pose[6:69] + +# fist pose +left_hand_pose = torch.tensor([0.09001956135034561, 0.1604590266942978, -0.3295670449733734, 0.12445037066936493, -0.11897698789834976, -1.5051144361495972, -0.1194705069065094, -0.16281449794769287, -0.6292539834976196, -0.27713727951049805, 0.035170216113328934, -0.5893177390098572, -0.20759613811969757, 0.07492011040449142, -1.4485805034637451, -0.017797302454710007, -0.12478633224964142, -0.7844052314758301, -0.4157009720802307, -0.5140947103500366, -0.2961726784706116, -0.7421528100967407, -0.11505582183599472, -0.7972996830940247, -0.29345276951789856, -0.18898937106132507, -0.6230823397636414, -0.18764786422252655, -0.2696149945259094, -0.5542467832565308, -0.47717514634132385, -0.12663133442401886, -1.2747308015823364, -0.23940050601959229, -0.1586960405111313, -0.7655659914016724, 0.8745182156562805, 0.5848557353019714, -0.07204405218362808, -0.5052485466003418, 0.1797526329755783, 0.3281439244747162, 0.5276764035224915, -0.008714836090803146, -0.4373648762702942], dtype = torch.float32) +right_hand_pose = torch.tensor([0.034751810133457184, -0.12605343759059906, 0.5510415434837341, 0.19454114139080048, 0.11147838830947876, 1.4676157236099243, -0.14799435436725616, 0.17293521761894226, 0.4679432511329651, -0.3042353689670563, 0.007868679240345955, 0.8570928573608398, -0.1827319711446762, -0.07225851714611053, 1.307037591934204, -0.02989627793431282, 0.1208646297454834, 0.7142824530601501, -0.3403030335903168, 0.5368582606315613, 0.3839572072029114, -0.9722614884376526, 0.17358140647411346, 0.911861002445221, -0.29665058851242065, 0.21779759228229523, 0.7269846796989441, -0.15343312919139862, 0.3083758056163788, 0.7146623730659485, -0.5153037309646606, 0.1721675992012024, 1.2982604503631592, -0.2590428292751312, 0.12812566757202148, 0.7502076029777527, 0.8694817423820496, -0.5263001322746277, 0.06934576481580734, -0.4630220830440521, -0.19237111508846283, -0.25436165928840637, 0.5972414612770081, -0.08250168710947037, 0.5013565421104431], dtype = torch.float32) + + +# project +PROJ_DIR = os.path.dirname(os.path.realpath(__file__)) + +opt = dict() + + +def load_global_opt(path): + import yaml + global opt + opt = yaml.load(open(path, encoding = 'UTF-8'), Loader = yaml.FullLoader) + +def set_opt(new_opt): + global opt + opt = new_opt diff --git a/AnimatableGaussians/configs/awesome_amass_poses.yaml b/AnimatableGaussians/configs/awesome_amass_poses.yaml new file mode 100644 index 0000000000000000000000000000000000000000..32f98d0497150dc49e6391d1c9585b55620bd171 --- /dev/null +++ b/AnimatableGaussians/configs/awesome_amass_poses.yaml @@ -0,0 +1,25 @@ +# CMU sub-dataset +basketball: + - ./CMU/06/06_13_poses.npz + - ./CMU/06/06_14_poses.npz +tennis: + - ./CMU/02/02_08_poses.npz + - ./CMU/02/02_09_poses.npz +football: + - ./CMU/10/10_05_poses.npz + - ./CMU/11/11_01_poses.npz +punch: + - ./CMU/15/15_13_poses.npz +kick: + - ./CMU/144/144_05_poses.npz +others: + - ./CMU/144/144_28_poses.npz +dancing: + - ./CMU/131/131_03_poses.npz + +# MPI_mosh sub-dataset +dancing2: + - ./MPI_mosh/00059/misc_poses.npz + - ./MPI_mosh/00093/irish_dance_poses.npz + - ./MPI_mosh/00093/misc_poses.npz + - ./MPI_mosh/50004/misc_poses.npz \ No newline at end of file diff --git a/AnimatableGaussians/configs/huawei_0425/avatar.yaml b/AnimatableGaussians/configs/huawei_0425/avatar.yaml new file mode 100644 index 0000000000000000000000000000000000000000..985d689529742c4485028c2108612feb47f21c06 --- /dev/null +++ b/AnimatableGaussians/configs/huawei_0425/avatar.yaml @@ -0,0 +1,75 @@ +mode: train +train: + dataset: MvRgbDatasetAvatarReX + data: + subject_name: huawei0425 + data_dir: ../data/body_data + frame_range: &id001 + - 124 + - 144 + - 1 + used_cam_ids: + - 0 + - 1 + - 2 + - 3 + - 4 + - 5 + - 6 + - 8 + - 9 + - 10 + - 11 + - 12 + - 14 + - 15 + load_smpl_pos_map: true + pretrained_dir: null + net_ckpt_dir: ./results/huawei0425/avatar + prev_ckpt: null + ckpt_interval: + epoch: 10 + batch: 50000 + eval_interval: 1000 + eval_training_ids: + - 190 + - 7 + eval_testing_ids: + - 354 + - 7 + eval_img_factor: 1.0 + lr_init: 0.0005 + loss_weight: + l1: 1.0 + lpips: 0.1 + offset: 0.005 + finetune_color: false + batch_size: 1 + num_workers: 8 + random_bg_color: true +test: + dataset: MvRgbDatasetAvatarReX + data: + data_dir: ../data/body_data + frame_range: [0, 500] + subject_name: huawei0425 + pose_data: + data_path: ../data/AMASS/test_poses_ours.npz + frame_range: [0, 1000] +# data_path: Z:/Data/Pose/AMASS/CMU/06/06_13_poses.npz +# data_path: Z:/Data/Pose/AMASS/CMU/10/10_05_poses.npz +# frame_interval: 4 + view_setting: front + render_view_idx: 13 + global_orient: true + img_scale: 1.0 + save_mesh: false + render_skeleton: false + save_tex_map: false + save_ply: true + n_pca: 20 + sigma_pca: 2.0 + prev_ckpt: ../checkpoints/body_avatar +model: + with_viewdirs: true + random_style: false \ No newline at end of file diff --git a/AnimatableGaussians/configs/huawei_0425/avatar1.yaml b/AnimatableGaussians/configs/huawei_0425/avatar1.yaml new file mode 100644 index 0000000000000000000000000000000000000000..19c51485f5e4ba5404d8e15bb520057e1751525a --- /dev/null +++ b/AnimatableGaussians/configs/huawei_0425/avatar1.yaml @@ -0,0 +1,75 @@ +mode: train +train: + dataset: MvRgbDatasetAvatarReX + data: + subject_name: dx1test + data_dir: /home/pengc02/pengcheng/projects/gaussian_avatar/ag_gha/smplparam + frame_range: &id001 + - 124 + - 144 + - 1 + used_cam_ids: + - 0 + - 1 + - 2 + - 3 + - 4 + - 5 + - 6 + - 8 + - 9 + - 10 + - 11 + - 12 + - 14 + - 15 + load_smpl_pos_map: true + pretrained_dir: null + net_ckpt_dir: ./results/huawei0425/avatar1 + prev_ckpt: null + ckpt_interval: + epoch: 10 + batch: 50000 + eval_interval: 1000 + eval_training_ids: + - 190 + - 7 + eval_testing_ids: + - 354 + - 7 + eval_img_factor: 1.0 + lr_init: 0.0005 + loss_weight: + l1: 1.0 + lpips: 0.1 + offset: 0.005 + finetune_color: false + batch_size: 1 + num_workers: 8 + random_bg_color: true +test: + dataset: MvRgbDatasetAvatarReX + data: + data_dir: /home/pengc02/pengcheng/projects/gaussian_avatar/ag_gha/smplparam + frame_range: [0, 500] + subject_name: huawei0425 + pose_data: + data_path: ../data/AMASS/dx_pred_new.npz + frame_range: [0, 128] +# data_path: Z:/Data/Pose/AMASS/CMU/06/06_13_poses.npz +# data_path: Z:/Data/Pose/AMASS/CMU/10/10_05_poses.npz +# frame_interval: 4 + view_setting: front + render_view_idx: 13 + global_orient: true + img_scale: 1.0 + save_mesh: false + render_skeleton: false + save_tex_map: false + save_ply: true + n_pca: 20 + sigma_pca: 2.0 + prev_ckpt: ../checkpoints_new/body +model: + with_viewdirs: true + random_style: false \ No newline at end of file diff --git a/AnimatableGaussians/configs/huawei_0425/avatar2.yaml b/AnimatableGaussians/configs/huawei_0425/avatar2.yaml new file mode 100644 index 0000000000000000000000000000000000000000..fcb46376e0902e58fc0d1420f9f0877bc9a6137e --- /dev/null +++ b/AnimatableGaussians/configs/huawei_0425/avatar2.yaml @@ -0,0 +1,75 @@ +mode: train +train: + dataset: MvRgbDatasetAvatarReX + data: + subject_name: dx_long_1_debug + data_dir: /home/pengc02/pengcheng/projects/gaussian_avatar/ag_gha/smplparam + frame_range: &id001 + - 124 + - 144 + - 1 + used_cam_ids: + - 0 + - 1 + - 2 + - 3 + - 4 + - 5 + - 6 + - 8 + - 9 + - 10 + - 11 + - 12 + - 14 + - 15 + load_smpl_pos_map: true + pretrained_dir: null + net_ckpt_dir: ./results/huawei0425/avatar2 + prev_ckpt: null + ckpt_interval: + epoch: 10 + batch: 50000 + eval_interval: 1000 + eval_training_ids: + - 190 + - 7 + eval_testing_ids: + - 354 + - 7 + eval_img_factor: 1.0 + lr_init: 0.0005 + loss_weight: + l1: 1.0 + lpips: 0.1 + offset: 0.005 + finetune_color: false + batch_size: 1 + num_workers: 8 + random_bg_color: true +test: + dataset: MvRgbDatasetAvatarReX + data: + data_dir: /home/pengc02/pengcheng/projects/gaussian_avatar/ag_gha/smplparam + frame_range: [0, 500] + subject_name: huawei0425 + pose_data: + data_path: ../data/AMASS/dx_long_1_debug.npz + frame_range: [0, 270] +# data_path: Z:/Data/Pose/AMASS/CMU/06/06_13_poses.npz +# data_path: Z:/Data/Pose/AMASS/CMU/10/10_05_poses.npz +# frame_interval: 4 + view_setting: front + render_view_idx: 13 + global_orient: true + img_scale: 1.0 + save_mesh: false + render_skeleton: false + save_tex_map: false + save_ply: true + n_pca: 20 + sigma_pca: 2.0 + prev_ckpt: ../checkpoints_new/body +model: + with_viewdirs: true + random_style: false \ No newline at end of file diff --git a/AnimatableGaussians/configs/huawei_0425/nzc.yaml b/AnimatableGaussians/configs/huawei_0425/nzc.yaml new file mode 100644 index 0000000000000000000000000000000000000000..7e9dcfa3e0011bd6073f604b793db555a865b851 --- /dev/null +++ b/AnimatableGaussians/configs/huawei_0425/nzc.yaml @@ -0,0 +1,77 @@ +mode: train +train: + dataset: MvRgbDatasetAvatarReX + data: + subject_name: nzc_test_data_0916_comb_v2 + data_dir: /home/pengc02/pengcheng/projects/gaussian_avatar/ag_gha/smplparam_new + frame_range: &id001 + - 0 + - 200 + - 1 + used_cam_ids: + - 0 + - 1 + - 2 + - 3 + - 4 + - 5 + - 6 + - 8 + - 9 + - 10 + - 11 + - 12 + - 14 + - 15 + load_smpl_pos_map: true + pretrained_dir: null + net_ckpt_dir: ./results/huawei0425/avatar2 + prev_ckpt: null + ckpt_interval: + epoch: 10 + batch: 50000 + eval_interval: 1000 + eval_training_ids: + - 190 + - 7 + eval_testing_ids: + - 354 + - 7 + eval_img_factor: 1.0 + lr_init: 0.0005 + loss_weight: + l1: 1.0 + lpips: 0.1 + offset: 0.005 + finetune_color: false + batch_size: 1 + num_workers: 8 + random_bg_color: true +test: + dataset: MvRgbDatasetAvatarReX + data: + data_dir: /home/pengc02/pengcheng/projects/gaussian_avatar/ag_gha/smplparam_new + frame_range: [0, 800] + subject_name: huawei0425 + pose_data: + data_path: ../data/AMASS/dx_0916_comb_v2.npz + frame_range: [0, 300] +# data_path: Z:/Data/Pose/AMASS/CMU/06/06_13_poses.npz +# data_path: Z:/Data/Pose/AMASS/CMU/10/10_05_poses.npz +# frame_interval: 4 + view_setting: front + render_view_idx: 13 + global_orient: true + img_scale: 2.0 + save_mesh: false + render_skeleton: false + save_tex_map: false + save_ply: true + fix_hand: true + fix_hand_id: 23 + n_pca: 20 + sigma_pca: 2.0 + prev_ckpt: ../checkpoints_new_v2/body +model: + with_viewdirs: true + random_style: false \ No newline at end of file diff --git a/AnimatableGaussians/configs/huawei_0425/nzc_new.yaml b/AnimatableGaussians/configs/huawei_0425/nzc_new.yaml new file mode 100644 index 0000000000000000000000000000000000000000..e09c8ff1c2b04f03f1a6169ea242a120da498f8d --- /dev/null +++ b/AnimatableGaussians/configs/huawei_0425/nzc_new.yaml @@ -0,0 +1,77 @@ +mode: train +train: + dataset: MvRgbDatasetAvatarReX + data: + subject_name: 0921_nzc_lz + data_dir: /home/pengc02/pengcheng/projects/gaussian_avatar/ag_gha/smplparam + frame_range: &id001 + - 0 + - 200 + - 1 + used_cam_ids: + - 0 + - 1 + - 2 + - 3 + - 4 + - 5 + - 6 + - 8 + - 9 + - 10 + - 11 + - 12 + - 14 + - 15 + load_smpl_pos_map: true + pretrained_dir: null + net_ckpt_dir: ./results/huawei0425/avatar2 + prev_ckpt: null + ckpt_interval: + epoch: 10 + batch: 50000 + eval_interval: 1000 + eval_training_ids: + - 190 + - 7 + eval_testing_ids: + - 354 + - 7 + eval_img_factor: 1.0 + lr_init: 0.0005 + loss_weight: + l1: 1.0 + lpips: 0.1 + offset: 0.005 + finetune_color: false + batch_size: 1 + num_workers: 8 + random_bg_color: true +test: + dataset: MvRgbDatasetAvatarReX + data: + data_dir: /home/pengc02/pengcheng/projects/gaussian_avatar/ag_gha/smplparam + frame_range: [0, 800] + subject_name: huawei0425 + pose_data: + data_path: ../data/AMASS/dx_0916_comb_v2.npz + frame_range: [0, 300] +# data_path: Z:/Data/Pose/AMASS/CMU/06/06_13_poses.npz +# data_path: Z:/Data/Pose/AMASS/CMU/10/10_05_poses.npz +# frame_interval: 4 + view_setting: front + render_view_idx: 13 + global_orient: true + img_scale: 2.0 + save_mesh: false + render_skeleton: false + save_tex_map: false + save_ply: true + fix_hand: true + fix_hand_id: 23 + n_pca: 20 + sigma_pca: 2.0 + prev_ckpt: ../checkpoints_new/body +model: + with_viewdirs: true + random_style: false \ No newline at end of file diff --git a/AnimatableGaussians/configs/new0829/avatar.yaml b/AnimatableGaussians/configs/new0829/avatar.yaml new file mode 100644 index 0000000000000000000000000000000000000000..830d6d6f596bfd944a60ad286b0ac7b25c89fca2 --- /dev/null +++ b/AnimatableGaussians/configs/new0829/avatar.yaml @@ -0,0 +1,75 @@ +mode: train +train: + dataset: MvRgbDatasetAvatarReX + data: + subject_name: new0829 + data_dir: ../data/body_data + frame_range: &id001 + - 124 + - 144 + - 1 + used_cam_ids: + - 0 + - 1 + - 2 + - 3 + - 4 + - 5 + - 6 + - 8 + - 9 + - 10 + - 11 + - 12 + - 14 + - 15 + load_smpl_pos_map: true + pretrained_dir: null + net_ckpt_dir: ./results/huawei0425/avatar + prev_ckpt: null + ckpt_interval: + epoch: 10 + batch: 50000 + eval_interval: 1000 + eval_training_ids: + - 190 + - 7 + eval_testing_ids: + - 354 + - 7 + eval_img_factor: 1.0 + lr_init: 0.0005 + loss_weight: + l1: 1.0 + lpips: 0.1 + offset: 0.005 + finetune_color: false + batch_size: 1 + num_workers: 8 + random_bg_color: true +test: + dataset: MvRgbDatasetAvatarReX + data: + data_dir: ../data/body_data + frame_range: [0, 500] + subject_name: new0829 + pose_data: + data_path: ../data/AMASS/test_poses_ours.npz + frame_range: [0, 1000] +# data_path: Z:/Data/Pose/AMASS/CMU/06/06_13_poses.npz +# data_path: Z:/Data/Pose/AMASS/CMU/10/10_05_poses.npz +# frame_interval: 4 + view_setting: front + render_view_idx: 13 + global_orient: true + img_scale: 1.0 + save_mesh: false + render_skeleton: false + save_tex_map: false + save_ply: true + n_pca: 20 + sigma_pca: 2.0 + prev_ckpt: ../checkpoints_new/body +model: + with_viewdirs: true + random_style: false \ No newline at end of file diff --git a/AnimatableGaussians/configs/pengcheng/0921_nzc_ckpt_ys.yaml b/AnimatableGaussians/configs/pengcheng/0921_nzc_ckpt_ys.yaml new file mode 100644 index 0000000000000000000000000000000000000000..b5e6128f847fc9858624e9a64e3fc4bf193fc7cb --- /dev/null +++ b/AnimatableGaussians/configs/pengcheng/0921_nzc_ckpt_ys.yaml @@ -0,0 +1,77 @@ +mode: train +train: + dataset: MvRgbDatasetAvatarReX + data: + subject_name: 0921_nzc_lz + data_dir: /home/pengc02/pengcheng/projects/gaussian_avatar/ag_gha/smplparam_new + frame_range: &id001 + - 0 + - 200 + - 1 + used_cam_ids: + - 0 + - 1 + - 2 + - 3 + - 4 + - 5 + - 6 + - 8 + - 9 + - 10 + - 11 + - 12 + - 14 + - 15 + load_smpl_pos_map: true + pretrained_dir: null + net_ckpt_dir: ./results/huawei0425/avatar2 + prev_ckpt: null + ckpt_interval: + epoch: 10 + batch: 50000 + eval_interval: 1000 + eval_training_ids: + - 190 + - 7 + eval_testing_ids: + - 354 + - 7 + eval_img_factor: 1.0 + lr_init: 0.0005 + loss_weight: + l1: 1.0 + lpips: 0.1 + offset: 0.005 + finetune_color: false + batch_size: 1 + num_workers: 8 + random_bg_color: true +test: + dataset: MvRgbDatasetAvatarReX + data: + data_dir: /home/pengc02/pengcheng/projects/gaussian_avatar/ag_gha/smplparam_lz + frame_range: [0, 800] + subject_name: huawei0425 + pose_data: + data_path: ../data/AMASS/dx_0916_comb_v2.npz + frame_range: [0, 300] +# data_path: Z:/Data/Pose/AMASS/CMU/06/06_13_poses.npz +# data_path: Z:/Data/Pose/AMASS/CMU/10/10_05_poses.npz +# frame_interval: 4 + view_setting: front + render_view_idx: 13 + global_orient: true + img_scale: 2.0 + save_mesh: false + render_skeleton: false + save_tex_map: false + save_ply: true + fix_hand: true + fix_hand_id: 23 + n_pca: 20 + sigma_pca: 2.0 + prev_ckpt: ../checkpoints_cys/body12 +model: + with_viewdirs: true + random_style: false \ No newline at end of file diff --git a/AnimatableGaussians/configs/pengcheng/0923_cys.yaml b/AnimatableGaussians/configs/pengcheng/0923_cys.yaml new file mode 100644 index 0000000000000000000000000000000000000000..106cb029009bc2e3256b01fb0857c2961c6d9673 --- /dev/null +++ b/AnimatableGaussians/configs/pengcheng/0923_cys.yaml @@ -0,0 +1,77 @@ +mode: train +train: + dataset: MvRgbDatasetAvatarReX + data: + subject_name: 0923_cys + data_dir: /home/pengc02/pengcheng/projects/gaussian_avatar/avatar_final/data/pos_map_ys/body_mix + frame_range: &id001 + - 0 + - 200 + - 1 + used_cam_ids: + - 0 + - 1 + - 2 + - 3 + - 4 + - 5 + - 6 + - 8 + - 9 + - 10 + - 11 + - 12 + - 14 + - 15 + load_smpl_pos_map: true + pretrained_dir: null + net_ckpt_dir: ./results/huawei0425/avatar2 + prev_ckpt: null + ckpt_interval: + epoch: 10 + batch: 50000 + eval_interval: 1000 + eval_training_ids: + - 190 + - 7 + eval_testing_ids: + - 354 + - 7 + eval_img_factor: 1.0 + lr_init: 0.0005 + loss_weight: + l1: 1.0 + lpips: 0.1 + offset: 0.005 + finetune_color: false + batch_size: 1 + num_workers: 8 + random_bg_color: true +test: + dataset: MvRgbDatasetAvatarReX + data: + data_dir: /home/pengc02/pengcheng/projects/gaussian_avatar/avatar_final/data/pos_map_ys/body_mix + frame_range: [0, 800] + subject_name: huawei0425 + pose_data: + data_path: ../data/AMASS/dx_0916_comb_v2.npz + frame_range: [0, 300] +# data_path: Z:/Data/Pose/AMASS/CMU/06/06_13_poses.npz +# data_path: Z:/Data/Pose/AMASS/CMU/10/10_05_poses.npz +# frame_interval: 4 + view_setting: front + render_view_idx: 13 + global_orient: true + img_scale: 2.0 + save_mesh: false + render_skeleton: false + save_tex_map: false + save_ply: true + fix_hand: true + fix_hand_id: 23 + n_pca: 20 + sigma_pca: 2.0 + prev_ckpt: ../checkpoints/body_ys +model: + with_viewdirs: true + random_style: false \ No newline at end of file diff --git a/AnimatableGaussians/configs/pengcheng/0924_nzc_new_pose.yaml b/AnimatableGaussians/configs/pengcheng/0924_nzc_new_pose.yaml new file mode 100644 index 0000000000000000000000000000000000000000..994f7330b5a813e39ce15dc09a30964227d3daae --- /dev/null +++ b/AnimatableGaussians/configs/pengcheng/0924_nzc_new_pose.yaml @@ -0,0 +1,77 @@ +mode: train +train: + dataset: MvRgbDatasetAvatarReX + data: + subject_name: 0924_new_pose + data_dir: /home/pengc02/pengcheng/projects/gaussian_avatar/avatar_final/data/pos_map_ys/body_mix + frame_range: &id001 + - 0 + - 200 + - 1 + used_cam_ids: + - 0 + - 1 + - 2 + - 3 + - 4 + - 5 + - 6 + - 8 + - 9 + - 10 + - 11 + - 12 + - 14 + - 15 + load_smpl_pos_map: true + pretrained_dir: null + net_ckpt_dir: ./results/huawei0425/avatar2 + prev_ckpt: null + ckpt_interval: + epoch: 10 + batch: 50000 + eval_interval: 1000 + eval_training_ids: + - 190 + - 7 + eval_testing_ids: + - 354 + - 7 + eval_img_factor: 1.0 + lr_init: 0.0005 + loss_weight: + l1: 1.0 + lpips: 0.1 + offset: 0.005 + finetune_color: false + batch_size: 1 + num_workers: 8 + random_bg_color: true +test: + dataset: MvRgbDatasetAvatarReX + data: + data_dir: /home/pengc02/pengcheng/projects/gaussian_avatar/avatar_final/data/pos_map_ys/body_mix + frame_range: [0, 800] + subject_name: huawei0425 + pose_data: + data_path: ../data/AMASS/dx_0924.npz + frame_range: [0, 200] +# data_path: Z:/Data/Pose/AMASS/CMU/06/06_13_poses.npz +# data_path: Z:/Data/Pose/AMASS/CMU/10/10_05_poses.npz +# frame_interval: 4 + view_setting: front + render_view_idx: 13 + global_orient: true + img_scale: 2.0 + save_mesh: false + render_skeleton: false + save_tex_map: false + save_ply: true + fix_hand: true + fix_hand_id: 23 + n_pca: 20 + sigma_pca: 2.0 + prev_ckpt: ../checkpoints/body_ys +model: + with_viewdirs: true + random_style: false \ No newline at end of file diff --git a/AnimatableGaussians/configs/pengcheng/0925_nzc_new_pose.yaml b/AnimatableGaussians/configs/pengcheng/0925_nzc_new_pose.yaml new file mode 100644 index 0000000000000000000000000000000000000000..acdf9e0c7ef6c0a9a0bad81d6b39992986a84bb4 --- /dev/null +++ b/AnimatableGaussians/configs/pengcheng/0925_nzc_new_pose.yaml @@ -0,0 +1,77 @@ +mode: train +train: + dataset: MvRgbDatasetAvatarReX + data: + subject_name: 0926_new_pose + data_dir: /home/pengc02/pengcheng/projects/gaussian_avatar/avatar_final/data/pos_map_ys/body_mix + frame_range: &id001 + - 0 + - 200 + - 1 + used_cam_ids: + - 0 + - 1 + - 2 + - 3 + - 4 + - 5 + - 6 + - 8 + - 9 + - 10 + - 11 + - 12 + - 14 + - 15 + load_smpl_pos_map: true + pretrained_dir: null + net_ckpt_dir: ./results/huawei0425/avatar2 + prev_ckpt: null + ckpt_interval: + epoch: 10 + batch: 50000 + eval_interval: 1000 + eval_training_ids: + - 190 + - 7 + eval_testing_ids: + - 354 + - 7 + eval_img_factor: 1.0 + lr_init: 0.0005 + loss_weight: + l1: 1.0 + lpips: 0.1 + offset: 0.005 + finetune_color: false + batch_size: 1 + num_workers: 8 + random_bg_color: true +test: + dataset: MvRgbDatasetAvatarReX + data: + data_dir: /home/pengc02/pengcheng/projects/gaussian_avatar/avatar_final/data/pos_map_ys/body_mix + frame_range: [0, 800] + subject_name: huawei0425 + pose_data: + data_path: ../data/AMASS/0926_dx_happy.npz + frame_range: [0, 200] +# data_path: Z:/Data/Pose/AMASS/CMU/06/06_13_poses.npz +# data_path: Z:/Data/Pose/AMASS/CMU/10/10_05_poses.npz +# frame_interval: 4 + view_setting: front + render_view_idx: 13 + global_orient: true + img_scale: 2.0 + save_mesh: false + render_skeleton: false + save_tex_map: false + save_ply: true + fix_hand: true + fix_hand_id: 23 + n_pca: 20 + sigma_pca: 2.0 + prev_ckpt: ../checkpoints/body_ys +model: + with_viewdirs: true + random_style: false \ No newline at end of file diff --git a/AnimatableGaussians/configs/pengcheng/0926_nzc_new_pose.yaml b/AnimatableGaussians/configs/pengcheng/0926_nzc_new_pose.yaml new file mode 100644 index 0000000000000000000000000000000000000000..76890be368c05eabc74779c9a9cedd7e344711d2 --- /dev/null +++ b/AnimatableGaussians/configs/pengcheng/0926_nzc_new_pose.yaml @@ -0,0 +1,78 @@ +mode: train +train: + dataset: MvRgbDatasetAvatarReX + data: + subject_name: 0926_pose_long + data_dir: /home/pengc02/pengcheng/projects/gaussian_avatar/avatar_final/data/pos_map_ys/body_mix + frame_range: &id001 + - 0 + - 200 + - 1 + used_cam_ids: + - 0 + - 1 + - 2 + - 3 + - 4 + - 5 + - 6 + - 8 + - 9 + - 10 + - 11 + - 12 + - 14 + - 15 + load_smpl_pos_map: true + pretrained_dir: null + net_ckpt_dir: ./results/huawei0425/avatar2 + prev_ckpt: null + ckpt_interval: + epoch: 10 + batch: 50000 + eval_interval: 1000 + eval_training_ids: + - 190 + - 7 + eval_testing_ids: + - 354 + - 7 + eval_img_factor: 1.0 + lr_init: 0.0005 + loss_weight: + l1: 1.0 + lpips: 0.1 + offset: 0.005 + finetune_color: false + batch_size: 1 + num_workers: 8 + random_bg_color: true +test: + dataset: MvRgbDatasetAvatarReX + data: + data_dir: /home/pengc02/pengcheng/projects/gaussian_avatar/avatar_final/data/pos_map_ys/body_mix + frame_range: [0, 800] + subject_name: huawei0425 + pose_data: + data_path: ../data/AMASS/dx_0926_long_v1.npz + frame_range: [0, 2000] +# data_path: Z:/Data/Pose/AMASS/CMU/06/06_13_poses.npz +# data_path: Z:/Data/Pose/AMASS/CMU/10/10_05_poses.npz +# frame_interval: 4 + # view_setting: front + view_setting: degree120 + render_view_idx: 13 + global_orient: true + img_scale: 2.0 + save_mesh: false + render_skeleton: false + save_tex_map: false + save_ply: true + fix_hand: true + fix_hand_id: 23 + n_pca: 20 + sigma_pca: 2.0 + prev_ckpt: ../checkpoints/body_ys +model: + with_viewdirs: true + random_style: false \ No newline at end of file diff --git a/AnimatableGaussians/configs/pengcheng/0929_lodge.yaml b/AnimatableGaussians/configs/pengcheng/0929_lodge.yaml new file mode 100644 index 0000000000000000000000000000000000000000..5836b72afd3a3bf74fa5098fddbc715fa9a88135 --- /dev/null +++ b/AnimatableGaussians/configs/pengcheng/0929_lodge.yaml @@ -0,0 +1,78 @@ +mode: train +train: + dataset: MvRgbDatasetAvatarReX + data: + subject_name: 0929_lodge_012 + data_dir: /home/pengc02/pengcheng/projects/gaussian_avatar/avatar_final/data/pos_map_ys/body_mix + frame_range: &id001 + - 0 + - 200 + - 1 + used_cam_ids: + - 0 + - 1 + - 2 + - 3 + - 4 + - 5 + - 6 + - 8 + - 9 + - 10 + - 11 + - 12 + - 14 + - 15 + load_smpl_pos_map: true + pretrained_dir: null + net_ckpt_dir: ./results/huawei0425/avatar2 + prev_ckpt: null + ckpt_interval: + epoch: 10 + batch: 50000 + eval_interval: 1000 + eval_training_ids: + - 190 + - 7 + eval_testing_ids: + - 354 + - 7 + eval_img_factor: 1.0 + lr_init: 0.0005 + loss_weight: + l1: 1.0 + lpips: 0.1 + offset: 0.005 + finetune_color: false + batch_size: 1 + num_workers: 8 + random_bg_color: true +test: + dataset: MvRgbDatasetAvatarReX + data: + data_dir: /home/pengc02/pengcheng/projects/gaussian_avatar/avatar_final/data/pos_map_ys/body_mix + frame_range: [0, 800] + subject_name: huawei0425 + pose_data: + data_path: ../data/AMASS/012.npz + frame_range: [0, 2000] +# data_path: Z:/Data/Pose/AMASS/CMU/06/06_13_poses.npz +# data_path: Z:/Data/Pose/AMASS/CMU/10/10_05_poses.npz +# frame_interval: 4 + # view_setting: front + view_setting: front + render_view_idx: 13 + global_orient: true + img_scale: 2.0 + save_mesh: false + render_skeleton: false + save_tex_map: false + save_ply: true + fix_hand: true + fix_hand_id: 23 + n_pca: 20 + sigma_pca: 2.0 + prev_ckpt: ../checkpoints/body_ys +model: + with_viewdirs: true + random_style: false \ No newline at end of file diff --git a/AnimatableGaussians/configs/pengcheng/0930_sing.yaml b/AnimatableGaussians/configs/pengcheng/0930_sing.yaml new file mode 100644 index 0000000000000000000000000000000000000000..eadf64254bddeec5d2ecafad19e9db7a79f6f73d --- /dev/null +++ b/AnimatableGaussians/configs/pengcheng/0930_sing.yaml @@ -0,0 +1,78 @@ +mode: train +train: + dataset: MvRgbDatasetAvatarReX + data: + subject_name: 0930_sing_free + data_dir: /home/pengc02/pengcheng/projects/gaussian_avatar/avatar_final/data/pos_map_ys/body_mix + frame_range: &id001 + - 0 + - 200 + - 1 + used_cam_ids: + - 0 + - 1 + - 2 + - 3 + - 4 + - 5 + - 6 + - 8 + - 9 + - 10 + - 11 + - 12 + - 14 + - 15 + load_smpl_pos_map: true + pretrained_dir: null + net_ckpt_dir: ./results/huawei0425/avatar2 + prev_ckpt: null + ckpt_interval: + epoch: 10 + batch: 50000 + eval_interval: 1000 + eval_training_ids: + - 190 + - 7 + eval_testing_ids: + - 354 + - 7 + eval_img_factor: 1.0 + lr_init: 0.0005 + loss_weight: + l1: 1.0 + lpips: 0.1 + offset: 0.005 + finetune_color: false + batch_size: 1 + num_workers: 8 + random_bg_color: true +test: + dataset: MvRgbDatasetAvatarReX + data: + data_dir: /home/pengc02/pengcheng/projects/gaussian_avatar/avatar_final/data/pos_map_ys/body_mix + frame_range: [0, 800] + subject_name: huawei0425 + pose_data: + data_path: ../data/AMASS/0930_sing.npz + frame_range: [0, 300] +# data_path: Z:/Data/Pose/AMASS/CMU/06/06_13_poses.npz +# data_path: Z:/Data/Pose/AMASS/CMU/10/10_05_poses.npz +# frame_interval: 4 + # view_setting: front + view_setting: free + render_view_idx: 13 + global_orient: true + img_scale: 2.0 + save_mesh: false + render_skeleton: false + save_tex_map: false + save_ply: true + fix_hand: true + fix_hand_id: 23 + n_pca: 20 + sigma_pca: 2.0 + prev_ckpt: ../checkpoints/body_ys +model: + with_viewdirs: true + random_style: false \ No newline at end of file diff --git a/AnimatableGaussians/configs/pengcheng/1002_nzc_new_pose.yaml b/AnimatableGaussians/configs/pengcheng/1002_nzc_new_pose.yaml new file mode 100644 index 0000000000000000000000000000000000000000..9f07efdecdb735f05fd2b50659852b4f6501ad95 --- /dev/null +++ b/AnimatableGaussians/configs/pengcheng/1002_nzc_new_pose.yaml @@ -0,0 +1,79 @@ +mode: train +train: + dataset: MvRgbDatasetAvatarReX + data: + subject_name: 1002_nzc_360_no_global + data_dir: /home/pengc02/pengcheng/projects/gaussian_avatar/avatar_final/data/pos_map_ys/body_mix + frame_range: &id001 + - 0 + - 200 + - 1 + used_cam_ids: + - 0 + - 1 + - 2 + - 3 + - 4 + - 5 + - 6 + - 8 + - 9 + - 10 + - 11 + - 12 + - 14 + - 15 + load_smpl_pos_map: true + pretrained_dir: null + net_ckpt_dir: ./results/huawei0425/avatar2 + prev_ckpt: null + ckpt_interval: + epoch: 10 + batch: 50000 + eval_interval: 1000 + eval_training_ids: + - 190 + - 7 + eval_testing_ids: + - 354 + - 7 + eval_img_factor: 1.0 + lr_init: 0.0005 + loss_weight: + l1: 1.0 + lpips: 0.1 + offset: 0.005 + finetune_color: false + batch_size: 1 + num_workers: 8 + random_bg_color: true +test: + dataset: MvRgbDatasetAvatarReX + data: + data_dir: /home/pengc02/pengcheng/projects/gaussian_avatar/avatar_final/data/pos_map_ys/body_mix + frame_range: [0, 800] + subject_name: huawei0425 + pose_data: + data_path: ../data/AMASS/dx_0926_long_v1.npz + frame_range: [0, 360] +# data_path: Z:/Data/Pose/AMASS/CMU/06/06_13_poses.npz +# data_path: Z:/Data/Pose/AMASS/CMU/10/10_05_poses.npz +# frame_interval: 4 + # view_setting: front + # view_setting: degree120 + view_setting: free + render_view_idx: 13 + global_orient: false + img_scale: 2.0 + save_mesh: false + render_skeleton: false + save_tex_map: false + save_ply: true + fix_hand: true + fix_hand_id: 23 + n_pca: 20 + sigma_pca: 2.0 + prev_ckpt: ../checkpoints/body_ys +model: + with_viewdirs: true + random_style: false \ No newline at end of file diff --git a/AnimatableGaussians/configs/pengcheng/1002_train_pose.yaml b/AnimatableGaussians/configs/pengcheng/1002_train_pose.yaml new file mode 100644 index 0000000000000000000000000000000000000000..f1d623a209184a56b559f3ea269adbe76ad66405 --- /dev/null +++ b/AnimatableGaussians/configs/pengcheng/1002_train_pose.yaml @@ -0,0 +1,79 @@ +mode: train +train: + dataset: MvRgbDatasetAvatarReX + data: + subject_name: 1002_train_pose + data_dir: /home/pengc02/pengcheng/projects/gaussian_avatar/avatar_final/data/pos_map_ys/body_mix + frame_range: &id001 + - 0 + - 200 + - 1 + used_cam_ids: + - 0 + - 1 + - 2 + - 3 + - 4 + - 5 + - 6 + - 8 + - 9 + - 10 + - 11 + - 12 + - 14 + - 15 + load_smpl_pos_map: true + pretrained_dir: null + net_ckpt_dir: ./results/huawei0425/avatar2 + prev_ckpt: null + ckpt_interval: + epoch: 10 + batch: 50000 + eval_interval: 1000 + eval_training_ids: + - 190 + - 7 + eval_testing_ids: + - 354 + - 7 + eval_img_factor: 1.0 + lr_init: 0.0005 + loss_weight: + l1: 1.0 + lpips: 0.1 + offset: 0.005 + finetune_color: false + batch_size: 1 + num_workers: 8 + random_bg_color: true +test: + dataset: MvRgbDatasetAvatarReX + data: + data_dir: /home/pengc02/pengcheng/projects/gaussian_avatar/avatar_final/data/pos_map_ys/body_mix + frame_range: [0, 800] + subject_name: huawei0425 + pose_data: + data_path: ../data/AMASS/train_data_v4.npz + frame_range: [0, 300] +# data_path: Z:/Data/Pose/AMASS/CMU/06/06_13_poses.npz +# data_path: Z:/Data/Pose/AMASS/CMU/10/10_05_poses.npz +# frame_interval: 4 + # view_setting: front + # view_setting: degree120 + view_setting: free + render_view_idx: 13 + global_orient: true + img_scale: 2.0 + save_mesh: false + render_skeleton: false + save_tex_map: false + save_ply: true + fix_hand: true + fix_hand_id: 23 + n_pca: 20 + sigma_pca: 2.0 + prev_ckpt: ../checkpoints/body_ys +model: + with_viewdirs: true + random_style: false \ No newline at end of file diff --git a/AnimatableGaussians/configs/pengcheng/1003_cat_pose.yaml b/AnimatableGaussians/configs/pengcheng/1003_cat_pose.yaml new file mode 100644 index 0000000000000000000000000000000000000000..ef410a048ebd282e695ffac54fe46ccfe6be4928 --- /dev/null +++ b/AnimatableGaussians/configs/pengcheng/1003_cat_pose.yaml @@ -0,0 +1,79 @@ +mode: train +train: + dataset: MvRgbDatasetAvatarReX + data: + subject_name: 1003_cat_pose_false + data_dir: /home/pengc02/pengcheng/projects/gaussian_avatar/avatar_final/data/pos_map_ys/body_mix + frame_range: &id001 + - 0 + - 200 + - 1 + used_cam_ids: + - 0 + - 1 + - 2 + - 3 + - 4 + - 5 + - 6 + - 8 + - 9 + - 10 + - 11 + - 12 + - 14 + - 15 + load_smpl_pos_map: true + pretrained_dir: null + net_ckpt_dir: ./results/huawei0425/avatar2 + prev_ckpt: null + ckpt_interval: + epoch: 10 + batch: 50000 + eval_interval: 1000 + eval_training_ids: + - 190 + - 7 + eval_testing_ids: + - 354 + - 7 + eval_img_factor: 1.0 + lr_init: 0.0005 + loss_weight: + l1: 1.0 + lpips: 0.1 + offset: 0.005 + finetune_color: false + batch_size: 1 + num_workers: 8 + random_bg_color: true +test: + dataset: MvRgbDatasetAvatarReX + data: + data_dir: /home/pengc02/pengcheng/projects/gaussian_avatar/avatar_final/data/pos_map_ys/body_mix + frame_range: [0, 800] + subject_name: huawei0425 + pose_data: + data_path: ../data/AMASS/1003_cat_data.npz + frame_range: [0, 2000] +# data_path: Z:/Data/Pose/AMASS/CMU/06/06_13_poses.npz +# data_path: Z:/Data/Pose/AMASS/CMU/10/10_05_poses.npz +# frame_interval: 4 + # view_setting: front + view_setting: degree120 + # view_setting: free + render_view_idx: 13 + global_orient: true + img_scale: 2.0 + save_mesh: false + render_skeleton: false + save_tex_map: false + save_ply: true + fix_hand: true + fix_hand_id: 23 + n_pca: 20 + sigma_pca: 2.0 + prev_ckpt: ../checkpoints/body_ys +model: + with_viewdirs: true + random_style: false \ No newline at end of file diff --git a/AnimatableGaussians/configs/pengcheng/1004_smooth_train_pose.yaml b/AnimatableGaussians/configs/pengcheng/1004_smooth_train_pose.yaml new file mode 100644 index 0000000000000000000000000000000000000000..f319fcd19d0d593c32d7dd9354bf3839977e22c6 --- /dev/null +++ b/AnimatableGaussians/configs/pengcheng/1004_smooth_train_pose.yaml @@ -0,0 +1,79 @@ +mode: train +train: + dataset: MvRgbDatasetAvatarReX + data: + subject_name: 1006_smooth_train_pose + data_dir: /home/pengc02/pengcheng/projects/gaussian_avatar/avatar_final/data/pos_map_ys/body_mix + frame_range: &id001 + - 0 + - 200 + - 1 + used_cam_ids: + - 0 + - 1 + - 2 + - 3 + - 4 + - 5 + - 6 + - 8 + - 9 + - 10 + - 11 + - 12 + - 14 + - 15 + load_smpl_pos_map: true + pretrained_dir: null + net_ckpt_dir: ./results/huawei0425/avatar2 + prev_ckpt: null + ckpt_interval: + epoch: 10 + batch: 50000 + eval_interval: 1000 + eval_training_ids: + - 190 + - 7 + eval_testing_ids: + - 354 + - 7 + eval_img_factor: 1.0 + lr_init: 0.0005 + loss_weight: + l1: 1.0 + lpips: 0.1 + offset: 0.005 + finetune_color: false + batch_size: 1 + num_workers: 8 + random_bg_color: true +test: + dataset: MvRgbDatasetAvatarReX + data: + data_dir: /home/pengc02/pengcheng/projects/gaussian_avatar/avatar_final/data/pos_map_ys/body_mix + frame_range: [0, 800] + subject_name: huawei0425 + pose_data: + data_path: ../data/AMASS/1004_smooth_train_data.npz + frame_range: [0, 2000] +# data_path: Z:/Data/Pose/AMASS/CMU/06/06_13_poses.npz +# data_path: Z:/Data/Pose/AMASS/CMU/10/10_05_poses.npz +# frame_interval: 4 + # view_setting: front + view_setting: degree120 + # view_setting: free + render_view_idx: 13 + global_orient: true + img_scale: 2.0 + save_mesh: false + render_skeleton: false + save_tex_map: false + save_ply: true + fix_hand: true + fix_hand_id: 23 + n_pca: 20 + sigma_pca: 2.0 + prev_ckpt: ../checkpoints/body_ys +model: + with_viewdirs: true + random_style: false \ No newline at end of file diff --git a/AnimatableGaussians/configs/pengcheng/1007_slow10.yaml b/AnimatableGaussians/configs/pengcheng/1007_slow10.yaml new file mode 100644 index 0000000000000000000000000000000000000000..2f815441d064ecd86bf4890571021601e7dfec2a --- /dev/null +++ b/AnimatableGaussians/configs/pengcheng/1007_slow10.yaml @@ -0,0 +1,79 @@ +mode: train +train: + dataset: MvRgbDatasetAvatarReX + data: + subject_name: 1007_slow10 + data_dir: /home/pengc02/pengcheng/projects/gaussian_avatar/avatar_final/data/pos_map_ys/body_mix + frame_range: &id001 + - 0 + - 200 + - 1 + used_cam_ids: + - 0 + - 1 + - 2 + - 3 + - 4 + - 5 + - 6 + - 8 + - 9 + - 10 + - 11 + - 12 + - 14 + - 15 + load_smpl_pos_map: true + pretrained_dir: null + net_ckpt_dir: ./results/huawei0425/avatar2 + prev_ckpt: null + ckpt_interval: + epoch: 10 + batch: 50000 + eval_interval: 1000 + eval_training_ids: + - 190 + - 7 + eval_testing_ids: + - 354 + - 7 + eval_img_factor: 1.0 + lr_init: 0.0005 + loss_weight: + l1: 1.0 + lpips: 0.1 + offset: 0.005 + finetune_color: false + batch_size: 1 + num_workers: 8 + random_bg_color: true +test: + dataset: MvRgbDatasetAvatarReX + data: + data_dir: /home/pengc02/pengcheng/projects/gaussian_avatar/avatar_final/data/pos_map_ys/body_mix + frame_range: [0, 800] + subject_name: huawei0425 + pose_data: + data_path: ../data/AMASS/1007_train_data_slow10.npz + frame_range: [0, 2000] +# data_path: Z:/Data/Pose/AMASS/CMU/06/06_13_poses.npz +# data_path: Z:/Data/Pose/AMASS/CMU/10/10_05_poses.npz +# frame_interval: 4 + # view_setting: front + view_setting: degree90 + # view_setting: free + render_view_idx: 13 + global_orient: true + img_scale: 2.0 + save_mesh: false + render_skeleton: false + save_tex_map: false + save_ply: true + fix_hand: true + fix_hand_id: 23 + n_pca: 20 + sigma_pca: 2.0 + prev_ckpt: ../checkpoints/body_ys +model: + with_viewdirs: true + random_style: false \ No newline at end of file diff --git a/AnimatableGaussians/dataset/__pycache__/commons.cpython-310.pyc b/AnimatableGaussians/dataset/__pycache__/commons.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..de054b8be7d0276c5f2a5ff4d887faf2d01cf842 Binary files /dev/null and b/AnimatableGaussians/dataset/__pycache__/commons.cpython-310.pyc differ diff --git a/AnimatableGaussians/dataset/__pycache__/commons.cpython-38.pyc b/AnimatableGaussians/dataset/__pycache__/commons.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..15bf7dc51e037d2b4ab011534547b0a146423bbb Binary files /dev/null and b/AnimatableGaussians/dataset/__pycache__/commons.cpython-38.pyc differ diff --git a/AnimatableGaussians/dataset/__pycache__/dataset_mv_rgb.cpython-310.pyc b/AnimatableGaussians/dataset/__pycache__/dataset_mv_rgb.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..279546fceeaf179aaa26759baa6b183e461b86eb Binary files /dev/null and b/AnimatableGaussians/dataset/__pycache__/dataset_mv_rgb.cpython-310.pyc differ diff --git a/AnimatableGaussians/dataset/__pycache__/dataset_mv_rgb.cpython-38.pyc b/AnimatableGaussians/dataset/__pycache__/dataset_mv_rgb.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e8ee9d4907ab61307af8c059c500e619d96d8f3c Binary files /dev/null and b/AnimatableGaussians/dataset/__pycache__/dataset_mv_rgb.cpython-38.pyc differ diff --git a/AnimatableGaussians/dataset/__pycache__/dataset_pose.cpython-310.pyc b/AnimatableGaussians/dataset/__pycache__/dataset_pose.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e33d35be950cd27ee01ab6544032c150002fa283 Binary files /dev/null and b/AnimatableGaussians/dataset/__pycache__/dataset_pose.cpython-310.pyc differ diff --git a/AnimatableGaussians/dataset/__pycache__/dataset_pose.cpython-38.pyc b/AnimatableGaussians/dataset/__pycache__/dataset_pose.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8786537d65cffa975d8239d259728fd317f78057 Binary files /dev/null and b/AnimatableGaussians/dataset/__pycache__/dataset_pose.cpython-38.pyc differ diff --git a/AnimatableGaussians/dataset/commons.py b/AnimatableGaussians/dataset/commons.py new file mode 100644 index 0000000000000000000000000000000000000000..99040868317a55621e2778022f3178c3ee71a5ea --- /dev/null +++ b/AnimatableGaussians/dataset/commons.py @@ -0,0 +1,31 @@ +import numpy as np +import torch +import trimesh + +import AnimatableGaussians.config as config + + +def _initialize_hands(self): + smplx_lhand_to_mano_rhand_data = np.load(config.PROJ_DIR + '/smpl_files/mano/smplx_lhand_to_mano_rhand.npz', allow_pickle = True) + smplx_rhand_to_mano_rhand_data = np.load(config.PROJ_DIR + '/smpl_files/mano/smplx_rhand_to_mano_rhand.npz', allow_pickle = True) + smpl_lhand_vert_id = np.copy(smplx_lhand_to_mano_rhand_data['smpl_vert_id_to_mano']) + smpl_rhand_vert_id = np.copy(smplx_rhand_to_mano_rhand_data['smpl_vert_id_to_mano']) + self.smpl_lhand_vert_id = torch.from_numpy(smpl_lhand_vert_id) + self.smpl_rhand_vert_id = torch.from_numpy(smpl_rhand_vert_id) + self.smpl_hands_vert_id = torch.cat([self.smpl_lhand_vert_id, self.smpl_rhand_vert_id], 0) + mano_face_closed = np.loadtxt(config.PROJ_DIR + '/smpl_files/mano/mano_face_close.txt').astype(np.int64) + self.mano_face_closed = torch.from_numpy(mano_face_closed) + self.mano_face_closed_turned = self.mano_face_closed[:, [2, 1, 0]] + self.mano_face_closed_2hand = torch.cat([self.mano_face_closed[:, [2, 1, 0]], self.mano_face_closed + self.smpl_lhand_vert_id.shape[0]], 0) + + +def generate_two_manos(self, smplx_verts: torch.Tensor): + left_mano_v = smplx_verts[self.smpl_lhand_vert_id].cpu().numpy() + left_mano_trimesh = trimesh.Trimesh(left_mano_v, self.mano_face_closed_turned, process = False) + left_mano_n = left_mano_trimesh.vertex_normals.astype(np.float32) + + right_mano_v = smplx_verts[self.smpl_rhand_vert_id].cpu().numpy() + right_mano_trimesh = trimesh.Trimesh(right_mano_v, self.mano_face_closed, process = False) + right_mano_n = right_mano_trimesh.vertex_normals.astype(np.float32) + + return left_mano_v, left_mano_n, right_mano_v, right_mano_n diff --git a/AnimatableGaussians/dataset/dataset_mv_rgb.py b/AnimatableGaussians/dataset/dataset_mv_rgb.py new file mode 100644 index 0000000000000000000000000000000000000000..ffdd2ed67eb650edbb6dad09d019ca6556162d05 --- /dev/null +++ b/AnimatableGaussians/dataset/dataset_mv_rgb.py @@ -0,0 +1,506 @@ +import glob +import os +import numpy as np +import cv2 as cv +from sympy import li +import torch +from torch.utils.data import Dataset + +import AnimatableGaussians.smplx as smplx +import AnimatableGaussians.config as config +import AnimatableGaussians.utils.nerf_util as nerf_util +import AnimatableGaussians.utils.visualize_util as visualize_util +import AnimatableGaussians.dataset.commons as commons + + +class MvRgbDatasetBase(Dataset): + @torch.no_grad() + def __init__( + self, + data_dir, + frame_range = None, + used_cam_ids = None, + training = True, + subject_name = None, + load_smpl_pos_map = False, + load_smpl_nml_map = False, + mode = '3dgs' + ): + super(MvRgbDatasetBase, self).__init__() + + self.data_dir = data_dir + self.training = training + self.subject_name = subject_name + if self.subject_name is None: + self.subject_name = os.path.basename(self.data_dir) + self.load_smpl_pos_map = load_smpl_pos_map + self.load_smpl_nml_map = load_smpl_nml_map + self.mode = mode # '3dgs' or 'nerf' + + self.load_cam_data() + self.load_smpl_data() + + self.smpl_model = smplx.SMPLX(model_path = config.PROJ_DIR + '/smpl_files/smplx', gender = 'neutral', use_pca = False, num_pca_comps = 45, flat_hand_mean = True, batch_size = 1) + pose_list = list(range(self.smpl_data['body_pose'].shape[0])) + if frame_range is not None: + # print('# Selected frame range: ', frame_range) + # print(isinstance(frame_range, list)) + # print(type(frame_range)) + # to list + frame_range = list(frame_range) + if isinstance(frame_range, list): + if len(frame_range) == 2: + print(f'# Selected frame indices: range({frame_range[0]}, {frame_range[1]})') + frame_range = range(frame_range[0], frame_range[1]) + elif len(frame_range) == 3: + print(f'# Selected frame indices: range({frame_range[0]}, {frame_range[1]}, {frame_range[2]})') + frame_range = range(frame_range[0], frame_range[1], frame_range[2]) + elif isinstance(frame_range, str): + frame_range = np.loadtxt(self.data_dir + '/' + frame_range).astype(np.int).tolist() + print(f'# Selected frame indices: {frame_range}') + else: + raise TypeError('Invalid frame_range!') + self.pose_list = list(frame_range) + else: + self.pose_list = pose_list + + if self.training: + if used_cam_ids is None: + self.used_cam_ids = list(range(self.view_num)) + else: + self.used_cam_ids = used_cam_ids + print('# Used camera ids: ', self.used_cam_ids) + self.data_list = [] + for pose_idx in self.pose_list: + for view_idx in self.used_cam_ids: + self.data_list.append((pose_idx, view_idx)) + # filter missing files + self.filter_missing_files() + + print('# Dataset contains %d items' % len(self)) + + # SMPL related + ret = self.smpl_model.forward(betas = self.smpl_data['betas'][0][None], + global_orient = config.cano_smpl_global_orient[None], + transl = config.cano_smpl_transl[None], + body_pose = config.cano_smpl_body_pose[None]) + + self.cano_smpl = {k: v[0] for k, v in ret.items() if isinstance(v, torch.Tensor)} + self.inv_cano_jnt_mats = torch.linalg.inv(self.cano_smpl['A']) + min_xyz = self.cano_smpl['vertices'].min(0)[0] + max_xyz = self.cano_smpl['vertices'].max(0)[0] + self.cano_smpl_center = 0.5 * (min_xyz + max_xyz) + min_xyz[:2] -= 0.05 + max_xyz[:2] += 0.05 + min_xyz[2] -= 0.15 + max_xyz[2] += 0.15 + self.cano_bounds = torch.stack([min_xyz, max_xyz], 0).to(torch.float32).numpy() + self.smpl_faces = self.smpl_model.faces.astype(np.int32) + + commons._initialize_hands(self) + + def __len__(self): + if self.training: + return len(self.data_list) + else: + return len(self.pose_list) + + def __getitem__(self, index): + return self.getitem(index, self.training) + + def getitem(self, index, training = True, **kwargs): + if training or kwargs.get('eval', False): # training or evaluation + pose_idx, view_idx = self.data_list[index] + pose_idx = kwargs['pose_idx'] if 'pose_idx' in kwargs else pose_idx + view_idx = kwargs['view_idx'] if 'view_idx' in kwargs else view_idx + data_idx = (pose_idx, view_idx) + if not training: + print('data index: (%d, %d)' % (pose_idx, view_idx)) + else: # testing + pose_idx = self.pose_list[index] + data_idx = pose_idx + print('data index: %d' % pose_idx) + + # SMPL + with torch.no_grad(): + live_smpl = self.smpl_model.forward( + betas = self.smpl_data['betas'][0][None], + global_orient = self.smpl_data['global_orient'][pose_idx][None], + transl = self.smpl_data['transl'][pose_idx][None], + body_pose = self.smpl_data['body_pose'][pose_idx][None], + jaw_pose = self.smpl_data['jaw_pose'][pose_idx][None], + expression = self.smpl_data['expression'][pose_idx][None], + left_hand_pose = self.smpl_data['left_hand_pose'][pose_idx][None], + right_hand_pose = self.smpl_data['right_hand_pose'][pose_idx][None] + ) + cano_smpl = self.smpl_model.forward( + betas = self.smpl_data['betas'][0][None], + global_orient = config.cano_smpl_global_orient[None], + transl = config.cano_smpl_transl[None], + body_pose = config.cano_smpl_body_pose[None], + jaw_pose = self.smpl_data['jaw_pose'][pose_idx][None], + expression = self.smpl_data['expression'][pose_idx][None], + ) + live_smpl_woRoot = self.smpl_model.forward( + betas = self.smpl_data['betas'][0][None], + body_pose = self.smpl_data['body_pose'][pose_idx][None], + jaw_pose = self.smpl_data['jaw_pose'][pose_idx][None], + expression = self.smpl_data['expression'][pose_idx][None], + ) + + data_item = dict() + if self.load_smpl_pos_map: + smpl_pos_map = cv.imread(self.data_dir + '/smpl_pos_map/%08d.exr' % pose_idx, cv.IMREAD_UNCHANGED) + pos_map_size = smpl_pos_map.shape[1] // 2 + smpl_pos_map = np.concatenate([smpl_pos_map[:, :pos_map_size], smpl_pos_map[:, pos_map_size:]], 2) + smpl_pos_map = smpl_pos_map.transpose((2, 0, 1)) + data_item['smpl_pos_map'] = smpl_pos_map + + if self.load_smpl_nml_map: + smpl_nml_map = cv.imread(self.data_dir + '/smpl_nml_map/%08d.jpg' % pose_idx, cv.IMREAD_UNCHANGED) + smpl_nml_map = (smpl_nml_map / 255.).astype(np.float32) + nml_map_size = smpl_nml_map.shape[1] // 2 + smpl_nml_map = np.concatenate([smpl_nml_map[:, :nml_map_size], smpl_nml_map[:, nml_map_size:]], 2) + smpl_nml_map = smpl_nml_map.transpose((2, 0, 1)) + data_item['smpl_nml_map'] = smpl_nml_map + + data_item['joints'] = live_smpl.joints[0, :22] + data_item['kin_parent'] = self.smpl_model.parents[:22].to(torch.long) + data_item['item_idx'] = index + data_item['data_idx'] = data_idx + data_item['time_stamp'] = np.array(pose_idx, np.float32) + data_item['global_orient'] = self.smpl_data['global_orient'][pose_idx] + data_item['transl'] = self.smpl_data['transl'][pose_idx] + data_item['live_smpl_v'] = live_smpl.vertices[0] + data_item['live_smpl_v_woRoot'] = live_smpl_woRoot.vertices[0] + data_item['cano_smpl_v'] = cano_smpl.vertices[0] + data_item['cano_jnts'] = cano_smpl.joints[0] + data_item['cano2live_jnt_mats'] = torch.matmul(live_smpl.A[0], torch.linalg.inv(cano_smpl.A[0])) + data_item['cano2live_jnt_mats_woRoot'] = torch.matmul(live_smpl_woRoot.A[0], torch.linalg.inv(cano_smpl.A[0])) + data_item['cano_smpl_center'] = self.cano_smpl_center + data_item['cano_bounds'] = self.cano_bounds + data_item['smpl_faces'] = self.smpl_faces + min_xyz = live_smpl.vertices[0].min(0)[0] - 0.15 + max_xyz = live_smpl.vertices[0].max(0)[0] + 0.15 + live_bounds = torch.stack([min_xyz, max_xyz], 0).to(torch.float32).numpy() + data_item['live_bounds'] = live_bounds + + if training: + color_img, mask_img = self.load_color_mask_images(pose_idx, view_idx) + + color_img = (color_img / 255.).astype(np.float32) + + boundary_mask_img, mask_img = self.get_boundary_mask(mask_img) + + if self.mode == '3dgs': + data_item.update({ + 'img_h': color_img.shape[0], + 'img_w': color_img.shape[1], + 'extr': self.extr_mats[view_idx], + 'intr': self.intr_mats[view_idx], + 'color_img': color_img, + 'mask_img': mask_img, + 'boundary_mask_img': boundary_mask_img + }) + elif self.mode == 'nerf': + depth_img = np.zeros(color_img.shape[:2], np.float32) + nerf_random = nerf_util.sample_randomly_for_nerf_rendering( + color_img, mask_img, depth_img, + self.extr_mats[view_idx], self.intr_mats[view_idx], + live_bounds, + unsample_region_mask = boundary_mask_img + ) + data_item.update({ + 'nerf_random': nerf_random, + 'extr': self.extr_mats[view_idx], + 'intr': self.intr_mats[view_idx] + }) + else: + raise ValueError('Invalid dataset mode!') + else: + """ synthesis config """ + img_h = 512 if 'img_h' not in kwargs else kwargs['img_h'] + img_w = 512 if 'img_w' not in kwargs else kwargs['img_w'] + intr = np.array([[550, 0, 256], [0, 550, 256], [0, 0, 1]], np.float32) if 'intr' not in kwargs else kwargs['intr'] + if 'extr' not in kwargs: + extr = visualize_util.calc_front_mv(live_bounds.mean(0), tar_pos = np.array([0, 0, 2.5])) + else: + extr = kwargs['extr'] + + data_item.update({ + 'img_h': img_h, + 'img_w': img_w, + 'extr': extr, + 'intr': intr + }) + + if self.mode == 'nerf' or self.mode == '3dgs' and not training: + # mano + data_item['left_cano_mano_v'], data_item['left_cano_mano_n'], data_item['right_cano_mano_v'], data_item['right_cano_mano_n'] \ + = commons.generate_two_manos(self, self.cano_smpl['vertices']) + data_item['left_live_mano_v'], data_item['left_live_mano_n'], data_item['right_live_mano_v'], data_item['right_live_mano_n'] \ + = commons.generate_two_manos(self, live_smpl.vertices[0]) + + return data_item + + def load_cam_data(self): + """ + Initialize: + self.cam_names, self.view_num, self.extr_mats, self.intr_mats, + self.img_widths, self.img_heights + """ + raise NotImplementedError + + def load_smpl_data(self): + """ + Initialize: + self.cam_data, a dict including ['body_pose', 'global_orient', 'transl', 'betas', ...] + """ + smpl_data = np.load(self.data_dir + '/smpl_params.npz', allow_pickle = True) + smpl_data = dict(smpl_data) + self.smpl_data = {k: torch.from_numpy(v.astype(np.float32)) for k, v in smpl_data.items()} + + def filter_missing_files(self): + pass + + def load_color_mask_images(self, pose_idx, view_idx): + raise NotImplementedError + + @staticmethod + def get_boundary_mask(mask, kernel_size = 5): + """ + :param mask: np.uint8 + :param kernel_size: + :return: + """ + mask_bk = mask.copy() + thres = 128 + mask[mask < thres] = 0 + mask[mask > thres] = 1 + kernel = np.ones((kernel_size, kernel_size), np.uint8) + mask_erode = cv.erode(mask.copy(), kernel) + mask_dilate = cv.dilate(mask.copy(), kernel) + boundary_mask = (mask_dilate - mask_erode) == 1 + boundary_mask = np.logical_or(boundary_mask, + np.logical_and(mask_bk > 5, mask_bk < 250)) + + # boundary_mask_resized = cv.resize(boundary_mask.astype(np.uint8), (0, 0), fx = 0.5, fy = 0.5) + # cv.imshow('boundary_mask', boundary_mask_resized.astype(np.uint8) * 255) + # cv.waitKey(0) + + return boundary_mask, mask == 1 + + def compute_pca(self, n_components = 10): + from sklearn.decomposition import PCA + from tqdm import tqdm + import joblib + + if not os.path.exists(self.data_dir + '/smpl_pos_map/pca_%d.ckpt' % n_components): + pose_conds = [] + mask = None + for pose_idx in tqdm(self.pose_list, desc = 'Loading position maps...'): + pose_map = cv.imread(self.data_dir + '/smpl_pos_map/%08d.exr' % pose_idx, cv.IMREAD_UNCHANGED) + pose_map = pose_map[:, :pose_map.shape[1] // 2] + if mask is None: + mask = np.linalg.norm(pose_map, axis = -1) > 1e-6 + pose_conds.append(pose_map[mask]) + pose_conds = np.stack(pose_conds, 0) + pose_conds = pose_conds.reshape(pose_conds.shape[0], -1) + self.pca = PCA(n_components = n_components) + self.pca.fit(pose_conds) + joblib.dump(self.pca, self.data_dir + '/smpl_pos_map/pca_%d.ckpt' % n_components) + self.pos_map_mask = mask + else: + self.pca = joblib.load(self.data_dir + '/smpl_pos_map/pca_%d.ckpt' % n_components) + pose_map = cv.imread(sorted(glob.glob(self.data_dir + '/smpl_pos_map/0*.exr'))[0], cv.IMREAD_UNCHANGED) + pose_map = pose_map[:, :pose_map.shape[1] // 2] + self.pos_map_mask = np.linalg.norm(pose_map, axis = -1) > 1e-6 + + def transform_pca(self, pose_conds, sigma_pca = 2.): + pose_conds = pose_conds.reshape(1, -1) + lowdim_pose_conds = self.pca.transform(pose_conds) + std = np.sqrt(self.pca.explained_variance_) + lowdim_pose_conds = np.maximum(lowdim_pose_conds, -sigma_pca * std) + lowdim_pose_conds = np.minimum(lowdim_pose_conds, sigma_pca * std) + new_pose_conds = self.pca.inverse_transform(lowdim_pose_conds) + new_pose_conds = new_pose_conds.reshape(-1, 3) + return new_pose_conds + + +class MvRgbDatasetTHuman4(MvRgbDatasetBase): + def __init__( + self, + data_dir, + frame_range = None, + used_cam_ids = None, + training = True, + subject_name = None, + load_smpl_pos_map = False, + load_smpl_nml_map = False, + mode = '3dgs' + ): + super(MvRgbDatasetTHuman4, self).__init__( + data_dir, + frame_range, + used_cam_ids, + training, + subject_name, + load_smpl_pos_map, + load_smpl_nml_map, + mode + ) + + def load_cam_data(self): + import json + cam_data = json.load(open(self.data_dir + '/calibration.json', 'r')) + self.view_num = len(cam_data) + self.extr_mats = [] + self.cam_names = ['cam%02d' % view_idx for view_idx in range(self.view_num)] + for view_idx in range(self.view_num): + extr_mat = np.identity(4, np.float32) + extr_mat[:3, :3] = np.array(cam_data['cam%02d' % view_idx]['R'], np.float32).reshape(3, 3) + extr_mat[:3, 3] = np.array(cam_data['cam%02d' % view_idx]['T'], np.float32) + self.extr_mats.append(extr_mat) + self.intr_mats = [np.array(cam_data['cam%02d' % view_idx]['K'], np.float32).reshape(3, 3) for view_idx in range(self.view_num)] + self.img_heights = [cam_data['cam%02d' % view_idx]['imgSize'][1] for view_idx in range(self.view_num)] + self.img_widths = [cam_data['cam%02d' % view_idx]['imgSize'][0] for view_idx in range(self.view_num)] + + def filter_missing_files(self): + missing_data_list = [] + with open(self.data_dir + '/missing_img_files.txt', 'r') as fp: + lines = fp.readlines() + for line in lines: + line = line.replace('\\', '/') # considering both Windows and Ubuntu file system + frame_idx = int(os.path.basename(line).replace('.jpg', '')) + view_idx = int(os.path.basename(os.path.dirname(line)).replace('cam', '')) + missing_data_list.append((frame_idx, view_idx)) + for missing_data_idx in missing_data_list: + if missing_data_idx in self.data_list: + self.data_list.remove(missing_data_idx) + + def load_color_mask_images(self, pose_idx, view_idx): + color_img = cv.imread(self.data_dir + '/images/cam%02d/%08d.jpg' % (view_idx, pose_idx), cv.IMREAD_UNCHANGED) + mask_img = cv.imread(self.data_dir + '/masks/cam%02d/%08d.jpg' % (view_idx, pose_idx), cv.IMREAD_UNCHANGED) + return color_img, mask_img + + +class MvRgbDatasetAvatarReX(MvRgbDatasetBase): + def __init__( + self, + data_dir, + frame_range = None, + used_cam_ids = None, + training = True, + subject_name = None, + load_smpl_pos_map = False, + load_smpl_nml_map = False, + mode = '3dgs' + ): + super(MvRgbDatasetAvatarReX, self).__init__( + data_dir, + frame_range, + used_cam_ids, + training, + subject_name, + load_smpl_pos_map, + load_smpl_nml_map, + mode + ) + + def load_cam_data(self): + import json + cam_data = json.load(open(self.data_dir + '/calibration_full.json', 'r')) + self.cam_names = list(cam_data.keys()) + self.view_num = len(self.cam_names) + self.extr_mats = [] + for view_idx in range(self.view_num): + extr_mat = np.identity(4, np.float32) + extr_mat[:3, :3] = np.array(cam_data[self.cam_names[view_idx]]['R'], np.float32).reshape(3, 3) + extr_mat[:3, 3] = np.array(cam_data[self.cam_names[view_idx]]['T'], np.float32) + self.extr_mats.append(extr_mat) + self.intr_mats = [np.array(cam_data[self.cam_names[view_idx]]['K'], np.float32).reshape(3, 3) for view_idx in range(self.view_num)] + self.img_heights = [cam_data[self.cam_names[view_idx]]['imgSize'][1] for view_idx in range(self.view_num)] + self.img_widths = [cam_data[self.cam_names[view_idx]]['imgSize'][0] for view_idx in range(self.view_num)] + + def filter_missing_files(self): + if os.path.exists(self.data_dir + '/missing_img_files.txt'): + missing_data_list = [] + with open(self.data_dir + '/missing_img_files.txt', 'r') as fp: + lines = fp.readlines() + for line in lines: + line = line.replace('\\', '/') # considering both Windows and Ubuntu file system + frame_idx = int(os.path.basename(line).replace('.jpg', '')) + view_idx = self.cam_names.index(os.path.basename(os.path.dirname(line))) + missing_data_list.append((frame_idx, view_idx)) + for missing_data_idx in missing_data_list: + if missing_data_idx in self.data_list: + self.data_list.remove(missing_data_idx) + + def load_color_mask_images(self, pose_idx, view_idx): + cam_name = self.cam_names[view_idx] + color_img = cv.imread(self.data_dir + '/%s/%08d.jpg' % (cam_name, pose_idx), cv.IMREAD_UNCHANGED) + mask_img = cv.imread(self.data_dir + '/%s/mask/pha/%08d.jpg' % (cam_name, pose_idx), cv.IMREAD_UNCHANGED) + return color_img, mask_img + + +class MvRgbDatasetActorsHQ(MvRgbDatasetBase): + def __init__( + self, + data_dir, + frame_range = None, + used_cam_ids = None, + training = True, + subject_name = None, + load_smpl_pos_map = False, + load_smpl_nml_map = False, + mode = '3dgs' + ): + super(MvRgbDatasetActorsHQ, self).__init__( + data_dir, + frame_range, + used_cam_ids, + training, + subject_name, + load_smpl_pos_map, + load_smpl_nml_map, + mode + ) + + if subject_name is None: + self.subject_name = os.path.basename(os.path.dirname(self.data_dir)) + + def load_cam_data(self): + import csv + cam_names = [] + extr_mats = [] + intr_mats = [] + img_widths = [] + img_heights = [] + with open(self.data_dir + '/4x/calibration.csv', "r", newline = "", encoding = 'utf-8') as fp: + reader = csv.DictReader(fp) + for row in reader: + cam_names.append(row['name']) + img_widths.append(int(row['w'])) + img_heights.append(int(row['h'])) + + extr_mat = np.identity(4, np.float32) + extr_mat[:3, :3] = cv.Rodrigues(np.array([float(row['rx']), float(row['ry']), float(row['rz'])], np.float32))[0] + extr_mat[:3, 3] = np.array([float(row['tx']), float(row['ty']), float(row['tz'])]) + extr_mat = np.linalg.inv(extr_mat) + extr_mats.append(extr_mat) + + intr_mat = np.identity(3, np.float32) + intr_mat[0, 0] = float(row['fx']) * float(row['w']) + intr_mat[0, 2] = float(row['px']) * float(row['w']) + intr_mat[1, 1] = float(row['fy']) * float(row['h']) + intr_mat[1, 2] = float(row['py']) * float(row['h']) + intr_mats.append(intr_mat) + + self.cam_names, self.img_widths, self.img_heights, self.extr_mats, self.intr_mats \ + = cam_names, img_widths, img_heights, extr_mats, intr_mats + + def load_color_mask_images(self, pose_idx, view_idx): + cam_name = self.cam_names[view_idx] + color_img = cv.imread(self.data_dir + '/4x/rgbs/%s/%s_rgb%06d.jpg' % (cam_name, cam_name, pose_idx), cv.IMREAD_UNCHANGED) + mask_img = cv.imread(self.data_dir + '/4x/masks/%s/%s_mask%06d.png' % (cam_name, cam_name, pose_idx), cv.IMREAD_UNCHANGED) + return color_img, mask_img diff --git a/AnimatableGaussians/dataset/dataset_pose.py b/AnimatableGaussians/dataset/dataset_pose.py new file mode 100644 index 0000000000000000000000000000000000000000..1ce1a8824e1c40134d3bee6ab6899cd17c1b220a --- /dev/null +++ b/AnimatableGaussians/dataset/dataset_pose.py @@ -0,0 +1,573 @@ +import glob +import os +import pickle +import numpy as np +import cv2 as cv +import torch +import trimesh +from torch.utils.data import Dataset +import yaml +import json +import AnimatableGaussians.smplx as smplx + +import AnimatableGaussians.dataset.commons as commons +import AnimatableGaussians.utils.nerf_util as nerf_util +import AnimatableGaussians.utils.visualize_util as visualize_util +import AnimatableGaussians.config as config + + +class PoseDataset(Dataset): + @torch.no_grad() + def __init__( + self, + data_path, + frame_range = None, + frame_interval = 1, + smpl_shape = None, + gender = 'neutral', + frame_win = 0, + fix_head_pose = True, + fix_hand_pose = True, + denoise = False, + hand_pose_type = 'ori', + constrain_leg_pose = False, + device = 'cuda:0' + ): + super(PoseDataset, self).__init__() + + self.data_path = data_path + self.training = False + + self.gender = gender + + data_name, ext = os.path.splitext(os.path.basename(data_path)) + print(data_name) + if ext == '.pkl': + smpl_data = pickle.load(open(data_path, 'rb')) + smpl_data = dict(smpl_data) + self.body_poses = torch.from_numpy(smpl_data['smpl_poses']).to(torch.float32) + self.transl = torch.from_numpy(smpl_data['smpl_trans']).to(torch.float32) * 1e-3 + self.dataset_name = 'aist++' + self.seq_name = data_name + elif ext == '.npz': + potential_datasets = ['thuman4', 'actorshq', 'avatarrex', 'AMASS'] + for i, potential_dataset in enumerate(potential_datasets): + start_pos = data_path.find(potential_dataset) + if start_pos == -1: + if i < len(potential_datasets) - 1: + continue + else: + raise ValueError('Invalid data_path!') + self.dataset_name = potential_dataset + self.seq_name = data_path[start_pos:].replace(self.dataset_name, '').replace('/', '_').replace('\\', '_').replace('.npz', '') + break + # print(self.dataset_name) + # print(f'# Dataset name: {self.dataset_name}, sequence name: {self.seq_name}') + if self.dataset_name == 'thuman4' or self.dataset_name == 'actorshq' or self.dataset_name == 'avatarrex': + smpl_data = np.load(data_path) + # if smpl_data.shape[1] == 156: + # # build dict + # smpl_data = { + # 'betas': smpl_data[:, :10], + # 'global_orient': smpl_data[:, 10:13], + # 'transl': smpl_data[:, 13:16], + # 'body_pose': smpl_data[:, 16:88], + # 'left_hand_pose': smpl_data[:, 88:133], + # 'right_hand_pose': smpl_data[:, 133:] + # } + smpl_data = dict(smpl_data) + for k in smpl_data.keys(): + print(k, smpl_data[k].shape) + else: # AMASS dataset + pose_file = np.load(data_path) + smpl_data = { + 'betas': np.zeros((1, 10), np.float32), + 'global_orient': pose_file['poses'][:, :3], + 'transl': pose_file['trans'], + 'body_pose': pose_file['poses'][:, 3: 22 * 3], + 'left_hand_pose': pose_file['poses'][:, 22 * 3: 37 * 3], + 'right_hand_pose': pose_file['poses'][:, 37 * 3:] + } + + # smpl_data['body_pose'][:, 13 * 3 + 2] -= 0.3 + # smpl_data['body_pose'][:, 12 * 3 + 2] += 0.3 + # # smpl_data['body_pose'][:, 16 * 3 + 2] -= 0.1 + # # smpl_data['body_pose'][:, 15 * 3 + 2] += 0.1 + # smpl_data['body_pose'][:, 19 * 3: 20 * 3] = 0. + # smpl_data['body_pose'][:, 20 * 3: 21 * 3] = 0. + # smpl_data['body_pose'][:, 14 * 3] = 0. + # print(smpl_data['body_pose'].shape) + if self.seq_name == '_actor01': + smpl_data['body_pose'][:, 6*3: 7*3] = 0. + smpl_data['body_pose'][:, 7*3: 8*3] = 0. + + smpl_data = {k: torch.from_numpy(v).to(torch.float32) for k, v in smpl_data.items()} + frame_num = smpl_data['body_pose'].shape[0] + self.body_poses = torch.zeros((frame_num, 72), dtype = torch.float32) + self.body_poses[:, :3] = smpl_data['global_orient'] + self.body_poses[:, 3:3+21*3] = smpl_data['body_pose'] + self.transl = smpl_data['transl'] + # print(self.body_poses) + + data_dir = os.path.dirname(data_path) + calib_path = os.path.basename(data_path).replace('.npz', '.json').replace('pose', 'calibration') + calib_path = data_dir + '/' + calib_path + if os.path.exists(calib_path): + cam_data = json.load(open(calib_path, 'r')) + self.view_num = len(cam_data) + self.extr_mats = [] + self.cam_names = list(cam_data.keys()) + for view_idx in range(self.view_num): + extr_mat = np.identity(4, np.float32) + extr_mat[:3, :3] = np.array(cam_data[self.cam_names[view_idx]]['R'], np.float32).reshape(3, 3) + extr_mat[:3, 3] = np.array(cam_data[self.cam_names[view_idx]]['T'], np.float32) + self.extr_mats.append(extr_mat) + self.intr_mats = [np.array(cam_data[self.cam_names[view_idx]]['K'], np.float32).reshape(3, 3) for view_idx in range(self.view_num)] + self.img_heights = [cam_data[self.cam_names[view_idx]]['imgSize'][1] for view_idx in range(self.view_num)] + self.img_widths = [cam_data[self.cam_names[view_idx]]['imgSize'][0] for view_idx in range(self.view_num)] + else: + raise AssertionError('Invalid data_path!') + + if 'left_hand_pose' in smpl_data: + self.left_hand_pose = smpl_data['left_hand_pose'] + else: + self.left_hand_pose = config.left_hand_pose[None].expand(self.body_poses.shape[0], -1) + if 'right_hand_pose' in smpl_data: + self.right_hand_pose = smpl_data['right_hand_pose'] + else: + self.right_hand_pose = config.right_hand_pose[None].expand(self.body_poses.shape[0], -1) + + self.body_poses = self.body_poses.to(device) + self.transl = self.transl.to(device) + + self.fix_head_pose = fix_head_pose + self.fix_hand_pose = fix_hand_pose + + self.smpl_model = smplx.SMPLX(model_path = config.PROJ_DIR + '/smpl_files/smplx', gender = self.gender, use_pca = False, num_pca_comps = 45, flat_hand_mean = True, batch_size = 1).to(device) + + pose_list = list(range(0, self.body_poses.shape[0], frame_interval)) + if frame_range is not None: + frame_range = list(frame_range) + if isinstance(frame_range, list): + if isinstance(frame_range[0], list): + self.pose_list = [] + for interval in frame_range: + if len(interval) == 2 or len(interval) == 3: + self.pose_list += list(range(*interval)) + else: + for i in range(interval[3]): + self.pose_list += list(range(interval[0], interval[1], interval[2])) + else: + if len(frame_range) == 2: + print(f'# Selected frame indices: range({frame_range[0]}, {frame_range[1]})') + frame_range = range(frame_range[0], frame_range[1]) + elif len(frame_range) == 3: + print(f'# Selected frame indices: range({frame_range[0]}, {frame_range[1]}, {frame_range[2]})') + frame_range = range(frame_range[0], frame_range[1], frame_range[2]) + self.pose_list = list(frame_range) + else: + self.pose_list = pose_list + + print('# Pose list: ', self.pose_list) + print('# Dataset contains %d items' % len(self)) + + # SMPL related + self.smpl_shape = smpl_shape.to(torch.float32).to(device) if smpl_shape is not None else torch.zeros(10, dtype = torch.float32) + ret = self.smpl_model.forward(betas = self.smpl_shape[None], + global_orient = config.cano_smpl_global_orient[None].to(device), + transl = config.cano_smpl_transl[None].to(device), + body_pose = config.cano_smpl_body_pose[None].to(device), + # left_hand_pose = config.left_hand_pose[None], + # right_hand_pose = config.right_hand_pose[None] + ) + self.cano_smpl = {k: v[0] for k, v in ret.items() if isinstance(v, torch.Tensor)} + self.inv_cano_jnt_mats = torch.linalg.inv(self.cano_smpl['A']) + min_xyz = self.cano_smpl['vertices'].min(0)[0] + max_xyz = self.cano_smpl['vertices'].max(0)[0] + self.cano_smpl_center = 0.5 * (min_xyz + max_xyz) + min_xyz[:2] -= 0.05 + max_xyz[:2] += 0.05 + min_xyz[2] -= 0.15 + max_xyz[2] += 0.15 + self.cano_bounds = torch.stack([min_xyz, max_xyz], 0).to(torch.float32).cpu().numpy() + self.smpl_faces = self.smpl_model.faces.astype(np.int32) + + self.frame_win = int(frame_win) + self.denoise = denoise + if self.denoise: + win_size = 1 + body_poses_clone = self.body_poses.clone() + transl_clone = self.transl.clone() + frame_num = body_poses_clone.shape[0] + self.body_poses[win_size: frame_num-win_size] = 0 + self.transl[win_size: frame_num-win_size] = 0 + for i in range(-win_size, win_size + 1): + self.body_poses[win_size: frame_num-win_size] += body_poses_clone[win_size+i: frame_num-win_size+i] + self.transl[win_size: frame_num-win_size] += transl_clone[win_size+i: frame_num-win_size+i] + self.body_poses[win_size: frame_num-win_size] /= (2 * win_size + 1) + self.transl[win_size: frame_num-win_size] /= (2 * win_size + 1) + + self.hand_pose_type = hand_pose_type + + self.device = device + self.last_data_idx = 0 + + commons._initialize_hands(self) + self.left_cano_mano_v, self.left_cano_mano_n, self.right_cano_mano_v, self.right_cano_mano_n \ + = commons.generate_two_manos(self, self.cano_smpl['vertices']) + + if constrain_leg_pose: + # a = 14. + # # print(self.body_poses[284, 1*3:2*3]) + # # print(self.body_poses[284, 2*3:3*3]) + # self.body_poses[:, 1*3] = torch.clip(self.body_poses[:, 1 * 3], -np.pi / a, np.pi / a) + # self.body_poses[:, 2*3] = torch.clip(self.body_poses[:, 2 * 3], -np.pi / a, np.pi / a) + # self.body_poses[:, 1 * 3+2] = torch.clip(self.body_poses[:, 1 * 3+2], -np.pi / a, np.pi / a) + # self.body_poses[:, 2 * 3+2] = torch.clip(self.body_poses[:, 2 * 3+2], -np.pi / a, np.pi / a) + # exit(1) + + self.body_poses[:, 4*3] = torch.clip(self.body_poses[:, 4*3], -0.3, 0.3) + self.body_poses[:, 5*3] = torch.clip(self.body_poses[:, 5*3], -0.3, 0.3) + + def __len__(self): + return len(self.pose_list) + + def __getitem__(self, index): + return self.getitem(index) + + @torch.no_grad() + def getitem(self, index, **kwargs): + pose_idx = self.pose_list[index] + if pose_idx == 0 or pose_idx > self.pose_list[min(index - 1, 0)]: + data_idx = pose_idx + else: + data_idx = self.last_data_idx + 1 + # print('data index: %d, pose index: %d' % (data_idx, pose_idx)) + + if self.hand_pose_type == 'fist': + left_hand_pose = config.left_hand_pose.to(self.device).clone() + right_hand_pose = config.right_hand_pose.to(self.device).clone() + left_hand_pose[:3] = 0. + right_hand_pose[:3] = 0. + elif self.hand_pose_type == 'normal': + left_hand_pose = torch.tensor([0.10859203338623047, 0.10181399434804916, -0.2822268009185791, 0.10211331397294998, -0.09689036756753922, -0.4484838545322418, -0.11360692232847214, -0.023141659796237946, 0.10571160167455673, -0.08793719857931137, -0.026760095730423927, -0.41390693187713623, -0.0923849567770958, 0.10266668349504471, -0.36039748787879944, 0.02140655182301998, -0.07156527787446976, -0.04903153330087662, -0.22358819842338562, -0.3716682195663452, -0.2683027982711792, -0.1506909281015396, 0.07079305499792099, -0.34404537081718445, -0.168443500995636, -0.014021224342286587, 0.09489774703979492, -0.050323735922575, -0.18992969393730164, -0.43895423412323, -0.1806418001651764, 0.0198075994849205, -0.25444355607032776, -0.10171788930892944, -0.10680688172578812, -0.09953738003969193, 0.8094075918197632, 0.5156061053276062, -0.07900168001651764, -0.45094889402389526, 0.24947893619537354, 0.23369410634040833, 0.45277315378189087, -0.17375235259532928, -0.3077943027019501], dtype = torch.float32, device = self.device) + right_hand_pose = torch.tensor([0.06415501981973648, -0.06942438334226608, 0.282951682806015, 0.09073827415704727, 0.0775153785943985, 0.2961004376411438, -0.07659692317247391, 0.004730052314698696, -0.12084470689296722, 0.007974660955369473, 0.05222926288843155, 0.32775357365608215, -0.10166633129119873, -0.06862349808216095, 0.174485981464386, -0.0023323255591094494, 0.04998664930462837, -0.03490559384226799, 0.12949667870998383, 0.26883721351623535, 0.06881044059991837, -0.18259745836257935, -0.08183271437883377, 0.17669665813446045, -0.08099694550037384, 0.04115655645728111, -0.17928685247898102, 0.07734024524688721, 0.13419172167778015, 0.2600148022174835, -0.151871919631958, -0.01772170141339302, 0.1267814189195633, -0.08800505846738815, 0.09480107575654984, 0.0016392067773267627, 0.6149336695671082, -0.32634419202804565, 0.02278662845492363, -0.39148610830307007, -0.22757330536842346, -0.07884717732667923, 0.38199105858802795, 0.13064607977867126, 0.20154500007629395], dtype = torch.float32, device = self.device) + elif self.hand_pose_type == 'zero': + left_hand_pose = torch.zeros(45, dtype = torch.float32, device = self.device) + right_hand_pose = torch.zeros(45, dtype = torch.float32, device = self.device) + elif self.hand_pose_type == 'ori': + left_hand_pose = self.left_hand_pose[pose_idx].to(self.device) + right_hand_pose = self.right_hand_pose[pose_idx].to(self.device) + else: + raise ValueError('Invalid hand_pose_type!') + + # SMPL + live_smpl = self.smpl_model.forward(betas = self.smpl_shape[None], + global_orient = self.body_poses[pose_idx, :3][None], + transl = self.transl[pose_idx][None], + body_pose = self.body_poses[pose_idx, 3: 66][None], + left_hand_pose = left_hand_pose[None], + right_hand_pose = right_hand_pose[None] + ) + + # live_smpl_trimesh = trimesh.Trimesh(vertices = live_smpl.vertices[0].cpu().numpy(), faces = self.smpl_model.faces, process = False) + # live_smpl_trimesh.export('./debug/smpl_amass.ply') + # exit(1) + + live_smpl_woRoot = self.smpl_model.forward(betas = self.smpl_shape[None], + # global_orient = self.body_poses[pose_idx, :3][None], + # transl = self.transl[pose_idx][None], + body_pose = self.body_poses[pose_idx, 3: 66][None], + # left_hand_pose = config.left_hand_pose[None], + # right_hand_pose = config.right_hand_pose[None] + ) + + # cano_smpl = self.smpl_model.forward(betas=self.smpl_shape[None], + # global_orient=config.cano_smpl_global_orient[None], + # transl=config.cano_smpl_transl[None], + # body_pose=config.cano_smpl_body_pose[None], + # # left_hand_pose = left_hand_pose[None], + # # right_hand_pose = right_hand_pose[None] + # ) + + data_item = dict() + data_item['item_idx'] = index + data_item['data_idx'] = data_idx + data_item['global_orient'] = self.body_poses[pose_idx, :3] + data_item['transl'] = self.transl[pose_idx] + data_item['joints'] = live_smpl.joints[0, :22] + data_item['kin_parent'] = self.smpl_model.parents[:22].to(torch.long) + data_item['pose_1st'] = self.body_poses[0, 3: 66] + if self.frame_win > 0: + total_frame_num = len(self.pose_list) + selected_frames = self.pose_list[max(0, index - self.frame_win): min(total_frame_num, index + self.frame_win + 1)] + data_item['pose'] = self.body_poses[selected_frames, 3: 66].clone() + else: + data_item['pose'] = self.body_poses[pose_idx, 3: 66].clone() + + if self.fix_head_pose: + data_item['pose'][..., 3 * 11: 3 * 11 + 3] = 0. + data_item['pose'][..., 3 * 14: 3 * 14 + 3] = 0. + if self.fix_hand_pose: + data_item['pose'][..., 3 * 19: 3 * 19 + 3] = 0. + data_item['pose'][..., 3 * 20: 3 * 20 + 3] = 0. + data_item['lhand_pose'] = torch.zeros_like(config.left_hand_pose) + data_item['rhand_pose'] = torch.zeros_like(config.right_hand_pose) + data_item['time_stamp'] = np.array(pose_idx, np.float32) + data_item['live_smpl_v'] = live_smpl.vertices[0] + data_item['live_smpl_v_woRoot'] = live_smpl_woRoot.vertices[0] + data_item['cano_smpl_v'] = self.cano_smpl['vertices'] + data_item['cano_jnts'] = self.cano_smpl['joints'] + inv_cano_jnt_mats = torch.linalg.inv(self.cano_smpl['A']) + data_item['cano2live_jnt_mats'] = torch.matmul(live_smpl.A[0], inv_cano_jnt_mats) + data_item['cano2live_jnt_mats_woRoot'] = torch.matmul(live_smpl_woRoot.A[0], inv_cano_jnt_mats) + data_item['cano_smpl_center'] = self.cano_smpl_center + data_item['cano_bounds'] = self.cano_bounds + data_item['smpl_faces'] = self.smpl_faces + min_xyz = live_smpl.vertices[0].min(0)[0] - 0.15 + max_xyz = live_smpl.vertices[0].max(0)[0] + 0.15 + live_bounds = torch.stack([min_xyz, max_xyz], 0).to(torch.float32).cpu().numpy() + data_item['live_bounds'] = live_bounds + + # # mano + # data_item['left_cano_mano_v'], data_item['left_cano_mano_n'], data_item['right_cano_mano_v'], data_item['right_cano_mano_n']\ + # = commons.generate_two_manos(self, self.cano_smpl['vertices']) + # data_item['left_live_mano_v'], data_item['left_live_mano_n'], data_item['right_live_mano_v'], data_item['right_live_mano_n'] \ + # = commons.generate_two_manos(self, live_smpl.vertices[0]) + + """ synthesis config """ + img_h = 512 if 'img_h' not in kwargs else kwargs['img_h'] + img_w = 512 if 'img_w' not in kwargs else kwargs['img_w'] + intr = np.array([[550, 0, 256], [0, 550, 256], [0, 0, 1]], np.float32) if 'intr' not in kwargs else kwargs['intr'] + if 'extr' not in kwargs: + extr = visualize_util.calc_front_mv(live_bounds.mean(0), tar_pos = np.array([0, 0, 2.5])) + else: + extr = kwargs['extr'] + + """ training data config of view_idx """ + # view_idx = 0 + # img_h = self.img_heights[view_idx] + # img_w = self.img_widths[view_idx] + # intr = self.intr_mats[view_idx] + # extr = self.extr_mats[view_idx] + + uv = self.gen_uv(img_w, img_h) + uv = uv.reshape(-1, 2) + ray_d, ray_o = nerf_util.get_rays(uv, extr, intr) + near, far, mask_at_bound = nerf_util.get_near_far(live_bounds, ray_o, ray_d) + uv = uv[mask_at_bound] + ray_o = ray_o[mask_at_bound] + ray_d = ray_d[mask_at_bound] + + data_item.update({ + 'uv': uv, + 'ray_o': ray_o, + 'ray_d': ray_d, + 'near': near, + 'far': far, + 'dist': np.zeros_like(near), + 'img_h': img_h, + 'img_w': img_w, + 'extr': extr, + 'intr': intr + }) + + return data_item + + def getitem_fast(self, index, **kwargs): + pose_idx = self.pose_list[index] + if pose_idx == 0 or pose_idx > self.last_data_idx: + data_idx = pose_idx + else: + data_idx = self.last_data_idx + 1 + # print('data index: %d, pose index: %d' % (data_idx, pose_idx)) + + if self.hand_pose_type == 'fist': + left_hand_pose = config.left_hand_pose.to(self.device) + right_hand_pose = config.right_hand_pose.to(self.device) + elif self.hand_pose_type == 'normal': + left_hand_pose = torch.tensor( + [0.10859203338623047, 0.10181399434804916, -0.2822268009185791, 0.10211331397294998, -0.09689036756753922, -0.4484838545322418, -0.11360692232847214, -0.023141659796237946, 0.10571160167455673, -0.08793719857931137, -0.026760095730423927, -0.41390693187713623, -0.0923849567770958, 0.10266668349504471, -0.36039748787879944, 0.02140655182301998, -0.07156527787446976, -0.04903153330087662, -0.22358819842338562, -0.3716682195663452, -0.2683027982711792, -0.1506909281015396, + 0.07079305499792099, -0.34404537081718445, -0.168443500995636, -0.014021224342286587, 0.09489774703979492, -0.050323735922575, -0.18992969393730164, -0.43895423412323, -0.1806418001651764, 0.0198075994849205, -0.25444355607032776, -0.10171788930892944, -0.10680688172578812, -0.09953738003969193, 0.8094075918197632, 0.5156061053276062, -0.07900168001651764, -0.45094889402389526, 0.24947893619537354, 0.23369410634040833, 0.45277315378189087, -0.17375235259532928, + -0.3077943027019501], dtype = torch.float32, device = self.device) + right_hand_pose = torch.tensor( + [0.06415501981973648, -0.06942438334226608, 0.282951682806015, 0.09073827415704727, 0.0775153785943985, 0.2961004376411438, -0.07659692317247391, 0.004730052314698696, -0.12084470689296722, 0.007974660955369473, 0.05222926288843155, 0.32775357365608215, -0.10166633129119873, -0.06862349808216095, 0.174485981464386, -0.0023323255591094494, 0.04998664930462837, -0.03490559384226799, 0.12949667870998383, 0.26883721351623535, 0.06881044059991837, -0.18259745836257935, + -0.08183271437883377, 0.17669665813446045, -0.08099694550037384, 0.04115655645728111, -0.17928685247898102, 0.07734024524688721, 0.13419172167778015, 0.2600148022174835, -0.151871919631958, -0.01772170141339302, 0.1267814189195633, -0.08800505846738815, 0.09480107575654984, 0.0016392067773267627, 0.6149336695671082, -0.32634419202804565, 0.02278662845492363, -0.39148610830307007, -0.22757330536842346, -0.07884717732667923, 0.38199105858802795, 0.13064607977867126, + 0.20154500007629395], dtype = torch.float32, device = self.device) + elif self.hand_pose_type == 'zero': + left_hand_pose = torch.zeros(45, dtype = torch.float32, device = self.device) + right_hand_pose = torch.zeros(45, dtype = torch.float32, device = self.device) + elif self.hand_pose_type == 'ori': + left_hand_pose = self.left_hand_pose[pose_idx].to(self.device) + right_hand_pose = self.right_hand_pose[pose_idx].to(self.device) + else: + raise ValueError('Invalid hand_pose_type!') + + # SMPL + live_smpl = self.smpl_model.forward(betas = self.smpl_shape[None], + global_orient = self.body_poses[pose_idx, :3][None], + transl = self.transl[pose_idx][None], + body_pose = self.body_poses[pose_idx, 3: 66][None], + left_hand_pose = left_hand_pose[None], + right_hand_pose = right_hand_pose[None] + ) + + live_smpl_woRoot = self.smpl_model.forward(betas = self.smpl_shape[None], + # global_orient = self.body_poses[pose_idx, :3][None], + # transl = self.transl[pose_idx][None], + body_pose = self.body_poses[pose_idx, 3: 66][None], + # left_hand_pose = config.left_hand_pose[None], + # right_hand_pose = config.right_hand_pose[None] + ) + + # cano_smpl = self.smpl_model.forward(betas = self.smpl_shape[None], + # global_orient = config.cano_smpl_global_orient[None], + # transl = config.cano_smpl_transl[None], + # body_pose = config.cano_smpl_body_pose[None], + # # left_hand_pose = left_hand_pose[None], + # # right_hand_pose = right_hand_pose[None] + # ) + + data_item = dict() + data_item['item_idx'] = index + data_item['data_idx'] = data_idx + data_item['global_orient'] = self.body_poses[pose_idx, :3] + data_item['body_pose'] = self.body_poses[pose_idx, 3:66] + data_item['transl'] = self.transl[pose_idx] + data_item['joints'] = live_smpl.joints[0, :22] + data_item['kin_parent'] = self.smpl_model.parents[:22].to(torch.long) + data_item['live_smpl_v'] = live_smpl.vertices[0] + data_item['live_smpl_v_woRoot'] = live_smpl_woRoot.vertices[0] + data_item['cano_smpl_v'] = self.cano_smpl['vertices'] + data_item['cano_jnts'] = self.cano_smpl['joints'] + inv_cano_jnt_mats = torch.linalg.inv(self.cano_smpl['A']) + data_item['cano2live_jnt_mats'] = torch.matmul(live_smpl.A[0], inv_cano_jnt_mats) + data_item['cano2live_jnt_mats_woRoot'] = torch.matmul(live_smpl_woRoot.A[0], inv_cano_jnt_mats) + data_item['cano_smpl_center'] = self.cano_smpl_center + data_item['cano_bounds'] = self.cano_bounds + data_item['smpl_faces'] = self.smpl_faces + min_xyz = live_smpl.vertices[0].min(0)[0] - 0.15 + max_xyz = live_smpl.vertices[0].max(0)[0] + 0.15 + live_bounds = torch.stack([min_xyz, max_xyz], 0).to(torch.float32).cpu().numpy() + data_item['live_bounds'] = live_bounds + + data_item['left_cano_mano_v'], data_item['left_cano_mano_n'], data_item['right_cano_mano_v'], data_item['right_cano_mano_n'] \ + = self.left_cano_mano_v, self.left_cano_mano_n, self.right_cano_mano_v, self.right_cano_mano_n + + """ synthesis config """ + img_h = 512 if 'img_h' not in kwargs else kwargs['img_h'] + img_w = 512 if 'img_w' not in kwargs else kwargs['img_w'] + intr = np.array([[550, 0, 256], [0, 550, 256], [0, 0, 1]], np.float32) if 'intr' not in kwargs else kwargs['intr'] + if 'extr' not in kwargs: + extr = visualize_util.calc_front_mv(live_bounds.mean(0), tar_pos = np.array([0, 0, 2.5])) + else: + extr = kwargs['extr'] + + data_item.update({ + 'img_h': img_h, + 'img_w': img_w, + 'extr': extr, + 'intr': intr + }) + + self.last_data_idx = data_idx + + return data_item + + def getitem_a_pose(self, **kwargs): + hand_pose_type = 'fist' + if hand_pose_type == 'fist': + left_hand_pose = config.left_hand_pose.to(self.device) + right_hand_pose = config.right_hand_pose.to(self.device) + elif hand_pose_type == 'normal': + left_hand_pose = torch.tensor( + [0.10859203338623047, 0.10181399434804916, -0.2822268009185791, 0.10211331397294998, -0.09689036756753922, -0.4484838545322418, -0.11360692232847214, -0.023141659796237946, 0.10571160167455673, -0.08793719857931137, -0.026760095730423927, -0.41390693187713623, -0.0923849567770958, 0.10266668349504471, -0.36039748787879944, 0.02140655182301998, -0.07156527787446976, -0.04903153330087662, -0.22358819842338562, -0.3716682195663452, -0.2683027982711792, -0.1506909281015396, + 0.07079305499792099, -0.34404537081718445, -0.168443500995636, -0.014021224342286587, 0.09489774703979492, -0.050323735922575, -0.18992969393730164, -0.43895423412323, -0.1806418001651764, 0.0198075994849205, -0.25444355607032776, -0.10171788930892944, -0.10680688172578812, -0.09953738003969193, 0.8094075918197632, 0.5156061053276062, -0.07900168001651764, -0.45094889402389526, 0.24947893619537354, 0.23369410634040833, 0.45277315378189087, -0.17375235259532928, + -0.3077943027019501], dtype = torch.float32, device = self.device) + right_hand_pose = torch.tensor( + [0.06415501981973648, -0.06942438334226608, 0.282951682806015, 0.09073827415704727, 0.0775153785943985, 0.2961004376411438, -0.07659692317247391, 0.004730052314698696, -0.12084470689296722, 0.007974660955369473, 0.05222926288843155, 0.32775357365608215, -0.10166633129119873, -0.06862349808216095, 0.174485981464386, -0.0023323255591094494, 0.04998664930462837, -0.03490559384226799, 0.12949667870998383, 0.26883721351623535, 0.06881044059991837, -0.18259745836257935, + -0.08183271437883377, 0.17669665813446045, -0.08099694550037384, 0.04115655645728111, -0.17928685247898102, 0.07734024524688721, 0.13419172167778015, 0.2600148022174835, -0.151871919631958, -0.01772170141339302, 0.1267814189195633, -0.08800505846738815, 0.09480107575654984, 0.0016392067773267627, 0.6149336695671082, -0.32634419202804565, 0.02278662845492363, -0.39148610830307007, -0.22757330536842346, -0.07884717732667923, 0.38199105858802795, 0.13064607977867126, + 0.20154500007629395], dtype = torch.float32, device = self.device) + elif self.hand_pose_type == 'zero': + left_hand_pose = torch.zeros(45, dtype = torch.float32, device = self.device) + right_hand_pose = torch.zeros(45, dtype = torch.float32, device = self.device) + else: + raise ValueError('Invalid hand_pose_type!') + + body_pose = torch.zeros(21 * 3, dtype = torch.float32).to(self.device) + body_pose[15 * 3 + 2] += -0.8 + body_pose[16 * 3 + 2] += 0.8 + + # SMPL + live_smpl = self.smpl_model.forward(betas = self.smpl_shape[None], + global_orient = None, + transl = None, + body_pose = body_pose[None], + left_hand_pose = left_hand_pose[None], + right_hand_pose = right_hand_pose[None] + ) + + live_smpl_woRoot = self.smpl_model.forward(betas = self.smpl_shape[None], + # global_orient = self.body_poses[pose_idx, :3][None], + # transl = self.transl[pose_idx][None], + body_pose = body_pose[None], + # left_hand_pose = config.left_hand_pose[None], + # right_hand_pose = config.right_hand_pose[None] + ) + + # cano_smpl = self.smpl_model.forward(betas = self.smpl_shape[None], + # global_orient = config.cano_smpl_global_orient[None], + # transl = config.cano_smpl_transl[None], + # body_pose = config.cano_smpl_body_pose[None], + # # left_hand_pose = left_hand_pose[None], + # # right_hand_pose = right_hand_pose[None] + # ) + + data_item = dict() + data_item['item_idx'] = 0 + data_item['data_idx'] = 0 + data_item['global_orient'] = torch.zeros(3, dtype = torch.float32) + data_item['joints'] = live_smpl.joints[0, :22] + data_item['kin_parent'] = self.smpl_model.parents[:22].to(torch.long) + data_item['live_smpl_v'] = live_smpl.vertices[0] + data_item['live_smpl_v_woRoot'] = live_smpl_woRoot.vertices[0] + data_item['cano_smpl_v'] = self.cano_smpl['vertices'] + data_item['cano_jnts'] = self.cano_smpl['joints'] + inv_cano_jnt_mats = torch.linalg.inv(self.cano_smpl['A']) + data_item['cano2live_jnt_mats'] = torch.matmul(live_smpl.A[0], inv_cano_jnt_mats) + data_item['cano2live_jnt_mats_woRoot'] = torch.matmul(live_smpl_woRoot.A[0], inv_cano_jnt_mats) + data_item['cano_smpl_center'] = self.cano_smpl_center + data_item['cano_bounds'] = self.cano_bounds + data_item['smpl_faces'] = self.smpl_faces + min_xyz = live_smpl.vertices[0].min(0)[0] - 0.15 + max_xyz = live_smpl.vertices[0].max(0)[0] + 0.15 + live_bounds = torch.stack([min_xyz, max_xyz], 0).to(torch.float32).cpu().numpy() + data_item['live_bounds'] = live_bounds + + data_item['left_cano_mano_v'], data_item['left_cano_mano_n'], data_item['right_cano_mano_v'], data_item['right_cano_mano_n'] \ + = self.left_cano_mano_v, self.left_cano_mano_n, self.right_cano_mano_v, self.right_cano_mano_n + + """ synthesis config """ + img_h = 512 if 'img_h' not in kwargs else kwargs['img_h'] + img_w = 300 if 'img_w' not in kwargs else kwargs['img_w'] + intr = np.array([[550, 0, 150], [0, 550, 256], [0, 0, 1]], np.float32) if 'intr' not in kwargs else kwargs['intr'] + if 'extr' not in kwargs: + extr = visualize_util.calc_front_mv(live_bounds.mean(0), tar_pos = np.array([0, 0, 2.5])) + else: + extr = kwargs['extr'] + + data_item.update({ + 'img_h': img_h, + 'img_w': img_w, + 'extr': extr, + 'intr': intr + }) + + return data_item + + @staticmethod + def gen_uv(img_w, img_h): + x, y = np.meshgrid(np.linspace(0, img_w - 1, img_w, dtype = np.int32), + np.linspace(0, img_h - 1, img_h, dtype = np.int32)) + uv = np.stack([x, y], axis = -1) + return uv diff --git a/AnimatableGaussians/eval/comparison_body_only_avatars.py b/AnimatableGaussians/eval/comparison_body_only_avatars.py new file mode 100644 index 0000000000000000000000000000000000000000..929576b29f2454c2ef629dce874e410a7f9b8feb --- /dev/null +++ b/AnimatableGaussians/eval/comparison_body_only_avatars.py @@ -0,0 +1,114 @@ +# To compute FID, first install pytorch_fid +# pip install pytorch-fid + +import os +import cv2 as cv +from tqdm import tqdm +import shutil + +from eval.score import * + +cam_id = 18 +ours_dir = './test_results/subject00/styleunet_gaussians3/testing__cam_%03d/batch_750000/rgb_map' % cam_id +posevocab_dir = './test_results/subject00/posevocab/testing__cam_%03d/rgb_map' % cam_id +tava_dir = './test_results/subject00/tava/cam_%03d' % cam_id +arah_dir = './test_results/subject00/arah/cam_%03d' % cam_id +slrf_dir = './test_results/subject00/slrf/cam_%03d' % cam_id +gt_dir = 'Z:/MultiviewRGB/THuman4/subject00/images/cam%02d' % cam_id +mask_dir = 'Z:/MultiviewRGB/THuman4/subject00/masks/cam%02d' % cam_id + +frame_list = list(range(2000, 2500, 1)) + + +if __name__ == '__main__': + ours_metrics = Metrics() + posevocab_metrics = Metrics() + slrf_metrics = Metrics() + arah_metrics = Metrics() + tava_metrics = Metrics() + + shutil.rmtree('./tmp_quant') + os.makedirs('./tmp_quant/ours', exist_ok = True) + os.makedirs('./tmp_quant/posevocab', exist_ok = True) + os.makedirs('./tmp_quant/slrf', exist_ok = True) + os.makedirs('./tmp_quant/arah', exist_ok = True) + os.makedirs('./tmp_quant/tava', exist_ok = True) + os.makedirs('./tmp_quant/gt', exist_ok = True) + + for frame_id in tqdm(frame_list): + ours_img = (cv.imread(ours_dir + '/%08d.jpg' % frame_id, cv.IMREAD_UNCHANGED) / 255.).astype(np.float32) + posevocab_img = (cv.imread(posevocab_dir + '/%08d.jpg' % frame_id, cv.IMREAD_UNCHANGED) / 255.).astype(np.float32) + slrf_img = (cv.imread(slrf_dir + '/%08d.png' % frame_id, cv.IMREAD_UNCHANGED) / 255.).astype(np.float32) + tava_img = (cv.imread(tava_dir + '/%d.jpg' % frame_id, cv.IMREAD_UNCHANGED) / 255.).astype(np.float32) + arah_img = (cv.imread(arah_dir + '/%d.jpg' % frame_id, cv.IMREAD_UNCHANGED) / 255.).astype(np.float32) + gt_img = (cv.imread(gt_dir + '/%08d.jpg' % frame_id, cv.IMREAD_UNCHANGED) / 255.).astype(np.float32) + mask_img = cv.imread(mask_dir + '/%08d.jpg' % frame_id, cv.IMREAD_UNCHANGED) > 128 + gt_img[~mask_img] = 1. + + ours_img_cropped, posevocab_img_cropped, slrf_img_cropped, tava_img_cropped, arah_img_cropped, gt_img_cropped = \ + crop_image( + mask_img, + 512, + ours_img, + posevocab_img, + slrf_img, + tava_img, + arah_img, + gt_img + ) + + cv.imwrite('./tmp_quant/ours/%08d.png' % frame_id, (ours_img_cropped * 255).astype(np.uint8)) + cv.imwrite('./tmp_quant/posevocab/%08d.png' % frame_id, (posevocab_img_cropped * 255).astype(np.uint8)) + cv.imwrite('./tmp_quant/slrf/%08d.png' % frame_id, (slrf_img_cropped * 255).astype(np.uint8)) + cv.imwrite('./tmp_quant/tava/%08d.png' % frame_id, (tava_img_cropped * 255).astype(np.uint8)) + cv.imwrite('./tmp_quant/arah/%08d.png' % frame_id, (arah_img_cropped * 255).astype(np.uint8)) + cv.imwrite('./tmp_quant/gt/%08d.png' % frame_id, (gt_img_cropped * 255).astype(np.uint8)) + + if ours_img is not None: + ours_metrics.psnr += compute_psnr(ours_img, gt_img) + ours_metrics.ssim += compute_ssim(ours_img, gt_img) + ours_metrics.lpips += compute_lpips(ours_img_cropped, gt_img_cropped) + ours_metrics.count += 1 + + if posevocab_img is not None: + posevocab_metrics.psnr += compute_psnr(posevocab_img, gt_img) + posevocab_metrics.ssim += compute_ssim(posevocab_img, gt_img) + posevocab_metrics.lpips += compute_lpips(posevocab_img_cropped, gt_img_cropped) + posevocab_metrics.count += 1 + + if slrf_img is not None: + slrf_metrics.psnr += compute_psnr(slrf_img, gt_img) + slrf_metrics.ssim += compute_ssim(slrf_img, gt_img) + slrf_metrics.lpips += compute_lpips(slrf_img_cropped, gt_img_cropped) + slrf_metrics.count += 1 + + if arah_img is not None: + arah_metrics.psnr += compute_psnr(arah_img, gt_img) + arah_metrics.ssim += compute_ssim(arah_img, gt_img) + arah_metrics.lpips += compute_lpips(arah_img_cropped, gt_img_cropped) + arah_metrics.count += 1 + + if tava_img is not None: + tava_metrics.psnr += compute_psnr(tava_img, gt_img) + tava_metrics.ssim += compute_ssim(tava_img, gt_img) + tava_metrics.lpips += compute_lpips(tava_img_cropped, gt_img_cropped) + tava_metrics.count += 1 + + print('Ours metrics: ', ours_metrics) + print('PoseVocab metrics: ', posevocab_metrics) + print('SLRF metrics: ', slrf_metrics) + print('ARAH metrics: ', arah_metrics) + print('TAVA metrics: ', tava_metrics) + + print('--- Ours ---') + os.system('python -m pytorch_fid --device cuda {} {}'.format('./tmp_quant/ours', './tmp_quant/gt')) + print('--- PoseVocab ---') + os.system('python -m pytorch_fid --device cuda {} {}'.format('./tmp_quant/posevocab', './tmp_quant/gt')) + print('--- SLRF ---') + os.system('python -m pytorch_fid --device cuda {} {}'.format('./tmp_quant/slrf', './tmp_quant/gt')) + print('--- ARAH ---') + os.system('python -m pytorch_fid --device cuda {} {}'.format('./tmp_quant/arah', './tmp_quant/gt')) + print('--- TAVA ---') + os.system('python -m pytorch_fid --device cuda {} {}'.format('./tmp_quant/tava', './tmp_quant/gt')) + + diff --git a/AnimatableGaussians/eval/score.py b/AnimatableGaussians/eval/score.py new file mode 100644 index 0000000000000000000000000000000000000000..568d97058e6a2106b2bcf3a90e7b14b3815f84d5 --- /dev/null +++ b/AnimatableGaussians/eval/score.py @@ -0,0 +1,108 @@ +import skimage.metrics +import numpy as np +import torch +import cv2 as cv + +from network.lpips import LPIPS + + +class Metrics: + def __init__(self): + self.psnr = 0. + self.ssim = 0. + self.lpips = 0. + self.count = 0 + + def __repr__(self): + if self.count > 0: + return f'Count: {self.count}, PSNR: {self.psnr / self.count}, SSIM: {self.ssim / self.count}, LPIPS: {self.lpips / self.count}' + else: + return 'count is 0!' + + +def crop_image(gt_mask, patch_size, *args): + """ + :param gt_mask: (H, W) + :param patch_size: resize the cropped patch to the given patch_size + :param args: some images with shape of (H, W, C) + """ + mask_uv = np.argwhere(gt_mask > 0.) + min_v, min_u = mask_uv.min(0) + max_v, max_u = mask_uv.max(0) + pad_size = 50 + min_v = (min_v - pad_size).clip(0, gt_mask.shape[0]) + min_u = (min_u - pad_size).clip(0, gt_mask.shape[1]) + max_v = (max_v + pad_size).clip(0, gt_mask.shape[0]) + max_u = (max_u + pad_size).clip(0, gt_mask.shape[1]) + len_v = max_v - min_v + len_u = max_u - min_u + max_size = max(len_v, len_u) + + cropped_images = [] + for image in args: + if image is None: + cropped_images.append(None) + else: + cropped_image = np.ones((max_size, max_size, 3), dtype = image.dtype) + if len_v > len_u: + start_u = (max_size - len_u) // 2 + cropped_image[:, start_u: start_u + len_u] = image[min_v: max_v, min_u: max_u] + else: + start_v = (max_size - len_v) // 2 + cropped_image[start_v: start_v + len_v, :] = image[min_v: max_v, min_u: max_u] + + cropped_image = cv.resize(cropped_image, (patch_size, patch_size), interpolation = cv.INTER_LINEAR) + cropped_images.append(cropped_image) + + if len(cropped_images) > 1: + return cropped_images + else: + return cropped_images[0] + + +def to_tensor(array, device = 'cuda'): + if isinstance(array, np.ndarray): + array = torch.from_numpy(array).to(device) + elif isinstance(array, torch.Tensor): + array = array.to(device) + else: + raise TypeError('Invalid type of array.') + return array + + +def cut_rect(img): + h, w = img.shape[:2] + size = max(h, w) + img_ = torch.ones((size, size, img.shape[2])).to(img) + if h < w: + img_[:h] = img + else: + img_[:, :w] = img + return img_ + + +lpips_net = None + + +def compute_lpips(src, tar, device = 'cuda'): + src = to_tensor(src, device) + tar = to_tensor(tar, device) + global lpips_net + if lpips_net is None: + lpips_net = LPIPS(net = 'vgg').to(device) + if src.shape[0] != src.shape[1]: + src = cut_rect(src) + tar = cut_rect(tar) + with torch.no_grad(): + lpips = lpips_net.forward(src.permute(2, 0, 1)[None], tar.permute(2, 0, 1)[None], normalize = True).mean() + return lpips.item() + + +def compute_psnr(src, tar): + psnr = skimage.metrics.peak_signal_noise_ratio(tar, src, data_range=1) + return psnr + + +def compute_ssim(src, tar): + ssim = skimage.metrics.structural_similarity(src, tar, multichannel = True, data_range = 1) + return ssim diff --git a/AnimatableGaussians/gaussians/__pycache__/gaussian_model.cpython-310.pyc b/AnimatableGaussians/gaussians/__pycache__/gaussian_model.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e03cefc35a5e63d61e7813abd0cf5ce1315c22f9 Binary files /dev/null and b/AnimatableGaussians/gaussians/__pycache__/gaussian_model.cpython-310.pyc differ diff --git a/AnimatableGaussians/gaussians/__pycache__/gaussian_model.cpython-38.pyc b/AnimatableGaussians/gaussians/__pycache__/gaussian_model.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e610e5483cec95bd6f9e29c3049381d9fd6a52e5 Binary files /dev/null and b/AnimatableGaussians/gaussians/__pycache__/gaussian_model.cpython-38.pyc differ diff --git a/AnimatableGaussians/gaussians/__pycache__/gaussian_renderer.cpython-310.pyc b/AnimatableGaussians/gaussians/__pycache__/gaussian_renderer.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..17e832f9ce58e4d2a4c8c8506cf38baefac6b7c1 Binary files /dev/null and b/AnimatableGaussians/gaussians/__pycache__/gaussian_renderer.cpython-310.pyc differ diff --git a/AnimatableGaussians/gaussians/__pycache__/gaussian_renderer.cpython-38.pyc b/AnimatableGaussians/gaussians/__pycache__/gaussian_renderer.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..bb7fd9aa233eb64eccbc779462869c35ae65c905 Binary files /dev/null and b/AnimatableGaussians/gaussians/__pycache__/gaussian_renderer.cpython-38.pyc differ diff --git a/AnimatableGaussians/gaussians/__pycache__/obj_io.cpython-310.pyc b/AnimatableGaussians/gaussians/__pycache__/obj_io.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c41cdcab047426f64017ef103b6903cb9f68ac06 Binary files /dev/null and b/AnimatableGaussians/gaussians/__pycache__/obj_io.cpython-310.pyc differ diff --git a/AnimatableGaussians/gaussians/__pycache__/obj_io.cpython-38.pyc b/AnimatableGaussians/gaussians/__pycache__/obj_io.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4c86cf66e96e3552d4657093ca8f2a8eced7fc1d Binary files /dev/null and b/AnimatableGaussians/gaussians/__pycache__/obj_io.cpython-38.pyc differ diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/.gitignore b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..faabab8435132c722ba96e9a0398e83b226a4e61 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/.gitignore @@ -0,0 +1,8 @@ +build/ +diff_gaussian_rasterization_depth_alpha.egg-info/ +dist/ + +__pycache__ + +*.so +*.idea \ No newline at end of file diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/CMakeLists.txt b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..10cf07b471ab6d032f03f051c92f5b4612712e75 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/CMakeLists.txt @@ -0,0 +1,36 @@ +# +# Copyright (C) 2023, Inria +# GRAPHDECO research group, https://team.inria.fr/graphdeco +# All rights reserved. +# +# This software is free for non-commercial, research and evaluation use +# under the terms of the LICENSE.md file. +# +# For inquiries contact george.drettakis@inria.fr +# + +cmake_minimum_required(VERSION 3.20) + +project(DiffRast LANGUAGES CUDA CXX) + +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_EXTENSIONS OFF) +set(CMAKE_CUDA_STANDARD 17) + +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + +add_library(CudaRasterizer + cuda_rasterizer/backward.h + cuda_rasterizer/backward.cu + cuda_rasterizer/forward.h + cuda_rasterizer/forward.cu + cuda_rasterizer/auxiliary.h + cuda_rasterizer/rasterizer_impl.cu + cuda_rasterizer/rasterizer_impl.h + cuda_rasterizer/rasterizer.h +) + +set_target_properties(CudaRasterizer PROPERTIES CUDA_ARCHITECTURES "75;86") + +target_include_directories(CudaRasterizer PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/cuda_rasterizer) +target_include_directories(CudaRasterizer PRIVATE third_party/glm ${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES}) diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/LICENSE.md b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/LICENSE.md new file mode 100644 index 0000000000000000000000000000000000000000..535c75ea6c094abed18382a67a590dfd5ac92413 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/LICENSE.md @@ -0,0 +1,83 @@ +Gaussian-Splatting License +=========================== + +**Inria** and **the Max Planck Institut for Informatik (MPII)** hold all the ownership rights on the *Software* named **gaussian-splatting**. +The *Software* is in the process of being registered with the Agence pour la Protection des +Programmes (APP). + +The *Software* is still being developed by the *Licensor*. + +*Licensor*'s goal is to allow the research community to use, test and evaluate +the *Software*. + +## 1. Definitions + +*Licensee* means any person or entity that uses the *Software* and distributes +its *Work*. + +*Licensor* means the owners of the *Software*, i.e Inria and MPII + +*Software* means the original work of authorship made available under this +License ie gaussian-splatting. + +*Work* means the *Software* and any additions to or derivative works of the +*Software* that are made available under this License. + + +## 2. Purpose +This license is intended to define the rights granted to the *Licensee* by +Licensors under the *Software*. + +## 3. Rights granted + +For the above reasons Licensors have decided to distribute the *Software*. +Licensors grant non-exclusive rights to use the *Software* for research purposes +to research users (both academic and industrial), free of charge, without right +to sublicense.. The *Software* may be used "non-commercially", i.e., for research +and/or evaluation purposes only. + +Subject to the terms and conditions of this License, you are granted a +non-exclusive, royalty-free, license to reproduce, prepare derivative works of, +publicly display, publicly perform and distribute its *Work* and any resulting +derivative works in any form. + +## 4. Limitations + +**4.1 Redistribution.** You may reproduce or distribute the *Work* only if (a) you do +so under this License, (b) you include a complete copy of this License with +your distribution, and (c) you retain without modification any copyright, +patent, trademark, or attribution notices that are present in the *Work*. + +**4.2 Derivative Works.** You may specify that additional or different terms apply +to the use, reproduction, and distribution of your derivative works of the *Work* +("Your Terms") only if (a) Your Terms provide that the use limitation in +Section 2 applies to your derivative works, and (b) you identify the specific +derivative works that are subject to Your Terms. Notwithstanding Your Terms, +this License (including the redistribution requirements in Section 3.1) will +continue to apply to the *Work* itself. + +**4.3** Any other use without of prior consent of Licensors is prohibited. Research +users explicitly acknowledge having received from Licensors all information +allowing to appreciate the adequacy between of the *Software* and their needs and +to undertake all necessary precautions for its execution and use. + +**4.4** The *Software* is provided both as a compiled library file and as source +code. In case of using the *Software* for a publication or other results obtained +through the use of the *Software*, users are strongly encouraged to cite the +corresponding publications as explained in the documentation of the *Software*. + +## 5. Disclaimer + +THE USER CANNOT USE, EXPLOIT OR DISTRIBUTE THE *SOFTWARE* FOR COMMERCIAL PURPOSES +WITHOUT PRIOR AND EXPLICIT CONSENT OF LICENSORS. YOU MUST CONTACT INRIA FOR ANY +UNAUTHORIZED USE: stip-sophia.transfert@inria.fr . ANY SUCH ACTION WILL +CONSTITUTE A FORGERY. THIS *SOFTWARE* IS PROVIDED "AS IS" WITHOUT ANY WARRANTIES +OF ANY NATURE AND ANY EXPRESS OR IMPLIED WARRANTIES, WITH REGARDS TO COMMERCIAL +USE, PROFESSIONNAL USE, LEGAL OR NOT, OR OTHER, OR COMMERCIALISATION OR +ADAPTATION. UNLESS EXPLICITLY PROVIDED BY LAW, IN NO EVENT, SHALL INRIA OR THE +AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE +GOODS OR SERVICES, LOSS OF USE, DATA, OR PROFITS OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING FROM, OUT OF OR +IN CONNECTION WITH THE *SOFTWARE* OR THE USE OR OTHER DEALINGS IN THE *SOFTWARE*. diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/README.md b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/README.md new file mode 100644 index 0000000000000000000000000000000000000000..5bc12949c9f31e97e53c902925c6127bd669e0f0 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/README.md @@ -0,0 +1,35 @@ +# Differential Gaussian Rasterization + +**NOTE**: this is a modified version to support depth & alpha rendering (both forward and backward) from the [original repository](https://github.com/graphdeco-inria/diff-gaussian-rasterization). + +```python +rendered_image, radii, rendered_depth, rendered_alpha = rasterizer( + means3D=means3D, + means2D=means2D, + shs=shs, + colors_precomp=colors_precomp, + opacities=opacity, + scales=scales, + rotations=rotations, + cov3D_precomp=cov3D_precomp, +) +``` + + +Used as the rasterization engine for the paper "3D Gaussian Splatting for Real-Time Rendering of Radiance Fields". If you can make use of it in your own research, please be so kind to cite us. + +
+
+

BibTeX

+
@Article{kerbl3Dgaussians,
+      author       = {Kerbl, Bernhard and Kopanas, Georgios and Leimk{\"u}hler, Thomas and Drettakis, George},
+      title        = {3D Gaussian Splatting for Real-Time Radiance Field Rendering},
+      journal      = {ACM Transactions on Graphics},
+      number       = {4},
+      volume       = {42},
+      month        = {July},
+      year         = {2023},
+      url          = {https://repo-sam.inria.fr/fungraph/3d-gaussian-splatting/}
+}
+
+
diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/cuda_rasterizer/auxiliary.h b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/cuda_rasterizer/auxiliary.h new file mode 100644 index 0000000000000000000000000000000000000000..cef35bd7ee80c7abd7203b1140987cdbb0819ebe --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/cuda_rasterizer/auxiliary.h @@ -0,0 +1,175 @@ +/* + * Copyright (C) 2023, Inria + * GRAPHDECO research group, https://team.inria.fr/graphdeco + * All rights reserved. + * + * This software is free for non-commercial, research and evaluation use + * under the terms of the LICENSE.md file. + * + * For inquiries contact george.drettakis@inria.fr + */ + +#ifndef CUDA_RASTERIZER_AUXILIARY_H_INCLUDED +#define CUDA_RASTERIZER_AUXILIARY_H_INCLUDED + +#include "config.h" +#include "stdio.h" + +#define BLOCK_SIZE (BLOCK_X * BLOCK_Y) +#define NUM_WARPS (BLOCK_SIZE/32) + +// Spherical harmonics coefficients +__device__ const float SH_C0 = 0.28209479177387814f; +__device__ const float SH_C1 = 0.4886025119029199f; +__device__ const float SH_C2[] = { + 1.0925484305920792f, + -1.0925484305920792f, + 0.31539156525252005f, + -1.0925484305920792f, + 0.5462742152960396f +}; +__device__ const float SH_C3[] = { + -0.5900435899266435f, + 2.890611442640554f, + -0.4570457994644658f, + 0.3731763325901154f, + -0.4570457994644658f, + 1.445305721320277f, + -0.5900435899266435f +}; + +__forceinline__ __device__ float ndc2Pix(float v, int S) +{ + return ((v + 1.0) * S - 1.0) * 0.5; +} + +__forceinline__ __device__ void getRect(const float2 p, int max_radius, uint2& rect_min, uint2& rect_max, dim3 grid) +{ + rect_min = { + min(grid.x, max((int)0, (int)((p.x - max_radius) / BLOCK_X))), + min(grid.y, max((int)0, (int)((p.y - max_radius) / BLOCK_Y))) + }; + rect_max = { + min(grid.x, max((int)0, (int)((p.x + max_radius + BLOCK_X - 1) / BLOCK_X))), + min(grid.y, max((int)0, (int)((p.y + max_radius + BLOCK_Y - 1) / BLOCK_Y))) + }; +} + +__forceinline__ __device__ float3 transformPoint4x3(const float3& p, const float* matrix) +{ + float3 transformed = { + matrix[0] * p.x + matrix[4] * p.y + matrix[8] * p.z + matrix[12], + matrix[1] * p.x + matrix[5] * p.y + matrix[9] * p.z + matrix[13], + matrix[2] * p.x + matrix[6] * p.y + matrix[10] * p.z + matrix[14], + }; + return transformed; +} + +__forceinline__ __device__ float4 transformPoint4x4(const float3& p, const float* matrix) +{ + float4 transformed = { + matrix[0] * p.x + matrix[4] * p.y + matrix[8] * p.z + matrix[12], + matrix[1] * p.x + matrix[5] * p.y + matrix[9] * p.z + matrix[13], + matrix[2] * p.x + matrix[6] * p.y + matrix[10] * p.z + matrix[14], + matrix[3] * p.x + matrix[7] * p.y + matrix[11] * p.z + matrix[15] + }; + return transformed; +} + +__forceinline__ __device__ float3 transformVec4x3(const float3& p, const float* matrix) +{ + float3 transformed = { + matrix[0] * p.x + matrix[4] * p.y + matrix[8] * p.z, + matrix[1] * p.x + matrix[5] * p.y + matrix[9] * p.z, + matrix[2] * p.x + matrix[6] * p.y + matrix[10] * p.z, + }; + return transformed; +} + +__forceinline__ __device__ float3 transformVec4x3Transpose(const float3& p, const float* matrix) +{ + float3 transformed = { + matrix[0] * p.x + matrix[1] * p.y + matrix[2] * p.z, + matrix[4] * p.x + matrix[5] * p.y + matrix[6] * p.z, + matrix[8] * p.x + matrix[9] * p.y + matrix[10] * p.z, + }; + return transformed; +} + +__forceinline__ __device__ float dnormvdz(float3 v, float3 dv) +{ + float sum2 = v.x * v.x + v.y * v.y + v.z * v.z; + float invsum32 = 1.0f / sqrt(sum2 * sum2 * sum2); + float dnormvdz = (-v.x * v.z * dv.x - v.y * v.z * dv.y + (sum2 - v.z * v.z) * dv.z) * invsum32; + return dnormvdz; +} + +__forceinline__ __device__ float3 dnormvdv(float3 v, float3 dv) +{ + float sum2 = v.x * v.x + v.y * v.y + v.z * v.z; + float invsum32 = 1.0f / sqrt(sum2 * sum2 * sum2); + + float3 dnormvdv; + dnormvdv.x = ((+sum2 - v.x * v.x) * dv.x - v.y * v.x * dv.y - v.z * v.x * dv.z) * invsum32; + dnormvdv.y = (-v.x * v.y * dv.x + (sum2 - v.y * v.y) * dv.y - v.z * v.y * dv.z) * invsum32; + dnormvdv.z = (-v.x * v.z * dv.x - v.y * v.z * dv.y + (sum2 - v.z * v.z) * dv.z) * invsum32; + return dnormvdv; +} + +__forceinline__ __device__ float4 dnormvdv(float4 v, float4 dv) +{ + float sum2 = v.x * v.x + v.y * v.y + v.z * v.z + v.w * v.w; + float invsum32 = 1.0f / sqrt(sum2 * sum2 * sum2); + + float4 vdv = { v.x * dv.x, v.y * dv.y, v.z * dv.z, v.w * dv.w }; + float vdv_sum = vdv.x + vdv.y + vdv.z + vdv.w; + float4 dnormvdv; + dnormvdv.x = ((sum2 - v.x * v.x) * dv.x - v.x * (vdv_sum - vdv.x)) * invsum32; + dnormvdv.y = ((sum2 - v.y * v.y) * dv.y - v.y * (vdv_sum - vdv.y)) * invsum32; + dnormvdv.z = ((sum2 - v.z * v.z) * dv.z - v.z * (vdv_sum - vdv.z)) * invsum32; + dnormvdv.w = ((sum2 - v.w * v.w) * dv.w - v.w * (vdv_sum - vdv.w)) * invsum32; + return dnormvdv; +} + +__forceinline__ __device__ float sigmoid(float x) +{ + return 1.0f / (1.0f + expf(-x)); +} + +__forceinline__ __device__ bool in_frustum(int idx, + const float* orig_points, + const float* viewmatrix, + const float* projmatrix, + bool prefiltered, + float3& p_view) +{ + float3 p_orig = { orig_points[3 * idx], orig_points[3 * idx + 1], orig_points[3 * idx + 2] }; + + // Bring points to screen space + float4 p_hom = transformPoint4x4(p_orig, projmatrix); + float p_w = 1.0f / (p_hom.w + 0.0000001f); + float3 p_proj = { p_hom.x * p_w, p_hom.y * p_w, p_hom.z * p_w }; + p_view = transformPoint4x3(p_orig, viewmatrix); + + if (p_view.z <= 0.2f)// || ((p_proj.x < -1.3 || p_proj.x > 1.3 || p_proj.y < -1.3 || p_proj.y > 1.3))) + { + if (prefiltered) + { + printf("Point is filtered although prefiltered is set. This shouldn't happen!"); + __trap(); + } + return false; + } + return true; +} + +#define CHECK_CUDA(A, debug) \ +A; if(debug) { \ +auto ret = cudaDeviceSynchronize(); \ +if (ret != cudaSuccess) { \ +std::cerr << "\n[CUDA ERROR] in " << __FILE__ << "\nLine " << __LINE__ << ": " << cudaGetErrorString(ret); \ +throw std::runtime_error(cudaGetErrorString(ret)); \ +} \ +} + +#endif \ No newline at end of file diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/cuda_rasterizer/backward.cu b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/cuda_rasterizer/backward.cu new file mode 100644 index 0000000000000000000000000000000000000000..1899c29f25f2052133ffdfe05e35b488f2627c9f --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/cuda_rasterizer/backward.cu @@ -0,0 +1,712 @@ +/* + * Copyright (C) 2023, Inria + * GRAPHDECO research group, https://team.inria.fr/graphdeco + * All rights reserved. + * + * This software is free for non-commercial, research and evaluation use + * under the terms of the LICENSE.md file. + * + * For inquiries contact george.drettakis@inria.fr + */ + +#include "backward.h" +#include "auxiliary.h" +#include +#include +namespace cg = cooperative_groups; + +// Backward pass for conversion of spherical harmonics to RGB for +// each Gaussian. +__device__ void computeColorFromSH(int idx, int deg, int max_coeffs, const glm::vec3* means, glm::vec3 campos, const float* shs, const bool* clamped, const glm::vec3* dL_dcolor, glm::vec3* dL_dmeans, glm::vec3* dL_dshs) +{ + // Compute intermediate values, as it is done during forward + glm::vec3 pos = means[idx]; + glm::vec3 dir_orig = pos - campos; + glm::vec3 dir = dir_orig / glm::length(dir_orig); + + glm::vec3* sh = ((glm::vec3*)shs) + idx * max_coeffs; + + // Use PyTorch rule for clamping: if clamping was applied, + // gradient becomes 0. + glm::vec3 dL_dRGB = dL_dcolor[idx]; + dL_dRGB.x *= clamped[3 * idx + 0] ? 0 : 1; + dL_dRGB.y *= clamped[3 * idx + 1] ? 0 : 1; + dL_dRGB.z *= clamped[3 * idx + 2] ? 0 : 1; + + glm::vec3 dRGBdx(0, 0, 0); + glm::vec3 dRGBdy(0, 0, 0); + glm::vec3 dRGBdz(0, 0, 0); + float x = dir.x; + float y = dir.y; + float z = dir.z; + + // Target location for this Gaussian to write SH gradients to + glm::vec3* dL_dsh = dL_dshs + idx * max_coeffs; + + // No tricks here, just high school-level calculus. + float dRGBdsh0 = SH_C0; + dL_dsh[0] = dRGBdsh0 * dL_dRGB; + if (deg > 0) + { + float dRGBdsh1 = -SH_C1 * y; + float dRGBdsh2 = SH_C1 * z; + float dRGBdsh3 = -SH_C1 * x; + dL_dsh[1] = dRGBdsh1 * dL_dRGB; + dL_dsh[2] = dRGBdsh2 * dL_dRGB; + dL_dsh[3] = dRGBdsh3 * dL_dRGB; + + dRGBdx = -SH_C1 * sh[3]; + dRGBdy = -SH_C1 * sh[1]; + dRGBdz = SH_C1 * sh[2]; + + if (deg > 1) + { + float xx = x * x, yy = y * y, zz = z * z; + float xy = x * y, yz = y * z, xz = x * z; + + float dRGBdsh4 = SH_C2[0] * xy; + float dRGBdsh5 = SH_C2[1] * yz; + float dRGBdsh6 = SH_C2[2] * (2.f * zz - xx - yy); + float dRGBdsh7 = SH_C2[3] * xz; + float dRGBdsh8 = SH_C2[4] * (xx - yy); + dL_dsh[4] = dRGBdsh4 * dL_dRGB; + dL_dsh[5] = dRGBdsh5 * dL_dRGB; + dL_dsh[6] = dRGBdsh6 * dL_dRGB; + dL_dsh[7] = dRGBdsh7 * dL_dRGB; + dL_dsh[8] = dRGBdsh8 * dL_dRGB; + + dRGBdx += SH_C2[0] * y * sh[4] + SH_C2[2] * 2.f * -x * sh[6] + SH_C2[3] * z * sh[7] + SH_C2[4] * 2.f * x * sh[8]; + dRGBdy += SH_C2[0] * x * sh[4] + SH_C2[1] * z * sh[5] + SH_C2[2] * 2.f * -y * sh[6] + SH_C2[4] * 2.f * -y * sh[8]; + dRGBdz += SH_C2[1] * y * sh[5] + SH_C2[2] * 2.f * 2.f * z * sh[6] + SH_C2[3] * x * sh[7]; + + if (deg > 2) + { + float dRGBdsh9 = SH_C3[0] * y * (3.f * xx - yy); + float dRGBdsh10 = SH_C3[1] * xy * z; + float dRGBdsh11 = SH_C3[2] * y * (4.f * zz - xx - yy); + float dRGBdsh12 = SH_C3[3] * z * (2.f * zz - 3.f * xx - 3.f * yy); + float dRGBdsh13 = SH_C3[4] * x * (4.f * zz - xx - yy); + float dRGBdsh14 = SH_C3[5] * z * (xx - yy); + float dRGBdsh15 = SH_C3[6] * x * (xx - 3.f * yy); + dL_dsh[9] = dRGBdsh9 * dL_dRGB; + dL_dsh[10] = dRGBdsh10 * dL_dRGB; + dL_dsh[11] = dRGBdsh11 * dL_dRGB; + dL_dsh[12] = dRGBdsh12 * dL_dRGB; + dL_dsh[13] = dRGBdsh13 * dL_dRGB; + dL_dsh[14] = dRGBdsh14 * dL_dRGB; + dL_dsh[15] = dRGBdsh15 * dL_dRGB; + + dRGBdx += ( + SH_C3[0] * sh[9] * 3.f * 2.f * xy + + SH_C3[1] * sh[10] * yz + + SH_C3[2] * sh[11] * -2.f * xy + + SH_C3[3] * sh[12] * -3.f * 2.f * xz + + SH_C3[4] * sh[13] * (-3.f * xx + 4.f * zz - yy) + + SH_C3[5] * sh[14] * 2.f * xz + + SH_C3[6] * sh[15] * 3.f * (xx - yy)); + + dRGBdy += ( + SH_C3[0] * sh[9] * 3.f * (xx - yy) + + SH_C3[1] * sh[10] * xz + + SH_C3[2] * sh[11] * (-3.f * yy + 4.f * zz - xx) + + SH_C3[3] * sh[12] * -3.f * 2.f * yz + + SH_C3[4] * sh[13] * -2.f * xy + + SH_C3[5] * sh[14] * -2.f * yz + + SH_C3[6] * sh[15] * -3.f * 2.f * xy); + + dRGBdz += ( + SH_C3[1] * sh[10] * xy + + SH_C3[2] * sh[11] * 4.f * 2.f * yz + + SH_C3[3] * sh[12] * 3.f * (2.f * zz - xx - yy) + + SH_C3[4] * sh[13] * 4.f * 2.f * xz + + SH_C3[5] * sh[14] * (xx - yy)); + } + } + } + + // The view direction is an input to the computation. View direction + // is influenced by the Gaussian's mean, so SHs gradients + // must propagate back into 3D position. + glm::vec3 dL_ddir(glm::dot(dRGBdx, dL_dRGB), glm::dot(dRGBdy, dL_dRGB), glm::dot(dRGBdz, dL_dRGB)); + + // Account for normalization of direction + float3 dL_dmean = dnormvdv(float3{ dir_orig.x, dir_orig.y, dir_orig.z }, float3{ dL_ddir.x, dL_ddir.y, dL_ddir.z }); + + // Gradients of loss w.r.t. Gaussian means, but only the portion + // that is caused because the mean affects the view-dependent color. + // Additional mean gradient is accumulated in below methods. + dL_dmeans[idx] += glm::vec3(dL_dmean.x, dL_dmean.y, dL_dmean.z); +} + +// Backward version of INVERSE 2D covariance matrix computation +// (due to length launched as separate kernel before other +// backward steps contained in preprocess) +__global__ void computeCov2DCUDA(int P, + const float3* means, + const int* radii, + const float* cov3Ds, + const float h_x, float h_y, + const float tan_fovx, float tan_fovy, + const float* view_matrix, + const float* dL_dconics, + float3* dL_dmeans, + float* dL_dcov) +{ + auto idx = cg::this_grid().thread_rank(); + if (idx >= P || !(radii[idx] > 0)) + return; + + // Reading location of 3D covariance for this Gaussian + const float* cov3D = cov3Ds + 6 * idx; + + // Fetch gradients, recompute 2D covariance and relevant + // intermediate forward results needed in the backward. + float3 mean = means[idx]; + float3 dL_dconic = { dL_dconics[4 * idx], dL_dconics[4 * idx + 1], dL_dconics[4 * idx + 3] }; + float3 t = transformPoint4x3(mean, view_matrix); + + const float limx = 1.3f * tan_fovx; + const float limy = 1.3f * tan_fovy; + const float txtz = t.x / t.z; + const float tytz = t.y / t.z; + t.x = min(limx, max(-limx, txtz)) * t.z; + t.y = min(limy, max(-limy, tytz)) * t.z; + + const float x_grad_mul = txtz < -limx || txtz > limx ? 0 : 1; + const float y_grad_mul = tytz < -limy || tytz > limy ? 0 : 1; + + glm::mat3 J = glm::mat3(h_x / t.z, 0.0f, -(h_x * t.x) / (t.z * t.z), + 0.0f, h_y / t.z, -(h_y * t.y) / (t.z * t.z), + 0, 0, 0); + + glm::mat3 W = glm::mat3( + view_matrix[0], view_matrix[4], view_matrix[8], + view_matrix[1], view_matrix[5], view_matrix[9], + view_matrix[2], view_matrix[6], view_matrix[10]); + + glm::mat3 Vrk = glm::mat3( + cov3D[0], cov3D[1], cov3D[2], + cov3D[1], cov3D[3], cov3D[4], + cov3D[2], cov3D[4], cov3D[5]); + + glm::mat3 T = W * J; + + glm::mat3 cov2D = glm::transpose(T) * glm::transpose(Vrk) * T; + + // Use helper variables for 2D covariance entries. More compact. + float a = cov2D[0][0] += 0.3f; + float b = cov2D[0][1]; + float c = cov2D[1][1] += 0.3f; + + float denom = a * c - b * b; + float dL_da = 0, dL_db = 0, dL_dc = 0; + float denom2inv = 1.0f / ((denom * denom) + 0.0000001f); + + if (denom2inv != 0) + { + // Gradients of loss w.r.t. entries of 2D covariance matrix, + // given gradients of loss w.r.t. conic matrix (inverse covariance matrix). + // e.g., dL / da = dL / d_conic_a * d_conic_a / d_a + dL_da = denom2inv * (-c * c * dL_dconic.x + 2 * b * c * dL_dconic.y + (denom - a * c) * dL_dconic.z); + dL_dc = denom2inv * (-a * a * dL_dconic.z + 2 * a * b * dL_dconic.y + (denom - a * c) * dL_dconic.x); + dL_db = denom2inv * 2 * (b * c * dL_dconic.x - (denom + 2 * b * b) * dL_dconic.y + a * b * dL_dconic.z); + + // Gradients of loss L w.r.t. each 3D covariance matrix (Vrk) entry, + // given gradients w.r.t. 2D covariance matrix (diagonal). + // cov2D = transpose(T) * transpose(Vrk) * T; + dL_dcov[6 * idx + 0] = (T[0][0] * T[0][0] * dL_da + T[0][0] * T[1][0] * dL_db + T[1][0] * T[1][0] * dL_dc); + dL_dcov[6 * idx + 3] = (T[0][1] * T[0][1] * dL_da + T[0][1] * T[1][1] * dL_db + T[1][1] * T[1][1] * dL_dc); + dL_dcov[6 * idx + 5] = (T[0][2] * T[0][2] * dL_da + T[0][2] * T[1][2] * dL_db + T[1][2] * T[1][2] * dL_dc); + + // Gradients of loss L w.r.t. each 3D covariance matrix (Vrk) entry, + // given gradients w.r.t. 2D covariance matrix (off-diagonal). + // Off-diagonal elements appear twice --> double the gradient. + // cov2D = transpose(T) * transpose(Vrk) * T; + dL_dcov[6 * idx + 1] = 2 * T[0][0] * T[0][1] * dL_da + (T[0][0] * T[1][1] + T[0][1] * T[1][0]) * dL_db + 2 * T[1][0] * T[1][1] * dL_dc; + dL_dcov[6 * idx + 2] = 2 * T[0][0] * T[0][2] * dL_da + (T[0][0] * T[1][2] + T[0][2] * T[1][0]) * dL_db + 2 * T[1][0] * T[1][2] * dL_dc; + dL_dcov[6 * idx + 4] = 2 * T[0][2] * T[0][1] * dL_da + (T[0][1] * T[1][2] + T[0][2] * T[1][1]) * dL_db + 2 * T[1][1] * T[1][2] * dL_dc; + } + else + { + for (int i = 0; i < 6; i++) + dL_dcov[6 * idx + i] = 0; + } + + // Gradients of loss w.r.t. upper 2x3 portion of intermediate matrix T + // cov2D = transpose(T) * transpose(Vrk) * T; + float dL_dT00 = 2 * (T[0][0] * Vrk[0][0] + T[0][1] * Vrk[0][1] + T[0][2] * Vrk[0][2]) * dL_da + + (T[1][0] * Vrk[0][0] + T[1][1] * Vrk[0][1] + T[1][2] * Vrk[0][2]) * dL_db; + float dL_dT01 = 2 * (T[0][0] * Vrk[1][0] + T[0][1] * Vrk[1][1] + T[0][2] * Vrk[1][2]) * dL_da + + (T[1][0] * Vrk[1][0] + T[1][1] * Vrk[1][1] + T[1][2] * Vrk[1][2]) * dL_db; + float dL_dT02 = 2 * (T[0][0] * Vrk[2][0] + T[0][1] * Vrk[2][1] + T[0][2] * Vrk[2][2]) * dL_da + + (T[1][0] * Vrk[2][0] + T[1][1] * Vrk[2][1] + T[1][2] * Vrk[2][2]) * dL_db; + float dL_dT10 = 2 * (T[1][0] * Vrk[0][0] + T[1][1] * Vrk[0][1] + T[1][2] * Vrk[0][2]) * dL_dc + + (T[0][0] * Vrk[0][0] + T[0][1] * Vrk[0][1] + T[0][2] * Vrk[0][2]) * dL_db; + float dL_dT11 = 2 * (T[1][0] * Vrk[1][0] + T[1][1] * Vrk[1][1] + T[1][2] * Vrk[1][2]) * dL_dc + + (T[0][0] * Vrk[1][0] + T[0][1] * Vrk[1][1] + T[0][2] * Vrk[1][2]) * dL_db; + float dL_dT12 = 2 * (T[1][0] * Vrk[2][0] + T[1][1] * Vrk[2][1] + T[1][2] * Vrk[2][2]) * dL_dc + + (T[0][0] * Vrk[2][0] + T[0][1] * Vrk[2][1] + T[0][2] * Vrk[2][2]) * dL_db; + + // Gradients of loss w.r.t. upper 3x2 non-zero entries of Jacobian matrix + // T = W * J + float dL_dJ00 = W[0][0] * dL_dT00 + W[0][1] * dL_dT01 + W[0][2] * dL_dT02; + float dL_dJ02 = W[2][0] * dL_dT00 + W[2][1] * dL_dT01 + W[2][2] * dL_dT02; + float dL_dJ11 = W[1][0] * dL_dT10 + W[1][1] * dL_dT11 + W[1][2] * dL_dT12; + float dL_dJ12 = W[2][0] * dL_dT10 + W[2][1] * dL_dT11 + W[2][2] * dL_dT12; + + float tz = 1.f / t.z; + float tz2 = tz * tz; + float tz3 = tz2 * tz; + + // Gradients of loss w.r.t. transformed Gaussian mean t + float dL_dtx = x_grad_mul * -h_x * tz2 * dL_dJ02; + float dL_dty = y_grad_mul * -h_y * tz2 * dL_dJ12; + float dL_dtz = -h_x * tz2 * dL_dJ00 - h_y * tz2 * dL_dJ11 + (2 * h_x * t.x) * tz3 * dL_dJ02 + (2 * h_y * t.y) * tz3 * dL_dJ12; + + // Account for transformation of mean to t + // t = transformPoint4x3(mean, view_matrix); + float3 dL_dmean = transformVec4x3Transpose({ dL_dtx, dL_dty, dL_dtz }, view_matrix); + + // Gradients of loss w.r.t. Gaussian means, but only the portion + // that is caused because the mean affects the covariance matrix. + // Additional mean gradient is accumulated in BACKWARD::preprocess. + dL_dmeans[idx] = dL_dmean; +} + +// Backward pass for the conversion of scale and rotation to a +// 3D covariance matrix for each Gaussian. +__device__ void computeCov3D(int idx, const glm::vec3 scale, float mod, const glm::vec4 rot, const float* dL_dcov3Ds, glm::vec3* dL_dscales, glm::vec4* dL_drots) +{ + // Recompute (intermediate) results for the 3D covariance computation. + glm::vec4 q = rot;// / glm::length(rot); + float r = q.x; + float x = q.y; + float y = q.z; + float z = q.w; + + glm::mat3 R = glm::mat3( + 1.f - 2.f * (y * y + z * z), 2.f * (x * y - r * z), 2.f * (x * z + r * y), + 2.f * (x * y + r * z), 1.f - 2.f * (x * x + z * z), 2.f * (y * z - r * x), + 2.f * (x * z - r * y), 2.f * (y * z + r * x), 1.f - 2.f * (x * x + y * y) + ); + + glm::mat3 S = glm::mat3(1.0f); + + glm::vec3 s = mod * scale; + S[0][0] = s.x; + S[1][1] = s.y; + S[2][2] = s.z; + + glm::mat3 M = S * R; + + const float* dL_dcov3D = dL_dcov3Ds + 6 * idx; + + glm::vec3 dunc(dL_dcov3D[0], dL_dcov3D[3], dL_dcov3D[5]); + glm::vec3 ounc = 0.5f * glm::vec3(dL_dcov3D[1], dL_dcov3D[2], dL_dcov3D[4]); + + // Convert per-element covariance loss gradients to matrix form + glm::mat3 dL_dSigma = glm::mat3( + dL_dcov3D[0], 0.5f * dL_dcov3D[1], 0.5f * dL_dcov3D[2], + 0.5f * dL_dcov3D[1], dL_dcov3D[3], 0.5f * dL_dcov3D[4], + 0.5f * dL_dcov3D[2], 0.5f * dL_dcov3D[4], dL_dcov3D[5] + ); + + // Compute loss gradient w.r.t. matrix M + // dSigma_dM = 2 * M + glm::mat3 dL_dM = 2.0f * M * dL_dSigma; + + glm::mat3 Rt = glm::transpose(R); + glm::mat3 dL_dMt = glm::transpose(dL_dM); + + // Gradients of loss w.r.t. scale + glm::vec3* dL_dscale = dL_dscales + idx; + dL_dscale->x = glm::dot(Rt[0], dL_dMt[0]); + dL_dscale->y = glm::dot(Rt[1], dL_dMt[1]); + dL_dscale->z = glm::dot(Rt[2], dL_dMt[2]); + + dL_dMt[0] *= s.x; + dL_dMt[1] *= s.y; + dL_dMt[2] *= s.z; + + // Gradients of loss w.r.t. normalized quaternion + glm::vec4 dL_dq; + dL_dq.x = 2 * z * (dL_dMt[0][1] - dL_dMt[1][0]) + 2 * y * (dL_dMt[2][0] - dL_dMt[0][2]) + 2 * x * (dL_dMt[1][2] - dL_dMt[2][1]); + dL_dq.y = 2 * y * (dL_dMt[1][0] + dL_dMt[0][1]) + 2 * z * (dL_dMt[2][0] + dL_dMt[0][2]) + 2 * r * (dL_dMt[1][2] - dL_dMt[2][1]) - 4 * x * (dL_dMt[2][2] + dL_dMt[1][1]); + dL_dq.z = 2 * x * (dL_dMt[1][0] + dL_dMt[0][1]) + 2 * r * (dL_dMt[2][0] - dL_dMt[0][2]) + 2 * z * (dL_dMt[1][2] + dL_dMt[2][1]) - 4 * y * (dL_dMt[2][2] + dL_dMt[0][0]); + dL_dq.w = 2 * r * (dL_dMt[0][1] - dL_dMt[1][0]) + 2 * x * (dL_dMt[2][0] + dL_dMt[0][2]) + 2 * y * (dL_dMt[1][2] + dL_dMt[2][1]) - 4 * z * (dL_dMt[1][1] + dL_dMt[0][0]); + + // Gradients of loss w.r.t. unnormalized quaternion + float4* dL_drot = (float4*)(dL_drots + idx); + *dL_drot = float4{ dL_dq.x, dL_dq.y, dL_dq.z, dL_dq.w };//dnormvdv(float4{ rot.x, rot.y, rot.z, rot.w }, float4{ dL_dq.x, dL_dq.y, dL_dq.z, dL_dq.w }); +} + +// Backward pass of the preprocessing steps, except +// for the covariance computation and inversion +// (those are handled by a previous kernel call) +template +__global__ void preprocessCUDA( + int P, int D, int M, + const float3* means, + const int* radii, + const float* shs, + const bool* clamped, + const glm::vec3* scales, + const glm::vec4* rotations, + const float scale_modifier, + const float* view, + const float* proj, + const glm::vec3* campos, + const float3* dL_dmean2D, + glm::vec3* dL_dmeans, + float* dL_dcolor, + float* dL_ddepth, + float* dL_dcov3D, + float* dL_dsh, + glm::vec3* dL_dscale, + glm::vec4* dL_drot) +{ + auto idx = cg::this_grid().thread_rank(); + if (idx >= P || !(radii[idx] > 0)) + return; + + float3 m = means[idx]; + + // Taking care of gradients from the screenspace points + float4 m_hom = transformPoint4x4(m, proj); + float m_w = 1.0f / (m_hom.w + 0.0000001f); + + // Compute loss gradient w.r.t. 3D means due to gradients of 2D means + // from rendering procedure + glm::vec3 dL_dmean; + float mul1 = (proj[0] * m.x + proj[4] * m.y + proj[8] * m.z + proj[12]) * m_w * m_w; + float mul2 = (proj[1] * m.x + proj[5] * m.y + proj[9] * m.z + proj[13]) * m_w * m_w; + dL_dmean.x = (proj[0] * m_w - proj[3] * mul1) * dL_dmean2D[idx].x + (proj[1] * m_w - proj[3] * mul2) * dL_dmean2D[idx].y; + dL_dmean.y = (proj[4] * m_w - proj[7] * mul1) * dL_dmean2D[idx].x + (proj[5] * m_w - proj[7] * mul2) * dL_dmean2D[idx].y; + dL_dmean.z = (proj[8] * m_w - proj[11] * mul1) * dL_dmean2D[idx].x + (proj[9] * m_w - proj[11] * mul2) * dL_dmean2D[idx].y; + + // That's the second part of the mean gradient. Previous computation + // of cov2D and following SH conversion also affects it. + dL_dmeans[idx] += dL_dmean; + + // the w must be equal to 1 for view^T * [x,y,z,1] + float3 m_view = transformPoint4x3(m, view); + + // Compute loss gradient w.r.t. 3D means due to gradients of depth + // from rendering procedure + glm::vec3 dL_dmean2; + float mul3 = view[2] * m.x + view[6] * m.y + view[10] * m.z + view[14]; + dL_dmean2.x = (view[2] - view[3] * mul3) * dL_ddepth[idx]; + dL_dmean2.y = (view[6] - view[7] * mul3) * dL_ddepth[idx]; + dL_dmean2.z = (view[10] - view[11] * mul3) * dL_ddepth[idx]; + + // That's the third part of the mean gradient. + dL_dmeans[idx] += dL_dmean2; + + // Compute gradient updates due to computing colors from SHs + if (shs) + computeColorFromSH(idx, D, M, (glm::vec3*)means, *campos, shs, clamped, (glm::vec3*)dL_dcolor, (glm::vec3*)dL_dmeans, (glm::vec3*)dL_dsh); + + // Compute gradient updates due to computing covariance from scale/rotation + if (scales) + computeCov3D(idx, scales[idx], scale_modifier, rotations[idx], dL_dcov3D, dL_dscale, dL_drot); +} + +// Backward version of the rendering procedure. +template +__global__ void __launch_bounds__(BLOCK_X * BLOCK_Y) +renderCUDA( + const uint2* __restrict__ ranges, + const uint32_t* __restrict__ point_list, + int W, int H, + const float* __restrict__ bg_color, + const float2* __restrict__ points_xy_image, + const float4* __restrict__ conic_opacity, + const float* __restrict__ colors, + const float* __restrict__ depths, + const float* __restrict__ alphas, + const uint32_t* __restrict__ n_contrib, + const float* __restrict__ dL_dpixels, + const float* __restrict__ dL_dpixel_depths, + const float* __restrict__ dL_dalphas, + float3* __restrict__ dL_dmean2D, + float4* __restrict__ dL_dconic2D, + float* __restrict__ dL_dopacity, + float* __restrict__ dL_dcolors, + float* __restrict__ dL_ddepths +) +{ + // We rasterize again. Compute necessary block info. + auto block = cg::this_thread_block(); + const uint32_t horizontal_blocks = (W + BLOCK_X - 1) / BLOCK_X; + const uint2 pix_min = { block.group_index().x * BLOCK_X, block.group_index().y * BLOCK_Y }; + const uint2 pix_max = { min(pix_min.x + BLOCK_X, W), min(pix_min.y + BLOCK_Y , H) }; + const uint2 pix = { pix_min.x + block.thread_index().x, pix_min.y + block.thread_index().y }; + const uint32_t pix_id = W * pix.y + pix.x; + const float2 pixf = { (float)pix.x, (float)pix.y }; + + const bool inside = pix.x < W&& pix.y < H; + const uint2 range = ranges[block.group_index().y * horizontal_blocks + block.group_index().x]; + + const int rounds = ((range.y - range.x + BLOCK_SIZE - 1) / BLOCK_SIZE); + + bool done = !inside; + int toDo = range.y - range.x; + + __shared__ int collected_id[BLOCK_SIZE]; + __shared__ float2 collected_xy[BLOCK_SIZE]; + __shared__ float4 collected_conic_opacity[BLOCK_SIZE]; + __shared__ float collected_colors[C * BLOCK_SIZE]; + __shared__ float collected_depths[BLOCK_SIZE]; + + // In the forward, we stored the final value for T, the + // product of all (1 - alpha) factors. + const float T_final = inside ? (1 - alphas[pix_id]) : 0; + float T = T_final; + + // We start from the back. The ID of the last contributing + // Gaussian is known from each pixel from the forward. + uint32_t contributor = toDo; + const int last_contributor = inside ? n_contrib[pix_id] : 0; + + float accum_rec[C] = { 0 }; + float dL_dpixel[C]; + float accum_depth_rec = 0; + float dL_dpixel_depth; + float accum_alpha_rec = 0; + float dL_dalpha; + if (inside) { + for (int i = 0; i < C; i++) + dL_dpixel[i] = dL_dpixels[i * H * W + pix_id]; + dL_dpixel_depth = dL_dpixel_depths[pix_id]; + dL_dalpha = dL_dalphas[pix_id]; + } + + float last_alpha = 0; + float last_color[C] = { 0 }; + float last_depth = 0; + + // Gradient of pixel coordinate w.r.t. normalized + // screen-space viewport corrdinates (-1 to 1) + const float ddelx_dx = 0.5 * W; + const float ddely_dy = 0.5 * H; + + // Traverse all Gaussians + for (int i = 0; i < rounds; i++, toDo -= BLOCK_SIZE) + { + // Load auxiliary data into shared memory, start in the BACK + // and load them in revers order. + block.sync(); + const int progress = i * BLOCK_SIZE + block.thread_rank(); + if (range.x + progress < range.y) + { + const int coll_id = point_list[range.y - progress - 1]; + collected_id[block.thread_rank()] = coll_id; + collected_xy[block.thread_rank()] = points_xy_image[coll_id]; + collected_conic_opacity[block.thread_rank()] = conic_opacity[coll_id]; + for (int i = 0; i < C; i++) + collected_colors[i * BLOCK_SIZE + block.thread_rank()] = colors[coll_id * C + i]; + collected_depths[block.thread_rank()] = depths[coll_id]; + } + block.sync(); + + // Iterate over Gaussians + for (int j = 0; !done && j < min(BLOCK_SIZE, toDo); j++) + { + // Keep track of current Gaussian ID. Skip, if this one + // is behind the last contributor for this pixel. + contributor--; + if (contributor >= last_contributor) + continue; + + // Compute blending values, as before. + const float2 xy = collected_xy[j]; + const float2 d = { xy.x - pixf.x, xy.y - pixf.y }; + const float4 con_o = collected_conic_opacity[j]; + const float power = -0.5f * (con_o.x * d.x * d.x + con_o.z * d.y * d.y) - con_o.y * d.x * d.y; + if (power > 0.0f) + continue; + + const float G = exp(power); + const float alpha = min(0.99f, con_o.w * G); + if (alpha < 1.0f / 255.0f) + continue; + + T = T / (1.f - alpha); + const float dchannel_dcolor = alpha * T; + const float dpixel_depth_ddepth = alpha * T; + + // Propagate gradients to per-Gaussian colors and keep + // gradients w.r.t. alpha (blending factor for a Gaussian/pixel + // pair). + float dL_dopa = 0.0f; + const int global_id = collected_id[j]; + for (int ch = 0; ch < C; ch++) + { + const float c = collected_colors[ch * BLOCK_SIZE + j]; + // Update last color (to be used in the next iteration) + accum_rec[ch] = last_alpha * last_color[ch] + (1.f - last_alpha) * accum_rec[ch]; + last_color[ch] = c; + + const float dL_dchannel = dL_dpixel[ch]; + dL_dopa += (c - accum_rec[ch]) * dL_dchannel; + // Update the gradients w.r.t. color of the Gaussian. + // Atomic, since this pixel is just one of potentially + // many that were affected by this Gaussian. + atomicAdd(&(dL_dcolors[global_id * C + ch]), dchannel_dcolor * dL_dchannel); + } + + // Propagate gradients from pixel depth to opacity + const float c_d = collected_depths[j]; + accum_depth_rec = last_alpha * last_depth + (1.f - last_alpha) * accum_depth_rec; + last_depth = c_d; + dL_dopa += (c_d - accum_depth_rec) * dL_dpixel_depth; + atomicAdd(&(dL_ddepths[global_id]), dpixel_depth_ddepth * dL_dpixel_depth); + + // Propagate gradients from pixel alpha (weights_sum) to opacity + accum_alpha_rec = last_alpha + (1.f - last_alpha) * accum_alpha_rec; + dL_dopa += (1 - accum_alpha_rec) * dL_dalpha; //- (alpha - accum_alpha_rec) * dL_dalpha; + + dL_dopa *= T; + // Update last alpha (to be used in the next iteration) + last_alpha = alpha; + + // Account for fact that alpha also influences how much of + // the background color is added if nothing left to blend + float bg_dot_dpixel = 0; + for (int i = 0; i < C; i++) + bg_dot_dpixel += bg_color[i] * dL_dpixel[i]; + dL_dopa += (-T_final / (1.f - alpha)) * bg_dot_dpixel; + + + // Helpful reusable temporary variables + const float dL_dG = con_o.w * dL_dopa; + const float gdx = G * d.x; + const float gdy = G * d.y; + const float dG_ddelx = -gdx * con_o.x - gdy * con_o.y; + const float dG_ddely = -gdy * con_o.z - gdx * con_o.y; + + // Update gradients w.r.t. 2D mean position of the Gaussian + atomicAdd(&dL_dmean2D[global_id].x, dL_dG * dG_ddelx * ddelx_dx); + atomicAdd(&dL_dmean2D[global_id].y, dL_dG * dG_ddely * ddely_dy); + + // Update gradients w.r.t. 2D covariance (2x2 matrix, symmetric) + atomicAdd(&dL_dconic2D[global_id].x, -0.5f * gdx * d.x * dL_dG); + atomicAdd(&dL_dconic2D[global_id].y, -0.5f * gdx * d.y * dL_dG); + atomicAdd(&dL_dconic2D[global_id].w, -0.5f * gdy * d.y * dL_dG); + + // Update gradients w.r.t. opacity of the Gaussian + atomicAdd(&(dL_dopacity[global_id]), G * dL_dopa); + } + } +} + +void BACKWARD::preprocess( + int P, int D, int M, + const float3* means3D, + const int* radii, + const float* shs, + const bool* clamped, + const glm::vec3* scales, + const glm::vec4* rotations, + const float scale_modifier, + const float* cov3Ds, + const float* viewmatrix, + const float* projmatrix, + const float focal_x, float focal_y, + const float tan_fovx, float tan_fovy, + const glm::vec3* campos, + const float3* dL_dmean2D, + const float* dL_dconic, + glm::vec3* dL_dmean3D, + float* dL_dcolor, + float* dL_ddepth, + float* dL_dcov3D, + float* dL_dsh, + glm::vec3* dL_dscale, + glm::vec4* dL_drot) +{ + // Propagate gradients for the path of 2D conic matrix computation. + // Somewhat long, thus it is its own kernel rather than being part of + // "preprocess". When done, loss gradient w.r.t. 3D means has been + // modified and gradient w.r.t. 3D covariance matrix has been computed. + computeCov2DCUDA << <(P + 255) / 256, 256 >> > ( + P, + means3D, + radii, + cov3Ds, + focal_x, + focal_y, + tan_fovx, + tan_fovy, + viewmatrix, + dL_dconic, + (float3*)dL_dmean3D, + dL_dcov3D); + + // Propagate gradients for remaining steps: finish 3D mean gradients, + // propagate color gradients to SH (if desireD), propagate 3D covariance + // matrix gradients to scale and rotation. + preprocessCUDA << < (P + 255) / 256, 256 >> > ( + P, D, M, + (float3*)means3D, + radii, + shs, + clamped, + (glm::vec3*)scales, + (glm::vec4*)rotations, + scale_modifier, + viewmatrix, + projmatrix, + campos, + (float3*)dL_dmean2D, + (glm::vec3*)dL_dmean3D, + dL_dcolor, + dL_ddepth, + dL_dcov3D, + dL_dsh, + dL_dscale, + dL_drot); +} + +void BACKWARD::render( + const dim3 grid, const dim3 block, + const uint2* ranges, + const uint32_t* point_list, + int W, int H, + const float* bg_color, + const float2* means2D, + const float4* conic_opacity, + const float* colors, + const float* depths, + const float* alphas, + const uint32_t* n_contrib, + const float* dL_dpixels, + const float* dL_dpixel_depths, + const float* dL_dalphas, + float3* dL_dmean2D, + float4* dL_dconic2D, + float* dL_dopacity, + float* dL_dcolors, + float* dL_ddepths) +{ + renderCUDA << > >( + ranges, + point_list, + W, H, + bg_color, + means2D, + conic_opacity, + colors, + depths, + alphas, + n_contrib, + dL_dpixels, + dL_dpixel_depths, + dL_dalphas, + dL_dmean2D, + dL_dconic2D, + dL_dopacity, + dL_dcolors, + dL_ddepths + ); +} \ No newline at end of file diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/cuda_rasterizer/backward.h b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/cuda_rasterizer/backward.h new file mode 100644 index 0000000000000000000000000000000000000000..6aa5e735b2a6e5bcfabd79e0c11ca8b252b2971f --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/cuda_rasterizer/backward.h @@ -0,0 +1,70 @@ +/* + * Copyright (C) 2023, Inria + * GRAPHDECO research group, https://team.inria.fr/graphdeco + * All rights reserved. + * + * This software is free for non-commercial, research and evaluation use + * under the terms of the LICENSE.md file. + * + * For inquiries contact george.drettakis@inria.fr + */ + +#ifndef CUDA_RASTERIZER_BACKWARD_H_INCLUDED +#define CUDA_RASTERIZER_BACKWARD_H_INCLUDED + +#include +#include "cuda_runtime.h" +#include "device_launch_parameters.h" +#define GLM_FORCE_CUDA +#include + +namespace BACKWARD +{ + void render( + const dim3 grid, dim3 block, + const uint2* ranges, + const uint32_t* point_list, + int W, int H, + const float* bg_color, + const float2* means2D, + const float4* conic_opacity, + const float* colors, + const float* depths, + const float* alphas, + const uint32_t* n_contrib, + const float* dL_dpixels, + const float* dL_dpixel_depths, + const float* dL_dalphas, + float3* dL_dmean2D, + float4* dL_dconic2D, + float* dL_dopacity, + float* dL_dcolors, + float* dL_ddepths); + + void preprocess( + int P, int D, int M, + const float3* means, + const int* radii, + const float* shs, + const bool* clamped, + const glm::vec3* scales, + const glm::vec4* rotations, + const float scale_modifier, + const float* cov3Ds, + const float* view, + const float* proj, + const float focal_x, float focal_y, + const float tan_fovx, float tan_fovy, + const glm::vec3* campos, + const float3* dL_dmean2D, + const float* dL_dconics, + glm::vec3* dL_dmeans, + float* dL_dcolor, + float* dL_ddepth, + float* dL_dcov3D, + float* dL_dsh, + glm::vec3* dL_dscale, + glm::vec4* dL_drot); +} + +#endif \ No newline at end of file diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/cuda_rasterizer/config.h b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/cuda_rasterizer/config.h new file mode 100644 index 0000000000000000000000000000000000000000..68374144a79d881c58ba3ae1a903d9fd066351e0 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/cuda_rasterizer/config.h @@ -0,0 +1,19 @@ +/* + * Copyright (C) 2023, Inria + * GRAPHDECO research group, https://team.inria.fr/graphdeco + * All rights reserved. + * + * This software is free for non-commercial, research and evaluation use + * under the terms of the LICENSE.md file. + * + * For inquiries contact george.drettakis@inria.fr + */ + +#ifndef CUDA_RASTERIZER_CONFIG_H_INCLUDED +#define CUDA_RASTERIZER_CONFIG_H_INCLUDED + +#define NUM_CHANNELS 3 // Default 3, RGB +#define BLOCK_X 16 +#define BLOCK_Y 16 + +#endif \ No newline at end of file diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/cuda_rasterizer/forward.cu b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/cuda_rasterizer/forward.cu new file mode 100644 index 0000000000000000000000000000000000000000..4e493ddeaeace4a283613c42ba7b097a588aeee5 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/cuda_rasterizer/forward.cu @@ -0,0 +1,466 @@ +/* + * Copyright (C) 2023, Inria + * GRAPHDECO research group, https://team.inria.fr/graphdeco + * All rights reserved. + * + * This software is free for non-commercial, research and evaluation use + * under the terms of the LICENSE.md file. + * + * For inquiries contact george.drettakis@inria.fr + */ + +#include "forward.h" +#include "auxiliary.h" +#include +#include +namespace cg = cooperative_groups; + +// Forward method for converting the input spherical harmonics +// coefficients of each Gaussian to a simple RGB color. +__device__ glm::vec3 computeColorFromSH(int idx, int deg, int max_coeffs, const glm::vec3* means, glm::vec3 campos, const float* shs, bool* clamped) +{ + // The implementation is loosely based on code for + // "Differentiable Point-Based Radiance Fields for + // Efficient View Synthesis" by Zhang et al. (2022) + glm::vec3 pos = means[idx]; + glm::vec3 dir = pos - campos; + dir = dir / glm::length(dir); + + glm::vec3* sh = ((glm::vec3*)shs) + idx * max_coeffs; + glm::vec3 result = SH_C0 * sh[0]; + + if (deg > 0) + { + float x = dir.x; + float y = dir.y; + float z = dir.z; + result = result - SH_C1 * y * sh[1] + SH_C1 * z * sh[2] - SH_C1 * x * sh[3]; + + if (deg > 1) + { + float xx = x * x, yy = y * y, zz = z * z; + float xy = x * y, yz = y * z, xz = x * z; + result = result + + SH_C2[0] * xy * sh[4] + + SH_C2[1] * yz * sh[5] + + SH_C2[2] * (2.0f * zz - xx - yy) * sh[6] + + SH_C2[3] * xz * sh[7] + + SH_C2[4] * (xx - yy) * sh[8]; + + if (deg > 2) + { + result = result + + SH_C3[0] * y * (3.0f * xx - yy) * sh[9] + + SH_C3[1] * xy * z * sh[10] + + SH_C3[2] * y * (4.0f * zz - xx - yy) * sh[11] + + SH_C3[3] * z * (2.0f * zz - 3.0f * xx - 3.0f * yy) * sh[12] + + SH_C3[4] * x * (4.0f * zz - xx - yy) * sh[13] + + SH_C3[5] * z * (xx - yy) * sh[14] + + SH_C3[6] * x * (xx - 3.0f * yy) * sh[15]; + } + } + } + result += 0.5f; + + // RGB colors are clamped to positive values. If values are + // clamped, we need to keep track of this for the backward pass. + clamped[3 * idx + 0] = (result.x < 0); + clamped[3 * idx + 1] = (result.y < 0); + clamped[3 * idx + 2] = (result.z < 0); + return glm::max(result, 0.0f); +} + +// Forward version of 2D covariance matrix computation +__device__ float3 computeCov2D(const float3& mean, float focal_x, float focal_y, float tan_fovx, float tan_fovy, const float* cov3D, const float* viewmatrix) +{ + // The following models the steps outlined by equations 29 + // and 31 in "EWA Splatting" (Zwicker et al., 2002). + // Additionally considers aspect / scaling of viewport. + // Transposes used to account for row-/column-major conventions. + float3 t = transformPoint4x3(mean, viewmatrix); + + const float limx = 1.3f * tan_fovx; + const float limy = 1.3f * tan_fovy; + const float txtz = t.x / t.z; + const float tytz = t.y / t.z; + t.x = min(limx, max(-limx, txtz)) * t.z; + t.y = min(limy, max(-limy, tytz)) * t.z; + + glm::mat3 J = glm::mat3( + focal_x / t.z, 0.0f, -(focal_x * t.x) / (t.z * t.z), + 0.0f, focal_y / t.z, -(focal_y * t.y) / (t.z * t.z), + 0, 0, 0); + + glm::mat3 W = glm::mat3( + viewmatrix[0], viewmatrix[4], viewmatrix[8], + viewmatrix[1], viewmatrix[5], viewmatrix[9], + viewmatrix[2], viewmatrix[6], viewmatrix[10]); + + glm::mat3 T = W * J; + + glm::mat3 Vrk = glm::mat3( + cov3D[0], cov3D[1], cov3D[2], + cov3D[1], cov3D[3], cov3D[4], + cov3D[2], cov3D[4], cov3D[5]); + + glm::mat3 cov = glm::transpose(T) * glm::transpose(Vrk) * T; + + // Apply low-pass filter: every Gaussian should be at least + // one pixel wide/high. Discard 3rd row and column. + cov[0][0] += 0.3f; + cov[1][1] += 0.3f; + return { float(cov[0][0]), float(cov[0][1]), float(cov[1][1]) }; +} + +// Forward method for converting scale and rotation properties of each +// Gaussian to a 3D covariance matrix in world space. Also takes care +// of quaternion normalization. +__device__ void computeCov3D(const glm::vec3 scale, float mod, const glm::vec4 rot, float* cov3D) +{ + // Create scaling matrix + glm::mat3 S = glm::mat3(1.0f); + S[0][0] = mod * scale.x; + S[1][1] = mod * scale.y; + S[2][2] = mod * scale.z; + + // Normalize quaternion to get valid rotation + glm::vec4 q = rot;// / glm::length(rot); + float r = q.x; + float x = q.y; + float y = q.z; + float z = q.w; + + // Compute rotation matrix from quaternion + glm::mat3 R = glm::mat3( + 1.f - 2.f * (y * y + z * z), 2.f * (x * y - r * z), 2.f * (x * z + r * y), + 2.f * (x * y + r * z), 1.f - 2.f * (x * x + z * z), 2.f * (y * z - r * x), + 2.f * (x * z - r * y), 2.f * (y * z + r * x), 1.f - 2.f * (x * x + y * y) + ); + + glm::mat3 M = S * R; + + // Compute 3D world covariance matrix Sigma + glm::mat3 Sigma = glm::transpose(M) * M; + + // Covariance is symmetric, only store upper right + cov3D[0] = Sigma[0][0]; + cov3D[1] = Sigma[0][1]; + cov3D[2] = Sigma[0][2]; + cov3D[3] = Sigma[1][1]; + cov3D[4] = Sigma[1][2]; + cov3D[5] = Sigma[2][2]; +} + +// Perform initial steps for each Gaussian prior to rasterization. +template +__global__ void preprocessCUDA(int P, int D, int M, + const float* orig_points, + const glm::vec3* scales, + const float scale_modifier, + const glm::vec4* rotations, + const float* opacities, + const float* shs, + bool* clamped, + const float* cov3D_precomp, + const float* colors_precomp, + const float* viewmatrix, + const float* projmatrix, + const glm::vec3* cam_pos, + const int W, int H, + const float tan_fovx, float tan_fovy, + const float focal_x, float focal_y, + int* radii, + float2* points_xy_image, + float* depths, + float* cov3Ds, + float* rgb, + float4* conic_opacity, + const dim3 grid, + uint32_t* tiles_touched, + bool prefiltered) +{ + auto idx = cg::this_grid().thread_rank(); + if (idx >= P) + return; + + // Initialize radius and touched tiles to 0. If this isn't changed, + // this Gaussian will not be processed further. + radii[idx] = 0; + tiles_touched[idx] = 0; + + // Perform near culling, quit if outside. + float3 p_view; + if (!in_frustum(idx, orig_points, viewmatrix, projmatrix, prefiltered, p_view)) + return; + + // Transform point by projecting + float3 p_orig = { orig_points[3 * idx], orig_points[3 * idx + 1], orig_points[3 * idx + 2] }; + float4 p_hom = transformPoint4x4(p_orig, projmatrix); + float p_w = 1.0f / (p_hom.w + 0.0000001f); + float3 p_proj = { p_hom.x * p_w, p_hom.y * p_w, p_hom.z * p_w }; + + // If 3D covariance matrix is precomputed, use it, otherwise compute + // from scaling and rotation parameters. + const float* cov3D; + if (cov3D_precomp != nullptr) + { + cov3D = cov3D_precomp + idx * 6; + } + else + { + computeCov3D(scales[idx], scale_modifier, rotations[idx], cov3Ds + idx * 6); + cov3D = cov3Ds + idx * 6; + } + + // Compute 2D screen-space covariance matrix + float3 cov = computeCov2D(p_orig, focal_x, focal_y, tan_fovx, tan_fovy, cov3D, viewmatrix); + + // Invert covariance (EWA algorithm) + float det = (cov.x * cov.z - cov.y * cov.y); + if (det == 0.0f) + return; + float det_inv = 1.f / det; + float3 conic = { cov.z * det_inv, -cov.y * det_inv, cov.x * det_inv }; + + // Compute extent in screen space (by finding eigenvalues of + // 2D covariance matrix). Use extent to compute a bounding rectangle + // of screen-space tiles that this Gaussian overlaps with. Quit if + // rectangle covers 0 tiles. + float mid = 0.5f * (cov.x + cov.z); + float lambda1 = mid + sqrt(max(0.1f, mid * mid - det)); + float lambda2 = mid - sqrt(max(0.1f, mid * mid - det)); + float my_radius = ceil(3.f * sqrt(max(lambda1, lambda2))); + float2 point_image = { ndc2Pix(p_proj.x, W), ndc2Pix(p_proj.y, H) }; + uint2 rect_min, rect_max; + getRect(point_image, my_radius, rect_min, rect_max, grid); + if ((rect_max.x - rect_min.x) * (rect_max.y - rect_min.y) == 0) + return; + + // If colors have been precomputed, use them, otherwise convert + // spherical harmonics coefficients to RGB color. + if (colors_precomp == nullptr) + { + glm::vec3 result = computeColorFromSH(idx, D, M, (glm::vec3*)orig_points, *cam_pos, shs, clamped); + rgb[idx * C + 0] = result.x; + rgb[idx * C + 1] = result.y; + rgb[idx * C + 2] = result.z; + } + + // Store some useful helper data for the next steps. + depths[idx] = p_view.z; + radii[idx] = my_radius; + points_xy_image[idx] = point_image; + // Inverse 2D covariance and opacity neatly pack into one float4 + conic_opacity[idx] = { conic.x, conic.y, conic.z, opacities[idx] }; + tiles_touched[idx] = (rect_max.y - rect_min.y) * (rect_max.x - rect_min.x); +} + +// Main rasterization method. Collaboratively works on one tile per +// block, each thread treats one pixel. Alternates between fetching +// and rasterizing data. +template +__global__ void __launch_bounds__(BLOCK_X * BLOCK_Y) +renderCUDA( + const uint2* __restrict__ ranges, + const uint32_t* __restrict__ point_list, + int W, int H, + const float2* __restrict__ points_xy_image, + const float* __restrict__ features, + const float* __restrict__ depths, + const float4* __restrict__ conic_opacity, + float* __restrict__ out_alpha, + uint32_t* __restrict__ n_contrib, + const float* __restrict__ bg_color, + float* __restrict__ out_color, + float* __restrict__ out_depth) +{ + // Identify current tile and associated min/max pixel range. + auto block = cg::this_thread_block(); + uint32_t horizontal_blocks = (W + BLOCK_X - 1) / BLOCK_X; + uint2 pix_min = { block.group_index().x * BLOCK_X, block.group_index().y * BLOCK_Y }; + uint2 pix_max = { min(pix_min.x + BLOCK_X, W), min(pix_min.y + BLOCK_Y , H) }; + uint2 pix = { pix_min.x + block.thread_index().x, pix_min.y + block.thread_index().y }; + uint32_t pix_id = W * pix.y + pix.x; + float2 pixf = { (float)pix.x, (float)pix.y }; + + // Check if this thread is associated with a valid pixel or outside. + bool inside = pix.x < W&& pix.y < H; + // Done threads can help with fetching, but don't rasterize + bool done = !inside; + + // Load start/end range of IDs to process in bit sorted list. + uint2 range = ranges[block.group_index().y * horizontal_blocks + block.group_index().x]; + const int rounds = ((range.y - range.x + BLOCK_SIZE - 1) / BLOCK_SIZE); + int toDo = range.y - range.x; + + // Allocate storage for batches of collectively fetched data. + __shared__ int collected_id[BLOCK_SIZE]; + __shared__ float2 collected_xy[BLOCK_SIZE]; + __shared__ float4 collected_conic_opacity[BLOCK_SIZE]; + + // Initialize helper variables + float T = 1.0f; + uint32_t contributor = 0; + uint32_t last_contributor = 0; + float C[CHANNELS] = { 0 }; + float weight = 0; + float D = 0; + + // Iterate over batches until all done or range is complete + for (int i = 0; i < rounds; i++, toDo -= BLOCK_SIZE) + { + // End if entire block votes that it is done rasterizing + int num_done = __syncthreads_count(done); + if (num_done == BLOCK_SIZE) + break; + + // Collectively fetch per-Gaussian data from global to shared + int progress = i * BLOCK_SIZE + block.thread_rank(); + if (range.x + progress < range.y) + { + int coll_id = point_list[range.x + progress]; + collected_id[block.thread_rank()] = coll_id; + collected_xy[block.thread_rank()] = points_xy_image[coll_id]; + collected_conic_opacity[block.thread_rank()] = conic_opacity[coll_id]; + } + block.sync(); + + // Iterate over current batch + for (int j = 0; !done && j < min(BLOCK_SIZE, toDo); j++) + { + // Keep track of current position in range + contributor++; + + // Resample using conic matrix (cf. "Surface + // Splatting" by Zwicker et al., 2001) + float2 xy = collected_xy[j]; + float2 d = { xy.x - pixf.x, xy.y - pixf.y }; + float4 con_o = collected_conic_opacity[j]; + float power = -0.5f * (con_o.x * d.x * d.x + con_o.z * d.y * d.y) - con_o.y * d.x * d.y; + if (power > 0.0f) + continue; + + // Eq. (2) from 3D Gaussian splatting paper. + // Obtain alpha by multiplying with Gaussian opacity + // and its exponential falloff from mean. + // Avoid numerical instabilities (see paper appendix). + float alpha = min(0.99f, con_o.w * exp(power)); + if (alpha < 1.0f / 255.0f) + continue; + float test_T = T * (1 - alpha); + if (test_T < 0.0001f) + { + done = true; + continue; + } + + // Eq. (3) from 3D Gaussian splatting paper. + for (int ch = 0; ch < CHANNELS; ch++) + C[ch] += features[collected_id[j] * CHANNELS + ch] * alpha * T; + weight += alpha * T; + D += depths[collected_id[j]] * alpha * T; + + T = test_T; + + // Keep track of last range entry to update this + // pixel. + last_contributor = contributor; + } + } + + // All threads that treat valid pixel write out their final + // rendering data to the frame and auxiliary buffers. + if (inside) + { + n_contrib[pix_id] = last_contributor; + for (int ch = 0; ch < CHANNELS; ch++) + out_color[ch * H * W + pix_id] = C[ch] + T * bg_color[ch]; + out_alpha[pix_id] = weight; //1 - T; + out_depth[pix_id] = D; + } +} + +void FORWARD::render( + const dim3 grid, dim3 block, + const uint2* ranges, + const uint32_t* point_list, + int W, int H, + const float2* means2D, + const float* colors, + const float* depths, + const float4* conic_opacity, + float* out_alpha, + uint32_t* n_contrib, + const float* bg_color, + float* out_color, + float* out_depth) +{ + renderCUDA << > > ( + ranges, + point_list, + W, H, + means2D, + colors, + depths, + conic_opacity, + out_alpha, + n_contrib, + bg_color, + out_color, + out_depth); +} + +void FORWARD::preprocess(int P, int D, int M, + const float* means3D, + const glm::vec3* scales, + const float scale_modifier, + const glm::vec4* rotations, + const float* opacities, + const float* shs, + bool* clamped, + const float* cov3D_precomp, + const float* colors_precomp, + const float* viewmatrix, + const float* projmatrix, + const glm::vec3* cam_pos, + const int W, int H, + const float focal_x, float focal_y, + const float tan_fovx, float tan_fovy, + int* radii, + float2* means2D, + float* depths, + float* cov3Ds, + float* rgb, + float4* conic_opacity, + const dim3 grid, + uint32_t* tiles_touched, + bool prefiltered) +{ + preprocessCUDA << <(P + 255) / 256, 256 >> > ( + P, D, M, + means3D, + scales, + scale_modifier, + rotations, + opacities, + shs, + clamped, + cov3D_precomp, + colors_precomp, + viewmatrix, + projmatrix, + cam_pos, + W, H, + tan_fovx, tan_fovy, + focal_x, focal_y, + radii, + means2D, + depths, + cov3Ds, + rgb, + conic_opacity, + grid, + tiles_touched, + prefiltered + ); +} \ No newline at end of file diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/cuda_rasterizer/forward.h b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/cuda_rasterizer/forward.h new file mode 100644 index 0000000000000000000000000000000000000000..71955f95d16fb32a3f7a70512be7ed269f06d0d4 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/cuda_rasterizer/forward.h @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2023, Inria + * GRAPHDECO research group, https://team.inria.fr/graphdeco + * All rights reserved. + * + * This software is free for non-commercial, research and evaluation use + * under the terms of the LICENSE.md file. + * + * For inquiries contact george.drettakis@inria.fr + */ + +#ifndef CUDA_RASTERIZER_FORWARD_H_INCLUDED +#define CUDA_RASTERIZER_FORWARD_H_INCLUDED + +#include +#include "cuda_runtime.h" +#include "device_launch_parameters.h" +#define GLM_FORCE_CUDA +#include + +namespace FORWARD +{ + // Perform initial steps for each Gaussian prior to rasterization. + void preprocess(int P, int D, int M, + const float* orig_points, + const glm::vec3* scales, + const float scale_modifier, + const glm::vec4* rotations, + const float* opacities, + const float* shs, + bool* clamped, + const float* cov3D_precomp, + const float* colors_precomp, + const float* viewmatrix, + const float* projmatrix, + const glm::vec3* cam_pos, + const int W, int H, + const float focal_x, float focal_y, + const float tan_fovx, float tan_fovy, + int* radii, + float2* points_xy_image, + float* depths, + float* cov3Ds, + float* colors, + float4* conic_opacity, + const dim3 grid, + uint32_t* tiles_touched, + bool prefiltered); + + // Main rasterization method. + void render( + const dim3 grid, dim3 block, + const uint2* ranges, + const uint32_t* point_list, + int W, int H, + const float2* points_xy_image, + const float* features, + const float* depths, + const float4* conic_opacity, + float* out_alpha, + uint32_t* n_contrib, + const float* bg_color, + float* out_color, + float* out_depth); +} + + +#endif \ No newline at end of file diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/cuda_rasterizer/rasterizer.h b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/cuda_rasterizer/rasterizer.h new file mode 100644 index 0000000000000000000000000000000000000000..3458eb4520b5990e4b5bdc2f4de42ecde45dbe9f --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/cuda_rasterizer/rasterizer.h @@ -0,0 +1,94 @@ +/* + * Copyright (C) 2023, Inria + * GRAPHDECO research group, https://team.inria.fr/graphdeco + * All rights reserved. + * + * This software is free for non-commercial, research and evaluation use + * under the terms of the LICENSE.md file. + * + * For inquiries contact george.drettakis@inria.fr + */ + +#ifndef CUDA_RASTERIZER_H_INCLUDED +#define CUDA_RASTERIZER_H_INCLUDED + +#include +#include + +namespace CudaRasterizer +{ + class Rasterizer + { + public: + + static void markVisible( + int P, + float* means3D, + float* viewmatrix, + float* projmatrix, + bool* present); + + static int forward( + std::function geometryBuffer, + std::function binningBuffer, + std::function imageBuffer, + const int P, int D, int M, + const float* background, + const int width, int height, + const float* means3D, + const float* shs, + const float* colors_precomp, + const float* opacities, + const float* scales, + const float scale_modifier, + const float* rotations, + const float* cov3D_precomp, + const float* viewmatrix, + const float* projmatrix, + const float* cam_pos, + const float tan_fovx, float tan_fovy, + const bool prefiltered, + float* out_color, + float* out_depth, + float* out_alpha, + int* radii = nullptr, + bool debug = false); + + static void backward( + const int P, int D, int M, int R, + const float* background, + const int width, int height, + const float* means3D, + const float* shs, + const float* colors_precomp, + const float* alphas, + const float* scales, + const float scale_modifier, + const float* rotations, + const float* cov3D_precomp, + const float* viewmatrix, + const float* projmatrix, + const float* campos, + const float tan_fovx, float tan_fovy, + const int* radii, + char* geom_buffer, + char* binning_buffer, + char* image_buffer, + const float* dL_dpix, + const float* dL_dpix_depth, + const float* dL_dalphas, + float* dL_dmean2D, + float* dL_dconic, + float* dL_dopacity, + float* dL_dcolor, + float* dL_ddepth, + float* dL_dmean3D, + float* dL_dcov3D, + float* dL_dsh, + float* dL_dscale, + float* dL_drot, + bool debug); + }; +}; + +#endif \ No newline at end of file diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/cuda_rasterizer/rasterizer_impl.cu b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/cuda_rasterizer/rasterizer_impl.cu new file mode 100644 index 0000000000000000000000000000000000000000..13d30b896639d28c5ebe1ec9f9c87dca97226eae --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/cuda_rasterizer/rasterizer_impl.cu @@ -0,0 +1,447 @@ +/* + * Copyright (C) 2023, Inria + * GRAPHDECO research group, https://team.inria.fr/graphdeco + * All rights reserved. + * + * This software is free for non-commercial, research and evaluation use + * under the terms of the LICENSE.md file. + * + * For inquiries contact george.drettakis@inria.fr + */ + +#include "rasterizer_impl.h" +#include +#include +#include +#include +#include +#include "cuda_runtime.h" +#include "device_launch_parameters.h" +#include +#include +#define GLM_FORCE_CUDA +#include + +#include +#include +namespace cg = cooperative_groups; + +#include "auxiliary.h" +#include "forward.h" +#include "backward.h" + +// Helper function to find the next-highest bit of the MSB +// on the CPU. +uint32_t getHigherMsb(uint32_t n) +{ + uint32_t msb = sizeof(n) * 4; + uint32_t step = msb; + while (step > 1) + { + step /= 2; + if (n >> msb) + msb += step; + else + msb -= step; + } + if (n >> msb) + msb++; + return msb; +} + +// Wrapper method to call auxiliary coarse frustum containment test. +// Mark all Gaussians that pass it. +__global__ void checkFrustum(int P, + const float* orig_points, + const float* viewmatrix, + const float* projmatrix, + bool* present) +{ + auto idx = cg::this_grid().thread_rank(); + if (idx >= P) + return; + + float3 p_view; + present[idx] = in_frustum(idx, orig_points, viewmatrix, projmatrix, false, p_view); +} + +// Generates one key/value pair for all Gaussian / tile overlaps. +// Run once per Gaussian (1:N mapping). +__global__ void duplicateWithKeys( + int P, + const float2* points_xy, + const float* depths, + const uint32_t* offsets, + uint64_t* gaussian_keys_unsorted, + uint32_t* gaussian_values_unsorted, + int* radii, + dim3 grid) +{ + auto idx = cg::this_grid().thread_rank(); + if (idx >= P) + return; + + // Generate no key/value pair for invisible Gaussians + if (radii[idx] > 0) + { + // Find this Gaussian's offset in buffer for writing keys/values. + uint32_t off = (idx == 0) ? 0 : offsets[idx - 1]; + uint2 rect_min, rect_max; + + getRect(points_xy[idx], radii[idx], rect_min, rect_max, grid); + + // For each tile that the bounding rect overlaps, emit a + // key/value pair. The key is | tile ID | depth |, + // and the value is the ID of the Gaussian. Sorting the values + // with this key yields Gaussian IDs in a list, such that they + // are first sorted by tile and then by depth. + for (int y = rect_min.y; y < rect_max.y; y++) + { + for (int x = rect_min.x; x < rect_max.x; x++) + { + uint64_t key = y * grid.x + x; + key <<= 32; + key |= *((uint32_t*)&depths[idx]); + gaussian_keys_unsorted[off] = key; + gaussian_values_unsorted[off] = idx; + off++; + } + } + } +} + +// Check keys to see if it is at the start/end of one tile's range in +// the full sorted list. If yes, write start/end of this tile. +// Run once per instanced (duplicated) Gaussian ID. +__global__ void identifyTileRanges(int L, uint64_t* point_list_keys, uint2* ranges) +{ + auto idx = cg::this_grid().thread_rank(); + if (idx >= L) + return; + + // Read tile ID from key. Update start/end of tile range if at limit. + uint64_t key = point_list_keys[idx]; + uint32_t currtile = key >> 32; + if (idx == 0) + ranges[currtile].x = 0; + else + { + uint32_t prevtile = point_list_keys[idx - 1] >> 32; + if (currtile != prevtile) + { + ranges[prevtile].y = idx; + ranges[currtile].x = idx; + } + } + if (idx == L - 1) + ranges[currtile].y = L; +} + +// Mark Gaussians as visible/invisible, based on view frustum testing +void CudaRasterizer::Rasterizer::markVisible( + int P, + float* means3D, + float* viewmatrix, + float* projmatrix, + bool* present) +{ + checkFrustum << <(P + 255) / 256, 256 >> > ( + P, + means3D, + viewmatrix, projmatrix, + present); +} + +CudaRasterizer::GeometryState CudaRasterizer::GeometryState::fromChunk(char*& chunk, size_t P) +{ + GeometryState geom; + obtain(chunk, geom.depths, P, 128); + obtain(chunk, geom.clamped, P * 3, 128); + obtain(chunk, geom.internal_radii, P, 128); + obtain(chunk, geom.means2D, P, 128); + obtain(chunk, geom.cov3D, P * 6, 128); + obtain(chunk, geom.conic_opacity, P, 128); + obtain(chunk, geom.rgb, P * 3, 128); + obtain(chunk, geom.tiles_touched, P, 128); + cub::DeviceScan::InclusiveSum(nullptr, geom.scan_size, geom.tiles_touched, geom.tiles_touched, P); + obtain(chunk, geom.scanning_space, geom.scan_size, 128); + obtain(chunk, geom.point_offsets, P, 128); + return geom; +} + +CudaRasterizer::ImageState CudaRasterizer::ImageState::fromChunk(char*& chunk, size_t N) +{ + ImageState img; + obtain(chunk, img.n_contrib, N, 128); + obtain(chunk, img.ranges, N, 128); + return img; +} + +CudaRasterizer::BinningState CudaRasterizer::BinningState::fromChunk(char*& chunk, size_t P) +{ + BinningState binning; + obtain(chunk, binning.point_list, P, 128); + obtain(chunk, binning.point_list_unsorted, P, 128); + obtain(chunk, binning.point_list_keys, P, 128); + obtain(chunk, binning.point_list_keys_unsorted, P, 128); + cub::DeviceRadixSort::SortPairs( + nullptr, binning.sorting_size, + binning.point_list_keys_unsorted, binning.point_list_keys, + binning.point_list_unsorted, binning.point_list, P); + obtain(chunk, binning.list_sorting_space, binning.sorting_size, 128); + return binning; +} + +// Forward rendering procedure for differentiable rasterization +// of Gaussians. +int CudaRasterizer::Rasterizer::forward( + std::function geometryBuffer, + std::function binningBuffer, + std::function imageBuffer, + const int P, int D, int M, + const float* background, + const int width, int height, + const float* means3D, + const float* shs, + const float* colors_precomp, + const float* opacities, + const float* scales, + const float scale_modifier, + const float* rotations, + const float* cov3D_precomp, + const float* viewmatrix, + const float* projmatrix, + const float* cam_pos, + const float tan_fovx, float tan_fovy, + const bool prefiltered, + float* out_color, + float* out_depth, + float* out_alpha, + int* radii, + bool debug) +{ + const float focal_y = height / (2.0f * tan_fovy); + const float focal_x = width / (2.0f * tan_fovx); + + size_t chunk_size = required(P); + char* chunkptr = geometryBuffer(chunk_size); + GeometryState geomState = GeometryState::fromChunk(chunkptr, P); + + if (radii == nullptr) + { + radii = geomState.internal_radii; + } + + dim3 tile_grid((width + BLOCK_X - 1) / BLOCK_X, (height + BLOCK_Y - 1) / BLOCK_Y, 1); + dim3 block(BLOCK_X, BLOCK_Y, 1); + + // Dynamically resize image-based auxiliary buffers during training + size_t img_chunk_size = required(width * height); + char* img_chunkptr = imageBuffer(img_chunk_size); + ImageState imgState = ImageState::fromChunk(img_chunkptr, width * height); + + if (NUM_CHANNELS != 3 && colors_precomp == nullptr) + { + throw std::runtime_error("For non-RGB, provide precomputed Gaussian colors!"); + } + + // Run preprocessing per-Gaussian (transformation, bounding, conversion of SHs to RGB) + CHECK_CUDA(FORWARD::preprocess( + P, D, M, + means3D, + (glm::vec3*)scales, + scale_modifier, + (glm::vec4*)rotations, + opacities, + shs, + geomState.clamped, + cov3D_precomp, + colors_precomp, + viewmatrix, projmatrix, + (glm::vec3*)cam_pos, + width, height, + focal_x, focal_y, + tan_fovx, tan_fovy, + radii, + geomState.means2D, + geomState.depths, + geomState.cov3D, + geomState.rgb, + geomState.conic_opacity, + tile_grid, + geomState.tiles_touched, + prefiltered + ), debug) + + // Compute prefix sum over full list of touched tile counts by Gaussians + // E.g., [2, 3, 0, 2, 1] -> [2, 5, 5, 7, 8] + CHECK_CUDA(cub::DeviceScan::InclusiveSum(geomState.scanning_space, geomState.scan_size, geomState.tiles_touched, geomState.point_offsets, P), debug) + + // Retrieve total number of Gaussian instances to launch and resize aux buffers + int num_rendered; + CHECK_CUDA(cudaMemcpy(&num_rendered, geomState.point_offsets + P - 1, sizeof(int), cudaMemcpyDeviceToHost), debug); + + size_t binning_chunk_size = required(num_rendered); + char* binning_chunkptr = binningBuffer(binning_chunk_size); + BinningState binningState = BinningState::fromChunk(binning_chunkptr, num_rendered); + + // For each instance to be rendered, produce adequate [ tile | depth ] key + // and corresponding dublicated Gaussian indices to be sorted + duplicateWithKeys << <(P + 255) / 256, 256 >> > ( + P, + geomState.means2D, + geomState.depths, + geomState.point_offsets, + binningState.point_list_keys_unsorted, + binningState.point_list_unsorted, + radii, + tile_grid) + CHECK_CUDA(, debug) + + int bit = getHigherMsb(tile_grid.x * tile_grid.y); + + // Sort complete list of (duplicated) Gaussian indices by keys + CHECK_CUDA(cub::DeviceRadixSort::SortPairs( + binningState.list_sorting_space, + binningState.sorting_size, + binningState.point_list_keys_unsorted, binningState.point_list_keys, + binningState.point_list_unsorted, binningState.point_list, + num_rendered, 0, 32 + bit), debug) + + CHECK_CUDA(cudaMemset(imgState.ranges, 0, tile_grid.x * tile_grid.y * sizeof(uint2)), debug); + + // Identify start and end of per-tile workloads in sorted list + if (num_rendered > 0) + identifyTileRanges << <(num_rendered + 255) / 256, 256 >> > ( + num_rendered, + binningState.point_list_keys, + imgState.ranges); + CHECK_CUDA(, debug); + + // Let each tile blend its range of Gaussians independently in parallel + const float* feature_ptr = colors_precomp != nullptr ? colors_precomp : geomState.rgb; + CHECK_CUDA(FORWARD::render( + tile_grid, block, + imgState.ranges, + binningState.point_list, + width, height, + geomState.means2D, + feature_ptr, + geomState.depths, + geomState.conic_opacity, + out_alpha, + imgState.n_contrib, + background, + out_color, + out_depth), debug); + + return num_rendered; +} + +// Produce necessary gradients for optimization, corresponding +// to forward render pass +void CudaRasterizer::Rasterizer::backward( + const int P, int D, int M, int R, + const float* background, + const int width, int height, + const float* means3D, + const float* shs, + const float* colors_precomp, + const float* alphas, + const float* scales, + const float scale_modifier, + const float* rotations, + const float* cov3D_precomp, + const float* viewmatrix, + const float* projmatrix, + const float* campos, + const float tan_fovx, float tan_fovy, + const int* radii, + char* geom_buffer, + char* binning_buffer, + char* img_buffer, + const float* dL_dpix, + const float* dL_dpix_depth, + const float* dL_dalphas, + float* dL_dmean2D, + float* dL_dconic, + float* dL_dopacity, + float* dL_dcolor, + float* dL_ddepth, + float* dL_dmean3D, + float* dL_dcov3D, + float* dL_dsh, + float* dL_dscale, + float* dL_drot, + bool debug) +{ + GeometryState geomState = GeometryState::fromChunk(geom_buffer, P); + BinningState binningState = BinningState::fromChunk(binning_buffer, R); + ImageState imgState = ImageState::fromChunk(img_buffer, width * height); + + if (radii == nullptr) + { + radii = geomState.internal_radii; + } + + const float focal_y = height / (2.0f * tan_fovy); + const float focal_x = width / (2.0f * tan_fovx); + + const dim3 tile_grid((width + BLOCK_X - 1) / BLOCK_X, (height + BLOCK_Y - 1) / BLOCK_Y, 1); + const dim3 block(BLOCK_X, BLOCK_Y, 1); + + // Compute loss gradients w.r.t. 2D mean position, conic matrix, + // opacity and RGB of Gaussians from per-pixel loss gradients. + // If we were given precomputed colors and not SHs, use them. + const float* color_ptr = (colors_precomp != nullptr) ? colors_precomp : geomState.rgb; + const float* depth_ptr = geomState.depths; + CHECK_CUDA(BACKWARD::render( + tile_grid, + block, + imgState.ranges, + binningState.point_list, + width, height, + background, + geomState.means2D, + geomState.conic_opacity, + color_ptr, + depth_ptr, + alphas, + imgState.n_contrib, + dL_dpix, + dL_dpix_depth, + dL_dalphas, + (float3*)dL_dmean2D, + (float4*)dL_dconic, + dL_dopacity, + dL_dcolor, + dL_ddepth), debug) + + // Take care of the rest of preprocessing. Was the precomputed covariance + // given to us or a scales/rot pair? If precomputed, pass that. If not, + // use the one we computed ourselves. + const float* cov3D_ptr = (cov3D_precomp != nullptr) ? cov3D_precomp : geomState.cov3D; + CHECK_CUDA(BACKWARD::preprocess(P, D, M, + (float3*)means3D, + radii, + shs, + geomState.clamped, + (glm::vec3*)scales, + (glm::vec4*)rotations, + scale_modifier, + cov3D_ptr, + viewmatrix, + projmatrix, + focal_x, focal_y, + tan_fovx, tan_fovy, + (glm::vec3*)campos, + (float3*)dL_dmean2D, + dL_dconic, + (glm::vec3*)dL_dmean3D, + dL_dcolor, + dL_ddepth, + dL_dcov3D, + dL_dsh, + (glm::vec3*)dL_dscale, + (glm::vec4*)dL_drot), debug) +} \ No newline at end of file diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/cuda_rasterizer/rasterizer_impl.h b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/cuda_rasterizer/rasterizer_impl.h new file mode 100644 index 0000000000000000000000000000000000000000..13dd5ec3d256dba0e6ea0d9ee9468bda21ed0632 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/cuda_rasterizer/rasterizer_impl.h @@ -0,0 +1,73 @@ +/* + * Copyright (C) 2023, Inria + * GRAPHDECO research group, https://team.inria.fr/graphdeco + * All rights reserved. + * + * This software is free for non-commercial, research and evaluation use + * under the terms of the LICENSE.md file. + * + * For inquiries contact george.drettakis@inria.fr + */ + +#pragma once + +#include +#include +#include "rasterizer.h" +#include + +namespace CudaRasterizer +{ + template + static void obtain(char*& chunk, T*& ptr, std::size_t count, std::size_t alignment) + { + std::size_t offset = (reinterpret_cast(chunk) + alignment - 1) & ~(alignment - 1); + ptr = reinterpret_cast(offset); + chunk = reinterpret_cast(ptr + count); + } + + struct GeometryState + { + size_t scan_size; + float* depths; + char* scanning_space; + bool* clamped; + int* internal_radii; + float2* means2D; + float* cov3D; + float4* conic_opacity; + float* rgb; + uint32_t* point_offsets; + uint32_t* tiles_touched; + + static GeometryState fromChunk(char*& chunk, size_t P); + }; + + struct ImageState + { + uint2* ranges; + uint32_t* n_contrib; + + static ImageState fromChunk(char*& chunk, size_t N); + }; + + struct BinningState + { + size_t sorting_size; + uint64_t* point_list_keys_unsorted; + uint64_t* point_list_keys; + uint32_t* point_list_unsorted; + uint32_t* point_list; + char* list_sorting_space; + + static BinningState fromChunk(char*& chunk, size_t P); + }; + + template + size_t required(size_t P) + { + char* size = nullptr; + T::fromChunk(size, P); + return ((size_t)size) + 128; + } +}; \ No newline at end of file diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/diff_gaussian_rasterization_depth_alpha/__init__.py b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/diff_gaussian_rasterization_depth_alpha/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..c10d152357429e1b30e2b38d0f8e3ca0f3906839 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/diff_gaussian_rasterization_depth_alpha/__init__.py @@ -0,0 +1,224 @@ +# +# Copyright (C) 2023, Inria +# GRAPHDECO research group, https://team.inria.fr/graphdeco +# All rights reserved. +# +# This software is free for non-commercial, research and evaluation use +# under the terms of the LICENSE.md file. +# +# For inquiries contact george.drettakis@inria.fr +# + +from typing import NamedTuple +import torch.nn as nn +import torch +from . import _C + +def cpu_deep_copy_tuple(input_tuple): + copied_tensors = [item.cpu().clone() if isinstance(item, torch.Tensor) else item for item in input_tuple] + return tuple(copied_tensors) + +def rasterize_gaussians( + means3D, + means2D, + sh, + colors_precomp, + opacities, + scales, + rotations, + cov3Ds_precomp, + raster_settings, +): + return _RasterizeGaussians.apply( + means3D, + means2D, + sh, + colors_precomp, + opacities, + scales, + rotations, + cov3Ds_precomp, + raster_settings, + ) + +class _RasterizeGaussians(torch.autograd.Function): + @staticmethod + def forward( + ctx, + means3D, + means2D, + sh, + colors_precomp, + opacities, + scales, + rotations, + cov3Ds_precomp, + raster_settings, + ): + + # Restructure arguments the way that the C++ lib expects them + args = ( + raster_settings.bg, + means3D, + colors_precomp, + opacities, + scales, + rotations, + raster_settings.scale_modifier, + cov3Ds_precomp, + raster_settings.viewmatrix, + raster_settings.projmatrix, + raster_settings.tanfovx, + raster_settings.tanfovy, + raster_settings.image_height, + raster_settings.image_width, + sh, + raster_settings.sh_degree, + raster_settings.campos, + raster_settings.prefiltered, + raster_settings.debug + ) + + # Invoke C++/CUDA rasterizer + if raster_settings.debug: + cpu_args = cpu_deep_copy_tuple(args) # Copy them before they can be corrupted + try: + num_rendered, color, depth, alpha, radii, geomBuffer, binningBuffer, imgBuffer = _C.rasterize_gaussians(*args) + except Exception as ex: + torch.save(cpu_args, "snapshot_fw.dump") + print("\nAn error occured in forward. Please forward snapshot_fw.dump for debugging.") + raise ex + else: + num_rendered, color, depth, alpha, radii, geomBuffer, binningBuffer, imgBuffer = _C.rasterize_gaussians(*args) + + # Keep relevant tensors for backward + ctx.raster_settings = raster_settings + ctx.num_rendered = num_rendered + ctx.save_for_backward(colors_precomp, means3D, scales, rotations, cov3Ds_precomp, radii, sh, geomBuffer, binningBuffer, imgBuffer, alpha) + return color, radii, depth, alpha + + @staticmethod + def backward(ctx, grad_color, grad_radii, grad_depth, grad_alpha): + + # Restore necessary values from context + num_rendered = ctx.num_rendered + raster_settings = ctx.raster_settings + colors_precomp, means3D, scales, rotations, cov3Ds_precomp, radii, sh, geomBuffer, binningBuffer, imgBuffer, alpha = ctx.saved_tensors + + # Restructure args as C++ method expects them + args = (raster_settings.bg, + means3D, + radii, + colors_precomp, + scales, + rotations, + raster_settings.scale_modifier, + cov3Ds_precomp, + raster_settings.viewmatrix, + raster_settings.projmatrix, + raster_settings.tanfovx, + raster_settings.tanfovy, + grad_color, + grad_depth, + grad_alpha, + sh, + raster_settings.sh_degree, + raster_settings.campos, + geomBuffer, + num_rendered, + binningBuffer, + imgBuffer, + alpha, + raster_settings.debug) + + # Compute gradients for relevant tensors by invoking backward method + if raster_settings.debug: + cpu_args = cpu_deep_copy_tuple(args) # Copy them before they can be corrupted + try: + grad_means2D, grad_colors_precomp, grad_opacities, grad_means3D, grad_cov3Ds_precomp, grad_sh, grad_scales, grad_rotations = _C.rasterize_gaussians_backward(*args) + except Exception as ex: + torch.save(cpu_args, "snapshot_bw.dump") + print("\nAn error occured in backward. Writing snapshot_bw.dump for debugging.\n") + raise ex + else: + grad_means2D, grad_colors_precomp, grad_opacities, grad_means3D, grad_cov3Ds_precomp, grad_sh, grad_scales, grad_rotations = _C.rasterize_gaussians_backward(*args) + + grads = ( + grad_means3D, + grad_means2D, + grad_sh, + grad_colors_precomp, + grad_opacities, + grad_scales, + grad_rotations, + grad_cov3Ds_precomp, + None, + ) + + return grads + +class GaussianRasterizationSettings(NamedTuple): + image_height: int + image_width: int + tanfovx : float + tanfovy : float + bg : torch.Tensor + scale_modifier : float + viewmatrix : torch.Tensor + projmatrix : torch.Tensor + sh_degree : int + campos : torch.Tensor + prefiltered : bool + debug : bool + +class GaussianRasterizer(nn.Module): + def __init__(self, raster_settings): + super().__init__() + self.raster_settings = raster_settings + + def markVisible(self, positions): + # Mark visible points (based on frustum culling for camera) with a boolean + with torch.no_grad(): + raster_settings = self.raster_settings + visible = _C.mark_visible( + positions, + raster_settings.viewmatrix, + raster_settings.projmatrix) + + return visible + + def forward(self, means3D, means2D, opacities, shs = None, colors_precomp = None, scales = None, rotations = None, cov3D_precomp = None): + + raster_settings = self.raster_settings + + if (shs is None and colors_precomp is None) or (shs is not None and colors_precomp is not None): + raise Exception('Please provide excatly one of either SHs or precomputed colors!') + + if ((scales is None or rotations is None) and cov3D_precomp is None) or ((scales is not None or rotations is not None) and cov3D_precomp is not None): + raise Exception('Please provide exactly one of either scale/rotation pair or precomputed 3D covariance!') + + if shs is None: + shs = torch.Tensor([]) + if colors_precomp is None: + colors_precomp = torch.Tensor([]) + + if scales is None: + scales = torch.Tensor([]) + if rotations is None: + rotations = torch.Tensor([]) + if cov3D_precomp is None: + cov3D_precomp = torch.Tensor([]) + + # Invoke C++/CUDA rasterization routine + return rasterize_gaussians( + means3D, + means2D, + shs, + colors_precomp, + opacities, + scales, + rotations, + cov3D_precomp, + raster_settings, + ) + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/ext.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/ext.cpp new file mode 100644 index 0000000000000000000000000000000000000000..fea1ee17ca01d8625f5eaab844658bc4a8eebd7f --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/ext.cpp @@ -0,0 +1,19 @@ +/* + * Copyright (C) 2023, Inria + * GRAPHDECO research group, https://team.inria.fr/graphdeco + * All rights reserved. + * + * This software is free for non-commercial, research and evaluation use + * under the terms of the LICENSE.md file. + * + * For inquiries contact george.drettakis@inria.fr + */ + +#include +#include "rasterize_points.h" + +PYBIND11_MODULE(TORCH_EXTENSION_NAME, m) { + m.def("rasterize_gaussians", &RasterizeGaussiansCUDA); + m.def("rasterize_gaussians_backward", &RasterizeGaussiansBackwardCUDA); + m.def("mark_visible", &markVisible); +} \ No newline at end of file diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/rasterize_points.cu b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/rasterize_points.cu new file mode 100644 index 0000000000000000000000000000000000000000..474647862336c9a9434356e8819584cc4a73de2d --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/rasterize_points.cu @@ -0,0 +1,229 @@ +/* + * Copyright (C) 2023, Inria + * GRAPHDECO research group, https://team.inria.fr/graphdeco + * All rights reserved. + * + * This software is free for non-commercial, research and evaluation use + * under the terms of the LICENSE.md file. + * + * For inquiries contact george.drettakis@inria.fr + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "cuda_rasterizer/config.h" +#include "cuda_rasterizer/rasterizer.h" +#include +#include +#include + +std::function resizeFunctional(torch::Tensor& t) { + auto lambda = [&t](size_t N) { + t.resize_({(long long)N}); + return reinterpret_cast(t.contiguous().data_ptr()); + }; + return lambda; +} + +std::tuple +RasterizeGaussiansCUDA( + const torch::Tensor& background, + const torch::Tensor& means3D, + const torch::Tensor& colors, + const torch::Tensor& opacity, + const torch::Tensor& scales, + const torch::Tensor& rotations, + const float scale_modifier, + const torch::Tensor& cov3D_precomp, + const torch::Tensor& viewmatrix, + const torch::Tensor& projmatrix, + const float tan_fovx, + const float tan_fovy, + const int image_height, + const int image_width, + const torch::Tensor& sh, + const int degree, + const torch::Tensor& campos, + const bool prefiltered, + const bool debug) +{ + if (means3D.ndimension() != 2 || means3D.size(1) != 3) { + AT_ERROR("means3D must have dimensions (num_points, 3)"); + } + + const int P = means3D.size(0); + const int H = image_height; + const int W = image_width; + + auto int_opts = means3D.options().dtype(torch::kInt32); + auto float_opts = means3D.options().dtype(torch::kFloat32); + + torch::Tensor out_color = torch::full({NUM_CHANNELS, H, W}, 0.0, float_opts); + torch::Tensor out_depth = torch::full({1, H, W}, 0.0, float_opts); + torch::Tensor out_alpha = torch::full({1, H, W}, 0.0, float_opts); + torch::Tensor radii = torch::full({P}, 0, means3D.options().dtype(torch::kInt32)); + + torch::Device device(torch::kCUDA); + torch::TensorOptions options(torch::kByte); + torch::Tensor geomBuffer = torch::empty({0}, options.device(device)); + torch::Tensor binningBuffer = torch::empty({0}, options.device(device)); + torch::Tensor imgBuffer = torch::empty({0}, options.device(device)); + std::function geomFunc = resizeFunctional(geomBuffer); + std::function binningFunc = resizeFunctional(binningBuffer); + std::function imgFunc = resizeFunctional(imgBuffer); + + int rendered = 0; + if(P != 0) + { + int M = 0; + if(sh.size(0) != 0) + { + M = sh.size(1); + } + + rendered = CudaRasterizer::Rasterizer::forward( + geomFunc, + binningFunc, + imgFunc, + P, degree, M, + background.contiguous().data(), + W, H, + means3D.contiguous().data(), + sh.contiguous().data_ptr(), + colors.contiguous().data(), + opacity.contiguous().data(), + scales.contiguous().data_ptr(), + scale_modifier, + rotations.contiguous().data_ptr(), + cov3D_precomp.contiguous().data(), + viewmatrix.contiguous().data(), + projmatrix.contiguous().data(), + campos.contiguous().data(), + tan_fovx, + tan_fovy, + prefiltered, + out_color.contiguous().data(), + out_depth.contiguous().data(), + out_alpha.contiguous().data(), + radii.contiguous().data(), + debug); + } + return std::make_tuple(rendered, out_color, out_depth, out_alpha, radii, geomBuffer, binningBuffer, imgBuffer); +} + +std::tuple + RasterizeGaussiansBackwardCUDA( + const torch::Tensor& background, + const torch::Tensor& means3D, + const torch::Tensor& radii, + const torch::Tensor& colors, + const torch::Tensor& scales, + const torch::Tensor& rotations, + const float scale_modifier, + const torch::Tensor& cov3D_precomp, + const torch::Tensor& viewmatrix, + const torch::Tensor& projmatrix, + const float tan_fovx, + const float tan_fovy, + const torch::Tensor& dL_dout_color, + const torch::Tensor& dL_dout_depth, + const torch::Tensor& dL_dout_alpha, + const torch::Tensor& sh, + const int degree, + const torch::Tensor& campos, + const torch::Tensor& geomBuffer, + const int R, + const torch::Tensor& binningBuffer, + const torch::Tensor& imageBuffer, + const torch::Tensor& alphas, + const bool debug) +{ + const int P = means3D.size(0); + const int H = dL_dout_color.size(1); + const int W = dL_dout_color.size(2); + + int M = 0; + if(sh.size(0) != 0) + { + M = sh.size(1); + } + + torch::Tensor dL_dmeans3D = torch::zeros({P, 3}, means3D.options()); + torch::Tensor dL_dmeans2D = torch::zeros({P, 3}, means3D.options()); + torch::Tensor dL_dcolors = torch::zeros({P, NUM_CHANNELS}, means3D.options()); + torch::Tensor dL_ddepths = torch::zeros({P, 1}, means3D.options()); + torch::Tensor dL_dconic = torch::zeros({P, 2, 2}, means3D.options()); + torch::Tensor dL_dopacity = torch::zeros({P, 1}, means3D.options()); + torch::Tensor dL_dcov3D = torch::zeros({P, 6}, means3D.options()); + torch::Tensor dL_dsh = torch::zeros({P, M, 3}, means3D.options()); + torch::Tensor dL_dscales = torch::zeros({P, 3}, means3D.options()); + torch::Tensor dL_drotations = torch::zeros({P, 4}, means3D.options()); + + if(P != 0) + { + CudaRasterizer::Rasterizer::backward(P, degree, M, R, + background.contiguous().data(), + W, H, + means3D.contiguous().data(), + sh.contiguous().data(), + colors.contiguous().data(), + alphas.contiguous().data(), + scales.data_ptr(), + scale_modifier, + rotations.data_ptr(), + cov3D_precomp.contiguous().data(), + viewmatrix.contiguous().data(), + projmatrix.contiguous().data(), + campos.contiguous().data(), + tan_fovx, + tan_fovy, + radii.contiguous().data(), + reinterpret_cast(geomBuffer.contiguous().data_ptr()), + reinterpret_cast(binningBuffer.contiguous().data_ptr()), + reinterpret_cast(imageBuffer.contiguous().data_ptr()), + dL_dout_color.contiguous().data(), + dL_dout_depth.contiguous().data(), + dL_dout_alpha.contiguous().data(), + dL_dmeans2D.contiguous().data(), + dL_dconic.contiguous().data(), + dL_dopacity.contiguous().data(), + dL_dcolors.contiguous().data(), + dL_ddepths.contiguous().data(), + dL_dmeans3D.contiguous().data(), + dL_dcov3D.contiguous().data(), + dL_dsh.contiguous().data(), + dL_dscales.contiguous().data(), + dL_drotations.contiguous().data(), + debug); + } + + return std::make_tuple(dL_dmeans2D, dL_dcolors, dL_dopacity, dL_dmeans3D, dL_dcov3D, dL_dsh, dL_dscales, dL_drotations); +} + +torch::Tensor markVisible( + torch::Tensor& means3D, + torch::Tensor& viewmatrix, + torch::Tensor& projmatrix) +{ + const int P = means3D.size(0); + + torch::Tensor present = torch::full({P}, false, means3D.options().dtype(at::kBool)); + + if(P != 0) + { + CudaRasterizer::Rasterizer::markVisible(P, + means3D.contiguous().data(), + viewmatrix.contiguous().data(), + projmatrix.contiguous().data(), + present.contiguous().data()); + } + + return present; +} \ No newline at end of file diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/rasterize_points.h b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/rasterize_points.h new file mode 100644 index 0000000000000000000000000000000000000000..da47d442737f7fa569f7986cbef671a814e96401 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/rasterize_points.h @@ -0,0 +1,70 @@ +/* + * Copyright (C) 2023, Inria + * GRAPHDECO research group, https://team.inria.fr/graphdeco + * All rights reserved. + * + * This software is free for non-commercial, research and evaluation use + * under the terms of the LICENSE.md file. + * + * For inquiries contact george.drettakis@inria.fr + */ + +#pragma once +#include +#include +#include +#include + +std::tuple +RasterizeGaussiansCUDA( + const torch::Tensor& background, + const torch::Tensor& means3D, + const torch::Tensor& colors, + const torch::Tensor& opacity, + const torch::Tensor& scales, + const torch::Tensor& rotations, + const float scale_modifier, + const torch::Tensor& cov3D_precomp, + const torch::Tensor& viewmatrix, + const torch::Tensor& projmatrix, + const float tan_fovx, + const float tan_fovy, + const int image_height, + const int image_width, + const torch::Tensor& sh, + const int degree, + const torch::Tensor& campos, + const bool prefiltered, + const bool debug); + +std::tuple + RasterizeGaussiansBackwardCUDA( + const torch::Tensor& background, + const torch::Tensor& means3D, + const torch::Tensor& radii, + const torch::Tensor& colors, + const torch::Tensor& scales, + const torch::Tensor& rotations, + const float scale_modifier, + const torch::Tensor& cov3D_precomp, + const torch::Tensor& viewmatrix, + const torch::Tensor& projmatrix, + const float tan_fovx, + const float tan_fovy, + const torch::Tensor& dL_dout_color, + const torch::Tensor& dL_dout_depth, + const torch::Tensor& dL_dout_alpha, + const torch::Tensor& sh, + const int degree, + const torch::Tensor& campos, + const torch::Tensor& geomBuffer, + const int R, + const torch::Tensor& binningBuffer, + const torch::Tensor& imageBuffer, + const torch::Tensor& alpha, + const bool debug); + +torch::Tensor markVisible( + torch::Tensor& means3D, + torch::Tensor& viewmatrix, + torch::Tensor& projmatrix); \ No newline at end of file diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/setup.py b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/setup.py new file mode 100644 index 0000000000000000000000000000000000000000..7a90725b7c3af59c639790533146ab8651d02e9f --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/setup.py @@ -0,0 +1,33 @@ +# +# Copyright (C) 2023, Inria +# GRAPHDECO research group, https://team.inria.fr/graphdeco +# All rights reserved. +# +# This software is free for non-commercial, research and evaluation use +# under the terms of the LICENSE.md file. +# +# For inquiries contact george.drettakis@inria.fr +# + +from setuptools import setup +from torch.utils.cpp_extension import CUDAExtension, BuildExtension +import os + +setup( + name="diff_gaussian_rasterization_depth_alpha", + packages=['diff_gaussian_rasterization_depth_alpha'], + ext_modules=[ + CUDAExtension( + name="diff_gaussian_rasterization_depth_alpha._C", + sources=[ + "cuda_rasterizer/rasterizer_impl.cu", + "cuda_rasterizer/forward.cu", + "cuda_rasterizer/backward.cu", + "rasterize_points.cu", + "ext.cpp"], + extra_compile_args={"nvcc": ["-I" + os.path.join(os.path.dirname(os.path.abspath(__file__)), "third_party/glm/")]}) + ], + cmdclass={ + 'build_ext': BuildExtension + } +) diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/.appveyor.yml b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/.appveyor.yml new file mode 100644 index 0000000000000000000000000000000000000000..f8618b285a582bbea199c6b24c7c0c1e90685c4c --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/.appveyor.yml @@ -0,0 +1,92 @@ +shallow_clone: true + +platform: + - x86 + - x64 + +configuration: + - Debug + - Release + +image: + - Visual Studio 2013 + - Visual Studio 2015 + - Visual Studio 2017 + - Visual Studio 2019 + +environment: + matrix: + - GLM_ARGUMENTS: -DGLM_TEST_FORCE_PURE=ON + - GLM_ARGUMENTS: -DGLM_TEST_ENABLE_SIMD_SSE2=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON + - GLM_ARGUMENTS: -DGLM_TEST_ENABLE_SIMD_AVX=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON + - GLM_ARGUMENTS: -DGLM_TEST_ENABLE_SIMD_AVX=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON -DGLM_TEST_ENABLE_CXX_14=ON + - GLM_ARGUMENTS: -DGLM_TEST_ENABLE_SIMD_AVX=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON -DGLM_TEST_ENABLE_CXX_17=ON + +matrix: + exclude: + - image: Visual Studio 2013 + GLM_ARGUMENTS: -DGLM_TEST_ENABLE_SIMD_AVX=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON + - image: Visual Studio 2013 + GLM_ARGUMENTS: -DGLM_TEST_ENABLE_SIMD_AVX=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON -DGLM_TEST_ENABLE_CXX_14=ON + - image: Visual Studio 2013 + GLM_ARGUMENTS: -DGLM_TEST_ENABLE_SIMD_AVX=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON -DGLM_TEST_ENABLE_CXX_17=ON + - image: Visual Studio 2013 + configuration: Debug + - image: Visual Studio 2015 + GLM_ARGUMENTS: -DGLM_TEST_ENABLE_SIMD_SSE2=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON + - image: Visual Studio 2015 + GLM_ARGUMENTS: -DGLM_TEST_ENABLE_SIMD_AVX=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON -DGLM_TEST_ENABLE_CXX_14=ON + - image: Visual Studio 2015 + GLM_ARGUMENTS: -DGLM_TEST_ENABLE_SIMD_AVX=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON -DGLM_TEST_ENABLE_CXX_17=ON + - image: Visual Studio 2015 + platform: x86 + - image: Visual Studio 2015 + configuration: Debug + - image: Visual Studio 2017 + platform: x86 + - image: Visual Studio 2017 + configuration: Debug + - image: Visual Studio 2019 + platform: x64 + +branches: + only: + - master + +before_build: + - ps: | + mkdir build + cd build + + if ("$env:APPVEYOR_JOB_NAME" -match "Image: Visual Studio 2013") { + $env:generator="Visual Studio 12 2013" + } + if ("$env:APPVEYOR_JOB_NAME" -match "Image: Visual Studio 2015") { + $env:generator="Visual Studio 14 2015" + } + if ("$env:APPVEYOR_JOB_NAME" -match "Image: Visual Studio 2017") { + $env:generator="Visual Studio 15 2017" + } + if ("$env:APPVEYOR_JOB_NAME" -match "Image: Visual Studio 2019") { + $env:generator="Visual Studio 16 2019" + } + if ($env:PLATFORM -eq "x64") { + $env:generator="$env:generator Win64" + } + echo generator="$env:generator" + cmake .. -G "$env:generator" -DCMAKE_INSTALL_PREFIX="$env:APPVEYOR_BUILD_FOLDER/install" -DGLM_QUIET=ON -DGLM_TEST_ENABLE=ON "$env:GLM_ARGUMENTS" + +build_script: + - cmake --build . --parallel --config %CONFIGURATION% -- /m /v:minimal + - cmake --build . --target install --parallel --config %CONFIGURATION% -- /m /v:minimal + +test_script: + - ctest --parallel 4 --verbose -C %CONFIGURATION% + - cd .. + - ps: | + mkdir build_test_cmake + cd build_test_cmake + cmake ..\test\cmake\ -G "$env:generator" -DCMAKE_PREFIX_PATH="$env:APPVEYOR_BUILD_FOLDER/install" + - cmake --build . --parallel --config %CONFIGURATION% -- /m /v:minimal + +deploy: off diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/.gitignore b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..4de8a4b247c7546d43c0e782a8936f1847f7601f --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/.gitignore @@ -0,0 +1,61 @@ +# Compiled Object files +*.slo +*.lo +*.o +*.obj + +# Precompiled Headers +*.gch +*.pch + +# Compiled Dynamic libraries +*.so +*.dylib +*.dll + +# Fortran module files +*.mod + +# Compiled Static libraries +*.lai +*.la +*.a +*.lib + +# Executables +*.exe +*.out +*.app + +# CMake +CMakeCache.txt +CMakeFiles +cmake_install.cmake +install_manifest.txt +*.cmake +!glmConfig.cmake +!glmConfig-version.cmake +# ^ May need to add future .cmake files as exceptions + +# Test logs +Testing/* + +# Test input +test/gtc/*.dds + +# Project Files +Makefile +*.cbp +*.user + +# Misc. +*.log + +# local build(s) +build* + +/.vs +/.vscode +/CMakeSettings.json +.DS_Store +*.swp diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/.travis.yml b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/.travis.yml new file mode 100644 index 0000000000000000000000000000000000000000..166d5a17fdf114e349f11e7bfc76fa18f4ac9e25 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/.travis.yml @@ -0,0 +1,388 @@ +language: cpp + +branches: + only: + - master + - stable + +jobs: + include: + - name: "Xcode 7.3 C++98 pure release" + os: osx + osx_image: xcode7.3 + env: + - MATRIX_EVAL="" + - CMAKE_BUILD_ENV="-DCMAKE_BUILD_TYPE=Release -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_98=ON -DGLM_TEST_FORCE_PURE=ON" + + - name: "Xcode 7.3 C++98 sse2 release" + os: osx + osx_image: xcode7.3 + env: + - MATRIX_EVAL="" + - CMAKE_BUILD_ENV="-DCMAKE_BUILD_TYPE=Release -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_98=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON -DGLM_TEST_ENABLE_SIMD_SSE2=ON" + + - name: "Xcode 7.3 C++98 ms release" + os: osx + osx_image: xcode7.3 + env: + - MATRIX_EVAL="" + - CMAKE_BUILD_ENV="-DCMAKE_BUILD_TYPE=Release -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_98=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON" + + - name: "XCode 7.3 C++11 pure release" + os: osx + osx_image: xcode7.3 + env: + - MATRIX_EVAL="" + - CMAKE_BUILD_ENV="-DCMAKE_BUILD_TYPE=Release -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_11=ON -DGLM_TEST_FORCE_PURE=ON" + + - name: "XCode 7.3 C++11 sse2 release" + os: osx + osx_image: xcode7.3 + env: + - MATRIX_EVAL="" + - CMAKE_BUILD_ENV="-DCMAKE_BUILD_TYPE=Release -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_11=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON -DGLM_TEST_ENABLE_SIMD_SSE3=ON" + + - name: "XCode 10.3 C++11 sse2 release" + os: osx + osx_image: xcode10.3 + env: + - MATRIX_EVAL="" + - CMAKE_BUILD_ENV="-DCMAKE_BUILD_TYPE=Release -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_11=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON -DGLM_TEST_ENABLE_SIMD_SSE3=ON" + + - name: "XCode 12.2 C++11 sse2 release" + os: osx + osx_image: xcode12.2 + env: + - MATRIX_EVAL="" + - CMAKE_BUILD_ENV="-DCMAKE_BUILD_TYPE=Release -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_11=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON -DGLM_TEST_ENABLE_SIMD_SSE3=ON" + - CTEST_ENV="--parallel 4 --output-on-failure" + - CMAKE_ENV="--parallel" + + - name: "XCode 12.2 C++11 sse2 debug" + os: osx + osx_image: xcode12.2 + env: + - MATRIX_EVAL="" + - CMAKE_BUILD_ENV="-DCMAKE_BUILD_TYPE=Debug -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_11=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON -DGLM_TEST_ENABLE_SIMD_SSE3=ON" + - CTEST_ENV="--parallel 4 --output-on-failure" + - CMAKE_ENV="--parallel" + + - name: "XCode 12.2 C++11 avx debug" + os: osx + osx_image: xcode12.2 + env: + - MATRIX_EVAL="" + - CMAKE_BUILD_ENV="-DCMAKE_BUILD_TYPE=Debug -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_11=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON -DGLM_TEST_ENABLE_SIMD_AVX=ON" + - CTEST_ENV="--parallel 4 --output-on-failure" + - CMAKE_ENV="--parallel" + + - name: "XCode 12.2 C++14 avx debug" + os: osx + osx_image: xcode12.2 + env: + - MATRIX_EVAL="" + - CMAKE_BUILD_ENV="-DCMAKE_BUILD_TYPE=Debug -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_14=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON -DGLM_TEST_ENABLE_SIMD_AVX=ON" + - CTEST_ENV="--parallel 4 --output-on-failure" + - CMAKE_ENV="--parallel" + + - name: "XCode 12.2 C++14 pure debug" + os: osx + osx_image: xcode12.2 + env: + - MATRIX_EVAL="" + - CMAKE_BUILD_ENV="-DCMAKE_BUILD_TYPE=Debug -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_14=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON -DGLM_TEST_FORCE_PURE=ON" + - CTEST_ENV="--parallel 4 --output-on-failure" + - CMAKE_ENV="--parallel" + + - name: "XCode 12.2 C++17 pure debug" + os: osx + osx_image: xcode12.2 + env: + - MATRIX_EVAL="" + - CMAKE_BUILD_ENV="-DCMAKE_BUILD_TYPE=Debug -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_17=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON -DGLM_TEST_FORCE_PURE=ON" + - CTEST_ENV="--parallel 4 --output-on-failure" + - CMAKE_ENV="--parallel" + + - name: "XCode 12.2 C++17 sse2 debug" + os: osx + osx_image: xcode12.2 + env: + - MATRIX_EVAL="" + - CMAKE_BUILD_ENV="-DCMAKE_BUILD_TYPE=Debug -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_17=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON -DGLM_TEST_ENABLE_SIMD_SSE2=ON" + - CTEST_ENV="--parallel 4 --output-on-failure" + - CMAKE_ENV="--parallel" + + - name: "XCode 12.2 C++17 sse2 release" + os: osx + osx_image: xcode12.2 + env: + - MATRIX_EVAL="" + - CMAKE_BUILD_ENV="-DCMAKE_BUILD_TYPE=Release -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_17=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON -DGLM_TEST_ENABLE_SIMD_SSE2=ON" + - CTEST_ENV="--parallel 4 --output-on-failure" + - CMAKE_ENV="--parallel" + + - name: "XCode 12.2 C++17 avx release" + os: osx + osx_image: xcode12.2 + env: + - MATRIX_EVAL="" + - CMAKE_BUILD_ENV="-DCMAKE_BUILD_TYPE=Release -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_17=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON -DGLM_TEST_ENABLE_SIMD_AVX=ON" + - CTEST_ENV="--parallel 4 --output-on-failure" + - CMAKE_ENV="--parallel" + + - name: "GCC 4.9 C++98 pure release" + os: linux + dist: Xenial + addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - g++-4.9 + env: + - MATRIX_EVAL="CC=gcc-4.9 && CXX=g++-4.9" + - CMAKE_BUILD_ENV="-DCMAKE_BUILD_TYPE=Release -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_98=ON -DGLM_TEST_FORCE_PURE=ON" + - CTEST_ENV="--parallel 4 --output-on-failure" + - CMAKE_ENV="--parallel" + + - name: "GCC 4.9 C++98 pure debug" + os: linux + dist: Xenial + addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - g++-4.9 + env: + - MATRIX_EVAL="CC=gcc-4.9 && CXX=g++-4.9" + - CMAKE_BUILD_ENV="-DCMAKE_BUILD_TYPE=Debug -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_98=ON -DGLM_TEST_FORCE_PURE=ON" + - CTEST_ENV="--parallel 4 --output-on-failure" + - CMAKE_ENV="--parallel" + + - name: "GCC 4.9 C++98 ms debug" + os: linux + dist: Xenial + addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - g++-4.9 + env: + - MATRIX_EVAL="CC=gcc-4.9 && CXX=g++-4.9" + - CMAKE_BUILD_ENV="-DCMAKE_BUILD_TYPE=Debug -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_98=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON" + - CTEST_ENV="--parallel 4 --output-on-failure" + - CMAKE_ENV="--parallel" + + - name: "GCC 4.9 C++11 ms debug" + os: linux + dist: Xenial + addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - g++-4.9 + env: + - MATRIX_EVAL="CC=gcc-4.9 && CXX=g++-4.9" + - CMAKE_BUILD_ENV="-DCMAKE_BUILD_TYPE=Debug -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_11=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON" + - CTEST_ENV="--parallel 4 --output-on-failure" + - CMAKE_ENV="--parallel" + + - name: "GCC 4.9 C++11 pure debug" + os: linux + dist: Xenial + addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - g++-4.9 + env: + - MATRIX_EVAL="CC=gcc-4.9 && CXX=g++-4.9" + - CMAKE_BUILD_ENV="-DCMAKE_BUILD_TYPE=Debug -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_11=ON -DGLM_TEST_FORCE_PURE=ON" + - CTEST_ENV="--parallel 4 --output-on-failure" + - CMAKE_ENV="--parallel" + + - name: "GCC 6 C++14 pure debug" + os: linux + dist: bionic + addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - g++-6 + env: + - MATRIX_EVAL="CC=gcc-6 && CXX=g++-6" + - CMAKE_BUILD_ENV="-DCMAKE_BUILD_TYPE=Debug -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_14=ON -DGLM_TEST_FORCE_PURE=ON" + - CTEST_ENV="--parallel 4 --output-on-failure" + - CMAKE_ENV="--parallel" + + - name: "GCC 6 C++14 ms debug" + os: linux + dist: bionic + addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - g++-6 + env: + - MATRIX_EVAL="CC=gcc-6 && CXX=g++-6" + - CMAKE_BUILD_ENV="-DCMAKE_BUILD_TYPE=Debug -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_14=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON" + - CTEST_ENV="--parallel 4 --output-on-failure" + - CMAKE_ENV="--parallel" + + - name: "GCC 7 C++17 ms debug" + os: linux + dist: bionic + addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - g++-7 + env: + - MATRIX_EVAL="CC=gcc-7 && CXX=g++-7" + - CMAKE_BUILD_ENV="-DCMAKE_BUILD_TYPE=Debug -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_17=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON" + - CTEST_ENV="--parallel 4 --output-on-failure" + - CMAKE_ENV="--parallel" + + - name: "GCC 7 C++17 pure debug" + os: linux + dist: bionic + addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - g++-7 + env: + - MATRIX_EVAL="CC=gcc-7 && CXX=g++-7" + - CMAKE_BUILD_ENV="-DCMAKE_BUILD_TYPE=Debug -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_17=ON -DGLM_TEST_FORCE_PURE=ON" + - CTEST_ENV="--parallel 4 --output-on-failure" + - CMAKE_ENV="--parallel" + + - name: "GCC 10 C++17 pure debug" + os: linux + dist: bionic + addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - g++-10 + env: + - MATRIX_EVAL="CC=gcc-10 && CXX=g++-10" + - CMAKE_BUILD_ENV="-DCMAKE_BUILD_TYPE=Debug -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_17=ON -DGLM_TEST_FORCE_PURE=ON" + - CTEST_ENV="--parallel 4 --output-on-failure" + - CMAKE_ENV="--parallel" + + - name: "GCC 10 C++17 pure release" + os: linux + dist: bionic + addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - g++-10 + env: + - MATRIX_EVAL="CC=gcc-10 && CXX=g++-10" + - CMAKE_BUILD_ENV="-DCMAKE_BUILD_TYPE=Release -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_17=ON -DGLM_TEST_FORCE_PURE=ON" + - CTEST_ENV="--parallel 4 --output-on-failure" + - CMAKE_ENV="--parallel" + + - name: "Clang C++14 pure release" + os: linux + dist: Xenial + env: + - MATRIX_EVAL="CC=clang && CXX=clang++" + - CMAKE_BUILD_ENV="-DCMAKE_BUILD_TYPE=Release -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_14=ON -DGLM_TEST_FORCE_PURE=ON" + - CTEST_ENV="--parallel 4 --output-on-failure" + - CMAKE_ENV="--parallel" + + - name: "Clang C++14 pure debug" + os: linux + dist: Xenial + env: + - MATRIX_EVAL="CC=clang && CXX=clang++" + - CMAKE_BUILD_ENV="-DCMAKE_BUILD_TYPE=Debug -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_14=ON -DGLM_TEST_FORCE_PURE=ON" + - CTEST_ENV="--parallel 4 --output-on-failure" + - CMAKE_ENV="--parallel" + + - name: "Clang C++14 sse2 debug" + os: linux + dist: Xenial + env: + - MATRIX_EVAL="CC=clang && CXX=clang++" + - CMAKE_BUILD_ENV="-DCMAKE_BUILD_TYPE=Debug -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_14=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON -DGLM_TEST_ENABLE_SIMD_SSE2=ON" + - CTEST_ENV="--parallel 4 --output-on-failure" + - CMAKE_ENV="--parallel" + + - name: "Clang C++14 sse2 debug" + os: linux + dist: focal + env: + - MATRIX_EVAL="CC=clang && CXX=clang++" + - CMAKE_BUILD_ENV="-DCMAKE_BUILD_TYPE=Debug -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_14=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON -DGLM_TEST_ENABLE_SIMD_SSE2=ON" + - CTEST_ENV="--parallel 4 --output-on-failure" + - CMAKE_ENV="--parallel" + + - name: "Clang C++17 sse2 debug" + os: linux + dist: focal + env: + - MATRIX_EVAL="CC=clang && CXX=clang++" + - CMAKE_BUILD_ENV="-DCMAKE_BUILD_TYPE=Debug -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_17=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON -DGLM_TEST_ENABLE_SIMD_SSE2=ON" + - CTEST_ENV="--parallel 4 --output-on-failure" + - CMAKE_ENV="--parallel" + + - name: "Clang C++17 avx2 debug" + os: linux + dist: focal + env: + - MATRIX_EVAL="CC=clang && CXX=clang++" + - CMAKE_BUILD_ENV="-DCMAKE_BUILD_TYPE=Debug -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_17=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON -DGLM_TEST_ENABLE_SIMD_AVX2=ON" + - CTEST_ENV="--parallel 4 --output-on-failure" + - CMAKE_ENV="--parallel" + + - name: "Clang C++17 pure debug" + os: linux + dist: focal + env: + - MATRIX_EVAL="CC=clang && CXX=clang++" + - CMAKE_BUILD_ENV="-DCMAKE_BUILD_TYPE=Debug -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_17=ON -DGLM_TEST_FORCE_PURE=ON" + - CTEST_ENV="--parallel 4 --output-on-failure" + - CMAKE_ENV="--parallel" + + - name: "Clang C++17 pure release" + os: linux + dist: focal + env: + - MATRIX_EVAL="CC=clang && CXX=clang++" + - CMAKE_BUILD_ENV="-DCMAKE_BUILD_TYPE=Release -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_17=ON -DGLM_TEST_FORCE_PURE=ON" + - CTEST_ENV="--parallel 4 --output-on-failure" + - CMAKE_ENV="--parallel" + +before_script: + - cmake --version + - eval "${MATRIX_EVAL}" + +script: + - ${CC} --version + - mkdir ./build + - cd ./build + - cmake -DCMAKE_INSTALL_PREFIX=$TRAVIS_BUILD_DIR/install -DCMAKE_CXX_COMPILER=$COMPILER ${CMAKE_BUILD_ENV} .. + - cmake --build . ${CMAKE_ENV} + - ctest ${CTEST_ENV} + - cmake --build . --target install ${CMAKE_ENV} + - cd $TRAVIS_BUILD_DIR + - mkdir ./build_test_cmake + - cd ./build_test_cmake + - cmake -DCMAKE_CXX_COMPILER=$COMPILER $TRAVIS_BUILD_DIR/test/cmake/ -DCMAKE_PREFIX_PATH=$TRAVIS_BUILD_DIR/install + - cmake --build . + + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/CMakeLists.txt b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..cfaa625c47fc5ac9f4fd0d7b0324a26131778ffa --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/CMakeLists.txt @@ -0,0 +1,45 @@ +cmake_minimum_required(VERSION 3.2 FATAL_ERROR) +cmake_policy(VERSION 3.2) + + +file(READ "glm/detail/setup.hpp" GLM_SETUP_FILE) +string(REGEX MATCH "#define[ ]+GLM_VERSION_MAJOR[ ]+([0-9]+)" _ ${GLM_SETUP_FILE}) +set(GLM_VERSION_MAJOR "${CMAKE_MATCH_1}") +string(REGEX MATCH "#define[ ]+GLM_VERSION_MINOR[ ]+([0-9]+)" _ ${GLM_SETUP_FILE}) +set(GLM_VERSION_MINOR "${CMAKE_MATCH_1}") +string(REGEX MATCH "#define[ ]+GLM_VERSION_PATCH[ ]+([0-9]+)" _ ${GLM_SETUP_FILE}) +set(GLM_VERSION_PATCH "${CMAKE_MATCH_1}") +string(REGEX MATCH "#define[ ]+GLM_VERSION_REVISION[ ]+([0-9]+)" _ ${GLM_SETUP_FILE}) +set(GLM_VERSION_REVISION "${CMAKE_MATCH_1}") + +set(GLM_VERSION ${GLM_VERSION_MAJOR}.${GLM_VERSION_MINOR}.${GLM_VERSION_PATCH}.${GLM_VERSION_REVISION}) +project(glm VERSION ${GLM_VERSION} LANGUAGES CXX) +message(STATUS "GLM: Version " ${GLM_VERSION}) + +add_subdirectory(glm) +add_library(glm::glm ALIAS glm) + +if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}) + + include(CPack) + install(DIRECTORY glm DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} PATTERN "CMakeLists.txt" EXCLUDE) + install(EXPORT glm FILE glmConfig.cmake DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/glm NAMESPACE glm::) + include(CMakePackageConfigHelpers) + write_basic_package_version_file("glmConfigVersion.cmake" COMPATIBILITY AnyNewerVersion) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/glmConfigVersion.cmake DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/glm) + + include(CTest) + if(BUILD_TESTING) + add_subdirectory(test) + endif() + +endif(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}) + +if (NOT TARGET uninstall) +configure_file(cmake/cmake_uninstall.cmake.in + cmake_uninstall.cmake IMMEDIATE @ONLY) + +add_custom_target(uninstall + "${CMAKE_COMMAND}" -P + "${CMAKE_BINARY_DIR}/cmake_uninstall.cmake") +endif() diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/cmake/cmake_uninstall.cmake.in b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/cmake/cmake_uninstall.cmake.in new file mode 100644 index 0000000000000000000000000000000000000000..f3005c10e4baafc9006214b9a075780ea0903427 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/cmake/cmake_uninstall.cmake.in @@ -0,0 +1,21 @@ +if(NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt") + message(FATAL_ERROR "Cannot find install manifest: @CMAKE_BINARY_DIR@/install_manifest.txt") +endif() + +file(READ "@CMAKE_BINARY_DIR@/install_manifest.txt" files) +string(REGEX REPLACE "\n" ";" files "${files}") +foreach(file ${files}) + message(STATUS "Uninstalling $ENV{DESTDIR}${file}") + if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") + exec_program( + "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\"" + OUTPUT_VARIABLE rm_out + RETURN_VALUE rm_retval + ) + if(NOT "${rm_retval}" STREQUAL 0) + message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}") + endif() + else(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") + message(STATUS "File $ENV{DESTDIR}${file} does not exist.") + endif() +endforeach() diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/copying.txt b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/copying.txt new file mode 100644 index 0000000000000000000000000000000000000000..5c43d396fa84cd790089673c52d9edc7719835d1 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/copying.txt @@ -0,0 +1,54 @@ +================================================================================ +OpenGL Mathematics (GLM) +-------------------------------------------------------------------------------- +GLM is licensed under The Happy Bunny License or MIT License + +================================================================================ +The Happy Bunny License (Modified MIT License) +-------------------------------------------------------------------------------- +Copyright (c) 2005 - G-Truc Creation + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Restrictions: + By making use of the Software for military purposes, you choose to make a + Bunny unhappy. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +================================================================================ +The MIT License +-------------------------------------------------------------------------------- +Copyright (c) 2005 - G-Truc Creation + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/CMakeLists.txt b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..4248abc8b351b5b232abe8e6aac57ae5557e6fac --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/CMakeLists.txt @@ -0,0 +1,78 @@ +file(GLOB ROOT_SOURCE *.cpp) +file(GLOB ROOT_INLINE *.inl) +file(GLOB ROOT_HEADER *.hpp) +file(GLOB ROOT_TEXT ../*.txt) +file(GLOB ROOT_MD ../*.md) +file(GLOB ROOT_NAT ../util/glm.natvis) + +file(GLOB_RECURSE CORE_SOURCE ./detail/*.cpp) +file(GLOB_RECURSE CORE_INLINE ./detail/*.inl) +file(GLOB_RECURSE CORE_HEADER ./detail/*.hpp) + +file(GLOB_RECURSE EXT_SOURCE ./ext/*.cpp) +file(GLOB_RECURSE EXT_INLINE ./ext/*.inl) +file(GLOB_RECURSE EXT_HEADER ./ext/*.hpp) + +file(GLOB_RECURSE GTC_SOURCE ./gtc/*.cpp) +file(GLOB_RECURSE GTC_INLINE ./gtc/*.inl) +file(GLOB_RECURSE GTC_HEADER ./gtc/*.hpp) + +file(GLOB_RECURSE GTX_SOURCE ./gtx/*.cpp) +file(GLOB_RECURSE GTX_INLINE ./gtx/*.inl) +file(GLOB_RECURSE GTX_HEADER ./gtx/*.hpp) + +file(GLOB_RECURSE SIMD_SOURCE ./simd/*.cpp) +file(GLOB_RECURSE SIMD_INLINE ./simd/*.inl) +file(GLOB_RECURSE SIMD_HEADER ./simd/*.h) + +source_group("Text Files" FILES ${ROOT_TEXT} ${ROOT_MD}) +source_group("Core Files" FILES ${CORE_SOURCE}) +source_group("Core Files" FILES ${CORE_INLINE}) +source_group("Core Files" FILES ${CORE_HEADER}) +source_group("EXT Files" FILES ${EXT_SOURCE}) +source_group("EXT Files" FILES ${EXT_INLINE}) +source_group("EXT Files" FILES ${EXT_HEADER}) +source_group("GTC Files" FILES ${GTC_SOURCE}) +source_group("GTC Files" FILES ${GTC_INLINE}) +source_group("GTC Files" FILES ${GTC_HEADER}) +source_group("GTX Files" FILES ${GTX_SOURCE}) +source_group("GTX Files" FILES ${GTX_INLINE}) +source_group("GTX Files" FILES ${GTX_HEADER}) +source_group("SIMD Files" FILES ${SIMD_SOURCE}) +source_group("SIMD Files" FILES ${SIMD_INLINE}) +source_group("SIMD Files" FILES ${SIMD_HEADER}) + +add_library(glm INTERFACE) + +include(GNUInstallDirs) + +target_include_directories(glm INTERFACE + $ + $ +) + +install(TARGETS glm EXPORT glm) + +if(BUILD_STATIC_LIBS) +add_library(glm_static STATIC ${ROOT_TEXT} ${ROOT_MD} ${ROOT_NAT} + ${ROOT_SOURCE} ${ROOT_INLINE} ${ROOT_HEADER} + ${CORE_SOURCE} ${CORE_INLINE} ${CORE_HEADER} + ${EXT_SOURCE} ${EXT_INLINE} ${EXT_HEADER} + ${GTC_SOURCE} ${GTC_INLINE} ${GTC_HEADER} + ${GTX_SOURCE} ${GTX_INLINE} ${GTX_HEADER} + ${SIMD_SOURCE} ${SIMD_INLINE} ${SIMD_HEADER}) + target_link_libraries(glm_static PUBLIC glm) + add_library(glm::glm_static ALIAS glm_static) +endif() + +if(BUILD_SHARED_LIBS) +add_library(glm_shared SHARED ${ROOT_TEXT} ${ROOT_MD} ${ROOT_NAT} + ${ROOT_SOURCE} ${ROOT_INLINE} ${ROOT_HEADER} + ${CORE_SOURCE} ${CORE_INLINE} ${CORE_HEADER} + ${EXT_SOURCE} ${EXT_INLINE} ${EXT_HEADER} + ${GTC_SOURCE} ${GTC_INLINE} ${GTC_HEADER} + ${GTX_SOURCE} ${GTX_INLINE} ${GTX_HEADER} + ${SIMD_SOURCE} ${SIMD_INLINE} ${SIMD_HEADER}) + target_link_libraries(glm_shared PUBLIC glm) + add_library(glm::glm_shared ALIAS glm_shared) +endif() diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/common.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/common.hpp new file mode 100644 index 0000000000000000000000000000000000000000..06d783bc9e8a42e616de97b5cd2a41a5ebdbf74f --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/common.hpp @@ -0,0 +1,539 @@ +/// @ref core +/// @file glm/common.hpp +/// +/// @see GLSL 4.20.8 specification, section 8.3 Common Functions +/// +/// @defgroup core_func_common Common functions +/// @ingroup core +/// +/// Provides GLSL common functions +/// +/// These all operate component-wise. The description is per component. +/// +/// Include to use these core features. + +#pragma once + +#include "detail/qualifier.hpp" +#include "detail/_fixes.hpp" + +namespace glm +{ + /// @addtogroup core_func_common + /// @{ + + /// Returns x if x >= 0; otherwise, it returns -x. + /// + /// @tparam genType floating-point or signed integer; scalar or vector types. + /// + /// @see GLSL abs man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template + GLM_FUNC_DECL GLM_CONSTEXPR genType abs(genType x); + + /// Returns x if x >= 0; otherwise, it returns -x. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point or signed integer scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see GLSL abs man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template + GLM_FUNC_DECL GLM_CONSTEXPR vec abs(vec const& x); + + /// Returns 1.0 if x > 0, 0.0 if x == 0, or -1.0 if x < 0. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see GLSL sign man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template + GLM_FUNC_DECL vec sign(vec const& x); + + /// Returns a value equal to the nearest integer that is less then or equal to x. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see GLSL floor man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template + GLM_FUNC_DECL vec floor(vec const& x); + + /// Returns a value equal to the nearest integer to x + /// whose absolute value is not larger than the absolute value of x. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see GLSL trunc man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template + GLM_FUNC_DECL vec trunc(vec const& x); + + /// Returns a value equal to the nearest integer to x. + /// The fraction 0.5 will round in a direction chosen by the + /// implementation, presumably the direction that is fastest. + /// This includes the possibility that round(x) returns the + /// same value as roundEven(x) for all values of x. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see GLSL round man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template + GLM_FUNC_DECL vec round(vec const& x); + + /// Returns a value equal to the nearest integer to x. + /// A fractional part of 0.5 will round toward the nearest even + /// integer. (Both 3.5 and 4.5 for x will return 4.0.) + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see GLSL roundEven man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + /// @see New round to even technique + template + GLM_FUNC_DECL vec roundEven(vec const& x); + + /// Returns a value equal to the nearest integer + /// that is greater than or equal to x. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see GLSL ceil man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template + GLM_FUNC_DECL vec ceil(vec const& x); + + /// Return x - floor(x). + /// + /// @tparam genType Floating-point scalar or vector types. + /// + /// @see GLSL fract man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template + GLM_FUNC_DECL genType fract(genType x); + + /// Return x - floor(x). + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see GLSL fract man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template + GLM_FUNC_DECL vec fract(vec const& x); + + template + GLM_FUNC_DECL genType mod(genType x, genType y); + + template + GLM_FUNC_DECL vec mod(vec const& x, T y); + + /// Modulus. Returns x - y * floor(x / y) + /// for each component in x using the floating point value y. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types, include glm/gtc/integer for integer scalar types support + /// @tparam Q Value from qualifier enum + /// + /// @see GLSL mod man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template + GLM_FUNC_DECL vec mod(vec const& x, vec const& y); + + /// Returns the fractional part of x and sets i to the integer + /// part (as a whole number floating point value). Both the + /// return value and the output parameter will have the same + /// sign as x. + /// + /// @tparam genType Floating-point scalar or vector types. + /// + /// @see GLSL modf man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template + GLM_FUNC_DECL genType modf(genType x, genType& i); + + /// Returns y if y < x; otherwise, it returns x. + /// + /// @tparam genType Floating-point or integer; scalar or vector types. + /// + /// @see GLSL min man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template + GLM_FUNC_DECL GLM_CONSTEXPR genType min(genType x, genType y); + + /// Returns y if y < x; otherwise, it returns x. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point or integer scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see GLSL min man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template + GLM_FUNC_DECL GLM_CONSTEXPR vec min(vec const& x, T y); + + /// Returns y if y < x; otherwise, it returns x. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point or integer scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see GLSL min man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template + GLM_FUNC_DECL GLM_CONSTEXPR vec min(vec const& x, vec const& y); + + /// Returns y if x < y; otherwise, it returns x. + /// + /// @tparam genType Floating-point or integer; scalar or vector types. + /// + /// @see GLSL max man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template + GLM_FUNC_DECL GLM_CONSTEXPR genType max(genType x, genType y); + + /// Returns y if x < y; otherwise, it returns x. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point or integer scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see GLSL max man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template + GLM_FUNC_DECL GLM_CONSTEXPR vec max(vec const& x, T y); + + /// Returns y if x < y; otherwise, it returns x. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point or integer scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see GLSL max man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template + GLM_FUNC_DECL GLM_CONSTEXPR vec max(vec const& x, vec const& y); + + /// Returns min(max(x, minVal), maxVal) for each component in x + /// using the floating-point values minVal and maxVal. + /// + /// @tparam genType Floating-point or integer; scalar or vector types. + /// + /// @see GLSL clamp man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template + GLM_FUNC_DECL GLM_CONSTEXPR genType clamp(genType x, genType minVal, genType maxVal); + + /// Returns min(max(x, minVal), maxVal) for each component in x + /// using the floating-point values minVal and maxVal. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point or integer scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see GLSL clamp man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template + GLM_FUNC_DECL GLM_CONSTEXPR vec clamp(vec const& x, T minVal, T maxVal); + + /// Returns min(max(x, minVal), maxVal) for each component in x + /// using the floating-point values minVal and maxVal. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point or integer scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see GLSL clamp man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template + GLM_FUNC_DECL GLM_CONSTEXPR vec clamp(vec const& x, vec const& minVal, vec const& maxVal); + + /// If genTypeU is a floating scalar or vector: + /// Returns x * (1.0 - a) + y * a, i.e., the linear blend of + /// x and y using the floating-point value a. + /// The value for a is not restricted to the range [0, 1]. + /// + /// If genTypeU is a boolean scalar or vector: + /// Selects which vector each returned component comes + /// from. For a component of 'a' that is false, the + /// corresponding component of 'x' is returned. For a + /// component of 'a' that is true, the corresponding + /// component of 'y' is returned. Components of 'x' and 'y' that + /// are not selected are allowed to be invalid floating point + /// values and will have no effect on the results. Thus, this + /// provides different functionality than + /// genType mix(genType x, genType y, genType(a)) + /// where a is a Boolean vector. + /// + /// @see GLSL mix man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + /// + /// @param[in] x Value to interpolate. + /// @param[in] y Value to interpolate. + /// @param[in] a Interpolant. + /// + /// @tparam genTypeT Floating point scalar or vector. + /// @tparam genTypeU Floating point or boolean scalar or vector. It can't be a vector if it is the length of genTypeT. + /// + /// @code + /// #include + /// ... + /// float a; + /// bool b; + /// glm::dvec3 e; + /// glm::dvec3 f; + /// glm::vec4 g; + /// glm::vec4 h; + /// ... + /// glm::vec4 r = glm::mix(g, h, a); // Interpolate with a floating-point scalar two vectors. + /// glm::vec4 s = glm::mix(g, h, b); // Returns g or h; + /// glm::dvec3 t = glm::mix(e, f, a); // Types of the third parameter is not required to match with the first and the second. + /// glm::vec4 u = glm::mix(g, h, r); // Interpolations can be perform per component with a vector for the last parameter. + /// @endcode + template + GLM_FUNC_DECL genTypeT mix(genTypeT x, genTypeT y, genTypeU a); + + template + GLM_FUNC_DECL vec mix(vec const& x, vec const& y, vec const& a); + + template + GLM_FUNC_DECL vec mix(vec const& x, vec const& y, U a); + + /// Returns 0.0 if x < edge, otherwise it returns 1.0 for each component of a genType. + /// + /// @see GLSL step man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template + GLM_FUNC_DECL genType step(genType edge, genType x); + + /// Returns 0.0 if x < edge, otherwise it returns 1.0. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see GLSL step man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template + GLM_FUNC_DECL vec step(T edge, vec const& x); + + /// Returns 0.0 if x < edge, otherwise it returns 1.0. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see GLSL step man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template + GLM_FUNC_DECL vec step(vec const& edge, vec const& x); + + /// Returns 0.0 if x <= edge0 and 1.0 if x >= edge1 and + /// performs smooth Hermite interpolation between 0 and 1 + /// when edge0 < x < edge1. This is useful in cases where + /// you would want a threshold function with a smooth + /// transition. This is equivalent to: + /// genType t; + /// t = clamp ((x - edge0) / (edge1 - edge0), 0, 1); + /// return t * t * (3 - 2 * t); + /// Results are undefined if edge0 >= edge1. + /// + /// @tparam genType Floating-point scalar or vector types. + /// + /// @see GLSL smoothstep man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template + GLM_FUNC_DECL genType smoothstep(genType edge0, genType edge1, genType x); + + template + GLM_FUNC_DECL vec smoothstep(T edge0, T edge1, vec const& x); + + template + GLM_FUNC_DECL vec smoothstep(vec const& edge0, vec const& edge1, vec const& x); + + /// Returns true if x holds a NaN (not a number) + /// representation in the underlying implementation's set of + /// floating point representations. Returns false otherwise, + /// including for implementations with no NaN + /// representations. + /// + /// /!\ When using compiler fast math, this function may fail. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see GLSL isnan man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template + GLM_FUNC_DECL vec isnan(vec const& x); + + /// Returns true if x holds a positive infinity or negative + /// infinity representation in the underlying implementation's + /// set of floating point representations. Returns false + /// otherwise, including for implementations with no infinity + /// representations. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see GLSL isinf man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template + GLM_FUNC_DECL vec isinf(vec const& x); + + /// Returns a signed integer value representing + /// the encoding of a floating-point value. The floating-point + /// value's bit-level representation is preserved. + /// + /// @see GLSL floatBitsToInt man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + GLM_FUNC_DECL int floatBitsToInt(float const& v); + + /// Returns a signed integer value representing + /// the encoding of a floating-point value. The floatingpoint + /// value's bit-level representation is preserved. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam Q Value from qualifier enum + /// + /// @see GLSL floatBitsToInt man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template + GLM_FUNC_DECL vec floatBitsToInt(vec const& v); + + /// Returns a unsigned integer value representing + /// the encoding of a floating-point value. The floatingpoint + /// value's bit-level representation is preserved. + /// + /// @see GLSL floatBitsToUint man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + GLM_FUNC_DECL uint floatBitsToUint(float const& v); + + /// Returns a unsigned integer value representing + /// the encoding of a floating-point value. The floatingpoint + /// value's bit-level representation is preserved. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam Q Value from qualifier enum + /// + /// @see GLSL floatBitsToUint man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template + GLM_FUNC_DECL vec floatBitsToUint(vec const& v); + + /// Returns a floating-point value corresponding to a signed + /// integer encoding of a floating-point value. + /// If an inf or NaN is passed in, it will not signal, and the + /// resulting floating point value is unspecified. Otherwise, + /// the bit-level representation is preserved. + /// + /// @see GLSL intBitsToFloat man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + GLM_FUNC_DECL float intBitsToFloat(int const& v); + + /// Returns a floating-point value corresponding to a signed + /// integer encoding of a floating-point value. + /// If an inf or NaN is passed in, it will not signal, and the + /// resulting floating point value is unspecified. Otherwise, + /// the bit-level representation is preserved. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam Q Value from qualifier enum + /// + /// @see GLSL intBitsToFloat man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template + GLM_FUNC_DECL vec intBitsToFloat(vec const& v); + + /// Returns a floating-point value corresponding to a + /// unsigned integer encoding of a floating-point value. + /// If an inf or NaN is passed in, it will not signal, and the + /// resulting floating point value is unspecified. Otherwise, + /// the bit-level representation is preserved. + /// + /// @see GLSL uintBitsToFloat man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + GLM_FUNC_DECL float uintBitsToFloat(uint const& v); + + /// Returns a floating-point value corresponding to a + /// unsigned integer encoding of a floating-point value. + /// If an inf or NaN is passed in, it will not signal, and the + /// resulting floating point value is unspecified. Otherwise, + /// the bit-level representation is preserved. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam Q Value from qualifier enum + /// + /// @see GLSL uintBitsToFloat man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template + GLM_FUNC_DECL vec uintBitsToFloat(vec const& v); + + /// Computes and returns a * b + c. + /// + /// @tparam genType Floating-point scalar or vector types. + /// + /// @see GLSL fma man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template + GLM_FUNC_DECL genType fma(genType const& a, genType const& b, genType const& c); + + /// Splits x into a floating-point significand in the range + /// [0.5, 1.0) and an integral exponent of two, such that: + /// x = significand * exp(2, exponent) + /// + /// The significand is returned by the function and the + /// exponent is returned in the parameter exp. For a + /// floating-point value of zero, the significant and exponent + /// are both zero. For a floating-point value that is an + /// infinity or is not a number, the results are undefined. + /// + /// @tparam genType Floating-point scalar or vector types. + /// + /// @see GLSL frexp man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template + GLM_FUNC_DECL genType frexp(genType x, int& exp); + + template + GLM_FUNC_DECL vec frexp(vec const& v, vec& exp); + + /// Builds a floating-point number from x and the + /// corresponding integral exponent of two in exp, returning: + /// significand * exp(2, exponent) + /// + /// If this product is too large to be represented in the + /// floating-point type, the result is undefined. + /// + /// @tparam genType Floating-point scalar or vector types. + /// + /// @see GLSL ldexp man page; + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template + GLM_FUNC_DECL genType ldexp(genType const& x, int const& exp); + + template + GLM_FUNC_DECL vec ldexp(vec const& v, vec const& exp); + + /// @} +}//namespace glm + +#include "detail/func_common.inl" + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/_features.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/_features.hpp new file mode 100644 index 0000000000000000000000000000000000000000..43069514fe5746a9767b687bfd8e94368aa87f5a --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/_features.hpp @@ -0,0 +1,394 @@ +#pragma once + +// #define GLM_CXX98_EXCEPTIONS +// #define GLM_CXX98_RTTI + +// #define GLM_CXX11_RVALUE_REFERENCES +// Rvalue references - GCC 4.3 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2118.html + +// GLM_CXX11_TRAILING_RETURN +// Rvalue references for *this - GCC not supported +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2439.htm + +// GLM_CXX11_NONSTATIC_MEMBER_INIT +// Initialization of class objects by rvalues - GCC any +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1610.html + +// GLM_CXX11_NONSTATIC_MEMBER_INIT +// Non-static data member initializers - GCC 4.7 +// http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2008/n2756.htm + +// #define GLM_CXX11_VARIADIC_TEMPLATE +// Variadic templates - GCC 4.3 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2242.pdf + +// +// Extending variadic template template parameters - GCC 4.4 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2555.pdf + +// #define GLM_CXX11_GENERALIZED_INITIALIZERS +// Initializer lists - GCC 4.4 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2672.htm + +// #define GLM_CXX11_STATIC_ASSERT +// Static assertions - GCC 4.3 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1720.html + +// #define GLM_CXX11_AUTO_TYPE +// auto-typed variables - GCC 4.4 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1984.pdf + +// #define GLM_CXX11_AUTO_TYPE +// Multi-declarator auto - GCC 4.4 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1737.pdf + +// #define GLM_CXX11_AUTO_TYPE +// Removal of auto as a storage-class specifier - GCC 4.4 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2546.htm + +// #define GLM_CXX11_AUTO_TYPE +// New function declarator syntax - GCC 4.4 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2541.htm + +// #define GLM_CXX11_LAMBDAS +// New wording for C++0x lambdas - GCC 4.5 +// http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2009/n2927.pdf + +// #define GLM_CXX11_DECLTYPE +// Declared type of an expression - GCC 4.3 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2343.pdf + +// +// Right angle brackets - GCC 4.3 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1757.html + +// +// Default template arguments for function templates DR226 GCC 4.3 +// http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#226 + +// +// Solving the SFINAE problem for expressions DR339 GCC 4.4 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2634.html + +// #define GLM_CXX11_ALIAS_TEMPLATE +// Template aliases N2258 GCC 4.7 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2258.pdf + +// +// Extern templates N1987 Yes +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1987.htm + +// #define GLM_CXX11_NULLPTR +// Null pointer constant N2431 GCC 4.6 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2431.pdf + +// #define GLM_CXX11_STRONG_ENUMS +// Strongly-typed enums N2347 GCC 4.4 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2347.pdf + +// +// Forward declarations for enums N2764 GCC 4.6 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2764.pdf + +// +// Generalized attributes N2761 GCC 4.8 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2761.pdf + +// +// Generalized constant expressions N2235 GCC 4.6 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2235.pdf + +// +// Alignment support N2341 GCC 4.8 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2341.pdf + +// #define GLM_CXX11_DELEGATING_CONSTRUCTORS +// Delegating constructors N1986 GCC 4.7 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1986.pdf + +// +// Inheriting constructors N2540 GCC 4.8 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2540.htm + +// #define GLM_CXX11_EXPLICIT_CONVERSIONS +// Explicit conversion operators N2437 GCC 4.5 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2437.pdf + +// +// New character types N2249 GCC 4.4 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2249.html + +// +// Unicode string literals N2442 GCC 4.5 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2442.htm + +// +// Raw string literals N2442 GCC 4.5 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2442.htm + +// +// Universal character name literals N2170 GCC 4.5 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2170.html + +// #define GLM_CXX11_USER_LITERALS +// User-defined literals N2765 GCC 4.7 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2765.pdf + +// +// Standard Layout Types N2342 GCC 4.5 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2342.htm + +// #define GLM_CXX11_DEFAULTED_FUNCTIONS +// #define GLM_CXX11_DELETED_FUNCTIONS +// Defaulted and deleted functions N2346 GCC 4.4 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2346.htm + +// +// Extended friend declarations N1791 GCC 4.7 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1791.pdf + +// +// Extending sizeof N2253 GCC 4.4 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2253.html + +// #define GLM_CXX11_INLINE_NAMESPACES +// Inline namespaces N2535 GCC 4.4 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2535.htm + +// #define GLM_CXX11_UNRESTRICTED_UNIONS +// Unrestricted unions N2544 GCC 4.6 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2544.pdf + +// #define GLM_CXX11_LOCAL_TYPE_TEMPLATE_ARGS +// Local and unnamed types as template arguments N2657 GCC 4.5 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2657.htm + +// #define GLM_CXX11_RANGE_FOR +// Range-based for N2930 GCC 4.6 +// http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2009/n2930.html + +// #define GLM_CXX11_OVERRIDE_CONTROL +// Explicit virtual overrides N2928 N3206 N3272 GCC 4.7 +// http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2009/n2928.htm +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3206.htm +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3272.htm + +// +// Minimal support for garbage collection and reachability-based leak detection N2670 No +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2670.htm + +// #define GLM_CXX11_NOEXCEPT +// Allowing move constructors to throw [noexcept] N3050 GCC 4.6 (core language only) +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3050.html + +// +// Defining move special member functions N3053 GCC 4.6 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3053.html + +// +// Sequence points N2239 Yes +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2239.html + +// +// Atomic operations N2427 GCC 4.4 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2239.html + +// +// Strong Compare and Exchange N2748 GCC 4.5 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2427.html + +// +// Bidirectional Fences N2752 GCC 4.8 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2752.htm + +// +// Memory model N2429 GCC 4.8 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2429.htm + +// +// Data-dependency ordering: atomics and memory model N2664 GCC 4.4 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2664.htm + +// +// Propagating exceptions N2179 GCC 4.4 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2179.html + +// +// Abandoning a process and at_quick_exit N2440 GCC 4.8 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2440.htm + +// +// Allow atomics use in signal handlers N2547 Yes +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2547.htm + +// +// Thread-local storage N2659 GCC 4.8 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2659.htm + +// +// Dynamic initialization and destruction with concurrency N2660 GCC 4.3 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2660.htm + +// +// __func__ predefined identifier N2340 GCC 4.3 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2340.htm + +// +// C99 preprocessor N1653 GCC 4.3 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1653.htm + +// +// long long N1811 GCC 4.3 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1811.pdf + +// +// Extended integral types N1988 Yes +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1988.pdf + +#if(GLM_COMPILER & GLM_COMPILER_GCC) + +# define GLM_CXX11_STATIC_ASSERT + +#elif(GLM_COMPILER & GLM_COMPILER_CLANG) +# if(__has_feature(cxx_exceptions)) +# define GLM_CXX98_EXCEPTIONS +# endif + +# if(__has_feature(cxx_rtti)) +# define GLM_CXX98_RTTI +# endif + +# if(__has_feature(cxx_access_control_sfinae)) +# define GLM_CXX11_ACCESS_CONTROL_SFINAE +# endif + +# if(__has_feature(cxx_alias_templates)) +# define GLM_CXX11_ALIAS_TEMPLATE +# endif + +# if(__has_feature(cxx_alignas)) +# define GLM_CXX11_ALIGNAS +# endif + +# if(__has_feature(cxx_attributes)) +# define GLM_CXX11_ATTRIBUTES +# endif + +# if(__has_feature(cxx_constexpr)) +# define GLM_CXX11_CONSTEXPR +# endif + +# if(__has_feature(cxx_decltype)) +# define GLM_CXX11_DECLTYPE +# endif + +# if(__has_feature(cxx_default_function_template_args)) +# define GLM_CXX11_DEFAULT_FUNCTION_TEMPLATE_ARGS +# endif + +# if(__has_feature(cxx_defaulted_functions)) +# define GLM_CXX11_DEFAULTED_FUNCTIONS +# endif + +# if(__has_feature(cxx_delegating_constructors)) +# define GLM_CXX11_DELEGATING_CONSTRUCTORS +# endif + +# if(__has_feature(cxx_deleted_functions)) +# define GLM_CXX11_DELETED_FUNCTIONS +# endif + +# if(__has_feature(cxx_explicit_conversions)) +# define GLM_CXX11_EXPLICIT_CONVERSIONS +# endif + +# if(__has_feature(cxx_generalized_initializers)) +# define GLM_CXX11_GENERALIZED_INITIALIZERS +# endif + +# if(__has_feature(cxx_implicit_moves)) +# define GLM_CXX11_IMPLICIT_MOVES +# endif + +# if(__has_feature(cxx_inheriting_constructors)) +# define GLM_CXX11_INHERITING_CONSTRUCTORS +# endif + +# if(__has_feature(cxx_inline_namespaces)) +# define GLM_CXX11_INLINE_NAMESPACES +# endif + +# if(__has_feature(cxx_lambdas)) +# define GLM_CXX11_LAMBDAS +# endif + +# if(__has_feature(cxx_local_type_template_args)) +# define GLM_CXX11_LOCAL_TYPE_TEMPLATE_ARGS +# endif + +# if(__has_feature(cxx_noexcept)) +# define GLM_CXX11_NOEXCEPT +# endif + +# if(__has_feature(cxx_nonstatic_member_init)) +# define GLM_CXX11_NONSTATIC_MEMBER_INIT +# endif + +# if(__has_feature(cxx_nullptr)) +# define GLM_CXX11_NULLPTR +# endif + +# if(__has_feature(cxx_override_control)) +# define GLM_CXX11_OVERRIDE_CONTROL +# endif + +# if(__has_feature(cxx_reference_qualified_functions)) +# define GLM_CXX11_REFERENCE_QUALIFIED_FUNCTIONS +# endif + +# if(__has_feature(cxx_range_for)) +# define GLM_CXX11_RANGE_FOR +# endif + +# if(__has_feature(cxx_raw_string_literals)) +# define GLM_CXX11_RAW_STRING_LITERALS +# endif + +# if(__has_feature(cxx_rvalue_references)) +# define GLM_CXX11_RVALUE_REFERENCES +# endif + +# if(__has_feature(cxx_static_assert)) +# define GLM_CXX11_STATIC_ASSERT +# endif + +# if(__has_feature(cxx_auto_type)) +# define GLM_CXX11_AUTO_TYPE +# endif + +# if(__has_feature(cxx_strong_enums)) +# define GLM_CXX11_STRONG_ENUMS +# endif + +# if(__has_feature(cxx_trailing_return)) +# define GLM_CXX11_TRAILING_RETURN +# endif + +# if(__has_feature(cxx_unicode_literals)) +# define GLM_CXX11_UNICODE_LITERALS +# endif + +# if(__has_feature(cxx_unrestricted_unions)) +# define GLM_CXX11_UNRESTRICTED_UNIONS +# endif + +# if(__has_feature(cxx_user_literals)) +# define GLM_CXX11_USER_LITERALS +# endif + +# if(__has_feature(cxx_variadic_templates)) +# define GLM_CXX11_VARIADIC_TEMPLATES +# endif + +#endif//(GLM_COMPILER & GLM_COMPILER_CLANG) diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/_fixes.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/_fixes.hpp new file mode 100644 index 0000000000000000000000000000000000000000..b1f06c2d4bb1ac8b093a3075414d48ba602e0387 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/_fixes.hpp @@ -0,0 +1,27 @@ +#include + +//! Workaround for compatibility with other libraries +#ifdef max +#undef max +#endif + +//! Workaround for compatibility with other libraries +#ifdef min +#undef min +#endif + +//! Workaround for Android +#ifdef isnan +#undef isnan +#endif + +//! Workaround for Android +#ifdef isinf +#undef isinf +#endif + +//! Workaround for Chrone Native Client +#ifdef log2 +#undef log2 +#endif + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/_noise.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/_noise.hpp new file mode 100644 index 0000000000000000000000000000000000000000..2a1285f0043e147d8a6f9382e25c2d7fa55f4a08 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/_noise.hpp @@ -0,0 +1,81 @@ +#pragma once + +#include "../common.hpp" + +namespace glm{ +namespace detail +{ + template + GLM_FUNC_QUALIFIER T mod289(T const& x) + { + return x - floor(x * (static_cast(1.0) / static_cast(289.0))) * static_cast(289.0); + } + + template + GLM_FUNC_QUALIFIER T permute(T const& x) + { + return mod289(((x * static_cast(34)) + static_cast(1)) * x); + } + + template + GLM_FUNC_QUALIFIER vec<2, T, Q> permute(vec<2, T, Q> const& x) + { + return mod289(((x * static_cast(34)) + static_cast(1)) * x); + } + + template + GLM_FUNC_QUALIFIER vec<3, T, Q> permute(vec<3, T, Q> const& x) + { + return mod289(((x * static_cast(34)) + static_cast(1)) * x); + } + + template + GLM_FUNC_QUALIFIER vec<4, T, Q> permute(vec<4, T, Q> const& x) + { + return mod289(((x * static_cast(34)) + static_cast(1)) * x); + } + + template + GLM_FUNC_QUALIFIER T taylorInvSqrt(T const& r) + { + return static_cast(1.79284291400159) - static_cast(0.85373472095314) * r; + } + + template + GLM_FUNC_QUALIFIER vec<2, T, Q> taylorInvSqrt(vec<2, T, Q> const& r) + { + return static_cast(1.79284291400159) - static_cast(0.85373472095314) * r; + } + + template + GLM_FUNC_QUALIFIER vec<3, T, Q> taylorInvSqrt(vec<3, T, Q> const& r) + { + return static_cast(1.79284291400159) - static_cast(0.85373472095314) * r; + } + + template + GLM_FUNC_QUALIFIER vec<4, T, Q> taylorInvSqrt(vec<4, T, Q> const& r) + { + return static_cast(1.79284291400159) - static_cast(0.85373472095314) * r; + } + + template + GLM_FUNC_QUALIFIER vec<2, T, Q> fade(vec<2, T, Q> const& t) + { + return (t * t * t) * (t * (t * static_cast(6) - static_cast(15)) + static_cast(10)); + } + + template + GLM_FUNC_QUALIFIER vec<3, T, Q> fade(vec<3, T, Q> const& t) + { + return (t * t * t) * (t * (t * static_cast(6) - static_cast(15)) + static_cast(10)); + } + + template + GLM_FUNC_QUALIFIER vec<4, T, Q> fade(vec<4, T, Q> const& t) + { + return (t * t * t) * (t * (t * static_cast(6) - static_cast(15)) + static_cast(10)); + } +}//namespace detail +}//namespace glm + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/_swizzle.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/_swizzle.hpp new file mode 100644 index 0000000000000000000000000000000000000000..67c66b14c6898c97acee607ec671fbec2fede26d --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/_swizzle.hpp @@ -0,0 +1,804 @@ +#pragma once + +namespace glm{ +namespace detail +{ + // Internal class for implementing swizzle operators + template + struct _swizzle_base0 + { + protected: + GLM_FUNC_QUALIFIER T& elem(size_t i){ return (reinterpret_cast(_buffer))[i]; } + GLM_FUNC_QUALIFIER T const& elem(size_t i) const{ return (reinterpret_cast(_buffer))[i]; } + + // Use an opaque buffer to *ensure* the compiler doesn't call a constructor. + // The size 1 buffer is assumed to aligned to the actual members so that the + // elem() + char _buffer[1]; + }; + + template + struct _swizzle_base1 : public _swizzle_base0 + { + }; + + template + struct _swizzle_base1<2, T, Q, E0,E1,-1,-2, Aligned> : public _swizzle_base0 + { + GLM_FUNC_QUALIFIER vec<2, T, Q> operator ()() const { return vec<2, T, Q>(this->elem(E0), this->elem(E1)); } + }; + + template + struct _swizzle_base1<3, T, Q, E0,E1,E2,-1, Aligned> : public _swizzle_base0 + { + GLM_FUNC_QUALIFIER vec<3, T, Q> operator ()() const { return vec<3, T, Q>(this->elem(E0), this->elem(E1), this->elem(E2)); } + }; + + template + struct _swizzle_base1<4, T, Q, E0,E1,E2,E3, Aligned> : public _swizzle_base0 + { + GLM_FUNC_QUALIFIER vec<4, T, Q> operator ()() const { return vec<4, T, Q>(this->elem(E0), this->elem(E1), this->elem(E2), this->elem(E3)); } + }; + + // Internal class for implementing swizzle operators + /* + Template parameters: + + T = type of scalar values (e.g. float, double) + N = number of components in the vector (e.g. 3) + E0...3 = what index the n-th element of this swizzle refers to in the unswizzled vec + + DUPLICATE_ELEMENTS = 1 if there is a repeated element, 0 otherwise (used to specialize swizzles + containing duplicate elements so that they cannot be used as r-values). + */ + template + struct _swizzle_base2 : public _swizzle_base1::value> + { + struct op_equal + { + GLM_FUNC_QUALIFIER void operator() (T& e, T& t) const{ e = t; } + }; + + struct op_minus + { + GLM_FUNC_QUALIFIER void operator() (T& e, T& t) const{ e -= t; } + }; + + struct op_plus + { + GLM_FUNC_QUALIFIER void operator() (T& e, T& t) const{ e += t; } + }; + + struct op_mul + { + GLM_FUNC_QUALIFIER void operator() (T& e, T& t) const{ e *= t; } + }; + + struct op_div + { + GLM_FUNC_QUALIFIER void operator() (T& e, T& t) const{ e /= t; } + }; + + public: + GLM_FUNC_QUALIFIER _swizzle_base2& operator= (const T& t) + { + for (int i = 0; i < N; ++i) + (*this)[i] = t; + return *this; + } + + GLM_FUNC_QUALIFIER _swizzle_base2& operator= (vec const& that) + { + _apply_op(that, op_equal()); + return *this; + } + + GLM_FUNC_QUALIFIER void operator -= (vec const& that) + { + _apply_op(that, op_minus()); + } + + GLM_FUNC_QUALIFIER void operator += (vec const& that) + { + _apply_op(that, op_plus()); + } + + GLM_FUNC_QUALIFIER void operator *= (vec const& that) + { + _apply_op(that, op_mul()); + } + + GLM_FUNC_QUALIFIER void operator /= (vec const& that) + { + _apply_op(that, op_div()); + } + + GLM_FUNC_QUALIFIER T& operator[](size_t i) + { + const int offset_dst[4] = { E0, E1, E2, E3 }; + return this->elem(offset_dst[i]); + } + GLM_FUNC_QUALIFIER T operator[](size_t i) const + { + const int offset_dst[4] = { E0, E1, E2, E3 }; + return this->elem(offset_dst[i]); + } + + protected: + template + GLM_FUNC_QUALIFIER void _apply_op(vec const& that, const U& op) + { + // Make a copy of the data in this == &that. + // The copier should optimize out the copy in cases where the function is + // properly inlined and the copy is not necessary. + T t[N]; + for (int i = 0; i < N; ++i) + t[i] = that[i]; + for (int i = 0; i < N; ++i) + op( (*this)[i], t[i] ); + } + }; + + // Specialization for swizzles containing duplicate elements. These cannot be modified. + template + struct _swizzle_base2 : public _swizzle_base1::value> + { + struct Stub {}; + + GLM_FUNC_QUALIFIER _swizzle_base2& operator= (Stub const&) { return *this; } + + GLM_FUNC_QUALIFIER T operator[] (size_t i) const + { + const int offset_dst[4] = { E0, E1, E2, E3 }; + return this->elem(offset_dst[i]); + } + }; + + template + struct _swizzle : public _swizzle_base2 + { + typedef _swizzle_base2 base_type; + + using base_type::operator=; + + GLM_FUNC_QUALIFIER operator vec () const { return (*this)(); } + }; + +// +// To prevent the C++ syntax from getting entirely overwhelming, define some alias macros +// +#define GLM_SWIZZLE_TEMPLATE1 template +#define GLM_SWIZZLE_TEMPLATE2 template +#define GLM_SWIZZLE_TYPE1 _swizzle +#define GLM_SWIZZLE_TYPE2 _swizzle + +// +// Wrapper for a binary operator (e.g. u.yy + v.zy) +// +#define GLM_SWIZZLE_VECTOR_BINARY_OPERATOR_IMPLEMENTATION(OPERAND) \ + GLM_SWIZZLE_TEMPLATE2 \ + GLM_FUNC_QUALIFIER vec operator OPERAND ( const GLM_SWIZZLE_TYPE1& a, const GLM_SWIZZLE_TYPE2& b) \ + { \ + return a() OPERAND b(); \ + } \ + GLM_SWIZZLE_TEMPLATE1 \ + GLM_FUNC_QUALIFIER vec operator OPERAND ( const GLM_SWIZZLE_TYPE1& a, const vec& b) \ + { \ + return a() OPERAND b; \ + } \ + GLM_SWIZZLE_TEMPLATE1 \ + GLM_FUNC_QUALIFIER vec operator OPERAND ( const vec& a, const GLM_SWIZZLE_TYPE1& b) \ + { \ + return a OPERAND b(); \ + } + +// +// Wrapper for a operand between a swizzle and a binary (e.g. 1.0f - u.xyz) +// +#define GLM_SWIZZLE_SCALAR_BINARY_OPERATOR_IMPLEMENTATION(OPERAND) \ + GLM_SWIZZLE_TEMPLATE1 \ + GLM_FUNC_QUALIFIER vec operator OPERAND ( const GLM_SWIZZLE_TYPE1& a, const T& b) \ + { \ + return a() OPERAND b; \ + } \ + GLM_SWIZZLE_TEMPLATE1 \ + GLM_FUNC_QUALIFIER vec operator OPERAND ( const T& a, const GLM_SWIZZLE_TYPE1& b) \ + { \ + return a OPERAND b(); \ + } + +// +// Macro for wrapping a function taking one argument (e.g. abs()) +// +#define GLM_SWIZZLE_FUNCTION_1_ARGS(RETURN_TYPE,FUNCTION) \ + GLM_SWIZZLE_TEMPLATE1 \ + GLM_FUNC_QUALIFIER typename GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const GLM_SWIZZLE_TYPE1& a) \ + { \ + return FUNCTION(a()); \ + } + +// +// Macro for wrapping a function taking two vector arguments (e.g. dot()). +// +#define GLM_SWIZZLE_FUNCTION_2_ARGS(RETURN_TYPE,FUNCTION) \ + GLM_SWIZZLE_TEMPLATE2 \ + GLM_FUNC_QUALIFIER typename GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const GLM_SWIZZLE_TYPE1& a, const GLM_SWIZZLE_TYPE2& b) \ + { \ + return FUNCTION(a(), b()); \ + } \ + GLM_SWIZZLE_TEMPLATE1 \ + GLM_FUNC_QUALIFIER typename GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const GLM_SWIZZLE_TYPE1& a, const GLM_SWIZZLE_TYPE1& b) \ + { \ + return FUNCTION(a(), b()); \ + } \ + GLM_SWIZZLE_TEMPLATE1 \ + GLM_FUNC_QUALIFIER typename GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const GLM_SWIZZLE_TYPE1& a, const typename V& b) \ + { \ + return FUNCTION(a(), b); \ + } \ + GLM_SWIZZLE_TEMPLATE1 \ + GLM_FUNC_QUALIFIER typename GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const V& a, const GLM_SWIZZLE_TYPE1& b) \ + { \ + return FUNCTION(a, b()); \ + } + +// +// Macro for wrapping a function take 2 vec arguments followed by a scalar (e.g. mix()). +// +#define GLM_SWIZZLE_FUNCTION_2_ARGS_SCALAR(RETURN_TYPE,FUNCTION) \ + GLM_SWIZZLE_TEMPLATE2 \ + GLM_FUNC_QUALIFIER typename GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const GLM_SWIZZLE_TYPE1& a, const GLM_SWIZZLE_TYPE2& b, const T& c) \ + { \ + return FUNCTION(a(), b(), c); \ + } \ + GLM_SWIZZLE_TEMPLATE1 \ + GLM_FUNC_QUALIFIER typename GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const GLM_SWIZZLE_TYPE1& a, const GLM_SWIZZLE_TYPE1& b, const T& c) \ + { \ + return FUNCTION(a(), b(), c); \ + } \ + GLM_SWIZZLE_TEMPLATE1 \ + GLM_FUNC_QUALIFIER typename GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const GLM_SWIZZLE_TYPE1& a, const typename S0::vec_type& b, const T& c)\ + { \ + return FUNCTION(a(), b, c); \ + } \ + GLM_SWIZZLE_TEMPLATE1 \ + GLM_FUNC_QUALIFIER typename GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const typename V& a, const GLM_SWIZZLE_TYPE1& b, const T& c) \ + { \ + return FUNCTION(a, b(), c); \ + } + +}//namespace detail +}//namespace glm + +namespace glm +{ + namespace detail + { + GLM_SWIZZLE_SCALAR_BINARY_OPERATOR_IMPLEMENTATION(-) + GLM_SWIZZLE_SCALAR_BINARY_OPERATOR_IMPLEMENTATION(*) + GLM_SWIZZLE_VECTOR_BINARY_OPERATOR_IMPLEMENTATION(+) + GLM_SWIZZLE_VECTOR_BINARY_OPERATOR_IMPLEMENTATION(-) + GLM_SWIZZLE_VECTOR_BINARY_OPERATOR_IMPLEMENTATION(*) + GLM_SWIZZLE_VECTOR_BINARY_OPERATOR_IMPLEMENTATION(/) + } + + // + // Swizzles are distinct types from the unswizzled type. The below macros will + // provide template specializations for the swizzle types for the given functions + // so that the compiler does not have any ambiguity to choosing how to handle + // the function. + // + // The alternative is to use the operator()() when calling the function in order + // to explicitly convert the swizzled type to the unswizzled type. + // + + //GLM_SWIZZLE_FUNCTION_1_ARGS(vec_type, abs); + //GLM_SWIZZLE_FUNCTION_1_ARGS(vec_type, acos); + //GLM_SWIZZLE_FUNCTION_1_ARGS(vec_type, acosh); + //GLM_SWIZZLE_FUNCTION_1_ARGS(vec_type, all); + //GLM_SWIZZLE_FUNCTION_1_ARGS(vec_type, any); + + //GLM_SWIZZLE_FUNCTION_2_ARGS(value_type, dot); + //GLM_SWIZZLE_FUNCTION_2_ARGS(vec_type, cross); + //GLM_SWIZZLE_FUNCTION_2_ARGS(vec_type, step); + //GLM_SWIZZLE_FUNCTION_2_ARGS_SCALAR(vec_type, mix); +} + +#define GLM_SWIZZLE2_2_MEMBERS(T, Q, E0,E1) \ + struct { detail::_swizzle<2, T, Q, 0,0,-1,-2> E0 ## E0; }; \ + struct { detail::_swizzle<2, T, Q, 0,1,-1,-2> E0 ## E1; }; \ + struct { detail::_swizzle<2, T, Q, 1,0,-1,-2> E1 ## E0; }; \ + struct { detail::_swizzle<2, T, Q, 1,1,-1,-2> E1 ## E1; }; + +#define GLM_SWIZZLE2_3_MEMBERS(T, Q, E0,E1) \ + struct { detail::_swizzle<3,T, Q, 0,0,0,-1> E0 ## E0 ## E0; }; \ + struct { detail::_swizzle<3,T, Q, 0,0,1,-1> E0 ## E0 ## E1; }; \ + struct { detail::_swizzle<3,T, Q, 0,1,0,-1> E0 ## E1 ## E0; }; \ + struct { detail::_swizzle<3,T, Q, 0,1,1,-1> E0 ## E1 ## E1; }; \ + struct { detail::_swizzle<3,T, Q, 1,0,0,-1> E1 ## E0 ## E0; }; \ + struct { detail::_swizzle<3,T, Q, 1,0,1,-1> E1 ## E0 ## E1; }; \ + struct { detail::_swizzle<3,T, Q, 1,1,0,-1> E1 ## E1 ## E0; }; \ + struct { detail::_swizzle<3,T, Q, 1,1,1,-1> E1 ## E1 ## E1; }; + +#define GLM_SWIZZLE2_4_MEMBERS(T, Q, E0,E1) \ + struct { detail::_swizzle<4,T, Q, 0,0,0,0> E0 ## E0 ## E0 ## E0; }; \ + struct { detail::_swizzle<4,T, Q, 0,0,0,1> E0 ## E0 ## E0 ## E1; }; \ + struct { detail::_swizzle<4,T, Q, 0,0,1,0> E0 ## E0 ## E1 ## E0; }; \ + struct { detail::_swizzle<4,T, Q, 0,0,1,1> E0 ## E0 ## E1 ## E1; }; \ + struct { detail::_swizzle<4,T, Q, 0,1,0,0> E0 ## E1 ## E0 ## E0; }; \ + struct { detail::_swizzle<4,T, Q, 0,1,0,1> E0 ## E1 ## E0 ## E1; }; \ + struct { detail::_swizzle<4,T, Q, 0,1,1,0> E0 ## E1 ## E1 ## E0; }; \ + struct { detail::_swizzle<4,T, Q, 0,1,1,1> E0 ## E1 ## E1 ## E1; }; \ + struct { detail::_swizzle<4,T, Q, 1,0,0,0> E1 ## E0 ## E0 ## E0; }; \ + struct { detail::_swizzle<4,T, Q, 1,0,0,1> E1 ## E0 ## E0 ## E1; }; \ + struct { detail::_swizzle<4,T, Q, 1,0,1,0> E1 ## E0 ## E1 ## E0; }; \ + struct { detail::_swizzle<4,T, Q, 1,0,1,1> E1 ## E0 ## E1 ## E1; }; \ + struct { detail::_swizzle<4,T, Q, 1,1,0,0> E1 ## E1 ## E0 ## E0; }; \ + struct { detail::_swizzle<4,T, Q, 1,1,0,1> E1 ## E1 ## E0 ## E1; }; \ + struct { detail::_swizzle<4,T, Q, 1,1,1,0> E1 ## E1 ## E1 ## E0; }; \ + struct { detail::_swizzle<4,T, Q, 1,1,1,1> E1 ## E1 ## E1 ## E1; }; + +#define GLM_SWIZZLE3_2_MEMBERS(T, Q, E0,E1,E2) \ + struct { detail::_swizzle<2,T, Q, 0,0,-1,-2> E0 ## E0; }; \ + struct { detail::_swizzle<2,T, Q, 0,1,-1,-2> E0 ## E1; }; \ + struct { detail::_swizzle<2,T, Q, 0,2,-1,-2> E0 ## E2; }; \ + struct { detail::_swizzle<2,T, Q, 1,0,-1,-2> E1 ## E0; }; \ + struct { detail::_swizzle<2,T, Q, 1,1,-1,-2> E1 ## E1; }; \ + struct { detail::_swizzle<2,T, Q, 1,2,-1,-2> E1 ## E2; }; \ + struct { detail::_swizzle<2,T, Q, 2,0,-1,-2> E2 ## E0; }; \ + struct { detail::_swizzle<2,T, Q, 2,1,-1,-2> E2 ## E1; }; \ + struct { detail::_swizzle<2,T, Q, 2,2,-1,-2> E2 ## E2; }; + +#define GLM_SWIZZLE3_3_MEMBERS(T, Q ,E0,E1,E2) \ + struct { detail::_swizzle<3, T, Q, 0,0,0,-1> E0 ## E0 ## E0; }; \ + struct { detail::_swizzle<3, T, Q, 0,0,1,-1> E0 ## E0 ## E1; }; \ + struct { detail::_swizzle<3, T, Q, 0,0,2,-1> E0 ## E0 ## E2; }; \ + struct { detail::_swizzle<3, T, Q, 0,1,0,-1> E0 ## E1 ## E0; }; \ + struct { detail::_swizzle<3, T, Q, 0,1,1,-1> E0 ## E1 ## E1; }; \ + struct { detail::_swizzle<3, T, Q, 0,1,2,-1> E0 ## E1 ## E2; }; \ + struct { detail::_swizzle<3, T, Q, 0,2,0,-1> E0 ## E2 ## E0; }; \ + struct { detail::_swizzle<3, T, Q, 0,2,1,-1> E0 ## E2 ## E1; }; \ + struct { detail::_swizzle<3, T, Q, 0,2,2,-1> E0 ## E2 ## E2; }; \ + struct { detail::_swizzle<3, T, Q, 1,0,0,-1> E1 ## E0 ## E0; }; \ + struct { detail::_swizzle<3, T, Q, 1,0,1,-1> E1 ## E0 ## E1; }; \ + struct { detail::_swizzle<3, T, Q, 1,0,2,-1> E1 ## E0 ## E2; }; \ + struct { detail::_swizzle<3, T, Q, 1,1,0,-1> E1 ## E1 ## E0; }; \ + struct { detail::_swizzle<3, T, Q, 1,1,1,-1> E1 ## E1 ## E1; }; \ + struct { detail::_swizzle<3, T, Q, 1,1,2,-1> E1 ## E1 ## E2; }; \ + struct { detail::_swizzle<3, T, Q, 1,2,0,-1> E1 ## E2 ## E0; }; \ + struct { detail::_swizzle<3, T, Q, 1,2,1,-1> E1 ## E2 ## E1; }; \ + struct { detail::_swizzle<3, T, Q, 1,2,2,-1> E1 ## E2 ## E2; }; \ + struct { detail::_swizzle<3, T, Q, 2,0,0,-1> E2 ## E0 ## E0; }; \ + struct { detail::_swizzle<3, T, Q, 2,0,1,-1> E2 ## E0 ## E1; }; \ + struct { detail::_swizzle<3, T, Q, 2,0,2,-1> E2 ## E0 ## E2; }; \ + struct { detail::_swizzle<3, T, Q, 2,1,0,-1> E2 ## E1 ## E0; }; \ + struct { detail::_swizzle<3, T, Q, 2,1,1,-1> E2 ## E1 ## E1; }; \ + struct { detail::_swizzle<3, T, Q, 2,1,2,-1> E2 ## E1 ## E2; }; \ + struct { detail::_swizzle<3, T, Q, 2,2,0,-1> E2 ## E2 ## E0; }; \ + struct { detail::_swizzle<3, T, Q, 2,2,1,-1> E2 ## E2 ## E1; }; \ + struct { detail::_swizzle<3, T, Q, 2,2,2,-1> E2 ## E2 ## E2; }; + +#define GLM_SWIZZLE3_4_MEMBERS(T, Q, E0,E1,E2) \ + struct { detail::_swizzle<4,T, Q, 0,0,0,0> E0 ## E0 ## E0 ## E0; }; \ + struct { detail::_swizzle<4,T, Q, 0,0,0,1> E0 ## E0 ## E0 ## E1; }; \ + struct { detail::_swizzle<4,T, Q, 0,0,0,2> E0 ## E0 ## E0 ## E2; }; \ + struct { detail::_swizzle<4,T, Q, 0,0,1,0> E0 ## E0 ## E1 ## E0; }; \ + struct { detail::_swizzle<4,T, Q, 0,0,1,1> E0 ## E0 ## E1 ## E1; }; \ + struct { detail::_swizzle<4,T, Q, 0,0,1,2> E0 ## E0 ## E1 ## E2; }; \ + struct { detail::_swizzle<4,T, Q, 0,0,2,0> E0 ## E0 ## E2 ## E0; }; \ + struct { detail::_swizzle<4,T, Q, 0,0,2,1> E0 ## E0 ## E2 ## E1; }; \ + struct { detail::_swizzle<4,T, Q, 0,0,2,2> E0 ## E0 ## E2 ## E2; }; \ + struct { detail::_swizzle<4,T, Q, 0,1,0,0> E0 ## E1 ## E0 ## E0; }; \ + struct { detail::_swizzle<4,T, Q, 0,1,0,1> E0 ## E1 ## E0 ## E1; }; \ + struct { detail::_swizzle<4,T, Q, 0,1,0,2> E0 ## E1 ## E0 ## E2; }; \ + struct { detail::_swizzle<4,T, Q, 0,1,1,0> E0 ## E1 ## E1 ## E0; }; \ + struct { detail::_swizzle<4,T, Q, 0,1,1,1> E0 ## E1 ## E1 ## E1; }; \ + struct { detail::_swizzle<4,T, Q, 0,1,1,2> E0 ## E1 ## E1 ## E2; }; \ + struct { detail::_swizzle<4,T, Q, 0,1,2,0> E0 ## E1 ## E2 ## E0; }; \ + struct { detail::_swizzle<4,T, Q, 0,1,2,1> E0 ## E1 ## E2 ## E1; }; \ + struct { detail::_swizzle<4,T, Q, 0,1,2,2> E0 ## E1 ## E2 ## E2; }; \ + struct { detail::_swizzle<4,T, Q, 0,2,0,0> E0 ## E2 ## E0 ## E0; }; \ + struct { detail::_swizzle<4,T, Q, 0,2,0,1> E0 ## E2 ## E0 ## E1; }; \ + struct { detail::_swizzle<4,T, Q, 0,2,0,2> E0 ## E2 ## E0 ## E2; }; \ + struct { detail::_swizzle<4,T, Q, 0,2,1,0> E0 ## E2 ## E1 ## E0; }; \ + struct { detail::_swizzle<4,T, Q, 0,2,1,1> E0 ## E2 ## E1 ## E1; }; \ + struct { detail::_swizzle<4,T, Q, 0,2,1,2> E0 ## E2 ## E1 ## E2; }; \ + struct { detail::_swizzle<4,T, Q, 0,2,2,0> E0 ## E2 ## E2 ## E0; }; \ + struct { detail::_swizzle<4,T, Q, 0,2,2,1> E0 ## E2 ## E2 ## E1; }; \ + struct { detail::_swizzle<4,T, Q, 0,2,2,2> E0 ## E2 ## E2 ## E2; }; \ + struct { detail::_swizzle<4,T, Q, 1,0,0,0> E1 ## E0 ## E0 ## E0; }; \ + struct { detail::_swizzle<4,T, Q, 1,0,0,1> E1 ## E0 ## E0 ## E1; }; \ + struct { detail::_swizzle<4,T, Q, 1,0,0,2> E1 ## E0 ## E0 ## E2; }; \ + struct { detail::_swizzle<4,T, Q, 1,0,1,0> E1 ## E0 ## E1 ## E0; }; \ + struct { detail::_swizzle<4,T, Q, 1,0,1,1> E1 ## E0 ## E1 ## E1; }; \ + struct { detail::_swizzle<4,T, Q, 1,0,1,2> E1 ## E0 ## E1 ## E2; }; \ + struct { detail::_swizzle<4,T, Q, 1,0,2,0> E1 ## E0 ## E2 ## E0; }; \ + struct { detail::_swizzle<4,T, Q, 1,0,2,1> E1 ## E0 ## E2 ## E1; }; \ + struct { detail::_swizzle<4,T, Q, 1,0,2,2> E1 ## E0 ## E2 ## E2; }; \ + struct { detail::_swizzle<4,T, Q, 1,1,0,0> E1 ## E1 ## E0 ## E0; }; \ + struct { detail::_swizzle<4,T, Q, 1,1,0,1> E1 ## E1 ## E0 ## E1; }; \ + struct { detail::_swizzle<4,T, Q, 1,1,0,2> E1 ## E1 ## E0 ## E2; }; \ + struct { detail::_swizzle<4,T, Q, 1,1,1,0> E1 ## E1 ## E1 ## E0; }; \ + struct { detail::_swizzle<4,T, Q, 1,1,1,1> E1 ## E1 ## E1 ## E1; }; \ + struct { detail::_swizzle<4,T, Q, 1,1,1,2> E1 ## E1 ## E1 ## E2; }; \ + struct { detail::_swizzle<4,T, Q, 1,1,2,0> E1 ## E1 ## E2 ## E0; }; \ + struct { detail::_swizzle<4,T, Q, 1,1,2,1> E1 ## E1 ## E2 ## E1; }; \ + struct { detail::_swizzle<4,T, Q, 1,1,2,2> E1 ## E1 ## E2 ## E2; }; \ + struct { detail::_swizzle<4,T, Q, 1,2,0,0> E1 ## E2 ## E0 ## E0; }; \ + struct { detail::_swizzle<4,T, Q, 1,2,0,1> E1 ## E2 ## E0 ## E1; }; \ + struct { detail::_swizzle<4,T, Q, 1,2,0,2> E1 ## E2 ## E0 ## E2; }; \ + struct { detail::_swizzle<4,T, Q, 1,2,1,0> E1 ## E2 ## E1 ## E0; }; \ + struct { detail::_swizzle<4,T, Q, 1,2,1,1> E1 ## E2 ## E1 ## E1; }; \ + struct { detail::_swizzle<4,T, Q, 1,2,1,2> E1 ## E2 ## E1 ## E2; }; \ + struct { detail::_swizzle<4,T, Q, 1,2,2,0> E1 ## E2 ## E2 ## E0; }; \ + struct { detail::_swizzle<4,T, Q, 1,2,2,1> E1 ## E2 ## E2 ## E1; }; \ + struct { detail::_swizzle<4,T, Q, 1,2,2,2> E1 ## E2 ## E2 ## E2; }; \ + struct { detail::_swizzle<4,T, Q, 2,0,0,0> E2 ## E0 ## E0 ## E0; }; \ + struct { detail::_swizzle<4,T, Q, 2,0,0,1> E2 ## E0 ## E0 ## E1; }; \ + struct { detail::_swizzle<4,T, Q, 2,0,0,2> E2 ## E0 ## E0 ## E2; }; \ + struct { detail::_swizzle<4,T, Q, 2,0,1,0> E2 ## E0 ## E1 ## E0; }; \ + struct { detail::_swizzle<4,T, Q, 2,0,1,1> E2 ## E0 ## E1 ## E1; }; \ + struct { detail::_swizzle<4,T, Q, 2,0,1,2> E2 ## E0 ## E1 ## E2; }; \ + struct { detail::_swizzle<4,T, Q, 2,0,2,0> E2 ## E0 ## E2 ## E0; }; \ + struct { detail::_swizzle<4,T, Q, 2,0,2,1> E2 ## E0 ## E2 ## E1; }; \ + struct { detail::_swizzle<4,T, Q, 2,0,2,2> E2 ## E0 ## E2 ## E2; }; \ + struct { detail::_swizzle<4,T, Q, 2,1,0,0> E2 ## E1 ## E0 ## E0; }; \ + struct { detail::_swizzle<4,T, Q, 2,1,0,1> E2 ## E1 ## E0 ## E1; }; \ + struct { detail::_swizzle<4,T, Q, 2,1,0,2> E2 ## E1 ## E0 ## E2; }; \ + struct { detail::_swizzle<4,T, Q, 2,1,1,0> E2 ## E1 ## E1 ## E0; }; \ + struct { detail::_swizzle<4,T, Q, 2,1,1,1> E2 ## E1 ## E1 ## E1; }; \ + struct { detail::_swizzle<4,T, Q, 2,1,1,2> E2 ## E1 ## E1 ## E2; }; \ + struct { detail::_swizzle<4,T, Q, 2,1,2,0> E2 ## E1 ## E2 ## E0; }; \ + struct { detail::_swizzle<4,T, Q, 2,1,2,1> E2 ## E1 ## E2 ## E1; }; \ + struct { detail::_swizzle<4,T, Q, 2,1,2,2> E2 ## E1 ## E2 ## E2; }; \ + struct { detail::_swizzle<4,T, Q, 2,2,0,0> E2 ## E2 ## E0 ## E0; }; \ + struct { detail::_swizzle<4,T, Q, 2,2,0,1> E2 ## E2 ## E0 ## E1; }; \ + struct { detail::_swizzle<4,T, Q, 2,2,0,2> E2 ## E2 ## E0 ## E2; }; \ + struct { detail::_swizzle<4,T, Q, 2,2,1,0> E2 ## E2 ## E1 ## E0; }; \ + struct { detail::_swizzle<4,T, Q, 2,2,1,1> E2 ## E2 ## E1 ## E1; }; \ + struct { detail::_swizzle<4,T, Q, 2,2,1,2> E2 ## E2 ## E1 ## E2; }; \ + struct { detail::_swizzle<4,T, Q, 2,2,2,0> E2 ## E2 ## E2 ## E0; }; \ + struct { detail::_swizzle<4,T, Q, 2,2,2,1> E2 ## E2 ## E2 ## E1; }; \ + struct { detail::_swizzle<4,T, Q, 2,2,2,2> E2 ## E2 ## E2 ## E2; }; + +#define GLM_SWIZZLE4_2_MEMBERS(T, Q, E0,E1,E2,E3) \ + struct { detail::_swizzle<2,T, Q, 0,0,-1,-2> E0 ## E0; }; \ + struct { detail::_swizzle<2,T, Q, 0,1,-1,-2> E0 ## E1; }; \ + struct { detail::_swizzle<2,T, Q, 0,2,-1,-2> E0 ## E2; }; \ + struct { detail::_swizzle<2,T, Q, 0,3,-1,-2> E0 ## E3; }; \ + struct { detail::_swizzle<2,T, Q, 1,0,-1,-2> E1 ## E0; }; \ + struct { detail::_swizzle<2,T, Q, 1,1,-1,-2> E1 ## E1; }; \ + struct { detail::_swizzle<2,T, Q, 1,2,-1,-2> E1 ## E2; }; \ + struct { detail::_swizzle<2,T, Q, 1,3,-1,-2> E1 ## E3; }; \ + struct { detail::_swizzle<2,T, Q, 2,0,-1,-2> E2 ## E0; }; \ + struct { detail::_swizzle<2,T, Q, 2,1,-1,-2> E2 ## E1; }; \ + struct { detail::_swizzle<2,T, Q, 2,2,-1,-2> E2 ## E2; }; \ + struct { detail::_swizzle<2,T, Q, 2,3,-1,-2> E2 ## E3; }; \ + struct { detail::_swizzle<2,T, Q, 3,0,-1,-2> E3 ## E0; }; \ + struct { detail::_swizzle<2,T, Q, 3,1,-1,-2> E3 ## E1; }; \ + struct { detail::_swizzle<2,T, Q, 3,2,-1,-2> E3 ## E2; }; \ + struct { detail::_swizzle<2,T, Q, 3,3,-1,-2> E3 ## E3; }; + +#define GLM_SWIZZLE4_3_MEMBERS(T, Q, E0,E1,E2,E3) \ + struct { detail::_swizzle<3, T, Q, 0,0,0,-1> E0 ## E0 ## E0; }; \ + struct { detail::_swizzle<3, T, Q, 0,0,1,-1> E0 ## E0 ## E1; }; \ + struct { detail::_swizzle<3, T, Q, 0,0,2,-1> E0 ## E0 ## E2; }; \ + struct { detail::_swizzle<3, T, Q, 0,0,3,-1> E0 ## E0 ## E3; }; \ + struct { detail::_swizzle<3, T, Q, 0,1,0,-1> E0 ## E1 ## E0; }; \ + struct { detail::_swizzle<3, T, Q, 0,1,1,-1> E0 ## E1 ## E1; }; \ + struct { detail::_swizzle<3, T, Q, 0,1,2,-1> E0 ## E1 ## E2; }; \ + struct { detail::_swizzle<3, T, Q, 0,1,3,-1> E0 ## E1 ## E3; }; \ + struct { detail::_swizzle<3, T, Q, 0,2,0,-1> E0 ## E2 ## E0; }; \ + struct { detail::_swizzle<3, T, Q, 0,2,1,-1> E0 ## E2 ## E1; }; \ + struct { detail::_swizzle<3, T, Q, 0,2,2,-1> E0 ## E2 ## E2; }; \ + struct { detail::_swizzle<3, T, Q, 0,2,3,-1> E0 ## E2 ## E3; }; \ + struct { detail::_swizzle<3, T, Q, 0,3,0,-1> E0 ## E3 ## E0; }; \ + struct { detail::_swizzle<3, T, Q, 0,3,1,-1> E0 ## E3 ## E1; }; \ + struct { detail::_swizzle<3, T, Q, 0,3,2,-1> E0 ## E3 ## E2; }; \ + struct { detail::_swizzle<3, T, Q, 0,3,3,-1> E0 ## E3 ## E3; }; \ + struct { detail::_swizzle<3, T, Q, 1,0,0,-1> E1 ## E0 ## E0; }; \ + struct { detail::_swizzle<3, T, Q, 1,0,1,-1> E1 ## E0 ## E1; }; \ + struct { detail::_swizzle<3, T, Q, 1,0,2,-1> E1 ## E0 ## E2; }; \ + struct { detail::_swizzle<3, T, Q, 1,0,3,-1> E1 ## E0 ## E3; }; \ + struct { detail::_swizzle<3, T, Q, 1,1,0,-1> E1 ## E1 ## E0; }; \ + struct { detail::_swizzle<3, T, Q, 1,1,1,-1> E1 ## E1 ## E1; }; \ + struct { detail::_swizzle<3, T, Q, 1,1,2,-1> E1 ## E1 ## E2; }; \ + struct { detail::_swizzle<3, T, Q, 1,1,3,-1> E1 ## E1 ## E3; }; \ + struct { detail::_swizzle<3, T, Q, 1,2,0,-1> E1 ## E2 ## E0; }; \ + struct { detail::_swizzle<3, T, Q, 1,2,1,-1> E1 ## E2 ## E1; }; \ + struct { detail::_swizzle<3, T, Q, 1,2,2,-1> E1 ## E2 ## E2; }; \ + struct { detail::_swizzle<3, T, Q, 1,2,3,-1> E1 ## E2 ## E3; }; \ + struct { detail::_swizzle<3, T, Q, 1,3,0,-1> E1 ## E3 ## E0; }; \ + struct { detail::_swizzle<3, T, Q, 1,3,1,-1> E1 ## E3 ## E1; }; \ + struct { detail::_swizzle<3, T, Q, 1,3,2,-1> E1 ## E3 ## E2; }; \ + struct { detail::_swizzle<3, T, Q, 1,3,3,-1> E1 ## E3 ## E3; }; \ + struct { detail::_swizzle<3, T, Q, 2,0,0,-1> E2 ## E0 ## E0; }; \ + struct { detail::_swizzle<3, T, Q, 2,0,1,-1> E2 ## E0 ## E1; }; \ + struct { detail::_swizzle<3, T, Q, 2,0,2,-1> E2 ## E0 ## E2; }; \ + struct { detail::_swizzle<3, T, Q, 2,0,3,-1> E2 ## E0 ## E3; }; \ + struct { detail::_swizzle<3, T, Q, 2,1,0,-1> E2 ## E1 ## E0; }; \ + struct { detail::_swizzle<3, T, Q, 2,1,1,-1> E2 ## E1 ## E1; }; \ + struct { detail::_swizzle<3, T, Q, 2,1,2,-1> E2 ## E1 ## E2; }; \ + struct { detail::_swizzle<3, T, Q, 2,1,3,-1> E2 ## E1 ## E3; }; \ + struct { detail::_swizzle<3, T, Q, 2,2,0,-1> E2 ## E2 ## E0; }; \ + struct { detail::_swizzle<3, T, Q, 2,2,1,-1> E2 ## E2 ## E1; }; \ + struct { detail::_swizzle<3, T, Q, 2,2,2,-1> E2 ## E2 ## E2; }; \ + struct { detail::_swizzle<3, T, Q, 2,2,3,-1> E2 ## E2 ## E3; }; \ + struct { detail::_swizzle<3, T, Q, 2,3,0,-1> E2 ## E3 ## E0; }; \ + struct { detail::_swizzle<3, T, Q, 2,3,1,-1> E2 ## E3 ## E1; }; \ + struct { detail::_swizzle<3, T, Q, 2,3,2,-1> E2 ## E3 ## E2; }; \ + struct { detail::_swizzle<3, T, Q, 2,3,3,-1> E2 ## E3 ## E3; }; \ + struct { detail::_swizzle<3, T, Q, 3,0,0,-1> E3 ## E0 ## E0; }; \ + struct { detail::_swizzle<3, T, Q, 3,0,1,-1> E3 ## E0 ## E1; }; \ + struct { detail::_swizzle<3, T, Q, 3,0,2,-1> E3 ## E0 ## E2; }; \ + struct { detail::_swizzle<3, T, Q, 3,0,3,-1> E3 ## E0 ## E3; }; \ + struct { detail::_swizzle<3, T, Q, 3,1,0,-1> E3 ## E1 ## E0; }; \ + struct { detail::_swizzle<3, T, Q, 3,1,1,-1> E3 ## E1 ## E1; }; \ + struct { detail::_swizzle<3, T, Q, 3,1,2,-1> E3 ## E1 ## E2; }; \ + struct { detail::_swizzle<3, T, Q, 3,1,3,-1> E3 ## E1 ## E3; }; \ + struct { detail::_swizzle<3, T, Q, 3,2,0,-1> E3 ## E2 ## E0; }; \ + struct { detail::_swizzle<3, T, Q, 3,2,1,-1> E3 ## E2 ## E1; }; \ + struct { detail::_swizzle<3, T, Q, 3,2,2,-1> E3 ## E2 ## E2; }; \ + struct { detail::_swizzle<3, T, Q, 3,2,3,-1> E3 ## E2 ## E3; }; \ + struct { detail::_swizzle<3, T, Q, 3,3,0,-1> E3 ## E3 ## E0; }; \ + struct { detail::_swizzle<3, T, Q, 3,3,1,-1> E3 ## E3 ## E1; }; \ + struct { detail::_swizzle<3, T, Q, 3,3,2,-1> E3 ## E3 ## E2; }; \ + struct { detail::_swizzle<3, T, Q, 3,3,3,-1> E3 ## E3 ## E3; }; + +#define GLM_SWIZZLE4_4_MEMBERS(T, Q, E0,E1,E2,E3) \ + struct { detail::_swizzle<4, T, Q, 0,0,0,0> E0 ## E0 ## E0 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 0,0,0,1> E0 ## E0 ## E0 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 0,0,0,2> E0 ## E0 ## E0 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 0,0,0,3> E0 ## E0 ## E0 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 0,0,1,0> E0 ## E0 ## E1 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 0,0,1,1> E0 ## E0 ## E1 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 0,0,1,2> E0 ## E0 ## E1 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 0,0,1,3> E0 ## E0 ## E1 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 0,0,2,0> E0 ## E0 ## E2 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 0,0,2,1> E0 ## E0 ## E2 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 0,0,2,2> E0 ## E0 ## E2 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 0,0,2,3> E0 ## E0 ## E2 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 0,0,3,0> E0 ## E0 ## E3 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 0,0,3,1> E0 ## E0 ## E3 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 0,0,3,2> E0 ## E0 ## E3 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 0,0,3,3> E0 ## E0 ## E3 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 0,1,0,0> E0 ## E1 ## E0 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 0,1,0,1> E0 ## E1 ## E0 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 0,1,0,2> E0 ## E1 ## E0 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 0,1,0,3> E0 ## E1 ## E0 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 0,1,1,0> E0 ## E1 ## E1 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 0,1,1,1> E0 ## E1 ## E1 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 0,1,1,2> E0 ## E1 ## E1 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 0,1,1,3> E0 ## E1 ## E1 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 0,1,2,0> E0 ## E1 ## E2 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 0,1,2,1> E0 ## E1 ## E2 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 0,1,2,2> E0 ## E1 ## E2 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 0,1,2,3> E0 ## E1 ## E2 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 0,1,3,0> E0 ## E1 ## E3 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 0,1,3,1> E0 ## E1 ## E3 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 0,1,3,2> E0 ## E1 ## E3 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 0,1,3,3> E0 ## E1 ## E3 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 0,2,0,0> E0 ## E2 ## E0 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 0,2,0,1> E0 ## E2 ## E0 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 0,2,0,2> E0 ## E2 ## E0 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 0,2,0,3> E0 ## E2 ## E0 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 0,2,1,0> E0 ## E2 ## E1 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 0,2,1,1> E0 ## E2 ## E1 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 0,2,1,2> E0 ## E2 ## E1 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 0,2,1,3> E0 ## E2 ## E1 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 0,2,2,0> E0 ## E2 ## E2 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 0,2,2,1> E0 ## E2 ## E2 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 0,2,2,2> E0 ## E2 ## E2 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 0,2,2,3> E0 ## E2 ## E2 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 0,2,3,0> E0 ## E2 ## E3 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 0,2,3,1> E0 ## E2 ## E3 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 0,2,3,2> E0 ## E2 ## E3 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 0,2,3,3> E0 ## E2 ## E3 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 0,3,0,0> E0 ## E3 ## E0 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 0,3,0,1> E0 ## E3 ## E0 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 0,3,0,2> E0 ## E3 ## E0 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 0,3,0,3> E0 ## E3 ## E0 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 0,3,1,0> E0 ## E3 ## E1 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 0,3,1,1> E0 ## E3 ## E1 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 0,3,1,2> E0 ## E3 ## E1 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 0,3,1,3> E0 ## E3 ## E1 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 0,3,2,0> E0 ## E3 ## E2 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 0,3,2,1> E0 ## E3 ## E2 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 0,3,2,2> E0 ## E3 ## E2 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 0,3,2,3> E0 ## E3 ## E2 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 0,3,3,0> E0 ## E3 ## E3 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 0,3,3,1> E0 ## E3 ## E3 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 0,3,3,2> E0 ## E3 ## E3 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 0,3,3,3> E0 ## E3 ## E3 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 1,0,0,0> E1 ## E0 ## E0 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 1,0,0,1> E1 ## E0 ## E0 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 1,0,0,2> E1 ## E0 ## E0 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 1,0,0,3> E1 ## E0 ## E0 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 1,0,1,0> E1 ## E0 ## E1 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 1,0,1,1> E1 ## E0 ## E1 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 1,0,1,2> E1 ## E0 ## E1 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 1,0,1,3> E1 ## E0 ## E1 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 1,0,2,0> E1 ## E0 ## E2 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 1,0,2,1> E1 ## E0 ## E2 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 1,0,2,2> E1 ## E0 ## E2 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 1,0,2,3> E1 ## E0 ## E2 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 1,0,3,0> E1 ## E0 ## E3 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 1,0,3,1> E1 ## E0 ## E3 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 1,0,3,2> E1 ## E0 ## E3 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 1,0,3,3> E1 ## E0 ## E3 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 1,1,0,0> E1 ## E1 ## E0 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 1,1,0,1> E1 ## E1 ## E0 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 1,1,0,2> E1 ## E1 ## E0 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 1,1,0,3> E1 ## E1 ## E0 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 1,1,1,0> E1 ## E1 ## E1 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 1,1,1,1> E1 ## E1 ## E1 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 1,1,1,2> E1 ## E1 ## E1 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 1,1,1,3> E1 ## E1 ## E1 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 1,1,2,0> E1 ## E1 ## E2 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 1,1,2,1> E1 ## E1 ## E2 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 1,1,2,2> E1 ## E1 ## E2 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 1,1,2,3> E1 ## E1 ## E2 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 1,1,3,0> E1 ## E1 ## E3 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 1,1,3,1> E1 ## E1 ## E3 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 1,1,3,2> E1 ## E1 ## E3 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 1,1,3,3> E1 ## E1 ## E3 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 1,2,0,0> E1 ## E2 ## E0 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 1,2,0,1> E1 ## E2 ## E0 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 1,2,0,2> E1 ## E2 ## E0 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 1,2,0,3> E1 ## E2 ## E0 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 1,2,1,0> E1 ## E2 ## E1 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 1,2,1,1> E1 ## E2 ## E1 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 1,2,1,2> E1 ## E2 ## E1 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 1,2,1,3> E1 ## E2 ## E1 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 1,2,2,0> E1 ## E2 ## E2 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 1,2,2,1> E1 ## E2 ## E2 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 1,2,2,2> E1 ## E2 ## E2 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 1,2,2,3> E1 ## E2 ## E2 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 1,2,3,0> E1 ## E2 ## E3 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 1,2,3,1> E1 ## E2 ## E3 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 1,2,3,2> E1 ## E2 ## E3 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 1,2,3,3> E1 ## E2 ## E3 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 1,3,0,0> E1 ## E3 ## E0 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 1,3,0,1> E1 ## E3 ## E0 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 1,3,0,2> E1 ## E3 ## E0 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 1,3,0,3> E1 ## E3 ## E0 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 1,3,1,0> E1 ## E3 ## E1 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 1,3,1,1> E1 ## E3 ## E1 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 1,3,1,2> E1 ## E3 ## E1 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 1,3,1,3> E1 ## E3 ## E1 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 1,3,2,0> E1 ## E3 ## E2 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 1,3,2,1> E1 ## E3 ## E2 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 1,3,2,2> E1 ## E3 ## E2 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 1,3,2,3> E1 ## E3 ## E2 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 1,3,3,0> E1 ## E3 ## E3 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 1,3,3,1> E1 ## E3 ## E3 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 1,3,3,2> E1 ## E3 ## E3 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 1,3,3,3> E1 ## E3 ## E3 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 2,0,0,0> E2 ## E0 ## E0 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 2,0,0,1> E2 ## E0 ## E0 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 2,0,0,2> E2 ## E0 ## E0 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 2,0,0,3> E2 ## E0 ## E0 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 2,0,1,0> E2 ## E0 ## E1 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 2,0,1,1> E2 ## E0 ## E1 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 2,0,1,2> E2 ## E0 ## E1 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 2,0,1,3> E2 ## E0 ## E1 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 2,0,2,0> E2 ## E0 ## E2 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 2,0,2,1> E2 ## E0 ## E2 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 2,0,2,2> E2 ## E0 ## E2 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 2,0,2,3> E2 ## E0 ## E2 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 2,0,3,0> E2 ## E0 ## E3 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 2,0,3,1> E2 ## E0 ## E3 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 2,0,3,2> E2 ## E0 ## E3 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 2,0,3,3> E2 ## E0 ## E3 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 2,1,0,0> E2 ## E1 ## E0 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 2,1,0,1> E2 ## E1 ## E0 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 2,1,0,2> E2 ## E1 ## E0 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 2,1,0,3> E2 ## E1 ## E0 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 2,1,1,0> E2 ## E1 ## E1 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 2,1,1,1> E2 ## E1 ## E1 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 2,1,1,2> E2 ## E1 ## E1 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 2,1,1,3> E2 ## E1 ## E1 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 2,1,2,0> E2 ## E1 ## E2 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 2,1,2,1> E2 ## E1 ## E2 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 2,1,2,2> E2 ## E1 ## E2 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 2,1,2,3> E2 ## E1 ## E2 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 2,1,3,0> E2 ## E1 ## E3 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 2,1,3,1> E2 ## E1 ## E3 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 2,1,3,2> E2 ## E1 ## E3 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 2,1,3,3> E2 ## E1 ## E3 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 2,2,0,0> E2 ## E2 ## E0 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 2,2,0,1> E2 ## E2 ## E0 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 2,2,0,2> E2 ## E2 ## E0 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 2,2,0,3> E2 ## E2 ## E0 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 2,2,1,0> E2 ## E2 ## E1 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 2,2,1,1> E2 ## E2 ## E1 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 2,2,1,2> E2 ## E2 ## E1 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 2,2,1,3> E2 ## E2 ## E1 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 2,2,2,0> E2 ## E2 ## E2 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 2,2,2,1> E2 ## E2 ## E2 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 2,2,2,2> E2 ## E2 ## E2 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 2,2,2,3> E2 ## E2 ## E2 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 2,2,3,0> E2 ## E2 ## E3 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 2,2,3,1> E2 ## E2 ## E3 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 2,2,3,2> E2 ## E2 ## E3 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 2,2,3,3> E2 ## E2 ## E3 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 2,3,0,0> E2 ## E3 ## E0 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 2,3,0,1> E2 ## E3 ## E0 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 2,3,0,2> E2 ## E3 ## E0 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 2,3,0,3> E2 ## E3 ## E0 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 2,3,1,0> E2 ## E3 ## E1 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 2,3,1,1> E2 ## E3 ## E1 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 2,3,1,2> E2 ## E3 ## E1 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 2,3,1,3> E2 ## E3 ## E1 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 2,3,2,0> E2 ## E3 ## E2 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 2,3,2,1> E2 ## E3 ## E2 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 2,3,2,2> E2 ## E3 ## E2 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 2,3,2,3> E2 ## E3 ## E2 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 2,3,3,0> E2 ## E3 ## E3 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 2,3,3,1> E2 ## E3 ## E3 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 2,3,3,2> E2 ## E3 ## E3 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 2,3,3,3> E2 ## E3 ## E3 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 3,0,0,0> E3 ## E0 ## E0 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 3,0,0,1> E3 ## E0 ## E0 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 3,0,0,2> E3 ## E0 ## E0 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 3,0,0,3> E3 ## E0 ## E0 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 3,0,1,0> E3 ## E0 ## E1 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 3,0,1,1> E3 ## E0 ## E1 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 3,0,1,2> E3 ## E0 ## E1 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 3,0,1,3> E3 ## E0 ## E1 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 3,0,2,0> E3 ## E0 ## E2 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 3,0,2,1> E3 ## E0 ## E2 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 3,0,2,2> E3 ## E0 ## E2 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 3,0,2,3> E3 ## E0 ## E2 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 3,0,3,0> E3 ## E0 ## E3 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 3,0,3,1> E3 ## E0 ## E3 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 3,0,3,2> E3 ## E0 ## E3 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 3,0,3,3> E3 ## E0 ## E3 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 3,1,0,0> E3 ## E1 ## E0 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 3,1,0,1> E3 ## E1 ## E0 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 3,1,0,2> E3 ## E1 ## E0 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 3,1,0,3> E3 ## E1 ## E0 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 3,1,1,0> E3 ## E1 ## E1 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 3,1,1,1> E3 ## E1 ## E1 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 3,1,1,2> E3 ## E1 ## E1 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 3,1,1,3> E3 ## E1 ## E1 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 3,1,2,0> E3 ## E1 ## E2 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 3,1,2,1> E3 ## E1 ## E2 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 3,1,2,2> E3 ## E1 ## E2 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 3,1,2,3> E3 ## E1 ## E2 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 3,1,3,0> E3 ## E1 ## E3 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 3,1,3,1> E3 ## E1 ## E3 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 3,1,3,2> E3 ## E1 ## E3 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 3,1,3,3> E3 ## E1 ## E3 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 3,2,0,0> E3 ## E2 ## E0 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 3,2,0,1> E3 ## E2 ## E0 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 3,2,0,2> E3 ## E2 ## E0 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 3,2,0,3> E3 ## E2 ## E0 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 3,2,1,0> E3 ## E2 ## E1 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 3,2,1,1> E3 ## E2 ## E1 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 3,2,1,2> E3 ## E2 ## E1 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 3,2,1,3> E3 ## E2 ## E1 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 3,2,2,0> E3 ## E2 ## E2 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 3,2,2,1> E3 ## E2 ## E2 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 3,2,2,2> E3 ## E2 ## E2 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 3,2,2,3> E3 ## E2 ## E2 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 3,2,3,0> E3 ## E2 ## E3 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 3,2,3,1> E3 ## E2 ## E3 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 3,2,3,2> E3 ## E2 ## E3 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 3,2,3,3> E3 ## E2 ## E3 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 3,3,0,0> E3 ## E3 ## E0 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 3,3,0,1> E3 ## E3 ## E0 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 3,3,0,2> E3 ## E3 ## E0 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 3,3,0,3> E3 ## E3 ## E0 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 3,3,1,0> E3 ## E3 ## E1 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 3,3,1,1> E3 ## E3 ## E1 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 3,3,1,2> E3 ## E3 ## E1 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 3,3,1,3> E3 ## E3 ## E1 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 3,3,2,0> E3 ## E3 ## E2 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 3,3,2,1> E3 ## E3 ## E2 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 3,3,2,2> E3 ## E3 ## E2 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 3,3,2,3> E3 ## E3 ## E2 ## E3; }; \ + struct { detail::_swizzle<4, T, Q, 3,3,3,0> E3 ## E3 ## E3 ## E0; }; \ + struct { detail::_swizzle<4, T, Q, 3,3,3,1> E3 ## E3 ## E3 ## E1; }; \ + struct { detail::_swizzle<4, T, Q, 3,3,3,2> E3 ## E3 ## E3 ## E2; }; \ + struct { detail::_swizzle<4, T, Q, 3,3,3,3> E3 ## E3 ## E3 ## E3; }; diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/_swizzle_func.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/_swizzle_func.hpp new file mode 100644 index 0000000000000000000000000000000000000000..f179a23203674016a245f61bb7c654dc7ac1d3f3 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/_swizzle_func.hpp @@ -0,0 +1,682 @@ +#pragma once + +#define GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, CONST, A, B) \ + vec<2, T, Q> A ## B() CONST \ + { \ + return vec<2, T, Q>(this->A, this->B); \ + } + +#define GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, CONST, A, B, C) \ + vec<3, T, Q> A ## B ## C() CONST \ + { \ + return vec<3, T, Q>(this->A, this->B, this->C); \ + } + +#define GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, CONST, A, B, C, D) \ + vec<4, T, Q> A ## B ## C ## D() CONST \ + { \ + return vec<4, T, Q>(this->A, this->B, this->C, this->D); \ + } + +#define GLM_SWIZZLE_GEN_VEC2_ENTRY_DEF(T, P, L, CONST, A, B) \ + template \ + vec vec::A ## B() CONST \ + { \ + return vec<2, T, Q>(this->A, this->B); \ + } + +#define GLM_SWIZZLE_GEN_VEC3_ENTRY_DEF(T, P, L, CONST, A, B, C) \ + template \ + vec<3, T, Q> vec::A ## B ## C() CONST \ + { \ + return vec<3, T, Q>(this->A, this->B, this->C); \ + } + +#define GLM_SWIZZLE_GEN_VEC4_ENTRY_DEF(T, P, L, CONST, A, B, C, D) \ + template \ + vec<4, T, Q> vec::A ## B ## C ## D() CONST \ + { \ + return vec<4, T, Q>(this->A, this->B, this->C, this->D); \ + } + +#define GLM_MUTABLE + +#define GLM_SWIZZLE_GEN_REF2_FROM_VEC2_SWIZZLE(T, P, A, B) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, 2, GLM_MUTABLE, A, B) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, 2, GLM_MUTABLE, B, A) + +#define GLM_SWIZZLE_GEN_REF_FROM_VEC2(T, P) \ + GLM_SWIZZLE_GEN_REF2_FROM_VEC2_SWIZZLE(T, P, x, y) \ + GLM_SWIZZLE_GEN_REF2_FROM_VEC2_SWIZZLE(T, P, r, g) \ + GLM_SWIZZLE_GEN_REF2_FROM_VEC2_SWIZZLE(T, P, s, t) + +#define GLM_SWIZZLE_GEN_REF2_FROM_VEC3_SWIZZLE(T, P, A, B, C) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, GLM_MUTABLE, A, B) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, GLM_MUTABLE, A, C) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, GLM_MUTABLE, B, A) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, GLM_MUTABLE, B, C) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, GLM_MUTABLE, C, A) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, GLM_MUTABLE, C, B) + +#define GLM_SWIZZLE_GEN_REF3_FROM_VEC3_SWIZZLE(T, P, A, B, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, GLM_MUTABLE, A, B, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, GLM_MUTABLE, A, C, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, GLM_MUTABLE, B, A, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, GLM_MUTABLE, B, C, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, GLM_MUTABLE, C, A, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, GLM_MUTABLE, C, B, A) + +#define GLM_SWIZZLE_GEN_REF_FROM_VEC3_COMP(T, P, A, B, C) \ + GLM_SWIZZLE_GEN_REF3_FROM_VEC3_SWIZZLE(T, P, A, B, C) \ + GLM_SWIZZLE_GEN_REF2_FROM_VEC3_SWIZZLE(T, P, A, B, C) + +#define GLM_SWIZZLE_GEN_REF_FROM_VEC3(T, P) \ + GLM_SWIZZLE_GEN_REF_FROM_VEC3_COMP(T, P, x, y, z) \ + GLM_SWIZZLE_GEN_REF_FROM_VEC3_COMP(T, P, r, g, b) \ + GLM_SWIZZLE_GEN_REF_FROM_VEC3_COMP(T, P, s, t, p) + +#define GLM_SWIZZLE_GEN_REF2_FROM_VEC4_SWIZZLE(T, P, A, B, C, D) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, GLM_MUTABLE, A, B) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, GLM_MUTABLE, A, C) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, GLM_MUTABLE, A, D) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, GLM_MUTABLE, B, A) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, GLM_MUTABLE, B, C) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, GLM_MUTABLE, B, D) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, GLM_MUTABLE, C, A) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, GLM_MUTABLE, C, B) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, GLM_MUTABLE, C, D) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, GLM_MUTABLE, D, A) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, GLM_MUTABLE, D, B) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, GLM_MUTABLE, D, C) + +#define GLM_SWIZZLE_GEN_REF3_FROM_VEC4_SWIZZLE(T, P, A, B, C, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, , A, B, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, , A, B, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, , A, C, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, , A, C, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, , A, D, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, , A, D, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, , B, A, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, , B, A, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, , B, C, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, , B, C, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, , B, D, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, , B, D, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, , C, A, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, , C, A, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, , C, B, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, , C, B, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, , C, D, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, , C, D, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, , D, A, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, , D, A, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, , D, B, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, , D, B, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, , D, C, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, , D, C, B) + +#define GLM_SWIZZLE_GEN_REF4_FROM_VEC4_SWIZZLE(T, P, A, B, C, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, , A, C, B, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, , A, C, D, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, , A, D, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, , A, D, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, , A, B, D, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, , A, B, C, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, , B, C, A, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, , B, C, D, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, , B, D, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, , B, D, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, , B, A, D, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, , B, A, C, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, , C, B, A, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, , C, B, D, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, , C, D, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, , C, D, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, , C, A, D, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, , C, A, B, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, , D, C, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, , D, C, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, , D, A, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, , D, A, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, , D, B, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, , D, B, C, A) + +#define GLM_SWIZZLE_GEN_REF_FROM_VEC4_COMP(T, P, A, B, C, D) \ + GLM_SWIZZLE_GEN_REF2_FROM_VEC4_SWIZZLE(T, P, A, B, C, D) \ + GLM_SWIZZLE_GEN_REF3_FROM_VEC4_SWIZZLE(T, P, A, B, C, D) \ + GLM_SWIZZLE_GEN_REF4_FROM_VEC4_SWIZZLE(T, P, A, B, C, D) + +#define GLM_SWIZZLE_GEN_REF_FROM_VEC4(T, P) \ + GLM_SWIZZLE_GEN_REF_FROM_VEC4_COMP(T, P, x, y, z, w) \ + GLM_SWIZZLE_GEN_REF_FROM_VEC4_COMP(T, P, r, g, b, a) \ + GLM_SWIZZLE_GEN_REF_FROM_VEC4_COMP(T, P, s, t, p, q) + +#define GLM_SWIZZLE_GEN_VEC2_FROM_VEC2_SWIZZLE(T, P, A, B) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, A, A) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, A, B) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, B, A) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, B, B) + +#define GLM_SWIZZLE_GEN_VEC3_FROM_VEC2_SWIZZLE(T, P, A, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, A, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, A, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, B, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, B, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, A, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, A, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, B, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, B, B) + +#define GLM_SWIZZLE_GEN_VEC4_FROM_VEC2_SWIZZLE(T, P, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, B, B) + +#define GLM_SWIZZLE_GEN_VEC_FROM_VEC2_COMP(T, P, A, B) \ + GLM_SWIZZLE_GEN_VEC2_FROM_VEC2_SWIZZLE(T, P, A, B) \ + GLM_SWIZZLE_GEN_VEC3_FROM_VEC2_SWIZZLE(T, P, A, B) \ + GLM_SWIZZLE_GEN_VEC4_FROM_VEC2_SWIZZLE(T, P, A, B) + +#define GLM_SWIZZLE_GEN_VEC_FROM_VEC2(T, P) \ + GLM_SWIZZLE_GEN_VEC_FROM_VEC2_COMP(T, P, x, y) \ + GLM_SWIZZLE_GEN_VEC_FROM_VEC2_COMP(T, P, r, g) \ + GLM_SWIZZLE_GEN_VEC_FROM_VEC2_COMP(T, P, s, t) + +#define GLM_SWIZZLE_GEN_VEC2_FROM_VEC3_SWIZZLE(T, P, A, B, C) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, A, A) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, A, B) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, A, C) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, B, A) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, B, B) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, B, C) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, C, A) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, C, B) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, C, C) + +#define GLM_SWIZZLE_GEN_VEC3_FROM_VEC3_SWIZZLE(T, P, A, B, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, A, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, A, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, A, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, B, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, B, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, B, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, C, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, C, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, C, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, A, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, A, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, A, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, B, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, B, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, B, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, C, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, C, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, C, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, C, A, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, C, A, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, C, A, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, C, B, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, C, B, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, C, B, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, C, C, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, C, C, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, C, C, C) + +#define GLM_SWIZZLE_GEN_VEC4_FROM_VEC3_SWIZZLE(T, P, A, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, C, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, C, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, C, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, C, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, C, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, C, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, C, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, C, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, C, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, C, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, C, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, C, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, C, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, C, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, C, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, C, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, C, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, C, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, A, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, A, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, A, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, A, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, A, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, A, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, A, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, A, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, A, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, B, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, B, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, B, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, B, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, B, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, B, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, B, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, B, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, B, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, C, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, C, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, C, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, C, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, C, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, C, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, C, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, C, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, C, C, C) + +#define GLM_SWIZZLE_GEN_VEC_FROM_VEC3_COMP(T, P, A, B, C) \ + GLM_SWIZZLE_GEN_VEC2_FROM_VEC3_SWIZZLE(T, P, A, B, C) \ + GLM_SWIZZLE_GEN_VEC3_FROM_VEC3_SWIZZLE(T, P, A, B, C) \ + GLM_SWIZZLE_GEN_VEC4_FROM_VEC3_SWIZZLE(T, P, A, B, C) + +#define GLM_SWIZZLE_GEN_VEC_FROM_VEC3(T, P) \ + GLM_SWIZZLE_GEN_VEC_FROM_VEC3_COMP(T, P, x, y, z) \ + GLM_SWIZZLE_GEN_VEC_FROM_VEC3_COMP(T, P, r, g, b) \ + GLM_SWIZZLE_GEN_VEC_FROM_VEC3_COMP(T, P, s, t, p) + +#define GLM_SWIZZLE_GEN_VEC2_FROM_VEC4_SWIZZLE(T, P, A, B, C, D) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, A, A) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, A, B) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, A, C) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, A, D) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, B, A) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, B, B) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, B, C) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, B, D) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, C, A) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, C, B) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, C, C) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, C, D) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, D, A) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, D, B) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, D, C) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, D, D) + +#define GLM_SWIZZLE_GEN_VEC3_FROM_VEC4_SWIZZLE(T, P, A, B, C, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, A, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, A, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, A, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, A, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, B, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, B, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, B, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, B, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, C, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, C, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, C, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, C, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, D, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, D, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, D, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, D, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, A, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, A, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, A, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, A, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, B, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, B, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, B, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, B, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, C, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, C, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, C, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, C, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, D, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, D, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, D, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, D, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, C, A, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, C, A, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, C, A, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, C, A, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, C, B, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, C, B, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, C, B, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, C, B, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, C, C, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, C, C, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, C, C, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, C, C, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, C, D, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, C, D, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, C, D, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, C, D, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, D, A, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, D, A, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, D, A, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, D, A, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, D, B, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, D, B, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, D, B, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, D, B, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, D, C, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, D, C, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, D, C, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, D, C, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, D, D, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, D, D, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, D, D, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, D, D, D) + +#define GLM_SWIZZLE_GEN_VEC4_FROM_VEC4_SWIZZLE(T, P, A, B, C, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, A, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, B, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, C, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, D, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, D, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, D, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, D, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, A, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, B, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, C, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, D, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, D, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, D, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, D, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, C, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, C, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, C, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, C, A, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, C, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, C, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, C, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, C, B, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, C, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, C, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, C, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, C, C, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, C, D, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, C, D, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, C, D, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, C, D, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, D, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, D, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, D, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, D, A, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, D, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, D, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, D, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, D, B, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, D, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, D, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, D, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, D, C, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, D, D, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, D, D, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, D, D, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, D, D, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, A, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, B, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, C, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, D, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, D, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, D, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, D, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, A, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, B, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, C, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, D, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, D, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, D, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, D, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, C, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, C, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, C, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, C, A, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, C, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, C, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, C, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, C, B, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, C, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, C, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, C, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, C, C, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, C, D, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, C, D, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, C, D, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, C, D, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, D, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, D, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, D, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, D, A, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, D, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, D, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, D, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, D, B, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, D, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, D, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, D, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, D, C, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, D, D, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, D, D, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, D, D, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, D, D, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, A, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, A, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, A, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, A, A, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, A, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, A, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, A, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, A, B, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, A, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, A, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, A, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, A, C, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, A, D, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, A, D, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, A, D, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, A, D, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, B, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, B, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, B, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, B, A, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, B, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, B, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, B, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, B, B, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, B, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, B, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, B, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, B, C, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, B, D, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, B, D, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, B, D, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, B, D, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, C, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, C, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, C, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, C, A, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, C, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, C, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, C, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, C, B, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, C, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, C, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, C, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, C, C, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, C, D, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, C, D, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, C, D, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, C, D, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, D, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, D, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, D, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, D, A, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, D, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, D, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, D, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, D, B, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, D, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, D, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, D, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, D, C, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, D, D, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, D, D, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, D, D, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, D, D, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, A, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, A, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, A, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, A, A, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, A, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, A, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, A, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, A, B, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, A, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, A, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, A, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, A, C, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, A, D, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, A, D, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, A, D, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, A, D, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, B, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, B, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, B, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, B, A, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, B, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, B, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, B, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, B, B, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, B, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, B, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, B, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, B, C, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, B, D, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, B, D, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, B, D, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, B, D, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, C, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, C, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, C, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, C, A, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, C, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, C, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, C, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, C, B, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, C, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, C, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, C, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, C, C, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, C, D, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, C, D, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, C, D, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, C, D, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, D, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, D, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, D, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, D, A, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, D, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, D, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, D, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, D, B, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, D, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, D, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, D, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, D, C, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, D, D, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, D, D, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, D, D, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, D, D, D) + +#define GLM_SWIZZLE_GEN_VEC_FROM_VEC4_COMP(T, P, A, B, C, D) \ + GLM_SWIZZLE_GEN_VEC2_FROM_VEC4_SWIZZLE(T, P, A, B, C, D) \ + GLM_SWIZZLE_GEN_VEC3_FROM_VEC4_SWIZZLE(T, P, A, B, C, D) \ + GLM_SWIZZLE_GEN_VEC4_FROM_VEC4_SWIZZLE(T, P, A, B, C, D) + +#define GLM_SWIZZLE_GEN_VEC_FROM_VEC4(T, P) \ + GLM_SWIZZLE_GEN_VEC_FROM_VEC4_COMP(T, P, x, y, z, w) \ + GLM_SWIZZLE_GEN_VEC_FROM_VEC4_COMP(T, P, r, g, b, a) \ + GLM_SWIZZLE_GEN_VEC_FROM_VEC4_COMP(T, P, s, t, p, q) + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/_vectorize.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/_vectorize.hpp new file mode 100644 index 0000000000000000000000000000000000000000..f7a0cc17533ea0f9a947aa41a14341a2c8cb11c4 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/_vectorize.hpp @@ -0,0 +1,162 @@ +#pragma once + +namespace glm{ +namespace detail +{ + template class vec, length_t L, typename R, typename T, qualifier Q> + struct functor1{}; + + template class vec, typename R, typename T, qualifier Q> + struct functor1 + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec<1, R, Q> call(R (*Func) (T x), vec<1, T, Q> const& v) + { + return vec<1, R, Q>(Func(v.x)); + } + }; + + template class vec, typename R, typename T, qualifier Q> + struct functor1 + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec<2, R, Q> call(R (*Func) (T x), vec<2, T, Q> const& v) + { + return vec<2, R, Q>(Func(v.x), Func(v.y)); + } + }; + + template class vec, typename R, typename T, qualifier Q> + struct functor1 + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec<3, R, Q> call(R (*Func) (T x), vec<3, T, Q> const& v) + { + return vec<3, R, Q>(Func(v.x), Func(v.y), Func(v.z)); + } + }; + + template class vec, typename R, typename T, qualifier Q> + struct functor1 + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec<4, R, Q> call(R (*Func) (T x), vec<4, T, Q> const& v) + { + return vec<4, R, Q>(Func(v.x), Func(v.y), Func(v.z), Func(v.w)); + } + }; + + template class vec, length_t L, typename T, qualifier Q> + struct functor2{}; + + template class vec, typename T, qualifier Q> + struct functor2 + { + GLM_FUNC_QUALIFIER static vec<1, T, Q> call(T (*Func) (T x, T y), vec<1, T, Q> const& a, vec<1, T, Q> const& b) + { + return vec<1, T, Q>(Func(a.x, b.x)); + } + }; + + template class vec, typename T, qualifier Q> + struct functor2 + { + GLM_FUNC_QUALIFIER static vec<2, T, Q> call(T (*Func) (T x, T y), vec<2, T, Q> const& a, vec<2, T, Q> const& b) + { + return vec<2, T, Q>(Func(a.x, b.x), Func(a.y, b.y)); + } + }; + + template class vec, typename T, qualifier Q> + struct functor2 + { + GLM_FUNC_QUALIFIER static vec<3, T, Q> call(T (*Func) (T x, T y), vec<3, T, Q> const& a, vec<3, T, Q> const& b) + { + return vec<3, T, Q>(Func(a.x, b.x), Func(a.y, b.y), Func(a.z, b.z)); + } + }; + + template class vec, typename T, qualifier Q> + struct functor2 + { + GLM_FUNC_QUALIFIER static vec<4, T, Q> call(T (*Func) (T x, T y), vec<4, T, Q> const& a, vec<4, T, Q> const& b) + { + return vec<4, T, Q>(Func(a.x, b.x), Func(a.y, b.y), Func(a.z, b.z), Func(a.w, b.w)); + } + }; + + template class vec, length_t L, typename T, qualifier Q> + struct functor2_vec_sca{}; + + template class vec, typename T, qualifier Q> + struct functor2_vec_sca + { + GLM_FUNC_QUALIFIER static vec<1, T, Q> call(T (*Func) (T x, T y), vec<1, T, Q> const& a, T b) + { + return vec<1, T, Q>(Func(a.x, b)); + } + }; + + template class vec, typename T, qualifier Q> + struct functor2_vec_sca + { + GLM_FUNC_QUALIFIER static vec<2, T, Q> call(T (*Func) (T x, T y), vec<2, T, Q> const& a, T b) + { + return vec<2, T, Q>(Func(a.x, b), Func(a.y, b)); + } + }; + + template class vec, typename T, qualifier Q> + struct functor2_vec_sca + { + GLM_FUNC_QUALIFIER static vec<3, T, Q> call(T (*Func) (T x, T y), vec<3, T, Q> const& a, T b) + { + return vec<3, T, Q>(Func(a.x, b), Func(a.y, b), Func(a.z, b)); + } + }; + + template class vec, typename T, qualifier Q> + struct functor2_vec_sca + { + GLM_FUNC_QUALIFIER static vec<4, T, Q> call(T (*Func) (T x, T y), vec<4, T, Q> const& a, T b) + { + return vec<4, T, Q>(Func(a.x, b), Func(a.y, b), Func(a.z, b), Func(a.w, b)); + } + }; + + template + struct functor2_vec_int {}; + + template + struct functor2_vec_int<1, T, Q> + { + GLM_FUNC_QUALIFIER static vec<1, int, Q> call(int (*Func) (T x, int y), vec<1, T, Q> const& a, vec<1, int, Q> const& b) + { + return vec<1, int, Q>(Func(a.x, b.x)); + } + }; + + template + struct functor2_vec_int<2, T, Q> + { + GLM_FUNC_QUALIFIER static vec<2, int, Q> call(int (*Func) (T x, int y), vec<2, T, Q> const& a, vec<2, int, Q> const& b) + { + return vec<2, int, Q>(Func(a.x, b.x), Func(a.y, b.y)); + } + }; + + template + struct functor2_vec_int<3, T, Q> + { + GLM_FUNC_QUALIFIER static vec<3, int, Q> call(int (*Func) (T x, int y), vec<3, T, Q> const& a, vec<3, int, Q> const& b) + { + return vec<3, int, Q>(Func(a.x, b.x), Func(a.y, b.y), Func(a.z, b.z)); + } + }; + + template + struct functor2_vec_int<4, T, Q> + { + GLM_FUNC_QUALIFIER static vec<4, int, Q> call(int (*Func) (T x, int y), vec<4, T, Q> const& a, vec<4, int, Q> const& b) + { + return vec<4, int, Q>(Func(a.x, b.x), Func(a.y, b.y), Func(a.z, b.z), Func(a.w, b.w)); + } + }; +}//namespace detail +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/compute_common.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/compute_common.hpp new file mode 100644 index 0000000000000000000000000000000000000000..5d6c2a22a937d2afc13b05ec4dcf8bc4f3580b56 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/compute_common.hpp @@ -0,0 +1,50 @@ +#pragma once + +#include "setup.hpp" +#include + +namespace glm{ +namespace detail +{ + template + struct compute_abs + {}; + + template + struct compute_abs + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static genFIType call(genFIType x) + { + GLM_STATIC_ASSERT( + std::numeric_limits::is_iec559 || std::numeric_limits::is_signed, + "'abs' only accept floating-point and integer scalar or vector inputs"); + + return x >= genFIType(0) ? x : -x; + // TODO, perf comp with: *(((int *) &x) + 1) &= 0x7fffffff; + } + }; + +#if (GLM_COMPILER & GLM_COMPILER_CUDA) || (GLM_COMPILER & GLM_COMPILER_HIP) + template<> + struct compute_abs + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static float call(float x) + { + return fabsf(x); + } + }; +#endif + + template + struct compute_abs + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static genFIType call(genFIType x) + { + GLM_STATIC_ASSERT( + (!std::numeric_limits::is_signed && std::numeric_limits::is_integer), + "'abs' only accept floating-point and integer scalar or vector inputs"); + return x; + } + }; +}//namespace detail +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/compute_vector_relational.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/compute_vector_relational.hpp new file mode 100644 index 0000000000000000000000000000000000000000..687b80b70d27ae2d666843f62b1aa6b556943506 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/compute_vector_relational.hpp @@ -0,0 +1,30 @@ +#pragma once + +//#include "compute_common.hpp" +#include "setup.hpp" +#include + +namespace glm{ +namespace detail +{ + template + struct compute_equal + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static bool call(T a, T b) + { + return a == b; + } + }; +/* + template + struct compute_equal + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static bool call(T a, T b) + { + return detail::compute_abs::is_signed>::call(b - a) <= static_cast(0); + //return std::memcmp(&a, &b, sizeof(T)) == 0; + } + }; +*/ +}//namespace detail +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/func_common.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/func_common.inl new file mode 100644 index 0000000000000000000000000000000000000000..922f1c50d72f56ea0caab0ae929544ce88b8bcf0 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/func_common.inl @@ -0,0 +1,792 @@ +/// @ref core +/// @file glm/detail/func_common.inl + +#include "../vector_relational.hpp" +#include "compute_common.hpp" +#include "type_vec1.hpp" +#include "type_vec2.hpp" +#include "type_vec3.hpp" +#include "type_vec4.hpp" +#include "_vectorize.hpp" +#include + +namespace glm +{ + // min + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType min(genType x, genType y) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer, "'min' only accept floating-point or integer inputs"); + return (y < x) ? y : x; + } + + // max + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType max(genType x, genType y) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer, "'max' only accept floating-point or integer inputs"); + + return (x < y) ? y : x; + } + + // abs + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR int abs(int x) + { + int const y = x >> (sizeof(int) * 8 - 1); + return (x ^ y) - y; + } + + // round +# if GLM_HAS_CXX11_STL + using ::std::round; +# else + template + GLM_FUNC_QUALIFIER genType round(genType x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'round' only accept floating-point inputs"); + + return x < static_cast(0) ? static_cast(int(x - static_cast(0.5))) : static_cast(int(x + static_cast(0.5))); + } +# endif + + // trunc +# if GLM_HAS_CXX11_STL + using ::std::trunc; +# else + template + GLM_FUNC_QUALIFIER genType trunc(genType x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'trunc' only accept floating-point inputs"); + + return x < static_cast(0) ? -std::floor(-x) : std::floor(x); + } +# endif + +}//namespace glm + +namespace glm{ +namespace detail +{ + template + struct compute_abs_vector + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec call(vec const& x) + { + return detail::functor1::call(abs, x); + } + }; + + template + struct compute_mix_vector + { + GLM_FUNC_QUALIFIER static vec call(vec const& x, vec const& y, vec const& a) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_GENTYPE, "'mix' only accept floating-point inputs for the interpolator a"); + + return vec(vec(x) * (static_cast(1) - a) + vec(y) * a); + } + }; + + template + struct compute_mix_vector + { + GLM_FUNC_QUALIFIER static vec call(vec const& x, vec const& y, vec const& a) + { + vec Result; + for(length_t i = 0; i < x.length(); ++i) + Result[i] = a[i] ? y[i] : x[i]; + return Result; + } + }; + + template + struct compute_mix_scalar + { + GLM_FUNC_QUALIFIER static vec call(vec const& x, vec const& y, U const& a) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_GENTYPE, "'mix' only accept floating-point inputs for the interpolator a"); + + return vec(vec(x) * (static_cast(1) - a) + vec(y) * a); + } + }; + + template + struct compute_mix_scalar + { + GLM_FUNC_QUALIFIER static vec call(vec const& x, vec const& y, bool const& a) + { + return a ? y : x; + } + }; + + template + struct compute_mix + { + GLM_FUNC_QUALIFIER static T call(T const& x, T const& y, U const& a) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_GENTYPE, "'mix' only accept floating-point inputs for the interpolator a"); + + return static_cast(static_cast(x) * (static_cast(1) - a) + static_cast(y) * a); + } + }; + + template + struct compute_mix + { + GLM_FUNC_QUALIFIER static T call(T const& x, T const& y, bool const& a) + { + return a ? y : x; + } + }; + + template + struct compute_sign + { + GLM_FUNC_QUALIFIER static vec call(vec const& x) + { + return vec(glm::lessThan(vec(0), x)) - vec(glm::lessThan(x, vec(0))); + } + }; + +# if GLM_ARCH == GLM_ARCH_X86 + template + struct compute_sign + { + GLM_FUNC_QUALIFIER static vec call(vec const& x) + { + T const Shift(static_cast(sizeof(T) * 8 - 1)); + vec const y(vec::type, Q>(-x) >> typename detail::make_unsigned::type(Shift)); + + return (x >> Shift) | y; + } + }; +# endif + + template + struct compute_floor + { + GLM_FUNC_QUALIFIER static vec call(vec const& x) + { + return detail::functor1::call(std::floor, x); + } + }; + + template + struct compute_ceil + { + GLM_FUNC_QUALIFIER static vec call(vec const& x) + { + return detail::functor1::call(std::ceil, x); + } + }; + + template + struct compute_fract + { + GLM_FUNC_QUALIFIER static vec call(vec const& x) + { + return x - floor(x); + } + }; + + template + struct compute_trunc + { + GLM_FUNC_QUALIFIER static vec call(vec const& x) + { + return detail::functor1::call(trunc, x); + } + }; + + template + struct compute_round + { + GLM_FUNC_QUALIFIER static vec call(vec const& x) + { + return detail::functor1::call(round, x); + } + }; + + template + struct compute_mod + { + GLM_FUNC_QUALIFIER static vec call(vec const& a, vec const& b) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'mod' only accept floating-point inputs. Include for integer inputs."); + return a - b * floor(a / b); + } + }; + + template + struct compute_min_vector + { + GLM_FUNC_QUALIFIER static vec call(vec const& x, vec const& y) + { + return detail::functor2::call(min, x, y); + } + }; + + template + struct compute_max_vector + { + GLM_FUNC_QUALIFIER static vec call(vec const& x, vec const& y) + { + return detail::functor2::call(max, x, y); + } + }; + + template + struct compute_clamp_vector + { + GLM_FUNC_QUALIFIER static vec call(vec const& x, vec const& minVal, vec const& maxVal) + { + return min(max(x, minVal), maxVal); + } + }; + + template + struct compute_step_vector + { + GLM_FUNC_QUALIFIER static vec call(vec const& edge, vec const& x) + { + return mix(vec(1), vec(0), glm::lessThan(x, edge)); + } + }; + + template + struct compute_smoothstep_vector + { + GLM_FUNC_QUALIFIER static vec call(vec const& edge0, vec const& edge1, vec const& x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_GENTYPE, "'smoothstep' only accept floating-point inputs"); + vec const tmp(clamp((x - edge0) / (edge1 - edge0), static_cast(0), static_cast(1))); + return tmp * tmp * (static_cast(3) - static_cast(2) * tmp); + } + }; +}//namespace detail + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genFIType abs(genFIType x) + { + return detail::compute_abs::is_signed>::call(x); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec abs(vec const& x) + { + return detail::compute_abs_vector::value>::call(x); + } + + // sign + // fast and works for any type + template + GLM_FUNC_QUALIFIER genFIType sign(genFIType x) + { + GLM_STATIC_ASSERT( + std::numeric_limits::is_iec559 || (std::numeric_limits::is_signed && std::numeric_limits::is_integer), + "'sign' only accept signed inputs"); + + return detail::compute_sign<1, genFIType, defaultp, + std::numeric_limits::is_iec559, detail::is_aligned::value>::call(vec<1, genFIType>(x)).x; + } + + template + GLM_FUNC_QUALIFIER vec sign(vec const& x) + { + GLM_STATIC_ASSERT( + std::numeric_limits::is_iec559 || (std::numeric_limits::is_signed && std::numeric_limits::is_integer), + "'sign' only accept signed inputs"); + + return detail::compute_sign::is_iec559, detail::is_aligned::value>::call(x); + } + + // floor + using ::std::floor; + template + GLM_FUNC_QUALIFIER vec floor(vec const& x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'floor' only accept floating-point inputs."); + return detail::compute_floor::value>::call(x); + } + + template + GLM_FUNC_QUALIFIER vec trunc(vec const& x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'trunc' only accept floating-point inputs"); + return detail::compute_trunc::value>::call(x); + } + + template + GLM_FUNC_QUALIFIER vec round(vec const& x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'round' only accept floating-point inputs"); + return detail::compute_round::value>::call(x); + } + +/* + // roundEven + template + GLM_FUNC_QUALIFIER genType roundEven(genType const& x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'roundEven' only accept floating-point inputs"); + + return genType(int(x + genType(int(x) % 2))); + } +*/ + + // roundEven + template + GLM_FUNC_QUALIFIER genType roundEven(genType x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'roundEven' only accept floating-point inputs"); + + int Integer = static_cast(x); + genType IntegerPart = static_cast(Integer); + genType FractionalPart = fract(x); + + if(FractionalPart > static_cast(0.5) || FractionalPart < static_cast(0.5)) + { + return round(x); + } + else if((Integer % 2) == 0) + { + return IntegerPart; + } + else if(x <= static_cast(0)) // Work around... + { + return IntegerPart - static_cast(1); + } + else + { + return IntegerPart + static_cast(1); + } + //else // Bug on MinGW 4.5.2 + //{ + // return mix(IntegerPart + genType(-1), IntegerPart + genType(1), x <= genType(0)); + //} + } + + template + GLM_FUNC_QUALIFIER vec roundEven(vec const& x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'roundEven' only accept floating-point inputs"); + return detail::functor1::call(roundEven, x); + } + + // ceil + using ::std::ceil; + template + GLM_FUNC_QUALIFIER vec ceil(vec const& x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'ceil' only accept floating-point inputs"); + return detail::compute_ceil::value>::call(x); + } + + // fract + template + GLM_FUNC_QUALIFIER genType fract(genType x) + { + return fract(vec<1, genType>(x)).x; + } + + template + GLM_FUNC_QUALIFIER vec fract(vec const& x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'fract' only accept floating-point inputs"); + return detail::compute_fract::value>::call(x); + } + + // mod + template + GLM_FUNC_QUALIFIER genType mod(genType x, genType y) + { +# if (GLM_COMPILER & GLM_COMPILER_CUDA) || (GLM_COMPILER & GLM_COMPILER_HIP) + // Another Cuda compiler bug https://github.com/g-truc/glm/issues/530 + vec<1, genType, defaultp> Result(mod(vec<1, genType, defaultp>(x), y)); + return Result.x; +# else + return mod(vec<1, genType, defaultp>(x), y).x; +# endif + } + + template + GLM_FUNC_QUALIFIER vec mod(vec const& x, T y) + { + return detail::compute_mod::value>::call(x, vec(y)); + } + + template + GLM_FUNC_QUALIFIER vec mod(vec const& x, vec const& y) + { + return detail::compute_mod::value>::call(x, y); + } + + // modf + template + GLM_FUNC_QUALIFIER genType modf(genType x, genType & i) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'modf' only accept floating-point inputs"); + return std::modf(x, &i); + } + + template + GLM_FUNC_QUALIFIER vec<1, T, Q> modf(vec<1, T, Q> const& x, vec<1, T, Q> & i) + { + return vec<1, T, Q>( + modf(x.x, i.x)); + } + + template + GLM_FUNC_QUALIFIER vec<2, T, Q> modf(vec<2, T, Q> const& x, vec<2, T, Q> & i) + { + return vec<2, T, Q>( + modf(x.x, i.x), + modf(x.y, i.y)); + } + + template + GLM_FUNC_QUALIFIER vec<3, T, Q> modf(vec<3, T, Q> const& x, vec<3, T, Q> & i) + { + return vec<3, T, Q>( + modf(x.x, i.x), + modf(x.y, i.y), + modf(x.z, i.z)); + } + + template + GLM_FUNC_QUALIFIER vec<4, T, Q> modf(vec<4, T, Q> const& x, vec<4, T, Q> & i) + { + return vec<4, T, Q>( + modf(x.x, i.x), + modf(x.y, i.y), + modf(x.z, i.z), + modf(x.w, i.w)); + } + + //// Only valid if (INT_MIN <= x-y <= INT_MAX) + //// min(x,y) + //r = y + ((x - y) & ((x - y) >> (sizeof(int) * + //CHAR_BIT - 1))); + //// max(x,y) + //r = x - ((x - y) & ((x - y) >> (sizeof(int) * + //CHAR_BIT - 1))); + + // min + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec min(vec const& a, T b) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer, "'min' only accept floating-point or integer inputs"); + return detail::compute_min_vector::value>::call(a, vec(b)); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec min(vec const& a, vec const& b) + { + return detail::compute_min_vector::value>::call(a, b); + } + + // max + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec max(vec const& a, T b) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer, "'max' only accept floating-point or integer inputs"); + return detail::compute_max_vector::value>::call(a, vec(b)); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec max(vec const& a, vec const& b) + { + return detail::compute_max_vector::value>::call(a, b); + } + + // clamp + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType clamp(genType x, genType minVal, genType maxVal) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer, "'clamp' only accept floating-point or integer inputs"); + return min(max(x, minVal), maxVal); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec clamp(vec const& x, T minVal, T maxVal) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer, "'clamp' only accept floating-point or integer inputs"); + return detail::compute_clamp_vector::value>::call(x, vec(minVal), vec(maxVal)); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec clamp(vec const& x, vec const& minVal, vec const& maxVal) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer, "'clamp' only accept floating-point or integer inputs"); + return detail::compute_clamp_vector::value>::call(x, minVal, maxVal); + } + + template + GLM_FUNC_QUALIFIER genTypeT mix(genTypeT x, genTypeT y, genTypeU a) + { + return detail::compute_mix::call(x, y, a); + } + + template + GLM_FUNC_QUALIFIER vec mix(vec const& x, vec const& y, U a) + { + return detail::compute_mix_scalar::value>::call(x, y, a); + } + + template + GLM_FUNC_QUALIFIER vec mix(vec const& x, vec const& y, vec const& a) + { + return detail::compute_mix_vector::value>::call(x, y, a); + } + + // step + template + GLM_FUNC_QUALIFIER genType step(genType edge, genType x) + { + return mix(static_cast(1), static_cast(0), x < edge); + } + + template + GLM_FUNC_QUALIFIER vec step(T edge, vec const& x) + { + return detail::compute_step_vector::value>::call(vec(edge), x); + } + + template + GLM_FUNC_QUALIFIER vec step(vec const& edge, vec const& x) + { + return detail::compute_step_vector::value>::call(edge, x); + } + + // smoothstep + template + GLM_FUNC_QUALIFIER genType smoothstep(genType edge0, genType edge1, genType x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_GENTYPE, "'smoothstep' only accept floating-point inputs"); + + genType const tmp(clamp((x - edge0) / (edge1 - edge0), genType(0), genType(1))); + return tmp * tmp * (genType(3) - genType(2) * tmp); + } + + template + GLM_FUNC_QUALIFIER vec smoothstep(T edge0, T edge1, vec const& x) + { + return detail::compute_smoothstep_vector::value>::call(vec(edge0), vec(edge1), x); + } + + template + GLM_FUNC_QUALIFIER vec smoothstep(vec const& edge0, vec const& edge1, vec const& x) + { + return detail::compute_smoothstep_vector::value>::call(edge0, edge1, x); + } + +# if GLM_HAS_CXX11_STL + using std::isnan; +# else + template + GLM_FUNC_QUALIFIER bool isnan(genType x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'isnan' only accept floating-point inputs"); + +# if GLM_HAS_CXX11_STL + return std::isnan(x); +# elif GLM_COMPILER & GLM_COMPILER_VC + return _isnan(x) != 0; +# elif GLM_COMPILER & GLM_COMPILER_INTEL +# if GLM_PLATFORM & GLM_PLATFORM_WINDOWS + return _isnan(x) != 0; +# else + return ::isnan(x) != 0; +# endif +# elif (GLM_COMPILER & (GLM_COMPILER_GCC | GLM_COMPILER_CLANG)) && (GLM_PLATFORM & GLM_PLATFORM_ANDROID) && __cplusplus < 201103L + return _isnan(x) != 0; +# elif (GLM_COMPILER & GLM_COMPILER_CUDA) || (GLM_COMPILER & GLM_COMPILER_HIP) + return ::isnan(x) != 0; +# else + return std::isnan(x); +# endif + } +# endif + + template + GLM_FUNC_QUALIFIER vec isnan(vec const& v) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'isnan' only accept floating-point inputs"); + + vec Result; + for (length_t l = 0; l < v.length(); ++l) + Result[l] = glm::isnan(v[l]); + return Result; + } + +# if GLM_HAS_CXX11_STL + using std::isinf; +# else + template + GLM_FUNC_QUALIFIER bool isinf(genType x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'isinf' only accept floating-point inputs"); + +# if GLM_HAS_CXX11_STL + return std::isinf(x); +# elif GLM_COMPILER & (GLM_COMPILER_INTEL | GLM_COMPILER_VC) +# if(GLM_PLATFORM & GLM_PLATFORM_WINDOWS) + return _fpclass(x) == _FPCLASS_NINF || _fpclass(x) == _FPCLASS_PINF; +# else + return ::isinf(x); +# endif +# elif GLM_COMPILER & (GLM_COMPILER_GCC | GLM_COMPILER_CLANG) +# if(GLM_PLATFORM & GLM_PLATFORM_ANDROID && __cplusplus < 201103L) + return _isinf(x) != 0; +# else + return std::isinf(x); +# endif +# elif (GLM_COMPILER & GLM_COMPILER_CUDA) || (GLM_COMPILER & GLM_COMPILER_HIP) + // http://developer.download.nvidia.com/compute/cuda/4_2/rel/toolkit/docs/online/group__CUDA__MATH__DOUBLE_g13431dd2b40b51f9139cbb7f50c18fab.html#g13431dd2b40b51f9139cbb7f50c18fab + return ::isinf(double(x)) != 0; +# else + return std::isinf(x); +# endif + } +# endif + + template + GLM_FUNC_QUALIFIER vec isinf(vec const& v) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'isinf' only accept floating-point inputs"); + + vec Result; + for (length_t l = 0; l < v.length(); ++l) + Result[l] = glm::isinf(v[l]); + return Result; + } + + GLM_FUNC_QUALIFIER int floatBitsToInt(float const& v) + { + union + { + float in; + int out; + } u; + + u.in = v; + + return u.out; + } + + template + GLM_FUNC_QUALIFIER vec floatBitsToInt(vec const& v) + { + return reinterpret_cast&>(const_cast&>(v)); + } + + GLM_FUNC_QUALIFIER uint floatBitsToUint(float const& v) + { + union + { + float in; + uint out; + } u; + + u.in = v; + + return u.out; + } + + template + GLM_FUNC_QUALIFIER vec floatBitsToUint(vec const& v) + { + return reinterpret_cast&>(const_cast&>(v)); + } + + GLM_FUNC_QUALIFIER float intBitsToFloat(int const& v) + { + union + { + int in; + float out; + } u; + + u.in = v; + + return u.out; + } + + template + GLM_FUNC_QUALIFIER vec intBitsToFloat(vec const& v) + { + return reinterpret_cast&>(const_cast&>(v)); + } + + GLM_FUNC_QUALIFIER float uintBitsToFloat(uint const& v) + { + union + { + uint in; + float out; + } u; + + u.in = v; + + return u.out; + } + + template + GLM_FUNC_QUALIFIER vec uintBitsToFloat(vec const& v) + { + return reinterpret_cast&>(const_cast&>(v)); + } + +# if GLM_HAS_CXX11_STL + using std::fma; +# else + template + GLM_FUNC_QUALIFIER genType fma(genType const& a, genType const& b, genType const& c) + { + return a * b + c; + } +# endif + + template + GLM_FUNC_QUALIFIER genType frexp(genType x, int& exp) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'frexp' only accept floating-point inputs"); + + return std::frexp(x, &exp); + } + + template + GLM_FUNC_QUALIFIER vec frexp(vec const& v, vec& exp) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'frexp' only accept floating-point inputs"); + + vec Result; + for (length_t l = 0; l < v.length(); ++l) + Result[l] = std::frexp(v[l], &exp[l]); + return Result; + } + + template + GLM_FUNC_QUALIFIER genType ldexp(genType const& x, int const& exp) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'ldexp' only accept floating-point inputs"); + + return std::ldexp(x, exp); + } + + template + GLM_FUNC_QUALIFIER vec ldexp(vec const& v, vec const& exp) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'ldexp' only accept floating-point inputs"); + + vec Result; + for (length_t l = 0; l < v.length(); ++l) + Result[l] = std::ldexp(v[l], exp[l]); + return Result; + } +}//namespace glm + +#if GLM_CONFIG_SIMD == GLM_ENABLE +# include "func_common_simd.inl" +#endif diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/func_common_simd.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/func_common_simd.inl new file mode 100644 index 0000000000000000000000000000000000000000..c04e6e5402414e42d4d430006cc9688d12fa9d85 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/func_common_simd.inl @@ -0,0 +1,231 @@ +/// @ref core +/// @file glm/detail/func_common_simd.inl + +#if GLM_ARCH & GLM_ARCH_SSE2_BIT + +#include "../simd/common.h" + +#include + +namespace glm{ +namespace detail +{ + template + struct compute_abs_vector<4, float, Q, true> + { + GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& v) + { + vec<4, float, Q> result; + result.data = glm_vec4_abs(v.data); + return result; + } + }; + + template + struct compute_abs_vector<4, int, Q, true> + { + GLM_FUNC_QUALIFIER static vec<4, int, Q> call(vec<4, int, Q> const& v) + { + vec<4, int, Q> result; + result.data = glm_ivec4_abs(v.data); + return result; + } + }; + + template + struct compute_floor<4, float, Q, true> + { + GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& v) + { + vec<4, float, Q> result; + result.data = glm_vec4_floor(v.data); + return result; + } + }; + + template + struct compute_ceil<4, float, Q, true> + { + GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& v) + { + vec<4, float, Q> result; + result.data = glm_vec4_ceil(v.data); + return result; + } + }; + + template + struct compute_fract<4, float, Q, true> + { + GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& v) + { + vec<4, float, Q> result; + result.data = glm_vec4_fract(v.data); + return result; + } + }; + + template + struct compute_round<4, float, Q, true> + { + GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& v) + { + vec<4, float, Q> result; + result.data = glm_vec4_round(v.data); + return result; + } + }; + + template + struct compute_mod<4, float, Q, true> + { + GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& x, vec<4, float, Q> const& y) + { + vec<4, float, Q> result; + result.data = glm_vec4_mod(x.data, y.data); + return result; + } + }; + + template + struct compute_min_vector<4, float, Q, true> + { + GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& v1, vec<4, float, Q> const& v2) + { + vec<4, float, Q> result; + result.data = _mm_min_ps(v1.data, v2.data); + return result; + } + }; + + template + struct compute_min_vector<4, int, Q, true> + { + GLM_FUNC_QUALIFIER static vec<4, int, Q> call(vec<4, int, Q> const& v1, vec<4, int, Q> const& v2) + { + vec<4, int, Q> result; + result.data = _mm_min_epi32(v1.data, v2.data); + return result; + } + }; + + template + struct compute_min_vector<4, uint, Q, true> + { + GLM_FUNC_QUALIFIER static vec<4, uint, Q> call(vec<4, uint, Q> const& v1, vec<4, uint, Q> const& v2) + { + vec<4, uint, Q> result; + result.data = _mm_min_epu32(v1.data, v2.data); + return result; + } + }; + + template + struct compute_max_vector<4, float, Q, true> + { + GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& v1, vec<4, float, Q> const& v2) + { + vec<4, float, Q> result; + result.data = _mm_max_ps(v1.data, v2.data); + return result; + } + }; + + template + struct compute_max_vector<4, int, Q, true> + { + GLM_FUNC_QUALIFIER static vec<4, int, Q> call(vec<4, int, Q> const& v1, vec<4, int, Q> const& v2) + { + vec<4, int, Q> result; + result.data = _mm_max_epi32(v1.data, v2.data); + return result; + } + }; + + template + struct compute_max_vector<4, uint, Q, true> + { + GLM_FUNC_QUALIFIER static vec<4, uint, Q> call(vec<4, uint, Q> const& v1, vec<4, uint, Q> const& v2) + { + vec<4, uint, Q> result; + result.data = _mm_max_epu32(v1.data, v2.data); + return result; + } + }; + + template + struct compute_clamp_vector<4, float, Q, true> + { + GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& x, vec<4, float, Q> const& minVal, vec<4, float, Q> const& maxVal) + { + vec<4, float, Q> result; + result.data = _mm_min_ps(_mm_max_ps(x.data, minVal.data), maxVal.data); + return result; + } + }; + + template + struct compute_clamp_vector<4, int, Q, true> + { + GLM_FUNC_QUALIFIER static vec<4, int, Q> call(vec<4, int, Q> const& x, vec<4, int, Q> const& minVal, vec<4, int, Q> const& maxVal) + { + vec<4, int, Q> result; + result.data = _mm_min_epi32(_mm_max_epi32(x.data, minVal.data), maxVal.data); + return result; + } + }; + + template + struct compute_clamp_vector<4, uint, Q, true> + { + GLM_FUNC_QUALIFIER static vec<4, uint, Q> call(vec<4, uint, Q> const& x, vec<4, uint, Q> const& minVal, vec<4, uint, Q> const& maxVal) + { + vec<4, uint, Q> result; + result.data = _mm_min_epu32(_mm_max_epu32(x.data, minVal.data), maxVal.data); + return result; + } + }; + + template + struct compute_mix_vector<4, float, bool, Q, true> + { + GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& x, vec<4, float, Q> const& y, vec<4, bool, Q> const& a) + { + __m128i const Load = _mm_set_epi32(-static_cast(a.w), -static_cast(a.z), -static_cast(a.y), -static_cast(a.x)); + __m128 const Mask = _mm_castsi128_ps(Load); + + vec<4, float, Q> Result; +# if 0 && GLM_ARCH & GLM_ARCH_AVX + Result.data = _mm_blendv_ps(x.data, y.data, Mask); +# else + Result.data = _mm_or_ps(_mm_and_ps(Mask, y.data), _mm_andnot_ps(Mask, x.data)); +# endif + return Result; + } + }; +/* FIXME + template + struct compute_step_vector + { + GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& edge, vec<4, float, Q> const& x) + { + vec<4, float, Q> Result; + result.data = glm_vec4_step(edge.data, x.data); + return result; + } + }; +*/ + template + struct compute_smoothstep_vector<4, float, Q, true> + { + GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& edge0, vec<4, float, Q> const& edge1, vec<4, float, Q> const& x) + { + vec<4, float, Q> Result; + Result.data = glm_vec4_smoothstep(edge0.data, edge1.data, x.data); + return Result; + } + }; +}//namespace detail +}//namespace glm + +#endif//GLM_ARCH & GLM_ARCH_SSE2_BIT diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/func_exponential.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/func_exponential.inl new file mode 100644 index 0000000000000000000000000000000000000000..477b37757ae883f931f972f9843be809902d21db --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/func_exponential.inl @@ -0,0 +1,152 @@ +/// @ref core +/// @file glm/detail/func_exponential.inl + +#include "../vector_relational.hpp" +#include "_vectorize.hpp" +#include +#include +#include + +namespace glm{ +namespace detail +{ +# if GLM_HAS_CXX11_STL + using std::log2; +# else + template + genType log2(genType Value) + { + return std::log(Value) * static_cast(1.4426950408889634073599246810019); + } +# endif + + template + struct compute_log2 + { + GLM_FUNC_QUALIFIER static vec call(vec const& v) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'log2' only accept floating-point inputs. Include for integer inputs."); + + return detail::functor1::call(log2, v); + } + }; + + template + struct compute_sqrt + { + GLM_FUNC_QUALIFIER static vec call(vec const& x) + { + return detail::functor1::call(std::sqrt, x); + } + }; + + template + struct compute_inversesqrt + { + GLM_FUNC_QUALIFIER static vec call(vec const& x) + { + return static_cast(1) / sqrt(x); + } + }; + + template + struct compute_inversesqrt + { + GLM_FUNC_QUALIFIER static vec call(vec const& x) + { + vec tmp(x); + vec xhalf(tmp * 0.5f); + vec* p = reinterpret_cast*>(const_cast*>(&x)); + vec i = vec(0x5f375a86) - (*p >> vec(1)); + vec* ptmp = reinterpret_cast*>(&i); + tmp = *ptmp; + tmp = tmp * (1.5f - xhalf * tmp * tmp); + return tmp; + } + }; +}//namespace detail + + // pow + using std::pow; + template + GLM_FUNC_QUALIFIER vec pow(vec const& base, vec const& exponent) + { + return detail::functor2::call(pow, base, exponent); + } + + // exp + using std::exp; + template + GLM_FUNC_QUALIFIER vec exp(vec const& x) + { + return detail::functor1::call(exp, x); + } + + // log + using std::log; + template + GLM_FUNC_QUALIFIER vec log(vec const& x) + { + return detail::functor1::call(log, x); + } + +# if GLM_HAS_CXX11_STL + using std::exp2; +# else + //exp2, ln2 = 0.69314718055994530941723212145818f + template + GLM_FUNC_QUALIFIER genType exp2(genType x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'exp2' only accept floating-point inputs"); + + return std::exp(static_cast(0.69314718055994530941723212145818) * x); + } +# endif + + template + GLM_FUNC_QUALIFIER vec exp2(vec const& x) + { + return detail::functor1::call(exp2, x); + } + + // log2, ln2 = 0.69314718055994530941723212145818f + template + GLM_FUNC_QUALIFIER genType log2(genType x) + { + return log2(vec<1, genType>(x)).x; + } + + template + GLM_FUNC_QUALIFIER vec log2(vec const& x) + { + return detail::compute_log2::is_iec559, detail::is_aligned::value>::call(x); + } + + // sqrt + using std::sqrt; + template + GLM_FUNC_QUALIFIER vec sqrt(vec const& x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'sqrt' only accept floating-point inputs"); + return detail::compute_sqrt::value>::call(x); + } + + // inversesqrt + template + GLM_FUNC_QUALIFIER genType inversesqrt(genType x) + { + return static_cast(1) / sqrt(x); + } + + template + GLM_FUNC_QUALIFIER vec inversesqrt(vec const& x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'inversesqrt' only accept floating-point inputs"); + return detail::compute_inversesqrt::value>::call(x); + } +}//namespace glm + +#if GLM_CONFIG_SIMD == GLM_ENABLE +# include "func_exponential_simd.inl" +#endif + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/func_exponential_simd.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/func_exponential_simd.inl new file mode 100644 index 0000000000000000000000000000000000000000..708e10d9709c09b2c50dff05c0884605c8c8068a --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/func_exponential_simd.inl @@ -0,0 +1,37 @@ +/// @ref core +/// @file glm/detail/func_exponential_simd.inl + +#include "../simd/exponential.h" + +#if GLM_ARCH & GLM_ARCH_SSE2_BIT + +namespace glm{ +namespace detail +{ + template + struct compute_sqrt<4, float, Q, true> + { + GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& v) + { + vec<4, float, Q> Result; + Result.data = _mm_sqrt_ps(v.data); + return Result; + } + }; + +# if GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE + template<> + struct compute_sqrt<4, float, aligned_lowp, true> + { + GLM_FUNC_QUALIFIER static vec<4, float, aligned_lowp> call(vec<4, float, aligned_lowp> const& v) + { + vec<4, float, aligned_lowp> Result; + Result.data = glm_vec4_sqrt_lowp(v.data); + return Result; + } + }; +# endif +}//namespace detail +}//namespace glm + +#endif//GLM_ARCH & GLM_ARCH_SSE2_BIT diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/func_geometric.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/func_geometric.inl new file mode 100644 index 0000000000000000000000000000000000000000..6018f8d10ccd2daaf3e8a1a3114f0ff5d2171a45 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/func_geometric.inl @@ -0,0 +1,243 @@ +#include "../exponential.hpp" +#include "../common.hpp" + +namespace glm{ +namespace detail +{ + template + struct compute_length + { + GLM_FUNC_QUALIFIER static T call(vec const& v) + { + return sqrt(dot(v, v)); + } + }; + + template + struct compute_distance + { + GLM_FUNC_QUALIFIER static T call(vec const& p0, vec const& p1) + { + return length(p1 - p0); + } + }; + + template + struct compute_dot{}; + + template + struct compute_dot, T, Aligned> + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static T call(vec<1, T, Q> const& a, vec<1, T, Q> const& b) + { + return a.x * b.x; + } + }; + + template + struct compute_dot, T, Aligned> + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static T call(vec<2, T, Q> const& a, vec<2, T, Q> const& b) + { + vec<2, T, Q> tmp(a * b); + return tmp.x + tmp.y; + } + }; + + template + struct compute_dot, T, Aligned> + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static T call(vec<3, T, Q> const& a, vec<3, T, Q> const& b) + { + vec<3, T, Q> tmp(a * b); + return tmp.x + tmp.y + tmp.z; + } + }; + + template + struct compute_dot, T, Aligned> + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static T call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) + { + vec<4, T, Q> tmp(a * b); + return (tmp.x + tmp.y) + (tmp.z + tmp.w); + } + }; + + template + struct compute_cross + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec<3, T, Q> call(vec<3, T, Q> const& x, vec<3, T, Q> const& y) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'cross' accepts only floating-point inputs"); + + return vec<3, T, Q>( + x.y * y.z - y.y * x.z, + x.z * y.x - y.z * x.x, + x.x * y.y - y.x * x.y); + } + }; + + template + struct compute_normalize + { + GLM_FUNC_QUALIFIER static vec call(vec const& v) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'normalize' accepts only floating-point inputs"); + + return v * inversesqrt(dot(v, v)); + } + }; + + template + struct compute_faceforward + { + GLM_FUNC_QUALIFIER static vec call(vec const& N, vec const& I, vec const& Nref) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'normalize' accepts only floating-point inputs"); + + return dot(Nref, I) < static_cast(0) ? N : -N; + } + }; + + template + struct compute_reflect + { + GLM_FUNC_QUALIFIER static vec call(vec const& I, vec const& N) + { + return I - N * dot(N, I) * static_cast(2); + } + }; + + template + struct compute_refract + { + GLM_FUNC_QUALIFIER static vec call(vec const& I, vec const& N, T eta) + { + T const dotValue(dot(N, I)); + T const k(static_cast(1) - eta * eta * (static_cast(1) - dotValue * dotValue)); + vec const Result = + (k >= static_cast(0)) ? (eta * I - (eta * dotValue + std::sqrt(k)) * N) : vec(0); + return Result; + } + }; +}//namespace detail + + // length + template + GLM_FUNC_QUALIFIER genType length(genType x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'length' accepts only floating-point inputs"); + + return abs(x); + } + + template + GLM_FUNC_QUALIFIER T length(vec const& v) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'length' accepts only floating-point inputs"); + + return detail::compute_length::value>::call(v); + } + + // distance + template + GLM_FUNC_QUALIFIER genType distance(genType const& p0, genType const& p1) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'distance' accepts only floating-point inputs"); + + return length(p1 - p0); + } + + template + GLM_FUNC_QUALIFIER T distance(vec const& p0, vec const& p1) + { + return detail::compute_distance::value>::call(p0, p1); + } + + // dot + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR T dot(T x, T y) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'dot' accepts only floating-point inputs"); + return x * y; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR T dot(vec const& x, vec const& y) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'dot' accepts only floating-point inputs"); + return detail::compute_dot, T, detail::is_aligned::value>::call(x, y); + } + + // cross + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> cross(vec<3, T, Q> const& x, vec<3, T, Q> const& y) + { + return detail::compute_cross::value>::call(x, y); + } +/* + // normalize + template + GLM_FUNC_QUALIFIER genType normalize(genType const& x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'normalize' accepts only floating-point inputs"); + + return x < genType(0) ? genType(-1) : genType(1); + } +*/ + template + GLM_FUNC_QUALIFIER vec normalize(vec const& x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'normalize' accepts only floating-point inputs"); + + return detail::compute_normalize::value>::call(x); + } + + // faceforward + template + GLM_FUNC_QUALIFIER genType faceforward(genType const& N, genType const& I, genType const& Nref) + { + return dot(Nref, I) < static_cast(0) ? N : -N; + } + + template + GLM_FUNC_QUALIFIER vec faceforward(vec const& N, vec const& I, vec const& Nref) + { + return detail::compute_faceforward::value>::call(N, I, Nref); + } + + // reflect + template + GLM_FUNC_QUALIFIER genType reflect(genType const& I, genType const& N) + { + return I - N * dot(N, I) * genType(2); + } + + template + GLM_FUNC_QUALIFIER vec reflect(vec const& I, vec const& N) + { + return detail::compute_reflect::value>::call(I, N); + } + + // refract + template + GLM_FUNC_QUALIFIER genType refract(genType const& I, genType const& N, genType eta) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'refract' accepts only floating-point inputs"); + genType const dotValue(dot(N, I)); + genType const k(static_cast(1) - eta * eta * (static_cast(1) - dotValue * dotValue)); + return (eta * I - (eta * dotValue + sqrt(k)) * N) * static_cast(k >= static_cast(0)); + } + + template + GLM_FUNC_QUALIFIER vec refract(vec const& I, vec const& N, T eta) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'refract' accepts only floating-point inputs"); + return detail::compute_refract::value>::call(I, N, eta); + } +}//namespace glm + +#if GLM_CONFIG_SIMD == GLM_ENABLE +# include "func_geometric_simd.inl" +#endif diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/func_geometric_simd.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/func_geometric_simd.inl new file mode 100644 index 0000000000000000000000000000000000000000..7a8e12758f4140e89036686e5aa1a55efbf3eb99 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/func_geometric_simd.inl @@ -0,0 +1,163 @@ +/// @ref core +/// @file glm/detail/func_geometric_simd.inl + +#include "../simd/geometric.h" + +#if GLM_ARCH & GLM_ARCH_SSE2_BIT + +namespace glm{ +namespace detail +{ + template + struct compute_length<4, float, Q, true> + { + GLM_FUNC_QUALIFIER static float call(vec<4, float, Q> const& v) + { + return _mm_cvtss_f32(glm_vec4_length(v.data)); + } + }; + + template + struct compute_distance<4, float, Q, true> + { + GLM_FUNC_QUALIFIER static float call(vec<4, float, Q> const& p0, vec<4, float, Q> const& p1) + { + return _mm_cvtss_f32(glm_vec4_distance(p0.data, p1.data)); + } + }; + + template + struct compute_dot, float, true> + { + GLM_FUNC_QUALIFIER static float call(vec<4, float, Q> const& x, vec<4, float, Q> const& y) + { + return _mm_cvtss_f32(glm_vec1_dot(x.data, y.data)); + } + }; + + template + struct compute_cross + { + GLM_FUNC_QUALIFIER static vec<3, float, Q> call(vec<3, float, Q> const& a, vec<3, float, Q> const& b) + { + __m128 const set0 = _mm_set_ps(0.0f, a.z, a.y, a.x); + __m128 const set1 = _mm_set_ps(0.0f, b.z, b.y, b.x); + __m128 const xpd0 = glm_vec4_cross(set0, set1); + + vec<4, float, Q> Result; + Result.data = xpd0; + return vec<3, float, Q>(Result); + } + }; + + template + struct compute_normalize<4, float, Q, true> + { + GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& v) + { + vec<4, float, Q> Result; + Result.data = glm_vec4_normalize(v.data); + return Result; + } + }; + + template + struct compute_faceforward<4, float, Q, true> + { + GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& N, vec<4, float, Q> const& I, vec<4, float, Q> const& Nref) + { + vec<4, float, Q> Result; + Result.data = glm_vec4_faceforward(N.data, I.data, Nref.data); + return Result; + } + }; + + template + struct compute_reflect<4, float, Q, true> + { + GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& I, vec<4, float, Q> const& N) + { + vec<4, float, Q> Result; + Result.data = glm_vec4_reflect(I.data, N.data); + return Result; + } + }; + + template + struct compute_refract<4, float, Q, true> + { + GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& I, vec<4, float, Q> const& N, float eta) + { + vec<4, float, Q> Result; + Result.data = glm_vec4_refract(I.data, N.data, _mm_set1_ps(eta)); + return Result; + } + }; +}//namespace detail +}//namespace glm + +#elif GLM_ARCH & GLM_ARCH_NEON_BIT +namespace glm{ +namespace detail +{ + template + struct compute_length<4, float, Q, true> + { + GLM_FUNC_QUALIFIER static float call(vec<4, float, Q> const& v) + { + return sqrt(compute_dot, float, true>::call(v, v)); + } + }; + + template + struct compute_distance<4, float, Q, true> + { + GLM_FUNC_QUALIFIER static float call(vec<4, float, Q> const& p0, vec<4, float, Q> const& p1) + { + return compute_length<4, float, Q, true>::call(p1 - p0); + } + }; + + + template + struct compute_dot, float, true> + { + GLM_FUNC_QUALIFIER static float call(vec<4, float, Q> const& x, vec<4, float, Q> const& y) + { +#if GLM_ARCH & GLM_ARCH_ARMV8_BIT + float32x4_t v = vmulq_f32(x.data, y.data); + return vaddvq_f32(v); +#else // Armv7a with Neon + float32x4_t p = vmulq_f32(x.data, y.data); + float32x2_t v = vpadd_f32(vget_low_f32(p), vget_high_f32(p)); + v = vpadd_f32(v, v); + return vget_lane_f32(v, 0); +#endif + } + }; + + template + struct compute_normalize<4, float, Q, true> + { + GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& v) + { + float32x4_t p = vmulq_f32(v.data, v.data); +#if GLM_ARCH & GLM_ARCH_ARMV8_BIT + p = vpaddq_f32(p, p); + p = vpaddq_f32(p, p); +#else + float32x2_t t = vpadd_f32(vget_low_f32(p), vget_high_f32(p)); + t = vpadd_f32(t, t); + p = vcombine_f32(t, t); +#endif + + float32x4_t vd = vrsqrteq_f32(p); + vec<4, float, Q> Result; + Result.data = vmulq_f32(v.data, vd); + return Result; + } + }; +}//namespace detail +}//namespace glm + +#endif//GLM_ARCH & GLM_ARCH_SSE2_BIT diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/func_integer.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/func_integer.inl new file mode 100644 index 0000000000000000000000000000000000000000..53732d904fcf407c10c6599a4020da709d07cb0a --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/func_integer.inl @@ -0,0 +1,372 @@ +/// @ref core + +#include "_vectorize.hpp" +#if(GLM_ARCH & GLM_ARCH_X86 && GLM_COMPILER & GLM_COMPILER_VC) +# include +# pragma intrinsic(_BitScanReverse) +#endif//(GLM_ARCH & GLM_ARCH_X86 && GLM_COMPILER & GLM_COMPILER_VC) +#include + +#if !GLM_HAS_EXTENDED_INTEGER_TYPE +# if GLM_COMPILER & GLM_COMPILER_GCC +# pragma GCC diagnostic ignored "-Wlong-long" +# endif +# if (GLM_COMPILER & GLM_COMPILER_CLANG) +# pragma clang diagnostic ignored "-Wc++11-long-long" +# endif +#endif + +namespace glm{ +namespace detail +{ + template + GLM_FUNC_QUALIFIER T mask(T Bits) + { + return Bits >= static_cast(sizeof(T) * 8) ? ~static_cast(0) : (static_cast(1) << Bits) - static_cast(1); + } + + template + struct compute_bitfieldReverseStep + { + GLM_FUNC_QUALIFIER static vec call(vec const& v, T, T) + { + return v; + } + }; + + template + struct compute_bitfieldReverseStep + { + GLM_FUNC_QUALIFIER static vec call(vec const& v, T Mask, T Shift) + { + return (v & Mask) << Shift | (v & (~Mask)) >> Shift; + } + }; + + template + struct compute_bitfieldBitCountStep + { + GLM_FUNC_QUALIFIER static vec call(vec const& v, T, T) + { + return v; + } + }; + + template + struct compute_bitfieldBitCountStep + { + GLM_FUNC_QUALIFIER static vec call(vec const& v, T Mask, T Shift) + { + return (v & Mask) + ((v >> Shift) & Mask); + } + }; + + template + struct compute_findLSB + { + GLM_FUNC_QUALIFIER static int call(genIUType Value) + { + if(Value == 0) + return -1; + + return glm::bitCount(~Value & (Value - static_cast(1))); + } + }; + +# if GLM_HAS_BITSCAN_WINDOWS + template + struct compute_findLSB + { + GLM_FUNC_QUALIFIER static int call(genIUType Value) + { + unsigned long Result(0); + unsigned char IsNotNull = _BitScanForward(&Result, *reinterpret_cast(&Value)); + return IsNotNull ? int(Result) : -1; + } + }; + +# if !((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_MODEL == GLM_MODEL_32)) + template + struct compute_findLSB + { + GLM_FUNC_QUALIFIER static int call(genIUType Value) + { + unsigned long Result(0); + unsigned char IsNotNull = _BitScanForward64(&Result, *reinterpret_cast(&Value)); + return IsNotNull ? int(Result) : -1; + } + }; +# endif +# endif//GLM_HAS_BITSCAN_WINDOWS + + template + struct compute_findMSB_step_vec + { + GLM_FUNC_QUALIFIER static vec call(vec const& x, T Shift) + { + return x | (x >> Shift); + } + }; + + template + struct compute_findMSB_step_vec + { + GLM_FUNC_QUALIFIER static vec call(vec const& x, T) + { + return x; + } + }; + + template + struct compute_findMSB_vec + { + GLM_FUNC_QUALIFIER static vec call(vec const& v) + { + vec x(v); + x = compute_findMSB_step_vec= 8>::call(x, static_cast( 1)); + x = compute_findMSB_step_vec= 8>::call(x, static_cast( 2)); + x = compute_findMSB_step_vec= 8>::call(x, static_cast( 4)); + x = compute_findMSB_step_vec= 16>::call(x, static_cast( 8)); + x = compute_findMSB_step_vec= 32>::call(x, static_cast(16)); + x = compute_findMSB_step_vec= 64>::call(x, static_cast(32)); + return vec(sizeof(T) * 8 - 1) - glm::bitCount(~x); + } + }; + +# if GLM_HAS_BITSCAN_WINDOWS + template + GLM_FUNC_QUALIFIER int compute_findMSB_32(genIUType Value) + { + unsigned long Result(0); + unsigned char IsNotNull = _BitScanReverse(&Result, *reinterpret_cast(&Value)); + return IsNotNull ? int(Result) : -1; + } + + template + struct compute_findMSB_vec + { + GLM_FUNC_QUALIFIER static vec call(vec const& x) + { + return detail::functor1::call(compute_findMSB_32, x); + } + }; + +# if !((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_MODEL == GLM_MODEL_32)) + template + GLM_FUNC_QUALIFIER int compute_findMSB_64(genIUType Value) + { + unsigned long Result(0); + unsigned char IsNotNull = _BitScanReverse64(&Result, *reinterpret_cast(&Value)); + return IsNotNull ? int(Result) : -1; + } + + template + struct compute_findMSB_vec + { + GLM_FUNC_QUALIFIER static vec call(vec const& x) + { + return detail::functor1::call(compute_findMSB_64, x); + } + }; +# endif +# endif//GLM_HAS_BITSCAN_WINDOWS +}//namespace detail + + // uaddCarry + GLM_FUNC_QUALIFIER uint uaddCarry(uint const& x, uint const& y, uint & Carry) + { + detail::uint64 const Value64(static_cast(x) + static_cast(y)); + detail::uint64 const Max32((static_cast(1) << static_cast(32)) - static_cast(1)); + Carry = Value64 > Max32 ? 1u : 0u; + return static_cast(Value64 % (Max32 + static_cast(1))); + } + + template + GLM_FUNC_QUALIFIER vec uaddCarry(vec const& x, vec const& y, vec& Carry) + { + vec Value64(vec(x) + vec(y)); + vec Max32((static_cast(1) << static_cast(32)) - static_cast(1)); + Carry = mix(vec(0), vec(1), greaterThan(Value64, Max32)); + return vec(Value64 % (Max32 + static_cast(1))); + } + + // usubBorrow + GLM_FUNC_QUALIFIER uint usubBorrow(uint const& x, uint const& y, uint & Borrow) + { + Borrow = x >= y ? static_cast(0) : static_cast(1); + if(y >= x) + return y - x; + else + return static_cast((static_cast(1) << static_cast(32)) + (static_cast(y) - static_cast(x))); + } + + template + GLM_FUNC_QUALIFIER vec usubBorrow(vec const& x, vec const& y, vec& Borrow) + { + Borrow = mix(vec(1), vec(0), greaterThanEqual(x, y)); + vec const YgeX(y - x); + vec const XgeY(vec((static_cast(1) << static_cast(32)) + (vec(y) - vec(x)))); + return mix(XgeY, YgeX, greaterThanEqual(y, x)); + } + + // umulExtended + GLM_FUNC_QUALIFIER void umulExtended(uint const& x, uint const& y, uint & msb, uint & lsb) + { + detail::uint64 Value64 = static_cast(x) * static_cast(y); + msb = static_cast(Value64 >> static_cast(32)); + lsb = static_cast(Value64); + } + + template + GLM_FUNC_QUALIFIER void umulExtended(vec const& x, vec const& y, vec& msb, vec& lsb) + { + vec Value64(vec(x) * vec(y)); + msb = vec(Value64 >> static_cast(32)); + lsb = vec(Value64); + } + + // imulExtended + GLM_FUNC_QUALIFIER void imulExtended(int x, int y, int& msb, int& lsb) + { + detail::int64 Value64 = static_cast(x) * static_cast(y); + msb = static_cast(Value64 >> static_cast(32)); + lsb = static_cast(Value64); + } + + template + GLM_FUNC_QUALIFIER void imulExtended(vec const& x, vec const& y, vec& msb, vec& lsb) + { + vec Value64(vec(x) * vec(y)); + lsb = vec(Value64 & static_cast(0xFFFFFFFF)); + msb = vec((Value64 >> static_cast(32)) & static_cast(0xFFFFFFFF)); + } + + // bitfieldExtract + template + GLM_FUNC_QUALIFIER genIUType bitfieldExtract(genIUType Value, int Offset, int Bits) + { + return bitfieldExtract(vec<1, genIUType>(Value), Offset, Bits).x; + } + + template + GLM_FUNC_QUALIFIER vec bitfieldExtract(vec const& Value, int Offset, int Bits) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'bitfieldExtract' only accept integer inputs"); + + return (Value >> static_cast(Offset)) & static_cast(detail::mask(Bits)); + } + + // bitfieldInsert + template + GLM_FUNC_QUALIFIER genIUType bitfieldInsert(genIUType const& Base, genIUType const& Insert, int Offset, int Bits) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'bitfieldInsert' only accept integer values"); + + return bitfieldInsert(vec<1, genIUType>(Base), vec<1, genIUType>(Insert), Offset, Bits).x; + } + + template + GLM_FUNC_QUALIFIER vec bitfieldInsert(vec const& Base, vec const& Insert, int Offset, int Bits) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'bitfieldInsert' only accept integer values"); + + T const Mask = detail::mask(static_cast(Bits)) << Offset; + return (Base & ~Mask) | ((Insert << static_cast(Offset)) & Mask); + } + + // bitfieldReverse + template + GLM_FUNC_QUALIFIER genIUType bitfieldReverse(genIUType x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'bitfieldReverse' only accept integer values"); + + return bitfieldReverse(glm::vec<1, genIUType, glm::defaultp>(x)).x; + } + + template + GLM_FUNC_QUALIFIER vec bitfieldReverse(vec const& v) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'bitfieldReverse' only accept integer values"); + + vec x(v); + x = detail::compute_bitfieldReverseStep::value, sizeof(T) * 8>= 2>::call(x, static_cast(0x5555555555555555ull), static_cast( 1)); + x = detail::compute_bitfieldReverseStep::value, sizeof(T) * 8>= 4>::call(x, static_cast(0x3333333333333333ull), static_cast( 2)); + x = detail::compute_bitfieldReverseStep::value, sizeof(T) * 8>= 8>::call(x, static_cast(0x0F0F0F0F0F0F0F0Full), static_cast( 4)); + x = detail::compute_bitfieldReverseStep::value, sizeof(T) * 8>= 16>::call(x, static_cast(0x00FF00FF00FF00FFull), static_cast( 8)); + x = detail::compute_bitfieldReverseStep::value, sizeof(T) * 8>= 32>::call(x, static_cast(0x0000FFFF0000FFFFull), static_cast(16)); + x = detail::compute_bitfieldReverseStep::value, sizeof(T) * 8>= 64>::call(x, static_cast(0x00000000FFFFFFFFull), static_cast(32)); + return x; + } + + // bitCount + template + GLM_FUNC_QUALIFIER int bitCount(genIUType x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'bitCount' only accept integer values"); + + return bitCount(glm::vec<1, genIUType, glm::defaultp>(x)).x; + } + + template + GLM_FUNC_QUALIFIER vec bitCount(vec const& v) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'bitCount' only accept integer values"); + +# if GLM_COMPILER & GLM_COMPILER_VC +# pragma warning(push) +# pragma warning(disable : 4310) //cast truncates constant value +# endif + + vec::type, Q> x(*reinterpret_cast::type, Q> const *>(&v)); + x = detail::compute_bitfieldBitCountStep::type, Q, detail::is_aligned::value, sizeof(T) * 8>= 2>::call(x, typename detail::make_unsigned::type(0x5555555555555555ull), typename detail::make_unsigned::type( 1)); + x = detail::compute_bitfieldBitCountStep::type, Q, detail::is_aligned::value, sizeof(T) * 8>= 4>::call(x, typename detail::make_unsigned::type(0x3333333333333333ull), typename detail::make_unsigned::type( 2)); + x = detail::compute_bitfieldBitCountStep::type, Q, detail::is_aligned::value, sizeof(T) * 8>= 8>::call(x, typename detail::make_unsigned::type(0x0F0F0F0F0F0F0F0Full), typename detail::make_unsigned::type( 4)); + x = detail::compute_bitfieldBitCountStep::type, Q, detail::is_aligned::value, sizeof(T) * 8>= 16>::call(x, typename detail::make_unsigned::type(0x00FF00FF00FF00FFull), typename detail::make_unsigned::type( 8)); + x = detail::compute_bitfieldBitCountStep::type, Q, detail::is_aligned::value, sizeof(T) * 8>= 32>::call(x, typename detail::make_unsigned::type(0x0000FFFF0000FFFFull), typename detail::make_unsigned::type(16)); + x = detail::compute_bitfieldBitCountStep::type, Q, detail::is_aligned::value, sizeof(T) * 8>= 64>::call(x, typename detail::make_unsigned::type(0x00000000FFFFFFFFull), typename detail::make_unsigned::type(32)); + return vec(x); + +# if GLM_COMPILER & GLM_COMPILER_VC +# pragma warning(pop) +# endif + } + + // findLSB + template + GLM_FUNC_QUALIFIER int findLSB(genIUType Value) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'findLSB' only accept integer values"); + + return detail::compute_findLSB::call(Value); + } + + template + GLM_FUNC_QUALIFIER vec findLSB(vec const& x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'findLSB' only accept integer values"); + + return detail::functor1::call(findLSB, x); + } + + // findMSB + template + GLM_FUNC_QUALIFIER int findMSB(genIUType v) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'findMSB' only accept integer values"); + + return findMSB(vec<1, genIUType>(v)).x; + } + + template + GLM_FUNC_QUALIFIER vec findMSB(vec const& v) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'findMSB' only accept integer values"); + + return detail::compute_findMSB_vec::call(v); + } +}//namespace glm + +#if GLM_CONFIG_SIMD == GLM_ENABLE +# include "func_integer_simd.inl" +#endif + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/func_integer_simd.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/func_integer_simd.inl new file mode 100644 index 0000000000000000000000000000000000000000..96ed825deed01846d381026361a68b2c7696e6d1 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/func_integer_simd.inl @@ -0,0 +1,65 @@ +#include "../simd/integer.h" + +#if GLM_ARCH & GLM_ARCH_SSE2_BIT + +namespace glm{ +namespace detail +{ + template + struct compute_bitfieldReverseStep<4, uint, Q, true, true> + { + GLM_FUNC_QUALIFIER static vec<4, uint, Q> call(vec<4, uint, Q> const& v, uint Mask, uint Shift) + { + __m128i const set0 = v.data; + + __m128i const set1 = _mm_set1_epi32(static_cast(Mask)); + __m128i const and1 = _mm_and_si128(set0, set1); + __m128i const sft1 = _mm_slli_epi32(and1, Shift); + + __m128i const set2 = _mm_andnot_si128(set0, _mm_set1_epi32(-1)); + __m128i const and2 = _mm_and_si128(set0, set2); + __m128i const sft2 = _mm_srai_epi32(and2, Shift); + + __m128i const or0 = _mm_or_si128(sft1, sft2); + + return or0; + } + }; + + template + struct compute_bitfieldBitCountStep<4, uint, Q, true, true> + { + GLM_FUNC_QUALIFIER static vec<4, uint, Q> call(vec<4, uint, Q> const& v, uint Mask, uint Shift) + { + __m128i const set0 = v.data; + + __m128i const set1 = _mm_set1_epi32(static_cast(Mask)); + __m128i const and0 = _mm_and_si128(set0, set1); + __m128i const sft0 = _mm_slli_epi32(set0, Shift); + __m128i const and1 = _mm_and_si128(sft0, set1); + __m128i const add0 = _mm_add_epi32(and0, and1); + + return add0; + } + }; +}//namespace detail + +# if GLM_ARCH & GLM_ARCH_AVX_BIT + template<> + GLM_FUNC_QUALIFIER int bitCount(uint x) + { + return _mm_popcnt_u32(x); + } + +# if(GLM_MODEL == GLM_MODEL_64) + template<> + GLM_FUNC_QUALIFIER int bitCount(detail::uint64 x) + { + return static_cast(_mm_popcnt_u64(x)); + } +# endif//GLM_MODEL +# endif//GLM_ARCH + +}//namespace glm + +#endif//GLM_ARCH & GLM_ARCH_SSE2_BIT diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/func_matrix.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/func_matrix.inl new file mode 100644 index 0000000000000000000000000000000000000000..893f0596bde493dd2549af0afe819048eeb13b94 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/func_matrix.inl @@ -0,0 +1,443 @@ +#include "../geometric.hpp" +#include + +namespace glm{ +namespace detail +{ + template + struct compute_matrixCompMult + { + GLM_FUNC_QUALIFIER static mat call(mat const& x, mat const& y) + { + mat Result; + for(length_t i = 0; i < Result.length(); ++i) + Result[i] = x[i] * y[i]; + return Result; + } + }; + + template + struct compute_matrixCompMult_type { + GLM_FUNC_QUALIFIER static mat call(mat const& x, mat const& y) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_GENTYPE, + "'matrixCompMult' only accept floating-point inputs, include to discard this restriction."); + return detail::compute_matrixCompMult::value>::call(x, y); + } + }; + + template + struct compute_outerProduct { + GLM_FUNC_QUALIFIER static typename detail::outerProduct_trait::type call(vec const& c, vec const& r) + { + typename detail::outerProduct_trait::type m; + for(length_t i = 0; i < m.length(); ++i) + m[i] = c * r[i]; + return m; + } + }; + + template + struct compute_outerProduct_type { + GLM_FUNC_QUALIFIER static typename detail::outerProduct_trait::type call(vec const& c, vec const& r) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_GENTYPE, + "'outerProduct' only accept floating-point inputs, include to discard this restriction."); + + return detail::compute_outerProduct::call(c, r); + } + }; + + template + struct compute_transpose{}; + + template + struct compute_transpose<2, 2, T, Q, Aligned> + { + GLM_FUNC_QUALIFIER static mat<2, 2, T, Q> call(mat<2, 2, T, Q> const& m) + { + mat<2, 2, T, Q> Result; + Result[0][0] = m[0][0]; + Result[0][1] = m[1][0]; + Result[1][0] = m[0][1]; + Result[1][1] = m[1][1]; + return Result; + } + }; + + template + struct compute_transpose<2, 3, T, Q, Aligned> + { + GLM_FUNC_QUALIFIER static mat<3, 2, T, Q> call(mat<2, 3, T, Q> const& m) + { + mat<3,2, T, Q> Result; + Result[0][0] = m[0][0]; + Result[0][1] = m[1][0]; + Result[1][0] = m[0][1]; + Result[1][1] = m[1][1]; + Result[2][0] = m[0][2]; + Result[2][1] = m[1][2]; + return Result; + } + }; + + template + struct compute_transpose<2, 4, T, Q, Aligned> + { + GLM_FUNC_QUALIFIER static mat<4, 2, T, Q> call(mat<2, 4, T, Q> const& m) + { + mat<4, 2, T, Q> Result; + Result[0][0] = m[0][0]; + Result[0][1] = m[1][0]; + Result[1][0] = m[0][1]; + Result[1][1] = m[1][1]; + Result[2][0] = m[0][2]; + Result[2][1] = m[1][2]; + Result[3][0] = m[0][3]; + Result[3][1] = m[1][3]; + return Result; + } + }; + + template + struct compute_transpose<3, 2, T, Q, Aligned> + { + GLM_FUNC_QUALIFIER static mat<2, 3, T, Q> call(mat<3, 2, T, Q> const& m) + { + mat<2, 3, T, Q> Result; + Result[0][0] = m[0][0]; + Result[0][1] = m[1][0]; + Result[0][2] = m[2][0]; + Result[1][0] = m[0][1]; + Result[1][1] = m[1][1]; + Result[1][2] = m[2][1]; + return Result; + } + }; + + template + struct compute_transpose<3, 3, T, Q, Aligned> + { + GLM_FUNC_QUALIFIER static mat<3, 3, T, Q> call(mat<3, 3, T, Q> const& m) + { + mat<3, 3, T, Q> Result; + Result[0][0] = m[0][0]; + Result[0][1] = m[1][0]; + Result[0][2] = m[2][0]; + + Result[1][0] = m[0][1]; + Result[1][1] = m[1][1]; + Result[1][2] = m[2][1]; + + Result[2][0] = m[0][2]; + Result[2][1] = m[1][2]; + Result[2][2] = m[2][2]; + return Result; + } + }; + + template + struct compute_transpose<3, 4, T, Q, Aligned> + { + GLM_FUNC_QUALIFIER static mat<4, 3, T, Q> call(mat<3, 4, T, Q> const& m) + { + mat<4, 3, T, Q> Result; + Result[0][0] = m[0][0]; + Result[0][1] = m[1][0]; + Result[0][2] = m[2][0]; + Result[1][0] = m[0][1]; + Result[1][1] = m[1][1]; + Result[1][2] = m[2][1]; + Result[2][0] = m[0][2]; + Result[2][1] = m[1][2]; + Result[2][2] = m[2][2]; + Result[3][0] = m[0][3]; + Result[3][1] = m[1][3]; + Result[3][2] = m[2][3]; + return Result; + } + }; + + template + struct compute_transpose<4, 2, T, Q, Aligned> + { + GLM_FUNC_QUALIFIER static mat<2, 4, T, Q> call(mat<4, 2, T, Q> const& m) + { + mat<2, 4, T, Q> Result; + Result[0][0] = m[0][0]; + Result[0][1] = m[1][0]; + Result[0][2] = m[2][0]; + Result[0][3] = m[3][0]; + Result[1][0] = m[0][1]; + Result[1][1] = m[1][1]; + Result[1][2] = m[2][1]; + Result[1][3] = m[3][1]; + return Result; + } + }; + + template + struct compute_transpose<4, 3, T, Q, Aligned> + { + GLM_FUNC_QUALIFIER static mat<3, 4, T, Q> call(mat<4, 3, T, Q> const& m) + { + mat<3, 4, T, Q> Result; + Result[0][0] = m[0][0]; + Result[0][1] = m[1][0]; + Result[0][2] = m[2][0]; + Result[0][3] = m[3][0]; + Result[1][0] = m[0][1]; + Result[1][1] = m[1][1]; + Result[1][2] = m[2][1]; + Result[1][3] = m[3][1]; + Result[2][0] = m[0][2]; + Result[2][1] = m[1][2]; + Result[2][2] = m[2][2]; + Result[2][3] = m[3][2]; + return Result; + } + }; + + template + struct compute_transpose<4, 4, T, Q, Aligned> + { + GLM_FUNC_QUALIFIER static mat<4, 4, T, Q> call(mat<4, 4, T, Q> const& m) + { + mat<4, 4, T, Q> Result; + Result[0][0] = m[0][0]; + Result[0][1] = m[1][0]; + Result[0][2] = m[2][0]; + Result[0][3] = m[3][0]; + + Result[1][0] = m[0][1]; + Result[1][1] = m[1][1]; + Result[1][2] = m[2][1]; + Result[1][3] = m[3][1]; + + Result[2][0] = m[0][2]; + Result[2][1] = m[1][2]; + Result[2][2] = m[2][2]; + Result[2][3] = m[3][2]; + + Result[3][0] = m[0][3]; + Result[3][1] = m[1][3]; + Result[3][2] = m[2][3]; + Result[3][3] = m[3][3]; + return Result; + } + }; + + template + struct compute_transpose_type { + GLM_FUNC_QUALIFIER static mat call(mat const& m) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_GENTYPE, + "'transpose' only accept floating-point inputs, include to discard this restriction."); + return detail::compute_transpose::value>::call(m); + } + }; + + template + struct compute_determinant{}; + + template + struct compute_determinant<2, 2, T, Q, Aligned> + { + GLM_FUNC_QUALIFIER static T call(mat<2, 2, T, Q> const& m) + { + return m[0][0] * m[1][1] - m[1][0] * m[0][1]; + } + }; + + template + struct compute_determinant<3, 3, T, Q, Aligned> + { + GLM_FUNC_QUALIFIER static T call(mat<3, 3, T, Q> const& m) + { + return + + m[0][0] * (m[1][1] * m[2][2] - m[2][1] * m[1][2]) + - m[1][0] * (m[0][1] * m[2][2] - m[2][1] * m[0][2]) + + m[2][0] * (m[0][1] * m[1][2] - m[1][1] * m[0][2]); + } + }; + + template + struct compute_determinant<4, 4, T, Q, Aligned> + { + GLM_FUNC_QUALIFIER static T call(mat<4, 4, T, Q> const& m) + { + T SubFactor00 = m[2][2] * m[3][3] - m[3][2] * m[2][3]; + T SubFactor01 = m[2][1] * m[3][3] - m[3][1] * m[2][3]; + T SubFactor02 = m[2][1] * m[3][2] - m[3][1] * m[2][2]; + T SubFactor03 = m[2][0] * m[3][3] - m[3][0] * m[2][3]; + T SubFactor04 = m[2][0] * m[3][2] - m[3][0] * m[2][2]; + T SubFactor05 = m[2][0] * m[3][1] - m[3][0] * m[2][1]; + + vec<4, T, Q> DetCof( + + (m[1][1] * SubFactor00 - m[1][2] * SubFactor01 + m[1][3] * SubFactor02), + - (m[1][0] * SubFactor00 - m[1][2] * SubFactor03 + m[1][3] * SubFactor04), + + (m[1][0] * SubFactor01 - m[1][1] * SubFactor03 + m[1][3] * SubFactor05), + - (m[1][0] * SubFactor02 - m[1][1] * SubFactor04 + m[1][2] * SubFactor05)); + + return + m[0][0] * DetCof[0] + m[0][1] * DetCof[1] + + m[0][2] * DetCof[2] + m[0][3] * DetCof[3]; + } + }; + + template + struct compute_determinant_type{ + + GLM_FUNC_QUALIFIER static T call(mat const& m) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_GENTYPE, + "'determinant' only accept floating-point inputs, include to discard this restriction."); + return detail::compute_determinant::value>::call(m); + } + }; + + template + struct compute_inverse{}; + + template + struct compute_inverse<2, 2, T, Q, Aligned> + { + GLM_FUNC_QUALIFIER static mat<2, 2, T, Q> call(mat<2, 2, T, Q> const& m) + { + T OneOverDeterminant = static_cast(1) / ( + + m[0][0] * m[1][1] + - m[1][0] * m[0][1]); + + mat<2, 2, T, Q> Inverse( + + m[1][1] * OneOverDeterminant, + - m[0][1] * OneOverDeterminant, + - m[1][0] * OneOverDeterminant, + + m[0][0] * OneOverDeterminant); + + return Inverse; + } + }; + + template + struct compute_inverse<3, 3, T, Q, Aligned> + { + GLM_FUNC_QUALIFIER static mat<3, 3, T, Q> call(mat<3, 3, T, Q> const& m) + { + T OneOverDeterminant = static_cast(1) / ( + + m[0][0] * (m[1][1] * m[2][2] - m[2][1] * m[1][2]) + - m[1][0] * (m[0][1] * m[2][2] - m[2][1] * m[0][2]) + + m[2][0] * (m[0][1] * m[1][2] - m[1][1] * m[0][2])); + + mat<3, 3, T, Q> Inverse; + Inverse[0][0] = + (m[1][1] * m[2][2] - m[2][1] * m[1][2]) * OneOverDeterminant; + Inverse[1][0] = - (m[1][0] * m[2][2] - m[2][0] * m[1][2]) * OneOverDeterminant; + Inverse[2][0] = + (m[1][0] * m[2][1] - m[2][0] * m[1][1]) * OneOverDeterminant; + Inverse[0][1] = - (m[0][1] * m[2][2] - m[2][1] * m[0][2]) * OneOverDeterminant; + Inverse[1][1] = + (m[0][0] * m[2][2] - m[2][0] * m[0][2]) * OneOverDeterminant; + Inverse[2][1] = - (m[0][0] * m[2][1] - m[2][0] * m[0][1]) * OneOverDeterminant; + Inverse[0][2] = + (m[0][1] * m[1][2] - m[1][1] * m[0][2]) * OneOverDeterminant; + Inverse[1][2] = - (m[0][0] * m[1][2] - m[1][0] * m[0][2]) * OneOverDeterminant; + Inverse[2][2] = + (m[0][0] * m[1][1] - m[1][0] * m[0][1]) * OneOverDeterminant; + + return Inverse; + } + }; + + template + struct compute_inverse<4, 4, T, Q, Aligned> + { + GLM_FUNC_QUALIFIER static mat<4, 4, T, Q> call(mat<4, 4, T, Q> const& m) + { + T Coef00 = m[2][2] * m[3][3] - m[3][2] * m[2][3]; + T Coef02 = m[1][2] * m[3][3] - m[3][2] * m[1][3]; + T Coef03 = m[1][2] * m[2][3] - m[2][2] * m[1][3]; + + T Coef04 = m[2][1] * m[3][3] - m[3][1] * m[2][3]; + T Coef06 = m[1][1] * m[3][3] - m[3][1] * m[1][3]; + T Coef07 = m[1][1] * m[2][3] - m[2][1] * m[1][3]; + + T Coef08 = m[2][1] * m[3][2] - m[3][1] * m[2][2]; + T Coef10 = m[1][1] * m[3][2] - m[3][1] * m[1][2]; + T Coef11 = m[1][1] * m[2][2] - m[2][1] * m[1][2]; + + T Coef12 = m[2][0] * m[3][3] - m[3][0] * m[2][3]; + T Coef14 = m[1][0] * m[3][3] - m[3][0] * m[1][3]; + T Coef15 = m[1][0] * m[2][3] - m[2][0] * m[1][3]; + + T Coef16 = m[2][0] * m[3][2] - m[3][0] * m[2][2]; + T Coef18 = m[1][0] * m[3][2] - m[3][0] * m[1][2]; + T Coef19 = m[1][0] * m[2][2] - m[2][0] * m[1][2]; + + T Coef20 = m[2][0] * m[3][1] - m[3][0] * m[2][1]; + T Coef22 = m[1][0] * m[3][1] - m[3][0] * m[1][1]; + T Coef23 = m[1][0] * m[2][1] - m[2][0] * m[1][1]; + + vec<4, T, Q> Fac0(Coef00, Coef00, Coef02, Coef03); + vec<4, T, Q> Fac1(Coef04, Coef04, Coef06, Coef07); + vec<4, T, Q> Fac2(Coef08, Coef08, Coef10, Coef11); + vec<4, T, Q> Fac3(Coef12, Coef12, Coef14, Coef15); + vec<4, T, Q> Fac4(Coef16, Coef16, Coef18, Coef19); + vec<4, T, Q> Fac5(Coef20, Coef20, Coef22, Coef23); + + vec<4, T, Q> Vec0(m[1][0], m[0][0], m[0][0], m[0][0]); + vec<4, T, Q> Vec1(m[1][1], m[0][1], m[0][1], m[0][1]); + vec<4, T, Q> Vec2(m[1][2], m[0][2], m[0][2], m[0][2]); + vec<4, T, Q> Vec3(m[1][3], m[0][3], m[0][3], m[0][3]); + + vec<4, T, Q> Inv0(Vec1 * Fac0 - Vec2 * Fac1 + Vec3 * Fac2); + vec<4, T, Q> Inv1(Vec0 * Fac0 - Vec2 * Fac3 + Vec3 * Fac4); + vec<4, T, Q> Inv2(Vec0 * Fac1 - Vec1 * Fac3 + Vec3 * Fac5); + vec<4, T, Q> Inv3(Vec0 * Fac2 - Vec1 * Fac4 + Vec2 * Fac5); + + vec<4, T, Q> SignA(+1, -1, +1, -1); + vec<4, T, Q> SignB(-1, +1, -1, +1); + mat<4, 4, T, Q> Inverse(Inv0 * SignA, Inv1 * SignB, Inv2 * SignA, Inv3 * SignB); + + vec<4, T, Q> Row0(Inverse[0][0], Inverse[1][0], Inverse[2][0], Inverse[3][0]); + + vec<4, T, Q> Dot0(m[0] * Row0); + T Dot1 = (Dot0.x + Dot0.y) + (Dot0.z + Dot0.w); + + T OneOverDeterminant = static_cast(1) / Dot1; + + return Inverse * OneOverDeterminant; + } + }; +}//namespace detail + + template + GLM_FUNC_QUALIFIER mat matrixCompMult(mat const& x, mat const& y) + { + return detail::compute_matrixCompMult_type::is_iec559, detail::is_aligned::value>::call(x, y); + } + + template + GLM_FUNC_QUALIFIER typename detail::outerProduct_trait::type outerProduct(vec const& c, vec const& r) + { + return detail::compute_outerProduct_type::is_iec559>::call(c, r); + } + + template + GLM_FUNC_QUALIFIER typename mat::transpose_type transpose(mat const& m) + { + return detail::compute_transpose_type::is_iec559, detail::is_aligned::value>::call(m); + } + + template + GLM_FUNC_QUALIFIER T determinant(mat const& m) + { + return detail::compute_determinant_type::is_iec559, detail::is_aligned::value>::call(m); + } + + template + GLM_FUNC_QUALIFIER mat inverse(mat const& m) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_GENTYPE, "'inverse' only accept floating-point inputs"); + return detail::compute_inverse::value>::call(m); + } +}//namespace glm + +#if GLM_CONFIG_SIMD == GLM_ENABLE +# include "func_matrix_simd.inl" +#endif + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/func_matrix_simd.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/func_matrix_simd.inl new file mode 100644 index 0000000000000000000000000000000000000000..0b7d660bfabb0fb23b0c8c17202e14f417bc4a02 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/func_matrix_simd.inl @@ -0,0 +1,252 @@ +#if GLM_ARCH & GLM_ARCH_SSE2_BIT + +#include "type_mat4x4.hpp" +#include "../geometric.hpp" +#include "../simd/matrix.h" +#include + +namespace glm{ +namespace detail +{ +# if GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE + template + struct compute_matrixCompMult<4, 4, float, Q, true> + { + GLM_STATIC_ASSERT(detail::is_aligned::value, "Specialization requires aligned"); + + GLM_FUNC_QUALIFIER static mat<4, 4, float, Q> call(mat<4, 4, float, Q> const& x, mat<4, 4, float, Q> const& y) + { + mat<4, 4, float, Q> Result; + glm_mat4_matrixCompMult( + &x[0].data, + &y[0].data, + &Result[0].data); + return Result; + } + }; +# endif + + template + struct compute_transpose<4, 4, float, Q, true> + { + GLM_FUNC_QUALIFIER static mat<4, 4, float, Q> call(mat<4, 4, float, Q> const& m) + { + mat<4, 4, float, Q> Result; + glm_mat4_transpose(&m[0].data, &Result[0].data); + return Result; + } + }; + + template + struct compute_determinant<4, 4, float, Q, true> + { + GLM_FUNC_QUALIFIER static float call(mat<4, 4, float, Q> const& m) + { + return _mm_cvtss_f32(glm_mat4_determinant(&m[0].data)); + } + }; + + template + struct compute_inverse<4, 4, float, Q, true> + { + GLM_FUNC_QUALIFIER static mat<4, 4, float, Q> call(mat<4, 4, float, Q> const& m) + { + mat<4, 4, float, Q> Result; + glm_mat4_inverse(&m[0].data, &Result[0].data); + return Result; + } + }; +}//namespace detail + +# if GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE + template<> + GLM_FUNC_QUALIFIER mat<4, 4, float, aligned_lowp> outerProduct<4, 4, float, aligned_lowp>(vec<4, float, aligned_lowp> const& c, vec<4, float, aligned_lowp> const& r) + { + __m128 NativeResult[4]; + glm_mat4_outerProduct(c.data, r.data, NativeResult); + mat<4, 4, float, aligned_lowp> Result; + std::memcpy(&Result[0], &NativeResult[0], sizeof(Result)); + return Result; + } + + template<> + GLM_FUNC_QUALIFIER mat<4, 4, float, aligned_mediump> outerProduct<4, 4, float, aligned_mediump>(vec<4, float, aligned_mediump> const& c, vec<4, float, aligned_mediump> const& r) + { + __m128 NativeResult[4]; + glm_mat4_outerProduct(c.data, r.data, NativeResult); + mat<4, 4, float, aligned_mediump> Result; + std::memcpy(&Result[0], &NativeResult[0], sizeof(Result)); + return Result; + } + + template<> + GLM_FUNC_QUALIFIER mat<4, 4, float, aligned_highp> outerProduct<4, 4, float, aligned_highp>(vec<4, float, aligned_highp> const& c, vec<4, float, aligned_highp> const& r) + { + __m128 NativeResult[4]; + glm_mat4_outerProduct(c.data, r.data, NativeResult); + mat<4, 4, float, aligned_highp> Result; + std::memcpy(&Result[0], &NativeResult[0], sizeof(Result)); + return Result; + } +# endif +}//namespace glm + +#elif GLM_ARCH & GLM_ARCH_NEON_BIT + +namespace glm { +#if GLM_LANG & GLM_LANG_CXX11_FLAG + template + GLM_FUNC_QUALIFIER + typename std::enable_if::value, mat<4, 4, float, Q>>::type + operator*(mat<4, 4, float, Q> const & m1, mat<4, 4, float, Q> const & m2) + { + auto MulRow = [&](int l) { + float32x4_t const SrcA = m2[l].data; + + float32x4_t r = neon::mul_lane(m1[0].data, SrcA, 0); + r = neon::madd_lane(r, m1[1].data, SrcA, 1); + r = neon::madd_lane(r, m1[2].data, SrcA, 2); + r = neon::madd_lane(r, m1[3].data, SrcA, 3); + + return r; + }; + + mat<4, 4, float, aligned_highp> Result; + Result[0].data = MulRow(0); + Result[1].data = MulRow(1); + Result[2].data = MulRow(2); + Result[3].data = MulRow(3); + + return Result; + } +#endif // CXX11 + +namespace detail +{ + template + struct compute_inverse<4, 4, float, Q, true> + { + GLM_FUNC_QUALIFIER static mat<4, 4, float, Q> call(mat<4, 4, float, Q> const& m) + { + float32x4_t const& m0 = m[0].data; + float32x4_t const& m1 = m[1].data; + float32x4_t const& m2 = m[2].data; + float32x4_t const& m3 = m[3].data; + + // m[2][2] * m[3][3] - m[3][2] * m[2][3]; + // m[2][2] * m[3][3] - m[3][2] * m[2][3]; + // m[1][2] * m[3][3] - m[3][2] * m[1][3]; + // m[1][2] * m[2][3] - m[2][2] * m[1][3]; + + float32x4_t Fac0; + { + float32x4_t w0 = vcombine_f32(neon::dup_lane(m2, 2), neon::dup_lane(m1, 2)); + float32x4_t w1 = neon::copy_lane(neon::dupq_lane(m3, 3), 3, m2, 3); + float32x4_t w2 = neon::copy_lane(neon::dupq_lane(m3, 2), 3, m2, 2); + float32x4_t w3 = vcombine_f32(neon::dup_lane(m2, 3), neon::dup_lane(m1, 3)); + Fac0 = w0 * w1 - w2 * w3; + } + + // m[2][1] * m[3][3] - m[3][1] * m[2][3]; + // m[2][1] * m[3][3] - m[3][1] * m[2][3]; + // m[1][1] * m[3][3] - m[3][1] * m[1][3]; + // m[1][1] * m[2][3] - m[2][1] * m[1][3]; + + float32x4_t Fac1; + { + float32x4_t w0 = vcombine_f32(neon::dup_lane(m2, 1), neon::dup_lane(m1, 1)); + float32x4_t w1 = neon::copy_lane(neon::dupq_lane(m3, 3), 3, m2, 3); + float32x4_t w2 = neon::copy_lane(neon::dupq_lane(m3, 1), 3, m2, 1); + float32x4_t w3 = vcombine_f32(neon::dup_lane(m2, 3), neon::dup_lane(m1, 3)); + Fac1 = w0 * w1 - w2 * w3; + } + + // m[2][1] * m[3][2] - m[3][1] * m[2][2]; + // m[2][1] * m[3][2] - m[3][1] * m[2][2]; + // m[1][1] * m[3][2] - m[3][1] * m[1][2]; + // m[1][1] * m[2][2] - m[2][1] * m[1][2]; + + float32x4_t Fac2; + { + float32x4_t w0 = vcombine_f32(neon::dup_lane(m2, 1), neon::dup_lane(m1, 1)); + float32x4_t w1 = neon::copy_lane(neon::dupq_lane(m3, 2), 3, m2, 2); + float32x4_t w2 = neon::copy_lane(neon::dupq_lane(m3, 1), 3, m2, 1); + float32x4_t w3 = vcombine_f32(neon::dup_lane(m2, 2), neon::dup_lane(m1, 2)); + Fac2 = w0 * w1 - w2 * w3; + } + + // m[2][0] * m[3][3] - m[3][0] * m[2][3]; + // m[2][0] * m[3][3] - m[3][0] * m[2][3]; + // m[1][0] * m[3][3] - m[3][0] * m[1][3]; + // m[1][0] * m[2][3] - m[2][0] * m[1][3]; + + float32x4_t Fac3; + { + float32x4_t w0 = vcombine_f32(neon::dup_lane(m2, 0), neon::dup_lane(m1, 0)); + float32x4_t w1 = neon::copy_lane(neon::dupq_lane(m3, 3), 3, m2, 3); + float32x4_t w2 = neon::copy_lane(neon::dupq_lane(m3, 0), 3, m2, 0); + float32x4_t w3 = vcombine_f32(neon::dup_lane(m2, 3), neon::dup_lane(m1, 3)); + Fac3 = w0 * w1 - w2 * w3; + } + + // m[2][0] * m[3][2] - m[3][0] * m[2][2]; + // m[2][0] * m[3][2] - m[3][0] * m[2][2]; + // m[1][0] * m[3][2] - m[3][0] * m[1][2]; + // m[1][0] * m[2][2] - m[2][0] * m[1][2]; + + float32x4_t Fac4; + { + float32x4_t w0 = vcombine_f32(neon::dup_lane(m2, 0), neon::dup_lane(m1, 0)); + float32x4_t w1 = neon::copy_lane(neon::dupq_lane(m3, 2), 3, m2, 2); + float32x4_t w2 = neon::copy_lane(neon::dupq_lane(m3, 0), 3, m2, 0); + float32x4_t w3 = vcombine_f32(neon::dup_lane(m2, 2), neon::dup_lane(m1, 2)); + Fac4 = w0 * w1 - w2 * w3; + } + + // m[2][0] * m[3][1] - m[3][0] * m[2][1]; + // m[2][0] * m[3][1] - m[3][0] * m[2][1]; + // m[1][0] * m[3][1] - m[3][0] * m[1][1]; + // m[1][0] * m[2][1] - m[2][0] * m[1][1]; + + float32x4_t Fac5; + { + float32x4_t w0 = vcombine_f32(neon::dup_lane(m2, 0), neon::dup_lane(m1, 0)); + float32x4_t w1 = neon::copy_lane(neon::dupq_lane(m3, 1), 3, m2, 1); + float32x4_t w2 = neon::copy_lane(neon::dupq_lane(m3, 0), 3, m2, 0); + float32x4_t w3 = vcombine_f32(neon::dup_lane(m2, 1), neon::dup_lane(m1, 1)); + Fac5 = w0 * w1 - w2 * w3; + } + + float32x4_t Vec0 = neon::copy_lane(neon::dupq_lane(m0, 0), 0, m1, 0); // (m[1][0], m[0][0], m[0][0], m[0][0]); + float32x4_t Vec1 = neon::copy_lane(neon::dupq_lane(m0, 1), 0, m1, 1); // (m[1][1], m[0][1], m[0][1], m[0][1]); + float32x4_t Vec2 = neon::copy_lane(neon::dupq_lane(m0, 2), 0, m1, 2); // (m[1][2], m[0][2], m[0][2], m[0][2]); + float32x4_t Vec3 = neon::copy_lane(neon::dupq_lane(m0, 3), 0, m1, 3); // (m[1][3], m[0][3], m[0][3], m[0][3]); + + float32x4_t Inv0 = Vec1 * Fac0 - Vec2 * Fac1 + Vec3 * Fac2; + float32x4_t Inv1 = Vec0 * Fac0 - Vec2 * Fac3 + Vec3 * Fac4; + float32x4_t Inv2 = Vec0 * Fac1 - Vec1 * Fac3 + Vec3 * Fac5; + float32x4_t Inv3 = Vec0 * Fac2 - Vec1 * Fac4 + Vec2 * Fac5; + + float32x4_t r0 = float32x4_t{-1, +1, -1, +1} * Inv0; + float32x4_t r1 = float32x4_t{+1, -1, +1, -1} * Inv1; + float32x4_t r2 = float32x4_t{-1, +1, -1, +1} * Inv2; + float32x4_t r3 = float32x4_t{+1, -1, +1, -1} * Inv3; + + float32x4_t det = neon::mul_lane(r0, m0, 0); + det = neon::madd_lane(det, r1, m0, 1); + det = neon::madd_lane(det, r2, m0, 2); + det = neon::madd_lane(det, r3, m0, 3); + + float32x4_t rdet = vdupq_n_f32(1 / vgetq_lane_f32(det, 0)); + + mat<4, 4, float, Q> r; + r[0].data = vmulq_f32(r0, rdet); + r[1].data = vmulq_f32(r1, rdet); + r[2].data = vmulq_f32(r2, rdet); + r[3].data = vmulq_f32(r3, rdet); + return r; + } + }; +}//namespace detail +}//namespace glm +#endif diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/func_packing.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/func_packing.inl new file mode 100644 index 0000000000000000000000000000000000000000..6d150541dbd86ae307feb637355fef2bd07662aa --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/func_packing.inl @@ -0,0 +1,189 @@ +/// @ref core +/// @file glm/detail/func_packing.inl + +#include "../common.hpp" +#include "type_half.hpp" + +namespace glm +{ + GLM_FUNC_QUALIFIER uint packUnorm2x16(vec2 const& v) + { + union + { + unsigned short in[2]; + uint out; + } u; + + vec<2, unsigned short, defaultp> result(round(clamp(v, 0.0f, 1.0f) * 65535.0f)); + + u.in[0] = result[0]; + u.in[1] = result[1]; + + return u.out; + } + + GLM_FUNC_QUALIFIER vec2 unpackUnorm2x16(uint p) + { + union + { + uint in; + unsigned short out[2]; + } u; + + u.in = p; + + return vec2(u.out[0], u.out[1]) * 1.5259021896696421759365224689097e-5f; + } + + GLM_FUNC_QUALIFIER uint packSnorm2x16(vec2 const& v) + { + union + { + signed short in[2]; + uint out; + } u; + + vec<2, short, defaultp> result(round(clamp(v, -1.0f, 1.0f) * 32767.0f)); + + u.in[0] = result[0]; + u.in[1] = result[1]; + + return u.out; + } + + GLM_FUNC_QUALIFIER vec2 unpackSnorm2x16(uint p) + { + union + { + uint in; + signed short out[2]; + } u; + + u.in = p; + + return clamp(vec2(u.out[0], u.out[1]) * 3.0518509475997192297128208258309e-5f, -1.0f, 1.0f); + } + + GLM_FUNC_QUALIFIER uint packUnorm4x8(vec4 const& v) + { + union + { + unsigned char in[4]; + uint out; + } u; + + vec<4, unsigned char, defaultp> result(round(clamp(v, 0.0f, 1.0f) * 255.0f)); + + u.in[0] = result[0]; + u.in[1] = result[1]; + u.in[2] = result[2]; + u.in[3] = result[3]; + + return u.out; + } + + GLM_FUNC_QUALIFIER vec4 unpackUnorm4x8(uint p) + { + union + { + uint in; + unsigned char out[4]; + } u; + + u.in = p; + + return vec4(u.out[0], u.out[1], u.out[2], u.out[3]) * 0.0039215686274509803921568627451f; + } + + GLM_FUNC_QUALIFIER uint packSnorm4x8(vec4 const& v) + { + union + { + signed char in[4]; + uint out; + } u; + + vec<4, signed char, defaultp> result(round(clamp(v, -1.0f, 1.0f) * 127.0f)); + + u.in[0] = result[0]; + u.in[1] = result[1]; + u.in[2] = result[2]; + u.in[3] = result[3]; + + return u.out; + } + + GLM_FUNC_QUALIFIER glm::vec4 unpackSnorm4x8(uint p) + { + union + { + uint in; + signed char out[4]; + } u; + + u.in = p; + + return clamp(vec4(u.out[0], u.out[1], u.out[2], u.out[3]) * 0.0078740157480315f, -1.0f, 1.0f); + } + + GLM_FUNC_QUALIFIER double packDouble2x32(uvec2 const& v) + { + union + { + uint in[2]; + double out; + } u; + + u.in[0] = v[0]; + u.in[1] = v[1]; + + return u.out; + } + + GLM_FUNC_QUALIFIER uvec2 unpackDouble2x32(double v) + { + union + { + double in; + uint out[2]; + } u; + + u.in = v; + + return uvec2(u.out[0], u.out[1]); + } + + GLM_FUNC_QUALIFIER uint packHalf2x16(vec2 const& v) + { + union + { + signed short in[2]; + uint out; + } u; + + u.in[0] = detail::toFloat16(v.x); + u.in[1] = detail::toFloat16(v.y); + + return u.out; + } + + GLM_FUNC_QUALIFIER vec2 unpackHalf2x16(uint v) + { + union + { + uint in; + signed short out[2]; + } u; + + u.in = v; + + return vec2( + detail::toFloat32(u.out[0]), + detail::toFloat32(u.out[1])); + } +}//namespace glm + +#if GLM_CONFIG_SIMD == GLM_ENABLE +# include "func_packing_simd.inl" +#endif + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/func_packing_simd.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/func_packing_simd.inl new file mode 100644 index 0000000000000000000000000000000000000000..b8b5a98452f8d1c95c4fb137f12a126fd329ce5f --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/func_packing_simd.inl @@ -0,0 +1,6 @@ +namespace glm{ +namespace detail +{ + +}//namespace detail +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/func_trigonometric.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/func_trigonometric.inl new file mode 100644 index 0000000000000000000000000000000000000000..1b0ad3bbe1bbffce607567016e1fc8eb2ec6d6f1 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/func_trigonometric.inl @@ -0,0 +1,197 @@ +#include "_vectorize.hpp" +#include +#include + +namespace glm +{ + // radians + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType radians(genType degrees) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'radians' only accept floating-point input"); + + return degrees * static_cast(0.01745329251994329576923690768489); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec radians(vec const& v) + { + return detail::functor1::call(radians, v); + } + + // degrees + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType degrees(genType radians) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'degrees' only accept floating-point input"); + + return radians * static_cast(57.295779513082320876798154814105); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec degrees(vec const& v) + { + return detail::functor1::call(degrees, v); + } + + // sin + using ::std::sin; + + template + GLM_FUNC_QUALIFIER vec sin(vec const& v) + { + return detail::functor1::call(sin, v); + } + + // cos + using std::cos; + + template + GLM_FUNC_QUALIFIER vec cos(vec const& v) + { + return detail::functor1::call(cos, v); + } + + // tan + using std::tan; + + template + GLM_FUNC_QUALIFIER vec tan(vec const& v) + { + return detail::functor1::call(tan, v); + } + + // asin + using std::asin; + + template + GLM_FUNC_QUALIFIER vec asin(vec const& v) + { + return detail::functor1::call(asin, v); + } + + // acos + using std::acos; + + template + GLM_FUNC_QUALIFIER vec acos(vec const& v) + { + return detail::functor1::call(acos, v); + } + + // atan + template + GLM_FUNC_QUALIFIER genType atan(genType y, genType x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'atan' only accept floating-point input"); + + return ::std::atan2(y, x); + } + + template + GLM_FUNC_QUALIFIER vec atan(vec const& a, vec const& b) + { + return detail::functor2::call(::std::atan2, a, b); + } + + using std::atan; + + template + GLM_FUNC_QUALIFIER vec atan(vec const& v) + { + return detail::functor1::call(atan, v); + } + + // sinh + using std::sinh; + + template + GLM_FUNC_QUALIFIER vec sinh(vec const& v) + { + return detail::functor1::call(sinh, v); + } + + // cosh + using std::cosh; + + template + GLM_FUNC_QUALIFIER vec cosh(vec const& v) + { + return detail::functor1::call(cosh, v); + } + + // tanh + using std::tanh; + + template + GLM_FUNC_QUALIFIER vec tanh(vec const& v) + { + return detail::functor1::call(tanh, v); + } + + // asinh +# if GLM_HAS_CXX11_STL + using std::asinh; +# else + template + GLM_FUNC_QUALIFIER genType asinh(genType x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'asinh' only accept floating-point input"); + + return (x < static_cast(0) ? static_cast(-1) : (x > static_cast(0) ? static_cast(1) : static_cast(0))) * log(std::abs(x) + sqrt(static_cast(1) + x * x)); + } +# endif + + template + GLM_FUNC_QUALIFIER vec asinh(vec const& v) + { + return detail::functor1::call(asinh, v); + } + + // acosh +# if GLM_HAS_CXX11_STL + using std::acosh; +# else + template + GLM_FUNC_QUALIFIER genType acosh(genType x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'acosh' only accept floating-point input"); + + if(x < static_cast(1)) + return static_cast(0); + return log(x + sqrt(x * x - static_cast(1))); + } +# endif + + template + GLM_FUNC_QUALIFIER vec acosh(vec const& v) + { + return detail::functor1::call(acosh, v); + } + + // atanh +# if GLM_HAS_CXX11_STL + using std::atanh; +# else + template + GLM_FUNC_QUALIFIER genType atanh(genType x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'atanh' only accept floating-point input"); + + if(std::abs(x) >= static_cast(1)) + return 0; + return static_cast(0.5) * log((static_cast(1) + x) / (static_cast(1) - x)); + } +# endif + + template + GLM_FUNC_QUALIFIER vec atanh(vec const& v) + { + return detail::functor1::call(atanh, v); + } +}//namespace glm + +#if GLM_CONFIG_SIMD == GLM_ENABLE +# include "func_trigonometric_simd.inl" +#endif + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/func_trigonometric_simd.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/func_trigonometric_simd.inl new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/func_vector_relational.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/func_vector_relational.inl new file mode 100644 index 0000000000000000000000000000000000000000..67653fba9afd42869a5eec9ee236a0f4fedeac0b --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/func_vector_relational.inl @@ -0,0 +1,87 @@ +namespace glm +{ + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec lessThan(vec const& x, vec const& y) + { + vec Result(true); + for(length_t i = 0; i < L; ++i) + Result[i] = x[i] < y[i]; + return Result; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec lessThanEqual(vec const& x, vec const& y) + { + vec Result(true); + for(length_t i = 0; i < L; ++i) + Result[i] = x[i] <= y[i]; + return Result; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec greaterThan(vec const& x, vec const& y) + { + vec Result(true); + for(length_t i = 0; i < L; ++i) + Result[i] = x[i] > y[i]; + return Result; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec greaterThanEqual(vec const& x, vec const& y) + { + vec Result(true); + for(length_t i = 0; i < L; ++i) + Result[i] = x[i] >= y[i]; + return Result; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec equal(vec const& x, vec const& y) + { + vec Result(true); + for(length_t i = 0; i < L; ++i) + Result[i] = x[i] == y[i]; + return Result; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec notEqual(vec const& x, vec const& y) + { + vec Result(true); + for(length_t i = 0; i < L; ++i) + Result[i] = x[i] != y[i]; + return Result; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool any(vec const& v) + { + bool Result = false; + for(length_t i = 0; i < L; ++i) + Result = Result || v[i]; + return Result; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool all(vec const& v) + { + bool Result = true; + for(length_t i = 0; i < L; ++i) + Result = Result && v[i]; + return Result; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec not_(vec const& v) + { + vec Result(true); + for(length_t i = 0; i < L; ++i) + Result[i] = !v[i]; + return Result; + } +}//namespace glm + +#if GLM_CONFIG_SIMD == GLM_ENABLE +# include "func_vector_relational_simd.inl" +#endif diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/func_vector_relational_simd.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/func_vector_relational_simd.inl new file mode 100644 index 0000000000000000000000000000000000000000..b8b5a98452f8d1c95c4fb137f12a126fd329ce5f --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/func_vector_relational_simd.inl @@ -0,0 +1,6 @@ +namespace glm{ +namespace detail +{ + +}//namespace detail +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/glm.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/glm.cpp new file mode 100644 index 0000000000000000000000000000000000000000..aec632f228814914cf3f25c6fe21c23514fd9242 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/glm.cpp @@ -0,0 +1,263 @@ +/// @ref core +/// @file glm/glm.cpp + +#ifndef GLM_ENABLE_EXPERIMENTAL +#define GLM_ENABLE_EXPERIMENTAL +#endif +#include +#include +#include +#include +#include +#include + +namespace glm +{ +// tvec1 type explicit instantiation +template struct vec<1, uint8, lowp>; +template struct vec<1, uint16, lowp>; +template struct vec<1, uint32, lowp>; +template struct vec<1, uint64, lowp>; +template struct vec<1, int8, lowp>; +template struct vec<1, int16, lowp>; +template struct vec<1, int32, lowp>; +template struct vec<1, int64, lowp>; +template struct vec<1, float32, lowp>; +template struct vec<1, float64, lowp>; + +template struct vec<1, uint8, mediump>; +template struct vec<1, uint16, mediump>; +template struct vec<1, uint32, mediump>; +template struct vec<1, uint64, mediump>; +template struct vec<1, int8, mediump>; +template struct vec<1, int16, mediump>; +template struct vec<1, int32, mediump>; +template struct vec<1, int64, mediump>; +template struct vec<1, float32, mediump>; +template struct vec<1, float64, mediump>; + +template struct vec<1, uint8, highp>; +template struct vec<1, uint16, highp>; +template struct vec<1, uint32, highp>; +template struct vec<1, uint64, highp>; +template struct vec<1, int8, highp>; +template struct vec<1, int16, highp>; +template struct vec<1, int32, highp>; +template struct vec<1, int64, highp>; +template struct vec<1, float32, highp>; +template struct vec<1, float64, highp>; + +// tvec2 type explicit instantiation +template struct vec<2, uint8, lowp>; +template struct vec<2, uint16, lowp>; +template struct vec<2, uint32, lowp>; +template struct vec<2, uint64, lowp>; +template struct vec<2, int8, lowp>; +template struct vec<2, int16, lowp>; +template struct vec<2, int32, lowp>; +template struct vec<2, int64, lowp>; +template struct vec<2, float32, lowp>; +template struct vec<2, float64, lowp>; + +template struct vec<2, uint8, mediump>; +template struct vec<2, uint16, mediump>; +template struct vec<2, uint32, mediump>; +template struct vec<2, uint64, mediump>; +template struct vec<2, int8, mediump>; +template struct vec<2, int16, mediump>; +template struct vec<2, int32, mediump>; +template struct vec<2, int64, mediump>; +template struct vec<2, float32, mediump>; +template struct vec<2, float64, mediump>; + +template struct vec<2, uint8, highp>; +template struct vec<2, uint16, highp>; +template struct vec<2, uint32, highp>; +template struct vec<2, uint64, highp>; +template struct vec<2, int8, highp>; +template struct vec<2, int16, highp>; +template struct vec<2, int32, highp>; +template struct vec<2, int64, highp>; +template struct vec<2, float32, highp>; +template struct vec<2, float64, highp>; + +// tvec3 type explicit instantiation +template struct vec<3, uint8, lowp>; +template struct vec<3, uint16, lowp>; +template struct vec<3, uint32, lowp>; +template struct vec<3, uint64, lowp>; +template struct vec<3, int8, lowp>; +template struct vec<3, int16, lowp>; +template struct vec<3, int32, lowp>; +template struct vec<3, int64, lowp>; +template struct vec<3, float32, lowp>; +template struct vec<3, float64, lowp>; + +template struct vec<3, uint8, mediump>; +template struct vec<3, uint16, mediump>; +template struct vec<3, uint32, mediump>; +template struct vec<3, uint64, mediump>; +template struct vec<3, int8, mediump>; +template struct vec<3, int16, mediump>; +template struct vec<3, int32, mediump>; +template struct vec<3, int64, mediump>; +template struct vec<3, float32, mediump>; +template struct vec<3, float64, mediump>; + +template struct vec<3, uint8, highp>; +template struct vec<3, uint16, highp>; +template struct vec<3, uint32, highp>; +template struct vec<3, uint64, highp>; +template struct vec<3, int8, highp>; +template struct vec<3, int16, highp>; +template struct vec<3, int32, highp>; +template struct vec<3, int64, highp>; +template struct vec<3, float32, highp>; +template struct vec<3, float64, highp>; + +// tvec4 type explicit instantiation +template struct vec<4, uint8, lowp>; +template struct vec<4, uint16, lowp>; +template struct vec<4, uint32, lowp>; +template struct vec<4, uint64, lowp>; +template struct vec<4, int8, lowp>; +template struct vec<4, int16, lowp>; +template struct vec<4, int32, lowp>; +template struct vec<4, int64, lowp>; +template struct vec<4, float32, lowp>; +template struct vec<4, float64, lowp>; + +template struct vec<4, uint8, mediump>; +template struct vec<4, uint16, mediump>; +template struct vec<4, uint32, mediump>; +template struct vec<4, uint64, mediump>; +template struct vec<4, int8, mediump>; +template struct vec<4, int16, mediump>; +template struct vec<4, int32, mediump>; +template struct vec<4, int64, mediump>; +template struct vec<4, float32, mediump>; +template struct vec<4, float64, mediump>; + +template struct vec<4, uint8, highp>; +template struct vec<4, uint16, highp>; +template struct vec<4, uint32, highp>; +template struct vec<4, uint64, highp>; +template struct vec<4, int8, highp>; +template struct vec<4, int16, highp>; +template struct vec<4, int32, highp>; +template struct vec<4, int64, highp>; +template struct vec<4, float32, highp>; +template struct vec<4, float64, highp>; + +// tmat2x2 type explicit instantiation +template struct mat<2, 2, float32, lowp>; +template struct mat<2, 2, float64, lowp>; + +template struct mat<2, 2, float32, mediump>; +template struct mat<2, 2, float64, mediump>; + +template struct mat<2, 2, float32, highp>; +template struct mat<2, 2, float64, highp>; + +// tmat2x3 type explicit instantiation +template struct mat<2, 3, float32, lowp>; +template struct mat<2, 3, float64, lowp>; + +template struct mat<2, 3, float32, mediump>; +template struct mat<2, 3, float64, mediump>; + +template struct mat<2, 3, float32, highp>; +template struct mat<2, 3, float64, highp>; + +// tmat2x4 type explicit instantiation +template struct mat<2, 4, float32, lowp>; +template struct mat<2, 4, float64, lowp>; + +template struct mat<2, 4, float32, mediump>; +template struct mat<2, 4, float64, mediump>; + +template struct mat<2, 4, float32, highp>; +template struct mat<2, 4, float64, highp>; + +// tmat3x2 type explicit instantiation +template struct mat<3, 2, float32, lowp>; +template struct mat<3, 2, float64, lowp>; + +template struct mat<3, 2, float32, mediump>; +template struct mat<3, 2, float64, mediump>; + +template struct mat<3, 2, float32, highp>; +template struct mat<3, 2, float64, highp>; + +// tmat3x3 type explicit instantiation +template struct mat<3, 3, float32, lowp>; +template struct mat<3, 3, float64, lowp>; + +template struct mat<3, 3, float32, mediump>; +template struct mat<3, 3, float64, mediump>; + +template struct mat<3, 3, float32, highp>; +template struct mat<3, 3, float64, highp>; + +// tmat3x4 type explicit instantiation +template struct mat<3, 4, float32, lowp>; +template struct mat<3, 4, float64, lowp>; + +template struct mat<3, 4, float32, mediump>; +template struct mat<3, 4, float64, mediump>; + +template struct mat<3, 4, float32, highp>; +template struct mat<3, 4, float64, highp>; + +// tmat4x2 type explicit instantiation +template struct mat<4, 2, float32, lowp>; +template struct mat<4, 2, float64, lowp>; + +template struct mat<4, 2, float32, mediump>; +template struct mat<4, 2, float64, mediump>; + +template struct mat<4, 2, float32, highp>; +template struct mat<4, 2, float64, highp>; + +// tmat4x3 type explicit instantiation +template struct mat<4, 3, float32, lowp>; +template struct mat<4, 3, float64, lowp>; + +template struct mat<4, 3, float32, mediump>; +template struct mat<4, 3, float64, mediump>; + +template struct mat<4, 3, float32, highp>; +template struct mat<4, 3, float64, highp>; + +// tmat4x4 type explicit instantiation +template struct mat<4, 4, float32, lowp>; +template struct mat<4, 4, float64, lowp>; + +template struct mat<4, 4, float32, mediump>; +template struct mat<4, 4, float64, mediump>; + +template struct mat<4, 4, float32, highp>; +template struct mat<4, 4, float64, highp>; + +// tquat type explicit instantiation +template struct qua; +template struct qua; + +template struct qua; +template struct qua; + +template struct qua; +template struct qua; + +//tdualquat type explicit instantiation +template struct tdualquat; +template struct tdualquat; + +template struct tdualquat; +template struct tdualquat; + +template struct tdualquat; +template struct tdualquat; + +}//namespace glm + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/qualifier.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/qualifier.hpp new file mode 100644 index 0000000000000000000000000000000000000000..46afd36d6514edeaf82ad6cd96eb23a0c541da31 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/qualifier.hpp @@ -0,0 +1,229 @@ +#pragma once + +#include "setup.hpp" + +namespace glm +{ + /// Qualify GLM types in term of alignment (packed, aligned) and precision in term of ULPs (lowp, mediump, highp) + enum qualifier + { + packed_highp, ///< Typed data is tightly packed in memory and operations are executed with high precision in term of ULPs + packed_mediump, ///< Typed data is tightly packed in memory and operations are executed with medium precision in term of ULPs for higher performance + packed_lowp, ///< Typed data is tightly packed in memory and operations are executed with low precision in term of ULPs to maximize performance + +# if GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE + aligned_highp, ///< Typed data is aligned in memory allowing SIMD optimizations and operations are executed with high precision in term of ULPs + aligned_mediump, ///< Typed data is aligned in memory allowing SIMD optimizations and operations are executed with high precision in term of ULPs for higher performance + aligned_lowp, // ///< Typed data is aligned in memory allowing SIMD optimizations and operations are executed with high precision in term of ULPs to maximize performance + aligned = aligned_highp, ///< By default aligned qualifier is also high precision +# endif + + highp = packed_highp, ///< By default highp qualifier is also packed + mediump = packed_mediump, ///< By default mediump qualifier is also packed + lowp = packed_lowp, ///< By default lowp qualifier is also packed + packed = packed_highp, ///< By default packed qualifier is also high precision + +# if GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE && defined(GLM_FORCE_DEFAULT_ALIGNED_GENTYPES) + defaultp = aligned_highp +# else + defaultp = highp +# endif + }; + + typedef qualifier precision; + + template struct vec; + template struct mat; + template struct qua; + +# if GLM_HAS_TEMPLATE_ALIASES + template using tvec1 = vec<1, T, Q>; + template using tvec2 = vec<2, T, Q>; + template using tvec3 = vec<3, T, Q>; + template using tvec4 = vec<4, T, Q>; + template using tmat2x2 = mat<2, 2, T, Q>; + template using tmat2x3 = mat<2, 3, T, Q>; + template using tmat2x4 = mat<2, 4, T, Q>; + template using tmat3x2 = mat<3, 2, T, Q>; + template using tmat3x3 = mat<3, 3, T, Q>; + template using tmat3x4 = mat<3, 4, T, Q>; + template using tmat4x2 = mat<4, 2, T, Q>; + template using tmat4x3 = mat<4, 3, T, Q>; + template using tmat4x4 = mat<4, 4, T, Q>; + template using tquat = qua; +# endif + +namespace detail +{ + template + struct is_aligned + { + static const bool value = false; + }; + +# if GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE + template<> + struct is_aligned + { + static const bool value = true; + }; + + template<> + struct is_aligned + { + static const bool value = true; + }; + + template<> + struct is_aligned + { + static const bool value = true; + }; +# endif + + template + struct storage + { + typedef struct type { + T data[L]; + } type; + }; + +# if GLM_HAS_ALIGNOF + template + struct storage + { + typedef struct alignas(L * sizeof(T)) type { + T data[L]; + } type; + }; + + template + struct storage<3, T, true> + { + typedef struct alignas(4 * sizeof(T)) type { + T data[4]; + } type; + }; +# endif + +# if GLM_ARCH & GLM_ARCH_SSE2_BIT + template<> + struct storage<4, float, true> + { + typedef glm_f32vec4 type; + }; + + template<> + struct storage<4, int, true> + { + typedef glm_i32vec4 type; + }; + + template<> + struct storage<4, unsigned int, true> + { + typedef glm_u32vec4 type; + }; + + template<> + struct storage<2, double, true> + { + typedef glm_f64vec2 type; + }; + + template<> + struct storage<2, detail::int64, true> + { + typedef glm_i64vec2 type; + }; + + template<> + struct storage<2, detail::uint64, true> + { + typedef glm_u64vec2 type; + }; +# endif +# if (GLM_ARCH & GLM_ARCH_AVX_BIT) + template<> + struct storage<4, double, true> + { + typedef glm_f64vec4 type; + }; +# endif + +# if (GLM_ARCH & GLM_ARCH_AVX2_BIT) + template<> + struct storage<4, detail::int64, true> + { + typedef glm_i64vec4 type; + }; + + template<> + struct storage<4, detail::uint64, true> + { + typedef glm_u64vec4 type; + }; +# endif + +# if GLM_ARCH & GLM_ARCH_NEON_BIT + template<> + struct storage<4, float, true> + { + typedef glm_f32vec4 type; + }; + + template<> + struct storage<4, int, true> + { + typedef glm_i32vec4 type; + }; + + template<> + struct storage<4, unsigned int, true> + { + typedef glm_u32vec4 type; + }; +# endif + + enum genTypeEnum + { + GENTYPE_VEC, + GENTYPE_MAT, + GENTYPE_QUAT + }; + + template + struct genTypeTrait + {}; + + template + struct genTypeTrait > + { + static const genTypeEnum GENTYPE = GENTYPE_MAT; + }; + + template + struct init_gentype + { + }; + + template + struct init_gentype + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static genType identity() + { + return genType(1, 0, 0, 0); + } + }; + + template + struct init_gentype + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static genType identity() + { + return genType(1); + } + }; +}//namespace detail +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/setup.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/setup.hpp new file mode 100644 index 0000000000000000000000000000000000000000..a222cdfe69370b0b5ba2bb296f6d6b4b9f21044d --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/setup.hpp @@ -0,0 +1,1184 @@ +#ifndef GLM_SETUP_INCLUDED + +#include +#include + +#define GLM_VERSION_MAJOR 0 +#define GLM_VERSION_MINOR 9 +#define GLM_VERSION_PATCH 9 +#define GLM_VERSION_REVISION 9 +#define GLM_VERSION 999 +#define GLM_VERSION_MESSAGE "GLM: version 0.9.9.9" + +#define GLM_SETUP_INCLUDED GLM_VERSION + +/////////////////////////////////////////////////////////////////////////////////// +// Active states + +#define GLM_DISABLE 0 +#define GLM_ENABLE 1 + +/////////////////////////////////////////////////////////////////////////////////// +// Messages + +#if defined(GLM_FORCE_MESSAGES) +# define GLM_MESSAGES GLM_ENABLE +#else +# define GLM_MESSAGES GLM_DISABLE +#endif + +/////////////////////////////////////////////////////////////////////////////////// +// Detect the platform + +#include "../simd/platform.h" + +/////////////////////////////////////////////////////////////////////////////////// +// Build model + +#if defined(_M_ARM64) || defined(__LP64__) || defined(_M_X64) || defined(__ppc64__) || defined(__x86_64__) +# define GLM_MODEL GLM_MODEL_64 +#elif defined(__i386__) || defined(__ppc__) || defined(__ILP32__) || defined(_M_ARM) +# define GLM_MODEL GLM_MODEL_32 +#else +# define GLM_MODEL GLM_MODEL_32 +#endif// + +#if !defined(GLM_MODEL) && GLM_COMPILER != 0 +# error "GLM_MODEL undefined, your compiler may not be supported by GLM. Add #define GLM_MODEL 0 to ignore this message." +#endif//GLM_MODEL + +/////////////////////////////////////////////////////////////////////////////////// +// C++ Version + +// User defines: GLM_FORCE_CXX98, GLM_FORCE_CXX03, GLM_FORCE_CXX11, GLM_FORCE_CXX14, GLM_FORCE_CXX17, GLM_FORCE_CXX2A + +#define GLM_LANG_CXX98_FLAG (1 << 1) +#define GLM_LANG_CXX03_FLAG (1 << 2) +#define GLM_LANG_CXX0X_FLAG (1 << 3) +#define GLM_LANG_CXX11_FLAG (1 << 4) +#define GLM_LANG_CXX14_FLAG (1 << 5) +#define GLM_LANG_CXX17_FLAG (1 << 6) +#define GLM_LANG_CXX2A_FLAG (1 << 7) +#define GLM_LANG_CXXMS_FLAG (1 << 8) +#define GLM_LANG_CXXGNU_FLAG (1 << 9) + +#define GLM_LANG_CXX98 GLM_LANG_CXX98_FLAG +#define GLM_LANG_CXX03 (GLM_LANG_CXX98 | GLM_LANG_CXX03_FLAG) +#define GLM_LANG_CXX0X (GLM_LANG_CXX03 | GLM_LANG_CXX0X_FLAG) +#define GLM_LANG_CXX11 (GLM_LANG_CXX0X | GLM_LANG_CXX11_FLAG) +#define GLM_LANG_CXX14 (GLM_LANG_CXX11 | GLM_LANG_CXX14_FLAG) +#define GLM_LANG_CXX17 (GLM_LANG_CXX14 | GLM_LANG_CXX17_FLAG) +#define GLM_LANG_CXX2A (GLM_LANG_CXX17 | GLM_LANG_CXX2A_FLAG) +#define GLM_LANG_CXXMS GLM_LANG_CXXMS_FLAG +#define GLM_LANG_CXXGNU GLM_LANG_CXXGNU_FLAG + +#if (defined(_MSC_EXTENSIONS)) +# define GLM_LANG_EXT GLM_LANG_CXXMS_FLAG +#elif ((GLM_COMPILER & (GLM_COMPILER_CLANG | GLM_COMPILER_GCC)) && (GLM_ARCH & GLM_ARCH_SIMD_BIT)) +# define GLM_LANG_EXT GLM_LANG_CXXMS_FLAG +#else +# define GLM_LANG_EXT 0 +#endif + +#if (defined(GLM_FORCE_CXX_UNKNOWN)) +# define GLM_LANG 0 +#elif defined(GLM_FORCE_CXX2A) +# define GLM_LANG (GLM_LANG_CXX2A | GLM_LANG_EXT) +# define GLM_LANG_STL11_FORCED +#elif defined(GLM_FORCE_CXX17) +# define GLM_LANG (GLM_LANG_CXX17 | GLM_LANG_EXT) +# define GLM_LANG_STL11_FORCED +#elif defined(GLM_FORCE_CXX14) +# define GLM_LANG (GLM_LANG_CXX14 | GLM_LANG_EXT) +# define GLM_LANG_STL11_FORCED +#elif defined(GLM_FORCE_CXX11) +# define GLM_LANG (GLM_LANG_CXX11 | GLM_LANG_EXT) +# define GLM_LANG_STL11_FORCED +#elif defined(GLM_FORCE_CXX03) +# define GLM_LANG (GLM_LANG_CXX03 | GLM_LANG_EXT) +#elif defined(GLM_FORCE_CXX98) +# define GLM_LANG (GLM_LANG_CXX98 | GLM_LANG_EXT) +#else +# if GLM_COMPILER & GLM_COMPILER_VC && defined(_MSVC_LANG) +# if GLM_COMPILER >= GLM_COMPILER_VC15_7 +# define GLM_LANG_PLATFORM _MSVC_LANG +# elif GLM_COMPILER >= GLM_COMPILER_VC15 +# if _MSVC_LANG > 201402L +# define GLM_LANG_PLATFORM 201402L +# else +# define GLM_LANG_PLATFORM _MSVC_LANG +# endif +# else +# define GLM_LANG_PLATFORM 0 +# endif +# else +# define GLM_LANG_PLATFORM 0 +# endif + +# if __cplusplus > 201703L || GLM_LANG_PLATFORM > 201703L +# define GLM_LANG (GLM_LANG_CXX2A | GLM_LANG_EXT) +# elif __cplusplus == 201703L || GLM_LANG_PLATFORM == 201703L +# define GLM_LANG (GLM_LANG_CXX17 | GLM_LANG_EXT) +# elif __cplusplus == 201402L || __cplusplus == 201406L || __cplusplus == 201500L || GLM_LANG_PLATFORM == 201402L +# define GLM_LANG (GLM_LANG_CXX14 | GLM_LANG_EXT) +# elif __cplusplus == 201103L || GLM_LANG_PLATFORM == 201103L +# define GLM_LANG (GLM_LANG_CXX11 | GLM_LANG_EXT) +# elif defined(__INTEL_CXX11_MODE__) || defined(_MSC_VER) || defined(__GXX_EXPERIMENTAL_CXX0X__) +# define GLM_LANG (GLM_LANG_CXX0X | GLM_LANG_EXT) +# elif __cplusplus == 199711L +# define GLM_LANG (GLM_LANG_CXX98 | GLM_LANG_EXT) +# else +# define GLM_LANG (0 | GLM_LANG_EXT) +# endif +#endif + +/////////////////////////////////////////////////////////////////////////////////// +// Has of C++ features + +// http://clang.llvm.org/cxx_status.html +// http://gcc.gnu.org/projects/cxx0x.html +// http://msdn.microsoft.com/en-us/library/vstudio/hh567368(v=vs.120).aspx + +// Android has multiple STLs but C++11 STL detection doesn't always work #284 #564 +#if GLM_PLATFORM == GLM_PLATFORM_ANDROID && !defined(GLM_LANG_STL11_FORCED) +# define GLM_HAS_CXX11_STL 0 +#elif (GLM_COMPILER & GLM_COMPILER_CUDA_RTC) == GLM_COMPILER_CUDA_RTC +# define GLM_HAS_CXX11_STL 0 +#elif (GLM_COMPILER & GLM_COMPILER_HIP) +# define GLM_HAS_CXX11_STL 0 +#elif GLM_COMPILER & GLM_COMPILER_CLANG +# if (defined(_LIBCPP_VERSION) || (GLM_LANG & GLM_LANG_CXX11_FLAG) || defined(GLM_LANG_STL11_FORCED)) +# define GLM_HAS_CXX11_STL 1 +# else +# define GLM_HAS_CXX11_STL 0 +# endif +#elif GLM_LANG & GLM_LANG_CXX11_FLAG +# define GLM_HAS_CXX11_STL 1 +#else +# define GLM_HAS_CXX11_STL ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ + ((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC48)) || \ + ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC12)) || \ + ((GLM_PLATFORM != GLM_PLATFORM_WINDOWS) && (GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_COMPILER >= GLM_COMPILER_INTEL15)))) +#endif + +// N1720 +#if GLM_COMPILER & GLM_COMPILER_CLANG +# define GLM_HAS_STATIC_ASSERT __has_feature(cxx_static_assert) +#elif GLM_LANG & GLM_LANG_CXX11_FLAG +# define GLM_HAS_STATIC_ASSERT 1 +#else +# define GLM_HAS_STATIC_ASSERT ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ + ((GLM_COMPILER & GLM_COMPILER_CUDA)) || \ + ((GLM_COMPILER & GLM_COMPILER_VC)) || \ + ((GLM_COMPILER & GLM_COMPILER_HIP)))) +#endif + +// N1988 +#if GLM_LANG & GLM_LANG_CXX11_FLAG +# define GLM_HAS_EXTENDED_INTEGER_TYPE 1 +#else +# define GLM_HAS_EXTENDED_INTEGER_TYPE (\ + ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_VC)) || \ + ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_CUDA)) || \ + ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_CLANG)) || \ + ((GLM_COMPILER & GLM_COMPILER_HIP))) +#endif + +// N2672 Initializer lists http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2672.htm +#if GLM_COMPILER & GLM_COMPILER_CLANG +# define GLM_HAS_INITIALIZER_LISTS __has_feature(cxx_generalized_initializers) +#elif GLM_LANG & GLM_LANG_CXX11_FLAG +# define GLM_HAS_INITIALIZER_LISTS 1 +#else +# define GLM_HAS_INITIALIZER_LISTS ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ + ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC15)) || \ + ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_COMPILER >= GLM_COMPILER_INTEL14)) || \ + ((GLM_COMPILER & GLM_COMPILER_CUDA)) || \ + ((GLM_COMPILER & GLM_COMPILER_HIP)))) +#endif + +// N2544 Unrestricted unions http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2544.pdf +#if GLM_COMPILER & GLM_COMPILER_CLANG +# define GLM_HAS_UNRESTRICTED_UNIONS __has_feature(cxx_unrestricted_unions) +#elif GLM_LANG & GLM_LANG_CXX11_FLAG +# define GLM_HAS_UNRESTRICTED_UNIONS 1 +#else +# define GLM_HAS_UNRESTRICTED_UNIONS (GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ + (GLM_COMPILER & GLM_COMPILER_VC) || \ + ((GLM_COMPILER & GLM_COMPILER_CUDA)) || \ + ((GLM_COMPILER & GLM_COMPILER_HIP))) +#endif + +// N2346 +#if GLM_COMPILER & GLM_COMPILER_CLANG +# define GLM_HAS_DEFAULTED_FUNCTIONS __has_feature(cxx_defaulted_functions) +#elif GLM_COMPILER & GLM_COMPILER_CUDA + // Do not use defaulted functions for CUDA compiler when function qualifiers are present +# define GLM_HAS_DEFAULTED_FUNCTIONS 0 +#elif GLM_LANG & GLM_LANG_CXX11_FLAG +# define GLM_HAS_DEFAULTED_FUNCTIONS 1 +#else +# define GLM_HAS_DEFAULTED_FUNCTIONS ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ + ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC12)) || \ + ((GLM_COMPILER & GLM_COMPILER_INTEL)) || \ + ((GLM_COMPILER & GLM_COMPILER_HIP)))) +#endif + +// N2118 +#if GLM_COMPILER & GLM_COMPILER_CLANG +# define GLM_HAS_RVALUE_REFERENCES __has_feature(cxx_rvalue_references) +#elif GLM_LANG & GLM_LANG_CXX11_FLAG +# define GLM_HAS_RVALUE_REFERENCES 1 +#else +# define GLM_HAS_RVALUE_REFERENCES ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ + ((GLM_COMPILER & GLM_COMPILER_VC)) || \ + ((GLM_COMPILER & GLM_COMPILER_CUDA)) || \ + ((GLM_COMPILER & GLM_COMPILER_HIP)))) +#endif + +// N2437 http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2437.pdf +#if GLM_COMPILER & GLM_COMPILER_CLANG +# define GLM_HAS_EXPLICIT_CONVERSION_OPERATORS __has_feature(cxx_explicit_conversions) +#elif GLM_LANG & GLM_LANG_CXX11_FLAG +# define GLM_HAS_EXPLICIT_CONVERSION_OPERATORS 1 +#else +# define GLM_HAS_EXPLICIT_CONVERSION_OPERATORS ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ + ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_COMPILER >= GLM_COMPILER_INTEL14)) || \ + ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC12)) || \ + ((GLM_COMPILER & GLM_COMPILER_CUDA)) || \ + ((GLM_COMPILER & GLM_COMPILER_HIP)))) +#endif + +// N2258 http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2258.pdf +#if GLM_COMPILER & GLM_COMPILER_CLANG +# define GLM_HAS_TEMPLATE_ALIASES __has_feature(cxx_alias_templates) +#elif GLM_LANG & GLM_LANG_CXX11_FLAG +# define GLM_HAS_TEMPLATE_ALIASES 1 +#else +# define GLM_HAS_TEMPLATE_ALIASES ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ + ((GLM_COMPILER & GLM_COMPILER_INTEL)) || \ + ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC12)) || \ + ((GLM_COMPILER & GLM_COMPILER_CUDA)) || \ + ((GLM_COMPILER & GLM_COMPILER_HIP)))) +#endif + +// N2930 http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2930.html +#if GLM_COMPILER & GLM_COMPILER_CLANG +# define GLM_HAS_RANGE_FOR __has_feature(cxx_range_for) +#elif GLM_LANG & GLM_LANG_CXX11_FLAG +# define GLM_HAS_RANGE_FOR 1 +#else +# define GLM_HAS_RANGE_FOR ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ + ((GLM_COMPILER & GLM_COMPILER_INTEL)) || \ + ((GLM_COMPILER & GLM_COMPILER_VC)) || \ + ((GLM_COMPILER & GLM_COMPILER_CUDA)) || \ + ((GLM_COMPILER & GLM_COMPILER_HIP)))) +#endif + +// N2341 http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2341.pdf +#if GLM_COMPILER & GLM_COMPILER_CLANG +# define GLM_HAS_ALIGNOF __has_feature(cxx_alignas) +#elif GLM_LANG & GLM_LANG_CXX11_FLAG +# define GLM_HAS_ALIGNOF 1 +#else +# define GLM_HAS_ALIGNOF ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ + ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_COMPILER >= GLM_COMPILER_INTEL15)) || \ + ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC14)) || \ + ((GLM_COMPILER & GLM_COMPILER_CUDA)) || \ + ((GLM_COMPILER & GLM_COMPILER_HIP)))) +#endif + +// N2235 Generalized Constant Expressions http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2235.pdf +// N3652 Extended Constant Expressions http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3652.html +#if (GLM_ARCH & GLM_ARCH_SIMD_BIT) // Compiler SIMD intrinsics don't support constexpr... +# define GLM_HAS_CONSTEXPR 0 +#elif (GLM_COMPILER & GLM_COMPILER_CLANG) +# define GLM_HAS_CONSTEXPR __has_feature(cxx_relaxed_constexpr) +#elif (GLM_LANG & GLM_LANG_CXX14_FLAG) +# define GLM_HAS_CONSTEXPR 1 +#else +# define GLM_HAS_CONSTEXPR ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && GLM_HAS_INITIALIZER_LISTS && (\ + ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_COMPILER >= GLM_COMPILER_INTEL17)) || \ + ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC15)))) +#endif + +#if GLM_HAS_CONSTEXPR +# define GLM_CONSTEXPR constexpr +#else +# define GLM_CONSTEXPR +#endif + +// +#if GLM_HAS_CONSTEXPR +# if (GLM_COMPILER & GLM_COMPILER_CLANG) +# if __has_feature(cxx_if_constexpr) +# define GLM_HAS_IF_CONSTEXPR 1 +# else +# define GLM_HAS_IF_CONSTEXPR 0 +# endif +# elif (GLM_LANG & GLM_LANG_CXX17_FLAG) +# define GLM_HAS_IF_CONSTEXPR 1 +# else +# define GLM_HAS_IF_CONSTEXPR 0 +# endif +#else +# define GLM_HAS_IF_CONSTEXPR 0 +#endif + +#if GLM_HAS_IF_CONSTEXPR +# define GLM_IF_CONSTEXPR if constexpr +#else +# define GLM_IF_CONSTEXPR if +#endif + +// +#if GLM_LANG & GLM_LANG_CXX11_FLAG +# define GLM_HAS_ASSIGNABLE 1 +#else +# define GLM_HAS_ASSIGNABLE ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ + ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC15)) || \ + ((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC49)))) +#endif + +// +#define GLM_HAS_TRIVIAL_QUERIES 0 + +// +#if GLM_LANG & GLM_LANG_CXX11_FLAG +# define GLM_HAS_MAKE_SIGNED 1 +#else +# define GLM_HAS_MAKE_SIGNED ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ + ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC12)) || \ + ((GLM_COMPILER & GLM_COMPILER_CUDA)) || \ + ((GLM_COMPILER & GLM_COMPILER_HIP)))) +#endif + +// +#if defined(GLM_FORCE_INTRINSICS) +# define GLM_HAS_BITSCAN_WINDOWS ((GLM_PLATFORM & GLM_PLATFORM_WINDOWS) && (\ + ((GLM_COMPILER & GLM_COMPILER_INTEL)) || \ + ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC14) && (GLM_ARCH & GLM_ARCH_X86_BIT)))) +#else +# define GLM_HAS_BITSCAN_WINDOWS 0 +#endif + +#if GLM_LANG & GLM_LANG_CXX11_FLAG +# define GLM_HAS_NOEXCEPT 1 +#else +# define GLM_HAS_NOEXCEPT 0 +#endif + +#if GLM_HAS_NOEXCEPT +# define GLM_NOEXCEPT noexcept +#else +# define GLM_NOEXCEPT +#endif + +/////////////////////////////////////////////////////////////////////////////////// +// OpenMP +#ifdef _OPENMP +# if GLM_COMPILER & GLM_COMPILER_GCC +# if GLM_COMPILER >= GLM_COMPILER_GCC61 +# define GLM_HAS_OPENMP 45 +# elif GLM_COMPILER >= GLM_COMPILER_GCC49 +# define GLM_HAS_OPENMP 40 +# elif GLM_COMPILER >= GLM_COMPILER_GCC47 +# define GLM_HAS_OPENMP 31 +# else +# define GLM_HAS_OPENMP 0 +# endif +# elif GLM_COMPILER & GLM_COMPILER_CLANG +# if GLM_COMPILER >= GLM_COMPILER_CLANG38 +# define GLM_HAS_OPENMP 31 +# else +# define GLM_HAS_OPENMP 0 +# endif +# elif GLM_COMPILER & GLM_COMPILER_VC +# define GLM_HAS_OPENMP 20 +# elif GLM_COMPILER & GLM_COMPILER_INTEL +# if GLM_COMPILER >= GLM_COMPILER_INTEL16 +# define GLM_HAS_OPENMP 40 +# else +# define GLM_HAS_OPENMP 0 +# endif +# else +# define GLM_HAS_OPENMP 0 +# endif +#else +# define GLM_HAS_OPENMP 0 +#endif + +/////////////////////////////////////////////////////////////////////////////////// +// nullptr + +#if GLM_LANG & GLM_LANG_CXX0X_FLAG +# define GLM_CONFIG_NULLPTR GLM_ENABLE +#else +# define GLM_CONFIG_NULLPTR GLM_DISABLE +#endif + +#if GLM_CONFIG_NULLPTR == GLM_ENABLE +# define GLM_NULLPTR nullptr +#else +# define GLM_NULLPTR 0 +#endif + +/////////////////////////////////////////////////////////////////////////////////// +// Static assert + +#if GLM_HAS_STATIC_ASSERT +# define GLM_STATIC_ASSERT(x, message) static_assert(x, message) +#elif GLM_COMPILER & GLM_COMPILER_VC +# define GLM_STATIC_ASSERT(x, message) typedef char __CASSERT__##__LINE__[(x) ? 1 : -1] +#else +# define GLM_STATIC_ASSERT(x, message) assert(x) +#endif//GLM_LANG + +/////////////////////////////////////////////////////////////////////////////////// +// Qualifiers + +// User defines: GLM_CUDA_FORCE_DEVICE_FUNC, GLM_CUDA_FORCE_HOST_FUNC + +#if (GLM_COMPILER & GLM_COMPILER_CUDA) || (GLM_COMPILER & GLM_COMPILER_HIP) +# if defined(GLM_CUDA_FORCE_DEVICE_FUNC) && defined(GLM_CUDA_FORCE_HOST_FUNC) +# error "GLM error: GLM_CUDA_FORCE_DEVICE_FUNC and GLM_CUDA_FORCE_HOST_FUNC should not be defined at the same time, GLM by default generates both device and host code for CUDA compiler." +# endif//defined(GLM_CUDA_FORCE_DEVICE_FUNC) && defined(GLM_CUDA_FORCE_HOST_FUNC) + +# if defined(GLM_CUDA_FORCE_DEVICE_FUNC) +# define GLM_CUDA_FUNC_DEF __device__ +# define GLM_CUDA_FUNC_DECL __device__ +# elif defined(GLM_CUDA_FORCE_HOST_FUNC) +# define GLM_CUDA_FUNC_DEF __host__ +# define GLM_CUDA_FUNC_DECL __host__ +# else +# define GLM_CUDA_FUNC_DEF __device__ __host__ +# define GLM_CUDA_FUNC_DECL __device__ __host__ +# endif//defined(GLM_CUDA_FORCE_XXXX_FUNC) +#else +# define GLM_CUDA_FUNC_DEF +# define GLM_CUDA_FUNC_DECL +#endif + +#if defined(GLM_FORCE_INLINE) +# if GLM_COMPILER & GLM_COMPILER_VC +# define GLM_INLINE __forceinline +# define GLM_NEVER_INLINE __declspec(noinline) +# elif GLM_COMPILER & (GLM_COMPILER_GCC | GLM_COMPILER_CLANG) +# define GLM_INLINE inline __attribute__((__always_inline__)) +# define GLM_NEVER_INLINE __attribute__((__noinline__)) +# elif (GLM_COMPILER & GLM_COMPILER_CUDA) || (GLM_COMPILER & GLM_COMPILER_HIP) +# define GLM_INLINE __forceinline__ +# define GLM_NEVER_INLINE __noinline__ +# else +# define GLM_INLINE inline +# define GLM_NEVER_INLINE +# endif//GLM_COMPILER +#else +# define GLM_INLINE inline +# define GLM_NEVER_INLINE +#endif//defined(GLM_FORCE_INLINE) + +#define GLM_FUNC_DECL GLM_CUDA_FUNC_DECL +#define GLM_FUNC_QUALIFIER GLM_CUDA_FUNC_DEF GLM_INLINE + +/////////////////////////////////////////////////////////////////////////////////// +// Swizzle operators + +// User defines: GLM_FORCE_SWIZZLE + +#define GLM_SWIZZLE_DISABLED 0 +#define GLM_SWIZZLE_OPERATOR 1 +#define GLM_SWIZZLE_FUNCTION 2 + +#if defined(GLM_SWIZZLE) +# pragma message("GLM: GLM_SWIZZLE is deprecated, use GLM_FORCE_SWIZZLE instead.") +# define GLM_FORCE_SWIZZLE +#endif + +#if defined(GLM_FORCE_SWIZZLE) && (GLM_LANG & GLM_LANG_CXXMS_FLAG) && !defined(GLM_FORCE_XYZW_ONLY) +# define GLM_CONFIG_SWIZZLE GLM_SWIZZLE_OPERATOR +#elif defined(GLM_FORCE_SWIZZLE) +# define GLM_CONFIG_SWIZZLE GLM_SWIZZLE_FUNCTION +#else +# define GLM_CONFIG_SWIZZLE GLM_SWIZZLE_DISABLED +#endif + +/////////////////////////////////////////////////////////////////////////////////// +// Allows using not basic types as genType + +// #define GLM_FORCE_UNRESTRICTED_GENTYPE + +#ifdef GLM_FORCE_UNRESTRICTED_GENTYPE +# define GLM_CONFIG_UNRESTRICTED_GENTYPE GLM_ENABLE +#else +# define GLM_CONFIG_UNRESTRICTED_GENTYPE GLM_DISABLE +#endif + +/////////////////////////////////////////////////////////////////////////////////// +// Clip control, define GLM_FORCE_DEPTH_ZERO_TO_ONE before including GLM +// to use a clip space between 0 to 1. +// Coordinate system, define GLM_FORCE_LEFT_HANDED before including GLM +// to use left handed coordinate system by default. + +#define GLM_CLIP_CONTROL_ZO_BIT (1 << 0) // ZERO_TO_ONE +#define GLM_CLIP_CONTROL_NO_BIT (1 << 1) // NEGATIVE_ONE_TO_ONE +#define GLM_CLIP_CONTROL_LH_BIT (1 << 2) // LEFT_HANDED, For DirectX, Metal, Vulkan +#define GLM_CLIP_CONTROL_RH_BIT (1 << 3) // RIGHT_HANDED, For OpenGL, default in GLM + +#define GLM_CLIP_CONTROL_LH_ZO (GLM_CLIP_CONTROL_LH_BIT | GLM_CLIP_CONTROL_ZO_BIT) +#define GLM_CLIP_CONTROL_LH_NO (GLM_CLIP_CONTROL_LH_BIT | GLM_CLIP_CONTROL_NO_BIT) +#define GLM_CLIP_CONTROL_RH_ZO (GLM_CLIP_CONTROL_RH_BIT | GLM_CLIP_CONTROL_ZO_BIT) +#define GLM_CLIP_CONTROL_RH_NO (GLM_CLIP_CONTROL_RH_BIT | GLM_CLIP_CONTROL_NO_BIT) + +#ifdef GLM_FORCE_DEPTH_ZERO_TO_ONE +# ifdef GLM_FORCE_LEFT_HANDED +# define GLM_CONFIG_CLIP_CONTROL GLM_CLIP_CONTROL_LH_ZO +# else +# define GLM_CONFIG_CLIP_CONTROL GLM_CLIP_CONTROL_RH_ZO +# endif +#else +# ifdef GLM_FORCE_LEFT_HANDED +# define GLM_CONFIG_CLIP_CONTROL GLM_CLIP_CONTROL_LH_NO +# else +# define GLM_CONFIG_CLIP_CONTROL GLM_CLIP_CONTROL_RH_NO +# endif +#endif + +/////////////////////////////////////////////////////////////////////////////////// +// Qualifiers + +#if (GLM_COMPILER & GLM_COMPILER_VC) || ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_PLATFORM & GLM_PLATFORM_WINDOWS)) +# define GLM_DEPRECATED __declspec(deprecated) +# define GLM_ALIGNED_TYPEDEF(type, name, alignment) typedef __declspec(align(alignment)) type name +#elif GLM_COMPILER & (GLM_COMPILER_GCC | GLM_COMPILER_CLANG | GLM_COMPILER_INTEL) +# define GLM_DEPRECATED __attribute__((__deprecated__)) +# define GLM_ALIGNED_TYPEDEF(type, name, alignment) typedef type name __attribute__((aligned(alignment))) +#elif (GLM_COMPILER & GLM_COMPILER_CUDA) || (GLM_COMPILER & GLM_COMPILER_HIP) +# define GLM_DEPRECATED +# define GLM_ALIGNED_TYPEDEF(type, name, alignment) typedef type name __align__(x) +#else +# define GLM_DEPRECATED +# define GLM_ALIGNED_TYPEDEF(type, name, alignment) typedef type name +#endif + +/////////////////////////////////////////////////////////////////////////////////// + +#ifdef GLM_FORCE_EXPLICIT_CTOR +# define GLM_EXPLICIT explicit +#else +# define GLM_EXPLICIT +#endif + +/////////////////////////////////////////////////////////////////////////////////// +// SYCL + +#if GLM_COMPILER==GLM_COMPILER_SYCL + +#include +#include + +namespace glm { +namespace std { + // Import SYCL's functions into the namespace glm::std to force their usages. + // It's important to use the math built-in function (sin, exp, ...) + // of SYCL instead the std ones. + using namespace cl::sycl; + + /////////////////////////////////////////////////////////////////////////////// + // Import some "harmless" std's stuffs used by glm into + // the new glm::std namespace. + template + using numeric_limits = ::std::numeric_limits; + + using ::std::size_t; + + using ::std::uint8_t; + using ::std::uint16_t; + using ::std::uint32_t; + using ::std::uint64_t; + + using ::std::int8_t; + using ::std::int16_t; + using ::std::int32_t; + using ::std::int64_t; + + using ::std::make_unsigned; + /////////////////////////////////////////////////////////////////////////////// +} //namespace std +} //namespace glm + +#endif + +/////////////////////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////////////////////// +// Length type: all length functions returns a length_t type. +// When GLM_FORCE_SIZE_T_LENGTH is defined, length_t is a typedef of size_t otherwise +// length_t is a typedef of int like GLSL defines it. + +#define GLM_LENGTH_INT 1 +#define GLM_LENGTH_SIZE_T 2 + +#ifdef GLM_FORCE_SIZE_T_LENGTH +# define GLM_CONFIG_LENGTH_TYPE GLM_LENGTH_SIZE_T +#else +# define GLM_CONFIG_LENGTH_TYPE GLM_LENGTH_INT +#endif + +namespace glm +{ + using std::size_t; +# if GLM_CONFIG_LENGTH_TYPE == GLM_LENGTH_SIZE_T + typedef size_t length_t; +# else + typedef int length_t; +# endif +}//namespace glm + +/////////////////////////////////////////////////////////////////////////////////// +// constexpr + +#if GLM_HAS_CONSTEXPR +# define GLM_CONFIG_CONSTEXP GLM_ENABLE + + namespace glm + { + template + constexpr std::size_t countof(T const (&)[N]) + { + return N; + } + }//namespace glm +# define GLM_COUNTOF(arr) glm::countof(arr) +#elif defined(_MSC_VER) +# define GLM_CONFIG_CONSTEXP GLM_DISABLE + +# define GLM_COUNTOF(arr) _countof(arr) +#else +# define GLM_CONFIG_CONSTEXP GLM_DISABLE + +# define GLM_COUNTOF(arr) sizeof(arr) / sizeof(arr[0]) +#endif + +/////////////////////////////////////////////////////////////////////////////////// +// uint + +namespace glm{ +namespace detail +{ + template + struct is_int + { + enum test {value = 0}; + }; + + template<> + struct is_int + { + enum test {value = ~0}; + }; + + template<> + struct is_int + { + enum test {value = ~0}; + }; +}//namespace detail + + typedef unsigned int uint; +}//namespace glm + +/////////////////////////////////////////////////////////////////////////////////// +// 64-bit int + +#if GLM_HAS_EXTENDED_INTEGER_TYPE +# include +#endif + +namespace glm{ +namespace detail +{ +# if GLM_HAS_EXTENDED_INTEGER_TYPE + typedef std::uint64_t uint64; + typedef std::int64_t int64; +# elif (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) // C99 detected, 64 bit types available + typedef uint64_t uint64; + typedef int64_t int64; +# elif GLM_COMPILER & GLM_COMPILER_VC + typedef unsigned __int64 uint64; + typedef signed __int64 int64; +# elif GLM_COMPILER & GLM_COMPILER_GCC +# pragma GCC diagnostic ignored "-Wlong-long" + __extension__ typedef unsigned long long uint64; + __extension__ typedef signed long long int64; +# elif (GLM_COMPILER & GLM_COMPILER_CLANG) +# pragma clang diagnostic ignored "-Wc++11-long-long" + typedef unsigned long long uint64; + typedef signed long long int64; +# else//unknown compiler + typedef unsigned long long uint64; + typedef signed long long int64; +# endif +}//namespace detail +}//namespace glm + +/////////////////////////////////////////////////////////////////////////////////// +// make_unsigned + +#if GLM_HAS_MAKE_SIGNED +# include + +namespace glm{ +namespace detail +{ + using std::make_unsigned; +}//namespace detail +}//namespace glm + +#else + +namespace glm{ +namespace detail +{ + template + struct make_unsigned + {}; + + template<> + struct make_unsigned + { + typedef unsigned char type; + }; + + template<> + struct make_unsigned + { + typedef unsigned char type; + }; + + template<> + struct make_unsigned + { + typedef unsigned short type; + }; + + template<> + struct make_unsigned + { + typedef unsigned int type; + }; + + template<> + struct make_unsigned + { + typedef unsigned long type; + }; + + template<> + struct make_unsigned + { + typedef uint64 type; + }; + + template<> + struct make_unsigned + { + typedef unsigned char type; + }; + + template<> + struct make_unsigned + { + typedef unsigned short type; + }; + + template<> + struct make_unsigned + { + typedef unsigned int type; + }; + + template<> + struct make_unsigned + { + typedef unsigned long type; + }; + + template<> + struct make_unsigned + { + typedef uint64 type; + }; +}//namespace detail +}//namespace glm +#endif + +/////////////////////////////////////////////////////////////////////////////////// +// Only use x, y, z, w as vector type components + +#ifdef GLM_FORCE_XYZW_ONLY +# define GLM_CONFIG_XYZW_ONLY GLM_ENABLE +#else +# define GLM_CONFIG_XYZW_ONLY GLM_DISABLE +#endif + +/////////////////////////////////////////////////////////////////////////////////// +// Configure the use of defaulted initialized types + +#define GLM_CTOR_INIT_DISABLE 0 +#define GLM_CTOR_INITIALIZER_LIST 1 +#define GLM_CTOR_INITIALISATION 2 + +#if defined(GLM_FORCE_CTOR_INIT) && GLM_HAS_INITIALIZER_LISTS +# define GLM_CONFIG_CTOR_INIT GLM_CTOR_INITIALIZER_LIST +#elif defined(GLM_FORCE_CTOR_INIT) && !GLM_HAS_INITIALIZER_LISTS +# define GLM_CONFIG_CTOR_INIT GLM_CTOR_INITIALISATION +#else +# define GLM_CONFIG_CTOR_INIT GLM_CTOR_INIT_DISABLE +#endif + +/////////////////////////////////////////////////////////////////////////////////// +// Use SIMD instruction sets + +#if GLM_HAS_ALIGNOF && (GLM_LANG & GLM_LANG_CXXMS_FLAG) && (GLM_ARCH & GLM_ARCH_SIMD_BIT) +# define GLM_CONFIG_SIMD GLM_ENABLE +#else +# define GLM_CONFIG_SIMD GLM_DISABLE +#endif + +/////////////////////////////////////////////////////////////////////////////////// +// Configure the use of defaulted function + +#if GLM_HAS_DEFAULTED_FUNCTIONS +# define GLM_CONFIG_DEFAULTED_FUNCTIONS GLM_ENABLE +# define GLM_DEFAULT = default +#else +# define GLM_CONFIG_DEFAULTED_FUNCTIONS GLM_DISABLE +# define GLM_DEFAULT +#endif + +#if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INIT_DISABLE && GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_ENABLE +# define GLM_CONFIG_DEFAULTED_DEFAULT_CTOR GLM_ENABLE +# define GLM_DEFAULT_CTOR GLM_DEFAULT +#else +# define GLM_CONFIG_DEFAULTED_DEFAULT_CTOR GLM_DISABLE +# define GLM_DEFAULT_CTOR +#endif + +/////////////////////////////////////////////////////////////////////////////////// +// Configure the use of aligned gentypes + +#ifdef GLM_FORCE_ALIGNED // Legacy define +# define GLM_FORCE_DEFAULT_ALIGNED_GENTYPES +#endif + +#ifdef GLM_FORCE_DEFAULT_ALIGNED_GENTYPES +# define GLM_FORCE_ALIGNED_GENTYPES +#endif + +#if GLM_HAS_ALIGNOF && (GLM_LANG & GLM_LANG_CXXMS_FLAG) && (defined(GLM_FORCE_ALIGNED_GENTYPES) || (GLM_CONFIG_SIMD == GLM_ENABLE)) +# define GLM_CONFIG_ALIGNED_GENTYPES GLM_ENABLE +#else +# define GLM_CONFIG_ALIGNED_GENTYPES GLM_DISABLE +#endif + +/////////////////////////////////////////////////////////////////////////////////// +// Configure the use of anonymous structure as implementation detail + +#if ((GLM_CONFIG_SIMD == GLM_ENABLE) || (GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR) || (GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE)) +# define GLM_CONFIG_ANONYMOUS_STRUCT GLM_ENABLE +#else +# define GLM_CONFIG_ANONYMOUS_STRUCT GLM_DISABLE +#endif + +/////////////////////////////////////////////////////////////////////////////////// +// Silent warnings + +#ifdef GLM_FORCE_SILENT_WARNINGS +# define GLM_SILENT_WARNINGS GLM_ENABLE +#else +# define GLM_SILENT_WARNINGS GLM_DISABLE +#endif + +/////////////////////////////////////////////////////////////////////////////////// +// Precision + +#define GLM_HIGHP 1 +#define GLM_MEDIUMP 2 +#define GLM_LOWP 3 + +#if defined(GLM_FORCE_PRECISION_HIGHP_BOOL) || defined(GLM_PRECISION_HIGHP_BOOL) +# define GLM_CONFIG_PRECISION_BOOL GLM_HIGHP +#elif defined(GLM_FORCE_PRECISION_MEDIUMP_BOOL) || defined(GLM_PRECISION_MEDIUMP_BOOL) +# define GLM_CONFIG_PRECISION_BOOL GLM_MEDIUMP +#elif defined(GLM_FORCE_PRECISION_LOWP_BOOL) || defined(GLM_PRECISION_LOWP_BOOL) +# define GLM_CONFIG_PRECISION_BOOL GLM_LOWP +#else +# define GLM_CONFIG_PRECISION_BOOL GLM_HIGHP +#endif + +#if defined(GLM_FORCE_PRECISION_HIGHP_INT) || defined(GLM_PRECISION_HIGHP_INT) +# define GLM_CONFIG_PRECISION_INT GLM_HIGHP +#elif defined(GLM_FORCE_PRECISION_MEDIUMP_INT) || defined(GLM_PRECISION_MEDIUMP_INT) +# define GLM_CONFIG_PRECISION_INT GLM_MEDIUMP +#elif defined(GLM_FORCE_PRECISION_LOWP_INT) || defined(GLM_PRECISION_LOWP_INT) +# define GLM_CONFIG_PRECISION_INT GLM_LOWP +#else +# define GLM_CONFIG_PRECISION_INT GLM_HIGHP +#endif + +#if defined(GLM_FORCE_PRECISION_HIGHP_UINT) || defined(GLM_PRECISION_HIGHP_UINT) +# define GLM_CONFIG_PRECISION_UINT GLM_HIGHP +#elif defined(GLM_FORCE_PRECISION_MEDIUMP_UINT) || defined(GLM_PRECISION_MEDIUMP_UINT) +# define GLM_CONFIG_PRECISION_UINT GLM_MEDIUMP +#elif defined(GLM_FORCE_PRECISION_LOWP_UINT) || defined(GLM_PRECISION_LOWP_UINT) +# define GLM_CONFIG_PRECISION_UINT GLM_LOWP +#else +# define GLM_CONFIG_PRECISION_UINT GLM_HIGHP +#endif + +#if defined(GLM_FORCE_PRECISION_HIGHP_FLOAT) || defined(GLM_PRECISION_HIGHP_FLOAT) +# define GLM_CONFIG_PRECISION_FLOAT GLM_HIGHP +#elif defined(GLM_FORCE_PRECISION_MEDIUMP_FLOAT) || defined(GLM_PRECISION_MEDIUMP_FLOAT) +# define GLM_CONFIG_PRECISION_FLOAT GLM_MEDIUMP +#elif defined(GLM_FORCE_PRECISION_LOWP_FLOAT) || defined(GLM_PRECISION_LOWP_FLOAT) +# define GLM_CONFIG_PRECISION_FLOAT GLM_LOWP +#else +# define GLM_CONFIG_PRECISION_FLOAT GLM_HIGHP +#endif + +#if defined(GLM_FORCE_PRECISION_HIGHP_DOUBLE) || defined(GLM_PRECISION_HIGHP_DOUBLE) +# define GLM_CONFIG_PRECISION_DOUBLE GLM_HIGHP +#elif defined(GLM_FORCE_PRECISION_MEDIUMP_DOUBLE) || defined(GLM_PRECISION_MEDIUMP_DOUBLE) +# define GLM_CONFIG_PRECISION_DOUBLE GLM_MEDIUMP +#elif defined(GLM_FORCE_PRECISION_LOWP_DOUBLE) || defined(GLM_PRECISION_LOWP_DOUBLE) +# define GLM_CONFIG_PRECISION_DOUBLE GLM_LOWP +#else +# define GLM_CONFIG_PRECISION_DOUBLE GLM_HIGHP +#endif + +/////////////////////////////////////////////////////////////////////////////////// +// Check inclusions of different versions of GLM + +#elif ((GLM_SETUP_INCLUDED != GLM_VERSION) && !defined(GLM_FORCE_IGNORE_VERSION)) +# error "GLM error: A different version of GLM is already included. Define GLM_FORCE_IGNORE_VERSION before including GLM headers to ignore this error." +#elif GLM_SETUP_INCLUDED == GLM_VERSION + +/////////////////////////////////////////////////////////////////////////////////// +// Messages + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_MESSAGE_DISPLAYED) +# define GLM_MESSAGE_DISPLAYED +# define GLM_STR_HELPER(x) #x +# define GLM_STR(x) GLM_STR_HELPER(x) + + // Report GLM version +# pragma message (GLM_STR(GLM_VERSION_MESSAGE)) + + // Report C++ language +# if (GLM_LANG & GLM_LANG_CXX2A_FLAG) && (GLM_LANG & GLM_LANG_EXT) +# pragma message("GLM: C++ 2A with extensions") +# elif (GLM_LANG & GLM_LANG_CXX2A_FLAG) +# pragma message("GLM: C++ 2A") +# elif (GLM_LANG & GLM_LANG_CXX17_FLAG) && (GLM_LANG & GLM_LANG_EXT) +# pragma message("GLM: C++ 17 with extensions") +# elif (GLM_LANG & GLM_LANG_CXX17_FLAG) +# pragma message("GLM: C++ 17") +# elif (GLM_LANG & GLM_LANG_CXX14_FLAG) && (GLM_LANG & GLM_LANG_EXT) +# pragma message("GLM: C++ 14 with extensions") +# elif (GLM_LANG & GLM_LANG_CXX14_FLAG) +# pragma message("GLM: C++ 14") +# elif (GLM_LANG & GLM_LANG_CXX11_FLAG) && (GLM_LANG & GLM_LANG_EXT) +# pragma message("GLM: C++ 11 with extensions") +# elif (GLM_LANG & GLM_LANG_CXX11_FLAG) +# pragma message("GLM: C++ 11") +# elif (GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_LANG & GLM_LANG_EXT) +# pragma message("GLM: C++ 0x with extensions") +# elif (GLM_LANG & GLM_LANG_CXX0X_FLAG) +# pragma message("GLM: C++ 0x") +# elif (GLM_LANG & GLM_LANG_CXX03_FLAG) && (GLM_LANG & GLM_LANG_EXT) +# pragma message("GLM: C++ 03 with extensions") +# elif (GLM_LANG & GLM_LANG_CXX03_FLAG) +# pragma message("GLM: C++ 03") +# elif (GLM_LANG & GLM_LANG_CXX98_FLAG) && (GLM_LANG & GLM_LANG_EXT) +# pragma message("GLM: C++ 98 with extensions") +# elif (GLM_LANG & GLM_LANG_CXX98_FLAG) +# pragma message("GLM: C++ 98") +# else +# pragma message("GLM: C++ language undetected") +# endif//GLM_LANG + + // Report compiler detection +# if GLM_COMPILER & GLM_COMPILER_CUDA +# pragma message("GLM: CUDA compiler detected") +# elif GLM_COMPILER & GLM_COMPILER_HIP +# pragma message("GLM: HIP compiler detected") +# elif GLM_COMPILER & GLM_COMPILER_VC +# pragma message("GLM: Visual C++ compiler detected") +# elif GLM_COMPILER & GLM_COMPILER_CLANG +# pragma message("GLM: Clang compiler detected") +# elif GLM_COMPILER & GLM_COMPILER_INTEL +# pragma message("GLM: Intel Compiler detected") +# elif GLM_COMPILER & GLM_COMPILER_GCC +# pragma message("GLM: GCC compiler detected") +# else +# pragma message("GLM: Compiler not detected") +# endif + + // Report build target +# if (GLM_ARCH & GLM_ARCH_AVX2_BIT) && (GLM_MODEL == GLM_MODEL_64) +# pragma message("GLM: x86 64 bits with AVX2 instruction set build target") +# elif (GLM_ARCH & GLM_ARCH_AVX2_BIT) && (GLM_MODEL == GLM_MODEL_32) +# pragma message("GLM: x86 32 bits with AVX2 instruction set build target") + +# elif (GLM_ARCH & GLM_ARCH_AVX_BIT) && (GLM_MODEL == GLM_MODEL_64) +# pragma message("GLM: x86 64 bits with AVX instruction set build target") +# elif (GLM_ARCH & GLM_ARCH_AVX_BIT) && (GLM_MODEL == GLM_MODEL_32) +# pragma message("GLM: x86 32 bits with AVX instruction set build target") + +# elif (GLM_ARCH & GLM_ARCH_SSE42_BIT) && (GLM_MODEL == GLM_MODEL_64) +# pragma message("GLM: x86 64 bits with SSE4.2 instruction set build target") +# elif (GLM_ARCH & GLM_ARCH_SSE42_BIT) && (GLM_MODEL == GLM_MODEL_32) +# pragma message("GLM: x86 32 bits with SSE4.2 instruction set build target") + +# elif (GLM_ARCH & GLM_ARCH_SSE41_BIT) && (GLM_MODEL == GLM_MODEL_64) +# pragma message("GLM: x86 64 bits with SSE4.1 instruction set build target") +# elif (GLM_ARCH & GLM_ARCH_SSE41_BIT) && (GLM_MODEL == GLM_MODEL_32) +# pragma message("GLM: x86 32 bits with SSE4.1 instruction set build target") + +# elif (GLM_ARCH & GLM_ARCH_SSSE3_BIT) && (GLM_MODEL == GLM_MODEL_64) +# pragma message("GLM: x86 64 bits with SSSE3 instruction set build target") +# elif (GLM_ARCH & GLM_ARCH_SSSE3_BIT) && (GLM_MODEL == GLM_MODEL_32) +# pragma message("GLM: x86 32 bits with SSSE3 instruction set build target") + +# elif (GLM_ARCH & GLM_ARCH_SSE3_BIT) && (GLM_MODEL == GLM_MODEL_64) +# pragma message("GLM: x86 64 bits with SSE3 instruction set build target") +# elif (GLM_ARCH & GLM_ARCH_SSE3_BIT) && (GLM_MODEL == GLM_MODEL_32) +# pragma message("GLM: x86 32 bits with SSE3 instruction set build target") + +# elif (GLM_ARCH & GLM_ARCH_SSE2_BIT) && (GLM_MODEL == GLM_MODEL_64) +# pragma message("GLM: x86 64 bits with SSE2 instruction set build target") +# elif (GLM_ARCH & GLM_ARCH_SSE2_BIT) && (GLM_MODEL == GLM_MODEL_32) +# pragma message("GLM: x86 32 bits with SSE2 instruction set build target") + +# elif (GLM_ARCH & GLM_ARCH_X86_BIT) && (GLM_MODEL == GLM_MODEL_64) +# pragma message("GLM: x86 64 bits build target") +# elif (GLM_ARCH & GLM_ARCH_X86_BIT) && (GLM_MODEL == GLM_MODEL_32) +# pragma message("GLM: x86 32 bits build target") + +# elif (GLM_ARCH & GLM_ARCH_NEON_BIT) && (GLM_MODEL == GLM_MODEL_64) +# pragma message("GLM: ARM 64 bits with Neon instruction set build target") +# elif (GLM_ARCH & GLM_ARCH_NEON_BIT) && (GLM_MODEL == GLM_MODEL_32) +# pragma message("GLM: ARM 32 bits with Neon instruction set build target") + +# elif (GLM_ARCH & GLM_ARCH_ARM_BIT) && (GLM_MODEL == GLM_MODEL_64) +# pragma message("GLM: ARM 64 bits build target") +# elif (GLM_ARCH & GLM_ARCH_ARM_BIT) && (GLM_MODEL == GLM_MODEL_32) +# pragma message("GLM: ARM 32 bits build target") + +# elif (GLM_ARCH & GLM_ARCH_MIPS_BIT) && (GLM_MODEL == GLM_MODEL_64) +# pragma message("GLM: MIPS 64 bits build target") +# elif (GLM_ARCH & GLM_ARCH_MIPS_BIT) && (GLM_MODEL == GLM_MODEL_32) +# pragma message("GLM: MIPS 32 bits build target") + +# elif (GLM_ARCH & GLM_ARCH_PPC_BIT) && (GLM_MODEL == GLM_MODEL_64) +# pragma message("GLM: PowerPC 64 bits build target") +# elif (GLM_ARCH & GLM_ARCH_PPC_BIT) && (GLM_MODEL == GLM_MODEL_32) +# pragma message("GLM: PowerPC 32 bits build target") +# else +# pragma message("GLM: Unknown build target") +# endif//GLM_ARCH + + // Report platform name +# if(GLM_PLATFORM & GLM_PLATFORM_QNXNTO) +# pragma message("GLM: QNX platform detected") +//# elif(GLM_PLATFORM & GLM_PLATFORM_IOS) +//# pragma message("GLM: iOS platform detected") +# elif(GLM_PLATFORM & GLM_PLATFORM_APPLE) +# pragma message("GLM: Apple platform detected") +# elif(GLM_PLATFORM & GLM_PLATFORM_WINCE) +# pragma message("GLM: WinCE platform detected") +# elif(GLM_PLATFORM & GLM_PLATFORM_WINDOWS) +# pragma message("GLM: Windows platform detected") +# elif(GLM_PLATFORM & GLM_PLATFORM_CHROME_NACL) +# pragma message("GLM: Native Client detected") +# elif(GLM_PLATFORM & GLM_PLATFORM_ANDROID) +# pragma message("GLM: Android platform detected") +# elif(GLM_PLATFORM & GLM_PLATFORM_LINUX) +# pragma message("GLM: Linux platform detected") +# elif(GLM_PLATFORM & GLM_PLATFORM_UNIX) +# pragma message("GLM: UNIX platform detected") +# elif(GLM_PLATFORM & GLM_PLATFORM_UNKNOWN) +# pragma message("GLM: platform unknown") +# else +# pragma message("GLM: platform not detected") +# endif + + // Report whether only xyzw component are used +# if defined GLM_FORCE_XYZW_ONLY +# pragma message("GLM: GLM_FORCE_XYZW_ONLY is defined. Only x, y, z and w component are available in vector type. This define disables swizzle operators and SIMD instruction sets.") +# endif + + // Report swizzle operator support +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR +# pragma message("GLM: GLM_FORCE_SWIZZLE is defined, swizzling operators enabled.") +# elif GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION +# pragma message("GLM: GLM_FORCE_SWIZZLE is defined, swizzling functions enabled. Enable compiler C++ language extensions to enable swizzle operators.") +# else +# pragma message("GLM: GLM_FORCE_SWIZZLE is undefined. swizzling functions or operators are disabled.") +# endif + + // Report .length() type +# if GLM_CONFIG_LENGTH_TYPE == GLM_LENGTH_SIZE_T +# pragma message("GLM: GLM_FORCE_SIZE_T_LENGTH is defined. .length() returns a glm::length_t, a typedef of std::size_t.") +# else +# pragma message("GLM: GLM_FORCE_SIZE_T_LENGTH is undefined. .length() returns a glm::length_t, a typedef of int following GLSL.") +# endif + +# if GLM_CONFIG_UNRESTRICTED_GENTYPE == GLM_ENABLE +# pragma message("GLM: GLM_FORCE_UNRESTRICTED_GENTYPE is defined. Removes GLSL restrictions on valid function genTypes.") +# else +# pragma message("GLM: GLM_FORCE_UNRESTRICTED_GENTYPE is undefined. Follows strictly GLSL on valid function genTypes.") +# endif + +# if GLM_SILENT_WARNINGS == GLM_ENABLE +# pragma message("GLM: GLM_FORCE_SILENT_WARNINGS is defined. Ignores C++ warnings from using C++ language extensions.") +# else +# pragma message("GLM: GLM_FORCE_SILENT_WARNINGS is undefined. Shows C++ warnings from using C++ language extensions.") +# endif + +# ifdef GLM_FORCE_SINGLE_ONLY +# pragma message("GLM: GLM_FORCE_SINGLE_ONLY is defined. Using only single precision floating-point types.") +# endif + +# if defined(GLM_FORCE_ALIGNED_GENTYPES) && (GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE) +# undef GLM_FORCE_ALIGNED_GENTYPES +# pragma message("GLM: GLM_FORCE_ALIGNED_GENTYPES is defined, allowing aligned types. This prevents the use of C++ constexpr.") +# elif defined(GLM_FORCE_ALIGNED_GENTYPES) && (GLM_CONFIG_ALIGNED_GENTYPES == GLM_DISABLE) +# undef GLM_FORCE_ALIGNED_GENTYPES +# pragma message("GLM: GLM_FORCE_ALIGNED_GENTYPES is defined but is disabled. It requires C++11 and language extensions.") +# endif + +# if defined(GLM_FORCE_DEFAULT_ALIGNED_GENTYPES) +# if GLM_CONFIG_ALIGNED_GENTYPES == GLM_DISABLE +# undef GLM_FORCE_DEFAULT_ALIGNED_GENTYPES +# pragma message("GLM: GLM_FORCE_DEFAULT_ALIGNED_GENTYPES is defined but is disabled. It requires C++11 and language extensions.") +# elif GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE +# pragma message("GLM: GLM_FORCE_DEFAULT_ALIGNED_GENTYPES is defined. All gentypes (e.g. vec3) will be aligned and padded by default.") +# endif +# endif + +# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_ZO_BIT +# pragma message("GLM: GLM_FORCE_DEPTH_ZERO_TO_ONE is defined. Using zero to one depth clip space.") +# else +# pragma message("GLM: GLM_FORCE_DEPTH_ZERO_TO_ONE is undefined. Using negative one to one depth clip space.") +# endif + +# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_LH_BIT +# pragma message("GLM: GLM_FORCE_LEFT_HANDED is defined. Using left handed coordinate system.") +# else +# pragma message("GLM: GLM_FORCE_LEFT_HANDED is undefined. Using right handed coordinate system.") +# endif +#endif//GLM_MESSAGES + +#endif//GLM_SETUP_INCLUDED diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_float.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_float.hpp new file mode 100644 index 0000000000000000000000000000000000000000..34b33fa9937180ec86275720f993f912efffb8f0 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_float.hpp @@ -0,0 +1,68 @@ +#pragma once + +#include "setup.hpp" + +#if GLM_COMPILER == GLM_COMPILER_VC12 +# pragma warning(push) +# pragma warning(disable: 4512) // assignment operator could not be generated +#endif + +namespace glm{ +namespace detail +{ + template + union float_t + {}; + + // https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/ + template <> + union float_t + { + typedef int int_type; + typedef float float_type; + + GLM_CONSTEXPR float_t(float_type Num = 0.0f) : f(Num) {} + + GLM_CONSTEXPR float_t& operator=(float_t const& x) + { + f = x.f; + return *this; + } + + // Portable extraction of components. + GLM_CONSTEXPR bool negative() const { return i < 0; } + GLM_CONSTEXPR int_type mantissa() const { return i & ((1 << 23) - 1); } + GLM_CONSTEXPR int_type exponent() const { return (i >> 23) & ((1 << 8) - 1); } + + int_type i; + float_type f; + }; + + template <> + union float_t + { + typedef detail::int64 int_type; + typedef double float_type; + + GLM_CONSTEXPR float_t(float_type Num = static_cast(0)) : f(Num) {} + + GLM_CONSTEXPR float_t& operator=(float_t const& x) + { + f = x.f; + return *this; + } + + // Portable extraction of components. + GLM_CONSTEXPR bool negative() const { return i < 0; } + GLM_CONSTEXPR int_type mantissa() const { return i & ((int_type(1) << 52) - 1); } + GLM_CONSTEXPR int_type exponent() const { return (i >> 52) & ((int_type(1) << 11) - 1); } + + int_type i; + float_type f; + }; +}//namespace detail +}//namespace glm + +#if GLM_COMPILER == GLM_COMPILER_VC12 +# pragma warning(pop) +#endif diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_half.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_half.hpp new file mode 100644 index 0000000000000000000000000000000000000000..6a71e38328e5a19a083fdbe8f5da0d57d954d083 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_half.hpp @@ -0,0 +1,16 @@ +#pragma once + +#include "setup.hpp" + +namespace glm{ +namespace detail +{ + typedef short hdata; + + GLM_FUNC_DECL float toFloat32(hdata value); + GLM_FUNC_DECL hdata toFloat16(float const& value); + +}//namespace detail +}//namespace glm + +#include "type_half.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_half.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_half.inl new file mode 100644 index 0000000000000000000000000000000000000000..55c28ef2333fcadfedd3a24f92d8a48ee214609b --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_half.inl @@ -0,0 +1,241 @@ +namespace glm{ +namespace detail +{ + GLM_FUNC_QUALIFIER float overflow() + { + volatile float f = 1e10; + + for(int i = 0; i < 10; ++i) + f = f * f; // this will overflow before the for loop terminates + return f; + } + + union uif32 + { + GLM_FUNC_QUALIFIER uif32() : + i(0) + {} + + GLM_FUNC_QUALIFIER uif32(float f_) : + f(f_) + {} + + GLM_FUNC_QUALIFIER uif32(unsigned int i_) : + i(i_) + {} + + float f; + unsigned int i; + }; + + GLM_FUNC_QUALIFIER float toFloat32(hdata value) + { + int s = (value >> 15) & 0x00000001; + int e = (value >> 10) & 0x0000001f; + int m = value & 0x000003ff; + + if(e == 0) + { + if(m == 0) + { + // + // Plus or minus zero + // + + detail::uif32 result; + result.i = static_cast(s << 31); + return result.f; + } + else + { + // + // Denormalized number -- renormalize it + // + + while(!(m & 0x00000400)) + { + m <<= 1; + e -= 1; + } + + e += 1; + m &= ~0x00000400; + } + } + else if(e == 31) + { + if(m == 0) + { + // + // Positive or negative infinity + // + + uif32 result; + result.i = static_cast((s << 31) | 0x7f800000); + return result.f; + } + else + { + // + // Nan -- preserve sign and significand bits + // + + uif32 result; + result.i = static_cast((s << 31) | 0x7f800000 | (m << 13)); + return result.f; + } + } + + // + // Normalized number + // + + e = e + (127 - 15); + m = m << 13; + + // + // Assemble s, e and m. + // + + uif32 Result; + Result.i = static_cast((s << 31) | (e << 23) | m); + return Result.f; + } + + GLM_FUNC_QUALIFIER hdata toFloat16(float const& f) + { + uif32 Entry; + Entry.f = f; + int i = static_cast(Entry.i); + + // + // Our floating point number, f, is represented by the bit + // pattern in integer i. Disassemble that bit pattern into + // the sign, s, the exponent, e, and the significand, m. + // Shift s into the position where it will go in the + // resulting half number. + // Adjust e, accounting for the different exponent bias + // of float and half (127 versus 15). + // + + int s = (i >> 16) & 0x00008000; + int e = ((i >> 23) & 0x000000ff) - (127 - 15); + int m = i & 0x007fffff; + + // + // Now reassemble s, e and m into a half: + // + + if(e <= 0) + { + if(e < -10) + { + // + // E is less than -10. The absolute value of f is + // less than half_MIN (f may be a small normalized + // float, a denormalized float or a zero). + // + // We convert f to a half zero. + // + + return hdata(s); + } + + // + // E is between -10 and 0. F is a normalized float, + // whose magnitude is less than __half_NRM_MIN. + // + // We convert f to a denormalized half. + // + + m = (m | 0x00800000) >> (1 - e); + + // + // Round to nearest, round "0.5" up. + // + // Rounding may cause the significand to overflow and make + // our number normalized. Because of the way a half's bits + // are laid out, we don't have to treat this case separately; + // the code below will handle it correctly. + // + + if(m & 0x00001000) + m += 0x00002000; + + // + // Assemble the half from s, e (zero) and m. + // + + return hdata(s | (m >> 13)); + } + else if(e == 0xff - (127 - 15)) + { + if(m == 0) + { + // + // F is an infinity; convert f to a half + // infinity with the same sign as f. + // + + return hdata(s | 0x7c00); + } + else + { + // + // F is a NAN; we produce a half NAN that preserves + // the sign bit and the 10 leftmost bits of the + // significand of f, with one exception: If the 10 + // leftmost bits are all zero, the NAN would turn + // into an infinity, so we have to set at least one + // bit in the significand. + // + + m >>= 13; + + return hdata(s | 0x7c00 | m | (m == 0)); + } + } + else + { + // + // E is greater than zero. F is a normalized float. + // We try to convert f to a normalized half. + // + + // + // Round to nearest, round "0.5" up + // + + if(m & 0x00001000) + { + m += 0x00002000; + + if(m & 0x00800000) + { + m = 0; // overflow in significand, + e += 1; // adjust exponent + } + } + + // + // Handle exponent overflow + // + + if (e > 30) + { + overflow(); // Cause a hardware floating point overflow; + + return hdata(s | 0x7c00); + // if this returns, the half becomes an + } // infinity with the same sign as f. + + // + // Assemble the half from s, e and m. + // + + return hdata(s | (e << 10) | (m >> 13)); + } + } + +}//namespace detail +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_mat2x2.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_mat2x2.hpp new file mode 100644 index 0000000000000000000000000000000000000000..3784576b01b7c6f718263620b43b905fbf2ccee7 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_mat2x2.hpp @@ -0,0 +1,177 @@ +/// @ref core +/// @file glm/detail/type_mat2x2.hpp + +#pragma once + +#include "type_vec2.hpp" +#include +#include + +namespace glm +{ + template + struct mat<2, 2, T, Q> + { + typedef vec<2, T, Q> col_type; + typedef vec<2, T, Q> row_type; + typedef mat<2, 2, T, Q> type; + typedef mat<2, 2, T, Q> transpose_type; + typedef T value_type; + + private: + col_type value[2]; + + public: + // -- Accesses -- + + typedef length_t length_type; + GLM_FUNC_DECL static GLM_CONSTEXPR length_type length() { return 2; } + + GLM_FUNC_DECL col_type & operator[](length_type i) GLM_NOEXCEPT; + GLM_FUNC_DECL GLM_CONSTEXPR col_type const& operator[](length_type i) const GLM_NOEXCEPT; + + // -- Constructors -- + + GLM_FUNC_DECL GLM_CONSTEXPR mat() GLM_DEFAULT_CTOR; + template + GLM_FUNC_DECL GLM_CONSTEXPR mat(mat<2, 2, T, P> const& m); + + GLM_FUNC_DECL explicit GLM_CONSTEXPR mat(T scalar); + GLM_FUNC_DECL GLM_CONSTEXPR mat( + T const& x1, T const& y1, + T const& x2, T const& y2); + GLM_FUNC_DECL GLM_CONSTEXPR mat( + col_type const& v1, + col_type const& v2); + + // -- Conversions -- + + template + GLM_FUNC_DECL GLM_CONSTEXPR mat( + U const& x1, V const& y1, + M const& x2, N const& y2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR mat( + vec<2, U, Q> const& v1, + vec<2, V, Q> const& v2); + + // -- Matrix conversions -- + + template + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 2, U, P> const& m); + + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 3, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 4, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 3, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 2, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 4, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 2, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 4, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 3, T, Q> const& x); + + // -- Unary arithmetic operators -- + + template + GLM_FUNC_DECL mat<2, 2, T, Q> & operator=(mat<2, 2, U, Q> const& m); + template + GLM_FUNC_DECL mat<2, 2, T, Q> & operator+=(U s); + template + GLM_FUNC_DECL mat<2, 2, T, Q> & operator+=(mat<2, 2, U, Q> const& m); + template + GLM_FUNC_DECL mat<2, 2, T, Q> & operator-=(U s); + template + GLM_FUNC_DECL mat<2, 2, T, Q> & operator-=(mat<2, 2, U, Q> const& m); + template + GLM_FUNC_DECL mat<2, 2, T, Q> & operator*=(U s); + template + GLM_FUNC_DECL mat<2, 2, T, Q> & operator*=(mat<2, 2, U, Q> const& m); + template + GLM_FUNC_DECL mat<2, 2, T, Q> & operator/=(U s); + template + GLM_FUNC_DECL mat<2, 2, T, Q> & operator/=(mat<2, 2, U, Q> const& m); + + // -- Increment and decrement operators -- + + GLM_FUNC_DECL mat<2, 2, T, Q> & operator++ (); + GLM_FUNC_DECL mat<2, 2, T, Q> & operator-- (); + GLM_FUNC_DECL mat<2, 2, T, Q> operator++(int); + GLM_FUNC_DECL mat<2, 2, T, Q> operator--(int); + }; + + // -- Unary operators -- + + template + GLM_FUNC_DECL mat<2, 2, T, Q> operator+(mat<2, 2, T, Q> const& m); + + template + GLM_FUNC_DECL mat<2, 2, T, Q> operator-(mat<2, 2, T, Q> const& m); + + // -- Binary operators -- + + template + GLM_FUNC_DECL mat<2, 2, T, Q> operator+(mat<2, 2, T, Q> const& m, T scalar); + + template + GLM_FUNC_DECL mat<2, 2, T, Q> operator+(T scalar, mat<2, 2, T, Q> const& m); + + template + GLM_FUNC_DECL mat<2, 2, T, Q> operator+(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2); + + template + GLM_FUNC_DECL mat<2, 2, T, Q> operator-(mat<2, 2, T, Q> const& m, T scalar); + + template + GLM_FUNC_DECL mat<2, 2, T, Q> operator-(T scalar, mat<2, 2, T, Q> const& m); + + template + GLM_FUNC_DECL mat<2, 2, T, Q> operator-(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2); + + template + GLM_FUNC_DECL mat<2, 2, T, Q> operator*(mat<2, 2, T, Q> const& m, T scalar); + + template + GLM_FUNC_DECL mat<2, 2, T, Q> operator*(T scalar, mat<2, 2, T, Q> const& m); + + template + GLM_FUNC_DECL typename mat<2, 2, T, Q>::col_type operator*(mat<2, 2, T, Q> const& m, typename mat<2, 2, T, Q>::row_type const& v); + + template + GLM_FUNC_DECL typename mat<2, 2, T, Q>::row_type operator*(typename mat<2, 2, T, Q>::col_type const& v, mat<2, 2, T, Q> const& m); + + template + GLM_FUNC_DECL mat<2, 2, T, Q> operator*(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2); + + template + GLM_FUNC_DECL mat<3, 2, T, Q> operator*(mat<2, 2, T, Q> const& m1, mat<3, 2, T, Q> const& m2); + + template + GLM_FUNC_DECL mat<4, 2, T, Q> operator*(mat<2, 2, T, Q> const& m1, mat<4, 2, T, Q> const& m2); + + template + GLM_FUNC_DECL mat<2, 2, T, Q> operator/(mat<2, 2, T, Q> const& m, T scalar); + + template + GLM_FUNC_DECL mat<2, 2, T, Q> operator/(T scalar, mat<2, 2, T, Q> const& m); + + template + GLM_FUNC_DECL typename mat<2, 2, T, Q>::col_type operator/(mat<2, 2, T, Q> const& m, typename mat<2, 2, T, Q>::row_type const& v); + + template + GLM_FUNC_DECL typename mat<2, 2, T, Q>::row_type operator/(typename mat<2, 2, T, Q>::col_type const& v, mat<2, 2, T, Q> const& m); + + template + GLM_FUNC_DECL mat<2, 2, T, Q> operator/(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2); + + // -- Boolean operators -- + + template + GLM_FUNC_DECL bool operator==(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2); + + template + GLM_FUNC_DECL bool operator!=(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2); +} //namespace glm + +#ifndef GLM_EXTERNAL_TEMPLATE +#include "type_mat2x2.inl" +#endif diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_mat2x2.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_mat2x2.inl new file mode 100644 index 0000000000000000000000000000000000000000..94c9e22fd3267aaa953cfe91f34c5213089a8775 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_mat2x2.inl @@ -0,0 +1,536 @@ +#include "../matrix.hpp" + +namespace glm +{ + // -- Constructors -- + +# if GLM_CONFIG_DEFAULTED_DEFAULT_CTOR == GLM_DISABLE + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>::mat() +# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALIZER_LIST + : value{col_type(1, 0), col_type(0, 1)} +# endif + { +# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALISATION + this->value[0] = col_type(1, 0); + this->value[1] = col_type(0, 1); +# endif + } +# endif + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>::mat(mat<2, 2, T, P> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1])} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = m[0]; + this->value[1] = m[1]; +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>::mat(T scalar) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(scalar, 0), col_type(0, scalar)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(scalar, 0); + this->value[1] = col_type(0, scalar); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>::mat + ( + T const& x0, T const& y0, + T const& x1, T const& y1 + ) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(x0, y0), col_type(x1, y1)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(x0, y0); + this->value[1] = col_type(x1, y1); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>::mat(col_type const& v0, col_type const& v1) +# if GLM_HAS_INITIALIZER_LISTS + : value{v0, v1} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = v0; + this->value[1] = v1; +# endif + } + + // -- Conversion constructors -- + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>::mat + ( + X1 const& x1, Y1 const& y1, + X2 const& x2, Y2 const& y2 + ) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(static_cast(x1), value_type(y1)), col_type(static_cast(x2), value_type(y2)) } +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(static_cast(x1), value_type(y1)); + this->value[1] = col_type(static_cast(x2), value_type(y2)); +# endif + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>::mat(vec<2, V1, Q> const& v1, vec<2, V2, Q> const& v2) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(v1), col_type(v2)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(v1); + this->value[1] = col_type(v2); +# endif + } + + // -- mat2x2 matrix conversions -- + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>::mat(mat<2, 2, U, P> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1])} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>::mat(mat<3, 3, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1])} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>::mat(mat<4, 4, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1])} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>::mat(mat<2, 3, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1])} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>::mat(mat<3, 2, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1])} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>::mat(mat<2, 4, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1])} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>::mat(mat<4, 2, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1])} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>::mat(mat<3, 4, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1])} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>::mat(mat<4, 3, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1])} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); +# endif + } + + // -- Accesses -- + + template + GLM_FUNC_QUALIFIER typename mat<2, 2, T, Q>::col_type& mat<2, 2, T, Q>::operator[](typename mat<2, 2, T, Q>::length_type i) GLM_NOEXCEPT + { + assert(i < this->length()); + return this->value[i]; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<2, 2, T, Q>::col_type const& mat<2, 2, T, Q>::operator[](typename mat<2, 2, T, Q>::length_type i) const GLM_NOEXCEPT + { + assert(i < this->length()); + return this->value[i]; + } + + // -- Unary updatable operators -- + + template + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q>& mat<2, 2, T, Q>::operator=(mat<2, 2, U, Q> const& m) + { + this->value[0] = m[0]; + this->value[1] = m[1]; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q>& mat<2, 2, T, Q>::operator+=(U scalar) + { + this->value[0] += scalar; + this->value[1] += scalar; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q>& mat<2, 2, T, Q>::operator+=(mat<2, 2, U, Q> const& m) + { + this->value[0] += m[0]; + this->value[1] += m[1]; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q>& mat<2, 2, T, Q>::operator-=(U scalar) + { + this->value[0] -= scalar; + this->value[1] -= scalar; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q>& mat<2, 2, T, Q>::operator-=(mat<2, 2, U, Q> const& m) + { + this->value[0] -= m[0]; + this->value[1] -= m[1]; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q>& mat<2, 2, T, Q>::operator*=(U scalar) + { + this->value[0] *= scalar; + this->value[1] *= scalar; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q>& mat<2, 2, T, Q>::operator*=(mat<2, 2, U, Q> const& m) + { + return (*this = *this * m); + } + + template + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q>& mat<2, 2, T, Q>::operator/=(U scalar) + { + this->value[0] /= scalar; + this->value[1] /= scalar; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q>& mat<2, 2, T, Q>::operator/=(mat<2, 2, U, Q> const& m) + { + return *this *= inverse(m); + } + + // -- Increment and decrement operators -- + + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q>& mat<2, 2, T, Q>::operator++() + { + ++this->value[0]; + ++this->value[1]; + return *this; + } + + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q>& mat<2, 2, T, Q>::operator--() + { + --this->value[0]; + --this->value[1]; + return *this; + } + + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q> mat<2, 2, T, Q>::operator++(int) + { + mat<2, 2, T, Q> Result(*this); + ++*this; + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q> mat<2, 2, T, Q>::operator--(int) + { + mat<2, 2, T, Q> Result(*this); + --*this; + return Result; + } + + // -- Unary arithmetic operators -- + + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q> operator+(mat<2, 2, T, Q> const& m) + { + return m; + } + + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q> operator-(mat<2, 2, T, Q> const& m) + { + return mat<2, 2, T, Q>( + -m[0], + -m[1]); + } + + // -- Binary arithmetic operators -- + + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q> operator+(mat<2, 2, T, Q> const& m, T scalar) + { + return mat<2, 2, T, Q>( + m[0] + scalar, + m[1] + scalar); + } + + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q> operator+(T scalar, mat<2, 2, T, Q> const& m) + { + return mat<2, 2, T, Q>( + m[0] + scalar, + m[1] + scalar); + } + + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q> operator+(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2) + { + return mat<2, 2, T, Q>( + m1[0] + m2[0], + m1[1] + m2[1]); + } + + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q> operator-(mat<2, 2, T, Q> const& m, T scalar) + { + return mat<2, 2, T, Q>( + m[0] - scalar, + m[1] - scalar); + } + + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q> operator-(T scalar, mat<2, 2, T, Q> const& m) + { + return mat<2, 2, T, Q>( + scalar - m[0], + scalar - m[1]); + } + + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q> operator-(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2) + { + return mat<2, 2, T, Q>( + m1[0] - m2[0], + m1[1] - m2[1]); + } + + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q> operator*(mat<2, 2, T, Q> const& m, T scalar) + { + return mat<2, 2, T, Q>( + m[0] * scalar, + m[1] * scalar); + } + + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q> operator*(T scalar, mat<2, 2, T, Q> const& m) + { + return mat<2, 2, T, Q>( + m[0] * scalar, + m[1] * scalar); + } + + template + GLM_FUNC_QUALIFIER typename mat<2, 2, T, Q>::col_type operator* + ( + mat<2, 2, T, Q> const& m, + typename mat<2, 2, T, Q>::row_type const& v + ) + { + return vec<2, T, Q>( + m[0][0] * v.x + m[1][0] * v.y, + m[0][1] * v.x + m[1][1] * v.y); + } + + template + GLM_FUNC_QUALIFIER typename mat<2, 2, T, Q>::row_type operator* + ( + typename mat<2, 2, T, Q>::col_type const& v, + mat<2, 2, T, Q> const& m + ) + { + return vec<2, T, Q>( + v.x * m[0][0] + v.y * m[0][1], + v.x * m[1][0] + v.y * m[1][1]); + } + + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q> operator*(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2) + { + return mat<2, 2, T, Q>( + m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1], + m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1], + m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1], + m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1]); + } + + template + GLM_FUNC_QUALIFIER mat<3, 2, T, Q> operator*(mat<2, 2, T, Q> const& m1, mat<3, 2, T, Q> const& m2) + { + return mat<3, 2, T, Q>( + m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1], + m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1], + m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1], + m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1], + m1[0][0] * m2[2][0] + m1[1][0] * m2[2][1], + m1[0][1] * m2[2][0] + m1[1][1] * m2[2][1]); + } + + template + GLM_FUNC_QUALIFIER mat<4, 2, T, Q> operator*(mat<2, 2, T, Q> const& m1, mat<4, 2, T, Q> const& m2) + { + return mat<4, 2, T, Q>( + m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1], + m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1], + m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1], + m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1], + m1[0][0] * m2[2][0] + m1[1][0] * m2[2][1], + m1[0][1] * m2[2][0] + m1[1][1] * m2[2][1], + m1[0][0] * m2[3][0] + m1[1][0] * m2[3][1], + m1[0][1] * m2[3][0] + m1[1][1] * m2[3][1]); + } + + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q> operator/(mat<2, 2, T, Q> const& m, T scalar) + { + return mat<2, 2, T, Q>( + m[0] / scalar, + m[1] / scalar); + } + + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q> operator/(T scalar, mat<2, 2, T, Q> const& m) + { + return mat<2, 2, T, Q>( + scalar / m[0], + scalar / m[1]); + } + + template + GLM_FUNC_QUALIFIER typename mat<2, 2, T, Q>::col_type operator/(mat<2, 2, T, Q> const& m, typename mat<2, 2, T, Q>::row_type const& v) + { + return inverse(m) * v; + } + + template + GLM_FUNC_QUALIFIER typename mat<2, 2, T, Q>::row_type operator/(typename mat<2, 2, T, Q>::col_type const& v, mat<2, 2, T, Q> const& m) + { + return v * inverse(m); + } + + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q> operator/(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2) + { + mat<2, 2, T, Q> m1_copy(m1); + return m1_copy /= m2; + } + + // -- Boolean operators -- + + template + GLM_FUNC_QUALIFIER bool operator==(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2) + { + return (m1[0] == m2[0]) && (m1[1] == m2[1]); + } + + template + GLM_FUNC_QUALIFIER bool operator!=(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2) + { + return (m1[0] != m2[0]) || (m1[1] != m2[1]); + } +} //namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_mat2x3.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_mat2x3.hpp new file mode 100644 index 0000000000000000000000000000000000000000..3888c3158c0ebdc04d539150b9fa4ff8f696535f --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_mat2x3.hpp @@ -0,0 +1,159 @@ +/// @ref core +/// @file glm/detail/type_mat2x3.hpp + +#pragma once + +#include "type_vec2.hpp" +#include "type_vec3.hpp" +#include +#include + +namespace glm +{ + template + struct mat<2, 3, T, Q> + { + typedef vec<3, T, Q> col_type; + typedef vec<2, T, Q> row_type; + typedef mat<2, 3, T, Q> type; + typedef mat<3, 2, T, Q> transpose_type; + typedef T value_type; + + private: + col_type value[2]; + + public: + // -- Accesses -- + + typedef length_t length_type; + GLM_FUNC_DECL static GLM_CONSTEXPR length_type length() { return 2; } + + GLM_FUNC_DECL col_type & operator[](length_type i) GLM_NOEXCEPT; + GLM_FUNC_DECL GLM_CONSTEXPR col_type const& operator[](length_type i) const GLM_NOEXCEPT; + + // -- Constructors -- + + GLM_FUNC_DECL GLM_CONSTEXPR mat() GLM_DEFAULT_CTOR; + template + GLM_FUNC_DECL GLM_CONSTEXPR mat(mat<2, 3, T, P> const& m); + + GLM_FUNC_DECL explicit GLM_CONSTEXPR mat(T scalar); + GLM_FUNC_DECL GLM_CONSTEXPR mat( + T x0, T y0, T z0, + T x1, T y1, T z1); + GLM_FUNC_DECL GLM_CONSTEXPR mat( + col_type const& v0, + col_type const& v1); + + // -- Conversions -- + + template + GLM_FUNC_DECL GLM_CONSTEXPR mat( + X1 x1, Y1 y1, Z1 z1, + X2 x2, Y2 y2, Z2 z2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR mat( + vec<3, U, Q> const& v1, + vec<3, V, Q> const& v2); + + // -- Matrix conversions -- + + template + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 3, U, P> const& m); + + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 2, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 3, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 4, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 4, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 2, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 4, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 2, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 3, T, Q> const& x); + + // -- Unary arithmetic operators -- + + template + GLM_FUNC_DECL mat<2, 3, T, Q> & operator=(mat<2, 3, U, Q> const& m); + template + GLM_FUNC_DECL mat<2, 3, T, Q> & operator+=(U s); + template + GLM_FUNC_DECL mat<2, 3, T, Q> & operator+=(mat<2, 3, U, Q> const& m); + template + GLM_FUNC_DECL mat<2, 3, T, Q> & operator-=(U s); + template + GLM_FUNC_DECL mat<2, 3, T, Q> & operator-=(mat<2, 3, U, Q> const& m); + template + GLM_FUNC_DECL mat<2, 3, T, Q> & operator*=(U s); + template + GLM_FUNC_DECL mat<2, 3, T, Q> & operator/=(U s); + + // -- Increment and decrement operators -- + + GLM_FUNC_DECL mat<2, 3, T, Q> & operator++ (); + GLM_FUNC_DECL mat<2, 3, T, Q> & operator-- (); + GLM_FUNC_DECL mat<2, 3, T, Q> operator++(int); + GLM_FUNC_DECL mat<2, 3, T, Q> operator--(int); + }; + + // -- Unary operators -- + + template + GLM_FUNC_DECL mat<2, 3, T, Q> operator+(mat<2, 3, T, Q> const& m); + + template + GLM_FUNC_DECL mat<2, 3, T, Q> operator-(mat<2, 3, T, Q> const& m); + + // -- Binary operators -- + + template + GLM_FUNC_DECL mat<2, 3, T, Q> operator+(mat<2, 3, T, Q> const& m, T scalar); + + template + GLM_FUNC_DECL mat<2, 3, T, Q> operator+(mat<2, 3, T, Q> const& m1, mat<2, 3, T, Q> const& m2); + + template + GLM_FUNC_DECL mat<2, 3, T, Q> operator-(mat<2, 3, T, Q> const& m, T scalar); + + template + GLM_FUNC_DECL mat<2, 3, T, Q> operator-(mat<2, 3, T, Q> const& m1, mat<2, 3, T, Q> const& m2); + + template + GLM_FUNC_DECL mat<2, 3, T, Q> operator*(mat<2, 3, T, Q> const& m, T scalar); + + template + GLM_FUNC_DECL mat<2, 3, T, Q> operator*(T scalar, mat<2, 3, T, Q> const& m); + + template + GLM_FUNC_DECL typename mat<2, 3, T, Q>::col_type operator*(mat<2, 3, T, Q> const& m, typename mat<2, 3, T, Q>::row_type const& v); + + template + GLM_FUNC_DECL typename mat<2, 3, T, Q>::row_type operator*(typename mat<2, 3, T, Q>::col_type const& v, mat<2, 3, T, Q> const& m); + + template + GLM_FUNC_DECL mat<2, 3, T, Q> operator*(mat<2, 3, T, Q> const& m1, mat<2, 2, T, Q> const& m2); + + template + GLM_FUNC_DECL mat<3, 3, T, Q> operator*(mat<2, 3, T, Q> const& m1, mat<3, 2, T, Q> const& m2); + + template + GLM_FUNC_DECL mat<4, 3, T, Q> operator*(mat<2, 3, T, Q> const& m1, mat<4, 2, T, Q> const& m2); + + template + GLM_FUNC_DECL mat<2, 3, T, Q> operator/(mat<2, 3, T, Q> const& m, T scalar); + + template + GLM_FUNC_DECL mat<2, 3, T, Q> operator/(T scalar, mat<2, 3, T, Q> const& m); + + // -- Boolean operators -- + + template + GLM_FUNC_DECL bool operator==(mat<2, 3, T, Q> const& m1, mat<2, 3, T, Q> const& m2); + + template + GLM_FUNC_DECL bool operator!=(mat<2, 3, T, Q> const& m1, mat<2, 3, T, Q> const& m2); +}//namespace glm + +#ifndef GLM_EXTERNAL_TEMPLATE +#include "type_mat2x3.inl" +#endif diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_mat2x3.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_mat2x3.inl new file mode 100644 index 0000000000000000000000000000000000000000..61e1db0feab18811d32a4efb0f670cbd2e704e84 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_mat2x3.inl @@ -0,0 +1,510 @@ +namespace glm +{ + // -- Constructors -- + +# if GLM_CONFIG_DEFAULTED_DEFAULT_CTOR == GLM_DISABLE + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q>::mat() +# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALIZER_LIST + : value{col_type(1, 0, 0), col_type(0, 1, 0)} +# endif + { +# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALISATION + this->value[0] = col_type(1, 0, 0); + this->value[1] = col_type(0, 1, 0); +# endif + } +# endif + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q>::mat(mat<2, 3, T, P> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1])} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = m.value[0]; + this->value[1] = m.value[1]; +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q>::mat(T scalar) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(scalar, 0, 0), col_type(0, scalar, 0)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(scalar, 0, 0); + this->value[1] = col_type(0, scalar, 0); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q>::mat + ( + T x0, T y0, T z0, + T x1, T y1, T z1 + ) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(x0, y0, z0), col_type(x1, y1, z1)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(x0, y0, z0); + this->value[1] = col_type(x1, y1, z1); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q>::mat(col_type const& v0, col_type const& v1) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(v0), col_type(v1)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(v0); + this->value[1] = col_type(v1); +# endif + } + + // -- Conversion constructors -- + + template + template< + typename X1, typename Y1, typename Z1, + typename X2, typename Y2, typename Z2> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q>::mat + ( + X1 x1, Y1 y1, Z1 z1, + X2 x2, Y2 y2, Z2 z2 + ) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(x1, y1, z1), col_type(x2, y2, z2)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(x1, y1, z1); + this->value[1] = col_type(x2, y2, z2); +# endif + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q>::mat(vec<3, V1, Q> const& v1, vec<3, V2, Q> const& v2) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(v1), col_type(v2)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(v1); + this->value[1] = col_type(v2); +# endif + } + + // -- Matrix conversions -- + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q>::mat(mat<2, 3, U, P> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1])} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q>::mat(mat<2, 2, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0], 0), col_type(m[1], 0)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0], 0); + this->value[1] = col_type(m[1], 0); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q>::mat(mat<3, 3, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1])} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q>::mat(mat<4, 4, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1])} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q>::mat(mat<2, 4, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1])} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q>::mat(mat<3, 2, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0], 0), col_type(m[1], 0)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0], 0); + this->value[1] = col_type(m[1], 0); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q>::mat(mat<3, 4, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1])} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q>::mat(mat<4, 2, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0], 0), col_type(m[1], 0)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0], 0); + this->value[1] = col_type(m[1], 0); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q>::mat(mat<4, 3, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1])} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); +# endif + } + + // -- Accesses -- + + template + GLM_FUNC_QUALIFIER typename mat<2, 3, T, Q>::col_type & mat<2, 3, T, Q>::operator[](typename mat<2, 3, T, Q>::length_type i) GLM_NOEXCEPT + { + assert(i < this->length()); + return this->value[i]; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<2, 3, T, Q>::col_type const& mat<2, 3, T, Q>::operator[](typename mat<2, 3, T, Q>::length_type i) const GLM_NOEXCEPT + { + assert(i < this->length()); + return this->value[i]; + } + + // -- Unary updatable operators -- + + template + template + GLM_FUNC_QUALIFIER mat<2, 3, T, Q>& mat<2, 3, T, Q>::operator=(mat<2, 3, U, Q> const& m) + { + this->value[0] = m[0]; + this->value[1] = m[1]; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<2, 3, T, Q> & mat<2, 3, T, Q>::operator+=(U s) + { + this->value[0] += s; + this->value[1] += s; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<2, 3, T, Q>& mat<2, 3, T, Q>::operator+=(mat<2, 3, U, Q> const& m) + { + this->value[0] += m[0]; + this->value[1] += m[1]; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<2, 3, T, Q>& mat<2, 3, T, Q>::operator-=(U s) + { + this->value[0] -= s; + this->value[1] -= s; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<2, 3, T, Q>& mat<2, 3, T, Q>::operator-=(mat<2, 3, U, Q> const& m) + { + this->value[0] -= m[0]; + this->value[1] -= m[1]; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<2, 3, T, Q>& mat<2, 3, T, Q>::operator*=(U s) + { + this->value[0] *= s; + this->value[1] *= s; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<2, 3, T, Q> & mat<2, 3, T, Q>::operator/=(U s) + { + this->value[0] /= s; + this->value[1] /= s; + return *this; + } + + // -- Increment and decrement operators -- + + template + GLM_FUNC_QUALIFIER mat<2, 3, T, Q> & mat<2, 3, T, Q>::operator++() + { + ++this->value[0]; + ++this->value[1]; + return *this; + } + + template + GLM_FUNC_QUALIFIER mat<2, 3, T, Q> & mat<2, 3, T, Q>::operator--() + { + --this->value[0]; + --this->value[1]; + return *this; + } + + template + GLM_FUNC_QUALIFIER mat<2, 3, T, Q> mat<2, 3, T, Q>::operator++(int) + { + mat<2, 3, T, Q> Result(*this); + ++*this; + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<2, 3, T, Q> mat<2, 3, T, Q>::operator--(int) + { + mat<2, 3, T, Q> Result(*this); + --*this; + return Result; + } + + // -- Unary arithmetic operators -- + + template + GLM_FUNC_QUALIFIER mat<2, 3, T, Q> operator+(mat<2, 3, T, Q> const& m) + { + return m; + } + + template + GLM_FUNC_QUALIFIER mat<2, 3, T, Q> operator-(mat<2, 3, T, Q> const& m) + { + return mat<2, 3, T, Q>( + -m[0], + -m[1]); + } + + // -- Binary arithmetic operators -- + + template + GLM_FUNC_QUALIFIER mat<2, 3, T, Q> operator+(mat<2, 3, T, Q> const& m, T scalar) + { + return mat<2, 3, T, Q>( + m[0] + scalar, + m[1] + scalar); + } + + template + GLM_FUNC_QUALIFIER mat<2, 3, T, Q> operator+(mat<2, 3, T, Q> const& m1, mat<2, 3, T, Q> const& m2) + { + return mat<2, 3, T, Q>( + m1[0] + m2[0], + m1[1] + m2[1]); + } + + template + GLM_FUNC_QUALIFIER mat<2, 3, T, Q> operator-(mat<2, 3, T, Q> const& m, T scalar) + { + return mat<2, 3, T, Q>( + m[0] - scalar, + m[1] - scalar); + } + + template + GLM_FUNC_QUALIFIER mat<2, 3, T, Q> operator-(mat<2, 3, T, Q> const& m1, mat<2, 3, T, Q> const& m2) + { + return mat<2, 3, T, Q>( + m1[0] - m2[0], + m1[1] - m2[1]); + } + + template + GLM_FUNC_QUALIFIER mat<2, 3, T, Q> operator*(mat<2, 3, T, Q> const& m, T scalar) + { + return mat<2, 3, T, Q>( + m[0] * scalar, + m[1] * scalar); + } + + template + GLM_FUNC_QUALIFIER mat<2, 3, T, Q> operator*(T scalar, mat<2, 3, T, Q> const& m) + { + return mat<2, 3, T, Q>( + m[0] * scalar, + m[1] * scalar); + } + + template + GLM_FUNC_QUALIFIER typename mat<2, 3, T, Q>::col_type operator* + ( + mat<2, 3, T, Q> const& m, + typename mat<2, 3, T, Q>::row_type const& v) + { + return typename mat<2, 3, T, Q>::col_type( + m[0][0] * v.x + m[1][0] * v.y, + m[0][1] * v.x + m[1][1] * v.y, + m[0][2] * v.x + m[1][2] * v.y); + } + + template + GLM_FUNC_QUALIFIER typename mat<2, 3, T, Q>::row_type operator* + ( + typename mat<2, 3, T, Q>::col_type const& v, + mat<2, 3, T, Q> const& m) + { + return typename mat<2, 3, T, Q>::row_type( + v.x * m[0][0] + v.y * m[0][1] + v.z * m[0][2], + v.x * m[1][0] + v.y * m[1][1] + v.z * m[1][2]); + } + + template + GLM_FUNC_QUALIFIER mat<2, 3, T, Q> operator*(mat<2, 3, T, Q> const& m1, mat<2, 2, T, Q> const& m2) + { + return mat<2, 3, T, Q>( + m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1], + m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1], + m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1], + m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1], + m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1], + m1[0][2] * m2[1][0] + m1[1][2] * m2[1][1]); + } + + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator*(mat<2, 3, T, Q> const& m1, mat<3, 2, T, Q> const& m2) + { + T SrcA00 = m1[0][0]; + T SrcA01 = m1[0][1]; + T SrcA02 = m1[0][2]; + T SrcA10 = m1[1][0]; + T SrcA11 = m1[1][1]; + T SrcA12 = m1[1][2]; + + T SrcB00 = m2[0][0]; + T SrcB01 = m2[0][1]; + T SrcB10 = m2[1][0]; + T SrcB11 = m2[1][1]; + T SrcB20 = m2[2][0]; + T SrcB21 = m2[2][1]; + + mat<3, 3, T, Q> Result; + Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01; + Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01; + Result[0][2] = SrcA02 * SrcB00 + SrcA12 * SrcB01; + Result[1][0] = SrcA00 * SrcB10 + SrcA10 * SrcB11; + Result[1][1] = SrcA01 * SrcB10 + SrcA11 * SrcB11; + Result[1][2] = SrcA02 * SrcB10 + SrcA12 * SrcB11; + Result[2][0] = SrcA00 * SrcB20 + SrcA10 * SrcB21; + Result[2][1] = SrcA01 * SrcB20 + SrcA11 * SrcB21; + Result[2][2] = SrcA02 * SrcB20 + SrcA12 * SrcB21; + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 3, T, Q> operator*(mat<2, 3, T, Q> const& m1, mat<4, 2, T, Q> const& m2) + { + return mat<4, 3, T, Q>( + m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1], + m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1], + m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1], + m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1], + m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1], + m1[0][2] * m2[1][0] + m1[1][2] * m2[1][1], + m1[0][0] * m2[2][0] + m1[1][0] * m2[2][1], + m1[0][1] * m2[2][0] + m1[1][1] * m2[2][1], + m1[0][2] * m2[2][0] + m1[1][2] * m2[2][1], + m1[0][0] * m2[3][0] + m1[1][0] * m2[3][1], + m1[0][1] * m2[3][0] + m1[1][1] * m2[3][1], + m1[0][2] * m2[3][0] + m1[1][2] * m2[3][1]); + } + + template + GLM_FUNC_QUALIFIER mat<2, 3, T, Q> operator/(mat<2, 3, T, Q> const& m, T scalar) + { + return mat<2, 3, T, Q>( + m[0] / scalar, + m[1] / scalar); + } + + template + GLM_FUNC_QUALIFIER mat<2, 3, T, Q> operator/(T scalar, mat<2, 3, T, Q> const& m) + { + return mat<2, 3, T, Q>( + scalar / m[0], + scalar / m[1]); + } + + // -- Boolean operators -- + + template + GLM_FUNC_QUALIFIER bool operator==(mat<2, 3, T, Q> const& m1, mat<2, 3, T, Q> const& m2) + { + return (m1[0] == m2[0]) && (m1[1] == m2[1]); + } + + template + GLM_FUNC_QUALIFIER bool operator!=(mat<2, 3, T, Q> const& m1, mat<2, 3, T, Q> const& m2) + { + return (m1[0] != m2[0]) || (m1[1] != m2[1]); + } +} //namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_mat2x4.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_mat2x4.hpp new file mode 100644 index 0000000000000000000000000000000000000000..cfd1a54e3e0f704c4f32cdb2ba0b9cffc8b4c522 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_mat2x4.hpp @@ -0,0 +1,161 @@ +/// @ref core +/// @file glm/detail/type_mat2x4.hpp + +#pragma once + +#include "type_vec2.hpp" +#include "type_vec4.hpp" +#include +#include + +namespace glm +{ + template + struct mat<2, 4, T, Q> + { + typedef vec<4, T, Q> col_type; + typedef vec<2, T, Q> row_type; + typedef mat<2, 4, T, Q> type; + typedef mat<4, 2, T, Q> transpose_type; + typedef T value_type; + + private: + col_type value[2]; + + public: + // -- Accesses -- + + typedef length_t length_type; + GLM_FUNC_DECL static GLM_CONSTEXPR length_type length() { return 2; } + + GLM_FUNC_DECL col_type & operator[](length_type i) GLM_NOEXCEPT; + GLM_FUNC_DECL GLM_CONSTEXPR col_type const& operator[](length_type i) const GLM_NOEXCEPT; + + // -- Constructors -- + + GLM_FUNC_DECL GLM_CONSTEXPR mat() GLM_DEFAULT_CTOR; + template + GLM_FUNC_DECL GLM_CONSTEXPR mat(mat<2, 4, T, P> const& m); + + GLM_FUNC_DECL explicit GLM_CONSTEXPR mat(T scalar); + GLM_FUNC_DECL GLM_CONSTEXPR mat( + T x0, T y0, T z0, T w0, + T x1, T y1, T z1, T w1); + GLM_FUNC_DECL GLM_CONSTEXPR mat( + col_type const& v0, + col_type const& v1); + + // -- Conversions -- + + template< + typename X1, typename Y1, typename Z1, typename W1, + typename X2, typename Y2, typename Z2, typename W2> + GLM_FUNC_DECL GLM_CONSTEXPR mat( + X1 x1, Y1 y1, Z1 z1, W1 w1, + X2 x2, Y2 y2, Z2 z2, W2 w2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR mat( + vec<4, U, Q> const& v1, + vec<4, V, Q> const& v2); + + // -- Matrix conversions -- + + template + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 4, U, P> const& m); + + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 2, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 3, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 4, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 3, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 2, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 4, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 2, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 3, T, Q> const& x); + + // -- Unary arithmetic operators -- + + template + GLM_FUNC_DECL mat<2, 4, T, Q> & operator=(mat<2, 4, U, Q> const& m); + template + GLM_FUNC_DECL mat<2, 4, T, Q> & operator+=(U s); + template + GLM_FUNC_DECL mat<2, 4, T, Q> & operator+=(mat<2, 4, U, Q> const& m); + template + GLM_FUNC_DECL mat<2, 4, T, Q> & operator-=(U s); + template + GLM_FUNC_DECL mat<2, 4, T, Q> & operator-=(mat<2, 4, U, Q> const& m); + template + GLM_FUNC_DECL mat<2, 4, T, Q> & operator*=(U s); + template + GLM_FUNC_DECL mat<2, 4, T, Q> & operator/=(U s); + + // -- Increment and decrement operators -- + + GLM_FUNC_DECL mat<2, 4, T, Q> & operator++ (); + GLM_FUNC_DECL mat<2, 4, T, Q> & operator-- (); + GLM_FUNC_DECL mat<2, 4, T, Q> operator++(int); + GLM_FUNC_DECL mat<2, 4, T, Q> operator--(int); + }; + + // -- Unary operators -- + + template + GLM_FUNC_DECL mat<2, 4, T, Q> operator+(mat<2, 4, T, Q> const& m); + + template + GLM_FUNC_DECL mat<2, 4, T, Q> operator-(mat<2, 4, T, Q> const& m); + + // -- Binary operators -- + + template + GLM_FUNC_DECL mat<2, 4, T, Q> operator+(mat<2, 4, T, Q> const& m, T scalar); + + template + GLM_FUNC_DECL mat<2, 4, T, Q> operator+(mat<2, 4, T, Q> const& m1, mat<2, 4, T, Q> const& m2); + + template + GLM_FUNC_DECL mat<2, 4, T, Q> operator-(mat<2, 4, T, Q> const& m, T scalar); + + template + GLM_FUNC_DECL mat<2, 4, T, Q> operator-(mat<2, 4, T, Q> const& m1, mat<2, 4, T, Q> const& m2); + + template + GLM_FUNC_DECL mat<2, 4, T, Q> operator*(mat<2, 4, T, Q> const& m, T scalar); + + template + GLM_FUNC_DECL mat<2, 4, T, Q> operator*(T scalar, mat<2, 4, T, Q> const& m); + + template + GLM_FUNC_DECL typename mat<2, 4, T, Q>::col_type operator*(mat<2, 4, T, Q> const& m, typename mat<2, 4, T, Q>::row_type const& v); + + template + GLM_FUNC_DECL typename mat<2, 4, T, Q>::row_type operator*(typename mat<2, 4, T, Q>::col_type const& v, mat<2, 4, T, Q> const& m); + + template + GLM_FUNC_DECL mat<4, 4, T, Q> operator*(mat<2, 4, T, Q> const& m1, mat<4, 2, T, Q> const& m2); + + template + GLM_FUNC_DECL mat<2, 4, T, Q> operator*(mat<2, 4, T, Q> const& m1, mat<2, 2, T, Q> const& m2); + + template + GLM_FUNC_DECL mat<3, 4, T, Q> operator*(mat<2, 4, T, Q> const& m1, mat<3, 2, T, Q> const& m2); + + template + GLM_FUNC_DECL mat<2, 4, T, Q> operator/(mat<2, 4, T, Q> const& m, T scalar); + + template + GLM_FUNC_DECL mat<2, 4, T, Q> operator/(T scalar, mat<2, 4, T, Q> const& m); + + // -- Boolean operators -- + + template + GLM_FUNC_DECL bool operator==(mat<2, 4, T, Q> const& m1, mat<2, 4, T, Q> const& m2); + + template + GLM_FUNC_DECL bool operator!=(mat<2, 4, T, Q> const& m1, mat<2, 4, T, Q> const& m2); +}//namespace glm + +#ifndef GLM_EXTERNAL_TEMPLATE +#include "type_mat2x4.inl" +#endif diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_mat2x4.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_mat2x4.inl new file mode 100644 index 0000000000000000000000000000000000000000..7ff3fa2696a40c9532276d7cc1508c3cb30a4fed --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_mat2x4.inl @@ -0,0 +1,520 @@ +namespace glm +{ + // -- Constructors -- + +# if GLM_CONFIG_DEFAULTED_DEFAULT_CTOR == GLM_DISABLE + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>::mat() +# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALIZER_LIST + : value{col_type(1, 0, 0, 0), col_type(0, 1, 0, 0)} +# endif + { +# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALISATION + this->value[0] = col_type(1, 0, 0, 0); + this->value[1] = col_type(0, 1, 0, 0); +# endif + } +# endif + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>::mat(mat<2, 4, T, P> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1])} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = m[0]; + this->value[1] = m[1]; +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>::mat(T s) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(s, 0, 0, 0), col_type(0, s, 0, 0)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(s, 0, 0, 0); + this->value[1] = col_type(0, s, 0, 0); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>::mat + ( + T x0, T y0, T z0, T w0, + T x1, T y1, T z1, T w1 + ) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(x0, y0, z0, w0), col_type(x1, y1, z1, w1)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(x0, y0, z0, w0); + this->value[1] = col_type(x1, y1, z1, w1); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>::mat(col_type const& v0, col_type const& v1) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(v0), col_type(v1)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = v0; + this->value[1] = v1; +# endif + } + + // -- Conversion constructors -- + + template + template< + typename X1, typename Y1, typename Z1, typename W1, + typename X2, typename Y2, typename Z2, typename W2> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>::mat + ( + X1 x1, Y1 y1, Z1 z1, W1 w1, + X2 x2, Y2 y2, Z2 z2, W2 w2 + ) +# if GLM_HAS_INITIALIZER_LISTS + : value{ + col_type(x1, y1, z1, w1), + col_type(x2, y2, z2, w2)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(x1, y1, z1, w1); + this->value[1] = col_type(x2, y2, z2, w2); +# endif + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>::mat(vec<4, V1, Q> const& v1, vec<4, V2, Q> const& v2) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(v1), col_type(v2)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(v1); + this->value[1] = col_type(v2); +# endif + } + + // -- Matrix conversions -- + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>::mat(mat<2, 4, U, P> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1])} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>::mat(mat<2, 2, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0], 0, 0), col_type(m[1], 0, 0)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0], 0, 0); + this->value[1] = col_type(m[1], 0, 0); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>::mat(mat<3, 3, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0], 0), col_type(m[1], 0)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0], 0); + this->value[1] = col_type(m[1], 0); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>::mat(mat<4, 4, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1])} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>::mat(mat<2, 3, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0], 0), col_type(m[1], 0)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0], 0); + this->value[1] = col_type(m[1], 0); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>::mat(mat<3, 2, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0], 0, 0), col_type(m[1], 0, 0)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0], 0, 0); + this->value[1] = col_type(m[1], 0, 0); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>::mat(mat<3, 4, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1])} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>::mat(mat<4, 2, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0], 0, 0), col_type(m[1], 0, 0)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0], 0, 0); + this->value[1] = col_type(m[1], 0, 0); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>::mat(mat<4, 3, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0], 0), col_type(m[1], 0)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0], 0); + this->value[1] = col_type(m[1], 0); +# endif + } + + // -- Accesses -- + + template + GLM_FUNC_QUALIFIER typename mat<2, 4, T, Q>::col_type & mat<2, 4, T, Q>::operator[](typename mat<2, 4, T, Q>::length_type i) GLM_NOEXCEPT + { + assert(i < this->length()); + return this->value[i]; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<2, 4, T, Q>::col_type const& mat<2, 4, T, Q>::operator[](typename mat<2, 4, T, Q>::length_type i) const GLM_NOEXCEPT + { + assert(i < this->length()); + return this->value[i]; + } + + // -- Unary updatable operators -- + + template + template + GLM_FUNC_QUALIFIER mat<2, 4, T, Q>& mat<2, 4, T, Q>::operator=(mat<2, 4, U, Q> const& m) + { + this->value[0] = m[0]; + this->value[1] = m[1]; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<2, 4, T, Q>& mat<2, 4, T, Q>::operator+=(U s) + { + this->value[0] += s; + this->value[1] += s; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<2, 4, T, Q>& mat<2, 4, T, Q>::operator+=(mat<2, 4, U, Q> const& m) + { + this->value[0] += m[0]; + this->value[1] += m[1]; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<2, 4, T, Q>& mat<2, 4, T, Q>::operator-=(U s) + { + this->value[0] -= s; + this->value[1] -= s; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<2, 4, T, Q>& mat<2, 4, T, Q>::operator-=(mat<2, 4, U, Q> const& m) + { + this->value[0] -= m[0]; + this->value[1] -= m[1]; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<2, 4, T, Q>& mat<2, 4, T, Q>::operator*=(U s) + { + this->value[0] *= s; + this->value[1] *= s; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<2, 4, T, Q> & mat<2, 4, T, Q>::operator/=(U s) + { + this->value[0] /= s; + this->value[1] /= s; + return *this; + } + + // -- Increment and decrement operators -- + + template + GLM_FUNC_QUALIFIER mat<2, 4, T, Q>& mat<2, 4, T, Q>::operator++() + { + ++this->value[0]; + ++this->value[1]; + return *this; + } + + template + GLM_FUNC_QUALIFIER mat<2, 4, T, Q>& mat<2, 4, T, Q>::operator--() + { + --this->value[0]; + --this->value[1]; + return *this; + } + + template + GLM_FUNC_QUALIFIER mat<2, 4, T, Q> mat<2, 4, T, Q>::operator++(int) + { + mat<2, 4, T, Q> Result(*this); + ++*this; + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<2, 4, T, Q> mat<2, 4, T, Q>::operator--(int) + { + mat<2, 4, T, Q> Result(*this); + --*this; + return Result; + } + + // -- Unary arithmetic operators -- + + template + GLM_FUNC_QUALIFIER mat<2, 4, T, Q> operator+(mat<2, 4, T, Q> const& m) + { + return m; + } + + template + GLM_FUNC_QUALIFIER mat<2, 4, T, Q> operator-(mat<2, 4, T, Q> const& m) + { + return mat<2, 4, T, Q>( + -m[0], + -m[1]); + } + + // -- Binary arithmetic operators -- + + template + GLM_FUNC_QUALIFIER mat<2, 4, T, Q> operator+(mat<2, 4, T, Q> const& m, T scalar) + { + return mat<2, 4, T, Q>( + m[0] + scalar, + m[1] + scalar); + } + + template + GLM_FUNC_QUALIFIER mat<2, 4, T, Q> operator+(mat<2, 4, T, Q> const& m1, mat<2, 4, T, Q> const& m2) + { + return mat<2, 4, T, Q>( + m1[0] + m2[0], + m1[1] + m2[1]); + } + + template + GLM_FUNC_QUALIFIER mat<2, 4, T, Q> operator-(mat<2, 4, T, Q> const& m, T scalar) + { + return mat<2, 4, T, Q>( + m[0] - scalar, + m[1] - scalar); + } + + template + GLM_FUNC_QUALIFIER mat<2, 4, T, Q> operator-(mat<2, 4, T, Q> const& m1, mat<2, 4, T, Q> const& m2) + { + return mat<2, 4, T, Q>( + m1[0] - m2[0], + m1[1] - m2[1]); + } + + template + GLM_FUNC_QUALIFIER mat<2, 4, T, Q> operator*(mat<2, 4, T, Q> const& m, T scalar) + { + return mat<2, 4, T, Q>( + m[0] * scalar, + m[1] * scalar); + } + + template + GLM_FUNC_QUALIFIER mat<2, 4, T, Q> operator*(T scalar, mat<2, 4, T, Q> const& m) + { + return mat<2, 4, T, Q>( + m[0] * scalar, + m[1] * scalar); + } + + template + GLM_FUNC_QUALIFIER typename mat<2, 4, T, Q>::col_type operator*(mat<2, 4, T, Q> const& m, typename mat<2, 4, T, Q>::row_type const& v) + { + return typename mat<2, 4, T, Q>::col_type( + m[0][0] * v.x + m[1][0] * v.y, + m[0][1] * v.x + m[1][1] * v.y, + m[0][2] * v.x + m[1][2] * v.y, + m[0][3] * v.x + m[1][3] * v.y); + } + + template + GLM_FUNC_QUALIFIER typename mat<2, 4, T, Q>::row_type operator*(typename mat<2, 4, T, Q>::col_type const& v, mat<2, 4, T, Q> const& m) + { + return typename mat<2, 4, T, Q>::row_type( + v.x * m[0][0] + v.y * m[0][1] + v.z * m[0][2] + v.w * m[0][3], + v.x * m[1][0] + v.y * m[1][1] + v.z * m[1][2] + v.w * m[1][3]); + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> operator*(mat<2, 4, T, Q> const& m1, mat<4, 2, T, Q> const& m2) + { + T SrcA00 = m1[0][0]; + T SrcA01 = m1[0][1]; + T SrcA02 = m1[0][2]; + T SrcA03 = m1[0][3]; + T SrcA10 = m1[1][0]; + T SrcA11 = m1[1][1]; + T SrcA12 = m1[1][2]; + T SrcA13 = m1[1][3]; + + T SrcB00 = m2[0][0]; + T SrcB01 = m2[0][1]; + T SrcB10 = m2[1][0]; + T SrcB11 = m2[1][1]; + T SrcB20 = m2[2][0]; + T SrcB21 = m2[2][1]; + T SrcB30 = m2[3][0]; + T SrcB31 = m2[3][1]; + + mat<4, 4, T, Q> Result; + Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01; + Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01; + Result[0][2] = SrcA02 * SrcB00 + SrcA12 * SrcB01; + Result[0][3] = SrcA03 * SrcB00 + SrcA13 * SrcB01; + Result[1][0] = SrcA00 * SrcB10 + SrcA10 * SrcB11; + Result[1][1] = SrcA01 * SrcB10 + SrcA11 * SrcB11; + Result[1][2] = SrcA02 * SrcB10 + SrcA12 * SrcB11; + Result[1][3] = SrcA03 * SrcB10 + SrcA13 * SrcB11; + Result[2][0] = SrcA00 * SrcB20 + SrcA10 * SrcB21; + Result[2][1] = SrcA01 * SrcB20 + SrcA11 * SrcB21; + Result[2][2] = SrcA02 * SrcB20 + SrcA12 * SrcB21; + Result[2][3] = SrcA03 * SrcB20 + SrcA13 * SrcB21; + Result[3][0] = SrcA00 * SrcB30 + SrcA10 * SrcB31; + Result[3][1] = SrcA01 * SrcB30 + SrcA11 * SrcB31; + Result[3][2] = SrcA02 * SrcB30 + SrcA12 * SrcB31; + Result[3][3] = SrcA03 * SrcB30 + SrcA13 * SrcB31; + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<2, 4, T, Q> operator*(mat<2, 4, T, Q> const& m1, mat<2, 2, T, Q> const& m2) + { + return mat<2, 4, T, Q>( + m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1], + m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1], + m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1], + m1[0][3] * m2[0][0] + m1[1][3] * m2[0][1], + m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1], + m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1], + m1[0][2] * m2[1][0] + m1[1][2] * m2[1][1], + m1[0][3] * m2[1][0] + m1[1][3] * m2[1][1]); + } + + template + GLM_FUNC_QUALIFIER mat<3, 4, T, Q> operator*(mat<2, 4, T, Q> const& m1, mat<3, 2, T, Q> const& m2) + { + return mat<3, 4, T, Q>( + m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1], + m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1], + m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1], + m1[0][3] * m2[0][0] + m1[1][3] * m2[0][1], + m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1], + m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1], + m1[0][2] * m2[1][0] + m1[1][2] * m2[1][1], + m1[0][3] * m2[1][0] + m1[1][3] * m2[1][1], + m1[0][0] * m2[2][0] + m1[1][0] * m2[2][1], + m1[0][1] * m2[2][0] + m1[1][1] * m2[2][1], + m1[0][2] * m2[2][0] + m1[1][2] * m2[2][1], + m1[0][3] * m2[2][0] + m1[1][3] * m2[2][1]); + } + + template + GLM_FUNC_QUALIFIER mat<2, 4, T, Q> operator/(mat<2, 4, T, Q> const& m, T scalar) + { + return mat<2, 4, T, Q>( + m[0] / scalar, + m[1] / scalar); + } + + template + GLM_FUNC_QUALIFIER mat<2, 4, T, Q> operator/(T scalar, mat<2, 4, T, Q> const& m) + { + return mat<2, 4, T, Q>( + scalar / m[0], + scalar / m[1]); + } + + // -- Boolean operators -- + + template + GLM_FUNC_QUALIFIER bool operator==(mat<2, 4, T, Q> const& m1, mat<2, 4, T, Q> const& m2) + { + return (m1[0] == m2[0]) && (m1[1] == m2[1]); + } + + template + GLM_FUNC_QUALIFIER bool operator!=(mat<2, 4, T, Q> const& m1, mat<2, 4, T, Q> const& m2) + { + return (m1[0] != m2[0]) || (m1[1] != m2[1]); + } +} //namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_mat3x2.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_mat3x2.hpp new file mode 100644 index 0000000000000000000000000000000000000000..a242ddde5742f20127c4038411718c860148cc22 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_mat3x2.hpp @@ -0,0 +1,167 @@ +/// @ref core +/// @file glm/detail/type_mat3x2.hpp + +#pragma once + +#include "type_vec2.hpp" +#include "type_vec3.hpp" +#include +#include + +namespace glm +{ + template + struct mat<3, 2, T, Q> + { + typedef vec<2, T, Q> col_type; + typedef vec<3, T, Q> row_type; + typedef mat<3, 2, T, Q> type; + typedef mat<2, 3, T, Q> transpose_type; + typedef T value_type; + + private: + col_type value[3]; + + public: + // -- Accesses -- + + typedef length_t length_type; + GLM_FUNC_DECL static GLM_CONSTEXPR length_type length() { return 3; } + + GLM_FUNC_DECL col_type & operator[](length_type i) GLM_NOEXCEPT; + GLM_FUNC_DECL GLM_CONSTEXPR col_type const& operator[](length_type i) const GLM_NOEXCEPT; + + // -- Constructors -- + + GLM_FUNC_DECL GLM_CONSTEXPR mat() GLM_DEFAULT_CTOR; + template + GLM_FUNC_DECL GLM_CONSTEXPR mat(mat<3, 2, T, P> const& m); + + GLM_FUNC_DECL explicit GLM_CONSTEXPR mat(T scalar); + GLM_FUNC_DECL GLM_CONSTEXPR mat( + T x0, T y0, + T x1, T y1, + T x2, T y2); + GLM_FUNC_DECL GLM_CONSTEXPR mat( + col_type const& v0, + col_type const& v1, + col_type const& v2); + + // -- Conversions -- + + template< + typename X1, typename Y1, + typename X2, typename Y2, + typename X3, typename Y3> + GLM_FUNC_DECL GLM_CONSTEXPR mat( + X1 x1, Y1 y1, + X2 x2, Y2 y2, + X3 x3, Y3 y3); + + template + GLM_FUNC_DECL GLM_CONSTEXPR mat( + vec<2, V1, Q> const& v1, + vec<2, V2, Q> const& v2, + vec<2, V3, Q> const& v3); + + // -- Matrix conversions -- + + template + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 2, U, P> const& m); + + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 2, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 3, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 4, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 3, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 4, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 4, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 2, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 3, T, Q> const& x); + + // -- Unary arithmetic operators -- + + template + GLM_FUNC_DECL mat<3, 2, T, Q> & operator=(mat<3, 2, U, Q> const& m); + template + GLM_FUNC_DECL mat<3, 2, T, Q> & operator+=(U s); + template + GLM_FUNC_DECL mat<3, 2, T, Q> & operator+=(mat<3, 2, U, Q> const& m); + template + GLM_FUNC_DECL mat<3, 2, T, Q> & operator-=(U s); + template + GLM_FUNC_DECL mat<3, 2, T, Q> & operator-=(mat<3, 2, U, Q> const& m); + template + GLM_FUNC_DECL mat<3, 2, T, Q> & operator*=(U s); + template + GLM_FUNC_DECL mat<3, 2, T, Q> & operator/=(U s); + + // -- Increment and decrement operators -- + + GLM_FUNC_DECL mat<3, 2, T, Q> & operator++ (); + GLM_FUNC_DECL mat<3, 2, T, Q> & operator-- (); + GLM_FUNC_DECL mat<3, 2, T, Q> operator++(int); + GLM_FUNC_DECL mat<3, 2, T, Q> operator--(int); + }; + + // -- Unary operators -- + + template + GLM_FUNC_DECL mat<3, 2, T, Q> operator+(mat<3, 2, T, Q> const& m); + + template + GLM_FUNC_DECL mat<3, 2, T, Q> operator-(mat<3, 2, T, Q> const& m); + + // -- Binary operators -- + + template + GLM_FUNC_DECL mat<3, 2, T, Q> operator+(mat<3, 2, T, Q> const& m, T scalar); + + template + GLM_FUNC_DECL mat<3, 2, T, Q> operator+(mat<3, 2, T, Q> const& m1, mat<3, 2, T, Q> const& m2); + + template + GLM_FUNC_DECL mat<3, 2, T, Q> operator-(mat<3, 2, T, Q> const& m, T scalar); + + template + GLM_FUNC_DECL mat<3, 2, T, Q> operator-(mat<3, 2, T, Q> const& m1, mat<3, 2, T, Q> const& m2); + + template + GLM_FUNC_DECL mat<3, 2, T, Q> operator*(mat<3, 2, T, Q> const& m, T scalar); + + template + GLM_FUNC_DECL mat<3, 2, T, Q> operator*(T scalar, mat<3, 2, T, Q> const& m); + + template + GLM_FUNC_DECL typename mat<3, 2, T, Q>::col_type operator*(mat<3, 2, T, Q> const& m, typename mat<3, 2, T, Q>::row_type const& v); + + template + GLM_FUNC_DECL typename mat<3, 2, T, Q>::row_type operator*(typename mat<3, 2, T, Q>::col_type const& v, mat<3, 2, T, Q> const& m); + + template + GLM_FUNC_DECL mat<2, 2, T, Q> operator*(mat<3, 2, T, Q> const& m1, mat<2, 3, T, Q> const& m2); + + template + GLM_FUNC_DECL mat<3, 2, T, Q> operator*(mat<3, 2, T, Q> const& m1, mat<3, 3, T, Q> const& m2); + + template + GLM_FUNC_DECL mat<4, 2, T, Q> operator*(mat<3, 2, T, Q> const& m1, mat<4, 3, T, Q> const& m2); + + template + GLM_FUNC_DECL mat<3, 2, T, Q> operator/(mat<3, 2, T, Q> const& m, T scalar); + + template + GLM_FUNC_DECL mat<3, 2, T, Q> operator/(T scalar, mat<3, 2, T, Q> const& m); + + // -- Boolean operators -- + + template + GLM_FUNC_DECL bool operator==(mat<3, 2, T, Q> const& m1, mat<3, 2, T, Q> const& m2); + + template + GLM_FUNC_DECL bool operator!=(mat<3, 2, T, Q> const& m1, mat<3, 2, T, Q> const& m2); + +}//namespace glm + +#ifndef GLM_EXTERNAL_TEMPLATE +#include "type_mat3x2.inl" +#endif diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_mat3x2.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_mat3x2.inl new file mode 100644 index 0000000000000000000000000000000000000000..27d4c8b73bc0e1f1d143f2095b100dc06b7bb050 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_mat3x2.inl @@ -0,0 +1,532 @@ +namespace glm +{ + // -- Constructors -- + +# if GLM_CONFIG_DEFAULTED_DEFAULT_CTOR == GLM_DISABLE + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>::mat() +# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALIZER_LIST + : value{col_type(1, 0), col_type(0, 1), col_type(0, 0)} +# endif + { +# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALISATION + this->value[0] = col_type(1, 0); + this->value[1] = col_type(0, 1); + this->value[2] = col_type(0, 0); +# endif + } +# endif + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>::mat(mat<3, 2, T, P> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(m[2])} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = m[0]; + this->value[1] = m[1]; + this->value[2] = m[2]; +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>::mat(T s) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(s, 0), col_type(0, s), col_type(0, 0)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(s, 0); + this->value[1] = col_type(0, s); + this->value[2] = col_type(0, 0); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>::mat + ( + T x0, T y0, + T x1, T y1, + T x2, T y2 + ) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(x0, y0), col_type(x1, y1), col_type(x2, y2)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(x0, y0); + this->value[1] = col_type(x1, y1); + this->value[2] = col_type(x2, y2); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>::mat(col_type const& v0, col_type const& v1, col_type const& v2) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(v0), col_type(v1), col_type(v2)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = v0; + this->value[1] = v1; + this->value[2] = v2; +# endif + } + + // -- Conversion constructors -- + + template + template< + typename X0, typename Y0, + typename X1, typename Y1, + typename X2, typename Y2> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>::mat + ( + X0 x0, Y0 y0, + X1 x1, Y1 y1, + X2 x2, Y2 y2 + ) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(x0, y0), col_type(x1, y1), col_type(x2, y2)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(x0, y0); + this->value[1] = col_type(x1, y1); + this->value[2] = col_type(x2, y2); +# endif + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>::mat(vec<2, V0, Q> const& v0, vec<2, V1, Q> const& v1, vec<2, V2, Q> const& v2) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(v0), col_type(v1), col_type(v2)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(v0); + this->value[1] = col_type(v1); + this->value[2] = col_type(v2); +# endif + } + + // -- Matrix conversions -- + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>::mat(mat<3, 2, U, P> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(m[2])} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(m[2]); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>::mat(mat<2, 2, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(0)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = m[0]; + this->value[1] = m[1]; + this->value[2] = col_type(0); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>::mat(mat<3, 3, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(m[2])} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(m[2]); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>::mat(mat<4, 4, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(m[2])} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(m[2]); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>::mat(mat<2, 3, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(0)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(0); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>::mat(mat<2, 4, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(0)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(0); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>::mat(mat<3, 4, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(m[2])} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(m[2]); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>::mat(mat<4, 2, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(m[2])} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = m[0]; + this->value[1] = m[1]; + this->value[2] = m[2]; +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>::mat(mat<4, 3, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(m[2])} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(m[2]); +# endif + } + + // -- Accesses -- + + template + GLM_FUNC_QUALIFIER typename mat<3, 2, T, Q>::col_type & mat<3, 2, T, Q>::operator[](typename mat<3, 2, T, Q>::length_type i) GLM_NOEXCEPT + { + assert(i < this->length()); + return this->value[i]; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<3, 2, T, Q>::col_type const& mat<3, 2, T, Q>::operator[](typename mat<3, 2, T, Q>::length_type i) const GLM_NOEXCEPT + { + assert(i < this->length()); + return this->value[i]; + } + + // -- Unary updatable operators -- + + template + template + GLM_FUNC_QUALIFIER mat<3, 2, T, Q>& mat<3, 2, T, Q>::operator=(mat<3, 2, U, Q> const& m) + { + this->value[0] = m[0]; + this->value[1] = m[1]; + this->value[2] = m[2]; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<3, 2, T, Q>& mat<3, 2, T, Q>::operator+=(U s) + { + this->value[0] += s; + this->value[1] += s; + this->value[2] += s; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<3, 2, T, Q>& mat<3, 2, T, Q>::operator+=(mat<3, 2, U, Q> const& m) + { + this->value[0] += m[0]; + this->value[1] += m[1]; + this->value[2] += m[2]; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<3, 2, T, Q>& mat<3, 2, T, Q>::operator-=(U s) + { + this->value[0] -= s; + this->value[1] -= s; + this->value[2] -= s; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<3, 2, T, Q>& mat<3, 2, T, Q>::operator-=(mat<3, 2, U, Q> const& m) + { + this->value[0] -= m[0]; + this->value[1] -= m[1]; + this->value[2] -= m[2]; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<3, 2, T, Q>& mat<3, 2, T, Q>::operator*=(U s) + { + this->value[0] *= s; + this->value[1] *= s; + this->value[2] *= s; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<3, 2, T, Q> & mat<3, 2, T, Q>::operator/=(U s) + { + this->value[0] /= s; + this->value[1] /= s; + this->value[2] /= s; + return *this; + } + + // -- Increment and decrement operators -- + + template + GLM_FUNC_QUALIFIER mat<3, 2, T, Q>& mat<3, 2, T, Q>::operator++() + { + ++this->value[0]; + ++this->value[1]; + ++this->value[2]; + return *this; + } + + template + GLM_FUNC_QUALIFIER mat<3, 2, T, Q>& mat<3, 2, T, Q>::operator--() + { + --this->value[0]; + --this->value[1]; + --this->value[2]; + return *this; + } + + template + GLM_FUNC_QUALIFIER mat<3, 2, T, Q> mat<3, 2, T, Q>::operator++(int) + { + mat<3, 2, T, Q> Result(*this); + ++*this; + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<3, 2, T, Q> mat<3, 2, T, Q>::operator--(int) + { + mat<3, 2, T, Q> Result(*this); + --*this; + return Result; + } + + // -- Unary arithmetic operators -- + + template + GLM_FUNC_QUALIFIER mat<3, 2, T, Q> operator+(mat<3, 2, T, Q> const& m) + { + return m; + } + + template + GLM_FUNC_QUALIFIER mat<3, 2, T, Q> operator-(mat<3, 2, T, Q> const& m) + { + return mat<3, 2, T, Q>( + -m[0], + -m[1], + -m[2]); + } + + // -- Binary arithmetic operators -- + + template + GLM_FUNC_QUALIFIER mat<3, 2, T, Q> operator+(mat<3, 2, T, Q> const& m, T scalar) + { + return mat<3, 2, T, Q>( + m[0] + scalar, + m[1] + scalar, + m[2] + scalar); + } + + template + GLM_FUNC_QUALIFIER mat<3, 2, T, Q> operator+(mat<3, 2, T, Q> const& m1, mat<3, 2, T, Q> const& m2) + { + return mat<3, 2, T, Q>( + m1[0] + m2[0], + m1[1] + m2[1], + m1[2] + m2[2]); + } + + template + GLM_FUNC_QUALIFIER mat<3, 2, T, Q> operator-(mat<3, 2, T, Q> const& m, T scalar) + { + return mat<3, 2, T, Q>( + m[0] - scalar, + m[1] - scalar, + m[2] - scalar); + } + + template + GLM_FUNC_QUALIFIER mat<3, 2, T, Q> operator-(mat<3, 2, T, Q> const& m1, mat<3, 2, T, Q> const& m2) + { + return mat<3, 2, T, Q>( + m1[0] - m2[0], + m1[1] - m2[1], + m1[2] - m2[2]); + } + + template + GLM_FUNC_QUALIFIER mat<3, 2, T, Q> operator*(mat<3, 2, T, Q> const& m, T scalar) + { + return mat<3, 2, T, Q>( + m[0] * scalar, + m[1] * scalar, + m[2] * scalar); + } + + template + GLM_FUNC_QUALIFIER mat<3, 2, T, Q> operator*(T scalar, mat<3, 2, T, Q> const& m) + { + return mat<3, 2, T, Q>( + m[0] * scalar, + m[1] * scalar, + m[2] * scalar); + } + + template + GLM_FUNC_QUALIFIER typename mat<3, 2, T, Q>::col_type operator*(mat<3, 2, T, Q> const& m, typename mat<3, 2, T, Q>::row_type const& v) + { + return typename mat<3, 2, T, Q>::col_type( + m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z, + m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z); + } + + template + GLM_FUNC_QUALIFIER typename mat<3, 2, T, Q>::row_type operator*(typename mat<3, 2, T, Q>::col_type const& v, mat<3, 2, T, Q> const& m) + { + return typename mat<3, 2, T, Q>::row_type( + v.x * m[0][0] + v.y * m[0][1], + v.x * m[1][0] + v.y * m[1][1], + v.x * m[2][0] + v.y * m[2][1]); + } + + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q> operator*(mat<3, 2, T, Q> const& m1, mat<2, 3, T, Q> const& m2) + { + const T SrcA00 = m1[0][0]; + const T SrcA01 = m1[0][1]; + const T SrcA10 = m1[1][0]; + const T SrcA11 = m1[1][1]; + const T SrcA20 = m1[2][0]; + const T SrcA21 = m1[2][1]; + + const T SrcB00 = m2[0][0]; + const T SrcB01 = m2[0][1]; + const T SrcB02 = m2[0][2]; + const T SrcB10 = m2[1][0]; + const T SrcB11 = m2[1][1]; + const T SrcB12 = m2[1][2]; + + mat<2, 2, T, Q> Result; + Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01 + SrcA20 * SrcB02; + Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01 + SrcA21 * SrcB02; + Result[1][0] = SrcA00 * SrcB10 + SrcA10 * SrcB11 + SrcA20 * SrcB12; + Result[1][1] = SrcA01 * SrcB10 + SrcA11 * SrcB11 + SrcA21 * SrcB12; + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<3, 2, T, Q> operator*(mat<3, 2, T, Q> const& m1, mat<3, 3, T, Q> const& m2) + { + return mat<3, 2, T, Q>( + m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2], + m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2], + m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1] + m1[2][0] * m2[1][2], + m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1] + m1[2][1] * m2[1][2], + m1[0][0] * m2[2][0] + m1[1][0] * m2[2][1] + m1[2][0] * m2[2][2], + m1[0][1] * m2[2][0] + m1[1][1] * m2[2][1] + m1[2][1] * m2[2][2]); + } + + template + GLM_FUNC_QUALIFIER mat<4, 2, T, Q> operator*(mat<3, 2, T, Q> const& m1, mat<4, 3, T, Q> const& m2) + { + return mat<4, 2, T, Q>( + m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2], + m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2], + m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1] + m1[2][0] * m2[1][2], + m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1] + m1[2][1] * m2[1][2], + m1[0][0] * m2[2][0] + m1[1][0] * m2[2][1] + m1[2][0] * m2[2][2], + m1[0][1] * m2[2][0] + m1[1][1] * m2[2][1] + m1[2][1] * m2[2][2], + m1[0][0] * m2[3][0] + m1[1][0] * m2[3][1] + m1[2][0] * m2[3][2], + m1[0][1] * m2[3][0] + m1[1][1] * m2[3][1] + m1[2][1] * m2[3][2]); + } + + template + GLM_FUNC_QUALIFIER mat<3, 2, T, Q> operator/(mat<3, 2, T, Q> const& m, T scalar) + { + return mat<3, 2, T, Q>( + m[0] / scalar, + m[1] / scalar, + m[2] / scalar); + } + + template + GLM_FUNC_QUALIFIER mat<3, 2, T, Q> operator/(T scalar, mat<3, 2, T, Q> const& m) + { + return mat<3, 2, T, Q>( + scalar / m[0], + scalar / m[1], + scalar / m[2]); + } + + // -- Boolean operators -- + + template + GLM_FUNC_QUALIFIER bool operator==(mat<3, 2, T, Q> const& m1, mat<3, 2, T, Q> const& m2) + { + return (m1[0] == m2[0]) && (m1[1] == m2[1]) && (m1[2] == m2[2]); + } + + template + GLM_FUNC_QUALIFIER bool operator!=(mat<3, 2, T, Q> const& m1, mat<3, 2, T, Q> const& m2) + { + return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]); + } +} //namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_mat3x3.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_mat3x3.hpp new file mode 100644 index 0000000000000000000000000000000000000000..a41a620b133877d1c408b03cc87e534b4a5b8efa --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_mat3x3.hpp @@ -0,0 +1,184 @@ +/// @ref core +/// @file glm/detail/type_mat3x3.hpp + +#pragma once + +#include "type_vec3.hpp" +#include +#include + +namespace glm +{ + template + struct mat<3, 3, T, Q> + { + typedef vec<3, T, Q> col_type; + typedef vec<3, T, Q> row_type; + typedef mat<3, 3, T, Q> type; + typedef mat<3, 3, T, Q> transpose_type; + typedef T value_type; + + private: + col_type value[3]; + + public: + // -- Accesses -- + + typedef length_t length_type; + GLM_FUNC_DECL static GLM_CONSTEXPR length_type length() { return 3; } + + GLM_FUNC_DECL col_type & operator[](length_type i) GLM_NOEXCEPT; + GLM_FUNC_DECL GLM_CONSTEXPR col_type const& operator[](length_type i) const GLM_NOEXCEPT; + + // -- Constructors -- + + GLM_FUNC_DECL GLM_CONSTEXPR mat() GLM_DEFAULT_CTOR; + template + GLM_FUNC_DECL GLM_CONSTEXPR mat(mat<3, 3, T, P> const& m); + + GLM_FUNC_DECL explicit GLM_CONSTEXPR mat(T scalar); + GLM_FUNC_DECL GLM_CONSTEXPR mat( + T x0, T y0, T z0, + T x1, T y1, T z1, + T x2, T y2, T z2); + GLM_FUNC_DECL GLM_CONSTEXPR mat( + col_type const& v0, + col_type const& v1, + col_type const& v2); + + // -- Conversions -- + + template< + typename X1, typename Y1, typename Z1, + typename X2, typename Y2, typename Z2, + typename X3, typename Y3, typename Z3> + GLM_FUNC_DECL GLM_CONSTEXPR mat( + X1 x1, Y1 y1, Z1 z1, + X2 x2, Y2 y2, Z2 z2, + X3 x3, Y3 y3, Z3 z3); + + template + GLM_FUNC_DECL GLM_CONSTEXPR mat( + vec<3, V1, Q> const& v1, + vec<3, V2, Q> const& v2, + vec<3, V3, Q> const& v3); + + // -- Matrix conversions -- + + template + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 3, U, P> const& m); + + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 2, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 4, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 3, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 2, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 4, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 2, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 4, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 3, T, Q> const& x); + + // -- Unary arithmetic operators -- + + template + GLM_FUNC_DECL mat<3, 3, T, Q> & operator=(mat<3, 3, U, Q> const& m); + template + GLM_FUNC_DECL mat<3, 3, T, Q> & operator+=(U s); + template + GLM_FUNC_DECL mat<3, 3, T, Q> & operator+=(mat<3, 3, U, Q> const& m); + template + GLM_FUNC_DECL mat<3, 3, T, Q> & operator-=(U s); + template + GLM_FUNC_DECL mat<3, 3, T, Q> & operator-=(mat<3, 3, U, Q> const& m); + template + GLM_FUNC_DECL mat<3, 3, T, Q> & operator*=(U s); + template + GLM_FUNC_DECL mat<3, 3, T, Q> & operator*=(mat<3, 3, U, Q> const& m); + template + GLM_FUNC_DECL mat<3, 3, T, Q> & operator/=(U s); + template + GLM_FUNC_DECL mat<3, 3, T, Q> & operator/=(mat<3, 3, U, Q> const& m); + + // -- Increment and decrement operators -- + + GLM_FUNC_DECL mat<3, 3, T, Q> & operator++(); + GLM_FUNC_DECL mat<3, 3, T, Q> & operator--(); + GLM_FUNC_DECL mat<3, 3, T, Q> operator++(int); + GLM_FUNC_DECL mat<3, 3, T, Q> operator--(int); + }; + + // -- Unary operators -- + + template + GLM_FUNC_DECL mat<3, 3, T, Q> operator+(mat<3, 3, T, Q> const& m); + + template + GLM_FUNC_DECL mat<3, 3, T, Q> operator-(mat<3, 3, T, Q> const& m); + + // -- Binary operators -- + + template + GLM_FUNC_DECL mat<3, 3, T, Q> operator+(mat<3, 3, T, Q> const& m, T scalar); + + template + GLM_FUNC_DECL mat<3, 3, T, Q> operator+(T scalar, mat<3, 3, T, Q> const& m); + + template + GLM_FUNC_DECL mat<3, 3, T, Q> operator+(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2); + + template + GLM_FUNC_DECL mat<3, 3, T, Q> operator-(mat<3, 3, T, Q> const& m, T scalar); + + template + GLM_FUNC_DECL mat<3, 3, T, Q> operator-(T scalar, mat<3, 3, T, Q> const& m); + + template + GLM_FUNC_DECL mat<3, 3, T, Q> operator-(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2); + + template + GLM_FUNC_DECL mat<3, 3, T, Q> operator*(mat<3, 3, T, Q> const& m, T scalar); + + template + GLM_FUNC_DECL mat<3, 3, T, Q> operator*(T scalar, mat<3, 3, T, Q> const& m); + + template + GLM_FUNC_DECL typename mat<3, 3, T, Q>::col_type operator*(mat<3, 3, T, Q> const& m, typename mat<3, 3, T, Q>::row_type const& v); + + template + GLM_FUNC_DECL typename mat<3, 3, T, Q>::row_type operator*(typename mat<3, 3, T, Q>::col_type const& v, mat<3, 3, T, Q> const& m); + + template + GLM_FUNC_DECL mat<3, 3, T, Q> operator*(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2); + + template + GLM_FUNC_DECL mat<2, 3, T, Q> operator*(mat<3, 3, T, Q> const& m1, mat<2, 3, T, Q> const& m2); + + template + GLM_FUNC_DECL mat<4, 3, T, Q> operator*(mat<3, 3, T, Q> const& m1, mat<4, 3, T, Q> const& m2); + + template + GLM_FUNC_DECL mat<3, 3, T, Q> operator/(mat<3, 3, T, Q> const& m, T scalar); + + template + GLM_FUNC_DECL mat<3, 3, T, Q> operator/(T scalar, mat<3, 3, T, Q> const& m); + + template + GLM_FUNC_DECL typename mat<3, 3, T, Q>::col_type operator/(mat<3, 3, T, Q> const& m, typename mat<3, 3, T, Q>::row_type const& v); + + template + GLM_FUNC_DECL typename mat<3, 3, T, Q>::row_type operator/(typename mat<3, 3, T, Q>::col_type const& v, mat<3, 3, T, Q> const& m); + + template + GLM_FUNC_DECL mat<3, 3, T, Q> operator/(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2); + + // -- Boolean operators -- + + template + GLM_FUNC_DECL GLM_CONSTEXPR bool operator==(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2); + + template + GLM_FUNC_DECL bool operator!=(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2); +}//namespace glm + +#ifndef GLM_EXTERNAL_TEMPLATE +#include "type_mat3x3.inl" +#endif diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_mat3x3.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_mat3x3.inl new file mode 100644 index 0000000000000000000000000000000000000000..0719ba7394c0d24c83ac2e870fe19aba4865795b --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_mat3x3.inl @@ -0,0 +1,601 @@ +#include "../matrix.hpp" + +namespace glm +{ + // -- Constructors -- + +# if GLM_CONFIG_DEFAULTED_DEFAULT_CTOR == GLM_DISABLE + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q>::mat() +# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALIZER_LIST + : value{col_type(1, 0, 0), col_type(0, 1, 0), col_type(0, 0, 1)} +# endif + { +# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALISATION + this->value[0] = col_type(1, 0, 0); + this->value[1] = col_type(0, 1, 0); + this->value[2] = col_type(0, 0, 1); +# endif + } +# endif + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q>::mat(mat<3, 3, T, P> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(m[2])} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(m[2]); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q>::mat(T s) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(s, 0, 0), col_type(0, s, 0), col_type(0, 0, s)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(s, 0, 0); + this->value[1] = col_type(0, s, 0); + this->value[2] = col_type(0, 0, s); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q>::mat + ( + T x0, T y0, T z0, + T x1, T y1, T z1, + T x2, T y2, T z2 + ) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(x0, y0, z0), col_type(x1, y1, z1), col_type(x2, y2, z2)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(x0, y0, z0); + this->value[1] = col_type(x1, y1, z1); + this->value[2] = col_type(x2, y2, z2); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q>::mat(col_type const& v0, col_type const& v1, col_type const& v2) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(v0), col_type(v1), col_type(v2)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(v0); + this->value[1] = col_type(v1); + this->value[2] = col_type(v2); +# endif + } + + // -- Conversion constructors -- + + template + template< + typename X1, typename Y1, typename Z1, + typename X2, typename Y2, typename Z2, + typename X3, typename Y3, typename Z3> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q>::mat + ( + X1 x1, Y1 y1, Z1 z1, + X2 x2, Y2 y2, Z2 z2, + X3 x3, Y3 y3, Z3 z3 + ) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(x1, y1, z1), col_type(x2, y2, z2), col_type(x3, y3, z3)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(x1, y1, z1); + this->value[1] = col_type(x2, y2, z2); + this->value[2] = col_type(x3, y3, z3); +# endif + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q>::mat(vec<3, V1, Q> const& v1, vec<3, V2, Q> const& v2, vec<3, V3, Q> const& v3) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(v1), col_type(v2), col_type(v3)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(v1); + this->value[1] = col_type(v2); + this->value[2] = col_type(v3); +# endif + } + + // -- Matrix conversions -- + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q>::mat(mat<3, 3, U, P> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(m[2])} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(m[2]); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q>::mat(mat<2, 2, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0], 0), col_type(m[1], 0), col_type(0, 0, 1)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0], 0); + this->value[1] = col_type(m[1], 0); + this->value[2] = col_type(0, 0, 1); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q>::mat(mat<4, 4, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(m[2])} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(m[2]); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q>::mat(mat<2, 3, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(0, 0, 1)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(0, 0, 1); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q>::mat(mat<3, 2, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0], 0), col_type(m[1], 0), col_type(m[2], 1)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0], 0); + this->value[1] = col_type(m[1], 0); + this->value[2] = col_type(m[2], 1); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q>::mat(mat<2, 4, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(0, 0, 1)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(0, 0, 1); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q>::mat(mat<4, 2, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0], 0), col_type(m[1], 0), col_type(m[2], 1)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0], 0); + this->value[1] = col_type(m[1], 0); + this->value[2] = col_type(m[2], 1); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q>::mat(mat<3, 4, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(m[2])} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(m[2]); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q>::mat(mat<4, 3, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(m[2])} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(m[2]); +# endif + } + + // -- Accesses -- + + template + GLM_FUNC_QUALIFIER typename mat<3, 3, T, Q>::col_type & mat<3, 3, T, Q>::operator[](typename mat<3, 3, T, Q>::length_type i) GLM_NOEXCEPT + { + assert(i < this->length()); + return this->value[i]; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<3, 3, T, Q>::col_type const& mat<3, 3, T, Q>::operator[](typename mat<3, 3, T, Q>::length_type i) const GLM_NOEXCEPT + { + assert(i < this->length()); + return this->value[i]; + } + + // -- Unary updatable operators -- + + template + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> & mat<3, 3, T, Q>::operator=(mat<3, 3, U, Q> const& m) + { + this->value[0] = m[0]; + this->value[1] = m[1]; + this->value[2] = m[2]; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> & mat<3, 3, T, Q>::operator+=(U s) + { + this->value[0] += s; + this->value[1] += s; + this->value[2] += s; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> & mat<3, 3, T, Q>::operator+=(mat<3, 3, U, Q> const& m) + { + this->value[0] += m[0]; + this->value[1] += m[1]; + this->value[2] += m[2]; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> & mat<3, 3, T, Q>::operator-=(U s) + { + this->value[0] -= s; + this->value[1] -= s; + this->value[2] -= s; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> & mat<3, 3, T, Q>::operator-=(mat<3, 3, U, Q> const& m) + { + this->value[0] -= m[0]; + this->value[1] -= m[1]; + this->value[2] -= m[2]; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> & mat<3, 3, T, Q>::operator*=(U s) + { + this->value[0] *= s; + this->value[1] *= s; + this->value[2] *= s; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> & mat<3, 3, T, Q>::operator*=(mat<3, 3, U, Q> const& m) + { + return (*this = *this * m); + } + + template + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> & mat<3, 3, T, Q>::operator/=(U s) + { + this->value[0] /= s; + this->value[1] /= s; + this->value[2] /= s; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> & mat<3, 3, T, Q>::operator/=(mat<3, 3, U, Q> const& m) + { + return *this *= inverse(m); + } + + // -- Increment and decrement operators -- + + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> & mat<3, 3, T, Q>::operator++() + { + ++this->value[0]; + ++this->value[1]; + ++this->value[2]; + return *this; + } + + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> & mat<3, 3, T, Q>::operator--() + { + --this->value[0]; + --this->value[1]; + --this->value[2]; + return *this; + } + + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> mat<3, 3, T, Q>::operator++(int) + { + mat<3, 3, T, Q> Result(*this); + ++*this; + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> mat<3, 3, T, Q>::operator--(int) + { + mat<3, 3, T, Q> Result(*this); + --*this; + return Result; + } + + // -- Unary arithmetic operators -- + + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator+(mat<3, 3, T, Q> const& m) + { + return m; + } + + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator-(mat<3, 3, T, Q> const& m) + { + return mat<3, 3, T, Q>( + -m[0], + -m[1], + -m[2]); + } + + // -- Binary arithmetic operators -- + + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator+(mat<3, 3, T, Q> const& m, T scalar) + { + return mat<3, 3, T, Q>( + m[0] + scalar, + m[1] + scalar, + m[2] + scalar); + } + + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator+(T scalar, mat<3, 3, T, Q> const& m) + { + return mat<3, 3, T, Q>( + m[0] + scalar, + m[1] + scalar, + m[2] + scalar); + } + + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator+(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2) + { + return mat<3, 3, T, Q>( + m1[0] + m2[0], + m1[1] + m2[1], + m1[2] + m2[2]); + } + + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator-(mat<3, 3, T, Q> const& m, T scalar) + { + return mat<3, 3, T, Q>( + m[0] - scalar, + m[1] - scalar, + m[2] - scalar); + } + + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator-(T scalar, mat<3, 3, T, Q> const& m) + { + return mat<3, 3, T, Q>( + scalar - m[0], + scalar - m[1], + scalar - m[2]); + } + + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator-(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2) + { + return mat<3, 3, T, Q>( + m1[0] - m2[0], + m1[1] - m2[1], + m1[2] - m2[2]); + } + + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator*(mat<3, 3, T, Q> const& m, T scalar) + { + return mat<3, 3, T, Q>( + m[0] * scalar, + m[1] * scalar, + m[2] * scalar); + } + + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator*(T scalar, mat<3, 3, T, Q> const& m) + { + return mat<3, 3, T, Q>( + m[0] * scalar, + m[1] * scalar, + m[2] * scalar); + } + + template + GLM_FUNC_QUALIFIER typename mat<3, 3, T, Q>::col_type operator*(mat<3, 3, T, Q> const& m, typename mat<3, 3, T, Q>::row_type const& v) + { + return typename mat<3, 3, T, Q>::col_type( + m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z, + m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z, + m[0][2] * v.x + m[1][2] * v.y + m[2][2] * v.z); + } + + template + GLM_FUNC_QUALIFIER typename mat<3, 3, T, Q>::row_type operator*(typename mat<3, 3, T, Q>::col_type const& v, mat<3, 3, T, Q> const& m) + { + return typename mat<3, 3, T, Q>::row_type( + m[0][0] * v.x + m[0][1] * v.y + m[0][2] * v.z, + m[1][0] * v.x + m[1][1] * v.y + m[1][2] * v.z, + m[2][0] * v.x + m[2][1] * v.y + m[2][2] * v.z); + } + + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator*(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2) + { + T const SrcA00 = m1[0][0]; + T const SrcA01 = m1[0][1]; + T const SrcA02 = m1[0][2]; + T const SrcA10 = m1[1][0]; + T const SrcA11 = m1[1][1]; + T const SrcA12 = m1[1][2]; + T const SrcA20 = m1[2][0]; + T const SrcA21 = m1[2][1]; + T const SrcA22 = m1[2][2]; + + T const SrcB00 = m2[0][0]; + T const SrcB01 = m2[0][1]; + T const SrcB02 = m2[0][2]; + T const SrcB10 = m2[1][0]; + T const SrcB11 = m2[1][1]; + T const SrcB12 = m2[1][2]; + T const SrcB20 = m2[2][0]; + T const SrcB21 = m2[2][1]; + T const SrcB22 = m2[2][2]; + + mat<3, 3, T, Q> Result; + Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01 + SrcA20 * SrcB02; + Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01 + SrcA21 * SrcB02; + Result[0][2] = SrcA02 * SrcB00 + SrcA12 * SrcB01 + SrcA22 * SrcB02; + Result[1][0] = SrcA00 * SrcB10 + SrcA10 * SrcB11 + SrcA20 * SrcB12; + Result[1][1] = SrcA01 * SrcB10 + SrcA11 * SrcB11 + SrcA21 * SrcB12; + Result[1][2] = SrcA02 * SrcB10 + SrcA12 * SrcB11 + SrcA22 * SrcB12; + Result[2][0] = SrcA00 * SrcB20 + SrcA10 * SrcB21 + SrcA20 * SrcB22; + Result[2][1] = SrcA01 * SrcB20 + SrcA11 * SrcB21 + SrcA21 * SrcB22; + Result[2][2] = SrcA02 * SrcB20 + SrcA12 * SrcB21 + SrcA22 * SrcB22; + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<2, 3, T, Q> operator*(mat<3, 3, T, Q> const& m1, mat<2, 3, T, Q> const& m2) + { + return mat<2, 3, T, Q>( + m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2], + m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2], + m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1] + m1[2][2] * m2[0][2], + m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1] + m1[2][0] * m2[1][2], + m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1] + m1[2][1] * m2[1][2], + m1[0][2] * m2[1][0] + m1[1][2] * m2[1][1] + m1[2][2] * m2[1][2]); + } + + template + GLM_FUNC_QUALIFIER mat<4, 3, T, Q> operator*(mat<3, 3, T, Q> const& m1, mat<4, 3, T, Q> const& m2) + { + return mat<4, 3, T, Q>( + m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2], + m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2], + m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1] + m1[2][2] * m2[0][2], + m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1] + m1[2][0] * m2[1][2], + m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1] + m1[2][1] * m2[1][2], + m1[0][2] * m2[1][0] + m1[1][2] * m2[1][1] + m1[2][2] * m2[1][2], + m1[0][0] * m2[2][0] + m1[1][0] * m2[2][1] + m1[2][0] * m2[2][2], + m1[0][1] * m2[2][0] + m1[1][1] * m2[2][1] + m1[2][1] * m2[2][2], + m1[0][2] * m2[2][0] + m1[1][2] * m2[2][1] + m1[2][2] * m2[2][2], + m1[0][0] * m2[3][0] + m1[1][0] * m2[3][1] + m1[2][0] * m2[3][2], + m1[0][1] * m2[3][0] + m1[1][1] * m2[3][1] + m1[2][1] * m2[3][2], + m1[0][2] * m2[3][0] + m1[1][2] * m2[3][1] + m1[2][2] * m2[3][2]); + } + + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator/(mat<3, 3, T, Q> const& m, T scalar) + { + return mat<3, 3, T, Q>( + m[0] / scalar, + m[1] / scalar, + m[2] / scalar); + } + + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator/(T scalar, mat<3, 3, T, Q> const& m) + { + return mat<3, 3, T, Q>( + scalar / m[0], + scalar / m[1], + scalar / m[2]); + } + + template + GLM_FUNC_QUALIFIER typename mat<3, 3, T, Q>::col_type operator/(mat<3, 3, T, Q> const& m, typename mat<3, 3, T, Q>::row_type const& v) + { + return inverse(m) * v; + } + + template + GLM_FUNC_QUALIFIER typename mat<3, 3, T, Q>::row_type operator/(typename mat<3, 3, T, Q>::col_type const& v, mat<3, 3, T, Q> const& m) + { + return v * inverse(m); + } + + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator/(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2) + { + mat<3, 3, T, Q> m1_copy(m1); + return m1_copy /= m2; + } + + // -- Boolean operators -- + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator==(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2) + { + return (m1[0] == m2[0]) && (m1[1] == m2[1]) && (m1[2] == m2[2]); + } + + template + GLM_FUNC_QUALIFIER bool operator!=(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2) + { + return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]); + } +} //namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_mat3x4.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_mat3x4.hpp new file mode 100644 index 0000000000000000000000000000000000000000..06f775eeb8330aec5355e408c35ce19dc077b485 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_mat3x4.hpp @@ -0,0 +1,166 @@ +/// @ref core +/// @file glm/detail/type_mat3x4.hpp + +#pragma once + +#include "type_vec3.hpp" +#include "type_vec4.hpp" +#include +#include + +namespace glm +{ + template + struct mat<3, 4, T, Q> + { + typedef vec<4, T, Q> col_type; + typedef vec<3, T, Q> row_type; + typedef mat<3, 4, T, Q> type; + typedef mat<4, 3, T, Q> transpose_type; + typedef T value_type; + + private: + col_type value[3]; + + public: + // -- Accesses -- + + typedef length_t length_type; + GLM_FUNC_DECL static GLM_CONSTEXPR length_type length() { return 3; } + + GLM_FUNC_DECL col_type & operator[](length_type i) GLM_NOEXCEPT; + GLM_FUNC_DECL GLM_CONSTEXPR col_type const& operator[](length_type i) const GLM_NOEXCEPT; + + // -- Constructors -- + + GLM_FUNC_DECL GLM_CONSTEXPR mat() GLM_DEFAULT_CTOR; + template + GLM_FUNC_DECL GLM_CONSTEXPR mat(mat<3, 4, T, P> const& m); + + GLM_FUNC_DECL explicit GLM_CONSTEXPR mat(T scalar); + GLM_FUNC_DECL GLM_CONSTEXPR mat( + T x0, T y0, T z0, T w0, + T x1, T y1, T z1, T w1, + T x2, T y2, T z2, T w2); + GLM_FUNC_DECL GLM_CONSTEXPR mat( + col_type const& v0, + col_type const& v1, + col_type const& v2); + + // -- Conversions -- + + template< + typename X1, typename Y1, typename Z1, typename W1, + typename X2, typename Y2, typename Z2, typename W2, + typename X3, typename Y3, typename Z3, typename W3> + GLM_FUNC_DECL GLM_CONSTEXPR mat( + X1 x1, Y1 y1, Z1 z1, W1 w1, + X2 x2, Y2 y2, Z2 z2, W2 w2, + X3 x3, Y3 y3, Z3 z3, W3 w3); + + template + GLM_FUNC_DECL GLM_CONSTEXPR mat( + vec<4, V1, Q> const& v1, + vec<4, V2, Q> const& v2, + vec<4, V3, Q> const& v3); + + // -- Matrix conversions -- + + template + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 4, U, P> const& m); + + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 2, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 3, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 4, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 3, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 2, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 4, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 2, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 3, T, Q> const& x); + + // -- Unary arithmetic operators -- + + template + GLM_FUNC_DECL mat<3, 4, T, Q> & operator=(mat<3, 4, U, Q> const& m); + template + GLM_FUNC_DECL mat<3, 4, T, Q> & operator+=(U s); + template + GLM_FUNC_DECL mat<3, 4, T, Q> & operator+=(mat<3, 4, U, Q> const& m); + template + GLM_FUNC_DECL mat<3, 4, T, Q> & operator-=(U s); + template + GLM_FUNC_DECL mat<3, 4, T, Q> & operator-=(mat<3, 4, U, Q> const& m); + template + GLM_FUNC_DECL mat<3, 4, T, Q> & operator*=(U s); + template + GLM_FUNC_DECL mat<3, 4, T, Q> & operator/=(U s); + + // -- Increment and decrement operators -- + + GLM_FUNC_DECL mat<3, 4, T, Q> & operator++(); + GLM_FUNC_DECL mat<3, 4, T, Q> & operator--(); + GLM_FUNC_DECL mat<3, 4, T, Q> operator++(int); + GLM_FUNC_DECL mat<3, 4, T, Q> operator--(int); + }; + + // -- Unary operators -- + + template + GLM_FUNC_DECL mat<3, 4, T, Q> operator+(mat<3, 4, T, Q> const& m); + + template + GLM_FUNC_DECL mat<3, 4, T, Q> operator-(mat<3, 4, T, Q> const& m); + + // -- Binary operators -- + + template + GLM_FUNC_DECL mat<3, 4, T, Q> operator+(mat<3, 4, T, Q> const& m, T scalar); + + template + GLM_FUNC_DECL mat<3, 4, T, Q> operator+(mat<3, 4, T, Q> const& m1, mat<3, 4, T, Q> const& m2); + + template + GLM_FUNC_DECL mat<3, 4, T, Q> operator-(mat<3, 4, T, Q> const& m, T scalar); + + template + GLM_FUNC_DECL mat<3, 4, T, Q> operator-(mat<3, 4, T, Q> const& m1, mat<3, 4, T, Q> const& m2); + + template + GLM_FUNC_DECL mat<3, 4, T, Q> operator*(mat<3, 4, T, Q> const& m, T scalar); + + template + GLM_FUNC_DECL mat<3, 4, T, Q> operator*(T scalar, mat<3, 4, T, Q> const& m); + + template + GLM_FUNC_DECL typename mat<3, 4, T, Q>::col_type operator*(mat<3, 4, T, Q> const& m, typename mat<3, 4, T, Q>::row_type const& v); + + template + GLM_FUNC_DECL typename mat<3, 4, T, Q>::row_type operator*(typename mat<3, 4, T, Q>::col_type const& v, mat<3, 4, T, Q> const& m); + + template + GLM_FUNC_DECL mat<4, 4, T, Q> operator*(mat<3, 4, T, Q> const& m1, mat<4, 3, T, Q> const& m2); + + template + GLM_FUNC_DECL mat<2, 4, T, Q> operator*(mat<3, 4, T, Q> const& m1, mat<2, 3, T, Q> const& m2); + + template + GLM_FUNC_DECL mat<3, 4, T, Q> operator*(mat<3, 4, T, Q> const& m1, mat<3, 3, T, Q> const& m2); + + template + GLM_FUNC_DECL mat<3, 4, T, Q> operator/(mat<3, 4, T, Q> const& m, T scalar); + + template + GLM_FUNC_DECL mat<3, 4, T, Q> operator/(T scalar, mat<3, 4, T, Q> const& m); + + // -- Boolean operators -- + + template + GLM_FUNC_DECL bool operator==(mat<3, 4, T, Q> const& m1, mat<3, 4, T, Q> const& m2); + + template + GLM_FUNC_DECL bool operator!=(mat<3, 4, T, Q> const& m1, mat<3, 4, T, Q> const& m2); +}//namespace glm + +#ifndef GLM_EXTERNAL_TEMPLATE +#include "type_mat3x4.inl" +#endif diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_mat3x4.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_mat3x4.inl new file mode 100644 index 0000000000000000000000000000000000000000..7cc7fa919f55ec8fedf9e8463e4d6ce89e31ef3d --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_mat3x4.inl @@ -0,0 +1,578 @@ +namespace glm +{ + // -- Constructors -- + +# if GLM_CONFIG_DEFAULTED_DEFAULT_CTOR == GLM_DISABLE + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>::mat() +# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALIZER_LIST + : value{col_type(1, 0, 0, 0), col_type(0, 1, 0, 0), col_type(0, 0, 1, 0)} +# endif + { +# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALISATION + this->value[0] = col_type(1, 0, 0, 0); + this->value[1] = col_type(0, 1, 0, 0); + this->value[2] = col_type(0, 0, 1, 0); +# endif + } +# endif + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>::mat(mat<3, 4, T, P> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(m[2])} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = m[0]; + this->value[1] = m[1]; + this->value[2] = m[2]; +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>::mat(T s) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(s, 0, 0, 0), col_type(0, s, 0, 0), col_type(0, 0, s, 0)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(s, 0, 0, 0); + this->value[1] = col_type(0, s, 0, 0); + this->value[2] = col_type(0, 0, s, 0); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>::mat + ( + T x0, T y0, T z0, T w0, + T x1, T y1, T z1, T w1, + T x2, T y2, T z2, T w2 + ) +# if GLM_HAS_INITIALIZER_LISTS + : value{ + col_type(x0, y0, z0, w0), + col_type(x1, y1, z1, w1), + col_type(x2, y2, z2, w2)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(x0, y0, z0, w0); + this->value[1] = col_type(x1, y1, z1, w1); + this->value[2] = col_type(x2, y2, z2, w2); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>::mat(col_type const& v0, col_type const& v1, col_type const& v2) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(v0), col_type(v1), col_type(v2)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = v0; + this->value[1] = v1; + this->value[2] = v2; +# endif + } + + // -- Conversion constructors -- + + template + template< + typename X0, typename Y0, typename Z0, typename W0, + typename X1, typename Y1, typename Z1, typename W1, + typename X2, typename Y2, typename Z2, typename W2> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>::mat + ( + X0 x0, Y0 y0, Z0 z0, W0 w0, + X1 x1, Y1 y1, Z1 z1, W1 w1, + X2 x2, Y2 y2, Z2 z2, W2 w2 + ) +# if GLM_HAS_INITIALIZER_LISTS + : value{ + col_type(x0, y0, z0, w0), + col_type(x1, y1, z1, w1), + col_type(x2, y2, z2, w2)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(x0, y0, z0, w0); + this->value[1] = col_type(x1, y1, z1, w1); + this->value[2] = col_type(x2, y2, z2, w2); +# endif + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>::mat(vec<4, V1, Q> const& v0, vec<4, V2, Q> const& v1, vec<4, V3, Q> const& v2) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(v0), col_type(v1), col_type(v2)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(v0); + this->value[1] = col_type(v1); + this->value[2] = col_type(v2); +# endif + } + + // -- Matrix conversions -- + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>::mat(mat<3, 4, U, P> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(m[2])} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(m[2]); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>::mat(mat<2, 2, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0], 0, 0), col_type(m[1], 0, 0), col_type(0, 0, 1, 0)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0], 0, 0); + this->value[1] = col_type(m[1], 0, 0); + this->value[2] = col_type(0, 0, 1, 0); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>::mat(mat<3, 3, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0], 0), col_type(m[1], 0), col_type(m[2], 0)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0], 0); + this->value[1] = col_type(m[1], 0); + this->value[2] = col_type(m[2], 0); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>::mat(mat<4, 4, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(m[2])} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(m[2]); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>::mat(mat<2, 3, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0], 0), col_type(m[1], 0), col_type(0, 0, 1, 0)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0], 0); + this->value[1] = col_type(m[1], 0); + this->value[2] = col_type(0, 0, 1, 0); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>::mat(mat<3, 2, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0], 0, 0), col_type(m[1], 0, 0), col_type(m[2], 1, 0)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0], 0, 0); + this->value[1] = col_type(m[1], 0, 0); + this->value[2] = col_type(m[2], 1, 0); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>::mat(mat<2, 4, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(0, 0, 1, 0)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(0, 0, 1, 0); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>::mat(mat<4, 2, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0], 0, 0), col_type(m[1], 0, 0), col_type(m[2], 1, 0)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0], 0, 0); + this->value[1] = col_type(m[1], 0, 0); + this->value[2] = col_type(m[2], 1, 0); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>::mat(mat<4, 3, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0], 0), col_type(m[1], 0), col_type(m[2], 0)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0], 0); + this->value[1] = col_type(m[1], 0); + this->value[2] = col_type(m[2], 0); +# endif + } + + // -- Accesses -- + + template + GLM_FUNC_QUALIFIER typename mat<3, 4, T, Q>::col_type & mat<3, 4, T, Q>::operator[](typename mat<3, 4, T, Q>::length_type i) GLM_NOEXCEPT + { + assert(i < this->length()); + return this->value[i]; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<3, 4, T, Q>::col_type const& mat<3, 4, T, Q>::operator[](typename mat<3, 4, T, Q>::length_type i) const GLM_NOEXCEPT + { + assert(i < this->length()); + return this->value[i]; + } + + // -- Unary updatable operators -- + + template + template + GLM_FUNC_QUALIFIER mat<3, 4, T, Q>& mat<3, 4, T, Q>::operator=(mat<3, 4, U, Q> const& m) + { + this->value[0] = m[0]; + this->value[1] = m[1]; + this->value[2] = m[2]; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<3, 4, T, Q>& mat<3, 4, T, Q>::operator+=(U s) + { + this->value[0] += s; + this->value[1] += s; + this->value[2] += s; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<3, 4, T, Q>& mat<3, 4, T, Q>::operator+=(mat<3, 4, U, Q> const& m) + { + this->value[0] += m[0]; + this->value[1] += m[1]; + this->value[2] += m[2]; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<3, 4, T, Q>& mat<3, 4, T, Q>::operator-=(U s) + { + this->value[0] -= s; + this->value[1] -= s; + this->value[2] -= s; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<3, 4, T, Q>& mat<3, 4, T, Q>::operator-=(mat<3, 4, U, Q> const& m) + { + this->value[0] -= m[0]; + this->value[1] -= m[1]; + this->value[2] -= m[2]; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<3, 4, T, Q>& mat<3, 4, T, Q>::operator*=(U s) + { + this->value[0] *= s; + this->value[1] *= s; + this->value[2] *= s; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<3, 4, T, Q> & mat<3, 4, T, Q>::operator/=(U s) + { + this->value[0] /= s; + this->value[1] /= s; + this->value[2] /= s; + return *this; + } + + // -- Increment and decrement operators -- + + template + GLM_FUNC_QUALIFIER mat<3, 4, T, Q>& mat<3, 4, T, Q>::operator++() + { + ++this->value[0]; + ++this->value[1]; + ++this->value[2]; + return *this; + } + + template + GLM_FUNC_QUALIFIER mat<3, 4, T, Q>& mat<3, 4, T, Q>::operator--() + { + --this->value[0]; + --this->value[1]; + --this->value[2]; + return *this; + } + + template + GLM_FUNC_QUALIFIER mat<3, 4, T, Q> mat<3, 4, T, Q>::operator++(int) + { + mat<3, 4, T, Q> Result(*this); + ++*this; + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<3, 4, T, Q> mat<3, 4, T, Q>::operator--(int) + { + mat<3, 4, T, Q> Result(*this); + --*this; + return Result; + } + + // -- Unary arithmetic operators -- + + template + GLM_FUNC_QUALIFIER mat<3, 4, T, Q> operator+(mat<3, 4, T, Q> const& m) + { + return m; + } + + template + GLM_FUNC_QUALIFIER mat<3, 4, T, Q> operator-(mat<3, 4, T, Q> const& m) + { + return mat<3, 4, T, Q>( + -m[0], + -m[1], + -m[2]); + } + + // -- Binary arithmetic operators -- + + template + GLM_FUNC_QUALIFIER mat<3, 4, T, Q> operator+(mat<3, 4, T, Q> const& m, T scalar) + { + return mat<3, 4, T, Q>( + m[0] + scalar, + m[1] + scalar, + m[2] + scalar); + } + + template + GLM_FUNC_QUALIFIER mat<3, 4, T, Q> operator+(mat<3, 4, T, Q> const& m1, mat<3, 4, T, Q> const& m2) + { + return mat<3, 4, T, Q>( + m1[0] + m2[0], + m1[1] + m2[1], + m1[2] + m2[2]); + } + + template + GLM_FUNC_QUALIFIER mat<3, 4, T, Q> operator-(mat<3, 4, T, Q> const& m, T scalar) + { + return mat<3, 4, T, Q>( + m[0] - scalar, + m[1] - scalar, + m[2] - scalar); + } + + template + GLM_FUNC_QUALIFIER mat<3, 4, T, Q> operator-(mat<3, 4, T, Q> const& m1, mat<3, 4, T, Q> const& m2) + { + return mat<3, 4, T, Q>( + m1[0] - m2[0], + m1[1] - m2[1], + m1[2] - m2[2]); + } + + template + GLM_FUNC_QUALIFIER mat<3, 4, T, Q> operator*(mat<3, 4, T, Q> const& m, T scalar) + { + return mat<3, 4, T, Q>( + m[0] * scalar, + m[1] * scalar, + m[2] * scalar); + } + + template + GLM_FUNC_QUALIFIER mat<3, 4, T, Q> operator*(T scalar, mat<3, 4, T, Q> const& m) + { + return mat<3, 4, T, Q>( + m[0] * scalar, + m[1] * scalar, + m[2] * scalar); + } + + template + GLM_FUNC_QUALIFIER typename mat<3, 4, T, Q>::col_type operator* + ( + mat<3, 4, T, Q> const& m, + typename mat<3, 4, T, Q>::row_type const& v + ) + { + return typename mat<3, 4, T, Q>::col_type( + m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z, + m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z, + m[0][2] * v.x + m[1][2] * v.y + m[2][2] * v.z, + m[0][3] * v.x + m[1][3] * v.y + m[2][3] * v.z); + } + + template + GLM_FUNC_QUALIFIER typename mat<3, 4, T, Q>::row_type operator* + ( + typename mat<3, 4, T, Q>::col_type const& v, + mat<3, 4, T, Q> const& m + ) + { + return typename mat<3, 4, T, Q>::row_type( + v.x * m[0][0] + v.y * m[0][1] + v.z * m[0][2] + v.w * m[0][3], + v.x * m[1][0] + v.y * m[1][1] + v.z * m[1][2] + v.w * m[1][3], + v.x * m[2][0] + v.y * m[2][1] + v.z * m[2][2] + v.w * m[2][3]); + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> operator*(mat<3, 4, T, Q> const& m1, mat<4, 3, T, Q> const& m2) + { + const T SrcA00 = m1[0][0]; + const T SrcA01 = m1[0][1]; + const T SrcA02 = m1[0][2]; + const T SrcA03 = m1[0][3]; + const T SrcA10 = m1[1][0]; + const T SrcA11 = m1[1][1]; + const T SrcA12 = m1[1][2]; + const T SrcA13 = m1[1][3]; + const T SrcA20 = m1[2][0]; + const T SrcA21 = m1[2][1]; + const T SrcA22 = m1[2][2]; + const T SrcA23 = m1[2][3]; + + const T SrcB00 = m2[0][0]; + const T SrcB01 = m2[0][1]; + const T SrcB02 = m2[0][2]; + const T SrcB10 = m2[1][0]; + const T SrcB11 = m2[1][1]; + const T SrcB12 = m2[1][2]; + const T SrcB20 = m2[2][0]; + const T SrcB21 = m2[2][1]; + const T SrcB22 = m2[2][2]; + const T SrcB30 = m2[3][0]; + const T SrcB31 = m2[3][1]; + const T SrcB32 = m2[3][2]; + + mat<4, 4, T, Q> Result; + Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01 + SrcA20 * SrcB02; + Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01 + SrcA21 * SrcB02; + Result[0][2] = SrcA02 * SrcB00 + SrcA12 * SrcB01 + SrcA22 * SrcB02; + Result[0][3] = SrcA03 * SrcB00 + SrcA13 * SrcB01 + SrcA23 * SrcB02; + Result[1][0] = SrcA00 * SrcB10 + SrcA10 * SrcB11 + SrcA20 * SrcB12; + Result[1][1] = SrcA01 * SrcB10 + SrcA11 * SrcB11 + SrcA21 * SrcB12; + Result[1][2] = SrcA02 * SrcB10 + SrcA12 * SrcB11 + SrcA22 * SrcB12; + Result[1][3] = SrcA03 * SrcB10 + SrcA13 * SrcB11 + SrcA23 * SrcB12; + Result[2][0] = SrcA00 * SrcB20 + SrcA10 * SrcB21 + SrcA20 * SrcB22; + Result[2][1] = SrcA01 * SrcB20 + SrcA11 * SrcB21 + SrcA21 * SrcB22; + Result[2][2] = SrcA02 * SrcB20 + SrcA12 * SrcB21 + SrcA22 * SrcB22; + Result[2][3] = SrcA03 * SrcB20 + SrcA13 * SrcB21 + SrcA23 * SrcB22; + Result[3][0] = SrcA00 * SrcB30 + SrcA10 * SrcB31 + SrcA20 * SrcB32; + Result[3][1] = SrcA01 * SrcB30 + SrcA11 * SrcB31 + SrcA21 * SrcB32; + Result[3][2] = SrcA02 * SrcB30 + SrcA12 * SrcB31 + SrcA22 * SrcB32; + Result[3][3] = SrcA03 * SrcB30 + SrcA13 * SrcB31 + SrcA23 * SrcB32; + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<2, 4, T, Q> operator*(mat<3, 4, T, Q> const& m1, mat<2, 3, T, Q> const& m2) + { + return mat<2, 4, T, Q>( + m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2], + m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2], + m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1] + m1[2][2] * m2[0][2], + m1[0][3] * m2[0][0] + m1[1][3] * m2[0][1] + m1[2][3] * m2[0][2], + m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1] + m1[2][0] * m2[1][2], + m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1] + m1[2][1] * m2[1][2], + m1[0][2] * m2[1][0] + m1[1][2] * m2[1][1] + m1[2][2] * m2[1][2], + m1[0][3] * m2[1][0] + m1[1][3] * m2[1][1] + m1[2][3] * m2[1][2]); + } + + template + GLM_FUNC_QUALIFIER mat<3, 4, T, Q> operator*(mat<3, 4, T, Q> const& m1, mat<3, 3, T, Q> const& m2) + { + return mat<3, 4, T, Q>( + m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2], + m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2], + m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1] + m1[2][2] * m2[0][2], + m1[0][3] * m2[0][0] + m1[1][3] * m2[0][1] + m1[2][3] * m2[0][2], + m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1] + m1[2][0] * m2[1][2], + m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1] + m1[2][1] * m2[1][2], + m1[0][2] * m2[1][0] + m1[1][2] * m2[1][1] + m1[2][2] * m2[1][2], + m1[0][3] * m2[1][0] + m1[1][3] * m2[1][1] + m1[2][3] * m2[1][2], + m1[0][0] * m2[2][0] + m1[1][0] * m2[2][1] + m1[2][0] * m2[2][2], + m1[0][1] * m2[2][0] + m1[1][1] * m2[2][1] + m1[2][1] * m2[2][2], + m1[0][2] * m2[2][0] + m1[1][2] * m2[2][1] + m1[2][2] * m2[2][2], + m1[0][3] * m2[2][0] + m1[1][3] * m2[2][1] + m1[2][3] * m2[2][2]); + } + + template + GLM_FUNC_QUALIFIER mat<3, 4, T, Q> operator/(mat<3, 4, T, Q> const& m, T scalar) + { + return mat<3, 4, T, Q>( + m[0] / scalar, + m[1] / scalar, + m[2] / scalar); + } + + template + GLM_FUNC_QUALIFIER mat<3, 4, T, Q> operator/(T scalar, mat<3, 4, T, Q> const& m) + { + return mat<3, 4, T, Q>( + scalar / m[0], + scalar / m[1], + scalar / m[2]); + } + + // -- Boolean operators -- + + template + GLM_FUNC_QUALIFIER bool operator==(mat<3, 4, T, Q> const& m1, mat<3, 4, T, Q> const& m2) + { + return (m1[0] == m2[0]) && (m1[1] == m2[1]) && (m1[2] == m2[2]); + } + + template + GLM_FUNC_QUALIFIER bool operator!=(mat<3, 4, T, Q> const& m1, mat<3, 4, T, Q> const& m2) + { + return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]); + } +} //namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_mat4x2.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_mat4x2.hpp new file mode 100644 index 0000000000000000000000000000000000000000..1a9d984bf76b2d04a45196ad5f22a019d67d3b3f --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_mat4x2.hpp @@ -0,0 +1,171 @@ +/// @ref core +/// @file glm/detail/type_mat4x2.hpp + +#pragma once + +#include "type_vec2.hpp" +#include "type_vec4.hpp" +#include +#include + +namespace glm +{ + template + struct mat<4, 2, T, Q> + { + typedef vec<2, T, Q> col_type; + typedef vec<4, T, Q> row_type; + typedef mat<4, 2, T, Q> type; + typedef mat<2, 4, T, Q> transpose_type; + typedef T value_type; + + private: + col_type value[4]; + + public: + // -- Accesses -- + + typedef length_t length_type; + GLM_FUNC_DECL static GLM_CONSTEXPR length_type length() { return 4; } + + GLM_FUNC_DECL col_type & operator[](length_type i) GLM_NOEXCEPT; + GLM_FUNC_DECL GLM_CONSTEXPR col_type const& operator[](length_type i) const GLM_NOEXCEPT; + + // -- Constructors -- + + GLM_FUNC_DECL GLM_CONSTEXPR mat() GLM_DEFAULT_CTOR; + template + GLM_FUNC_DECL GLM_CONSTEXPR mat(mat<4, 2, T, P> const& m); + + GLM_FUNC_DECL explicit GLM_CONSTEXPR mat(T scalar); + GLM_FUNC_DECL GLM_CONSTEXPR mat( + T x0, T y0, + T x1, T y1, + T x2, T y2, + T x3, T y3); + GLM_FUNC_DECL GLM_CONSTEXPR mat( + col_type const& v0, + col_type const& v1, + col_type const& v2, + col_type const& v3); + + // -- Conversions -- + + template< + typename X0, typename Y0, + typename X1, typename Y1, + typename X2, typename Y2, + typename X3, typename Y3> + GLM_FUNC_DECL GLM_CONSTEXPR mat( + X0 x0, Y0 y0, + X1 x1, Y1 y1, + X2 x2, Y2 y2, + X3 x3, Y3 y3); + + template + GLM_FUNC_DECL GLM_CONSTEXPR mat( + vec<2, V1, Q> const& v1, + vec<2, V2, Q> const& v2, + vec<2, V3, Q> const& v3, + vec<2, V4, Q> const& v4); + + // -- Matrix conversions -- + + template + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 2, U, P> const& m); + + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 2, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 3, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 4, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 3, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 2, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 4, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 3, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 4, T, Q> const& x); + + // -- Unary arithmetic operators -- + + template + GLM_FUNC_DECL mat<4, 2, T, Q> & operator=(mat<4, 2, U, Q> const& m); + template + GLM_FUNC_DECL mat<4, 2, T, Q> & operator+=(U s); + template + GLM_FUNC_DECL mat<4, 2, T, Q> & operator+=(mat<4, 2, U, Q> const& m); + template + GLM_FUNC_DECL mat<4, 2, T, Q> & operator-=(U s); + template + GLM_FUNC_DECL mat<4, 2, T, Q> & operator-=(mat<4, 2, U, Q> const& m); + template + GLM_FUNC_DECL mat<4, 2, T, Q> & operator*=(U s); + template + GLM_FUNC_DECL mat<4, 2, T, Q> & operator/=(U s); + + // -- Increment and decrement operators -- + + GLM_FUNC_DECL mat<4, 2, T, Q> & operator++ (); + GLM_FUNC_DECL mat<4, 2, T, Q> & operator-- (); + GLM_FUNC_DECL mat<4, 2, T, Q> operator++(int); + GLM_FUNC_DECL mat<4, 2, T, Q> operator--(int); + }; + + // -- Unary operators -- + + template + GLM_FUNC_DECL mat<4, 2, T, Q> operator+(mat<4, 2, T, Q> const& m); + + template + GLM_FUNC_DECL mat<4, 2, T, Q> operator-(mat<4, 2, T, Q> const& m); + + // -- Binary operators -- + + template + GLM_FUNC_DECL mat<4, 2, T, Q> operator+(mat<4, 2, T, Q> const& m, T scalar); + + template + GLM_FUNC_DECL mat<4, 2, T, Q> operator+(mat<4, 2, T, Q> const& m1, mat<4, 2, T, Q> const& m2); + + template + GLM_FUNC_DECL mat<4, 2, T, Q> operator-(mat<4, 2, T, Q> const& m, T scalar); + + template + GLM_FUNC_DECL mat<4, 2, T, Q> operator-(mat<4, 2, T, Q> const& m1, mat<4, 2, T, Q> const& m2); + + template + GLM_FUNC_DECL mat<4, 2, T, Q> operator*(mat<4, 2, T, Q> const& m, T scalar); + + template + GLM_FUNC_DECL mat<4, 2, T, Q> operator*(T scalar, mat<4, 2, T, Q> const& m); + + template + GLM_FUNC_DECL typename mat<4, 2, T, Q>::col_type operator*(mat<4, 2, T, Q> const& m, typename mat<4, 2, T, Q>::row_type const& v); + + template + GLM_FUNC_DECL typename mat<4, 2, T, Q>::row_type operator*(typename mat<4, 2, T, Q>::col_type const& v, mat<4, 2, T, Q> const& m); + + template + GLM_FUNC_DECL mat<2, 2, T, Q> operator*(mat<4, 2, T, Q> const& m1, mat<2, 4, T, Q> const& m2); + + template + GLM_FUNC_DECL mat<3, 2, T, Q> operator*(mat<4, 2, T, Q> const& m1, mat<3, 4, T, Q> const& m2); + + template + GLM_FUNC_DECL mat<4, 2, T, Q> operator*(mat<4, 2, T, Q> const& m1, mat<4, 4, T, Q> const& m2); + + template + GLM_FUNC_DECL mat<4, 2, T, Q> operator/(mat<4, 2, T, Q> const& m, T scalar); + + template + GLM_FUNC_DECL mat<4, 2, T, Q> operator/(T scalar, mat<4, 2, T, Q> const& m); + + // -- Boolean operators -- + + template + GLM_FUNC_DECL bool operator==(mat<4, 2, T, Q> const& m1, mat<4, 2, T, Q> const& m2); + + template + GLM_FUNC_DECL bool operator!=(mat<4, 2, T, Q> const& m1, mat<4, 2, T, Q> const& m2); +}//namespace glm + +#ifndef GLM_EXTERNAL_TEMPLATE +#include "type_mat4x2.inl" +#endif diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_mat4x2.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_mat4x2.inl new file mode 100644 index 0000000000000000000000000000000000000000..b8ff67e3a7a72cefd64d63bea6ec520f6bfb4f03 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_mat4x2.inl @@ -0,0 +1,574 @@ +namespace glm +{ + // -- Constructors -- + +# if GLM_CONFIG_DEFAULTED_DEFAULT_CTOR == GLM_DISABLE + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q>::mat() +# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALIZER_LIST + : value{col_type(1, 0), col_type(0, 1), col_type(0, 0), col_type(0, 0)} +# endif + { +# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALISATION + this->value[0] = col_type(1, 0); + this->value[1] = col_type(0, 1); + this->value[2] = col_type(0, 0); + this->value[3] = col_type(0, 0); +# endif + } +# endif + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q>::mat(mat<4, 2, T, P> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(m[2]), col_type(m[3])} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = m[0]; + this->value[1] = m[1]; + this->value[2] = m[2]; + this->value[3] = m[3]; +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q>::mat(T s) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(s, 0), col_type(0, s), col_type(0, 0), col_type(0, 0)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(s, 0); + this->value[1] = col_type(0, s); + this->value[2] = col_type(0, 0); + this->value[3] = col_type(0, 0); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q>::mat + ( + T x0, T y0, + T x1, T y1, + T x2, T y2, + T x3, T y3 + ) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(x0, y0), col_type(x1, y1), col_type(x2, y2), col_type(x3, y3)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(x0, y0); + this->value[1] = col_type(x1, y1); + this->value[2] = col_type(x2, y2); + this->value[3] = col_type(x3, y3); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q>::mat(col_type const& v0, col_type const& v1, col_type const& v2, col_type const& v3) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(v0), col_type(v1), col_type(v2), col_type(v3)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = v0; + this->value[1] = v1; + this->value[2] = v2; + this->value[3] = v3; +# endif + } + + // -- Conversion constructors -- + + template + template< + typename X0, typename Y0, + typename X1, typename Y1, + typename X2, typename Y2, + typename X3, typename Y3> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q>::mat + ( + X0 x0, Y0 y0, + X1 x1, Y1 y1, + X2 x2, Y2 y2, + X3 x3, Y3 y3 + ) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(x0, y0), col_type(x1, y1), col_type(x2, y2), col_type(x3, y3)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(x0, y0); + this->value[1] = col_type(x1, y1); + this->value[2] = col_type(x2, y2); + this->value[3] = col_type(x3, y3); +# endif + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q>::mat(vec<2, V0, Q> const& v0, vec<2, V1, Q> const& v1, vec<2, V2, Q> const& v2, vec<2, V3, Q> const& v3) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(v0), col_type(v1), col_type(v2), col_type(v3)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(v0); + this->value[1] = col_type(v1); + this->value[2] = col_type(v2); + this->value[3] = col_type(v3); +# endif + } + + // -- Conversion -- + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q>::mat(mat<4, 2, U, P> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(m[2]), col_type(m[3])} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(m[2]); + this->value[3] = col_type(m[3]); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q>::mat(mat<2, 2, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(0), col_type(0)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(0); + this->value[3] = col_type(0); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q>::mat(mat<3, 3, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(m[2]), col_type(0)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(m[2]); + this->value[3] = col_type(0); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q>::mat(mat<4, 4, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(m[2]), col_type(m[3])} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(m[2]); + this->value[3] = col_type(m[3]); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q>::mat(mat<2, 3, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(0), col_type(0)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(0); + this->value[3] = col_type(0); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q>::mat(mat<3, 2, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(m[2]), col_type(0)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(m[2]); + this->value[3] = col_type(0); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q>::mat(mat<2, 4, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(0), col_type(0)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(0); + this->value[3] = col_type(0); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q>::mat(mat<4, 3, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(m[2]), col_type(m[3])} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(m[2]); + this->value[3] = col_type(m[3]); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q>::mat(mat<3, 4, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(m[2]), col_type(0)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(m[2]); + this->value[3] = col_type(0); +# endif + } + + // -- Accesses -- + + template + GLM_FUNC_QUALIFIER typename mat<4, 2, T, Q>::col_type & mat<4, 2, T, Q>::operator[](typename mat<4, 2, T, Q>::length_type i) GLM_NOEXCEPT + { + assert(i < this->length()); + return this->value[i]; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<4, 2, T, Q>::col_type const& mat<4, 2, T, Q>::operator[](typename mat<4, 2, T, Q>::length_type i) const GLM_NOEXCEPT + { + assert(i < this->length()); + return this->value[i]; + } + + // -- Unary updatable operators -- + + template + template + GLM_FUNC_QUALIFIER mat<4, 2, T, Q>& mat<4, 2, T, Q>::operator=(mat<4, 2, U, Q> const& m) + { + this->value[0] = m[0]; + this->value[1] = m[1]; + this->value[2] = m[2]; + this->value[3] = m[3]; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<4, 2, T, Q> & mat<4, 2, T, Q>::operator+=(U s) + { + this->value[0] += s; + this->value[1] += s; + this->value[2] += s; + this->value[3] += s; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<4, 2, T, Q> & mat<4, 2, T, Q>::operator+=(mat<4, 2, U, Q> const& m) + { + this->value[0] += m[0]; + this->value[1] += m[1]; + this->value[2] += m[2]; + this->value[3] += m[3]; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<4, 2, T, Q> & mat<4, 2, T, Q>::operator-=(U s) + { + this->value[0] -= s; + this->value[1] -= s; + this->value[2] -= s; + this->value[3] -= s; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<4, 2, T, Q> & mat<4, 2, T, Q>::operator-=(mat<4, 2, U, Q> const& m) + { + this->value[0] -= m[0]; + this->value[1] -= m[1]; + this->value[2] -= m[2]; + this->value[3] -= m[3]; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<4, 2, T, Q> & mat<4, 2, T, Q>::operator*=(U s) + { + this->value[0] *= s; + this->value[1] *= s; + this->value[2] *= s; + this->value[3] *= s; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<4, 2, T, Q> & mat<4, 2, T, Q>::operator/=(U s) + { + this->value[0] /= s; + this->value[1] /= s; + this->value[2] /= s; + this->value[3] /= s; + return *this; + } + + // -- Increment and decrement operators -- + + template + GLM_FUNC_QUALIFIER mat<4, 2, T, Q> & mat<4, 2, T, Q>::operator++() + { + ++this->value[0]; + ++this->value[1]; + ++this->value[2]; + ++this->value[3]; + return *this; + } + + template + GLM_FUNC_QUALIFIER mat<4, 2, T, Q> & mat<4, 2, T, Q>::operator--() + { + --this->value[0]; + --this->value[1]; + --this->value[2]; + --this->value[3]; + return *this; + } + + template + GLM_FUNC_QUALIFIER mat<4, 2, T, Q> mat<4, 2, T, Q>::operator++(int) + { + mat<4, 2, T, Q> Result(*this); + ++*this; + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 2, T, Q> mat<4, 2, T, Q>::operator--(int) + { + mat<4, 2, T, Q> Result(*this); + --*this; + return Result; + } + + // -- Unary arithmetic operators -- + + template + GLM_FUNC_QUALIFIER mat<4, 2, T, Q> operator+(mat<4, 2, T, Q> const& m) + { + return m; + } + + template + GLM_FUNC_QUALIFIER mat<4, 2, T, Q> operator-(mat<4, 2, T, Q> const& m) + { + return mat<4, 2, T, Q>( + -m[0], + -m[1], + -m[2], + -m[3]); + } + + // -- Binary arithmetic operators -- + + template + GLM_FUNC_QUALIFIER mat<4, 2, T, Q> operator+(mat<4, 2, T, Q> const& m, T scalar) + { + return mat<4, 2, T, Q>( + m[0] + scalar, + m[1] + scalar, + m[2] + scalar, + m[3] + scalar); + } + + template + GLM_FUNC_QUALIFIER mat<4, 2, T, Q> operator+(mat<4, 2, T, Q> const& m1, mat<4, 2, T, Q> const& m2) + { + return mat<4, 2, T, Q>( + m1[0] + m2[0], + m1[1] + m2[1], + m1[2] + m2[2], + m1[3] + m2[3]); + } + + template + GLM_FUNC_QUALIFIER mat<4, 2, T, Q> operator-(mat<4, 2, T, Q> const& m, T scalar) + { + return mat<4, 2, T, Q>( + m[0] - scalar, + m[1] - scalar, + m[2] - scalar, + m[3] - scalar); + } + + template + GLM_FUNC_QUALIFIER mat<4, 2, T, Q> operator-(mat<4, 2, T, Q> const& m1, mat<4, 2, T, Q> const& m2) + { + return mat<4, 2, T, Q>( + m1[0] - m2[0], + m1[1] - m2[1], + m1[2] - m2[2], + m1[3] - m2[3]); + } + + template + GLM_FUNC_QUALIFIER mat<4, 2, T, Q> operator*(mat<4, 2, T, Q> const& m, T scalar) + { + return mat<4, 2, T, Q>( + m[0] * scalar, + m[1] * scalar, + m[2] * scalar, + m[3] * scalar); + } + + template + GLM_FUNC_QUALIFIER mat<4, 2, T, Q> operator*(T scalar, mat<4, 2, T, Q> const& m) + { + return mat<4, 2, T, Q>( + m[0] * scalar, + m[1] * scalar, + m[2] * scalar, + m[3] * scalar); + } + + template + GLM_FUNC_QUALIFIER typename mat<4, 2, T, Q>::col_type operator*(mat<4, 2, T, Q> const& m, typename mat<4, 2, T, Q>::row_type const& v) + { + return typename mat<4, 2, T, Q>::col_type( + m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z + m[3][0] * v.w, + m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z + m[3][1] * v.w); + } + + template + GLM_FUNC_QUALIFIER typename mat<4, 2, T, Q>::row_type operator*(typename mat<4, 2, T, Q>::col_type const& v, mat<4, 2, T, Q> const& m) + { + return typename mat<4, 2, T, Q>::row_type( + v.x * m[0][0] + v.y * m[0][1], + v.x * m[1][0] + v.y * m[1][1], + v.x * m[2][0] + v.y * m[2][1], + v.x * m[3][0] + v.y * m[3][1]); + } + + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q> operator*(mat<4, 2, T, Q> const& m1, mat<2, 4, T, Q> const& m2) + { + T const SrcA00 = m1[0][0]; + T const SrcA01 = m1[0][1]; + T const SrcA10 = m1[1][0]; + T const SrcA11 = m1[1][1]; + T const SrcA20 = m1[2][0]; + T const SrcA21 = m1[2][1]; + T const SrcA30 = m1[3][0]; + T const SrcA31 = m1[3][1]; + + T const SrcB00 = m2[0][0]; + T const SrcB01 = m2[0][1]; + T const SrcB02 = m2[0][2]; + T const SrcB03 = m2[0][3]; + T const SrcB10 = m2[1][0]; + T const SrcB11 = m2[1][1]; + T const SrcB12 = m2[1][2]; + T const SrcB13 = m2[1][3]; + + mat<2, 2, T, Q> Result; + Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01 + SrcA20 * SrcB02 + SrcA30 * SrcB03; + Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01 + SrcA21 * SrcB02 + SrcA31 * SrcB03; + Result[1][0] = SrcA00 * SrcB10 + SrcA10 * SrcB11 + SrcA20 * SrcB12 + SrcA30 * SrcB13; + Result[1][1] = SrcA01 * SrcB10 + SrcA11 * SrcB11 + SrcA21 * SrcB12 + SrcA31 * SrcB13; + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<3, 2, T, Q> operator*(mat<4, 2, T, Q> const& m1, mat<3, 4, T, Q> const& m2) + { + return mat<3, 2, T, Q>( + m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2] + m1[3][0] * m2[0][3], + m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2] + m1[3][1] * m2[0][3], + m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1] + m1[2][0] * m2[1][2] + m1[3][0] * m2[1][3], + m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1] + m1[2][1] * m2[1][2] + m1[3][1] * m2[1][3], + m1[0][0] * m2[2][0] + m1[1][0] * m2[2][1] + m1[2][0] * m2[2][2] + m1[3][0] * m2[2][3], + m1[0][1] * m2[2][0] + m1[1][1] * m2[2][1] + m1[2][1] * m2[2][2] + m1[3][1] * m2[2][3]); + } + + template + GLM_FUNC_QUALIFIER mat<4, 2, T, Q> operator*(mat<4, 2, T, Q> const& m1, mat<4, 4, T, Q> const& m2) + { + return mat<4, 2, T, Q>( + m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2] + m1[3][0] * m2[0][3], + m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2] + m1[3][1] * m2[0][3], + m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1] + m1[2][0] * m2[1][2] + m1[3][0] * m2[1][3], + m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1] + m1[2][1] * m2[1][2] + m1[3][1] * m2[1][3], + m1[0][0] * m2[2][0] + m1[1][0] * m2[2][1] + m1[2][0] * m2[2][2] + m1[3][0] * m2[2][3], + m1[0][1] * m2[2][0] + m1[1][1] * m2[2][1] + m1[2][1] * m2[2][2] + m1[3][1] * m2[2][3], + m1[0][0] * m2[3][0] + m1[1][0] * m2[3][1] + m1[2][0] * m2[3][2] + m1[3][0] * m2[3][3], + m1[0][1] * m2[3][0] + m1[1][1] * m2[3][1] + m1[2][1] * m2[3][2] + m1[3][1] * m2[3][3]); + } + + template + GLM_FUNC_QUALIFIER mat<4, 2, T, Q> operator/(mat<4, 2, T, Q> const& m, T scalar) + { + return mat<4, 2, T, Q>( + m[0] / scalar, + m[1] / scalar, + m[2] / scalar, + m[3] / scalar); + } + + template + GLM_FUNC_QUALIFIER mat<4, 2, T, Q> operator/(T scalar, mat<4, 2, T, Q> const& m) + { + return mat<4, 2, T, Q>( + scalar / m[0], + scalar / m[1], + scalar / m[2], + scalar / m[3]); + } + + // -- Boolean operators -- + + template + GLM_FUNC_QUALIFIER bool operator==(mat<4, 2, T, Q> const& m1, mat<4, 2, T, Q> const& m2) + { + return (m1[0] == m2[0]) && (m1[1] == m2[1]) && (m1[2] == m2[2]) && (m1[3] == m2[3]); + } + + template + GLM_FUNC_QUALIFIER bool operator!=(mat<4, 2, T, Q> const& m1, mat<4, 2, T, Q> const& m2) + { + return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]) || (m1[3] != m2[3]); + } +} //namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_mat4x3.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_mat4x3.hpp new file mode 100644 index 0000000000000000000000000000000000000000..d8830fee63fcbc92dcb53ea913efa0a252170efa --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_mat4x3.hpp @@ -0,0 +1,171 @@ +/// @ref core +/// @file glm/detail/type_mat4x3.hpp + +#pragma once + +#include "type_vec3.hpp" +#include "type_vec4.hpp" +#include +#include + +namespace glm +{ + template + struct mat<4, 3, T, Q> + { + typedef vec<3, T, Q> col_type; + typedef vec<4, T, Q> row_type; + typedef mat<4, 3, T, Q> type; + typedef mat<3, 4, T, Q> transpose_type; + typedef T value_type; + + private: + col_type value[4]; + + public: + // -- Accesses -- + + typedef length_t length_type; + GLM_FUNC_DECL static GLM_CONSTEXPR length_type length() { return 4; } + + GLM_FUNC_DECL col_type & operator[](length_type i) GLM_NOEXCEPT; + GLM_FUNC_DECL GLM_CONSTEXPR col_type const& operator[](length_type i) const GLM_NOEXCEPT; + + // -- Constructors -- + + GLM_FUNC_DECL GLM_CONSTEXPR mat() GLM_DEFAULT_CTOR; + template + GLM_FUNC_DECL GLM_CONSTEXPR mat(mat<4, 3, T, P> const& m); + + GLM_FUNC_DECL explicit GLM_CONSTEXPR mat(T const& x); + GLM_FUNC_DECL GLM_CONSTEXPR mat( + T const& x0, T const& y0, T const& z0, + T const& x1, T const& y1, T const& z1, + T const& x2, T const& y2, T const& z2, + T const& x3, T const& y3, T const& z3); + GLM_FUNC_DECL GLM_CONSTEXPR mat( + col_type const& v0, + col_type const& v1, + col_type const& v2, + col_type const& v3); + + // -- Conversions -- + + template< + typename X1, typename Y1, typename Z1, + typename X2, typename Y2, typename Z2, + typename X3, typename Y3, typename Z3, + typename X4, typename Y4, typename Z4> + GLM_FUNC_DECL GLM_CONSTEXPR mat( + X1 const& x1, Y1 const& y1, Z1 const& z1, + X2 const& x2, Y2 const& y2, Z2 const& z2, + X3 const& x3, Y3 const& y3, Z3 const& z3, + X4 const& x4, Y4 const& y4, Z4 const& z4); + + template + GLM_FUNC_DECL GLM_CONSTEXPR mat( + vec<3, V1, Q> const& v1, + vec<3, V2, Q> const& v2, + vec<3, V3, Q> const& v3, + vec<3, V4, Q> const& v4); + + // -- Matrix conversions -- + + template + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 3, U, P> const& m); + + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 2, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 3, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 4, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 3, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 2, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 4, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 2, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 4, T, Q> const& x); + + // -- Unary arithmetic operators -- + + template + GLM_FUNC_DECL mat<4, 3, T, Q> & operator=(mat<4, 3, U, Q> const& m); + template + GLM_FUNC_DECL mat<4, 3, T, Q> & operator+=(U s); + template + GLM_FUNC_DECL mat<4, 3, T, Q> & operator+=(mat<4, 3, U, Q> const& m); + template + GLM_FUNC_DECL mat<4, 3, T, Q> & operator-=(U s); + template + GLM_FUNC_DECL mat<4, 3, T, Q> & operator-=(mat<4, 3, U, Q> const& m); + template + GLM_FUNC_DECL mat<4, 3, T, Q> & operator*=(U s); + template + GLM_FUNC_DECL mat<4, 3, T, Q> & operator/=(U s); + + // -- Increment and decrement operators -- + + GLM_FUNC_DECL mat<4, 3, T, Q>& operator++(); + GLM_FUNC_DECL mat<4, 3, T, Q>& operator--(); + GLM_FUNC_DECL mat<4, 3, T, Q> operator++(int); + GLM_FUNC_DECL mat<4, 3, T, Q> operator--(int); + }; + + // -- Unary operators -- + + template + GLM_FUNC_DECL mat<4, 3, T, Q> operator+(mat<4, 3, T, Q> const& m); + + template + GLM_FUNC_DECL mat<4, 3, T, Q> operator-(mat<4, 3, T, Q> const& m); + + // -- Binary operators -- + + template + GLM_FUNC_DECL mat<4, 3, T, Q> operator+(mat<4, 3, T, Q> const& m, T const& s); + + template + GLM_FUNC_DECL mat<4, 3, T, Q> operator+(mat<4, 3, T, Q> const& m1, mat<4, 3, T, Q> const& m2); + + template + GLM_FUNC_DECL mat<4, 3, T, Q> operator-(mat<4, 3, T, Q> const& m, T const& s); + + template + GLM_FUNC_DECL mat<4, 3, T, Q> operator-(mat<4, 3, T, Q> const& m1, mat<4, 3, T, Q> const& m2); + + template + GLM_FUNC_DECL mat<4, 3, T, Q> operator*(mat<4, 3, T, Q> const& m, T const& s); + + template + GLM_FUNC_DECL mat<4, 3, T, Q> operator*(T const& s, mat<4, 3, T, Q> const& m); + + template + GLM_FUNC_DECL typename mat<4, 3, T, Q>::col_type operator*(mat<4, 3, T, Q> const& m, typename mat<4, 3, T, Q>::row_type const& v); + + template + GLM_FUNC_DECL typename mat<4, 3, T, Q>::row_type operator*(typename mat<4, 3, T, Q>::col_type const& v, mat<4, 3, T, Q> const& m); + + template + GLM_FUNC_DECL mat<2, 3, T, Q> operator*(mat<4, 3, T, Q> const& m1, mat<2, 4, T, Q> const& m2); + + template + GLM_FUNC_DECL mat<3, 3, T, Q> operator*(mat<4, 3, T, Q> const& m1, mat<3, 4, T, Q> const& m2); + + template + GLM_FUNC_DECL mat<4, 3, T, Q> operator*(mat<4, 3, T, Q> const& m1, mat<4, 4, T, Q> const& m2); + + template + GLM_FUNC_DECL mat<4, 3, T, Q> operator/(mat<4, 3, T, Q> const& m, T const& s); + + template + GLM_FUNC_DECL mat<4, 3, T, Q> operator/(T const& s, mat<4, 3, T, Q> const& m); + + // -- Boolean operators -- + + template + GLM_FUNC_DECL bool operator==(mat<4, 3, T, Q> const& m1, mat<4, 3, T, Q> const& m2); + + template + GLM_FUNC_DECL bool operator!=(mat<4, 3, T, Q> const& m1, mat<4, 3, T, Q> const& m2); +}//namespace glm + +#ifndef GLM_EXTERNAL_TEMPLATE +#include "type_mat4x3.inl" +#endif //GLM_EXTERNAL_TEMPLATE diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_mat4x3.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_mat4x3.inl new file mode 100644 index 0000000000000000000000000000000000000000..ccccbb48ab7e22c14935f5f7462aadc2bfe03d72 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_mat4x3.inl @@ -0,0 +1,598 @@ +namespace glm +{ + // -- Constructors -- + +# if GLM_CONFIG_DEFAULTED_DEFAULT_CTOR == GLM_DISABLE + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q>::mat() +# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALIZER_LIST + : value{col_type(1, 0, 0), col_type(0, 1, 0), col_type(0, 0, 1), col_type(0, 0, 0)} +# endif + { +# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALISATION + this->value[0] = col_type(1, 0, 0); + this->value[1] = col_type(0, 1, 0); + this->value[2] = col_type(0, 0, 1); + this->value[3] = col_type(0, 0, 0); +# endif + } +# endif + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q>::mat(mat<4, 3, T, P> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(m[2]), col_type(m[3])} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = m[0]; + this->value[1] = m[1]; + this->value[2] = m[2]; + this->value[3] = m[3]; +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q>::mat(T const& s) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(s, 0, 0), col_type(0, s, 0), col_type(0, 0, s), col_type(0, 0, 0)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(s, 0, 0); + this->value[1] = col_type(0, s, 0); + this->value[2] = col_type(0, 0, s); + this->value[3] = col_type(0, 0, 0); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q>::mat + ( + T const& x0, T const& y0, T const& z0, + T const& x1, T const& y1, T const& z1, + T const& x2, T const& y2, T const& z2, + T const& x3, T const& y3, T const& z3 + ) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(x0, y0, z0), col_type(x1, y1, z1), col_type(x2, y2, z2), col_type(x3, y3, z3)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(x0, y0, z0); + this->value[1] = col_type(x1, y1, z1); + this->value[2] = col_type(x2, y2, z2); + this->value[3] = col_type(x3, y3, z3); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q>::mat(col_type const& v0, col_type const& v1, col_type const& v2, col_type const& v3) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(v0), col_type(v1), col_type(v2), col_type(v3)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = v0; + this->value[1] = v1; + this->value[2] = v2; + this->value[3] = v3; +# endif + } + + // -- Conversion constructors -- + + template + template< + typename X0, typename Y0, typename Z0, + typename X1, typename Y1, typename Z1, + typename X2, typename Y2, typename Z2, + typename X3, typename Y3, typename Z3> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q>::mat + ( + X0 const& x0, Y0 const& y0, Z0 const& z0, + X1 const& x1, Y1 const& y1, Z1 const& z1, + X2 const& x2, Y2 const& y2, Z2 const& z2, + X3 const& x3, Y3 const& y3, Z3 const& z3 + ) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(x0, y0, z0), col_type(x1, y1, z1), col_type(x2, y2, z2), col_type(x3, y3, z3)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(x0, y0, z0); + this->value[1] = col_type(x1, y1, z1); + this->value[2] = col_type(x2, y2, z2); + this->value[3] = col_type(x3, y3, z3); +# endif + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q>::mat(vec<3, V1, Q> const& v1, vec<3, V2, Q> const& v2, vec<3, V3, Q> const& v3, vec<3, V4, Q> const& v4) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(v1), col_type(v2), col_type(v3), col_type(v4)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(v1); + this->value[1] = col_type(v2); + this->value[2] = col_type(v3); + this->value[3] = col_type(v4); +# endif + } + + // -- Matrix conversions -- + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q>::mat(mat<4, 3, U, P> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(m[2]), col_type(m[3])} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(m[2]); + this->value[3] = col_type(m[3]); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q>::mat(mat<2, 2, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0], 0), col_type(m[1], 0), col_type(0, 0, 1), col_type(0)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0], 0); + this->value[1] = col_type(m[1], 0); + this->value[2] = col_type(0, 0, 1); + this->value[3] = col_type(0); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q>::mat(mat<3, 3, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(m[2]), col_type(0)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(m[2]); + this->value[3] = col_type(0); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q>::mat(mat<4, 4, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(m[2]), col_type(m[3])} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(m[2]); + this->value[3] = col_type(m[3]); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q>::mat(mat<2, 3, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(0, 0, 1), col_type(0)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(0, 0, 1); + this->value[3] = col_type(0); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q>::mat(mat<3, 2, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0], 0), col_type(m[1], 0), col_type(m[2], 1), col_type(0)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0], 0); + this->value[1] = col_type(m[1], 0); + this->value[2] = col_type(m[2], 1); + this->value[3] = col_type(0); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q>::mat(mat<2, 4, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(0, 0, 1), col_type(0)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(0, 0, 1); + this->value[3] = col_type(0); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q>::mat(mat<4, 2, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0], 0), col_type(m[1], 0), col_type(m[2], 1), col_type(m[3], 0)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0], 0); + this->value[1] = col_type(m[1], 0); + this->value[2] = col_type(m[2], 1); + this->value[3] = col_type(m[3], 0); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q>::mat(mat<3, 4, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(m[2]), col_type(0)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(m[2]); + this->value[3] = col_type(0); +# endif + } + + // -- Accesses -- + + template + GLM_FUNC_QUALIFIER typename mat<4, 3, T, Q>::col_type & mat<4, 3, T, Q>::operator[](typename mat<4, 3, T, Q>::length_type i) GLM_NOEXCEPT + { + assert(i < this->length()); + return this->value[i]; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<4, 3, T, Q>::col_type const& mat<4, 3, T, Q>::operator[](typename mat<4, 3, T, Q>::length_type i) const GLM_NOEXCEPT + { + assert(i < this->length()); + return this->value[i]; + } + + // -- Unary updatable operators -- + + template + template + GLM_FUNC_QUALIFIER mat<4, 3, T, Q>& mat<4, 3, T, Q>::operator=(mat<4, 3, U, Q> const& m) + { + this->value[0] = m[0]; + this->value[1] = m[1]; + this->value[2] = m[2]; + this->value[3] = m[3]; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<4, 3, T, Q> & mat<4, 3, T, Q>::operator+=(U s) + { + this->value[0] += s; + this->value[1] += s; + this->value[2] += s; + this->value[3] += s; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<4, 3, T, Q> & mat<4, 3, T, Q>::operator+=(mat<4, 3, U, Q> const& m) + { + this->value[0] += m[0]; + this->value[1] += m[1]; + this->value[2] += m[2]; + this->value[3] += m[3]; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<4, 3, T, Q> & mat<4, 3, T, Q>::operator-=(U s) + { + this->value[0] -= s; + this->value[1] -= s; + this->value[2] -= s; + this->value[3] -= s; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<4, 3, T, Q> & mat<4, 3, T, Q>::operator-=(mat<4, 3, U, Q> const& m) + { + this->value[0] -= m[0]; + this->value[1] -= m[1]; + this->value[2] -= m[2]; + this->value[3] -= m[3]; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<4, 3, T, Q> & mat<4, 3, T, Q>::operator*=(U s) + { + this->value[0] *= s; + this->value[1] *= s; + this->value[2] *= s; + this->value[3] *= s; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<4, 3, T, Q> & mat<4, 3, T, Q>::operator/=(U s) + { + this->value[0] /= s; + this->value[1] /= s; + this->value[2] /= s; + this->value[3] /= s; + return *this; + } + + // -- Increment and decrement operators -- + + template + GLM_FUNC_QUALIFIER mat<4, 3, T, Q> & mat<4, 3, T, Q>::operator++() + { + ++this->value[0]; + ++this->value[1]; + ++this->value[2]; + ++this->value[3]; + return *this; + } + + template + GLM_FUNC_QUALIFIER mat<4, 3, T, Q> & mat<4, 3, T, Q>::operator--() + { + --this->value[0]; + --this->value[1]; + --this->value[2]; + --this->value[3]; + return *this; + } + + template + GLM_FUNC_QUALIFIER mat<4, 3, T, Q> mat<4, 3, T, Q>::operator++(int) + { + mat<4, 3, T, Q> Result(*this); + ++*this; + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 3, T, Q> mat<4, 3, T, Q>::operator--(int) + { + mat<4, 3, T, Q> Result(*this); + --*this; + return Result; + } + + // -- Unary arithmetic operators -- + + template + GLM_FUNC_QUALIFIER mat<4, 3, T, Q> operator+(mat<4, 3, T, Q> const& m) + { + return m; + } + + template + GLM_FUNC_QUALIFIER mat<4, 3, T, Q> operator-(mat<4, 3, T, Q> const& m) + { + return mat<4, 3, T, Q>( + -m[0], + -m[1], + -m[2], + -m[3]); + } + + // -- Binary arithmetic operators -- + + template + GLM_FUNC_QUALIFIER mat<4, 3, T, Q> operator+(mat<4, 3, T, Q> const& m, T const& s) + { + return mat<4, 3, T, Q>( + m[0] + s, + m[1] + s, + m[2] + s, + m[3] + s); + } + + template + GLM_FUNC_QUALIFIER mat<4, 3, T, Q> operator+(mat<4, 3, T, Q> const& m1, mat<4, 3, T, Q> const& m2) + { + return mat<4, 3, T, Q>( + m1[0] + m2[0], + m1[1] + m2[1], + m1[2] + m2[2], + m1[3] + m2[3]); + } + + template + GLM_FUNC_QUALIFIER mat<4, 3, T, Q> operator-(mat<4, 3, T, Q> const& m, T const& s) + { + return mat<4, 3, T, Q>( + m[0] - s, + m[1] - s, + m[2] - s, + m[3] - s); + } + + template + GLM_FUNC_QUALIFIER mat<4, 3, T, Q> operator-(mat<4, 3, T, Q> const& m1, mat<4, 3, T, Q> const& m2) + { + return mat<4, 3, T, Q>( + m1[0] - m2[0], + m1[1] - m2[1], + m1[2] - m2[2], + m1[3] - m2[3]); + } + + template + GLM_FUNC_QUALIFIER mat<4, 3, T, Q> operator*(mat<4, 3, T, Q> const& m, T const& s) + { + return mat<4, 3, T, Q>( + m[0] * s, + m[1] * s, + m[2] * s, + m[3] * s); + } + + template + GLM_FUNC_QUALIFIER mat<4, 3, T, Q> operator*(T const& s, mat<4, 3, T, Q> const& m) + { + return mat<4, 3, T, Q>( + m[0] * s, + m[1] * s, + m[2] * s, + m[3] * s); + } + + template + GLM_FUNC_QUALIFIER typename mat<4, 3, T, Q>::col_type operator* + ( + mat<4, 3, T, Q> const& m, + typename mat<4, 3, T, Q>::row_type const& v) + { + return typename mat<4, 3, T, Q>::col_type( + m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z + m[3][0] * v.w, + m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z + m[3][1] * v.w, + m[0][2] * v.x + m[1][2] * v.y + m[2][2] * v.z + m[3][2] * v.w); + } + + template + GLM_FUNC_QUALIFIER typename mat<4, 3, T, Q>::row_type operator* + ( + typename mat<4, 3, T, Q>::col_type const& v, + mat<4, 3, T, Q> const& m) + { + return typename mat<4, 3, T, Q>::row_type( + v.x * m[0][0] + v.y * m[0][1] + v.z * m[0][2], + v.x * m[1][0] + v.y * m[1][1] + v.z * m[1][2], + v.x * m[2][0] + v.y * m[2][1] + v.z * m[2][2], + v.x * m[3][0] + v.y * m[3][1] + v.z * m[3][2]); + } + + template + GLM_FUNC_QUALIFIER mat<2, 3, T, Q> operator*(mat<4, 3, T, Q> const& m1, mat<2, 4, T, Q> const& m2) + { + return mat<2, 3, T, Q>( + m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2] + m1[3][0] * m2[0][3], + m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2] + m1[3][1] * m2[0][3], + m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1] + m1[2][2] * m2[0][2] + m1[3][2] * m2[0][3], + m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1] + m1[2][0] * m2[1][2] + m1[3][0] * m2[1][3], + m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1] + m1[2][1] * m2[1][2] + m1[3][1] * m2[1][3], + m1[0][2] * m2[1][0] + m1[1][2] * m2[1][1] + m1[2][2] * m2[1][2] + m1[3][2] * m2[1][3]); + } + + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator*(mat<4, 3, T, Q> const& m1, mat<3, 4, T, Q> const& m2) + { + T const SrcA00 = m1[0][0]; + T const SrcA01 = m1[0][1]; + T const SrcA02 = m1[0][2]; + T const SrcA10 = m1[1][0]; + T const SrcA11 = m1[1][1]; + T const SrcA12 = m1[1][2]; + T const SrcA20 = m1[2][0]; + T const SrcA21 = m1[2][1]; + T const SrcA22 = m1[2][2]; + T const SrcA30 = m1[3][0]; + T const SrcA31 = m1[3][1]; + T const SrcA32 = m1[3][2]; + + T const SrcB00 = m2[0][0]; + T const SrcB01 = m2[0][1]; + T const SrcB02 = m2[0][2]; + T const SrcB03 = m2[0][3]; + T const SrcB10 = m2[1][0]; + T const SrcB11 = m2[1][1]; + T const SrcB12 = m2[1][2]; + T const SrcB13 = m2[1][3]; + T const SrcB20 = m2[2][0]; + T const SrcB21 = m2[2][1]; + T const SrcB22 = m2[2][2]; + T const SrcB23 = m2[2][3]; + + mat<3, 3, T, Q> Result; + Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01 + SrcA20 * SrcB02 + SrcA30 * SrcB03; + Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01 + SrcA21 * SrcB02 + SrcA31 * SrcB03; + Result[0][2] = SrcA02 * SrcB00 + SrcA12 * SrcB01 + SrcA22 * SrcB02 + SrcA32 * SrcB03; + Result[1][0] = SrcA00 * SrcB10 + SrcA10 * SrcB11 + SrcA20 * SrcB12 + SrcA30 * SrcB13; + Result[1][1] = SrcA01 * SrcB10 + SrcA11 * SrcB11 + SrcA21 * SrcB12 + SrcA31 * SrcB13; + Result[1][2] = SrcA02 * SrcB10 + SrcA12 * SrcB11 + SrcA22 * SrcB12 + SrcA32 * SrcB13; + Result[2][0] = SrcA00 * SrcB20 + SrcA10 * SrcB21 + SrcA20 * SrcB22 + SrcA30 * SrcB23; + Result[2][1] = SrcA01 * SrcB20 + SrcA11 * SrcB21 + SrcA21 * SrcB22 + SrcA31 * SrcB23; + Result[2][2] = SrcA02 * SrcB20 + SrcA12 * SrcB21 + SrcA22 * SrcB22 + SrcA32 * SrcB23; + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 3, T, Q> operator*(mat<4, 3, T, Q> const& m1, mat<4, 4, T, Q> const& m2) + { + return mat<4, 3, T, Q>( + m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2] + m1[3][0] * m2[0][3], + m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2] + m1[3][1] * m2[0][3], + m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1] + m1[2][2] * m2[0][2] + m1[3][2] * m2[0][3], + m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1] + m1[2][0] * m2[1][2] + m1[3][0] * m2[1][3], + m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1] + m1[2][1] * m2[1][2] + m1[3][1] * m2[1][3], + m1[0][2] * m2[1][0] + m1[1][2] * m2[1][1] + m1[2][2] * m2[1][2] + m1[3][2] * m2[1][3], + m1[0][0] * m2[2][0] + m1[1][0] * m2[2][1] + m1[2][0] * m2[2][2] + m1[3][0] * m2[2][3], + m1[0][1] * m2[2][0] + m1[1][1] * m2[2][1] + m1[2][1] * m2[2][2] + m1[3][1] * m2[2][3], + m1[0][2] * m2[2][0] + m1[1][2] * m2[2][1] + m1[2][2] * m2[2][2] + m1[3][2] * m2[2][3], + m1[0][0] * m2[3][0] + m1[1][0] * m2[3][1] + m1[2][0] * m2[3][2] + m1[3][0] * m2[3][3], + m1[0][1] * m2[3][0] + m1[1][1] * m2[3][1] + m1[2][1] * m2[3][2] + m1[3][1] * m2[3][3], + m1[0][2] * m2[3][0] + m1[1][2] * m2[3][1] + m1[2][2] * m2[3][2] + m1[3][2] * m2[3][3]); + } + + template + GLM_FUNC_QUALIFIER mat<4, 3, T, Q> operator/(mat<4, 3, T, Q> const& m, T const& s) + { + return mat<4, 3, T, Q>( + m[0] / s, + m[1] / s, + m[2] / s, + m[3] / s); + } + + template + GLM_FUNC_QUALIFIER mat<4, 3, T, Q> operator/(T const& s, mat<4, 3, T, Q> const& m) + { + return mat<4, 3, T, Q>( + s / m[0], + s / m[1], + s / m[2], + s / m[3]); + } + + // -- Boolean operators -- + + template + GLM_FUNC_QUALIFIER bool operator==(mat<4, 3, T, Q> const& m1, mat<4, 3, T, Q> const& m2) + { + return (m1[0] == m2[0]) && (m1[1] == m2[1]) && (m1[2] == m2[2]) && (m1[3] == m2[3]); + } + + template + GLM_FUNC_QUALIFIER bool operator!=(mat<4, 3, T, Q> const& m1, mat<4, 3, T, Q> const& m2) + { + return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]) || (m1[3] != m2[3]); + } +} //namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_mat4x4.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_mat4x4.hpp new file mode 100644 index 0000000000000000000000000000000000000000..357dc0649472836d358d18b091401e1fb440ab74 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_mat4x4.hpp @@ -0,0 +1,189 @@ +/// @ref core +/// @file glm/detail/type_mat4x4.hpp + +#pragma once + +#include "type_vec4.hpp" +#include +#include + +namespace glm +{ + template + struct mat<4, 4, T, Q> + { + typedef vec<4, T, Q> col_type; + typedef vec<4, T, Q> row_type; + typedef mat<4, 4, T, Q> type; + typedef mat<4, 4, T, Q> transpose_type; + typedef T value_type; + + private: + col_type value[4]; + + public: + // -- Accesses -- + + typedef length_t length_type; + GLM_FUNC_DECL static GLM_CONSTEXPR length_type length(){return 4;} + + GLM_FUNC_DECL col_type & operator[](length_type i) GLM_NOEXCEPT; + GLM_FUNC_DECL GLM_CONSTEXPR col_type const& operator[](length_type i) const GLM_NOEXCEPT; + + // -- Constructors -- + + GLM_FUNC_DECL GLM_CONSTEXPR mat() GLM_DEFAULT_CTOR; + template + GLM_FUNC_DECL GLM_CONSTEXPR mat(mat<4, 4, T, P> const& m); + + GLM_FUNC_DECL explicit GLM_CONSTEXPR mat(T const& x); + GLM_FUNC_DECL GLM_CONSTEXPR mat( + T const& x0, T const& y0, T const& z0, T const& w0, + T const& x1, T const& y1, T const& z1, T const& w1, + T const& x2, T const& y2, T const& z2, T const& w2, + T const& x3, T const& y3, T const& z3, T const& w3); + GLM_FUNC_DECL GLM_CONSTEXPR mat( + col_type const& v0, + col_type const& v1, + col_type const& v2, + col_type const& v3); + + // -- Conversions -- + + template< + typename X1, typename Y1, typename Z1, typename W1, + typename X2, typename Y2, typename Z2, typename W2, + typename X3, typename Y3, typename Z3, typename W3, + typename X4, typename Y4, typename Z4, typename W4> + GLM_FUNC_DECL GLM_CONSTEXPR mat( + X1 const& x1, Y1 const& y1, Z1 const& z1, W1 const& w1, + X2 const& x2, Y2 const& y2, Z2 const& z2, W2 const& w2, + X3 const& x3, Y3 const& y3, Z3 const& z3, W3 const& w3, + X4 const& x4, Y4 const& y4, Z4 const& z4, W4 const& w4); + + template + GLM_FUNC_DECL GLM_CONSTEXPR mat( + vec<4, V1, Q> const& v1, + vec<4, V2, Q> const& v2, + vec<4, V3, Q> const& v3, + vec<4, V4, Q> const& v4); + + // -- Matrix conversions -- + + template + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 4, U, P> const& m); + + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 2, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 3, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 3, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 2, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 4, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 2, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 4, T, Q> const& x); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 3, T, Q> const& x); + + // -- Unary arithmetic operators -- + + template + GLM_FUNC_DECL mat<4, 4, T, Q> & operator=(mat<4, 4, U, Q> const& m); + template + GLM_FUNC_DECL mat<4, 4, T, Q> & operator+=(U s); + template + GLM_FUNC_DECL mat<4, 4, T, Q> & operator+=(mat<4, 4, U, Q> const& m); + template + GLM_FUNC_DECL mat<4, 4, T, Q> & operator-=(U s); + template + GLM_FUNC_DECL mat<4, 4, T, Q> & operator-=(mat<4, 4, U, Q> const& m); + template + GLM_FUNC_DECL mat<4, 4, T, Q> & operator*=(U s); + template + GLM_FUNC_DECL mat<4, 4, T, Q> & operator*=(mat<4, 4, U, Q> const& m); + template + GLM_FUNC_DECL mat<4, 4, T, Q> & operator/=(U s); + template + GLM_FUNC_DECL mat<4, 4, T, Q> & operator/=(mat<4, 4, U, Q> const& m); + + // -- Increment and decrement operators -- + + GLM_FUNC_DECL mat<4, 4, T, Q> & operator++(); + GLM_FUNC_DECL mat<4, 4, T, Q> & operator--(); + GLM_FUNC_DECL mat<4, 4, T, Q> operator++(int); + GLM_FUNC_DECL mat<4, 4, T, Q> operator--(int); + }; + + // -- Unary operators -- + + template + GLM_FUNC_DECL mat<4, 4, T, Q> operator+(mat<4, 4, T, Q> const& m); + + template + GLM_FUNC_DECL mat<4, 4, T, Q> operator-(mat<4, 4, T, Q> const& m); + + // -- Binary operators -- + + template + GLM_FUNC_DECL mat<4, 4, T, Q> operator+(mat<4, 4, T, Q> const& m, T const& s); + + template + GLM_FUNC_DECL mat<4, 4, T, Q> operator+(T const& s, mat<4, 4, T, Q> const& m); + + template + GLM_FUNC_DECL mat<4, 4, T, Q> operator+(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2); + + template + GLM_FUNC_DECL mat<4, 4, T, Q> operator-(mat<4, 4, T, Q> const& m, T const& s); + + template + GLM_FUNC_DECL mat<4, 4, T, Q> operator-(T const& s, mat<4, 4, T, Q> const& m); + + template + GLM_FUNC_DECL mat<4, 4, T, Q> operator-(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2); + + template + GLM_FUNC_DECL mat<4, 4, T, Q> operator*(mat<4, 4, T, Q> const& m, T const& s); + + template + GLM_FUNC_DECL mat<4, 4, T, Q> operator*(T const& s, mat<4, 4, T, Q> const& m); + + template + GLM_FUNC_DECL typename mat<4, 4, T, Q>::col_type operator*(mat<4, 4, T, Q> const& m, typename mat<4, 4, T, Q>::row_type const& v); + + template + GLM_FUNC_DECL typename mat<4, 4, T, Q>::row_type operator*(typename mat<4, 4, T, Q>::col_type const& v, mat<4, 4, T, Q> const& m); + + template + GLM_FUNC_DECL mat<2, 4, T, Q> operator*(mat<4, 4, T, Q> const& m1, mat<2, 4, T, Q> const& m2); + + template + GLM_FUNC_DECL mat<3, 4, T, Q> operator*(mat<4, 4, T, Q> const& m1, mat<3, 4, T, Q> const& m2); + + template + GLM_FUNC_DECL mat<4, 4, T, Q> operator*(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2); + + template + GLM_FUNC_DECL mat<4, 4, T, Q> operator/(mat<4, 4, T, Q> const& m, T const& s); + + template + GLM_FUNC_DECL mat<4, 4, T, Q> operator/(T const& s, mat<4, 4, T, Q> const& m); + + template + GLM_FUNC_DECL typename mat<4, 4, T, Q>::col_type operator/(mat<4, 4, T, Q> const& m, typename mat<4, 4, T, Q>::row_type const& v); + + template + GLM_FUNC_DECL typename mat<4, 4, T, Q>::row_type operator/(typename mat<4, 4, T, Q>::col_type const& v, mat<4, 4, T, Q> const& m); + + template + GLM_FUNC_DECL mat<4, 4, T, Q> operator/(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2); + + // -- Boolean operators -- + + template + GLM_FUNC_DECL bool operator==(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2); + + template + GLM_FUNC_DECL bool operator!=(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2); +}//namespace glm + +#ifndef GLM_EXTERNAL_TEMPLATE +#include "type_mat4x4.inl" +#endif//GLM_EXTERNAL_TEMPLATE diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_mat4x4.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_mat4x4.inl new file mode 100644 index 0000000000000000000000000000000000000000..ceea30407ab5296ecf96fc3a3bb655cd407dea6b --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_mat4x4.inl @@ -0,0 +1,706 @@ +#include "../matrix.hpp" + +namespace glm +{ + // -- Constructors -- + +# if GLM_CONFIG_DEFAULTED_DEFAULT_CTOR == GLM_DISABLE + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q>::mat() +# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALIZER_LIST + : value{col_type(1, 0, 0, 0), col_type(0, 1, 0, 0), col_type(0, 0, 1, 0), col_type(0, 0, 0, 1)} +# endif + { +# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALISATION + this->value[0] = col_type(1, 0, 0, 0); + this->value[1] = col_type(0, 1, 0, 0); + this->value[2] = col_type(0, 0, 1, 0); + this->value[3] = col_type(0, 0, 0, 1); +# endif + } +# endif + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q>::mat(mat<4, 4, T, P> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(m[2]), col_type(m[3])} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = m[0]; + this->value[1] = m[1]; + this->value[2] = m[2]; + this->value[3] = m[3]; +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q>::mat(T const& s) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(s, 0, 0, 0), col_type(0, s, 0, 0), col_type(0, 0, s, 0), col_type(0, 0, 0, s)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(s, 0, 0, 0); + this->value[1] = col_type(0, s, 0, 0); + this->value[2] = col_type(0, 0, s, 0); + this->value[3] = col_type(0, 0, 0, s); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q>::mat + ( + T const& x0, T const& y0, T const& z0, T const& w0, + T const& x1, T const& y1, T const& z1, T const& w1, + T const& x2, T const& y2, T const& z2, T const& w2, + T const& x3, T const& y3, T const& z3, T const& w3 + ) +# if GLM_HAS_INITIALIZER_LISTS + : value{ + col_type(x0, y0, z0, w0), + col_type(x1, y1, z1, w1), + col_type(x2, y2, z2, w2), + col_type(x3, y3, z3, w3)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(x0, y0, z0, w0); + this->value[1] = col_type(x1, y1, z1, w1); + this->value[2] = col_type(x2, y2, z2, w2); + this->value[3] = col_type(x3, y3, z3, w3); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q>::mat(col_type const& v0, col_type const& v1, col_type const& v2, col_type const& v3) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(v0), col_type(v1), col_type(v2), col_type(v3)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = v0; + this->value[1] = v1; + this->value[2] = v2; + this->value[3] = v3; +# endif + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q>::mat(mat<4, 4, U, P> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(m[2]), col_type(m[3])} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0]); + this->value[1] = col_type(m[1]); + this->value[2] = col_type(m[2]); + this->value[3] = col_type(m[3]); +# endif + } + + // -- Conversions -- + + template + template< + typename X1, typename Y1, typename Z1, typename W1, + typename X2, typename Y2, typename Z2, typename W2, + typename X3, typename Y3, typename Z3, typename W3, + typename X4, typename Y4, typename Z4, typename W4> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q>::mat + ( + X1 const& x1, Y1 const& y1, Z1 const& z1, W1 const& w1, + X2 const& x2, Y2 const& y2, Z2 const& z2, W2 const& w2, + X3 const& x3, Y3 const& y3, Z3 const& z3, W3 const& w3, + X4 const& x4, Y4 const& y4, Z4 const& z4, W4 const& w4 + ) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(x1, y1, z1, w1), col_type(x2, y2, z2, w2), col_type(x3, y3, z3, w3), col_type(x4, y4, z4, w4)} +# endif + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 1st parameter type invalid."); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 2nd parameter type invalid."); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 3rd parameter type invalid."); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 4th parameter type invalid."); + + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 5th parameter type invalid."); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 6th parameter type invalid."); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 7th parameter type invalid."); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 8th parameter type invalid."); + + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 9th parameter type invalid."); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 10th parameter type invalid."); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 11th parameter type invalid."); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 12th parameter type invalid."); + + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 13th parameter type invalid."); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 14th parameter type invalid."); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 15th parameter type invalid."); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 16th parameter type invalid."); + +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(x1, y1, z1, w1); + this->value[1] = col_type(x2, y2, z2, w2); + this->value[2] = col_type(x3, y3, z3, w3); + this->value[3] = col_type(x4, y4, z4, w4); +# endif + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q>::mat(vec<4, V1, Q> const& v1, vec<4, V2, Q> const& v2, vec<4, V3, Q> const& v3, vec<4, V4, Q> const& v4) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(v1), col_type(v2), col_type(v3), col_type(v4)} +# endif + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 1st parameter type invalid."); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 2nd parameter type invalid."); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 3rd parameter type invalid."); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 4th parameter type invalid."); + +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(v1); + this->value[1] = col_type(v2); + this->value[2] = col_type(v3); + this->value[3] = col_type(v4); +# endif + } + + // -- Matrix conversions -- + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q>::mat(mat<2, 2, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0], 0, 0), col_type(m[1], 0, 0), col_type(0, 0, 1, 0), col_type(0, 0, 0, 1)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0], 0, 0); + this->value[1] = col_type(m[1], 0, 0); + this->value[2] = col_type(0, 0, 1, 0); + this->value[3] = col_type(0, 0, 0, 1); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q>::mat(mat<3, 3, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0], 0), col_type(m[1], 0), col_type(m[2], 0), col_type(0, 0, 0, 1)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0], 0); + this->value[1] = col_type(m[1], 0); + this->value[2] = col_type(m[2], 0); + this->value[3] = col_type(0, 0, 0, 1); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q>::mat(mat<2, 3, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0], 0), col_type(m[1], 0), col_type(0, 0, 1, 0), col_type(0, 0, 0, 1)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0], 0); + this->value[1] = col_type(m[1], 0); + this->value[2] = col_type(0, 0, 1, 0); + this->value[3] = col_type(0, 0, 0, 1); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q>::mat(mat<3, 2, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0], 0, 0), col_type(m[1], 0, 0), col_type(m[2], 1, 0), col_type(0, 0, 0, 1)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0], 0, 0); + this->value[1] = col_type(m[1], 0, 0); + this->value[2] = col_type(m[2], 1, 0); + this->value[3] = col_type(0, 0, 0, 1); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q>::mat(mat<2, 4, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(0, 0, 1, 0), col_type(0, 0, 0, 1)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = m[0]; + this->value[1] = m[1]; + this->value[2] = col_type(0, 0, 1, 0); + this->value[3] = col_type(0, 0, 0, 1); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q>::mat(mat<4, 2, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0], 0, 0), col_type(m[1], 0, 0), col_type(0, 0, 1, 0), col_type(0, 0, 0, 1)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0], 0, 0); + this->value[1] = col_type(m[1], 0, 0); + this->value[2] = col_type(0, 0, 1, 0); + this->value[3] = col_type(0, 0, 0, 1); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q>::mat(mat<3, 4, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0]), col_type(m[1]), col_type(m[2]), col_type(0, 0, 0, 1)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = m[0]; + this->value[1] = m[1]; + this->value[2] = m[2]; + this->value[3] = col_type(0, 0, 0, 1); +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q>::mat(mat<4, 3, T, Q> const& m) +# if GLM_HAS_INITIALIZER_LISTS + : value{col_type(m[0], 0), col_type(m[1], 0), col_type(m[2], 0), col_type(m[3], 1)} +# endif + { +# if !GLM_HAS_INITIALIZER_LISTS + this->value[0] = col_type(m[0], 0); + this->value[1] = col_type(m[1], 0); + this->value[2] = col_type(m[2], 0); + this->value[3] = col_type(m[3], 1); +# endif + } + + // -- Accesses -- + + template + GLM_FUNC_QUALIFIER typename mat<4, 4, T, Q>::col_type & mat<4, 4, T, Q>::operator[](typename mat<4, 4, T, Q>::length_type i) GLM_NOEXCEPT + { + assert(i < this->length()); + return this->value[i]; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<4, 4, T, Q>::col_type const& mat<4, 4, T, Q>::operator[](typename mat<4, 4, T, Q>::length_type i) const GLM_NOEXCEPT + { + assert(i < this->length()); + return this->value[i]; + } + + // -- Unary arithmetic operators -- + + template + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q>& mat<4, 4, T, Q>::operator=(mat<4, 4, U, Q> const& m) + { + //memcpy could be faster + //memcpy(&this->value, &m.value, 16 * sizeof(valType)); + this->value[0] = m[0]; + this->value[1] = m[1]; + this->value[2] = m[2]; + this->value[3] = m[3]; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q>& mat<4, 4, T, Q>::operator+=(U s) + { + this->value[0] += s; + this->value[1] += s; + this->value[2] += s; + this->value[3] += s; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q>& mat<4, 4, T, Q>::operator+=(mat<4, 4, U, Q> const& m) + { + this->value[0] += m[0]; + this->value[1] += m[1]; + this->value[2] += m[2]; + this->value[3] += m[3]; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> & mat<4, 4, T, Q>::operator-=(U s) + { + this->value[0] -= s; + this->value[1] -= s; + this->value[2] -= s; + this->value[3] -= s; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> & mat<4, 4, T, Q>::operator-=(mat<4, 4, U, Q> const& m) + { + this->value[0] -= m[0]; + this->value[1] -= m[1]; + this->value[2] -= m[2]; + this->value[3] -= m[3]; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> & mat<4, 4, T, Q>::operator*=(U s) + { + this->value[0] *= s; + this->value[1] *= s; + this->value[2] *= s; + this->value[3] *= s; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> & mat<4, 4, T, Q>::operator*=(mat<4, 4, U, Q> const& m) + { + return (*this = *this * m); + } + + template + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> & mat<4, 4, T, Q>::operator/=(U s) + { + this->value[0] /= s; + this->value[1] /= s; + this->value[2] /= s; + this->value[3] /= s; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> & mat<4, 4, T, Q>::operator/=(mat<4, 4, U, Q> const& m) + { + return *this *= inverse(m); + } + + // -- Increment and decrement operators -- + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> & mat<4, 4, T, Q>::operator++() + { + ++this->value[0]; + ++this->value[1]; + ++this->value[2]; + ++this->value[3]; + return *this; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> & mat<4, 4, T, Q>::operator--() + { + --this->value[0]; + --this->value[1]; + --this->value[2]; + --this->value[3]; + return *this; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> mat<4, 4, T, Q>::operator++(int) + { + mat<4, 4, T, Q> Result(*this); + ++*this; + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> mat<4, 4, T, Q>::operator--(int) + { + mat<4, 4, T, Q> Result(*this); + --*this; + return Result; + } + + // -- Unary constant operators -- + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> operator+(mat<4, 4, T, Q> const& m) + { + return m; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> operator-(mat<4, 4, T, Q> const& m) + { + return mat<4, 4, T, Q>( + -m[0], + -m[1], + -m[2], + -m[3]); + } + + // -- Binary arithmetic operators -- + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> operator+(mat<4, 4, T, Q> const& m, T const& s) + { + return mat<4, 4, T, Q>( + m[0] + s, + m[1] + s, + m[2] + s, + m[3] + s); + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> operator+(T const& s, mat<4, 4, T, Q> const& m) + { + return mat<4, 4, T, Q>( + m[0] + s, + m[1] + s, + m[2] + s, + m[3] + s); + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> operator+(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2) + { + return mat<4, 4, T, Q>( + m1[0] + m2[0], + m1[1] + m2[1], + m1[2] + m2[2], + m1[3] + m2[3]); + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> operator-(mat<4, 4, T, Q> const& m, T const& s) + { + return mat<4, 4, T, Q>( + m[0] - s, + m[1] - s, + m[2] - s, + m[3] - s); + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> operator-(T const& s, mat<4, 4, T, Q> const& m) + { + return mat<4, 4, T, Q>( + s - m[0], + s - m[1], + s - m[2], + s - m[3]); + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> operator-(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2) + { + return mat<4, 4, T, Q>( + m1[0] - m2[0], + m1[1] - m2[1], + m1[2] - m2[2], + m1[3] - m2[3]); + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> operator*(mat<4, 4, T, Q> const& m, T const & s) + { + return mat<4, 4, T, Q>( + m[0] * s, + m[1] * s, + m[2] * s, + m[3] * s); + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> operator*(T const& s, mat<4, 4, T, Q> const& m) + { + return mat<4, 4, T, Q>( + m[0] * s, + m[1] * s, + m[2] * s, + m[3] * s); + } + + template + GLM_FUNC_QUALIFIER typename mat<4, 4, T, Q>::col_type operator* + ( + mat<4, 4, T, Q> const& m, + typename mat<4, 4, T, Q>::row_type const& v + ) + { +/* + __m128 v0 = _mm_shuffle_ps(v.data, v.data, _MM_SHUFFLE(0, 0, 0, 0)); + __m128 v1 = _mm_shuffle_ps(v.data, v.data, _MM_SHUFFLE(1, 1, 1, 1)); + __m128 v2 = _mm_shuffle_ps(v.data, v.data, _MM_SHUFFLE(2, 2, 2, 2)); + __m128 v3 = _mm_shuffle_ps(v.data, v.data, _MM_SHUFFLE(3, 3, 3, 3)); + + __m128 m0 = _mm_mul_ps(m[0].data, v0); + __m128 m1 = _mm_mul_ps(m[1].data, v1); + __m128 a0 = _mm_add_ps(m0, m1); + + __m128 m2 = _mm_mul_ps(m[2].data, v2); + __m128 m3 = _mm_mul_ps(m[3].data, v3); + __m128 a1 = _mm_add_ps(m2, m3); + + __m128 a2 = _mm_add_ps(a0, a1); + + return typename mat<4, 4, T, Q>::col_type(a2); +*/ + + typename mat<4, 4, T, Q>::col_type const Mov0(v[0]); + typename mat<4, 4, T, Q>::col_type const Mov1(v[1]); + typename mat<4, 4, T, Q>::col_type const Mul0 = m[0] * Mov0; + typename mat<4, 4, T, Q>::col_type const Mul1 = m[1] * Mov1; + typename mat<4, 4, T, Q>::col_type const Add0 = Mul0 + Mul1; + typename mat<4, 4, T, Q>::col_type const Mov2(v[2]); + typename mat<4, 4, T, Q>::col_type const Mov3(v[3]); + typename mat<4, 4, T, Q>::col_type const Mul2 = m[2] * Mov2; + typename mat<4, 4, T, Q>::col_type const Mul3 = m[3] * Mov3; + typename mat<4, 4, T, Q>::col_type const Add1 = Mul2 + Mul3; + typename mat<4, 4, T, Q>::col_type const Add2 = Add0 + Add1; + return Add2; + +/* + return typename mat<4, 4, T, Q>::col_type( + m[0][0] * v[0] + m[1][0] * v[1] + m[2][0] * v[2] + m[3][0] * v[3], + m[0][1] * v[0] + m[1][1] * v[1] + m[2][1] * v[2] + m[3][1] * v[3], + m[0][2] * v[0] + m[1][2] * v[1] + m[2][2] * v[2] + m[3][2] * v[3], + m[0][3] * v[0] + m[1][3] * v[1] + m[2][3] * v[2] + m[3][3] * v[3]); +*/ + } + + template + GLM_FUNC_QUALIFIER typename mat<4, 4, T, Q>::row_type operator* + ( + typename mat<4, 4, T, Q>::col_type const& v, + mat<4, 4, T, Q> const& m + ) + { + return typename mat<4, 4, T, Q>::row_type( + m[0][0] * v[0] + m[0][1] * v[1] + m[0][2] * v[2] + m[0][3] * v[3], + m[1][0] * v[0] + m[1][1] * v[1] + m[1][2] * v[2] + m[1][3] * v[3], + m[2][0] * v[0] + m[2][1] * v[1] + m[2][2] * v[2] + m[2][3] * v[3], + m[3][0] * v[0] + m[3][1] * v[1] + m[3][2] * v[2] + m[3][3] * v[3]); + } + + template + GLM_FUNC_QUALIFIER mat<2, 4, T, Q> operator*(mat<4, 4, T, Q> const& m1, mat<2, 4, T, Q> const& m2) + { + return mat<2, 4, T, Q>( + m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2] + m1[3][0] * m2[0][3], + m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2] + m1[3][1] * m2[0][3], + m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1] + m1[2][2] * m2[0][2] + m1[3][2] * m2[0][3], + m1[0][3] * m2[0][0] + m1[1][3] * m2[0][1] + m1[2][3] * m2[0][2] + m1[3][3] * m2[0][3], + m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1] + m1[2][0] * m2[1][2] + m1[3][0] * m2[1][3], + m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1] + m1[2][1] * m2[1][2] + m1[3][1] * m2[1][3], + m1[0][2] * m2[1][0] + m1[1][2] * m2[1][1] + m1[2][2] * m2[1][2] + m1[3][2] * m2[1][3], + m1[0][3] * m2[1][0] + m1[1][3] * m2[1][1] + m1[2][3] * m2[1][2] + m1[3][3] * m2[1][3]); + } + + template + GLM_FUNC_QUALIFIER mat<3, 4, T, Q> operator*(mat<4, 4, T, Q> const& m1, mat<3, 4, T, Q> const& m2) + { + return mat<3, 4, T, Q>( + m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2] + m1[3][0] * m2[0][3], + m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2] + m1[3][1] * m2[0][3], + m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1] + m1[2][2] * m2[0][2] + m1[3][2] * m2[0][3], + m1[0][3] * m2[0][0] + m1[1][3] * m2[0][1] + m1[2][3] * m2[0][2] + m1[3][3] * m2[0][3], + m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1] + m1[2][0] * m2[1][2] + m1[3][0] * m2[1][3], + m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1] + m1[2][1] * m2[1][2] + m1[3][1] * m2[1][3], + m1[0][2] * m2[1][0] + m1[1][2] * m2[1][1] + m1[2][2] * m2[1][2] + m1[3][2] * m2[1][3], + m1[0][3] * m2[1][0] + m1[1][3] * m2[1][1] + m1[2][3] * m2[1][2] + m1[3][3] * m2[1][3], + m1[0][0] * m2[2][0] + m1[1][0] * m2[2][1] + m1[2][0] * m2[2][2] + m1[3][0] * m2[2][3], + m1[0][1] * m2[2][0] + m1[1][1] * m2[2][1] + m1[2][1] * m2[2][2] + m1[3][1] * m2[2][3], + m1[0][2] * m2[2][0] + m1[1][2] * m2[2][1] + m1[2][2] * m2[2][2] + m1[3][2] * m2[2][3], + m1[0][3] * m2[2][0] + m1[1][3] * m2[2][1] + m1[2][3] * m2[2][2] + m1[3][3] * m2[2][3]); + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> operator*(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2) + { + typename mat<4, 4, T, Q>::col_type const SrcA0 = m1[0]; + typename mat<4, 4, T, Q>::col_type const SrcA1 = m1[1]; + typename mat<4, 4, T, Q>::col_type const SrcA2 = m1[2]; + typename mat<4, 4, T, Q>::col_type const SrcA3 = m1[3]; + + typename mat<4, 4, T, Q>::col_type const SrcB0 = m2[0]; + typename mat<4, 4, T, Q>::col_type const SrcB1 = m2[1]; + typename mat<4, 4, T, Q>::col_type const SrcB2 = m2[2]; + typename mat<4, 4, T, Q>::col_type const SrcB3 = m2[3]; + + mat<4, 4, T, Q> Result; + Result[0] = SrcA0 * SrcB0[0] + SrcA1 * SrcB0[1] + SrcA2 * SrcB0[2] + SrcA3 * SrcB0[3]; + Result[1] = SrcA0 * SrcB1[0] + SrcA1 * SrcB1[1] + SrcA2 * SrcB1[2] + SrcA3 * SrcB1[3]; + Result[2] = SrcA0 * SrcB2[0] + SrcA1 * SrcB2[1] + SrcA2 * SrcB2[2] + SrcA3 * SrcB2[3]; + Result[3] = SrcA0 * SrcB3[0] + SrcA1 * SrcB3[1] + SrcA2 * SrcB3[2] + SrcA3 * SrcB3[3]; + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> operator/(mat<4, 4, T, Q> const& m, T const& s) + { + return mat<4, 4, T, Q>( + m[0] / s, + m[1] / s, + m[2] / s, + m[3] / s); + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> operator/(T const& s, mat<4, 4, T, Q> const& m) + { + return mat<4, 4, T, Q>( + s / m[0], + s / m[1], + s / m[2], + s / m[3]); + } + + template + GLM_FUNC_QUALIFIER typename mat<4, 4, T, Q>::col_type operator/(mat<4, 4, T, Q> const& m, typename mat<4, 4, T, Q>::row_type const& v) + { + return inverse(m) * v; + } + + template + GLM_FUNC_QUALIFIER typename mat<4, 4, T, Q>::row_type operator/(typename mat<4, 4, T, Q>::col_type const& v, mat<4, 4, T, Q> const& m) + { + return v * inverse(m); + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> operator/(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2) + { + mat<4, 4, T, Q> m1_copy(m1); + return m1_copy /= m2; + } + + // -- Boolean operators -- + + template + GLM_FUNC_QUALIFIER bool operator==(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2) + { + return (m1[0] == m2[0]) && (m1[1] == m2[1]) && (m1[2] == m2[2]) && (m1[3] == m2[3]); + } + + template + GLM_FUNC_QUALIFIER bool operator!=(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2) + { + return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]) || (m1[3] != m2[3]); + } +}//namespace glm + +#if GLM_CONFIG_SIMD == GLM_ENABLE +# include "type_mat4x4_simd.inl" +#endif diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_mat4x4_simd.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_mat4x4_simd.inl new file mode 100644 index 0000000000000000000000000000000000000000..c4ba07260662f65cb2ffbaaab6346326ea850331 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_mat4x4_simd.inl @@ -0,0 +1,6 @@ +/// @ref core + +namespace glm +{ + +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_quat.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_quat.hpp new file mode 100644 index 0000000000000000000000000000000000000000..04f7812d2597120ff7d32a2bec340742c208f94a --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_quat.hpp @@ -0,0 +1,191 @@ +/// @ref core +/// @file glm/detail/type_quat.hpp + +#pragma once + +// Dependency: +#include "../detail/type_mat3x3.hpp" +#include "../detail/type_mat4x4.hpp" +#include "../detail/type_vec3.hpp" +#include "../detail/type_vec4.hpp" +#include "../ext/vector_relational.hpp" +#include "../ext/quaternion_relational.hpp" +#include "../gtc/constants.hpp" +#include "../gtc/matrix_transform.hpp" + +namespace glm +{ + template + struct qua + { + // -- Implementation detail -- + + typedef qua type; + typedef T value_type; + + // -- Data -- + +# if GLM_SILENT_WARNINGS == GLM_ENABLE +# if GLM_COMPILER & GLM_COMPILER_GCC +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wpedantic" +# elif GLM_COMPILER & GLM_COMPILER_CLANG +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wgnu-anonymous-struct" +# pragma clang diagnostic ignored "-Wnested-anon-types" +# elif GLM_COMPILER & GLM_COMPILER_VC +# pragma warning(push) +# pragma warning(disable: 4201) // nonstandard extension used : nameless struct/union +# endif +# endif + +# if GLM_LANG & GLM_LANG_CXXMS_FLAG + union + { +# ifdef GLM_FORCE_QUAT_DATA_XYZW + struct { T x, y, z, w; }; +# else + struct { T w, x, y, z; }; +# endif + + typename detail::storage<4, T, detail::is_aligned::value>::type data; + }; +# else +# ifdef GLM_FORCE_QUAT_DATA_XYZW + T x, y, z, w; +# else + T w, x, y, z; +# endif +# endif + +# if GLM_SILENT_WARNINGS == GLM_ENABLE +# if GLM_COMPILER & GLM_COMPILER_CLANG +# pragma clang diagnostic pop +# elif GLM_COMPILER & GLM_COMPILER_GCC +# pragma GCC diagnostic pop +# elif GLM_COMPILER & GLM_COMPILER_VC +# pragma warning(pop) +# endif +# endif + + // -- Component accesses -- + + typedef length_t length_type; + + /// Return the count of components of a quaternion + GLM_FUNC_DECL static GLM_CONSTEXPR length_type length(){return 4;} + + GLM_FUNC_DECL GLM_CONSTEXPR T & operator[](length_type i); + GLM_FUNC_DECL GLM_CONSTEXPR T const& operator[](length_type i) const; + + // -- Implicit basic constructors -- + + GLM_FUNC_DECL GLM_CONSTEXPR qua() GLM_DEFAULT_CTOR; + GLM_FUNC_DECL GLM_CONSTEXPR qua(qua const& q) GLM_DEFAULT; + template + GLM_FUNC_DECL GLM_CONSTEXPR qua(qua const& q); + + // -- Explicit basic constructors -- + + GLM_FUNC_DECL GLM_CONSTEXPR qua(T s, vec<3, T, Q> const& v); + +# ifdef GLM_FORCE_QUAT_DATA_XYZW + GLM_FUNC_DECL GLM_CONSTEXPR qua(T x, T y, T z, T w); +# else + GLM_FUNC_DECL GLM_CONSTEXPR qua(T w, T x, T y, T z); +# endif + + // -- Conversion constructors -- + + template + GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT qua(qua const& q); + + /// Explicit conversion operators +# if GLM_HAS_EXPLICIT_CONVERSION_OPERATORS + GLM_FUNC_DECL explicit operator mat<3, 3, T, Q>() const; + GLM_FUNC_DECL explicit operator mat<4, 4, T, Q>() const; +# endif + + /// Create a quaternion from two normalized axis + /// + /// @param u A first normalized axis + /// @param v A second normalized axis + /// @see gtc_quaternion + /// @see http://lolengine.net/blog/2013/09/18/beautiful-maths-quaternion-from-vectors + GLM_FUNC_DECL qua(vec<3, T, Q> const& u, vec<3, T, Q> const& v); + + /// Build a quaternion from euler angles (pitch, yaw, roll), in radians. + GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT qua(vec<3, T, Q> const& eulerAngles); + GLM_FUNC_DECL GLM_EXPLICIT qua(mat<3, 3, T, Q> const& q); + GLM_FUNC_DECL GLM_EXPLICIT qua(mat<4, 4, T, Q> const& q); + + // -- Unary arithmetic operators -- + + GLM_FUNC_DECL GLM_CONSTEXPR qua& operator=(qua const& q) GLM_DEFAULT; + + template + GLM_FUNC_DECL GLM_CONSTEXPR qua& operator=(qua const& q); + template + GLM_FUNC_DECL GLM_CONSTEXPR qua& operator+=(qua const& q); + template + GLM_FUNC_DECL GLM_CONSTEXPR qua& operator-=(qua const& q); + template + GLM_FUNC_DECL GLM_CONSTEXPR qua& operator*=(qua const& q); + template + GLM_FUNC_DECL GLM_CONSTEXPR qua& operator*=(U s); + template + GLM_FUNC_DECL GLM_CONSTEXPR qua& operator/=(U s); + }; + + // -- Unary bit operators -- + + template + GLM_FUNC_DECL GLM_CONSTEXPR qua operator+(qua const& q); + + template + GLM_FUNC_DECL GLM_CONSTEXPR qua operator-(qua const& q); + + // -- Binary operators -- + + template + GLM_FUNC_DECL GLM_CONSTEXPR qua operator+(qua const& q, qua const& p); + + template + GLM_FUNC_DECL GLM_CONSTEXPR qua operator-(qua const& q, qua const& p); + + template + GLM_FUNC_DECL GLM_CONSTEXPR qua operator*(qua const& q, qua const& p); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator*(qua const& q, vec<3, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator*(vec<3, T, Q> const& v, qua const& q); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator*(qua const& q, vec<4, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator*(vec<4, T, Q> const& v, qua const& q); + + template + GLM_FUNC_DECL GLM_CONSTEXPR qua operator*(qua const& q, T const& s); + + template + GLM_FUNC_DECL GLM_CONSTEXPR qua operator*(T const& s, qua const& q); + + template + GLM_FUNC_DECL GLM_CONSTEXPR qua operator/(qua const& q, T const& s); + + // -- Boolean operators -- + + template + GLM_FUNC_DECL GLM_CONSTEXPR bool operator==(qua const& q1, qua const& q2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR bool operator!=(qua const& q1, qua const& q2); +} //namespace glm + +#ifndef GLM_EXTERNAL_TEMPLATE +#include "type_quat.inl" +#endif//GLM_EXTERNAL_TEMPLATE diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_quat.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_quat.inl new file mode 100644 index 0000000000000000000000000000000000000000..15dee69158e59826cfaaf134dab4a055a2b77bf5 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_quat.inl @@ -0,0 +1,412 @@ +#include "../trigonometric.hpp" +#include "../exponential.hpp" +#include "../ext/quaternion_common.hpp" +#include "../ext/quaternion_geometric.hpp" +#include + +namespace glm{ +namespace detail +{ + template + struct genTypeTrait > + { + static const genTypeEnum GENTYPE = GENTYPE_QUAT; + }; + + template + struct compute_dot, T, Aligned> + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static T call(qua const& a, qua const& b) + { + vec<4, T, Q> tmp(a.w * b.w, a.x * b.x, a.y * b.y, a.z * b.z); + return (tmp.x + tmp.y) + (tmp.z + tmp.w); + } + }; + + template + struct compute_quat_add + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static qua call(qua const& q, qua const& p) + { + return qua(q.w + p.w, q.x + p.x, q.y + p.y, q.z + p.z); + } + }; + + template + struct compute_quat_sub + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static qua call(qua const& q, qua const& p) + { + return qua(q.w - p.w, q.x - p.x, q.y - p.y, q.z - p.z); + } + }; + + template + struct compute_quat_mul_scalar + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static qua call(qua const& q, T s) + { + return qua(q.w * s, q.x * s, q.y * s, q.z * s); + } + }; + + template + struct compute_quat_div_scalar + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static qua call(qua const& q, T s) + { + return qua(q.w / s, q.x / s, q.y / s, q.z / s); + } + }; + + template + struct compute_quat_mul_vec4 + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec<4, T, Q> call(qua const& q, vec<4, T, Q> const& v) + { + return vec<4, T, Q>(q * vec<3, T, Q>(v), v.w); + } + }; +}//namespace detail + + // -- Component accesses -- + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR T & qua::operator[](typename qua::length_type i) + { + assert(i >= 0 && i < this->length()); +# ifdef GLM_FORCE_QUAT_DATA_XYZW + return (&x)[i]; +# else + return (&w)[i]; +# endif + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR T const& qua::operator[](typename qua::length_type i) const + { + assert(i >= 0 && i < this->length()); +# ifdef GLM_FORCE_QUAT_DATA_XYZW + return (&x)[i]; +# else + return (&w)[i]; +# endif + } + + // -- Implicit basic constructors -- + +# if GLM_CONFIG_DEFAULTED_DEFAULT_CTOR == GLM_DISABLE + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua::qua() +# if GLM_CONFIG_CTOR_INIT != GLM_CTOR_INIT_DISABLE +# ifdef GLM_FORCE_QUAT_DATA_XYZW + : x(0), y(0), z(0), w(1) +# else + : w(1), x(0), y(0), z(0) +# endif +# endif + {} +# endif + +# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua::qua(qua const& q) +# ifdef GLM_FORCE_QUAT_DATA_XYZW + : x(q.x), y(q.y), z(q.z), w(q.w) +# else + : w(q.w), x(q.x), y(q.y), z(q.z) +# endif + {} +# endif + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua::qua(qua const& q) +# ifdef GLM_FORCE_QUAT_DATA_XYZW + : x(q.x), y(q.y), z(q.z), w(q.w) +# else + : w(q.w), x(q.x), y(q.y), z(q.z) +# endif + {} + + // -- Explicit basic constructors -- + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua::qua(T s, vec<3, T, Q> const& v) +# ifdef GLM_FORCE_QUAT_DATA_XYZW + : x(v.x), y(v.y), z(v.z), w(s) +# else + : w(s), x(v.x), y(v.y), z(v.z) +# endif + {} + + template +# ifdef GLM_FORCE_QUAT_DATA_XYZW + GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua::qua(T _x, T _y, T _z, T _w) + : x(_x), y(_y), z(_z), w(_w) +# else + GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua::qua(T _w, T _x, T _y, T _z) + : w(_w), x(_x), y(_y), z(_z) +# endif + {} + + // -- Conversion constructors -- + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua::qua(qua const& q) +# ifdef GLM_FORCE_QUAT_DATA_XYZW + : x(static_cast(q.x)), y(static_cast(q.y)), z(static_cast(q.z)), w(static_cast(q.w)) +# else + : w(static_cast(q.w)), x(static_cast(q.x)), y(static_cast(q.y)), z(static_cast(q.z)) +# endif + {} + + //template + //GLM_FUNC_QUALIFIER qua::qua + //( + // valType const& pitch, + // valType const& yaw, + // valType const& roll + //) + //{ + // vec<3, valType> eulerAngle(pitch * valType(0.5), yaw * valType(0.5), roll * valType(0.5)); + // vec<3, valType> c = glm::cos(eulerAngle * valType(0.5)); + // vec<3, valType> s = glm::sin(eulerAngle * valType(0.5)); + // + // this->w = c.x * c.y * c.z + s.x * s.y * s.z; + // this->x = s.x * c.y * c.z - c.x * s.y * s.z; + // this->y = c.x * s.y * c.z + s.x * c.y * s.z; + // this->z = c.x * c.y * s.z - s.x * s.y * c.z; + //} + + template + GLM_FUNC_QUALIFIER qua::qua(vec<3, T, Q> const& u, vec<3, T, Q> const& v) + { + T norm_u_norm_v = sqrt(dot(u, u) * dot(v, v)); + T real_part = norm_u_norm_v + dot(u, v); + vec<3, T, Q> t; + + if(real_part < static_cast(1.e-6f) * norm_u_norm_v) + { + // If u and v are exactly opposite, rotate 180 degrees + // around an arbitrary orthogonal axis. Axis normalisation + // can happen later, when we normalise the quaternion. + real_part = static_cast(0); + t = abs(u.x) > abs(u.z) ? vec<3, T, Q>(-u.y, u.x, static_cast(0)) : vec<3, T, Q>(static_cast(0), -u.z, u.y); + } + else + { + // Otherwise, build quaternion the standard way. + t = cross(u, v); + } + + *this = normalize(qua(real_part, t.x, t.y, t.z)); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua::qua(vec<3, T, Q> const& eulerAngle) + { + vec<3, T, Q> c = glm::cos(eulerAngle * T(0.5)); + vec<3, T, Q> s = glm::sin(eulerAngle * T(0.5)); + + this->w = c.x * c.y * c.z + s.x * s.y * s.z; + this->x = s.x * c.y * c.z - c.x * s.y * s.z; + this->y = c.x * s.y * c.z + s.x * c.y * s.z; + this->z = c.x * c.y * s.z - s.x * s.y * c.z; + } + + template + GLM_FUNC_QUALIFIER qua::qua(mat<3, 3, T, Q> const& m) + { + *this = quat_cast(m); + } + + template + GLM_FUNC_QUALIFIER qua::qua(mat<4, 4, T, Q> const& m) + { + *this = quat_cast(m); + } + +# if GLM_HAS_EXPLICIT_CONVERSION_OPERATORS + template + GLM_FUNC_QUALIFIER qua::operator mat<3, 3, T, Q>() const + { + return mat3_cast(*this); + } + + template + GLM_FUNC_QUALIFIER qua::operator mat<4, 4, T, Q>() const + { + return mat4_cast(*this); + } +# endif//GLM_HAS_EXPLICIT_CONVERSION_OPERATORS + + // -- Unary arithmetic operators -- + +# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua & qua::operator=(qua const& q) + { + this->w = q.w; + this->x = q.x; + this->y = q.y; + this->z = q.z; + return *this; + } +# endif + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua & qua::operator=(qua const& q) + { + this->w = static_cast(q.w); + this->x = static_cast(q.x); + this->y = static_cast(q.y); + this->z = static_cast(q.z); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua & qua::operator+=(qua const& q) + { + return (*this = detail::compute_quat_add::value>::call(*this, qua(q))); + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua & qua::operator-=(qua const& q) + { + return (*this = detail::compute_quat_sub::value>::call(*this, qua(q))); + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua & qua::operator*=(qua const& r) + { + qua const p(*this); + qua const q(r); + + this->w = p.w * q.w - p.x * q.x - p.y * q.y - p.z * q.z; + this->x = p.w * q.x + p.x * q.w + p.y * q.z - p.z * q.y; + this->y = p.w * q.y + p.y * q.w + p.z * q.x - p.x * q.z; + this->z = p.w * q.z + p.z * q.w + p.x * q.y - p.y * q.x; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua & qua::operator*=(U s) + { + return (*this = detail::compute_quat_mul_scalar::value>::call(*this, static_cast(s))); + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua & qua::operator/=(U s) + { + return (*this = detail::compute_quat_div_scalar::value>::call(*this, static_cast(s))); + } + + // -- Unary bit operators -- + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua operator+(qua const& q) + { + return q; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua operator-(qua const& q) + { + return qua(-q.w, -q.x, -q.y, -q.z); + } + + // -- Binary operators -- + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua operator+(qua const& q, qua const& p) + { + return qua(q) += p; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua operator-(qua const& q, qua const& p) + { + return qua(q) -= p; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua operator*(qua const& q, qua const& p) + { + return qua(q) *= p; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator*(qua const& q, vec<3, T, Q> const& v) + { + vec<3, T, Q> const QuatVector(q.x, q.y, q.z); + vec<3, T, Q> const uv(glm::cross(QuatVector, v)); + vec<3, T, Q> const uuv(glm::cross(QuatVector, uv)); + + return v + ((uv * q.w) + uuv) * static_cast(2); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator*(vec<3, T, Q> const& v, qua const& q) + { + return glm::inverse(q) * v; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator*(qua const& q, vec<4, T, Q> const& v) + { + return detail::compute_quat_mul_vec4::value>::call(q, v); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator*(vec<4, T, Q> const& v, qua const& q) + { + return glm::inverse(q) * v; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua operator*(qua const& q, T const& s) + { + return qua( + q.w * s, q.x * s, q.y * s, q.z * s); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua operator*(T const& s, qua const& q) + { + return q * s; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua operator/(qua const& q, T const& s) + { + return qua( + q.w / s, q.x / s, q.y / s, q.z / s); + } + + // -- Boolean operators -- + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator==(qua const& q1, qua const& q2) + { + return q1.x == q2.x && q1.y == q2.y && q1.z == q2.z && q1.w == q2.w; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator!=(qua const& q1, qua const& q2) + { + return q1.x != q2.x || q1.y != q2.y || q1.z != q2.z || q1.w != q2.w; + } +}//namespace glm + +#if GLM_CONFIG_SIMD == GLM_ENABLE +# include "type_quat_simd.inl" +#endif + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_quat_simd.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_quat_simd.inl new file mode 100644 index 0000000000000000000000000000000000000000..25a30748aa7f81d1e46e296cf5531663ae02f3d8 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_quat_simd.inl @@ -0,0 +1,187 @@ +/// @ref core + +#if GLM_ARCH & GLM_ARCH_SSE2_BIT + +namespace glm{ +namespace detail +{ +/* + template + struct compute_quat_mul + { + static qua call(qua const& q1, qua const& q2) + { + // SSE2 STATS: 11 shuffle, 8 mul, 8 add + // SSE4 STATS: 3 shuffle, 4 mul, 4 dpps + + __m128 const mul0 = _mm_mul_ps(q1.data, _mm_shuffle_ps(q2.data, q2.data, _MM_SHUFFLE(0, 1, 2, 3))); + __m128 const mul1 = _mm_mul_ps(q1.data, _mm_shuffle_ps(q2.data, q2.data, _MM_SHUFFLE(1, 0, 3, 2))); + __m128 const mul2 = _mm_mul_ps(q1.data, _mm_shuffle_ps(q2.data, q2.data, _MM_SHUFFLE(2, 3, 0, 1))); + __m128 const mul3 = _mm_mul_ps(q1.data, q2.data); + +# if GLM_ARCH & GLM_ARCH_SSE41_BIT + __m128 const add0 = _mm_dp_ps(mul0, _mm_set_ps(1.0f, -1.0f, 1.0f, 1.0f), 0xff); + __m128 const add1 = _mm_dp_ps(mul1, _mm_set_ps(1.0f, 1.0f, 1.0f, -1.0f), 0xff); + __m128 const add2 = _mm_dp_ps(mul2, _mm_set_ps(1.0f, 1.0f, -1.0f, 1.0f), 0xff); + __m128 const add3 = _mm_dp_ps(mul3, _mm_set_ps(1.0f, -1.0f, -1.0f, -1.0f), 0xff); +# else + __m128 const mul4 = _mm_mul_ps(mul0, _mm_set_ps(1.0f, -1.0f, 1.0f, 1.0f)); + __m128 const add0 = _mm_add_ps(mul0, _mm_movehl_ps(mul4, mul4)); + __m128 const add4 = _mm_add_ss(add0, _mm_shuffle_ps(add0, add0, 1)); + + __m128 const mul5 = _mm_mul_ps(mul1, _mm_set_ps(1.0f, 1.0f, 1.0f, -1.0f)); + __m128 const add1 = _mm_add_ps(mul1, _mm_movehl_ps(mul5, mul5)); + __m128 const add5 = _mm_add_ss(add1, _mm_shuffle_ps(add1, add1, 1)); + + __m128 const mul6 = _mm_mul_ps(mul2, _mm_set_ps(1.0f, 1.0f, -1.0f, 1.0f)); + __m128 const add2 = _mm_add_ps(mul6, _mm_movehl_ps(mul6, mul6)); + __m128 const add6 = _mm_add_ss(add2, _mm_shuffle_ps(add2, add2, 1)); + + __m128 const mul7 = _mm_mul_ps(mul3, _mm_set_ps(1.0f, -1.0f, -1.0f, -1.0f)); + __m128 const add3 = _mm_add_ps(mul3, _mm_movehl_ps(mul7, mul7)); + __m128 const add7 = _mm_add_ss(add3, _mm_shuffle_ps(add3, add3, 1)); + #endif + + // This SIMD code is a politically correct way of doing this, but in every test I've tried it has been slower than + // the final code below. I'll keep this here for reference - maybe somebody else can do something better... + // + //__m128 xxyy = _mm_shuffle_ps(add4, add5, _MM_SHUFFLE(0, 0, 0, 0)); + //__m128 zzww = _mm_shuffle_ps(add6, add7, _MM_SHUFFLE(0, 0, 0, 0)); + // + //return _mm_shuffle_ps(xxyy, zzww, _MM_SHUFFLE(2, 0, 2, 0)); + + qua Result; + _mm_store_ss(&Result.x, add4); + _mm_store_ss(&Result.y, add5); + _mm_store_ss(&Result.z, add6); + _mm_store_ss(&Result.w, add7); + return Result; + } + }; +*/ + + template + struct compute_quat_add + { + static qua call(qua const& q, qua const& p) + { + qua Result; + Result.data = _mm_add_ps(q.data, p.data); + return Result; + } + }; + +# if GLM_ARCH & GLM_ARCH_AVX_BIT + template + struct compute_quat_add + { + static qua call(qua const& a, qua const& b) + { + qua Result; + Result.data = _mm256_add_pd(a.data, b.data); + return Result; + } + }; +# endif + + template + struct compute_quat_sub + { + static qua call(qua const& q, qua const& p) + { + qua Result; + Result.data = _mm_sub_ps(q.data, p.data); + return Result; + } + }; + +# if GLM_ARCH & GLM_ARCH_AVX_BIT + template + struct compute_quat_sub + { + static qua call(qua const& a, qua const& b) + { + qua Result; + Result.data = _mm256_sub_pd(a.data, b.data); + return Result; + } + }; +# endif + + template + struct compute_quat_mul_scalar + { + static qua call(qua const& q, float s) + { + vec<4, float, Q> Result; + Result.data = _mm_mul_ps(q.data, _mm_set_ps1(s)); + return Result; + } + }; + +# if GLM_ARCH & GLM_ARCH_AVX_BIT + template + struct compute_quat_mul_scalar + { + static qua call(qua const& q, double s) + { + qua Result; + Result.data = _mm256_mul_pd(q.data, _mm_set_ps1(s)); + return Result; + } + }; +# endif + + template + struct compute_quat_div_scalar + { + static qua call(qua const& q, float s) + { + vec<4, float, Q> Result; + Result.data = _mm_div_ps(q.data, _mm_set_ps1(s)); + return Result; + } + }; + +# if GLM_ARCH & GLM_ARCH_AVX_BIT + template + struct compute_quat_div_scalar + { + static qua call(qua const& q, double s) + { + qua Result; + Result.data = _mm256_div_pd(q.data, _mm_set_ps1(s)); + return Result; + } + }; +# endif + + template + struct compute_quat_mul_vec4 + { + static vec<4, float, Q> call(qua const& q, vec<4, float, Q> const& v) + { + __m128 const q_wwww = _mm_shuffle_ps(q.data, q.data, _MM_SHUFFLE(3, 3, 3, 3)); + __m128 const q_swp0 = _mm_shuffle_ps(q.data, q.data, _MM_SHUFFLE(3, 0, 2, 1)); + __m128 const q_swp1 = _mm_shuffle_ps(q.data, q.data, _MM_SHUFFLE(3, 1, 0, 2)); + __m128 const v_swp0 = _mm_shuffle_ps(v.data, v.data, _MM_SHUFFLE(3, 0, 2, 1)); + __m128 const v_swp1 = _mm_shuffle_ps(v.data, v.data, _MM_SHUFFLE(3, 1, 0, 2)); + + __m128 uv = _mm_sub_ps(_mm_mul_ps(q_swp0, v_swp1), _mm_mul_ps(q_swp1, v_swp0)); + __m128 uv_swp0 = _mm_shuffle_ps(uv, uv, _MM_SHUFFLE(3, 0, 2, 1)); + __m128 uv_swp1 = _mm_shuffle_ps(uv, uv, _MM_SHUFFLE(3, 1, 0, 2)); + __m128 uuv = _mm_sub_ps(_mm_mul_ps(q_swp0, uv_swp1), _mm_mul_ps(q_swp1, uv_swp0)); + + __m128 const two = _mm_set1_ps(2.0f); + uv = _mm_mul_ps(uv, _mm_mul_ps(q_wwww, two)); + uuv = _mm_mul_ps(uuv, two); + + vec<4, float, Q> Result; + Result.data = _mm_add_ps(v.data, _mm_add_ps(uv, uuv)); + return Result; + } + }; +}//namespace detail +}//namespace glm + +#endif//GLM_ARCH & GLM_ARCH_SSE2_BIT diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_vec1.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_vec1.hpp new file mode 100644 index 0000000000000000000000000000000000000000..add6bcbc449eb3dcbd2b13f3add5a01223a049b6 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_vec1.hpp @@ -0,0 +1,308 @@ +/// @ref core +/// @file glm/detail/type_vec1.hpp + +#pragma once + +#include "qualifier.hpp" +#if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR +# include "_swizzle.hpp" +#elif GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION +# include "_swizzle_func.hpp" +#endif +#include + +namespace glm +{ + template + struct vec<1, T, Q> + { + // -- Implementation detail -- + + typedef T value_type; + typedef vec<1, T, Q> type; + typedef vec<1, bool, Q> bool_type; + + // -- Data -- + +# if GLM_SILENT_WARNINGS == GLM_ENABLE +# if GLM_COMPILER & GLM_COMPILER_GCC +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wpedantic" +# elif GLM_COMPILER & GLM_COMPILER_CLANG +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wgnu-anonymous-struct" +# pragma clang diagnostic ignored "-Wnested-anon-types" +# elif GLM_COMPILER & GLM_COMPILER_VC +# pragma warning(push) +# pragma warning(disable: 4201) // nonstandard extension used : nameless struct/union +# endif +# endif + +# if GLM_CONFIG_XYZW_ONLY + T x; +# elif GLM_CONFIG_ANONYMOUS_STRUCT == GLM_ENABLE + union + { + T x; + T r; + T s; + + typename detail::storage<1, T, detail::is_aligned::value>::type data; +/* +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR + _GLM_SWIZZLE1_2_MEMBERS(T, Q, x) + _GLM_SWIZZLE1_2_MEMBERS(T, Q, r) + _GLM_SWIZZLE1_2_MEMBERS(T, Q, s) + _GLM_SWIZZLE1_3_MEMBERS(T, Q, x) + _GLM_SWIZZLE1_3_MEMBERS(T, Q, r) + _GLM_SWIZZLE1_3_MEMBERS(T, Q, s) + _GLM_SWIZZLE1_4_MEMBERS(T, Q, x) + _GLM_SWIZZLE1_4_MEMBERS(T, Q, r) + _GLM_SWIZZLE1_4_MEMBERS(T, Q, s) +# endif +*/ + }; +# else + union {T x, r, s;}; +/* +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION + GLM_SWIZZLE_GEN_VEC_FROM_VEC1(T, Q) +# endif +*/ +# endif + +# if GLM_SILENT_WARNINGS == GLM_ENABLE +# if GLM_COMPILER & GLM_COMPILER_CLANG +# pragma clang diagnostic pop +# elif GLM_COMPILER & GLM_COMPILER_GCC +# pragma GCC diagnostic pop +# elif GLM_COMPILER & GLM_COMPILER_VC +# pragma warning(pop) +# endif +# endif + + // -- Component accesses -- + + /// Return the count of components of the vector + typedef length_t length_type; + GLM_FUNC_DECL static GLM_CONSTEXPR length_type length(){return 1;} + + GLM_FUNC_DECL GLM_CONSTEXPR T & operator[](length_type i); + GLM_FUNC_DECL GLM_CONSTEXPR T const& operator[](length_type i) const; + + // -- Implicit basic constructors -- + + GLM_FUNC_DECL GLM_CONSTEXPR vec() GLM_DEFAULT_CTOR; + GLM_FUNC_DECL GLM_CONSTEXPR vec(vec const& v) GLM_DEFAULT; + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, T, P> const& v); + + // -- Explicit basic constructors -- + + GLM_FUNC_DECL GLM_CONSTEXPR explicit vec(T scalar); + + // -- Conversion vector constructors -- + + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<2, U, P> const& v); + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<3, U, P> const& v); + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<4, U, P> const& v); + + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<1, U, P> const& v); + + // -- Swizzle constructors -- +/* +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(detail::_swizzle<1, T, Q, E0, -1,-2,-3> const& that) + { + *this = that(); + } +# endif//GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR +*/ + // -- Unary arithmetic operators -- + + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator=(vec const& v) GLM_DEFAULT; + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator=(vec<1, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator+=(U scalar); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator+=(vec<1, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator-=(U scalar); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator-=(vec<1, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator*=(U scalar); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator*=(vec<1, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator/=(U scalar); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator/=(vec<1, U, Q> const& v); + + // -- Increment and decrement operators -- + + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator++(); + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator--(); + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator++(int); + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator--(int); + + // -- Unary bit operators -- + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator%=(U scalar); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator%=(vec<1, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator&=(U scalar); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator&=(vec<1, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator|=(U scalar); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator|=(vec<1, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator^=(U scalar); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator^=(vec<1, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator<<=(U scalar); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator<<=(vec<1, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator>>=(U scalar); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator>>=(vec<1, U, Q> const& v); + }; + + // -- Unary operators -- + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator+(vec<1, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator-(vec<1, T, Q> const& v); + + // -- Binary operators -- + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator+(vec<1, T, Q> const& v, T scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator+(T scalar, vec<1, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator+(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator-(vec<1, T, Q> const& v, T scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator-(T scalar, vec<1, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator-(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator*(vec<1, T, Q> const& v, T scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator*(T scalar, vec<1, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator*(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator/(vec<1, T, Q> const& v, T scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator/(T scalar, vec<1, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator/(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator%(vec<1, T, Q> const& v, T scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator%(T scalar, vec<1, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator%(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator&(vec<1, T, Q> const& v, T scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator&(T scalar, vec<1, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator&(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator|(vec<1, T, Q> const& v, T scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator|(T scalar, vec<1, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator|(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator^(vec<1, T, Q> const& v, T scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator^(T scalar, vec<1, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator^(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator<<(vec<1, T, Q> const& v, T scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator<<(T scalar, vec<1, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator<<(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator>>(vec<1, T, Q> const& v, T scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator>>(T scalar, vec<1, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator>>(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator~(vec<1, T, Q> const& v); + + // -- Boolean operators -- + + template + GLM_FUNC_DECL GLM_CONSTEXPR bool operator==(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR bool operator!=(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, bool, Q> operator&&(vec<1, bool, Q> const& v1, vec<1, bool, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<1, bool, Q> operator||(vec<1, bool, Q> const& v1, vec<1, bool, Q> const& v2); +}//namespace glm + +#ifndef GLM_EXTERNAL_TEMPLATE +#include "type_vec1.inl" +#endif//GLM_EXTERNAL_TEMPLATE diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_vec1.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_vec1.inl new file mode 100644 index 0000000000000000000000000000000000000000..c5ed53033efacd6dec0af0b89e52ed9e6bc9ce81 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_vec1.inl @@ -0,0 +1,553 @@ +/// @ref core + +#include "./compute_vector_relational.hpp" + +namespace glm +{ + // -- Implicit basic constructors -- + +# if GLM_CONFIG_DEFAULTED_DEFAULT_CTOR == GLM_DISABLE + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q>::vec() +# if GLM_CONFIG_CTOR_INIT != GLM_CTOR_INIT_DISABLE + : x(0) +# endif + {} +# endif + +# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q>::vec(vec<1, T, Q> const& v) + : x(v.x) + {} +# endif + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q>::vec(vec<1, T, P> const& v) + : x(v.x) + {} + + // -- Explicit basic constructors -- + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q>::vec(T scalar) + : x(scalar) + {} + + // -- Conversion vector constructors -- + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q>::vec(vec<1, U, P> const& v) + : x(static_cast(v.x)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q>::vec(vec<2, U, P> const& v) + : x(static_cast(v.x)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q>::vec(vec<3, U, P> const& v) + : x(static_cast(v.x)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q>::vec(vec<4, U, P> const& v) + : x(static_cast(v.x)) + {} + + // -- Component accesses -- + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR T & vec<1, T, Q>::operator[](typename vec<1, T, Q>::length_type) + { + return x; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR T const& vec<1, T, Q>::operator[](typename vec<1, T, Q>::length_type) const + { + return x; + } + + // -- Unary arithmetic operators -- + +# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator=(vec<1, T, Q> const& v) + { + this->x = v.x; + return *this; + } +# endif + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator=(vec<1, U, Q> const& v) + { + this->x = static_cast(v.x); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator+=(U scalar) + { + this->x += static_cast(scalar); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator+=(vec<1, U, Q> const& v) + { + this->x += static_cast(v.x); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator-=(U scalar) + { + this->x -= static_cast(scalar); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator-=(vec<1, U, Q> const& v) + { + this->x -= static_cast(v.x); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator*=(U scalar) + { + this->x *= static_cast(scalar); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator*=(vec<1, U, Q> const& v) + { + this->x *= static_cast(v.x); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator/=(U scalar) + { + this->x /= static_cast(scalar); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator/=(vec<1, U, Q> const& v) + { + this->x /= static_cast(v.x); + return *this; + } + + // -- Increment and decrement operators -- + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator++() + { + ++this->x; + return *this; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator--() + { + --this->x; + return *this; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> vec<1, T, Q>::operator++(int) + { + vec<1, T, Q> Result(*this); + ++*this; + return Result; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> vec<1, T, Q>::operator--(int) + { + vec<1, T, Q> Result(*this); + --*this; + return Result; + } + + // -- Unary bit operators -- + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator%=(U scalar) + { + this->x %= static_cast(scalar); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator%=(vec<1, U, Q> const& v) + { + this->x %= static_cast(v.x); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator&=(U scalar) + { + this->x &= static_cast(scalar); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator&=(vec<1, U, Q> const& v) + { + this->x &= static_cast(v.x); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator|=(U scalar) + { + this->x |= static_cast(scalar); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator|=(vec<1, U, Q> const& v) + { + this->x |= static_cast(v.x); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator^=(U scalar) + { + this->x ^= static_cast(scalar); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator^=(vec<1, U, Q> const& v) + { + this->x ^= static_cast(v.x); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator<<=(U scalar) + { + this->x <<= static_cast(scalar); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator<<=(vec<1, U, Q> const& v) + { + this->x <<= static_cast(v.x); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator>>=(U scalar) + { + this->x >>= static_cast(scalar); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator>>=(vec<1, U, Q> const& v) + { + this->x >>= static_cast(v.x); + return *this; + } + + // -- Unary constant operators -- + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator+(vec<1, T, Q> const& v) + { + return v; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator-(vec<1, T, Q> const& v) + { + return vec<1, T, Q>( + -v.x); + } + + // -- Binary arithmetic operators -- + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator+(vec<1, T, Q> const& v, T scalar) + { + return vec<1, T, Q>( + v.x + scalar); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator+(T scalar, vec<1, T, Q> const& v) + { + return vec<1, T, Q>( + scalar + v.x); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator+(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2) + { + return vec<1, T, Q>( + v1.x + v2.x); + } + + //operator- + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator-(vec<1, T, Q> const& v, T scalar) + { + return vec<1, T, Q>( + v.x - scalar); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator-(T scalar, vec<1, T, Q> const& v) + { + return vec<1, T, Q>( + scalar - v.x); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator-(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2) + { + return vec<1, T, Q>( + v1.x - v2.x); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator*(vec<1, T, Q> const& v, T scalar) + { + return vec<1, T, Q>( + v.x * scalar); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator*(T scalar, vec<1, T, Q> const& v) + { + return vec<1, T, Q>( + scalar * v.x); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator*(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2) + { + return vec<1, T, Q>( + v1.x * v2.x); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator/(vec<1, T, Q> const& v, T scalar) + { + return vec<1, T, Q>( + v.x / scalar); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator/(T scalar, vec<1, T, Q> const& v) + { + return vec<1, T, Q>( + scalar / v.x); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator/(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2) + { + return vec<1, T, Q>( + v1.x / v2.x); + } + + // -- Binary bit operators -- + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator%(vec<1, T, Q> const& v, T scalar) + { + return vec<1, T, Q>( + v.x % scalar); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator%(T scalar, vec<1, T, Q> const& v) + { + return vec<1, T, Q>( + scalar % v.x); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator%(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2) + { + return vec<1, T, Q>( + v1.x % v2.x); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator&(vec<1, T, Q> const& v, T scalar) + { + return vec<1, T, Q>( + v.x & scalar); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator&(T scalar, vec<1, T, Q> const& v) + { + return vec<1, T, Q>( + scalar & v.x); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator&(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2) + { + return vec<1, T, Q>( + v1.x & v2.x); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator|(vec<1, T, Q> const& v, T scalar) + { + return vec<1, T, Q>( + v.x | scalar); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator|(T scalar, vec<1, T, Q> const& v) + { + return vec<1, T, Q>( + scalar | v.x); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator|(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2) + { + return vec<1, T, Q>( + v1.x | v2.x); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator^(vec<1, T, Q> const& v, T scalar) + { + return vec<1, T, Q>( + v.x ^ scalar); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator^(T scalar, vec<1, T, Q> const& v) + { + return vec<1, T, Q>( + scalar ^ v.x); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator^(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2) + { + return vec<1, T, Q>( + v1.x ^ v2.x); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator<<(vec<1, T, Q> const& v, T scalar) + { + return vec<1, T, Q>( + static_cast(v.x << scalar)); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator<<(T scalar, vec<1, T, Q> const& v) + { + return vec<1, T, Q>( + static_cast(scalar << v.x)); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator<<(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2) + { + return vec<1, T, Q>( + static_cast(v1.x << v2.x)); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator>>(vec<1, T, Q> const& v, T scalar) + { + return vec<1, T, Q>( + static_cast(v.x >> scalar)); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator>>(T scalar, vec<1, T, Q> const& v) + { + return vec<1, T, Q>( + static_cast(scalar >> v.x)); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator>>(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2) + { + return vec<1, T, Q>( + static_cast(v1.x >> v2.x)); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator~(vec<1, T, Q> const& v) + { + return vec<1, T, Q>( + ~v.x); + } + + // -- Boolean operators -- + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator==(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2) + { + return detail::compute_equal::is_iec559>::call(v1.x, v2.x); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator!=(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2) + { + return !(v1 == v2); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, bool, Q> operator&&(vec<1, bool, Q> const& v1, vec<1, bool, Q> const& v2) + { + return vec<1, bool, Q>(v1.x && v2.x); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, bool, Q> operator||(vec<1, bool, Q> const& v1, vec<1, bool, Q> const& v2) + { + return vec<1, bool, Q>(v1.x || v2.x); + } +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_vec2.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_vec2.hpp new file mode 100644 index 0000000000000000000000000000000000000000..090e0ca52f47e0099c52dd27291690111a2ff4b1 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_vec2.hpp @@ -0,0 +1,402 @@ +/// @ref core +/// @file glm/detail/type_vec2.hpp + +#pragma once + +#include "qualifier.hpp" +#if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR +# include "_swizzle.hpp" +#elif GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION +# include "_swizzle_func.hpp" +#endif +#include + +namespace glm +{ + template + struct vec<2, T, Q> + { + // -- Implementation detail -- + + typedef T value_type; + typedef vec<2, T, Q> type; + typedef vec<2, bool, Q> bool_type; + + // -- Data -- + +# if GLM_SILENT_WARNINGS == GLM_ENABLE +# if GLM_COMPILER & GLM_COMPILER_GCC +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wpedantic" +# elif GLM_COMPILER & GLM_COMPILER_CLANG +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wgnu-anonymous-struct" +# pragma clang diagnostic ignored "-Wnested-anon-types" +# elif GLM_COMPILER & GLM_COMPILER_VC +# pragma warning(push) +# pragma warning(disable: 4201) // nonstandard extension used : nameless struct/union +# endif +# endif + +# if GLM_CONFIG_XYZW_ONLY + T x, y; +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION + GLM_SWIZZLE_GEN_VEC_FROM_VEC2_COMP(T, Q, x, y) +# endif//GLM_CONFIG_SWIZZLE +# elif GLM_CONFIG_ANONYMOUS_STRUCT == GLM_ENABLE + union + { + struct{ T x, y; }; + struct{ T r, g; }; + struct{ T s, t; }; + + typename detail::storage<2, T, detail::is_aligned::value>::type data; + +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR + GLM_SWIZZLE2_2_MEMBERS(T, Q, x, y) + GLM_SWIZZLE2_2_MEMBERS(T, Q, r, g) + GLM_SWIZZLE2_2_MEMBERS(T, Q, s, t) + GLM_SWIZZLE2_3_MEMBERS(T, Q, x, y) + GLM_SWIZZLE2_3_MEMBERS(T, Q, r, g) + GLM_SWIZZLE2_3_MEMBERS(T, Q, s, t) + GLM_SWIZZLE2_4_MEMBERS(T, Q, x, y) + GLM_SWIZZLE2_4_MEMBERS(T, Q, r, g) + GLM_SWIZZLE2_4_MEMBERS(T, Q, s, t) +# endif + }; +# else + union {T x, r, s;}; + union {T y, g, t;}; + +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION + GLM_SWIZZLE_GEN_VEC_FROM_VEC2(T, Q) +# endif//GLM_CONFIG_SWIZZLE +# endif + +# if GLM_SILENT_WARNINGS == GLM_ENABLE +# if GLM_COMPILER & GLM_COMPILER_CLANG +# pragma clang diagnostic pop +# elif GLM_COMPILER & GLM_COMPILER_GCC +# pragma GCC diagnostic pop +# elif GLM_COMPILER & GLM_COMPILER_VC +# pragma warning(pop) +# endif +# endif + + // -- Component accesses -- + + /// Return the count of components of the vector + typedef length_t length_type; + GLM_FUNC_DECL static GLM_CONSTEXPR length_type length(){return 2;} + + GLM_FUNC_DECL GLM_CONSTEXPR T& operator[](length_type i); + GLM_FUNC_DECL GLM_CONSTEXPR T const& operator[](length_type i) const; + + // -- Implicit basic constructors -- + + GLM_FUNC_DECL GLM_CONSTEXPR vec() GLM_DEFAULT_CTOR; + GLM_FUNC_DECL GLM_CONSTEXPR vec(vec const& v) GLM_DEFAULT; + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<2, T, P> const& v); + + // -- Explicit basic constructors -- + + GLM_FUNC_DECL GLM_CONSTEXPR explicit vec(T scalar); + GLM_FUNC_DECL GLM_CONSTEXPR vec(T x, T y); + + // -- Conversion constructors -- + + template + GLM_FUNC_DECL GLM_CONSTEXPR explicit vec(vec<1, U, P> const& v); + + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(A x, B y); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, A, Q> const& x, B y); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(A x, vec<1, B, Q> const& y); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, A, Q> const& x, vec<1, B, Q> const& y); + + // -- Conversion vector constructors -- + + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<3, U, P> const& v); + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<4, U, P> const& v); + + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<2, U, P> const& v); + + // -- Swizzle constructors -- +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(detail::_swizzle<2, T, Q, E0, E1,-1,-2> const& that) + { + *this = that(); + } +# endif//GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR + + // -- Unary arithmetic operators -- + + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator=(vec const& v) GLM_DEFAULT; + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator=(vec<2, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator+=(U scalar); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator+=(vec<1, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator+=(vec<2, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator-=(U scalar); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator-=(vec<1, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator-=(vec<2, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator*=(U scalar); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator*=(vec<1, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator*=(vec<2, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator/=(U scalar); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator/=(vec<1, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator/=(vec<2, U, Q> const& v); + + // -- Increment and decrement operators -- + + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator++(); + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator--(); + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator++(int); + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator--(int); + + // -- Unary bit operators -- + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator%=(U scalar); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator%=(vec<1, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator%=(vec<2, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator&=(U scalar); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator&=(vec<1, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator&=(vec<2, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator|=(U scalar); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator|=(vec<1, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator|=(vec<2, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator^=(U scalar); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator^=(vec<1, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator^=(vec<2, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator<<=(U scalar); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator<<=(vec<1, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator<<=(vec<2, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator>>=(U scalar); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator>>=(vec<1, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator>>=(vec<2, U, Q> const& v); + }; + + // -- Unary operators -- + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator+(vec<2, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator-(vec<2, T, Q> const& v); + + // -- Binary operators -- + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator+(vec<2, T, Q> const& v, T scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator+(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator+(T scalar, vec<2, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator+(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator+(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator-(vec<2, T, Q> const& v, T scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator-(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator-(T scalar, vec<2, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator-(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator-(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator*(vec<2, T, Q> const& v, T scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator*(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator*(T scalar, vec<2, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator*(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator*(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator/(vec<2, T, Q> const& v, T scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator/(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator/(T scalar, vec<2, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator/(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator/(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator%(vec<2, T, Q> const& v, T scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator%(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator%(T scalar, vec<2, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator%(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator%(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator&(vec<2, T, Q> const& v, T scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator&(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator&(T scalar, vec<2, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator&(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator&(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator|(vec<2, T, Q> const& v, T scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator|(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator|(T scalar, vec<2, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator|(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator|(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator^(vec<2, T, Q> const& v, T scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator^(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator^(T scalar, vec<2, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator^(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator^(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator<<(vec<2, T, Q> const& v, T scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator<<(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator<<(T scalar, vec<2, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator<<(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator<<(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator>>(vec<2, T, Q> const& v, T scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator>>(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator>>(T scalar, vec<2, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator>>(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator>>(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator~(vec<2, T, Q> const& v); + + // -- Boolean operators -- + + template + GLM_FUNC_DECL GLM_CONSTEXPR bool operator==(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR bool operator!=(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, bool, Q> operator&&(vec<2, bool, Q> const& v1, vec<2, bool, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<2, bool, Q> operator||(vec<2, bool, Q> const& v1, vec<2, bool, Q> const& v2); +}//namespace glm + +#ifndef GLM_EXTERNAL_TEMPLATE +#include "type_vec2.inl" +#endif//GLM_EXTERNAL_TEMPLATE diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_vec2.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_vec2.inl new file mode 100644 index 0000000000000000000000000000000000000000..07385d600a85528d7345fd722a4b1ec6a05a5868 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_vec2.inl @@ -0,0 +1,915 @@ +/// @ref core + +#include "./compute_vector_relational.hpp" + +namespace glm +{ + // -- Implicit basic constructors -- + +# if GLM_CONFIG_DEFAULTED_DEFAULT_CTOR == GLM_DISABLE + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q>::vec() +# if GLM_CONFIG_CTOR_INIT != GLM_CTOR_INIT_DISABLE + : x(0), y(0) +# endif + {} +# endif + +# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q>::vec(vec<2, T, Q> const& v) + : x(v.x), y(v.y) + {} +# endif + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q>::vec(vec<2, T, P> const& v) + : x(v.x), y(v.y) + {} + + // -- Explicit basic constructors -- + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q>::vec(T scalar) + : x(scalar), y(scalar) + {} + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q>::vec(T _x, T _y) + : x(_x), y(_y) + {} + + // -- Conversion scalar constructors -- + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q>::vec(vec<1, U, P> const& v) + : x(static_cast(v.x)) + , y(static_cast(v.x)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q>::vec(A _x, B _y) + : x(static_cast(_x)) + , y(static_cast(_y)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q>::vec(vec<1, A, Q> const& _x, B _y) + : x(static_cast(_x.x)) + , y(static_cast(_y)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q>::vec(A _x, vec<1, B, Q> const& _y) + : x(static_cast(_x)) + , y(static_cast(_y.x)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q>::vec(vec<1, A, Q> const& _x, vec<1, B, Q> const& _y) + : x(static_cast(_x.x)) + , y(static_cast(_y.x)) + {} + + // -- Conversion vector constructors -- + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q>::vec(vec<2, U, P> const& v) + : x(static_cast(v.x)) + , y(static_cast(v.y)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q>::vec(vec<3, U, P> const& v) + : x(static_cast(v.x)) + , y(static_cast(v.y)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q>::vec(vec<4, U, P> const& v) + : x(static_cast(v.x)) + , y(static_cast(v.y)) + {} + + // -- Component accesses -- + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR T & vec<2, T, Q>::operator[](typename vec<2, T, Q>::length_type i) + { + assert(i >= 0 && i < this->length()); + switch(i) + { + default: + case 0: + return x; + case 1: + return y; + } + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR T const& vec<2, T, Q>::operator[](typename vec<2, T, Q>::length_type i) const + { + assert(i >= 0 && i < this->length()); + switch(i) + { + default: + case 0: + return x; + case 1: + return y; + } + } + + // -- Unary arithmetic operators -- + +# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator=(vec<2, T, Q> const& v) + { + this->x = v.x; + this->y = v.y; + return *this; + } +# endif + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator=(vec<2, U, Q> const& v) + { + this->x = static_cast(v.x); + this->y = static_cast(v.y); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator+=(U scalar) + { + this->x += static_cast(scalar); + this->y += static_cast(scalar); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator+=(vec<1, U, Q> const& v) + { + this->x += static_cast(v.x); + this->y += static_cast(v.x); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator+=(vec<2, U, Q> const& v) + { + this->x += static_cast(v.x); + this->y += static_cast(v.y); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator-=(U scalar) + { + this->x -= static_cast(scalar); + this->y -= static_cast(scalar); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator-=(vec<1, U, Q> const& v) + { + this->x -= static_cast(v.x); + this->y -= static_cast(v.x); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator-=(vec<2, U, Q> const& v) + { + this->x -= static_cast(v.x); + this->y -= static_cast(v.y); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator*=(U scalar) + { + this->x *= static_cast(scalar); + this->y *= static_cast(scalar); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator*=(vec<1, U, Q> const& v) + { + this->x *= static_cast(v.x); + this->y *= static_cast(v.x); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator*=(vec<2, U, Q> const& v) + { + this->x *= static_cast(v.x); + this->y *= static_cast(v.y); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator/=(U scalar) + { + this->x /= static_cast(scalar); + this->y /= static_cast(scalar); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator/=(vec<1, U, Q> const& v) + { + this->x /= static_cast(v.x); + this->y /= static_cast(v.x); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator/=(vec<2, U, Q> const& v) + { + this->x /= static_cast(v.x); + this->y /= static_cast(v.y); + return *this; + } + + // -- Increment and decrement operators -- + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator++() + { + ++this->x; + ++this->y; + return *this; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator--() + { + --this->x; + --this->y; + return *this; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> vec<2, T, Q>::operator++(int) + { + vec<2, T, Q> Result(*this); + ++*this; + return Result; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> vec<2, T, Q>::operator--(int) + { + vec<2, T, Q> Result(*this); + --*this; + return Result; + } + + // -- Unary bit operators -- + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator%=(U scalar) + { + this->x %= static_cast(scalar); + this->y %= static_cast(scalar); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator%=(vec<1, U, Q> const& v) + { + this->x %= static_cast(v.x); + this->y %= static_cast(v.x); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator%=(vec<2, U, Q> const& v) + { + this->x %= static_cast(v.x); + this->y %= static_cast(v.y); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator&=(U scalar) + { + this->x &= static_cast(scalar); + this->y &= static_cast(scalar); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator&=(vec<1, U, Q> const& v) + { + this->x &= static_cast(v.x); + this->y &= static_cast(v.x); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator&=(vec<2, U, Q> const& v) + { + this->x &= static_cast(v.x); + this->y &= static_cast(v.y); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator|=(U scalar) + { + this->x |= static_cast(scalar); + this->y |= static_cast(scalar); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator|=(vec<1, U, Q> const& v) + { + this->x |= static_cast(v.x); + this->y |= static_cast(v.x); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator|=(vec<2, U, Q> const& v) + { + this->x |= static_cast(v.x); + this->y |= static_cast(v.y); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator^=(U scalar) + { + this->x ^= static_cast(scalar); + this->y ^= static_cast(scalar); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator^=(vec<1, U, Q> const& v) + { + this->x ^= static_cast(v.x); + this->y ^= static_cast(v.x); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator^=(vec<2, U, Q> const& v) + { + this->x ^= static_cast(v.x); + this->y ^= static_cast(v.y); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator<<=(U scalar) + { + this->x <<= static_cast(scalar); + this->y <<= static_cast(scalar); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator<<=(vec<1, U, Q> const& v) + { + this->x <<= static_cast(v.x); + this->y <<= static_cast(v.x); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator<<=(vec<2, U, Q> const& v) + { + this->x <<= static_cast(v.x); + this->y <<= static_cast(v.y); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator>>=(U scalar) + { + this->x >>= static_cast(scalar); + this->y >>= static_cast(scalar); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator>>=(vec<1, U, Q> const& v) + { + this->x >>= static_cast(v.x); + this->y >>= static_cast(v.x); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator>>=(vec<2, U, Q> const& v) + { + this->x >>= static_cast(v.x); + this->y >>= static_cast(v.y); + return *this; + } + + // -- Unary arithmetic operators -- + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator+(vec<2, T, Q> const& v) + { + return v; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator-(vec<2, T, Q> const& v) + { + return vec<2, T, Q>( + -v.x, + -v.y); + } + + // -- Binary arithmetic operators -- + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator+(vec<2, T, Q> const& v, T scalar) + { + return vec<2, T, Q>( + v.x + scalar, + v.y + scalar); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator+(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2) + { + return vec<2, T, Q>( + v1.x + v2.x, + v1.y + v2.x); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator+(T scalar, vec<2, T, Q> const& v) + { + return vec<2, T, Q>( + scalar + v.x, + scalar + v.y); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator+(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2) + { + return vec<2, T, Q>( + v1.x + v2.x, + v1.x + v2.y); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator+(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2) + { + return vec<2, T, Q>( + v1.x + v2.x, + v1.y + v2.y); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator-(vec<2, T, Q> const& v, T scalar) + { + return vec<2, T, Q>( + v.x - scalar, + v.y - scalar); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator-(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2) + { + return vec<2, T, Q>( + v1.x - v2.x, + v1.y - v2.x); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator-(T scalar, vec<2, T, Q> const& v) + { + return vec<2, T, Q>( + scalar - v.x, + scalar - v.y); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator-(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2) + { + return vec<2, T, Q>( + v1.x - v2.x, + v1.x - v2.y); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator-(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2) + { + return vec<2, T, Q>( + v1.x - v2.x, + v1.y - v2.y); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator*(vec<2, T, Q> const& v, T scalar) + { + return vec<2, T, Q>( + v.x * scalar, + v.y * scalar); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator*(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2) + { + return vec<2, T, Q>( + v1.x * v2.x, + v1.y * v2.x); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator*(T scalar, vec<2, T, Q> const& v) + { + return vec<2, T, Q>( + scalar * v.x, + scalar * v.y); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator*(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2) + { + return vec<2, T, Q>( + v1.x * v2.x, + v1.x * v2.y); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator*(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2) + { + return vec<2, T, Q>( + v1.x * v2.x, + v1.y * v2.y); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator/(vec<2, T, Q> const& v, T scalar) + { + return vec<2, T, Q>( + v.x / scalar, + v.y / scalar); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator/(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2) + { + return vec<2, T, Q>( + v1.x / v2.x, + v1.y / v2.x); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator/(T scalar, vec<2, T, Q> const& v) + { + return vec<2, T, Q>( + scalar / v.x, + scalar / v.y); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator/(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2) + { + return vec<2, T, Q>( + v1.x / v2.x, + v1.x / v2.y); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator/(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2) + { + return vec<2, T, Q>( + v1.x / v2.x, + v1.y / v2.y); + } + + // -- Binary bit operators -- + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator%(vec<2, T, Q> const& v, T scalar) + { + return vec<2, T, Q>( + v.x % scalar, + v.y % scalar); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator%(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2) + { + return vec<2, T, Q>( + v1.x % v2.x, + v1.y % v2.x); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator%(T scalar, vec<2, T, Q> const& v) + { + return vec<2, T, Q>( + scalar % v.x, + scalar % v.y); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator%(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2) + { + return vec<2, T, Q>( + v1.x % v2.x, + v1.x % v2.y); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator%(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2) + { + return vec<2, T, Q>( + v1.x % v2.x, + v1.y % v2.y); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator&(vec<2, T, Q> const& v, T scalar) + { + return vec<2, T, Q>( + v.x & scalar, + v.y & scalar); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator&(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2) + { + return vec<2, T, Q>( + v1.x & v2.x, + v1.y & v2.x); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator&(T scalar, vec<2, T, Q> const& v) + { + return vec<2, T, Q>( + scalar & v.x, + scalar & v.y); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator&(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2) + { + return vec<2, T, Q>( + v1.x & v2.x, + v1.x & v2.y); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator&(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2) + { + return vec<2, T, Q>( + v1.x & v2.x, + v1.y & v2.y); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator|(vec<2, T, Q> const& v, T scalar) + { + return vec<2, T, Q>( + v.x | scalar, + v.y | scalar); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator|(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2) + { + return vec<2, T, Q>( + v1.x | v2.x, + v1.y | v2.x); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator|(T scalar, vec<2, T, Q> const& v) + { + return vec<2, T, Q>( + scalar | v.x, + scalar | v.y); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator|(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2) + { + return vec<2, T, Q>( + v1.x | v2.x, + v1.x | v2.y); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator|(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2) + { + return vec<2, T, Q>( + v1.x | v2.x, + v1.y | v2.y); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator^(vec<2, T, Q> const& v, T scalar) + { + return vec<2, T, Q>( + v.x ^ scalar, + v.y ^ scalar); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator^(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2) + { + return vec<2, T, Q>( + v1.x ^ v2.x, + v1.y ^ v2.x); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator^(T scalar, vec<2, T, Q> const& v) + { + return vec<2, T, Q>( + scalar ^ v.x, + scalar ^ v.y); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator^(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2) + { + return vec<2, T, Q>( + v1.x ^ v2.x, + v1.x ^ v2.y); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator^(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2) + { + return vec<2, T, Q>( + v1.x ^ v2.x, + v1.y ^ v2.y); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator<<(vec<2, T, Q> const& v, T scalar) + { + return vec<2, T, Q>( + v.x << scalar, + v.y << scalar); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator<<(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2) + { + return vec<2, T, Q>( + v1.x << v2.x, + v1.y << v2.x); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator<<(T scalar, vec<2, T, Q> const& v) + { + return vec<2, T, Q>( + scalar << v.x, + scalar << v.y); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator<<(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2) + { + return vec<2, T, Q>( + v1.x << v2.x, + v1.x << v2.y); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator<<(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2) + { + return vec<2, T, Q>( + v1.x << v2.x, + v1.y << v2.y); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator>>(vec<2, T, Q> const& v, T scalar) + { + return vec<2, T, Q>( + v.x >> scalar, + v.y >> scalar); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator>>(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2) + { + return vec<2, T, Q>( + v1.x >> v2.x, + v1.y >> v2.x); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator>>(T scalar, vec<2, T, Q> const& v) + { + return vec<2, T, Q>( + scalar >> v.x, + scalar >> v.y); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator>>(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2) + { + return vec<2, T, Q>( + v1.x >> v2.x, + v1.x >> v2.y); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator>>(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2) + { + return vec<2, T, Q>( + v1.x >> v2.x, + v1.y >> v2.y); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator~(vec<2, T, Q> const& v) + { + return vec<2, T, Q>( + ~v.x, + ~v.y); + } + + // -- Boolean operators -- + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator==(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2) + { + return + detail::compute_equal::is_iec559>::call(v1.x, v2.x) && + detail::compute_equal::is_iec559>::call(v1.y, v2.y); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator!=(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2) + { + return !(v1 == v2); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, bool, Q> operator&&(vec<2, bool, Q> const& v1, vec<2, bool, Q> const& v2) + { + return vec<2, bool, Q>(v1.x && v2.x, v1.y && v2.y); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, bool, Q> operator||(vec<2, bool, Q> const& v1, vec<2, bool, Q> const& v2) + { + return vec<2, bool, Q>(v1.x || v2.x, v1.y || v2.y); + } +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_vec3.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_vec3.hpp new file mode 100644 index 0000000000000000000000000000000000000000..2a29d50be483bd27582cfa2478ba9eb264be491a --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_vec3.hpp @@ -0,0 +1,435 @@ +/// @ref core +/// @file glm/detail/type_vec3.hpp + +#pragma once + +#include "qualifier.hpp" +#if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR +# include "_swizzle.hpp" +#elif GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION +# include "_swizzle_func.hpp" +#endif +#include + +namespace glm +{ + template + struct vec<3, T, Q> + { + // -- Implementation detail -- + + typedef T value_type; + typedef vec<3, T, Q> type; + typedef vec<3, bool, Q> bool_type; + + // -- Data -- + +# if GLM_SILENT_WARNINGS == GLM_ENABLE +# if GLM_COMPILER & GLM_COMPILER_GCC +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wpedantic" +# elif GLM_COMPILER & GLM_COMPILER_CLANG +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wgnu-anonymous-struct" +# pragma clang diagnostic ignored "-Wnested-anon-types" +# elif GLM_COMPILER & GLM_COMPILER_VC +# pragma warning(push) +# pragma warning(disable: 4201) // nonstandard extension used : nameless struct/union +# if GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE +# pragma warning(disable: 4324) // structure was padded due to alignment specifier +# endif +# endif +# endif + +# if GLM_CONFIG_XYZW_ONLY + T x, y, z; +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION + GLM_SWIZZLE_GEN_VEC_FROM_VEC3_COMP(T, Q, x, y, z) +# endif//GLM_CONFIG_SWIZZLE +# elif GLM_CONFIG_ANONYMOUS_STRUCT == GLM_ENABLE + union + { + struct{ T x, y, z; }; + struct{ T r, g, b; }; + struct{ T s, t, p; }; + + typename detail::storage<3, T, detail::is_aligned::value>::type data; + +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR + GLM_SWIZZLE3_2_MEMBERS(T, Q, x, y, z) + GLM_SWIZZLE3_2_MEMBERS(T, Q, r, g, b) + GLM_SWIZZLE3_2_MEMBERS(T, Q, s, t, p) + GLM_SWIZZLE3_3_MEMBERS(T, Q, x, y, z) + GLM_SWIZZLE3_3_MEMBERS(T, Q, r, g, b) + GLM_SWIZZLE3_3_MEMBERS(T, Q, s, t, p) + GLM_SWIZZLE3_4_MEMBERS(T, Q, x, y, z) + GLM_SWIZZLE3_4_MEMBERS(T, Q, r, g, b) + GLM_SWIZZLE3_4_MEMBERS(T, Q, s, t, p) +# endif + }; +# else + union { T x, r, s; }; + union { T y, g, t; }; + union { T z, b, p; }; + +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION + GLM_SWIZZLE_GEN_VEC_FROM_VEC3(T, Q) +# endif//GLM_CONFIG_SWIZZLE +# endif//GLM_LANG + +# if GLM_SILENT_WARNINGS == GLM_ENABLE +# if GLM_COMPILER & GLM_COMPILER_CLANG +# pragma clang diagnostic pop +# elif GLM_COMPILER & GLM_COMPILER_GCC +# pragma GCC diagnostic pop +# elif GLM_COMPILER & GLM_COMPILER_VC +# pragma warning(pop) +# endif +# endif + + // -- Component accesses -- + + /// Return the count of components of the vector + typedef length_t length_type; + GLM_FUNC_DECL static GLM_CONSTEXPR length_type length(){return 3;} + + GLM_FUNC_DECL GLM_CONSTEXPR T & operator[](length_type i); + GLM_FUNC_DECL GLM_CONSTEXPR T const& operator[](length_type i) const; + + // -- Implicit basic constructors -- + + GLM_FUNC_DECL GLM_CONSTEXPR vec() GLM_DEFAULT_CTOR; + GLM_FUNC_DECL GLM_CONSTEXPR vec(vec const& v) GLM_DEFAULT; + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<3, T, P> const& v); + + // -- Explicit basic constructors -- + + GLM_FUNC_DECL GLM_CONSTEXPR explicit vec(T scalar); + GLM_FUNC_DECL GLM_CONSTEXPR vec(T a, T b, T c); + + // -- Conversion scalar constructors -- + + template + GLM_FUNC_DECL GLM_CONSTEXPR explicit vec(vec<1, U, P> const& v); + + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(X x, Y y, Z z); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, X, Q> const& _x, Y _y, Z _z); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(X _x, vec<1, Y, Q> const& _y, Z _z); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, X, Q> const& _x, vec<1, Y, Q> const& _y, Z _z); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(X _x, Y _y, vec<1, Z, Q> const& _z); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, X, Q> const& _x, Y _y, vec<1, Z, Q> const& _z); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(X _x, vec<1, Y, Q> const& _y, vec<1, Z, Q> const& _z); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, X, Q> const& _x, vec<1, Y, Q> const& _y, vec<1, Z, Q> const& _z); + + // -- Conversion vector constructors -- + + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<2, A, P> const& _xy, B _z); + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<2, A, P> const& _xy, vec<1, B, P> const& _z); + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(A _x, vec<2, B, P> const& _yz); + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, A, P> const& _x, vec<2, B, P> const& _yz); + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<4, U, P> const& v); + + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<3, U, P> const& v); + + // -- Swizzle constructors -- +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(detail::_swizzle<3, T, Q, E0, E1, E2, -1> const& that) + { + *this = that(); + } + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(detail::_swizzle<2, T, Q, E0, E1, -1, -2> const& v, T const& scalar) + { + *this = vec(v(), scalar); + } + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(T const& scalar, detail::_swizzle<2, T, Q, E0, E1, -1, -2> const& v) + { + *this = vec(scalar, v()); + } +# endif//GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR + + // -- Unary arithmetic operators -- + + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q>& operator=(vec<3, T, Q> const& v) GLM_DEFAULT; + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator=(vec<3, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator+=(U scalar); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator+=(vec<1, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator+=(vec<3, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator-=(U scalar); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator-=(vec<1, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator-=(vec<3, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator*=(U scalar); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator*=(vec<1, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator*=(vec<3, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator/=(U scalar); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator/=(vec<1, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator/=(vec<3, U, Q> const& v); + + // -- Increment and decrement operators -- + + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator++(); + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator--(); + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator++(int); + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator--(int); + + // -- Unary bit operators -- + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator%=(U scalar); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator%=(vec<1, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator%=(vec<3, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator&=(U scalar); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator&=(vec<1, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator&=(vec<3, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator|=(U scalar); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator|=(vec<1, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator|=(vec<3, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator^=(U scalar); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator^=(vec<1, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator^=(vec<3, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator<<=(U scalar); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator<<=(vec<1, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator<<=(vec<3, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator>>=(U scalar); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator>>=(vec<1, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator>>=(vec<3, U, Q> const& v); + }; + + // -- Unary operators -- + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator+(vec<3, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator-(vec<3, T, Q> const& v); + + // -- Binary operators -- + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator+(vec<3, T, Q> const& v, T scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator+(vec<3, T, Q> const& v, vec<1, T, Q> const& scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator+(T scalar, vec<3, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator+(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator+(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator-(vec<3, T, Q> const& v, T scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator-(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator-(T scalar, vec<3, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator-(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator-(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator*(vec<3, T, Q> const& v, T scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator*(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator*(T scalar, vec<3, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator*(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator*(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator/(vec<3, T, Q> const& v, T scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator/(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator/(T scalar, vec<3, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator/(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator/(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator%(vec<3, T, Q> const& v, T scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator%(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator%(T scalar, vec<3, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator%(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator%(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator&(vec<3, T, Q> const& v1, T scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator&(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator&(T scalar, vec<3, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator&(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator&(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator|(vec<3, T, Q> const& v, T scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator|(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator|(T scalar, vec<3, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator|(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator|(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator^(vec<3, T, Q> const& v, T scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator^(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator^(T scalar, vec<3, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator^(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator^(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator<<(vec<3, T, Q> const& v, T scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator<<(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator<<(T scalar, vec<3, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator<<(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator<<(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator>>(vec<3, T, Q> const& v, T scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator>>(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator>>(T scalar, vec<3, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator>>(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator>>(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator~(vec<3, T, Q> const& v); + + // -- Boolean operators -- + + template + GLM_FUNC_DECL GLM_CONSTEXPR bool operator==(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR bool operator!=(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, bool, Q> operator&&(vec<3, bool, Q> const& v1, vec<3, bool, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, bool, Q> operator||(vec<3, bool, Q> const& v1, vec<3, bool, Q> const& v2); +}//namespace glm + +#ifndef GLM_EXTERNAL_TEMPLATE +#include "type_vec3.inl" +#endif//GLM_EXTERNAL_TEMPLATE diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_vec3.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_vec3.inl new file mode 100644 index 0000000000000000000000000000000000000000..524bda022effc37d7710d7a1f3001208c7baf41b --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_vec3.inl @@ -0,0 +1,1070 @@ +/// @ref core + +#include "compute_vector_relational.hpp" + +namespace glm +{ + // -- Implicit basic constructors -- + +# if GLM_CONFIG_DEFAULTED_DEFAULT_CTOR == GLM_DISABLE + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>::vec() +# if GLM_CONFIG_CTOR_INIT != GLM_CTOR_INIT_DISABLE + : x(0), y(0), z(0) +# endif + {} +# endif + +# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>::vec(vec<3, T, Q> const& v) + : x(v.x), y(v.y), z(v.z) + {} +# endif + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>::vec(vec<3, T, P> const& v) + : x(v.x), y(v.y), z(v.z) + {} + + // -- Explicit basic constructors -- + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>::vec(T scalar) + : x(scalar), y(scalar), z(scalar) + {} + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>::vec(T _x, T _y, T _z) + : x(_x), y(_y), z(_z) + {} + + // -- Conversion scalar constructors -- + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>::vec(vec<1, U, P> const& v) + : x(static_cast(v.x)) + , y(static_cast(v.x)) + , z(static_cast(v.x)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>::vec(X _x, Y _y, Z _z) + : x(static_cast(_x)) + , y(static_cast(_y)) + , z(static_cast(_z)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>::vec(vec<1, X, Q> const& _x, Y _y, Z _z) + : x(static_cast(_x.x)) + , y(static_cast(_y)) + , z(static_cast(_z)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>::vec(X _x, vec<1, Y, Q> const& _y, Z _z) + : x(static_cast(_x)) + , y(static_cast(_y.x)) + , z(static_cast(_z)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>::vec(vec<1, X, Q> const& _x, vec<1, Y, Q> const& _y, Z _z) + : x(static_cast(_x.x)) + , y(static_cast(_y.x)) + , z(static_cast(_z)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>::vec(X _x, Y _y, vec<1, Z, Q> const& _z) + : x(static_cast(_x)) + , y(static_cast(_y)) + , z(static_cast(_z.x)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>::vec(vec<1, X, Q> const& _x, Y _y, vec<1, Z, Q> const& _z) + : x(static_cast(_x.x)) + , y(static_cast(_y)) + , z(static_cast(_z.x)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>::vec(X _x, vec<1, Y, Q> const& _y, vec<1, Z, Q> const& _z) + : x(static_cast(_x)) + , y(static_cast(_y.x)) + , z(static_cast(_z.x)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>::vec(vec<1, X, Q> const& _x, vec<1, Y, Q> const& _y, vec<1, Z, Q> const& _z) + : x(static_cast(_x.x)) + , y(static_cast(_y.x)) + , z(static_cast(_z.x)) + {} + + // -- Conversion vector constructors -- + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>::vec(vec<2, A, P> const& _xy, B _z) + : x(static_cast(_xy.x)) + , y(static_cast(_xy.y)) + , z(static_cast(_z)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>::vec(vec<2, A, P> const& _xy, vec<1, B, P> const& _z) + : x(static_cast(_xy.x)) + , y(static_cast(_xy.y)) + , z(static_cast(_z.x)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>::vec(A _x, vec<2, B, P> const& _yz) + : x(static_cast(_x)) + , y(static_cast(_yz.x)) + , z(static_cast(_yz.y)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>::vec(vec<1, A, P> const& _x, vec<2, B, P> const& _yz) + : x(static_cast(_x.x)) + , y(static_cast(_yz.x)) + , z(static_cast(_yz.y)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>::vec(vec<3, U, P> const& v) + : x(static_cast(v.x)) + , y(static_cast(v.y)) + , z(static_cast(v.z)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>::vec(vec<4, U, P> const& v) + : x(static_cast(v.x)) + , y(static_cast(v.y)) + , z(static_cast(v.z)) + {} + + // -- Component accesses -- + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR T & vec<3, T, Q>::operator[](typename vec<3, T, Q>::length_type i) + { + assert(i >= 0 && i < this->length()); + switch(i) + { + default: + case 0: + return x; + case 1: + return y; + case 2: + return z; + } + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR T const& vec<3, T, Q>::operator[](typename vec<3, T, Q>::length_type i) const + { + assert(i >= 0 && i < this->length()); + switch(i) + { + default: + case 0: + return x; + case 1: + return y; + case 2: + return z; + } + } + + // -- Unary arithmetic operators -- + +# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>& vec<3, T, Q>::operator=(vec<3, T, Q> const& v) + { + this->x = v.x; + this->y = v.y; + this->z = v.z; + return *this; + } +# endif + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>& vec<3, T, Q>::operator=(vec<3, U, Q> const& v) + { + this->x = static_cast(v.x); + this->y = static_cast(v.y); + this->z = static_cast(v.z); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator+=(U scalar) + { + this->x += static_cast(scalar); + this->y += static_cast(scalar); + this->z += static_cast(scalar); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator+=(vec<1, U, Q> const& v) + { + this->x += static_cast(v.x); + this->y += static_cast(v.x); + this->z += static_cast(v.x); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator+=(vec<3, U, Q> const& v) + { + this->x += static_cast(v.x); + this->y += static_cast(v.y); + this->z += static_cast(v.z); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator-=(U scalar) + { + this->x -= static_cast(scalar); + this->y -= static_cast(scalar); + this->z -= static_cast(scalar); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator-=(vec<1, U, Q> const& v) + { + this->x -= static_cast(v.x); + this->y -= static_cast(v.x); + this->z -= static_cast(v.x); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator-=(vec<3, U, Q> const& v) + { + this->x -= static_cast(v.x); + this->y -= static_cast(v.y); + this->z -= static_cast(v.z); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator*=(U scalar) + { + this->x *= static_cast(scalar); + this->y *= static_cast(scalar); + this->z *= static_cast(scalar); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator*=(vec<1, U, Q> const& v) + { + this->x *= static_cast(v.x); + this->y *= static_cast(v.x); + this->z *= static_cast(v.x); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator*=(vec<3, U, Q> const& v) + { + this->x *= static_cast(v.x); + this->y *= static_cast(v.y); + this->z *= static_cast(v.z); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator/=(U v) + { + this->x /= static_cast(v); + this->y /= static_cast(v); + this->z /= static_cast(v); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator/=(vec<1, U, Q> const& v) + { + this->x /= static_cast(v.x); + this->y /= static_cast(v.x); + this->z /= static_cast(v.x); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator/=(vec<3, U, Q> const& v) + { + this->x /= static_cast(v.x); + this->y /= static_cast(v.y); + this->z /= static_cast(v.z); + return *this; + } + + // -- Increment and decrement operators -- + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator++() + { + ++this->x; + ++this->y; + ++this->z; + return *this; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator--() + { + --this->x; + --this->y; + --this->z; + return *this; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> vec<3, T, Q>::operator++(int) + { + vec<3, T, Q> Result(*this); + ++*this; + return Result; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> vec<3, T, Q>::operator--(int) + { + vec<3, T, Q> Result(*this); + --*this; + return Result; + } + + // -- Unary bit operators -- + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator%=(U scalar) + { + this->x %= scalar; + this->y %= scalar; + this->z %= scalar; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator%=(vec<1, U, Q> const& v) + { + this->x %= v.x; + this->y %= v.x; + this->z %= v.x; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator%=(vec<3, U, Q> const& v) + { + this->x %= v.x; + this->y %= v.y; + this->z %= v.z; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator&=(U scalar) + { + this->x &= scalar; + this->y &= scalar; + this->z &= scalar; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator&=(vec<1, U, Q> const& v) + { + this->x &= v.x; + this->y &= v.x; + this->z &= v.x; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator&=(vec<3, U, Q> const& v) + { + this->x &= v.x; + this->y &= v.y; + this->z &= v.z; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator|=(U scalar) + { + this->x |= scalar; + this->y |= scalar; + this->z |= scalar; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator|=(vec<1, U, Q> const& v) + { + this->x |= v.x; + this->y |= v.x; + this->z |= v.x; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator|=(vec<3, U, Q> const& v) + { + this->x |= v.x; + this->y |= v.y; + this->z |= v.z; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator^=(U scalar) + { + this->x ^= scalar; + this->y ^= scalar; + this->z ^= scalar; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator^=(vec<1, U, Q> const& v) + { + this->x ^= v.x; + this->y ^= v.x; + this->z ^= v.x; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator^=(vec<3, U, Q> const& v) + { + this->x ^= v.x; + this->y ^= v.y; + this->z ^= v.z; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator<<=(U scalar) + { + this->x <<= scalar; + this->y <<= scalar; + this->z <<= scalar; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator<<=(vec<1, U, Q> const& v) + { + this->x <<= static_cast(v.x); + this->y <<= static_cast(v.x); + this->z <<= static_cast(v.x); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator<<=(vec<3, U, Q> const& v) + { + this->x <<= static_cast(v.x); + this->y <<= static_cast(v.y); + this->z <<= static_cast(v.z); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator>>=(U scalar) + { + this->x >>= static_cast(scalar); + this->y >>= static_cast(scalar); + this->z >>= static_cast(scalar); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator>>=(vec<1, U, Q> const& v) + { + this->x >>= static_cast(v.x); + this->y >>= static_cast(v.x); + this->z >>= static_cast(v.x); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator>>=(vec<3, U, Q> const& v) + { + this->x >>= static_cast(v.x); + this->y >>= static_cast(v.y); + this->z >>= static_cast(v.z); + return *this; + } + + // -- Unary arithmetic operators -- + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator+(vec<3, T, Q> const& v) + { + return v; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator-(vec<3, T, Q> const& v) + { + return vec<3, T, Q>( + -v.x, + -v.y, + -v.z); + } + + // -- Binary arithmetic operators -- + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator+(vec<3, T, Q> const& v, T scalar) + { + return vec<3, T, Q>( + v.x + scalar, + v.y + scalar, + v.z + scalar); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator+(vec<3, T, Q> const& v, vec<1, T, Q> const& scalar) + { + return vec<3, T, Q>( + v.x + scalar.x, + v.y + scalar.x, + v.z + scalar.x); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator+(T scalar, vec<3, T, Q> const& v) + { + return vec<3, T, Q>( + scalar + v.x, + scalar + v.y, + scalar + v.z); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator+(vec<1, T, Q> const& scalar, vec<3, T, Q> const& v) + { + return vec<3, T, Q>( + scalar.x + v.x, + scalar.x + v.y, + scalar.x + v.z); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator+(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2) + { + return vec<3, T, Q>( + v1.x + v2.x, + v1.y + v2.y, + v1.z + v2.z); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator-(vec<3, T, Q> const& v, T scalar) + { + return vec<3, T, Q>( + v.x - scalar, + v.y - scalar, + v.z - scalar); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator-(vec<3, T, Q> const& v, vec<1, T, Q> const& scalar) + { + return vec<3, T, Q>( + v.x - scalar.x, + v.y - scalar.x, + v.z - scalar.x); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator-(T scalar, vec<3, T, Q> const& v) + { + return vec<3, T, Q>( + scalar - v.x, + scalar - v.y, + scalar - v.z); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator-(vec<1, T, Q> const& scalar, vec<3, T, Q> const& v) + { + return vec<3, T, Q>( + scalar.x - v.x, + scalar.x - v.y, + scalar.x - v.z); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator-(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2) + { + return vec<3, T, Q>( + v1.x - v2.x, + v1.y - v2.y, + v1.z - v2.z); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator*(vec<3, T, Q> const& v, T scalar) + { + return vec<3, T, Q>( + v.x * scalar, + v.y * scalar, + v.z * scalar); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator*(vec<3, T, Q> const& v, vec<1, T, Q> const& scalar) + { + return vec<3, T, Q>( + v.x * scalar.x, + v.y * scalar.x, + v.z * scalar.x); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator*(T scalar, vec<3, T, Q> const& v) + { + return vec<3, T, Q>( + scalar * v.x, + scalar * v.y, + scalar * v.z); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator*(vec<1, T, Q> const& scalar, vec<3, T, Q> const& v) + { + return vec<3, T, Q>( + scalar.x * v.x, + scalar.x * v.y, + scalar.x * v.z); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator*(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2) + { + return vec<3, T, Q>( + v1.x * v2.x, + v1.y * v2.y, + v1.z * v2.z); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator/(vec<3, T, Q> const& v, T scalar) + { + return vec<3, T, Q>( + v.x / scalar, + v.y / scalar, + v.z / scalar); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator/(vec<3, T, Q> const& v, vec<1, T, Q> const& scalar) + { + return vec<3, T, Q>( + v.x / scalar.x, + v.y / scalar.x, + v.z / scalar.x); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator/(T scalar, vec<3, T, Q> const& v) + { + return vec<3, T, Q>( + scalar / v.x, + scalar / v.y, + scalar / v.z); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator/(vec<1, T, Q> const& scalar, vec<3, T, Q> const& v) + { + return vec<3, T, Q>( + scalar.x / v.x, + scalar.x / v.y, + scalar.x / v.z); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator/(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2) + { + return vec<3, T, Q>( + v1.x / v2.x, + v1.y / v2.y, + v1.z / v2.z); + } + + // -- Binary bit operators -- + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator%(vec<3, T, Q> const& v, T scalar) + { + return vec<3, T, Q>( + v.x % scalar, + v.y % scalar, + v.z % scalar); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator%(vec<3, T, Q> const& v, vec<1, T, Q> const& scalar) + { + return vec<3, T, Q>( + v.x % scalar.x, + v.y % scalar.x, + v.z % scalar.x); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator%(T scalar, vec<3, T, Q> const& v) + { + return vec<3, T, Q>( + scalar % v.x, + scalar % v.y, + scalar % v.z); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator%(vec<1, T, Q> const& scalar, vec<3, T, Q> const& v) + { + return vec<3, T, Q>( + scalar.x % v.x, + scalar.x % v.y, + scalar.x % v.z); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator%(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2) + { + return vec<3, T, Q>( + v1.x % v2.x, + v1.y % v2.y, + v1.z % v2.z); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator&(vec<3, T, Q> const& v, T scalar) + { + return vec<3, T, Q>( + v.x & scalar, + v.y & scalar, + v.z & scalar); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator&(vec<3, T, Q> const& v, vec<1, T, Q> const& scalar) + { + return vec<3, T, Q>( + v.x & scalar.x, + v.y & scalar.x, + v.z & scalar.x); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator&(T scalar, vec<3, T, Q> const& v) + { + return vec<3, T, Q>( + scalar & v.x, + scalar & v.y, + scalar & v.z); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator&(vec<1, T, Q> const& scalar, vec<3, T, Q> const& v) + { + return vec<3, T, Q>( + scalar.x & v.x, + scalar.x & v.y, + scalar.x & v.z); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator&(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2) + { + return vec<3, T, Q>( + v1.x & v2.x, + v1.y & v2.y, + v1.z & v2.z); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator|(vec<3, T, Q> const& v, T scalar) + { + return vec<3, T, Q>( + v.x | scalar, + v.y | scalar, + v.z | scalar); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator|(vec<3, T, Q> const& v, vec<1, T, Q> const& scalar) + { + return vec<3, T, Q>( + v.x | scalar.x, + v.y | scalar.x, + v.z | scalar.x); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator|(T scalar, vec<3, T, Q> const& v) + { + return vec<3, T, Q>( + scalar | v.x, + scalar | v.y, + scalar | v.z); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator|(vec<1, T, Q> const& scalar, vec<3, T, Q> const& v) + { + return vec<3, T, Q>( + scalar.x | v.x, + scalar.x | v.y, + scalar.x | v.z); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator|(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2) + { + return vec<3, T, Q>( + v1.x | v2.x, + v1.y | v2.y, + v1.z | v2.z); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator^(vec<3, T, Q> const& v, T scalar) + { + return vec<3, T, Q>( + v.x ^ scalar, + v.y ^ scalar, + v.z ^ scalar); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator^(vec<3, T, Q> const& v, vec<1, T, Q> const& scalar) + { + return vec<3, T, Q>( + v.x ^ scalar.x, + v.y ^ scalar.x, + v.z ^ scalar.x); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator^(T scalar, vec<3, T, Q> const& v) + { + return vec<3, T, Q>( + scalar ^ v.x, + scalar ^ v.y, + scalar ^ v.z); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator^(vec<1, T, Q> const& scalar, vec<3, T, Q> const& v) + { + return vec<3, T, Q>( + scalar.x ^ v.x, + scalar.x ^ v.y, + scalar.x ^ v.z); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator^(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2) + { + return vec<3, T, Q>( + v1.x ^ v2.x, + v1.y ^ v2.y, + v1.z ^ v2.z); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator<<(vec<3, T, Q> const& v, T scalar) + { + return vec<3, T, Q>( + v.x << scalar, + v.y << scalar, + v.z << scalar); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator<<(vec<3, T, Q> const& v, vec<1, T, Q> const& scalar) + { + return vec<3, T, Q>( + v.x << scalar.x, + v.y << scalar.x, + v.z << scalar.x); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator<<(T scalar, vec<3, T, Q> const& v) + { + return vec<3, T, Q>( + scalar << v.x, + scalar << v.y, + scalar << v.z); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator<<(vec<1, T, Q> const& scalar, vec<3, T, Q> const& v) + { + return vec<3, T, Q>( + scalar.x << v.x, + scalar.x << v.y, + scalar.x << v.z); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator<<(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2) + { + return vec<3, T, Q>( + v1.x << v2.x, + v1.y << v2.y, + v1.z << v2.z); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator>>(vec<3, T, Q> const& v, T scalar) + { + return vec<3, T, Q>( + v.x >> scalar, + v.y >> scalar, + v.z >> scalar); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator>>(vec<3, T, Q> const& v, vec<1, T, Q> const& scalar) + { + return vec<3, T, Q>( + v.x >> scalar.x, + v.y >> scalar.x, + v.z >> scalar.x); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator>>(T scalar, vec<3, T, Q> const& v) + { + return vec<3, T, Q>( + scalar >> v.x, + scalar >> v.y, + scalar >> v.z); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator>>(vec<1, T, Q> const& scalar, vec<3, T, Q> const& v) + { + return vec<3, T, Q>( + scalar.x >> v.x, + scalar.x >> v.y, + scalar.x >> v.z); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator>>(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2) + { + return vec<3, T, Q>( + v1.x >> v2.x, + v1.y >> v2.y, + v1.z >> v2.z); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator~(vec<3, T, Q> const& v) + { + return vec<3, T, Q>( + ~v.x, + ~v.y, + ~v.z); + } + + // -- Boolean operators -- + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator==(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2) + { + return + detail::compute_equal::is_iec559>::call(v1.x, v2.x) && + detail::compute_equal::is_iec559>::call(v1.y, v2.y) && + detail::compute_equal::is_iec559>::call(v1.z, v2.z); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator!=(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2) + { + return !(v1 == v2); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, bool, Q> operator&&(vec<3, bool, Q> const& v1, vec<3, bool, Q> const& v2) + { + return vec<3, bool, Q>(v1.x && v2.x, v1.y && v2.y, v1.z && v2.z); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, bool, Q> operator||(vec<3, bool, Q> const& v1, vec<3, bool, Q> const& v2) + { + return vec<3, bool, Q>(v1.x || v2.x, v1.y || v2.y, v1.z || v2.z); + } +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_vec4.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_vec4.hpp new file mode 100644 index 0000000000000000000000000000000000000000..eed9b04484450764b1369f567df0893937f0ea23 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_vec4.hpp @@ -0,0 +1,508 @@ +/// @ref core +/// @file glm/detail/type_vec4.hpp + +#pragma once + +#include "qualifier.hpp" +#if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR +# include "_swizzle.hpp" +#elif GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION +# include "_swizzle_func.hpp" +#endif +#include + +namespace glm +{ + template + struct vec<4, T, Q> + { + // -- Implementation detail -- + + typedef T value_type; + typedef vec<4, T, Q> type; + typedef vec<4, bool, Q> bool_type; + + // -- Data -- + +# if GLM_SILENT_WARNINGS == GLM_ENABLE +# if GLM_COMPILER & GLM_COMPILER_GCC +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wpedantic" +# elif GLM_COMPILER & GLM_COMPILER_CLANG +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wgnu-anonymous-struct" +# pragma clang diagnostic ignored "-Wnested-anon-types" +# elif GLM_COMPILER & GLM_COMPILER_VC +# pragma warning(push) +# pragma warning(disable: 4201) // nonstandard extension used : nameless struct/union +# endif +# endif + +# if GLM_CONFIG_XYZW_ONLY + T x, y, z, w; +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION + GLM_SWIZZLE_GEN_VEC_FROM_VEC4_COMP(T, Q, x, y, z, w) +# endif//GLM_CONFIG_SWIZZLE +# elif GLM_CONFIG_ANONYMOUS_STRUCT == GLM_ENABLE + union + { + struct { T x, y, z, w; }; + struct { T r, g, b, a; }; + struct { T s, t, p, q; }; + + typename detail::storage<4, T, detail::is_aligned::value>::type data; + +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR + GLM_SWIZZLE4_2_MEMBERS(T, Q, x, y, z, w) + GLM_SWIZZLE4_2_MEMBERS(T, Q, r, g, b, a) + GLM_SWIZZLE4_2_MEMBERS(T, Q, s, t, p, q) + GLM_SWIZZLE4_3_MEMBERS(T, Q, x, y, z, w) + GLM_SWIZZLE4_3_MEMBERS(T, Q, r, g, b, a) + GLM_SWIZZLE4_3_MEMBERS(T, Q, s, t, p, q) + GLM_SWIZZLE4_4_MEMBERS(T, Q, x, y, z, w) + GLM_SWIZZLE4_4_MEMBERS(T, Q, r, g, b, a) + GLM_SWIZZLE4_4_MEMBERS(T, Q, s, t, p, q) +# endif + }; +# else + union { T x, r, s; }; + union { T y, g, t; }; + union { T z, b, p; }; + union { T w, a, q; }; + +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION + GLM_SWIZZLE_GEN_VEC_FROM_VEC4(T, Q) +# endif +# endif + +# if GLM_SILENT_WARNINGS == GLM_ENABLE +# if GLM_COMPILER & GLM_COMPILER_CLANG +# pragma clang diagnostic pop +# elif GLM_COMPILER & GLM_COMPILER_GCC +# pragma GCC diagnostic pop +# elif GLM_COMPILER & GLM_COMPILER_VC +# pragma warning(pop) +# endif +# endif + + // -- Component accesses -- + + typedef length_t length_type; + + /// Return the count of components of the vector + GLM_FUNC_DECL static GLM_CONSTEXPR length_type length(){return 4;} + + GLM_FUNC_DECL GLM_CONSTEXPR T & operator[](length_type i); + GLM_FUNC_DECL GLM_CONSTEXPR T const& operator[](length_type i) const; + + // -- Implicit basic constructors -- + + GLM_FUNC_DECL GLM_CONSTEXPR vec() GLM_DEFAULT_CTOR; + GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<4, T, Q> const& v) GLM_DEFAULT; + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<4, T, P> const& v); + + // -- Explicit basic constructors -- + + GLM_FUNC_DECL GLM_CONSTEXPR explicit vec(T scalar); + GLM_FUNC_DECL GLM_CONSTEXPR vec(T x, T y, T z, T w); + + // -- Conversion scalar constructors -- + + template + GLM_FUNC_DECL GLM_CONSTEXPR explicit vec(vec<1, U, P> const& v); + + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(X _x, Y _y, Z _z, W _w); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, X, Q> const& _x, Y _y, Z _z, W _w); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(X _x, vec<1, Y, Q> const& _y, Z _z, W _w); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, X, Q> const& _x, vec<1, Y, Q> const& _y, Z _z, W _w); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(X _x, Y _y, vec<1, Z, Q> const& _z, W _w); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, X, Q> const& _x, Y _y, vec<1, Z, Q> const& _z, W _w); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(X _x, vec<1, Y, Q> const& _y, vec<1, Z, Q> const& _z, W _w); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, X, Q> const& _x, vec<1, Y, Q> const& _y, vec<1, Z, Q> const& _z, W _w); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, X, Q> const& _x, Y _y, Z _z, vec<1, W, Q> const& _w); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(X _x, vec<1, Y, Q> const& _y, Z _z, vec<1, W, Q> const& _w); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, X, Q> const& _x, vec<1, Y, Q> const& _y, Z _z, vec<1, W, Q> const& _w); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(X _x, Y _y, vec<1, Z, Q> const& _z, vec<1, W, Q> const& _w); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, X, Q> const& _x, Y _y, vec<1, Z, Q> const& _z, vec<1, W, Q> const& _w); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(X _x, vec<1, Y, Q> const& _y, vec<1, Z, Q> const& _z, vec<1, W, Q> const& _w); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, X, Q> const& _x, vec<1, Y, Q> const& _y, vec<1, Z, Q> const& _z, vec<1, W, Q> const& _w); + + // -- Conversion vector constructors -- + + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<2, A, P> const& _xy, B _z, C _w); + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<2, A, P> const& _xy, vec<1, B, P> const& _z, C _w); + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<2, A, P> const& _xy, B _z, vec<1, C, P> const& _w); + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<2, A, P> const& _xy, vec<1, B, P> const& _z, vec<1, C, P> const& _w); + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(A _x, vec<2, B, P> const& _yz, C _w); + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, A, P> const& _x, vec<2, B, P> const& _yz, C _w); + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(A _x, vec<2, B, P> const& _yz, vec<1, C, P> const& _w); + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, A, P> const& _x, vec<2, B, P> const& _yz, vec<1, C, P> const& _w); + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(A _x, B _y, vec<2, C, P> const& _zw); + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, A, P> const& _x, B _y, vec<2, C, P> const& _zw); + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(A _x, vec<1, B, P> const& _y, vec<2, C, P> const& _zw); + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, A, P> const& _x, vec<1, B, P> const& _y, vec<2, C, P> const& _zw); + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<3, A, P> const& _xyz, B _w); + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<3, A, P> const& _xyz, vec<1, B, P> const& _w); + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(A _x, vec<3, B, P> const& _yzw); + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, A, P> const& _x, vec<3, B, P> const& _yzw); + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<2, A, P> const& _xy, vec<2, B, P> const& _zw); + + /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) + template + GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<4, U, P> const& v); + + // -- Swizzle constructors -- +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(detail::_swizzle<4, T, Q, E0, E1, E2, E3> const& that) + { + *this = that(); + } + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(detail::_swizzle<2, T, Q, E0, E1, -1, -2> const& v, detail::_swizzle<2, T, Q, F0, F1, -1, -2> const& u) + { + *this = vec<4, T, Q>(v(), u()); + } + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(T const& x, T const& y, detail::_swizzle<2, T, Q, E0, E1, -1, -2> const& v) + { + *this = vec<4, T, Q>(x, y, v()); + } + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(T const& x, detail::_swizzle<2, T, Q, E0, E1, -1, -2> const& v, T const& w) + { + *this = vec<4, T, Q>(x, v(), w); + } + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(detail::_swizzle<2, T, Q, E0, E1, -1, -2> const& v, T const& z, T const& w) + { + *this = vec<4, T, Q>(v(), z, w); + } + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(detail::_swizzle<3, T, Q, E0, E1, E2, -1> const& v, T const& w) + { + *this = vec<4, T, Q>(v(), w); + } + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec(T const& x, detail::_swizzle<3, T, Q, E0, E1, E2, -1> const& v) + { + *this = vec<4, T, Q>(x, v()); + } +# endif//GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR + + // -- Unary arithmetic operators -- + + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q>& operator=(vec<4, T, Q> const& v) GLM_DEFAULT; + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q>& operator=(vec<4, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q>& operator+=(U scalar); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q>& operator+=(vec<1, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q>& operator+=(vec<4, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q>& operator-=(U scalar); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q>& operator-=(vec<1, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q>& operator-=(vec<4, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q>& operator*=(U scalar); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q>& operator*=(vec<1, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q>& operator*=(vec<4, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q>& operator/=(U scalar); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q>& operator/=(vec<1, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q>& operator/=(vec<4, U, Q> const& v); + + // -- Increment and decrement operators -- + + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator++(); + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator--(); + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator++(int); + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator--(int); + + // -- Unary bit operators -- + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator%=(U scalar); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator%=(vec<1, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator%=(vec<4, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator&=(U scalar); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator&=(vec<1, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator&=(vec<4, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator|=(U scalar); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator|=(vec<1, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator|=(vec<4, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator^=(U scalar); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator^=(vec<1, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator^=(vec<4, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator<<=(U scalar); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator<<=(vec<1, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator<<=(vec<4, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator>>=(U scalar); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator>>=(vec<1, U, Q> const& v); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator>>=(vec<4, U, Q> const& v); + }; + + // -- Unary operators -- + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator+(vec<4, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator-(vec<4, T, Q> const& v); + + // -- Binary operators -- + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator+(vec<4, T, Q> const& v, T const & scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator+(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator+(T scalar, vec<4, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator+(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator+(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator-(vec<4, T, Q> const& v, T const & scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator-(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator-(T scalar, vec<4, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator-(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator-(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator*(vec<4, T, Q> const& v, T const & scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator*(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator*(T scalar, vec<4, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator*(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator*(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator/(vec<4, T, Q> const& v, T const & scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator/(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator/(T scalar, vec<4, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator/(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator/(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator%(vec<4, T, Q> const& v, T scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator%(vec<4, T, Q> const& v, vec<1, T, Q> const& scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator%(T scalar, vec<4, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator%(vec<1, T, Q> const& scalar, vec<4, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator%(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator&(vec<4, T, Q> const& v, T scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator&(vec<4, T, Q> const& v, vec<1, T, Q> const& scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator&(T scalar, vec<4, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator&(vec<1, T, Q> const& scalar, vec<4, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator&(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator|(vec<4, T, Q> const& v, T scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator|(vec<4, T, Q> const& v, vec<1, T, Q> const& scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator|(T scalar, vec<4, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator|(vec<1, T, Q> const& scalar, vec<4, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator|(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator^(vec<4, T, Q> const& v, T scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator^(vec<4, T, Q> const& v, vec<1, T, Q> const& scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator^(T scalar, vec<4, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator^(vec<1, T, Q> const& scalar, vec<4, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator^(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator<<(vec<4, T, Q> const& v, T scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator<<(vec<4, T, Q> const& v, vec<1, T, Q> const& scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator<<(T scalar, vec<4, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator<<(vec<1, T, Q> const& scalar, vec<4, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator<<(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator>>(vec<4, T, Q> const& v, T scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator>>(vec<4, T, Q> const& v, vec<1, T, Q> const& scalar); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator>>(T scalar, vec<4, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator>>(vec<1, T, Q> const& scalar, vec<4, T, Q> const& v); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator>>(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator~(vec<4, T, Q> const& v); + + // -- Boolean operators -- + + template + GLM_FUNC_DECL GLM_CONSTEXPR bool operator==(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR bool operator!=(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, bool, Q> operator&&(vec<4, bool, Q> const& v1, vec<4, bool, Q> const& v2); + + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<4, bool, Q> operator||(vec<4, bool, Q> const& v1, vec<4, bool, Q> const& v2); +}//namespace glm + +#ifndef GLM_EXTERNAL_TEMPLATE +#include "type_vec4.inl" +#endif//GLM_EXTERNAL_TEMPLATE diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_vec4.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_vec4.inl new file mode 100644 index 0000000000000000000000000000000000000000..761c34516d79ab5f5303c976e55b1fab41539b22 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_vec4.inl @@ -0,0 +1,1142 @@ +/// @ref core + +#include "compute_vector_relational.hpp" + +namespace glm{ +namespace detail +{ + template + struct compute_vec4_add + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec<4, T, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) + { + return vec<4, T, Q>(a.x + b.x, a.y + b.y, a.z + b.z, a.w + b.w); + } + }; + + template + struct compute_vec4_sub + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec<4, T, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) + { + return vec<4, T, Q>(a.x - b.x, a.y - b.y, a.z - b.z, a.w - b.w); + } + }; + + template + struct compute_vec4_mul + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec<4, T, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) + { + return vec<4, T, Q>(a.x * b.x, a.y * b.y, a.z * b.z, a.w * b.w); + } + }; + + template + struct compute_vec4_div + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec<4, T, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) + { + return vec<4, T, Q>(a.x / b.x, a.y / b.y, a.z / b.z, a.w / b.w); + } + }; + + template + struct compute_vec4_mod + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec<4, T, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) + { + return vec<4, T, Q>(a.x % b.x, a.y % b.y, a.z % b.z, a.w % b.w); + } + }; + + template + struct compute_vec4_and + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec<4, T, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) + { + return vec<4, T, Q>(a.x & b.x, a.y & b.y, a.z & b.z, a.w & b.w); + } + }; + + template + struct compute_vec4_or + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec<4, T, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) + { + return vec<4, T, Q>(a.x | b.x, a.y | b.y, a.z | b.z, a.w | b.w); + } + }; + + template + struct compute_vec4_xor + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec<4, T, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) + { + return vec<4, T, Q>(a.x ^ b.x, a.y ^ b.y, a.z ^ b.z, a.w ^ b.w); + } + }; + + template + struct compute_vec4_shift_left + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec<4, T, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) + { + return vec<4, T, Q>(a.x << b.x, a.y << b.y, a.z << b.z, a.w << b.w); + } + }; + + template + struct compute_vec4_shift_right + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec<4, T, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) + { + return vec<4, T, Q>(a.x >> b.x, a.y >> b.y, a.z >> b.z, a.w >> b.w); + } + }; + + template + struct compute_vec4_equal + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static bool call(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2) + { + return + detail::compute_equal::is_iec559>::call(v1.x, v2.x) && + detail::compute_equal::is_iec559>::call(v1.y, v2.y) && + detail::compute_equal::is_iec559>::call(v1.z, v2.z) && + detail::compute_equal::is_iec559>::call(v1.w, v2.w); + } + }; + + template + struct compute_vec4_nequal + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static bool call(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2) + { + return !compute_vec4_equal::value, sizeof(T) * 8, detail::is_aligned::value>::call(v1, v2); + } + }; + + template + struct compute_vec4_bitwise_not + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec<4, T, Q> call(vec<4, T, Q> const& v) + { + return vec<4, T, Q>(~v.x, ~v.y, ~v.z, ~v.w); + } + }; +}//namespace detail + + // -- Implicit basic constructors -- + +# if GLM_CONFIG_DEFAULTED_DEFAULT_CTOR == GLM_DISABLE + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec() +# if GLM_CONFIG_CTOR_INIT != GLM_CTOR_INIT_DISABLE + : x(0), y(0), z(0), w(0) +# endif + {} +# endif + +# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(vec<4, T, Q> const& v) + : x(v.x), y(v.y), z(v.z), w(v.w) + {} +# endif + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(vec<4, T, P> const& v) + : x(v.x), y(v.y), z(v.z), w(v.w) + {} + + // -- Explicit basic constructors -- + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(T scalar) + : x(scalar), y(scalar), z(scalar), w(scalar) + {} + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(T _x, T _y, T _z, T _w) + : x(_x), y(_y), z(_z), w(_w) + {} + + // -- Conversion scalar constructors -- + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(vec<1, U, P> const& v) + : x(static_cast(v.x)) + , y(static_cast(v.x)) + , z(static_cast(v.x)) + , w(static_cast(v.x)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(X _x, Y _y, Z _z, W _w) + : x(static_cast(_x)) + , y(static_cast(_y)) + , z(static_cast(_z)) + , w(static_cast(_w)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(vec<1, X, Q> const& _x, Y _y, Z _z, W _w) + : x(static_cast(_x.x)) + , y(static_cast(_y)) + , z(static_cast(_z)) + , w(static_cast(_w)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(X _x, vec<1, Y, Q> const& _y, Z _z, W _w) + : x(static_cast(_x)) + , y(static_cast(_y.x)) + , z(static_cast(_z)) + , w(static_cast(_w)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(vec<1, X, Q> const& _x, vec<1, Y, Q> const& _y, Z _z, W _w) + : x(static_cast(_x.x)) + , y(static_cast(_y.x)) + , z(static_cast(_z)) + , w(static_cast(_w)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(X _x, Y _y, vec<1, Z, Q> const& _z, W _w) + : x(static_cast(_x)) + , y(static_cast(_y)) + , z(static_cast(_z.x)) + , w(static_cast(_w)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(vec<1, X, Q> const& _x, Y _y, vec<1, Z, Q> const& _z, W _w) + : x(static_cast(_x.x)) + , y(static_cast(_y)) + , z(static_cast(_z.x)) + , w(static_cast(_w)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(X _x, vec<1, Y, Q> const& _y, vec<1, Z, Q> const& _z, W _w) + : x(static_cast(_x)) + , y(static_cast(_y.x)) + , z(static_cast(_z.x)) + , w(static_cast(_w)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(vec<1, X, Q> const& _x, vec<1, Y, Q> const& _y, vec<1, Z, Q> const& _z, W _w) + : x(static_cast(_x.x)) + , y(static_cast(_y.x)) + , z(static_cast(_z.x)) + , w(static_cast(_w)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(vec<1, X, Q> const& _x, Y _y, Z _z, vec<1, W, Q> const& _w) + : x(static_cast(_x.x)) + , y(static_cast(_y)) + , z(static_cast(_z)) + , w(static_cast(_w.x)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(X _x, vec<1, Y, Q> const& _y, Z _z, vec<1, W, Q> const& _w) + : x(static_cast(_x)) + , y(static_cast(_y.x)) + , z(static_cast(_z)) + , w(static_cast(_w.x)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(vec<1, X, Q> const& _x, vec<1, Y, Q> const& _y, Z _z, vec<1, W, Q> const& _w) + : x(static_cast(_x.x)) + , y(static_cast(_y.x)) + , z(static_cast(_z)) + , w(static_cast(_w.x)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(X _x, Y _y, vec<1, Z, Q> const& _z, vec<1, W, Q> const& _w) + : x(static_cast(_x)) + , y(static_cast(_y)) + , z(static_cast(_z.x)) + , w(static_cast(_w.x)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(vec<1, X, Q> const& _x, Y _y, vec<1, Z, Q> const& _z, vec<1, W, Q> const& _w) + : x(static_cast(_x.x)) + , y(static_cast(_y)) + , z(static_cast(_z.x)) + , w(static_cast(_w.x)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(X _x, vec<1, Y, Q> const& _y, vec<1, Z, Q> const& _z, vec<1, W, Q> const& _w) + : x(static_cast(_x)) + , y(static_cast(_y.x)) + , z(static_cast(_z.x)) + , w(static_cast(_w.x)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(vec<1, X, Q> const& _x, vec<1, Y, Q> const& _y, vec<1, Z, Q> const& _z, vec<1, W, Q> const& _w) + : x(static_cast(_x.x)) + , y(static_cast(_y.x)) + , z(static_cast(_z.x)) + , w(static_cast(_w.x)) + {} + + // -- Conversion vector constructors -- + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(vec<2, A, P> const& _xy, B _z, C _w) + : x(static_cast(_xy.x)) + , y(static_cast(_xy.y)) + , z(static_cast(_z)) + , w(static_cast(_w)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(vec<2, A, P> const& _xy, vec<1, B, P> const& _z, C _w) + : x(static_cast(_xy.x)) + , y(static_cast(_xy.y)) + , z(static_cast(_z.x)) + , w(static_cast(_w)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(vec<2, A, P> const& _xy, B _z, vec<1, C, P> const& _w) + : x(static_cast(_xy.x)) + , y(static_cast(_xy.y)) + , z(static_cast(_z)) + , w(static_cast(_w.x)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(vec<2, A, P> const& _xy, vec<1, B, P> const& _z, vec<1, C, P> const& _w) + : x(static_cast(_xy.x)) + , y(static_cast(_xy.y)) + , z(static_cast(_z.x)) + , w(static_cast(_w.x)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(A _x, vec<2, B, P> const& _yz, C _w) + : x(static_cast(_x)) + , y(static_cast(_yz.x)) + , z(static_cast(_yz.y)) + , w(static_cast(_w)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(vec<1, A, P> const& _x, vec<2, B, P> const& _yz, C _w) + : x(static_cast(_x.x)) + , y(static_cast(_yz.x)) + , z(static_cast(_yz.y)) + , w(static_cast(_w)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(A _x, vec<2, B, P> const& _yz, vec<1, C, P> const& _w) + : x(static_cast(_x)) + , y(static_cast(_yz.x)) + , z(static_cast(_yz.y)) + , w(static_cast(_w.x)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(vec<1, A, P> const& _x, vec<2, B, P> const& _yz, vec<1, C, P> const& _w) + : x(static_cast(_x.x)) + , y(static_cast(_yz.x)) + , z(static_cast(_yz.y)) + , w(static_cast(_w.x)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(A _x, B _y, vec<2, C, P> const& _zw) + : x(static_cast(_x)) + , y(static_cast(_y)) + , z(static_cast(_zw.x)) + , w(static_cast(_zw.y)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(vec<1, A, P> const& _x, B _y, vec<2, C, P> const& _zw) + : x(static_cast(_x.x)) + , y(static_cast(_y)) + , z(static_cast(_zw.x)) + , w(static_cast(_zw.y)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(A _x, vec<1, B, P> const& _y, vec<2, C, P> const& _zw) + : x(static_cast(_x)) + , y(static_cast(_y.x)) + , z(static_cast(_zw.x)) + , w(static_cast(_zw.y)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(vec<1, A, P> const& _x, vec<1, B, P> const& _y, vec<2, C, P> const& _zw) + : x(static_cast(_x.x)) + , y(static_cast(_y.x)) + , z(static_cast(_zw.x)) + , w(static_cast(_zw.y)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(vec<3, A, P> const& _xyz, B _w) + : x(static_cast(_xyz.x)) + , y(static_cast(_xyz.y)) + , z(static_cast(_xyz.z)) + , w(static_cast(_w)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(vec<3, A, P> const& _xyz, vec<1, B, P> const& _w) + : x(static_cast(_xyz.x)) + , y(static_cast(_xyz.y)) + , z(static_cast(_xyz.z)) + , w(static_cast(_w.x)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(A _x, vec<3, B, P> const& _yzw) + : x(static_cast(_x)) + , y(static_cast(_yzw.x)) + , z(static_cast(_yzw.y)) + , w(static_cast(_yzw.z)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(vec<1, A, P> const& _x, vec<3, B, P> const& _yzw) + : x(static_cast(_x.x)) + , y(static_cast(_yzw.x)) + , z(static_cast(_yzw.y)) + , w(static_cast(_yzw.z)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(vec<2, A, P> const& _xy, vec<2, B, P> const& _zw) + : x(static_cast(_xy.x)) + , y(static_cast(_xy.y)) + , z(static_cast(_zw.x)) + , w(static_cast(_zw.y)) + {} + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(vec<4, U, P> const& v) + : x(static_cast(v.x)) + , y(static_cast(v.y)) + , z(static_cast(v.z)) + , w(static_cast(v.w)) + {} + + // -- Component accesses -- + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR T& vec<4, T, Q>::operator[](typename vec<4, T, Q>::length_type i) + { + assert(i >= 0 && i < this->length()); + switch(i) + { + default: + case 0: + return x; + case 1: + return y; + case 2: + return z; + case 3: + return w; + } + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR T const& vec<4, T, Q>::operator[](typename vec<4, T, Q>::length_type i) const + { + assert(i >= 0 && i < this->length()); + switch(i) + { + default: + case 0: + return x; + case 1: + return y; + case 2: + return z; + case 3: + return w; + } + } + + // -- Unary arithmetic operators -- + +# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>& vec<4, T, Q>::operator=(vec<4, T, Q> const& v) + { + this->x = v.x; + this->y = v.y; + this->z = v.z; + this->w = v.w; + return *this; + } +# endif + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>& vec<4, T, Q>::operator=(vec<4, U, Q> const& v) + { + this->x = static_cast(v.x); + this->y = static_cast(v.y); + this->z = static_cast(v.z); + this->w = static_cast(v.w); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator+=(U scalar) + { + return (*this = detail::compute_vec4_add::value>::call(*this, vec<4, T, Q>(scalar))); + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator+=(vec<1, U, Q> const& v) + { + return (*this = detail::compute_vec4_add::value>::call(*this, vec<4, T, Q>(v.x))); + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator+=(vec<4, U, Q> const& v) + { + return (*this = detail::compute_vec4_add::value>::call(*this, vec<4, T, Q>(v))); + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator-=(U scalar) + { + return (*this = detail::compute_vec4_sub::value>::call(*this, vec<4, T, Q>(scalar))); + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator-=(vec<1, U, Q> const& v) + { + return (*this = detail::compute_vec4_sub::value>::call(*this, vec<4, T, Q>(v.x))); + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator-=(vec<4, U, Q> const& v) + { + return (*this = detail::compute_vec4_sub::value>::call(*this, vec<4, T, Q>(v))); + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator*=(U scalar) + { + return (*this = detail::compute_vec4_mul::value>::call(*this, vec<4, T, Q>(scalar))); + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator*=(vec<1, U, Q> const& v) + { + return (*this = detail::compute_vec4_mul::value>::call(*this, vec<4, T, Q>(v.x))); + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator*=(vec<4, U, Q> const& v) + { + return (*this = detail::compute_vec4_mul::value>::call(*this, vec<4, T, Q>(v))); + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator/=(U scalar) + { + return (*this = detail::compute_vec4_div::value>::call(*this, vec<4, T, Q>(scalar))); + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator/=(vec<1, U, Q> const& v) + { + return (*this = detail::compute_vec4_div::value>::call(*this, vec<4, T, Q>(v.x))); + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator/=(vec<4, U, Q> const& v) + { + return (*this = detail::compute_vec4_div::value>::call(*this, vec<4, T, Q>(v))); + } + + // -- Increment and decrement operators -- + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator++() + { + ++this->x; + ++this->y; + ++this->z; + ++this->w; + return *this; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator--() + { + --this->x; + --this->y; + --this->z; + --this->w; + return *this; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> vec<4, T, Q>::operator++(int) + { + vec<4, T, Q> Result(*this); + ++*this; + return Result; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> vec<4, T, Q>::operator--(int) + { + vec<4, T, Q> Result(*this); + --*this; + return Result; + } + + // -- Unary bit operators -- + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator%=(U scalar) + { + return (*this = detail::compute_vec4_mod::value>::call(*this, vec<4, T, Q>(scalar))); + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator%=(vec<1, U, Q> const& v) + { + return (*this = detail::compute_vec4_mod::value>::call(*this, vec<4, T, Q>(v))); + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator%=(vec<4, U, Q> const& v) + { + return (*this = detail::compute_vec4_mod::value>::call(*this, vec<4, T, Q>(v))); + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator&=(U scalar) + { + return (*this = detail::compute_vec4_and::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<4, T, Q>(scalar))); + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator&=(vec<1, U, Q> const& v) + { + return (*this = detail::compute_vec4_and::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<4, T, Q>(v))); + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator&=(vec<4, U, Q> const& v) + { + return (*this = detail::compute_vec4_and::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<4, T, Q>(v))); + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator|=(U scalar) + { + return (*this = detail::compute_vec4_or::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<4, T, Q>(scalar))); + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator|=(vec<1, U, Q> const& v) + { + return (*this = detail::compute_vec4_or::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<4, T, Q>(v))); + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator|=(vec<4, U, Q> const& v) + { + return (*this = detail::compute_vec4_or::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<4, T, Q>(v))); + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator^=(U scalar) + { + return (*this = detail::compute_vec4_xor::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<4, T, Q>(scalar))); + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator^=(vec<1, U, Q> const& v) + { + return (*this = detail::compute_vec4_xor::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<4, T, Q>(v))); + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator^=(vec<4, U, Q> const& v) + { + return (*this = detail::compute_vec4_xor::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<4, T, Q>(v))); + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator<<=(U scalar) + { + return (*this = detail::compute_vec4_shift_left::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<4, T, Q>(scalar))); + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator<<=(vec<1, U, Q> const& v) + { + return (*this = detail::compute_vec4_shift_left::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<4, T, Q>(v))); + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator<<=(vec<4, U, Q> const& v) + { + return (*this = detail::compute_vec4_shift_left::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<4, T, Q>(v))); + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator>>=(U scalar) + { + return (*this = detail::compute_vec4_shift_right::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<4, T, Q>(scalar))); + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator>>=(vec<1, U, Q> const& v) + { + return (*this = detail::compute_vec4_shift_right::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<4, T, Q>(v))); + } + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator>>=(vec<4, U, Q> const& v) + { + return (*this = detail::compute_vec4_shift_right::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<4, T, Q>(v))); + } + + // -- Unary constant operators -- + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator+(vec<4, T, Q> const& v) + { + return v; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator-(vec<4, T, Q> const& v) + { + return vec<4, T, Q>(0) -= v; + } + + // -- Binary arithmetic operators -- + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator+(vec<4, T, Q> const& v, T const & scalar) + { + return vec<4, T, Q>(v) += scalar; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator+(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2) + { + return vec<4, T, Q>(v1) += v2; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator+(T scalar, vec<4, T, Q> const& v) + { + return vec<4, T, Q>(v) += scalar; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator+(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2) + { + return vec<4, T, Q>(v2) += v1; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator+(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2) + { + return vec<4, T, Q>(v1) += v2; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator-(vec<4, T, Q> const& v, T const & scalar) + { + return vec<4, T, Q>(v) -= scalar; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator-(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2) + { + return vec<4, T, Q>(v1) -= v2; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator-(T scalar, vec<4, T, Q> const& v) + { + return vec<4, T, Q>(scalar) -= v; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator-(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2) + { + return vec<4, T, Q>(v1.x) -= v2; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator-(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2) + { + return vec<4, T, Q>(v1) -= v2; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator*(vec<4, T, Q> const& v, T const & scalar) + { + return vec<4, T, Q>(v) *= scalar; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator*(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2) + { + return vec<4, T, Q>(v1) *= v2; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator*(T scalar, vec<4, T, Q> const& v) + { + return vec<4, T, Q>(v) *= scalar; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator*(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2) + { + return vec<4, T, Q>(v2) *= v1; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator*(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2) + { + return vec<4, T, Q>(v1) *= v2; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator/(vec<4, T, Q> const& v, T const & scalar) + { + return vec<4, T, Q>(v) /= scalar; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator/(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2) + { + return vec<4, T, Q>(v1) /= v2; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator/(T scalar, vec<4, T, Q> const& v) + { + return vec<4, T, Q>(scalar) /= v; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator/(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2) + { + return vec<4, T, Q>(v1.x) /= v2; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator/(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2) + { + return vec<4, T, Q>(v1) /= v2; + } + + // -- Binary bit operators -- + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator%(vec<4, T, Q> const& v, T scalar) + { + return vec<4, T, Q>(v) %= scalar; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator%(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2) + { + return vec<4, T, Q>(v1) %= v2.x; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator%(T scalar, vec<4, T, Q> const& v) + { + return vec<4, T, Q>(scalar) %= v; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator%(vec<1, T, Q> const& scalar, vec<4, T, Q> const& v) + { + return vec<4, T, Q>(scalar.x) %= v; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator%(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2) + { + return vec<4, T, Q>(v1) %= v2; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator&(vec<4, T, Q> const& v, T scalar) + { + return vec<4, T, Q>(v) &= scalar; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator&(vec<4, T, Q> const& v, vec<1, T, Q> const& scalar) + { + return vec<4, T, Q>(v) &= scalar; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator&(T scalar, vec<4, T, Q> const& v) + { + return vec<4, T, Q>(scalar) &= v; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator&(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2) + { + return vec<4, T, Q>(v1.x) &= v2; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator&(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2) + { + return vec<4, T, Q>(v1) &= v2; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator|(vec<4, T, Q> const& v, T scalar) + { + return vec<4, T, Q>(v) |= scalar; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator|(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2) + { + return vec<4, T, Q>(v1) |= v2.x; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator|(T scalar, vec<4, T, Q> const& v) + { + return vec<4, T, Q>(scalar) |= v; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator|(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2) + { + return vec<4, T, Q>(v1.x) |= v2; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator|(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2) + { + return vec<4, T, Q>(v1) |= v2; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator^(vec<4, T, Q> const& v, T scalar) + { + return vec<4, T, Q>(v) ^= scalar; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator^(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2) + { + return vec<4, T, Q>(v1) ^= v2.x; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator^(T scalar, vec<4, T, Q> const& v) + { + return vec<4, T, Q>(scalar) ^= v; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator^(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2) + { + return vec<4, T, Q>(v1.x) ^= v2; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator^(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2) + { + return vec<4, T, Q>(v1) ^= v2; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator<<(vec<4, T, Q> const& v, T scalar) + { + return vec<4, T, Q>(v) <<= scalar; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator<<(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2) + { + return vec<4, T, Q>(v1) <<= v2.x; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator<<(T scalar, vec<4, T, Q> const& v) + { + return vec<4, T, Q>(scalar) <<= v; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator<<(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2) + { + return vec<4, T, Q>(v1.x) <<= v2; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator<<(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2) + { + return vec<4, T, Q>(v1) <<= v2; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator>>(vec<4, T, Q> const& v, T scalar) + { + return vec<4, T, Q>(v) >>= scalar; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator>>(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2) + { + return vec<4, T, Q>(v1) >>= v2.x; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator>>(T scalar, vec<4, T, Q> const& v) + { + return vec<4, T, Q>(scalar) >>= v; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator>>(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2) + { + return vec<4, T, Q>(v1.x) >>= v2; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator>>(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2) + { + return vec<4, T, Q>(v1) >>= v2; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator~(vec<4, T, Q> const& v) + { + return detail::compute_vec4_bitwise_not::value, sizeof(T) * 8, detail::is_aligned::value>::call(v); + } + + // -- Boolean operators -- + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator==(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2) + { + return detail::compute_vec4_equal::value, sizeof(T) * 8, detail::is_aligned::value>::call(v1, v2); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator!=(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2) + { + return detail::compute_vec4_nequal::value, sizeof(T) * 8, detail::is_aligned::value>::call(v1, v2); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, bool, Q> operator&&(vec<4, bool, Q> const& v1, vec<4, bool, Q> const& v2) + { + return vec<4, bool, Q>(v1.x && v2.x, v1.y && v2.y, v1.z && v2.z, v1.w && v2.w); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, bool, Q> operator||(vec<4, bool, Q> const& v1, vec<4, bool, Q> const& v2) + { + return vec<4, bool, Q>(v1.x || v2.x, v1.y || v2.y, v1.z || v2.z, v1.w || v2.w); + } +}//namespace glm + +#if GLM_CONFIG_SIMD == GLM_ENABLE +# include "type_vec4_simd.inl" +#endif diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_vec4_simd.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_vec4_simd.inl new file mode 100644 index 0000000000000000000000000000000000000000..ae9151f48cbbe1bb8457c045cba53d8e17122a01 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/detail/type_vec4_simd.inl @@ -0,0 +1,788 @@ +#if GLM_ARCH & GLM_ARCH_SSE2_BIT + +namespace glm{ +namespace detail +{ +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR + template + struct _swizzle_base1<4, float, Q, E0,E1,E2,E3, true> : public _swizzle_base0 + { + GLM_FUNC_QUALIFIER vec<4, float, Q> operator ()() const + { + __m128 data = *reinterpret_cast<__m128 const*>(&this->_buffer); + + vec<4, float, Q> Result; +# if GLM_ARCH & GLM_ARCH_AVX_BIT + Result.data = _mm_permute_ps(data, _MM_SHUFFLE(E3, E2, E1, E0)); +# else + Result.data = _mm_shuffle_ps(data, data, _MM_SHUFFLE(E3, E2, E1, E0)); +# endif + return Result; + } + }; + + template + struct _swizzle_base1<4, int, Q, E0,E1,E2,E3, true> : public _swizzle_base0 + { + GLM_FUNC_QUALIFIER vec<4, int, Q> operator ()() const + { + __m128i data = *reinterpret_cast<__m128i const*>(&this->_buffer); + + vec<4, int, Q> Result; + Result.data = _mm_shuffle_epi32(data, _MM_SHUFFLE(E3, E2, E1, E0)); + return Result; + } + }; + + template + struct _swizzle_base1<4, uint, Q, E0,E1,E2,E3, true> : public _swizzle_base0 + { + GLM_FUNC_QUALIFIER vec<4, uint, Q> operator ()() const + { + __m128i data = *reinterpret_cast<__m128i const*>(&this->_buffer); + + vec<4, uint, Q> Result; + Result.data = _mm_shuffle_epi32(data, _MM_SHUFFLE(E3, E2, E1, E0)); + return Result; + } + }; +# endif// GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR + + template + struct compute_vec4_add + { + static vec<4, float, Q> call(vec<4, float, Q> const& a, vec<4, float, Q> const& b) + { + vec<4, float, Q> Result; + Result.data = _mm_add_ps(a.data, b.data); + return Result; + } + }; + +# if GLM_ARCH & GLM_ARCH_AVX_BIT + template + struct compute_vec4_add + { + static vec<4, double, Q> call(vec<4, double, Q> const& a, vec<4, double, Q> const& b) + { + vec<4, double, Q> Result; + Result.data = _mm256_add_pd(a.data, b.data); + return Result; + } + }; +# endif + + template + struct compute_vec4_sub + { + static vec<4, float, Q> call(vec<4, float, Q> const& a, vec<4, float, Q> const& b) + { + vec<4, float, Q> Result; + Result.data = _mm_sub_ps(a.data, b.data); + return Result; + } + }; + +# if GLM_ARCH & GLM_ARCH_AVX_BIT + template + struct compute_vec4_sub + { + static vec<4, double, Q> call(vec<4, double, Q> const& a, vec<4, double, Q> const& b) + { + vec<4, double, Q> Result; + Result.data = _mm256_sub_pd(a.data, b.data); + return Result; + } + }; +# endif + + template + struct compute_vec4_mul + { + static vec<4, float, Q> call(vec<4, float, Q> const& a, vec<4, float, Q> const& b) + { + vec<4, float, Q> Result; + Result.data = _mm_mul_ps(a.data, b.data); + return Result; + } + }; + +# if GLM_ARCH & GLM_ARCH_AVX_BIT + template + struct compute_vec4_mul + { + static vec<4, double, Q> call(vec<4, double, Q> const& a, vec<4, double, Q> const& b) + { + vec<4, double, Q> Result; + Result.data = _mm256_mul_pd(a.data, b.data); + return Result; + } + }; +# endif + + template + struct compute_vec4_div + { + static vec<4, float, Q> call(vec<4, float, Q> const& a, vec<4, float, Q> const& b) + { + vec<4, float, Q> Result; + Result.data = _mm_div_ps(a.data, b.data); + return Result; + } + }; + + # if GLM_ARCH & GLM_ARCH_AVX_BIT + template + struct compute_vec4_div + { + static vec<4, double, Q> call(vec<4, double, Q> const& a, vec<4, double, Q> const& b) + { + vec<4, double, Q> Result; + Result.data = _mm256_div_pd(a.data, b.data); + return Result; + } + }; +# endif + + template<> + struct compute_vec4_div + { + static vec<4, float, aligned_lowp> call(vec<4, float, aligned_lowp> const& a, vec<4, float, aligned_lowp> const& b) + { + vec<4, float, aligned_lowp> Result; + Result.data = _mm_mul_ps(a.data, _mm_rcp_ps(b.data)); + return Result; + } + }; + + template + struct compute_vec4_and + { + static vec<4, T, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) + { + vec<4, T, Q> Result; + Result.data = _mm_and_si128(a.data, b.data); + return Result; + } + }; + +# if GLM_ARCH & GLM_ARCH_AVX2_BIT + template + struct compute_vec4_and + { + static vec<4, T, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) + { + vec<4, T, Q> Result; + Result.data = _mm256_and_si256(a.data, b.data); + return Result; + } + }; +# endif + + template + struct compute_vec4_or + { + static vec<4, T, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) + { + vec<4, T, Q> Result; + Result.data = _mm_or_si128(a.data, b.data); + return Result; + } + }; + +# if GLM_ARCH & GLM_ARCH_AVX2_BIT + template + struct compute_vec4_or + { + static vec<4, T, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) + { + vec<4, T, Q> Result; + Result.data = _mm256_or_si256(a.data, b.data); + return Result; + } + }; +# endif + + template + struct compute_vec4_xor + { + static vec<4, T, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) + { + vec<4, T, Q> Result; + Result.data = _mm_xor_si128(a.data, b.data); + return Result; + } + }; + +# if GLM_ARCH & GLM_ARCH_AVX2_BIT + template + struct compute_vec4_xor + { + static vec<4, T, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) + { + vec<4, T, Q> Result; + Result.data = _mm256_xor_si256(a.data, b.data); + return Result; + } + }; +# endif + + template + struct compute_vec4_shift_left + { + static vec<4, T, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) + { + vec<4, T, Q> Result; + Result.data = _mm_sll_epi32(a.data, b.data); + return Result; + } + }; + +# if GLM_ARCH & GLM_ARCH_AVX2_BIT + template + struct compute_vec4_shift_left + { + static vec<4, T, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) + { + vec<4, T, Q> Result; + Result.data = _mm256_sll_epi64(a.data, b.data); + return Result; + } + }; +# endif + + template + struct compute_vec4_shift_right + { + static vec<4, T, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) + { + vec<4, T, Q> Result; + Result.data = _mm_srl_epi32(a.data, b.data); + return Result; + } + }; + +# if GLM_ARCH & GLM_ARCH_AVX2_BIT + template + struct compute_vec4_shift_right + { + static vec<4, T, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) + { + vec<4, T, Q> Result; + Result.data = _mm256_srl_epi64(a.data, b.data); + return Result; + } + }; +# endif + + template + struct compute_vec4_bitwise_not + { + static vec<4, T, Q> call(vec<4, T, Q> const& v) + { + vec<4, T, Q> Result; + Result.data = _mm_xor_si128(v.data, _mm_set1_epi32(-1)); + return Result; + } + }; + +# if GLM_ARCH & GLM_ARCH_AVX2_BIT + template + struct compute_vec4_bitwise_not + { + static vec<4, T, Q> call(vec<4, T, Q> const& v) + { + vec<4, T, Q> Result; + Result.data = _mm256_xor_si256(v.data, _mm_set1_epi32(-1)); + return Result; + } + }; +# endif + + template + struct compute_vec4_equal + { + static bool call(vec<4, float, Q> const& v1, vec<4, float, Q> const& v2) + { + return _mm_movemask_ps(_mm_cmpneq_ps(v1.data, v2.data)) == 0; + } + }; + +# if GLM_ARCH & GLM_ARCH_SSE41_BIT + template + struct compute_vec4_equal + { + static bool call(vec<4, int, Q> const& v1, vec<4, int, Q> const& v2) + { + //return _mm_movemask_epi8(_mm_cmpeq_epi32(v1.data, v2.data)) != 0; + __m128i neq = _mm_xor_si128(v1.data, v2.data); + return _mm_test_all_zeros(neq, neq) == 0; + } + }; +# endif + + template + struct compute_vec4_nequal + { + static bool call(vec<4, float, Q> const& v1, vec<4, float, Q> const& v2) + { + return _mm_movemask_ps(_mm_cmpneq_ps(v1.data, v2.data)) != 0; + } + }; + +# if GLM_ARCH & GLM_ARCH_SSE41_BIT + template + struct compute_vec4_nequal + { + static bool call(vec<4, int, Q> const& v1, vec<4, int, Q> const& v2) + { + //return _mm_movemask_epi8(_mm_cmpneq_epi32(v1.data, v2.data)) != 0; + __m128i neq = _mm_xor_si128(v1.data, v2.data); + return _mm_test_all_zeros(neq, neq) != 0; + } + }; +# endif +}//namespace detail + + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, float, aligned_lowp>::vec(float _s) : + data(_mm_set1_ps(_s)) + {} + + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, float, aligned_mediump>::vec(float _s) : + data(_mm_set1_ps(_s)) + {} + + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, float, aligned_highp>::vec(float _s) : + data(_mm_set1_ps(_s)) + {} + +# if GLM_ARCH & GLM_ARCH_AVX_BIT + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, double, aligned_lowp>::vec(double _s) : + data(_mm256_set1_pd(_s)) + {} + + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, double, aligned_mediump>::vec(double _s) : + data(_mm256_set1_pd(_s)) + {} + + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, double, aligned_highp>::vec(double _s) : + data(_mm256_set1_pd(_s)) + {} +# endif + + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, int, aligned_lowp>::vec(int _s) : + data(_mm_set1_epi32(_s)) + {} + + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, int, aligned_mediump>::vec(int _s) : + data(_mm_set1_epi32(_s)) + {} + + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, int, aligned_highp>::vec(int _s) : + data(_mm_set1_epi32(_s)) + {} + +# if GLM_ARCH & GLM_ARCH_AVX2_BIT + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, detail::int64, aligned_lowp>::vec(detail::int64 _s) : + data(_mm256_set1_epi64x(_s)) + {} + + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, detail::int64, aligned_mediump>::vec(detail::int64 _s) : + data(_mm256_set1_epi64x(_s)) + {} + + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, detail::int64, aligned_highp>::vec(detail::int64 _s) : + data(_mm256_set1_epi64x(_s)) + {} +# endif + + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, float, aligned_lowp>::vec(float _x, float _y, float _z, float _w) : + data(_mm_set_ps(_w, _z, _y, _x)) + {} + + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, float, aligned_mediump>::vec(float _x, float _y, float _z, float _w) : + data(_mm_set_ps(_w, _z, _y, _x)) + {} + + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, float, aligned_highp>::vec(float _x, float _y, float _z, float _w) : + data(_mm_set_ps(_w, _z, _y, _x)) + {} + + template<> + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, int, aligned_lowp>::vec(int _x, int _y, int _z, int _w) : + data(_mm_set_epi32(_w, _z, _y, _x)) + {} + + template<> + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, int, aligned_mediump>::vec(int _x, int _y, int _z, int _w) : + data(_mm_set_epi32(_w, _z, _y, _x)) + {} + + template<> + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, int, aligned_highp>::vec(int _x, int _y, int _z, int _w) : + data(_mm_set_epi32(_w, _z, _y, _x)) + {} + + template<> + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, float, aligned_lowp>::vec(int _x, int _y, int _z, int _w) : + data(_mm_cvtepi32_ps(_mm_set_epi32(_w, _z, _y, _x))) + {} + + template<> + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, float, aligned_mediump>::vec(int _x, int _y, int _z, int _w) : + data(_mm_cvtepi32_ps(_mm_set_epi32(_w, _z, _y, _x))) + {} + + template<> + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, float, aligned_highp>::vec(int _x, int _y, int _z, int _w) : + data(_mm_cvtepi32_ps(_mm_set_epi32(_w, _z, _y, _x))) + {} +}//namespace glm + +#endif//GLM_ARCH & GLM_ARCH_SSE2_BIT + +#if GLM_ARCH & GLM_ARCH_NEON_BIT +namespace glm { +namespace detail { + + template + struct compute_vec4_add + { + static + vec<4, float, Q> + call(vec<4, float, Q> const& a, vec<4, float, Q> const& b) + { + vec<4, float, Q> Result; + Result.data = vaddq_f32(a.data, b.data); + return Result; + } + }; + + template + struct compute_vec4_add + { + static + vec<4, uint, Q> + call(vec<4, uint, Q> const& a, vec<4, uint, Q> const& b) + { + vec<4, uint, Q> Result; + Result.data = vaddq_u32(a.data, b.data); + return Result; + } + }; + + template + struct compute_vec4_add + { + static + vec<4, int, Q> + call(vec<4, int, Q> const& a, vec<4, int, Q> const& b) + { + vec<4, int, Q> Result; + Result.data = vaddq_s32(a.data, b.data); + return Result; + } + }; + + template + struct compute_vec4_sub + { + static vec<4, float, Q> call(vec<4, float, Q> const& a, vec<4, float, Q> const& b) + { + vec<4, float, Q> Result; + Result.data = vsubq_f32(a.data, b.data); + return Result; + } + }; + + template + struct compute_vec4_sub + { + static vec<4, uint, Q> call(vec<4, uint, Q> const& a, vec<4, uint, Q> const& b) + { + vec<4, uint, Q> Result; + Result.data = vsubq_u32(a.data, b.data); + return Result; + } + }; + + template + struct compute_vec4_sub + { + static vec<4, int, Q> call(vec<4, int, Q> const& a, vec<4, int, Q> const& b) + { + vec<4, int, Q> Result; + Result.data = vsubq_s32(a.data, b.data); + return Result; + } + }; + + template + struct compute_vec4_mul + { + static vec<4, float, Q> call(vec<4, float, Q> const& a, vec<4, float, Q> const& b) + { + vec<4, float, Q> Result; + Result.data = vmulq_f32(a.data, b.data); + return Result; + } + }; + + template + struct compute_vec4_mul + { + static vec<4, uint, Q> call(vec<4, uint, Q> const& a, vec<4, uint, Q> const& b) + { + vec<4, uint, Q> Result; + Result.data = vmulq_u32(a.data, b.data); + return Result; + } + }; + + template + struct compute_vec4_mul + { + static vec<4, int, Q> call(vec<4, int, Q> const& a, vec<4, int, Q> const& b) + { + vec<4, int, Q> Result; + Result.data = vmulq_s32(a.data, b.data); + return Result; + } + }; + + template + struct compute_vec4_div + { + static vec<4, float, Q> call(vec<4, float, Q> const& a, vec<4, float, Q> const& b) + { + vec<4, float, Q> Result; +#if GLM_ARCH & GLM_ARCH_ARMV8_BIT + Result.data = vdivq_f32(a.data, b.data); +#else + /* Arm assembler reference: + * + * The Newton-Raphson iteration: x[n+1] = x[n] * (2 - d * x[n]) + * converges to (1/d) if x0 is the result of VRECPE applied to d. + * + * Note: The precision usually improves with two interactions, but more than two iterations are not helpful. */ + float32x4_t x = vrecpeq_f32(b.data); + x = vmulq_f32(vrecpsq_f32(b.data, x), x); + x = vmulq_f32(vrecpsq_f32(b.data, x), x); + Result.data = vmulq_f32(a.data, x); +#endif + return Result; + } + }; + + template + struct compute_vec4_equal + { + static bool call(vec<4, float, Q> const& v1, vec<4, float, Q> const& v2) + { + uint32x4_t cmp = vceqq_f32(v1.data, v2.data); +#if GLM_ARCH & GLM_ARCH_ARMV8_BIT + cmp = vpminq_u32(cmp, cmp); + cmp = vpminq_u32(cmp, cmp); + uint32_t r = cmp[0]; +#else + uint32x2_t cmpx2 = vpmin_u32(vget_low_u32(cmp), vget_high_u32(cmp)); + cmpx2 = vpmin_u32(cmpx2, cmpx2); + uint32_t r = cmpx2[0]; +#endif + return r == ~0u; + } + }; + + template + struct compute_vec4_equal + { + static bool call(vec<4, uint, Q> const& v1, vec<4, uint, Q> const& v2) + { + uint32x4_t cmp = vceqq_u32(v1.data, v2.data); +#if GLM_ARCH & GLM_ARCH_ARMV8_BIT + cmp = vpminq_u32(cmp, cmp); + cmp = vpminq_u32(cmp, cmp); + uint32_t r = cmp[0]; +#else + uint32x2_t cmpx2 = vpmin_u32(vget_low_u32(cmp), vget_high_u32(cmp)); + cmpx2 = vpmin_u32(cmpx2, cmpx2); + uint32_t r = cmpx2[0]; +#endif + return r == ~0u; + } + }; + + template + struct compute_vec4_equal + { + static bool call(vec<4, int, Q> const& v1, vec<4, int, Q> const& v2) + { + uint32x4_t cmp = vceqq_s32(v1.data, v2.data); +#if GLM_ARCH & GLM_ARCH_ARMV8_BIT + cmp = vpminq_u32(cmp, cmp); + cmp = vpminq_u32(cmp, cmp); + uint32_t r = cmp[0]; +#else + uint32x2_t cmpx2 = vpmin_u32(vget_low_u32(cmp), vget_high_u32(cmp)); + cmpx2 = vpmin_u32(cmpx2, cmpx2); + uint32_t r = cmpx2[0]; +#endif + return r == ~0u; + } + }; + + template + struct compute_vec4_nequal + { + static bool call(vec<4, float, Q> const& v1, vec<4, float, Q> const& v2) + { + return !compute_vec4_equal::call(v1, v2); + } + }; + + template + struct compute_vec4_nequal + { + static bool call(vec<4, uint, Q> const& v1, vec<4, uint, Q> const& v2) + { + return !compute_vec4_equal::call(v1, v2); + } + }; + + template + struct compute_vec4_nequal + { + static bool call(vec<4, int, Q> const& v1, vec<4, int, Q> const& v2) + { + return !compute_vec4_equal::call(v1, v2); + } + }; + +}//namespace detail + +#if !GLM_CONFIG_XYZW_ONLY + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, float, aligned_lowp>::vec(float _s) : + data(vdupq_n_f32(_s)) + {} + + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, float, aligned_mediump>::vec(float _s) : + data(vdupq_n_f32(_s)) + {} + + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, float, aligned_highp>::vec(float _s) : + data(vdupq_n_f32(_s)) + {} + + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, int, aligned_lowp>::vec(int _s) : + data(vdupq_n_s32(_s)) + {} + + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, int, aligned_mediump>::vec(int _s) : + data(vdupq_n_s32(_s)) + {} + + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, int, aligned_highp>::vec(int _s) : + data(vdupq_n_s32(_s)) + {} + + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, uint, aligned_lowp>::vec(uint _s) : + data(vdupq_n_u32(_s)) + {} + + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, uint, aligned_mediump>::vec(uint _s) : + data(vdupq_n_u32(_s)) + {} + + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, uint, aligned_highp>::vec(uint _s) : + data(vdupq_n_u32(_s)) + {} + + template<> + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, float, aligned_highp>::vec(const vec<4, float, aligned_highp>& rhs) : + data(rhs.data) + {} + + template<> + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, float, aligned_highp>::vec(const vec<4, int, aligned_highp>& rhs) : + data(vcvtq_f32_s32(rhs.data)) + {} + + template<> + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, float, aligned_highp>::vec(const vec<4, uint, aligned_highp>& rhs) : + data(vcvtq_f32_u32(rhs.data)) + {} + + template<> + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, float, aligned_lowp>::vec(int _x, int _y, int _z, int _w) : + data(vcvtq_f32_s32(vec<4, int, aligned_lowp>(_x, _y, _z, _w).data)) + {} + + template<> + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, float, aligned_mediump>::vec(int _x, int _y, int _z, int _w) : + data(vcvtq_f32_s32(vec<4, int, aligned_mediump>(_x, _y, _z, _w).data)) + {} + + template<> + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, float, aligned_highp>::vec(int _x, int _y, int _z, int _w) : + data(vcvtq_f32_s32(vec<4, int, aligned_highp>(_x, _y, _z, _w).data)) + {} + + template<> + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, float, aligned_lowp>::vec(uint _x, uint _y, uint _z, uint _w) : + data(vcvtq_f32_u32(vec<4, uint, aligned_lowp>(_x, _y, _z, _w).data)) + {} + + template<> + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, float, aligned_mediump>::vec(uint _x, uint _y, uint _z, uint _w) : + data(vcvtq_f32_u32(vec<4, uint, aligned_mediump>(_x, _y, _z, _w).data)) + {} + + + template<> + template<> + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, float, aligned_highp>::vec(uint _x, uint _y, uint _z, uint _w) : + data(vcvtq_f32_u32(vec<4, uint, aligned_highp>(_x, _y, _z, _w).data)) + {} + +#endif +}//namespace glm + +#endif diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/exponential.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/exponential.hpp new file mode 100644 index 0000000000000000000000000000000000000000..8b3879cf3cdb20aa4fbc0a72f1b83e78a52388f7 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/exponential.hpp @@ -0,0 +1,110 @@ +/// @ref core +/// @file glm/exponential.hpp +/// +/// @see GLSL 4.20.8 specification, section 8.2 Exponential Functions +/// +/// @defgroup core_func_exponential Exponential functions +/// @ingroup core +/// +/// Provides GLSL exponential functions +/// +/// These all operate component-wise. The description is per component. +/// +/// Include to use these core features. + +#pragma once + +#include "detail/type_vec1.hpp" +#include "detail/type_vec2.hpp" +#include "detail/type_vec3.hpp" +#include "detail/type_vec4.hpp" +#include + +namespace glm +{ + /// @addtogroup core_func_exponential + /// @{ + + /// Returns 'base' raised to the power 'exponent'. + /// + /// @param base Floating point value. pow function is defined for input values of 'base' defined in the range (inf-, inf+) in the limit of the type qualifier. + /// @param exponent Floating point value representing the 'exponent'. + /// + /// @see GLSL pow man page + /// @see GLSL 4.20.8 specification, section 8.2 Exponential Functions + template + GLM_FUNC_DECL vec pow(vec const& base, vec const& exponent); + + /// Returns the natural exponentiation of v, i.e., e^v. + /// + /// @param v exp function is defined for input values of v defined in the range (inf-, inf+) in the limit of the type qualifier. + /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. + /// @tparam T Floating-point scalar types. + /// + /// @see GLSL exp man page + /// @see GLSL 4.20.8 specification, section 8.2 Exponential Functions + template + GLM_FUNC_DECL vec exp(vec const& v); + + /// Returns the natural logarithm of v, i.e., + /// returns the value y which satisfies the equation x = e^y. + /// Results are undefined if v <= 0. + /// + /// @param v log function is defined for input values of v defined in the range (0, inf+) in the limit of the type qualifier. + /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. + /// @tparam T Floating-point scalar types. + /// + /// @see GLSL log man page + /// @see GLSL 4.20.8 specification, section 8.2 Exponential Functions + template + GLM_FUNC_DECL vec log(vec const& v); + + /// Returns 2 raised to the v power. + /// + /// @param v exp2 function is defined for input values of v defined in the range (inf-, inf+) in the limit of the type qualifier. + /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. + /// @tparam T Floating-point scalar types. + /// + /// @see GLSL exp2 man page + /// @see GLSL 4.20.8 specification, section 8.2 Exponential Functions + template + GLM_FUNC_DECL vec exp2(vec const& v); + + /// Returns the base 2 log of x, i.e., returns the value y, + /// which satisfies the equation x = 2 ^ y. + /// + /// @param v log2 function is defined for input values of v defined in the range (0, inf+) in the limit of the type qualifier. + /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. + /// @tparam T Floating-point scalar types. + /// + /// @see GLSL log2 man page + /// @see GLSL 4.20.8 specification, section 8.2 Exponential Functions + template + GLM_FUNC_DECL vec log2(vec const& v); + + /// Returns the positive square root of v. + /// + /// @param v sqrt function is defined for input values of v defined in the range [0, inf+) in the limit of the type qualifier. + /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. + /// @tparam T Floating-point scalar types. + /// + /// @see GLSL sqrt man page + /// @see GLSL 4.20.8 specification, section 8.2 Exponential Functions + template + GLM_FUNC_DECL vec sqrt(vec const& v); + + /// Returns the reciprocal of the positive square root of v. + /// + /// @param v inversesqrt function is defined for input values of v defined in the range [0, inf+) in the limit of the type qualifier. + /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. + /// @tparam T Floating-point scalar types. + /// + /// @see GLSL inversesqrt man page + /// @see GLSL 4.20.8 specification, section 8.2 Exponential Functions + template + GLM_FUNC_DECL vec inversesqrt(vec const& v); + + /// @} +}//namespace glm + +#include "detail/func_exponential.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext.hpp new file mode 100644 index 0000000000000000000000000000000000000000..b981297133ddfea6a89e2793576b2d9dbc9a9837 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext.hpp @@ -0,0 +1,255 @@ +/// @file glm/ext.hpp +/// +/// @ref core (Dependence) + +#include "detail/setup.hpp" + +#pragma once + +#include "glm.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_MESSAGE_EXT_INCLUDED_DISPLAYED) +# define GLM_MESSAGE_EXT_INCLUDED_DISPLAYED +# pragma message("GLM: All extensions included (not recommended)") +#endif//GLM_MESSAGES + +#include "./ext/matrix_clip_space.hpp" +#include "./ext/matrix_common.hpp" + +#include "./ext/matrix_double2x2.hpp" +#include "./ext/matrix_double2x2_precision.hpp" +#include "./ext/matrix_double2x3.hpp" +#include "./ext/matrix_double2x3_precision.hpp" +#include "./ext/matrix_double2x4.hpp" +#include "./ext/matrix_double2x4_precision.hpp" +#include "./ext/matrix_double3x2.hpp" +#include "./ext/matrix_double3x2_precision.hpp" +#include "./ext/matrix_double3x3.hpp" +#include "./ext/matrix_double3x3_precision.hpp" +#include "./ext/matrix_double3x4.hpp" +#include "./ext/matrix_double3x4_precision.hpp" +#include "./ext/matrix_double4x2.hpp" +#include "./ext/matrix_double4x2_precision.hpp" +#include "./ext/matrix_double4x3.hpp" +#include "./ext/matrix_double4x3_precision.hpp" +#include "./ext/matrix_double4x4.hpp" +#include "./ext/matrix_double4x4_precision.hpp" + +#include "./ext/matrix_float2x2.hpp" +#include "./ext/matrix_float2x2_precision.hpp" +#include "./ext/matrix_float2x3.hpp" +#include "./ext/matrix_float2x3_precision.hpp" +#include "./ext/matrix_float2x4.hpp" +#include "./ext/matrix_float2x4_precision.hpp" +#include "./ext/matrix_float3x2.hpp" +#include "./ext/matrix_float3x2_precision.hpp" +#include "./ext/matrix_float3x3.hpp" +#include "./ext/matrix_float3x3_precision.hpp" +#include "./ext/matrix_float3x4.hpp" +#include "./ext/matrix_float3x4_precision.hpp" +#include "./ext/matrix_float4x2.hpp" +#include "./ext/matrix_float4x2_precision.hpp" +#include "./ext/matrix_float4x3.hpp" +#include "./ext/matrix_float4x3_precision.hpp" +#include "./ext/matrix_float4x4.hpp" +#include "./ext/matrix_float4x4_precision.hpp" + +#include "./ext/matrix_int2x2.hpp" +#include "./ext/matrix_int2x2_sized.hpp" +#include "./ext/matrix_int2x3.hpp" +#include "./ext/matrix_int2x3_sized.hpp" +#include "./ext/matrix_int2x4.hpp" +#include "./ext/matrix_int2x4_sized.hpp" +#include "./ext/matrix_int3x2.hpp" +#include "./ext/matrix_int3x2_sized.hpp" +#include "./ext/matrix_int3x3.hpp" +#include "./ext/matrix_int3x3_sized.hpp" +#include "./ext/matrix_int3x4.hpp" +#include "./ext/matrix_int3x4_sized.hpp" +#include "./ext/matrix_int4x2.hpp" +#include "./ext/matrix_int4x2_sized.hpp" +#include "./ext/matrix_int4x3.hpp" +#include "./ext/matrix_int4x3_sized.hpp" +#include "./ext/matrix_int4x4.hpp" +#include "./ext/matrix_int4x4_sized.hpp" + +#include "./ext/matrix_uint2x2.hpp" +#include "./ext/matrix_uint2x2_sized.hpp" +#include "./ext/matrix_uint2x3.hpp" +#include "./ext/matrix_uint2x3_sized.hpp" +#include "./ext/matrix_uint2x4.hpp" +#include "./ext/matrix_uint2x4_sized.hpp" +#include "./ext/matrix_uint3x2.hpp" +#include "./ext/matrix_uint3x2_sized.hpp" +#include "./ext/matrix_uint3x3.hpp" +#include "./ext/matrix_uint3x3_sized.hpp" +#include "./ext/matrix_uint3x4.hpp" +#include "./ext/matrix_uint3x4_sized.hpp" +#include "./ext/matrix_uint4x2.hpp" +#include "./ext/matrix_uint4x2_sized.hpp" +#include "./ext/matrix_uint4x3.hpp" +#include "./ext/matrix_uint4x3_sized.hpp" +#include "./ext/matrix_uint4x4.hpp" +#include "./ext/matrix_uint4x4_sized.hpp" + +#include "./ext/matrix_projection.hpp" +#include "./ext/matrix_relational.hpp" +#include "./ext/matrix_transform.hpp" + +#include "./ext/quaternion_common.hpp" +#include "./ext/quaternion_double.hpp" +#include "./ext/quaternion_double_precision.hpp" +#include "./ext/quaternion_float.hpp" +#include "./ext/quaternion_float_precision.hpp" +#include "./ext/quaternion_exponential.hpp" +#include "./ext/quaternion_geometric.hpp" +#include "./ext/quaternion_relational.hpp" +#include "./ext/quaternion_transform.hpp" +#include "./ext/quaternion_trigonometric.hpp" + +#include "./ext/scalar_common.hpp" +#include "./ext/scalar_constants.hpp" +#include "./ext/scalar_integer.hpp" +#include "./ext/scalar_packing.hpp" +#include "./ext/scalar_reciprocal.hpp" +#include "./ext/scalar_relational.hpp" +#include "./ext/scalar_ulp.hpp" + +#include "./ext/scalar_int_sized.hpp" +#include "./ext/scalar_uint_sized.hpp" + +#include "./ext/vector_common.hpp" +#include "./ext/vector_integer.hpp" +#include "./ext/vector_packing.hpp" +#include "./ext/vector_reciprocal.hpp" +#include "./ext/vector_relational.hpp" +#include "./ext/vector_ulp.hpp" + +#include "./ext/vector_bool1.hpp" +#include "./ext/vector_bool1_precision.hpp" +#include "./ext/vector_bool2.hpp" +#include "./ext/vector_bool2_precision.hpp" +#include "./ext/vector_bool3.hpp" +#include "./ext/vector_bool3_precision.hpp" +#include "./ext/vector_bool4.hpp" +#include "./ext/vector_bool4_precision.hpp" + +#include "./ext/vector_double1.hpp" +#include "./ext/vector_double1_precision.hpp" +#include "./ext/vector_double2.hpp" +#include "./ext/vector_double2_precision.hpp" +#include "./ext/vector_double3.hpp" +#include "./ext/vector_double3_precision.hpp" +#include "./ext/vector_double4.hpp" +#include "./ext/vector_double4_precision.hpp" + +#include "./ext/vector_float1.hpp" +#include "./ext/vector_float1_precision.hpp" +#include "./ext/vector_float2.hpp" +#include "./ext/vector_float2_precision.hpp" +#include "./ext/vector_float3.hpp" +#include "./ext/vector_float3_precision.hpp" +#include "./ext/vector_float4.hpp" +#include "./ext/vector_float4_precision.hpp" + +#include "./ext/vector_int1.hpp" +#include "./ext/vector_int1_sized.hpp" +#include "./ext/vector_int2.hpp" +#include "./ext/vector_int2_sized.hpp" +#include "./ext/vector_int3.hpp" +#include "./ext/vector_int3_sized.hpp" +#include "./ext/vector_int4.hpp" +#include "./ext/vector_int4_sized.hpp" + +#include "./ext/vector_uint1.hpp" +#include "./ext/vector_uint1_sized.hpp" +#include "./ext/vector_uint2.hpp" +#include "./ext/vector_uint2_sized.hpp" +#include "./ext/vector_uint3.hpp" +#include "./ext/vector_uint3_sized.hpp" +#include "./ext/vector_uint4.hpp" +#include "./ext/vector_uint4_sized.hpp" + +#include "./gtc/bitfield.hpp" +#include "./gtc/color_space.hpp" +#include "./gtc/constants.hpp" +#include "./gtc/epsilon.hpp" +#include "./gtc/integer.hpp" +#include "./gtc/matrix_access.hpp" +#include "./gtc/matrix_integer.hpp" +#include "./gtc/matrix_inverse.hpp" +#include "./gtc/matrix_transform.hpp" +#include "./gtc/noise.hpp" +#include "./gtc/packing.hpp" +#include "./gtc/quaternion.hpp" +#include "./gtc/random.hpp" +#include "./gtc/reciprocal.hpp" +#include "./gtc/round.hpp" +#include "./gtc/type_precision.hpp" +#include "./gtc/type_ptr.hpp" +#include "./gtc/ulp.hpp" +#include "./gtc/vec1.hpp" +#if GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE +# include "./gtc/type_aligned.hpp" +#endif + +#ifdef GLM_ENABLE_EXPERIMENTAL +#include "./gtx/associated_min_max.hpp" +#include "./gtx/bit.hpp" +#include "./gtx/closest_point.hpp" +#include "./gtx/color_encoding.hpp" +#include "./gtx/color_space.hpp" +#include "./gtx/color_space_YCoCg.hpp" +#include "./gtx/compatibility.hpp" +#include "./gtx/component_wise.hpp" +#include "./gtx/dual_quaternion.hpp" +#include "./gtx/euler_angles.hpp" +#include "./gtx/extend.hpp" +#include "./gtx/extended_min_max.hpp" +#include "./gtx/fast_exponential.hpp" +#include "./gtx/fast_square_root.hpp" +#include "./gtx/fast_trigonometry.hpp" +#include "./gtx/functions.hpp" +#include "./gtx/gradient_paint.hpp" +#include "./gtx/handed_coordinate_space.hpp" +#include "./gtx/integer.hpp" +#include "./gtx/intersect.hpp" +#include "./gtx/log_base.hpp" +#include "./gtx/matrix_cross_product.hpp" +#include "./gtx/matrix_interpolation.hpp" +#include "./gtx/matrix_major_storage.hpp" +#include "./gtx/matrix_operation.hpp" +#include "./gtx/matrix_query.hpp" +#include "./gtx/mixed_product.hpp" +#include "./gtx/norm.hpp" +#include "./gtx/normal.hpp" +#include "./gtx/normalize_dot.hpp" +#include "./gtx/number_precision.hpp" +#include "./gtx/optimum_pow.hpp" +#include "./gtx/orthonormalize.hpp" +#include "./gtx/perpendicular.hpp" +#include "./gtx/polar_coordinates.hpp" +#include "./gtx/projection.hpp" +#include "./gtx/quaternion.hpp" +#include "./gtx/raw_data.hpp" +#include "./gtx/rotate_vector.hpp" +#include "./gtx/spline.hpp" +#include "./gtx/std_based_type.hpp" +#if !((GLM_COMPILER & GLM_COMPILER_CUDA) || (GLM_COMPILER & GLM_COMPILER_HIP)) +# include "./gtx/string_cast.hpp" +#endif +#include "./gtx/transform.hpp" +#include "./gtx/transform2.hpp" +#include "./gtx/vec_swizzle.hpp" +#include "./gtx/vector_angle.hpp" +#include "./gtx/vector_query.hpp" +#include "./gtx/wrap.hpp" + +#if GLM_HAS_TEMPLATE_ALIASES +# include "./gtx/scalar_multiplication.hpp" +#endif + +#if GLM_HAS_RANGE_FOR +# include "./gtx/range.hpp" +#endif +#endif//GLM_ENABLE_EXPERIMENTAL diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/_matrix_vectorize.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/_matrix_vectorize.hpp new file mode 100644 index 0000000000000000000000000000000000000000..6e08355510acee16ad84b3415c84a68993151107 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/_matrix_vectorize.hpp @@ -0,0 +1,128 @@ +#pragma once + +namespace glm { + + namespace detail { + + template class mat, length_t C, length_t R, typename Ret, typename T, qualifier Q> + struct matrix_functor_1 { + }; + + template class mat, typename Ret, typename T, qualifier Q> + struct matrix_functor_1 { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static mat<2, 2, T, Q> call(Ret (*Func)(T x), mat<2, 2, T, Q> const &x) { + return mat<2, 2, Ret, Q>( + Func(x[0][0]), Func(x[0][1]), + Func(x[1][0]), Func(x[1][1]) + ); + } + }; + + template class mat, typename Ret, typename T, qualifier Q> + struct matrix_functor_1 { + + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static mat<2, 3, T, Q> call(Ret (*Func)(T x), mat<2, 3, T, Q> const &x) { + return mat<2, 3, Ret, Q>( + Func(x[0][0]), Func(x[0][1]), Func(x[0][2]), + Func(x[1][0]), Func(x[1][1]), Func(x[1][2]) + ); + } + + }; + + template class mat, typename Ret, typename T, qualifier Q> + struct matrix_functor_1 { + + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static mat<2, 4, T, Q> call(Ret (*Func)(T x), mat<2, 4, T, Q> const &x) { + return mat<2, 4, Ret, Q>( + Func(x[0][0]), Func(x[0][1]), Func(x[0][2]), Func(x[0][3]), + Func(x[1][0]), Func(x[1][1]), Func(x[1][2]), Func(x[1][3]) + ); + } + + }; + + template class mat, typename Ret, typename T, qualifier Q> + struct matrix_functor_1 { + + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static mat<3, 2, T, Q> call(Ret (*Func)(T x), mat<3, 2, T, Q> const &x) { + return mat<3, 2, Ret, Q>( + Func(x[0][0]), Func(x[0][1]), + Func(x[1][0]), Func(x[1][1]), + Func(x[2][0]), Func(x[2][1]) + ); + } + + }; + + template class mat, typename Ret, typename T, qualifier Q> + struct matrix_functor_1 { + + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static mat<3, 3, T, Q> call(Ret (*Func)(T x), mat<3, 3, T, Q> const &x) { + return mat<3, 3, Ret, Q>( + Func(x[0][0]), Func(x[0][1]), Func(x[0][2]), + Func(x[1][0]), Func(x[1][1]), Func(x[1][2]), + Func(x[2][0]), Func(x[2][1]), Func(x[2][2]) + ); + } + + }; + + template class mat, typename Ret, typename T, qualifier Q> + struct matrix_functor_1 { + + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static mat<3, 4, T, Q> call(Ret (*Func)(T x), mat<3, 4, T, Q> const &x) { + return mat<3, 4, Ret, Q>( + Func(x[0][0]), Func(x[0][1]), Func(x[0][2]), Func(x[0][3]), + Func(x[1][0]), Func(x[1][1]), Func(x[1][2]), Func(x[1][3]), + Func(x[2][0]), Func(x[2][1]), Func(x[2][2]), Func(x[2][3]) + ); + } + + }; + + template class mat, typename Ret, typename T, qualifier Q> + struct matrix_functor_1 { + + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static mat<4, 2, T, Q> call(Ret (*Func)(T x), mat<4, 2, T, Q> const &x) { + return mat<4, 2, Ret, Q>( + Func(x[0][0]), Func(x[0][1]), + Func(x[1][0]), Func(x[1][1]), + Func(x[2][0]), Func(x[2][1]), + Func(x[3][0]), Func(x[3][1]) + ); + } + + }; + + template class mat, typename Ret, typename T, qualifier Q> + struct matrix_functor_1 { + + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static mat<4, 3, T, Q> call(Ret (*Func)(T x), mat<4, 3, T, Q> const &x) { + return mat<4, 3, Ret, Q>( + Func(x[0][0]), Func(x[0][1]), Func(x[0][2]), + Func(x[1][0]), Func(x[1][1]), Func(x[1][2]), + Func(x[2][0]), Func(x[2][1]), Func(x[2][2]), + Func(x[3][0]), Func(x[3][1]), Func(x[3][2]) + ); + } + + }; + + template class mat, typename Ret, typename T, qualifier Q> + struct matrix_functor_1 { + + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static mat<4, 4, T, Q> call(Ret (*Func)(T x), mat<4, 4, T, Q> const &x) { + return mat<4, 4, Ret, Q>( + Func(x[0][0]), Func(x[0][1]), Func(x[0][2]), Func(x[0][3]), + Func(x[1][0]), Func(x[1][1]), Func(x[1][2]), Func(x[1][3]), + Func(x[2][0]), Func(x[2][1]), Func(x[2][2]), Func(x[2][3]), + Func(x[3][0]), Func(x[3][1]), Func(x[3][2]), Func(x[3][3]) + ); + } + + }; + + } + +}// namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_clip_space.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_clip_space.hpp new file mode 100644 index 0000000000000000000000000000000000000000..ea3fb94dfb23374c5e982e1e7d61b6d0e115858c --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_clip_space.hpp @@ -0,0 +1,522 @@ +/// @ref ext_matrix_clip_space +/// @file glm/ext/matrix_clip_space.hpp +/// +/// @defgroup ext_matrix_clip_space GLM_EXT_matrix_clip_space +/// @ingroup ext +/// +/// Defines functions that generate clip space transformation matrices. +/// +/// The matrices generated by this extension use standard OpenGL fixed-function +/// conventions. For example, the lookAt function generates a transform from world +/// space into the specific eye space that the projective matrix functions +/// (perspective, ortho, etc) are designed to expect. The OpenGL compatibility +/// specifications defines the particular layout of this eye space. +/// +/// Include to use the features of this extension. +/// +/// @see ext_matrix_transform +/// @see ext_matrix_projection + +#pragma once + +// Dependencies +#include "../ext/scalar_constants.hpp" +#include "../geometric.hpp" +#include "../trigonometric.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_clip_space extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_clip_space + /// @{ + + /// Creates a matrix for projecting two-dimensional coordinates onto the screen. + /// + /// @tparam T A floating-point scalar type + /// + /// @see - glm::ortho(T const& left, T const& right, T const& bottom, T const& top, T const& zNear, T const& zFar) + /// @see gluOrtho2D man page + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> ortho( + T left, T right, T bottom, T top); + + /// Creates a matrix for an orthographic parallel viewing volume, using left-handed coordinates. + /// The near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) + /// + /// @tparam T A floating-point scalar type + /// + /// @see - glm::ortho(T const& left, T const& right, T const& bottom, T const& top) + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> orthoLH_ZO( + T left, T right, T bottom, T top, T zNear, T zFar); + + /// Creates a matrix for an orthographic parallel viewing volume using left-handed coordinates. + /// The near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) + /// + /// @tparam T A floating-point scalar type + /// + /// @see - glm::ortho(T const& left, T const& right, T const& bottom, T const& top) + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> orthoLH_NO( + T left, T right, T bottom, T top, T zNear, T zFar); + + /// Creates a matrix for an orthographic parallel viewing volume, using right-handed coordinates. + /// The near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) + /// + /// @tparam T A floating-point scalar type + /// + /// @see - glm::ortho(T const& left, T const& right, T const& bottom, T const& top) + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> orthoRH_ZO( + T left, T right, T bottom, T top, T zNear, T zFar); + + /// Creates a matrix for an orthographic parallel viewing volume, using right-handed coordinates. + /// The near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) + /// + /// @tparam T A floating-point scalar type + /// + /// @see - glm::ortho(T const& left, T const& right, T const& bottom, T const& top) + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> orthoRH_NO( + T left, T right, T bottom, T top, T zNear, T zFar); + + /// Creates a matrix for an orthographic parallel viewing volume, using left-handed coordinates. + /// The near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) + /// + /// @tparam T A floating-point scalar type + /// + /// @see - glm::ortho(T const& left, T const& right, T const& bottom, T const& top) + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> orthoZO( + T left, T right, T bottom, T top, T zNear, T zFar); + + /// Creates a matrix for an orthographic parallel viewing volume, using left-handed coordinates if GLM_FORCE_LEFT_HANDED if defined or right-handed coordinates otherwise. + /// The near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) + /// + /// @tparam T A floating-point scalar type + /// + /// @see - glm::ortho(T const& left, T const& right, T const& bottom, T const& top) + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> orthoNO( + T left, T right, T bottom, T top, T zNear, T zFar); + + /// Creates a matrix for an orthographic parallel viewing volume, using left-handed coordinates. + /// If GLM_FORCE_DEPTH_ZERO_TO_ONE is defined, the near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) + /// Otherwise, the near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) + /// + /// @tparam T A floating-point scalar type + /// + /// @see - glm::ortho(T const& left, T const& right, T const& bottom, T const& top) + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> orthoLH( + T left, T right, T bottom, T top, T zNear, T zFar); + + /// Creates a matrix for an orthographic parallel viewing volume, using right-handed coordinates. + /// If GLM_FORCE_DEPTH_ZERO_TO_ONE is defined, the near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) + /// Otherwise, the near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) + /// + /// @tparam T A floating-point scalar type + /// + /// @see - glm::ortho(T const& left, T const& right, T const& bottom, T const& top) + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> orthoRH( + T left, T right, T bottom, T top, T zNear, T zFar); + + /// Creates a matrix for an orthographic parallel viewing volume, using the default handedness and default near and far clip planes definition. + /// To change default handedness use GLM_FORCE_LEFT_HANDED. To change default near and far clip planes definition use GLM_FORCE_DEPTH_ZERO_TO_ONE. + /// + /// @tparam T A floating-point scalar type + /// + /// @see - glm::ortho(T const& left, T const& right, T const& bottom, T const& top) + /// @see glOrtho man page + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> ortho( + T left, T right, T bottom, T top, T zNear, T zFar); + + /// Creates a left-handed frustum matrix. + /// The near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) + /// + /// @tparam T A floating-point scalar type + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> frustumLH_ZO( + T left, T right, T bottom, T top, T near, T far); + + /// Creates a left-handed frustum matrix. + /// The near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) + /// + /// @tparam T A floating-point scalar type + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> frustumLH_NO( + T left, T right, T bottom, T top, T near, T far); + + /// Creates a right-handed frustum matrix. + /// The near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) + /// + /// @tparam T A floating-point scalar type + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> frustumRH_ZO( + T left, T right, T bottom, T top, T near, T far); + + /// Creates a right-handed frustum matrix. + /// The near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) + /// + /// @tparam T A floating-point scalar type + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> frustumRH_NO( + T left, T right, T bottom, T top, T near, T far); + + /// Creates a frustum matrix using left-handed coordinates if GLM_FORCE_LEFT_HANDED if defined or right-handed coordinates otherwise. + /// The near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) + /// + /// @tparam T A floating-point scalar type + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> frustumZO( + T left, T right, T bottom, T top, T near, T far); + + /// Creates a frustum matrix using left-handed coordinates if GLM_FORCE_LEFT_HANDED if defined or right-handed coordinates otherwise. + /// The near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) + /// + /// @tparam T A floating-point scalar type + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> frustumNO( + T left, T right, T bottom, T top, T near, T far); + + /// Creates a left-handed frustum matrix. + /// If GLM_FORCE_DEPTH_ZERO_TO_ONE is defined, the near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) + /// Otherwise, the near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) + /// + /// @tparam T A floating-point scalar type + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> frustumLH( + T left, T right, T bottom, T top, T near, T far); + + /// Creates a right-handed frustum matrix. + /// If GLM_FORCE_DEPTH_ZERO_TO_ONE is defined, the near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) + /// Otherwise, the near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) + /// + /// @tparam T A floating-point scalar type + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> frustumRH( + T left, T right, T bottom, T top, T near, T far); + + /// Creates a frustum matrix with default handedness, using the default handedness and default near and far clip planes definition. + /// To change default handedness use GLM_FORCE_LEFT_HANDED. To change default near and far clip planes definition use GLM_FORCE_DEPTH_ZERO_TO_ONE. + /// + /// @tparam T A floating-point scalar type + /// @see glFrustum man page + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> frustum( + T left, T right, T bottom, T top, T near, T far); + + + /// Creates a matrix for a right-handed, symmetric perspective-view frustum. + /// The near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) + /// + /// @param fovy Specifies the field of view angle, in degrees, in the y direction. Expressed in radians. + /// @param aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height). + /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). + /// @param far Specifies the distance from the viewer to the far clipping plane (always positive). + /// + /// @tparam T A floating-point scalar type + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveRH_ZO( + T fovy, T aspect, T near, T far); + + /// Creates a matrix for a right-handed, symmetric perspective-view frustum. + /// The near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) + /// + /// @param fovy Specifies the field of view angle, in degrees, in the y direction. Expressed in radians. + /// @param aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height). + /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). + /// @param far Specifies the distance from the viewer to the far clipping plane (always positive). + /// + /// @tparam T A floating-point scalar type + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveRH_NO( + T fovy, T aspect, T near, T far); + + /// Creates a matrix for a left-handed, symmetric perspective-view frustum. + /// The near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) + /// + /// @param fovy Specifies the field of view angle, in degrees, in the y direction. Expressed in radians. + /// @param aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height). + /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). + /// @param far Specifies the distance from the viewer to the far clipping plane (always positive). + /// + /// @tparam T A floating-point scalar type + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveLH_ZO( + T fovy, T aspect, T near, T far); + + /// Creates a matrix for a left-handed, symmetric perspective-view frustum. + /// The near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) + /// + /// @param fovy Specifies the field of view angle, in degrees, in the y direction. Expressed in radians. + /// @param aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height). + /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). + /// @param far Specifies the distance from the viewer to the far clipping plane (always positive). + /// + /// @tparam T A floating-point scalar type + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveLH_NO( + T fovy, T aspect, T near, T far); + + /// Creates a matrix for a symmetric perspective-view frustum using left-handed coordinates if GLM_FORCE_LEFT_HANDED if defined or right-handed coordinates otherwise. + /// The near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) + /// + /// @param fovy Specifies the field of view angle, in degrees, in the y direction. Expressed in radians. + /// @param aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height). + /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). + /// @param far Specifies the distance from the viewer to the far clipping plane (always positive). + /// + /// @tparam T A floating-point scalar type + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveZO( + T fovy, T aspect, T near, T far); + + /// Creates a matrix for a symmetric perspective-view frustum using left-handed coordinates if GLM_FORCE_LEFT_HANDED if defined or right-handed coordinates otherwise. + /// The near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) + /// + /// @param fovy Specifies the field of view angle, in degrees, in the y direction. Expressed in radians. + /// @param aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height). + /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). + /// @param far Specifies the distance from the viewer to the far clipping plane (always positive). + /// + /// @tparam T A floating-point scalar type + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveNO( + T fovy, T aspect, T near, T far); + + /// Creates a matrix for a right-handed, symmetric perspective-view frustum. + /// If GLM_FORCE_DEPTH_ZERO_TO_ONE is defined, the near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) + /// Otherwise, the near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) + /// + /// @param fovy Specifies the field of view angle, in degrees, in the y direction. Expressed in radians. + /// @param aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height). + /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). + /// @param far Specifies the distance from the viewer to the far clipping plane (always positive). + /// + /// @tparam T A floating-point scalar type + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveRH( + T fovy, T aspect, T near, T far); + + /// Creates a matrix for a left-handed, symmetric perspective-view frustum. + /// If GLM_FORCE_DEPTH_ZERO_TO_ONE is defined, the near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) + /// Otherwise, the near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) + /// + /// @param fovy Specifies the field of view angle, in degrees, in the y direction. Expressed in radians. + /// @param aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height). + /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). + /// @param far Specifies the distance from the viewer to the far clipping plane (always positive). + /// + /// @tparam T A floating-point scalar type + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveLH( + T fovy, T aspect, T near, T far); + + /// Creates a matrix for a symmetric perspective-view frustum based on the default handedness and default near and far clip planes definition. + /// To change default handedness use GLM_FORCE_LEFT_HANDED. To change default near and far clip planes definition use GLM_FORCE_DEPTH_ZERO_TO_ONE. + /// + /// @param fovy Specifies the field of view angle in the y direction. Expressed in radians. + /// @param aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height). + /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). + /// @param far Specifies the distance from the viewer to the far clipping plane (always positive). + /// + /// @tparam T A floating-point scalar type + /// @see gluPerspective man page + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> perspective( + T fovy, T aspect, T near, T far); + + /// Builds a perspective projection matrix based on a field of view using right-handed coordinates. + /// The near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) + /// + /// @param fov Expressed in radians. + /// @param width Width of the viewport + /// @param height Height of the viewport + /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). + /// @param far Specifies the distance from the viewer to the far clipping plane (always positive). + /// + /// @tparam T A floating-point scalar type + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveFovRH_ZO( + T fov, T width, T height, T near, T far); + + /// Builds a perspective projection matrix based on a field of view using right-handed coordinates. + /// The near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) + /// + /// @param fov Expressed in radians. + /// @param width Width of the viewport + /// @param height Height of the viewport + /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). + /// @param far Specifies the distance from the viewer to the far clipping plane (always positive). + /// + /// @tparam T A floating-point scalar type + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveFovRH_NO( + T fov, T width, T height, T near, T far); + + /// Builds a perspective projection matrix based on a field of view using left-handed coordinates. + /// The near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) + /// + /// @param fov Expressed in radians. + /// @param width Width of the viewport + /// @param height Height of the viewport + /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). + /// @param far Specifies the distance from the viewer to the far clipping plane (always positive). + /// + /// @tparam T A floating-point scalar type + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveFovLH_ZO( + T fov, T width, T height, T near, T far); + + /// Builds a perspective projection matrix based on a field of view using left-handed coordinates. + /// The near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) + /// + /// @param fov Expressed in radians. + /// @param width Width of the viewport + /// @param height Height of the viewport + /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). + /// @param far Specifies the distance from the viewer to the far clipping plane (always positive). + /// + /// @tparam T A floating-point scalar type + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveFovLH_NO( + T fov, T width, T height, T near, T far); + + /// Builds a perspective projection matrix based on a field of view using left-handed coordinates if GLM_FORCE_LEFT_HANDED if defined or right-handed coordinates otherwise. + /// The near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) + /// + /// @param fov Expressed in radians. + /// @param width Width of the viewport + /// @param height Height of the viewport + /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). + /// @param far Specifies the distance from the viewer to the far clipping plane (always positive). + /// + /// @tparam T A floating-point scalar type + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveFovZO( + T fov, T width, T height, T near, T far); + + /// Builds a perspective projection matrix based on a field of view using left-handed coordinates if GLM_FORCE_LEFT_HANDED if defined or right-handed coordinates otherwise. + /// The near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) + /// + /// @param fov Expressed in radians. + /// @param width Width of the viewport + /// @param height Height of the viewport + /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). + /// @param far Specifies the distance from the viewer to the far clipping plane (always positive). + /// + /// @tparam T A floating-point scalar type + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveFovNO( + T fov, T width, T height, T near, T far); + + /// Builds a right-handed perspective projection matrix based on a field of view. + /// If GLM_FORCE_DEPTH_ZERO_TO_ONE is defined, the near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) + /// Otherwise, the near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) + /// + /// @param fov Expressed in radians. + /// @param width Width of the viewport + /// @param height Height of the viewport + /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). + /// @param far Specifies the distance from the viewer to the far clipping plane (always positive). + /// + /// @tparam T A floating-point scalar type + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveFovRH( + T fov, T width, T height, T near, T far); + + /// Builds a left-handed perspective projection matrix based on a field of view. + /// If GLM_FORCE_DEPTH_ZERO_TO_ONE is defined, the near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) + /// Otherwise, the near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) + /// + /// @param fov Expressed in radians. + /// @param width Width of the viewport + /// @param height Height of the viewport + /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). + /// @param far Specifies the distance from the viewer to the far clipping plane (always positive). + /// + /// @tparam T A floating-point scalar type + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveFovLH( + T fov, T width, T height, T near, T far); + + /// Builds a perspective projection matrix based on a field of view and the default handedness and default near and far clip planes definition. + /// To change default handedness use GLM_FORCE_LEFT_HANDED. To change default near and far clip planes definition use GLM_FORCE_DEPTH_ZERO_TO_ONE. + /// + /// @param fov Expressed in radians. + /// @param width Width of the viewport + /// @param height Height of the viewport + /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). + /// @param far Specifies the distance from the viewer to the far clipping plane (always positive). + /// + /// @tparam T A floating-point scalar type + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveFov( + T fov, T width, T height, T near, T far); + + /// Creates a matrix for a left-handed, symmetric perspective-view frustum with far plane at infinite. + /// + /// @param fovy Specifies the field of view angle, in degrees, in the y direction. Expressed in radians. + /// @param aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height). + /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). + /// + /// @tparam T A floating-point scalar type + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> infinitePerspectiveLH( + T fovy, T aspect, T near); + + /// Creates a matrix for a right-handed, symmetric perspective-view frustum with far plane at infinite. + /// + /// @param fovy Specifies the field of view angle, in degrees, in the y direction. Expressed in radians. + /// @param aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height). + /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). + /// + /// @tparam T A floating-point scalar type + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> infinitePerspectiveRH( + T fovy, T aspect, T near); + + /// Creates a matrix for a symmetric perspective-view frustum with far plane at infinite with default handedness. + /// + /// @param fovy Specifies the field of view angle, in degrees, in the y direction. Expressed in radians. + /// @param aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height). + /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). + /// + /// @tparam T A floating-point scalar type + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> infinitePerspective( + T fovy, T aspect, T near); + + /// Creates a matrix for a symmetric perspective-view frustum with far plane at infinite for graphics hardware that doesn't support depth clamping. + /// + /// @param fovy Specifies the field of view angle, in degrees, in the y direction. Expressed in radians. + /// @param aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height). + /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). + /// + /// @tparam T A floating-point scalar type + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> tweakedInfinitePerspective( + T fovy, T aspect, T near); + + /// Creates a matrix for a symmetric perspective-view frustum with far plane at infinite for graphics hardware that doesn't support depth clamping. + /// + /// @param fovy Specifies the field of view angle, in degrees, in the y direction. Expressed in radians. + /// @param aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height). + /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). + /// @param ep Epsilon + /// + /// @tparam T A floating-point scalar type + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> tweakedInfinitePerspective( + T fovy, T aspect, T near, T ep); + + /// @} +}//namespace glm + +#include "matrix_clip_space.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_clip_space.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_clip_space.inl new file mode 100644 index 0000000000000000000000000000000000000000..77b9319947e51634b1628e5ad67cb6dba668339a --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_clip_space.inl @@ -0,0 +1,555 @@ +namespace glm +{ + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> ortho(T left, T right, T bottom, T top) + { + mat<4, 4, T, defaultp> Result(static_cast(1)); + Result[0][0] = static_cast(2) / (right - left); + Result[1][1] = static_cast(2) / (top - bottom); + Result[2][2] = - static_cast(1); + Result[3][0] = - (right + left) / (right - left); + Result[3][1] = - (top + bottom) / (top - bottom); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> orthoLH_ZO(T left, T right, T bottom, T top, T zNear, T zFar) + { + mat<4, 4, T, defaultp> Result(1); + Result[0][0] = static_cast(2) / (right - left); + Result[1][1] = static_cast(2) / (top - bottom); + Result[2][2] = static_cast(1) / (zFar - zNear); + Result[3][0] = - (right + left) / (right - left); + Result[3][1] = - (top + bottom) / (top - bottom); + Result[3][2] = - zNear / (zFar - zNear); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> orthoLH_NO(T left, T right, T bottom, T top, T zNear, T zFar) + { + mat<4, 4, T, defaultp> Result(1); + Result[0][0] = static_cast(2) / (right - left); + Result[1][1] = static_cast(2) / (top - bottom); + Result[2][2] = static_cast(2) / (zFar - zNear); + Result[3][0] = - (right + left) / (right - left); + Result[3][1] = - (top + bottom) / (top - bottom); + Result[3][2] = - (zFar + zNear) / (zFar - zNear); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> orthoRH_ZO(T left, T right, T bottom, T top, T zNear, T zFar) + { + mat<4, 4, T, defaultp> Result(1); + Result[0][0] = static_cast(2) / (right - left); + Result[1][1] = static_cast(2) / (top - bottom); + Result[2][2] = - static_cast(1) / (zFar - zNear); + Result[3][0] = - (right + left) / (right - left); + Result[3][1] = - (top + bottom) / (top - bottom); + Result[3][2] = - zNear / (zFar - zNear); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> orthoRH_NO(T left, T right, T bottom, T top, T zNear, T zFar) + { + mat<4, 4, T, defaultp> Result(1); + Result[0][0] = static_cast(2) / (right - left); + Result[1][1] = static_cast(2) / (top - bottom); + Result[2][2] = - static_cast(2) / (zFar - zNear); + Result[3][0] = - (right + left) / (right - left); + Result[3][1] = - (top + bottom) / (top - bottom); + Result[3][2] = - (zFar + zNear) / (zFar - zNear); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> orthoZO(T left, T right, T bottom, T top, T zNear, T zFar) + { +# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_LH_BIT + return orthoLH_ZO(left, right, bottom, top, zNear, zFar); +# else + return orthoRH_ZO(left, right, bottom, top, zNear, zFar); +# endif + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> orthoNO(T left, T right, T bottom, T top, T zNear, T zFar) + { +# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_LH_BIT + return orthoLH_NO(left, right, bottom, top, zNear, zFar); +# else + return orthoRH_NO(left, right, bottom, top, zNear, zFar); +# endif + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> orthoLH(T left, T right, T bottom, T top, T zNear, T zFar) + { +# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_ZO_BIT + return orthoLH_ZO(left, right, bottom, top, zNear, zFar); +# else + return orthoLH_NO(left, right, bottom, top, zNear, zFar); +# endif + + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> orthoRH(T left, T right, T bottom, T top, T zNear, T zFar) + { +# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_ZO_BIT + return orthoRH_ZO(left, right, bottom, top, zNear, zFar); +# else + return orthoRH_NO(left, right, bottom, top, zNear, zFar); +# endif + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> ortho(T left, T right, T bottom, T top, T zNear, T zFar) + { +# if GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_LH_ZO + return orthoLH_ZO(left, right, bottom, top, zNear, zFar); +# elif GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_LH_NO + return orthoLH_NO(left, right, bottom, top, zNear, zFar); +# elif GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_RH_ZO + return orthoRH_ZO(left, right, bottom, top, zNear, zFar); +# elif GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_RH_NO + return orthoRH_NO(left, right, bottom, top, zNear, zFar); +# endif + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> frustumLH_ZO(T left, T right, T bottom, T top, T nearVal, T farVal) + { + mat<4, 4, T, defaultp> Result(0); + Result[0][0] = (static_cast(2) * nearVal) / (right - left); + Result[1][1] = (static_cast(2) * nearVal) / (top - bottom); + Result[2][0] = -(right + left) / (right - left); + Result[2][1] = -(top + bottom) / (top - bottom); + Result[2][2] = farVal / (farVal - nearVal); + Result[2][3] = static_cast(1); + Result[3][2] = -(farVal * nearVal) / (farVal - nearVal); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> frustumLH_NO(T left, T right, T bottom, T top, T nearVal, T farVal) + { + mat<4, 4, T, defaultp> Result(0); + Result[0][0] = (static_cast(2) * nearVal) / (right - left); + Result[1][1] = (static_cast(2) * nearVal) / (top - bottom); + Result[2][0] = -(right + left) / (right - left); + Result[2][1] = -(top + bottom) / (top - bottom); + Result[2][2] = (farVal + nearVal) / (farVal - nearVal); + Result[2][3] = static_cast(1); + Result[3][2] = - (static_cast(2) * farVal * nearVal) / (farVal - nearVal); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> frustumRH_ZO(T left, T right, T bottom, T top, T nearVal, T farVal) + { + mat<4, 4, T, defaultp> Result(0); + Result[0][0] = (static_cast(2) * nearVal) / (right - left); + Result[1][1] = (static_cast(2) * nearVal) / (top - bottom); + Result[2][0] = (right + left) / (right - left); + Result[2][1] = (top + bottom) / (top - bottom); + Result[2][2] = farVal / (nearVal - farVal); + Result[2][3] = static_cast(-1); + Result[3][2] = -(farVal * nearVal) / (farVal - nearVal); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> frustumRH_NO(T left, T right, T bottom, T top, T nearVal, T farVal) + { + mat<4, 4, T, defaultp> Result(0); + Result[0][0] = (static_cast(2) * nearVal) / (right - left); + Result[1][1] = (static_cast(2) * nearVal) / (top - bottom); + Result[2][0] = (right + left) / (right - left); + Result[2][1] = (top + bottom) / (top - bottom); + Result[2][2] = - (farVal + nearVal) / (farVal - nearVal); + Result[2][3] = static_cast(-1); + Result[3][2] = - (static_cast(2) * farVal * nearVal) / (farVal - nearVal); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> frustumZO(T left, T right, T bottom, T top, T nearVal, T farVal) + { +# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_LH_BIT + return frustumLH_ZO(left, right, bottom, top, nearVal, farVal); +# else + return frustumRH_ZO(left, right, bottom, top, nearVal, farVal); +# endif + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> frustumNO(T left, T right, T bottom, T top, T nearVal, T farVal) + { +# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_LH_BIT + return frustumLH_NO(left, right, bottom, top, nearVal, farVal); +# else + return frustumRH_NO(left, right, bottom, top, nearVal, farVal); +# endif + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> frustumLH(T left, T right, T bottom, T top, T nearVal, T farVal) + { +# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_ZO_BIT + return frustumLH_ZO(left, right, bottom, top, nearVal, farVal); +# else + return frustumLH_NO(left, right, bottom, top, nearVal, farVal); +# endif + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> frustumRH(T left, T right, T bottom, T top, T nearVal, T farVal) + { +# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_ZO_BIT + return frustumRH_ZO(left, right, bottom, top, nearVal, farVal); +# else + return frustumRH_NO(left, right, bottom, top, nearVal, farVal); +# endif + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> frustum(T left, T right, T bottom, T top, T nearVal, T farVal) + { +# if GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_LH_ZO + return frustumLH_ZO(left, right, bottom, top, nearVal, farVal); +# elif GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_LH_NO + return frustumLH_NO(left, right, bottom, top, nearVal, farVal); +# elif GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_RH_ZO + return frustumRH_ZO(left, right, bottom, top, nearVal, farVal); +# elif GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_RH_NO + return frustumRH_NO(left, right, bottom, top, nearVal, farVal); +# endif + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveRH_ZO(T fovy, T aspect, T zNear, T zFar) + { + assert(abs(aspect - std::numeric_limits::epsilon()) > static_cast(0)); + + T const tanHalfFovy = tan(fovy / static_cast(2)); + + mat<4, 4, T, defaultp> Result(static_cast(0)); + Result[0][0] = static_cast(1) / (aspect * tanHalfFovy); + Result[1][1] = static_cast(1) / (tanHalfFovy); + Result[2][2] = zFar / (zNear - zFar); + Result[2][3] = - static_cast(1); + Result[3][2] = -(zFar * zNear) / (zFar - zNear); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveRH_NO(T fovy, T aspect, T zNear, T zFar) + { + assert(abs(aspect - std::numeric_limits::epsilon()) > static_cast(0)); + + T const tanHalfFovy = tan(fovy / static_cast(2)); + + mat<4, 4, T, defaultp> Result(static_cast(0)); + Result[0][0] = static_cast(1) / (aspect * tanHalfFovy); + Result[1][1] = static_cast(1) / (tanHalfFovy); + Result[2][2] = - (zFar + zNear) / (zFar - zNear); + Result[2][3] = - static_cast(1); + Result[3][2] = - (static_cast(2) * zFar * zNear) / (zFar - zNear); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveLH_ZO(T fovy, T aspect, T zNear, T zFar) + { + assert(abs(aspect - std::numeric_limits::epsilon()) > static_cast(0)); + + T const tanHalfFovy = tan(fovy / static_cast(2)); + + mat<4, 4, T, defaultp> Result(static_cast(0)); + Result[0][0] = static_cast(1) / (aspect * tanHalfFovy); + Result[1][1] = static_cast(1) / (tanHalfFovy); + Result[2][2] = zFar / (zFar - zNear); + Result[2][3] = static_cast(1); + Result[3][2] = -(zFar * zNear) / (zFar - zNear); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveLH_NO(T fovy, T aspect, T zNear, T zFar) + { + assert(abs(aspect - std::numeric_limits::epsilon()) > static_cast(0)); + + T const tanHalfFovy = tan(fovy / static_cast(2)); + + mat<4, 4, T, defaultp> Result(static_cast(0)); + Result[0][0] = static_cast(1) / (aspect * tanHalfFovy); + Result[1][1] = static_cast(1) / (tanHalfFovy); + Result[2][2] = (zFar + zNear) / (zFar - zNear); + Result[2][3] = static_cast(1); + Result[3][2] = - (static_cast(2) * zFar * zNear) / (zFar - zNear); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveZO(T fovy, T aspect, T zNear, T zFar) + { +# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_LH_BIT + return perspectiveLH_ZO(fovy, aspect, zNear, zFar); +# else + return perspectiveRH_ZO(fovy, aspect, zNear, zFar); +# endif + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveNO(T fovy, T aspect, T zNear, T zFar) + { +# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_LH_BIT + return perspectiveLH_NO(fovy, aspect, zNear, zFar); +# else + return perspectiveRH_NO(fovy, aspect, zNear, zFar); +# endif + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveLH(T fovy, T aspect, T zNear, T zFar) + { +# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_ZO_BIT + return perspectiveLH_ZO(fovy, aspect, zNear, zFar); +# else + return perspectiveLH_NO(fovy, aspect, zNear, zFar); +# endif + + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveRH(T fovy, T aspect, T zNear, T zFar) + { +# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_ZO_BIT + return perspectiveRH_ZO(fovy, aspect, zNear, zFar); +# else + return perspectiveRH_NO(fovy, aspect, zNear, zFar); +# endif + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspective(T fovy, T aspect, T zNear, T zFar) + { +# if GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_LH_ZO + return perspectiveLH_ZO(fovy, aspect, zNear, zFar); +# elif GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_LH_NO + return perspectiveLH_NO(fovy, aspect, zNear, zFar); +# elif GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_RH_ZO + return perspectiveRH_ZO(fovy, aspect, zNear, zFar); +# elif GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_RH_NO + return perspectiveRH_NO(fovy, aspect, zNear, zFar); +# endif + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveFovRH_ZO(T fov, T width, T height, T zNear, T zFar) + { + assert(width > static_cast(0)); + assert(height > static_cast(0)); + assert(fov > static_cast(0)); + + T const rad = fov; + T const h = glm::cos(static_cast(0.5) * rad) / glm::sin(static_cast(0.5) * rad); + T const w = h * height / width; ///todo max(width , Height) / min(width , Height)? + + mat<4, 4, T, defaultp> Result(static_cast(0)); + Result[0][0] = w; + Result[1][1] = h; + Result[2][2] = zFar / (zNear - zFar); + Result[2][3] = - static_cast(1); + Result[3][2] = -(zFar * zNear) / (zFar - zNear); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveFovRH_NO(T fov, T width, T height, T zNear, T zFar) + { + assert(width > static_cast(0)); + assert(height > static_cast(0)); + assert(fov > static_cast(0)); + + T const rad = fov; + T const h = glm::cos(static_cast(0.5) * rad) / glm::sin(static_cast(0.5) * rad); + T const w = h * height / width; ///todo max(width , Height) / min(width , Height)? + + mat<4, 4, T, defaultp> Result(static_cast(0)); + Result[0][0] = w; + Result[1][1] = h; + Result[2][2] = - (zFar + zNear) / (zFar - zNear); + Result[2][3] = - static_cast(1); + Result[3][2] = - (static_cast(2) * zFar * zNear) / (zFar - zNear); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveFovLH_ZO(T fov, T width, T height, T zNear, T zFar) + { + assert(width > static_cast(0)); + assert(height > static_cast(0)); + assert(fov > static_cast(0)); + + T const rad = fov; + T const h = glm::cos(static_cast(0.5) * rad) / glm::sin(static_cast(0.5) * rad); + T const w = h * height / width; ///todo max(width , Height) / min(width , Height)? + + mat<4, 4, T, defaultp> Result(static_cast(0)); + Result[0][0] = w; + Result[1][1] = h; + Result[2][2] = zFar / (zFar - zNear); + Result[2][3] = static_cast(1); + Result[3][2] = -(zFar * zNear) / (zFar - zNear); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveFovLH_NO(T fov, T width, T height, T zNear, T zFar) + { + assert(width > static_cast(0)); + assert(height > static_cast(0)); + assert(fov > static_cast(0)); + + T const rad = fov; + T const h = glm::cos(static_cast(0.5) * rad) / glm::sin(static_cast(0.5) * rad); + T const w = h * height / width; ///todo max(width , Height) / min(width , Height)? + + mat<4, 4, T, defaultp> Result(static_cast(0)); + Result[0][0] = w; + Result[1][1] = h; + Result[2][2] = (zFar + zNear) / (zFar - zNear); + Result[2][3] = static_cast(1); + Result[3][2] = - (static_cast(2) * zFar * zNear) / (zFar - zNear); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveFovZO(T fov, T width, T height, T zNear, T zFar) + { +# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_LH_BIT + return perspectiveFovLH_ZO(fov, width, height, zNear, zFar); +# else + return perspectiveFovRH_ZO(fov, width, height, zNear, zFar); +# endif + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveFovNO(T fov, T width, T height, T zNear, T zFar) + { +# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_LH_BIT + return perspectiveFovLH_NO(fov, width, height, zNear, zFar); +# else + return perspectiveFovRH_NO(fov, width, height, zNear, zFar); +# endif + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveFovLH(T fov, T width, T height, T zNear, T zFar) + { +# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_ZO_BIT + return perspectiveFovLH_ZO(fov, width, height, zNear, zFar); +# else + return perspectiveFovLH_NO(fov, width, height, zNear, zFar); +# endif + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveFovRH(T fov, T width, T height, T zNear, T zFar) + { +# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_ZO_BIT + return perspectiveFovRH_ZO(fov, width, height, zNear, zFar); +# else + return perspectiveFovRH_NO(fov, width, height, zNear, zFar); +# endif + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveFov(T fov, T width, T height, T zNear, T zFar) + { +# if GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_LH_ZO + return perspectiveFovLH_ZO(fov, width, height, zNear, zFar); +# elif GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_LH_NO + return perspectiveFovLH_NO(fov, width, height, zNear, zFar); +# elif GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_RH_ZO + return perspectiveFovRH_ZO(fov, width, height, zNear, zFar); +# elif GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_RH_NO + return perspectiveFovRH_NO(fov, width, height, zNear, zFar); +# endif + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> infinitePerspectiveRH(T fovy, T aspect, T zNear) + { + T const range = tan(fovy / static_cast(2)) * zNear; + T const left = -range * aspect; + T const right = range * aspect; + T const bottom = -range; + T const top = range; + + mat<4, 4, T, defaultp> Result(static_cast(0)); + Result[0][0] = (static_cast(2) * zNear) / (right - left); + Result[1][1] = (static_cast(2) * zNear) / (top - bottom); + Result[2][2] = - static_cast(1); + Result[2][3] = - static_cast(1); + Result[3][2] = - static_cast(2) * zNear; + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> infinitePerspectiveLH(T fovy, T aspect, T zNear) + { + T const range = tan(fovy / static_cast(2)) * zNear; + T const left = -range * aspect; + T const right = range * aspect; + T const bottom = -range; + T const top = range; + + mat<4, 4, T, defaultp> Result(T(0)); + Result[0][0] = (static_cast(2) * zNear) / (right - left); + Result[1][1] = (static_cast(2) * zNear) / (top - bottom); + Result[2][2] = static_cast(1); + Result[2][3] = static_cast(1); + Result[3][2] = - static_cast(2) * zNear; + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> infinitePerspective(T fovy, T aspect, T zNear) + { +# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_LH_BIT + return infinitePerspectiveLH(fovy, aspect, zNear); +# else + return infinitePerspectiveRH(fovy, aspect, zNear); +# endif + } + + // Infinite projection matrix: http://www.terathon.com/gdc07_lengyel.pdf + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> tweakedInfinitePerspective(T fovy, T aspect, T zNear, T ep) + { + T const range = tan(fovy / static_cast(2)) * zNear; + T const left = -range * aspect; + T const right = range * aspect; + T const bottom = -range; + T const top = range; + + mat<4, 4, T, defaultp> Result(static_cast(0)); + Result[0][0] = (static_cast(2) * zNear) / (right - left); + Result[1][1] = (static_cast(2) * zNear) / (top - bottom); + Result[2][2] = ep - static_cast(1); + Result[2][3] = static_cast(-1); + Result[3][2] = (ep - static_cast(2)) * zNear; + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> tweakedInfinitePerspective(T fovy, T aspect, T zNear) + { + return tweakedInfinitePerspective(fovy, aspect, zNear, epsilon()); + } +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_common.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_common.hpp new file mode 100644 index 0000000000000000000000000000000000000000..b1ba1b643a24828b3fcdbee8d6f95d1930977ab8 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_common.hpp @@ -0,0 +1,39 @@ +/// @ref ext_matrix_common +/// @file glm/ext/matrix_common.hpp +/// +/// @defgroup ext_matrix_common GLM_EXT_matrix_common +/// @ingroup ext +/// +/// Defines functions for common matrix operations. +/// +/// Include to use the features of this extension. +/// +/// @see ext_matrix_common + +#pragma once + +#include "../detail/qualifier.hpp" +#include "../detail/_fixes.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_common extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_common + /// @{ + + template + GLM_FUNC_DECL mat mix(mat const& x, mat const& y, mat const& a); + + template + GLM_FUNC_DECL mat mix(mat const& x, mat const& y, U a); + + template + GLM_FUNC_DECL GLM_CONSTEXPR mat abs(mat const& x); + + /// @} +}//namespace glm + +#include "matrix_common.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_common.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_common.inl new file mode 100644 index 0000000000000000000000000000000000000000..839348e068e2609ab2143c59efa3bf95754ed243 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_common.inl @@ -0,0 +1,34 @@ +#include "../matrix.hpp" + +#include "_matrix_vectorize.hpp" + +namespace glm +{ + template + GLM_FUNC_QUALIFIER mat mix(mat const& x, mat const& y, U a) + { + return mat(x) * (static_cast(1) - a) + mat(y) * a; + } + + template + GLM_FUNC_QUALIFIER mat mix(mat const& x, mat const& y, mat const& a) + { + return matrixCompMult(mat(x), static_cast(1) - a) + matrixCompMult(mat(y), a); + } + + template + struct compute_abs_matrix + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static mat call(mat const& x) + { + return detail::matrix_functor_1::call(abs, x); + } + }; + + template + GLM_FUNC_DECL GLM_CONSTEXPR mat abs(mat const& x) + { + return compute_abs_matrix::value>::call(x); + } + +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_double2x2.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_double2x2.hpp new file mode 100644 index 0000000000000000000000000000000000000000..89e7ebf0b6cb34d0b2bdd02a17b2302a1fc5042e --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_double2x2.hpp @@ -0,0 +1,23 @@ +/// @ref core +/// @file glm/ext/matrix_double2x2.hpp + +#pragma once +#include "../detail/type_mat2x2.hpp" + +namespace glm +{ + /// @addtogroup core_matrix + /// @{ + + /// 2 columns of 2 components matrix of double-precision floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + typedef mat<2, 2, double, defaultp> dmat2x2; + + /// 2 columns of 2 components matrix of double-precision floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + typedef mat<2, 2, double, defaultp> dmat2; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_double2x2_precision.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_double2x2_precision.hpp new file mode 100644 index 0000000000000000000000000000000000000000..8886488c871289f830412a10bd8277fe97551ace --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_double2x2_precision.hpp @@ -0,0 +1,49 @@ +/// @ref core +/// @file glm/ext/matrix_double2x2_precision.hpp + +#pragma once +#include "../detail/type_mat2x2.hpp" + +namespace glm +{ + /// @addtogroup core_matrix_precision + /// @{ + + /// 2 columns of 2 components matrix of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<2, 2, double, lowp> lowp_dmat2; + + /// 2 columns of 2 components matrix of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<2, 2, double, mediump> mediump_dmat2; + + /// 2 columns of 2 components matrix of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<2, 2, double, highp> highp_dmat2; + + /// 2 columns of 2 components matrix of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<2, 2, double, lowp> lowp_dmat2x2; + + /// 2 columns of 2 components matrix of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<2, 2, double, mediump> mediump_dmat2x2; + + /// 2 columns of 2 components matrix of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<2, 2, double, highp> highp_dmat2x2; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_double2x3.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_double2x3.hpp new file mode 100644 index 0000000000000000000000000000000000000000..ae485b259ec15650c4d29bf845ce9b8b3ec074de --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_double2x3.hpp @@ -0,0 +1,18 @@ +/// @ref core +/// @file glm/ext/matrix_double2x3.hpp + +#pragma once +#include "../detail/type_mat2x3.hpp" + +namespace glm +{ + /// @addtogroup core_matrix + /// @{ + + /// 2 columns of 3 components matrix of double-precision floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + typedef mat<2, 3, double, defaultp> dmat2x3; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_double2x3_precision.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_double2x3_precision.hpp new file mode 100644 index 0000000000000000000000000000000000000000..0a81269c1c483c93d93aabda11ef5365629fc835 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_double2x3_precision.hpp @@ -0,0 +1,31 @@ +/// @ref core +/// @file glm/ext/matrix_double2x3_precision.hpp + +#pragma once +#include "../detail/type_mat2x3.hpp" + +namespace glm +{ + /// @addtogroup core_matrix_precision + /// @{ + + /// 2 columns of 3 components matrix of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<2, 3, double, lowp> lowp_dmat2x3; + + /// 2 columns of 3 components matrix of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<2, 3, double, mediump> mediump_dmat2x3; + + /// 2 columns of 3 components matrix of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<2, 3, double, highp> highp_dmat2x3; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_double2x4.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_double2x4.hpp new file mode 100644 index 0000000000000000000000000000000000000000..485204872ea04ba2e5ce346520feda777e9cca22 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_double2x4.hpp @@ -0,0 +1,18 @@ +/// @ref core +/// @file glm/ext/matrix_double2x4.hpp + +#pragma once +#include "../detail/type_mat2x4.hpp" + +namespace glm +{ + /// @addtogroup core_matrix + /// @{ + + /// 2 columns of 4 components matrix of double-precision floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + typedef mat<2, 4, double, defaultp> dmat2x4; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_double2x4_precision.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_double2x4_precision.hpp new file mode 100644 index 0000000000000000000000000000000000000000..1fe933f420bfb82bac77aea6fc343833254c9d99 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_double2x4_precision.hpp @@ -0,0 +1,31 @@ +/// @ref core +/// @file glm/ext/matrix_double2x4_precision.hpp + +#pragma once +#include "../detail/type_mat2x4.hpp" + +namespace glm +{ + /// @addtogroup core_matrix_precision + /// @{ + + /// 2 columns of 4 components matrix of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<2, 4, double, lowp> lowp_dmat2x4; + + /// 2 columns of 4 components matrix of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<2, 4, double, mediump> mediump_dmat2x4; + + /// 2 columns of 4 components matrix of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<2, 4, double, highp> highp_dmat2x4; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_double3x2.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_double3x2.hpp new file mode 100644 index 0000000000000000000000000000000000000000..6b21696a24e5be52780286f1aa091b850ef80252 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_double3x2.hpp @@ -0,0 +1,18 @@ +/// @ref core +/// @file glm/ext/matrix_double3x2.hpp + +#pragma once +#include "../detail/type_mat3x2.hpp" + +namespace glm +{ + /// @addtogroup core_matrix + /// @{ + + /// 3 columns of 2 components matrix of double-precision floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + typedef mat<3, 2, double, defaultp> dmat3x2; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_double3x2_precision.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_double3x2_precision.hpp new file mode 100644 index 0000000000000000000000000000000000000000..f1467a119ca480f5addfd0b4ae4ae8250721d1fb --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_double3x2_precision.hpp @@ -0,0 +1,31 @@ +/// @ref core +/// @file glm/ext/matrix_double3x2_precision.hpp + +#pragma once +#include "../detail/type_mat3x2.hpp" + +namespace glm +{ + /// @addtogroup core_matrix_precision + /// @{ + + /// 3 columns of 2 components matrix of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<3, 2, double, lowp> lowp_dmat3x2; + + /// 3 columns of 2 components matrix of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<3, 2, double, mediump> mediump_dmat3x2; + + /// 3 columns of 2 components matrix of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<3, 2, double, highp> highp_dmat3x2; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_double3x3.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_double3x3.hpp new file mode 100644 index 0000000000000000000000000000000000000000..e1589137e3f5bd4e6c4ef504c2dff1c6a50e9410 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_double3x3.hpp @@ -0,0 +1,23 @@ +/// @ref core +/// @file glm/ext/matrix_double3x3.hpp + +#pragma once +#include "../detail/type_mat3x3.hpp" + +namespace glm +{ + /// @addtogroup core_matrix + /// @{ + + /// 3 columns of 3 components matrix of double-precision floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + typedef mat<3, 3, double, defaultp> dmat3x3; + + /// 3 columns of 3 components matrix of double-precision floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + typedef mat<3, 3, double, defaultp> dmat3; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_double3x3_precision.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_double3x3_precision.hpp new file mode 100644 index 0000000000000000000000000000000000000000..e487cc29089d8c35bab47653862734e95f67e8ed --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_double3x3_precision.hpp @@ -0,0 +1,49 @@ +/// @ref core +/// @file glm/ext/matrix_double3x3_precision.hpp + +#pragma once +#include "../detail/type_mat3x3.hpp" + +namespace glm +{ + /// @addtogroup core_matrix_precision + /// @{ + + /// 3 columns of 3 components matrix of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<3, 3, double, lowp> lowp_dmat3; + + /// 3 columns of 3 components matrix of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<3, 3, double, mediump> mediump_dmat3; + + /// 3 columns of 3 components matrix of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<3, 3, double, highp> highp_dmat3; + + /// 3 columns of 3 components matrix of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<3, 3, double, lowp> lowp_dmat3x3; + + /// 3 columns of 3 components matrix of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<3, 3, double, mediump> mediump_dmat3x3; + + /// 3 columns of 3 components matrix of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<3, 3, double, highp> highp_dmat3x3; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_double3x4.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_double3x4.hpp new file mode 100644 index 0000000000000000000000000000000000000000..d5f15ac14ec253361f5fb8f91d1e4828fbd8d591 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_double3x4.hpp @@ -0,0 +1,18 @@ +/// @ref core +/// @file glm/ext/matrix_double3x4.hpp + +#pragma once +#include "../detail/type_mat3x4.hpp" + +namespace glm +{ + /// @addtogroup core_matrix + /// @{ + + /// 3 columns of 4 components matrix of double-precision floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + typedef mat<3, 4, double, defaultp> dmat3x4; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_double3x4_precision.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_double3x4_precision.hpp new file mode 100644 index 0000000000000000000000000000000000000000..b7c21b0d67413d374424afc3c6921b36bed8f771 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_double3x4_precision.hpp @@ -0,0 +1,31 @@ +/// @ref core +/// @file glm/ext/matrix_double3x4_precision.hpp + +#pragma once +#include "../detail/type_mat3x4.hpp" + +namespace glm +{ + /// @addtogroup core_matrix_precision + /// @{ + + /// 3 columns of 4 components matrix of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<3, 4, double, lowp> lowp_dmat3x4; + + /// 3 columns of 4 components matrix of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<3, 4, double, mediump> mediump_dmat3x4; + + /// 3 columns of 4 components matrix of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<3, 4, double, highp> highp_dmat3x4; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_double4x2.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_double4x2.hpp new file mode 100644 index 0000000000000000000000000000000000000000..8cfa015928fa6642540bd67eda0aa8f2b93a72fd --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_double4x2.hpp @@ -0,0 +1,18 @@ +/// @ref core +/// @file glm/ext/matrix_double4x2.hpp + +#pragma once +#include "../detail/type_mat4x2.hpp" + +namespace glm +{ + /// @addtogroup core_matrix + /// @{ + + /// 4 columns of 2 components matrix of double-precision floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + typedef mat<4, 2, double, defaultp> dmat4x2; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_double4x2_precision.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_double4x2_precision.hpp new file mode 100644 index 0000000000000000000000000000000000000000..0d5f7c38c7ae247a05ddd85343f9318ce2030fa3 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_double4x2_precision.hpp @@ -0,0 +1,31 @@ +/// @ref core +/// @file glm/ext/matrix_double4x2_precision.hpp + +#pragma once +#include "../detail/type_mat4x2.hpp" + +namespace glm +{ + /// @addtogroup core_matrix_precision + /// @{ + + /// 4 columns of 2 components matrix of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<4, 2, double, lowp> lowp_dmat4x2; + + /// 4 columns of 2 components matrix of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<4, 2, double, mediump> mediump_dmat4x2; + + /// 4 columns of 2 components matrix of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<4, 2, double, highp> highp_dmat4x2; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_double4x3.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_double4x3.hpp new file mode 100644 index 0000000000000000000000000000000000000000..60c15104d6a243a0a7e11963b6c02b1e0a3fc3ed --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_double4x3.hpp @@ -0,0 +1,18 @@ +/// @ref core +/// @file glm/ext/matrix_double4x3.hpp + +#pragma once +#include "../detail/type_mat4x3.hpp" + +namespace glm +{ + /// @addtogroup core_matrix + /// @{ + + /// 4 columns of 3 components matrix of double-precision floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + typedef mat<4, 3, double, defaultp> dmat4x3; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_double4x3_precision.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_double4x3_precision.hpp new file mode 100644 index 0000000000000000000000000000000000000000..66f4455e0b55d67073a3db3cceda558d2a2822a8 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_double4x3_precision.hpp @@ -0,0 +1,31 @@ +/// @ref core +/// @file glm/ext/matrix_double4x3_precision.hpp + +#pragma once +#include "../detail/type_mat4x3.hpp" + +namespace glm +{ + /// @addtogroup core_matrix_precision + /// @{ + + /// 4 columns of 3 components matrix of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<4, 3, double, lowp> lowp_dmat4x3; + + /// 4 columns of 3 components matrix of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<4, 3, double, mediump> mediump_dmat4x3; + + /// 4 columns of 3 components matrix of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<4, 3, double, highp> highp_dmat4x3; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_double4x4.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_double4x4.hpp new file mode 100644 index 0000000000000000000000000000000000000000..513bfec3d73e0383a7a380b63b949ca6968db27c --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_double4x4.hpp @@ -0,0 +1,23 @@ +/// @ref core +/// @file glm/ext/matrix_double4x4.hpp + +#pragma once +#include "../detail/type_mat4x4.hpp" + +namespace glm +{ + /// @addtogroup core_matrix + /// @{ + + /// 4 columns of 4 components matrix of double-precision floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + typedef mat<4, 4, double, defaultp> dmat4x4; + + /// 4 columns of 4 components matrix of double-precision floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + typedef mat<4, 4, double, defaultp> dmat4; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_double4x4_precision.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_double4x4_precision.hpp new file mode 100644 index 0000000000000000000000000000000000000000..1e46ff7db7418bcf71ee76e333aa714d927d44ed --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_double4x4_precision.hpp @@ -0,0 +1,49 @@ +/// @ref core +/// @file glm/ext/matrix_double4x4_precision.hpp + +#pragma once +#include "../detail/type_mat4x4.hpp" + +namespace glm +{ + /// @addtogroup core_matrix_precision + /// @{ + + /// 4 columns of 4 components matrix of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<4, 4, double, lowp> lowp_dmat4; + + /// 4 columns of 4 components matrix of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<4, 4, double, mediump> mediump_dmat4; + + /// 4 columns of 4 components matrix of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<4, 4, double, highp> highp_dmat4; + + /// 4 columns of 4 components matrix of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<4, 4, double, lowp> lowp_dmat4x4; + + /// 4 columns of 4 components matrix of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<4, 4, double, mediump> mediump_dmat4x4; + + /// 4 columns of 4 components matrix of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<4, 4, double, highp> highp_dmat4x4; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_float2x2.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_float2x2.hpp new file mode 100644 index 0000000000000000000000000000000000000000..8b7478aba7bba8b43a5c90de21f19e05cd5a7fbe --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_float2x2.hpp @@ -0,0 +1,23 @@ +/// @ref core +/// @file glm/ext/matrix_float2x2.hpp + +#pragma once +#include "../detail/type_mat2x2.hpp" + +namespace glm +{ + /// @addtogroup core_matrix + /// @{ + + /// 2 columns of 2 components matrix of single-precision floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + typedef mat<2, 2, float, defaultp> mat2x2; + + /// 2 columns of 2 components matrix of single-precision floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + typedef mat<2, 2, float, defaultp> mat2; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_float2x2_precision.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_float2x2_precision.hpp new file mode 100644 index 0000000000000000000000000000000000000000..5990a489788db6361e53bffe783cae54dc97a18a --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_float2x2_precision.hpp @@ -0,0 +1,49 @@ +/// @ref core +/// @file glm/ext/matrix_float2x2_precision.hpp + +#pragma once +#include "../detail/type_mat2x2.hpp" + +namespace glm +{ + /// @addtogroup core_matrix_precision + /// @{ + + /// 2 columns of 2 components matrix of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<2, 2, float, lowp> lowp_mat2; + + /// 2 columns of 2 components matrix of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<2, 2, float, mediump> mediump_mat2; + + /// 2 columns of 2 components matrix of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<2, 2, float, highp> highp_mat2; + + /// 2 columns of 2 components matrix of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<2, 2, float, lowp> lowp_mat2x2; + + /// 2 columns of 2 components matrix of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<2, 2, float, mediump> mediump_mat2x2; + + /// 2 columns of 2 components matrix of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<2, 2, float, highp> highp_mat2x2; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_float2x3.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_float2x3.hpp new file mode 100644 index 0000000000000000000000000000000000000000..145b216ee7f21980c912a636ee836d91f52743ce --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_float2x3.hpp @@ -0,0 +1,18 @@ +/// @ref core +/// @file glm/ext/matrix_float2x3.hpp + +#pragma once +#include "../detail/type_mat2x3.hpp" + +namespace glm +{ + /// @addtogroup core_matrix + /// @{ + + /// 2 columns of 3 components matrix of single-precision floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + typedef mat<2, 3, float, defaultp> mat2x3; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_float2x3_precision.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_float2x3_precision.hpp new file mode 100644 index 0000000000000000000000000000000000000000..49ad0ccb0d7a30a9d6c4c6b7192b3ced1ba77783 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_float2x3_precision.hpp @@ -0,0 +1,31 @@ +/// @ref core +/// @file glm/ext/matrix_float2x3_precision.hpp + +#pragma once +#include "../detail/type_mat2x3.hpp" + +namespace glm +{ + /// @addtogroup core_matrix_precision + /// @{ + + /// 2 columns of 3 components matrix of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<2, 3, float, lowp> lowp_mat2x3; + + /// 2 columns of 3 components matrix of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<2, 3, float, mediump> mediump_mat2x3; + + /// 2 columns of 3 components matrix of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<2, 3, float, highp> highp_mat2x3; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_float2x4.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_float2x4.hpp new file mode 100644 index 0000000000000000000000000000000000000000..bd0f2b45092b2429ac780f908dca3513e6dce4bc --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_float2x4.hpp @@ -0,0 +1,18 @@ +/// @ref core +/// @file glm/ext/matrix_float2x4.hpp + +#pragma once +#include "../detail/type_mat2x4.hpp" + +namespace glm +{ + /// @addtogroup core_matrix + /// @{ + + /// 2 columns of 4 components matrix of single-precision floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + typedef mat<2, 4, float, defaultp> mat2x4; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_float2x4_precision.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_float2x4_precision.hpp new file mode 100644 index 0000000000000000000000000000000000000000..161a0cf5dea71c0a59f17197ea2c8603612669ad --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_float2x4_precision.hpp @@ -0,0 +1,31 @@ +/// @ref core +/// @file glm/ext/matrix_float2x4_precision.hpp + +#pragma once +#include "../detail/type_mat2x4.hpp" + +namespace glm +{ + /// @addtogroup core_matrix_precision + /// @{ + + /// 2 columns of 4 components matrix of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<2, 4, float, lowp> lowp_mat2x4; + + /// 2 columns of 4 components matrix of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<2, 4, float, mediump> mediump_mat2x4; + + /// 2 columns of 4 components matrix of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<2, 4, float, highp> highp_mat2x4; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_float3x2.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_float3x2.hpp new file mode 100644 index 0000000000000000000000000000000000000000..fb9972a56b8c2b18c9974b6049a92a55342b3004 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_float3x2.hpp @@ -0,0 +1,18 @@ +/// @ref core +/// @file glm/ext/matrix_float3x2.hpp + +#pragma once +#include "../detail/type_mat3x2.hpp" + +namespace glm +{ + /// @addtogroup core_matrix + /// @{ + + /// 3 columns of 2 components matrix of single-precision floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + typedef mat<3, 2, float, defaultp> mat3x2; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_float3x2_precision.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_float3x2_precision.hpp new file mode 100644 index 0000000000000000000000000000000000000000..d0b7d00ec9c83437e2f4f4e6b121865b82d1a70d --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_float3x2_precision.hpp @@ -0,0 +1,31 @@ +/// @ref core +/// @file glm/ext/matrix_float3x2_precision.hpp + +#pragma once +#include "../detail/type_mat3x2.hpp" + +namespace glm +{ + /// @addtogroup core_matrix_precision + /// @{ + + /// 3 columns of 2 components matrix of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<3, 2, float, lowp> lowp_mat3x2; + + /// 3 columns of 2 components matrix of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<3, 2, float, mediump> mediump_mat3x2; + + /// 3 columns of 2 components matrix of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<3, 2, float, highp> highp_mat3x2; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_float3x3.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_float3x3.hpp new file mode 100644 index 0000000000000000000000000000000000000000..9abaa605065149c7d8069a4be62cf4175c19578c --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_float3x3.hpp @@ -0,0 +1,23 @@ +/// @ref core +/// @file glm/ext/matrix_float3x3.hpp + +#pragma once +#include "../detail/type_mat3x3.hpp" + +namespace glm +{ + /// @addtogroup core_matrix + /// @{ + + /// 3 columns of 3 components matrix of single-precision floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + typedef mat<3, 3, float, defaultp> mat3x3; + + /// 3 columns of 3 components matrix of single-precision floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + typedef mat<3, 3, float, defaultp> mat3; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_float3x3_precision.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_float3x3_precision.hpp new file mode 100644 index 0000000000000000000000000000000000000000..e66345d1a038322f36514ca685650fbaba0c8946 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_float3x3_precision.hpp @@ -0,0 +1,49 @@ +/// @ref core +/// @file glm/ext/matrix_float3x3_precision.hpp + +#pragma once +#include "../detail/type_mat3x3.hpp" + +namespace glm +{ + /// @addtogroup core_matrix_precision + /// @{ + + /// 3 columns of 3 components matrix of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<3, 3, float, lowp> lowp_mat3; + + /// 3 columns of 3 components matrix of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<3, 3, float, mediump> mediump_mat3; + + /// 3 columns of 3 components matrix of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<3, 3, float, highp> highp_mat3; + + /// 3 columns of 3 components matrix of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<3, 3, float, lowp> lowp_mat3x3; + + /// 3 columns of 3 components matrix of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<3, 3, float, mediump> mediump_mat3x3; + + /// 3 columns of 3 components matrix of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<3, 3, float, highp> highp_mat3x3; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_float3x4.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_float3x4.hpp new file mode 100644 index 0000000000000000000000000000000000000000..95b7b4be39bccf79abb909ca92ea434cc34e1edd --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_float3x4.hpp @@ -0,0 +1,18 @@ +/// @ref core +/// @file glm/ext/matrix_float3x4.hpp + +#pragma once +#include "../detail/type_mat3x4.hpp" + +namespace glm +{ + /// @addtogroup core_matrix + /// @{ + + /// 3 columns of 4 components matrix of single-precision floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + typedef mat<3, 4, float, defaultp> mat3x4; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_float3x4_precision.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_float3x4_precision.hpp new file mode 100644 index 0000000000000000000000000000000000000000..a0e7033bbde8ef79c421f983668a70652568a7ab --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_float3x4_precision.hpp @@ -0,0 +1,31 @@ +/// @ref core +/// @file glm/ext/matrix_float3x4_precision.hpp + +#pragma once +#include "../detail/type_mat3x4.hpp" + +namespace glm +{ + /// @addtogroup core_matrix_precision + /// @{ + + /// 3 columns of 4 components matrix of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<3, 4, float, lowp> lowp_mat3x4; + + /// 3 columns of 4 components matrix of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<3, 4, float, mediump> mediump_mat3x4; + + /// 3 columns of 4 components matrix of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<3, 4, float, highp> highp_mat3x4; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_float4x2.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_float4x2.hpp new file mode 100644 index 0000000000000000000000000000000000000000..b5a34f232bc7b53ddf925eb678f07a47b7cc55e1 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_float4x2.hpp @@ -0,0 +1,18 @@ +/// @ref core +/// @file glm/ext/matrix_float4x2.hpp + +#pragma once +#include "../detail/type_mat4x2.hpp" + +namespace glm +{ + /// @addtogroup core_matrix + /// @{ + + /// 4 columns of 2 components matrix of single-precision floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + typedef mat<4, 2, float, defaultp> mat4x2; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_float4x2_precision.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_float4x2_precision.hpp new file mode 100644 index 0000000000000000000000000000000000000000..f3e91bbe779ff2a737d8ef44cc59854b0bb7d183 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_float4x2_precision.hpp @@ -0,0 +1,31 @@ +/// @ref core +/// @file glm/ext/matrix_float2x2_precision.hpp + +#pragma once +#include "../detail/type_mat2x2.hpp" + +namespace glm +{ + /// @addtogroup core_matrix_precision + /// @{ + + /// 4 columns of 2 components matrix of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<4, 2, float, lowp> lowp_mat4x2; + + /// 4 columns of 2 components matrix of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<4, 2, float, mediump> mediump_mat4x2; + + /// 4 columns of 2 components matrix of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<4, 2, float, highp> highp_mat4x2; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_float4x3.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_float4x3.hpp new file mode 100644 index 0000000000000000000000000000000000000000..084a7ebbea5a5cb5aa1d2bedc58c058264b42dc5 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_float4x3.hpp @@ -0,0 +1,18 @@ +/// @ref core +/// @file glm/ext/matrix_float4x3.hpp + +#pragma once +#include "../detail/type_mat4x3.hpp" + +namespace glm +{ + /// @addtogroup core_matrix + /// @{ + + /// 4 columns of 3 components matrix of single-precision floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + typedef mat<4, 3, float, defaultp> mat4x3; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_float4x3_precision.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_float4x3_precision.hpp new file mode 100644 index 0000000000000000000000000000000000000000..f0e7c27898eb1ec4ea99eea0168fb1f92a295377 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_float4x3_precision.hpp @@ -0,0 +1,31 @@ +/// @ref core +/// @file glm/ext/matrix_float4x3_precision.hpp + +#pragma once +#include "../detail/type_mat4x3.hpp" + +namespace glm +{ + /// @addtogroup core_matrix_precision + /// @{ + + /// 4 columns of 3 components matrix of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<4, 3, float, lowp> lowp_mat4x3; + + /// 4 columns of 3 components matrix of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<4, 3, float, mediump> mediump_mat4x3; + + /// 4 columns of 3 components matrix of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<4, 3, float, highp> highp_mat4x3; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_float4x4.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_float4x4.hpp new file mode 100644 index 0000000000000000000000000000000000000000..f5b08cf88bcab5ae65c86e61e8add8095bf2e0ba --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_float4x4.hpp @@ -0,0 +1,23 @@ +/// @ref core +/// @file glm/ext/matrix_float4x4.hpp + +#pragma once +#include "../detail/type_mat4x4.hpp" + +namespace glm +{ + /// @ingroup core_matrix + /// @{ + + /// 4 columns of 4 components matrix of single-precision floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + typedef mat<4, 4, float, defaultp> mat4x4; + + /// 4 columns of 4 components matrix of single-precision floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + typedef mat<4, 4, float, defaultp> mat4; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_float4x4_precision.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_float4x4_precision.hpp new file mode 100644 index 0000000000000000000000000000000000000000..9faf12463ad4c3f7aae787f01a6c3cbfe52d7eaf --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_float4x4_precision.hpp @@ -0,0 +1,49 @@ +/// @ref core +/// @file glm/ext/matrix_float4x4_precision.hpp + +#pragma once +#include "../detail/type_mat4x4.hpp" + +namespace glm +{ + /// @addtogroup core_matrix_precision + /// @{ + + /// 4 columns of 4 components matrix of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<4, 4, float, lowp> lowp_mat4; + + /// 4 columns of 4 components matrix of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<4, 4, float, mediump> mediump_mat4; + + /// 4 columns of 4 components matrix of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<4, 4, float, highp> highp_mat4; + + /// 4 columns of 4 components matrix of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<4, 4, float, lowp> lowp_mat4x4; + + /// 4 columns of 4 components matrix of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<4, 4, float, mediump> mediump_mat4x4; + + /// 4 columns of 4 components matrix of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + /// + /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef mat<4, 4, float, highp> highp_mat4x4; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_int2x2.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_int2x2.hpp new file mode 100644 index 0000000000000000000000000000000000000000..e8d346ad84e0b1142725f6d7b1a9e1f876f91c42 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_int2x2.hpp @@ -0,0 +1,38 @@ +/// @ref ext_matrix_int2x2 +/// @file glm/ext/matrix_int2x2.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_int2x2 GLM_EXT_matrix_int2x2 +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat2x2.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_int2x2 extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_int2x2 + /// @{ + + /// Signed integer 2x2 matrix. + /// + /// @see ext_matrix_int2x2 + typedef mat<2, 2, int, defaultp> imat2x2; + + /// Signed integer 2x2 matrix. + /// + /// @see ext_matrix_int2x2 + typedef mat<2, 2, int, defaultp> imat2; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_int2x2_sized.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_int2x2_sized.hpp new file mode 100644 index 0000000000000000000000000000000000000000..56db06d871739aade8780f2ae57d2f9de3e381fb --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_int2x2_sized.hpp @@ -0,0 +1,70 @@ +/// @ref ext_matrix_int2x2_sized +/// @file glm/ext/matrix_int2x2_sized.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_int2x2_sized GLM_EXT_matrix_int2x2_sized +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat2x2.hpp" +#include "../ext/scalar_int_sized.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_int2x2_sized extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_int2x2_sized + /// @{ + + /// 8 bit signed integer 2x2 matrix. + /// + /// @see ext_matrix_int2x2_sized + typedef mat<2, 2, int8, defaultp> i8mat2x2; + + /// 16 bit signed integer 2x2 matrix. + /// + /// @see ext_matrix_int2x2_sized + typedef mat<2, 2, int16, defaultp> i16mat2x2; + + /// 32 bit signed integer 2x2 matrix. + /// + /// @see ext_matrix_int2x2_sized + typedef mat<2, 2, int32, defaultp> i32mat2x2; + + /// 64 bit signed integer 2x2 matrix. + /// + /// @see ext_matrix_int2x2_sized + typedef mat<2, 2, int64, defaultp> i64mat2x2; + + + /// 8 bit signed integer 2x2 matrix. + /// + /// @see ext_matrix_int2x2_sized + typedef mat<2, 2, int8, defaultp> i8mat2; + + /// 16 bit signed integer 2x2 matrix. + /// + /// @see ext_matrix_int2x2_sized + typedef mat<2, 2, int16, defaultp> i16mat2; + + /// 32 bit signed integer 2x2 matrix. + /// + /// @see ext_matrix_int2x2_sized + typedef mat<2, 2, int32, defaultp> i32mat2; + + /// 64 bit signed integer 2x2 matrix. + /// + /// @see ext_matrix_int2x2_sized + typedef mat<2, 2, int64, defaultp> i64mat2; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_int2x3.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_int2x3.hpp new file mode 100644 index 0000000000000000000000000000000000000000..e9ec6de8964c2def6f908ffc66deb4a708b0d7a0 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_int2x3.hpp @@ -0,0 +1,33 @@ +/// @ref ext_matrix_int2x3 +/// @file glm/ext/matrix_int2x3.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_int2x3 GLM_EXT_matrix_int2x3 +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat2x3.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_int2x3 extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_int2x3 + /// @{ + + /// Signed integer 2x3 matrix. + /// + /// @see ext_matrix_int2x3 + typedef mat<2, 3, int, defaultp> imat2x3; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_int2x3_sized.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_int2x3_sized.hpp new file mode 100644 index 0000000000000000000000000000000000000000..66f7c3a4824044f38f574dbc42ed8ae3b6ae2a67 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_int2x3_sized.hpp @@ -0,0 +1,49 @@ +/// @ref ext_matrix_int2x3_sized +/// @file glm/ext/matrix_int2x3_sized.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_int2x3_sized GLM_EXT_matrix_int2x3_sized +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat2x3.hpp" +#include "../ext/scalar_int_sized.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_int2x3_sized extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_int2x3_sized + /// @{ + + /// 8 bit signed integer 2x3 matrix. + /// + /// @see ext_matrix_int2x3_sized + typedef mat<2, 3, int8, defaultp> i8mat2x3; + + /// 16 bit signed integer 2x3 matrix. + /// + /// @see ext_matrix_int2x3_sized + typedef mat<2, 3, int16, defaultp> i16mat2x3; + + /// 32 bit signed integer 2x3 matrix. + /// + /// @see ext_matrix_int2x3_sized + typedef mat<2, 3, int32, defaultp> i32mat2x3; + + /// 64 bit signed integer 2x3 matrix. + /// + /// @see ext_matrix_int2x3_sized + typedef mat<2, 3, int64, defaultp> i64mat2x3; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_int2x4.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_int2x4.hpp new file mode 100644 index 0000000000000000000000000000000000000000..309b3eaee42b4138f4af5748cdb876125b2d0540 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_int2x4.hpp @@ -0,0 +1,33 @@ +/// @ref ext_matrix_int2x4 +/// @file glm/ext/matrix_int2x4.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_int2x4 GLM_EXT_matrix_int2x4 +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat2x4.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_int2x4 extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_int2x4 + /// @{ + + /// Signed integer 2x4 matrix. + /// + /// @see ext_matrix_int2x4 + typedef mat<2, 4, int, defaultp> imat2x4; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_int2x4_sized.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_int2x4_sized.hpp new file mode 100644 index 0000000000000000000000000000000000000000..ae3298c73d4fb8cfe101fb7b87cc884b29a95ce7 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_int2x4_sized.hpp @@ -0,0 +1,49 @@ +/// @ref ext_matrix_int2x4_sized +/// @file glm/ext/matrix_int2x4_sized.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_int2x4_sized GLM_EXT_matrix_int2x4_sized +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat2x4.hpp" +#include "../ext/scalar_int_sized.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_int2x4_sized extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_int2x4_sized + /// @{ + + /// 8 bit signed integer 2x4 matrix. + /// + /// @see ext_matrix_int2x4_sized + typedef mat<2, 4, int8, defaultp> i8mat2x4; + + /// 16 bit signed integer 2x4 matrix. + /// + /// @see ext_matrix_int2x4_sized + typedef mat<2, 4, int16, defaultp> i16mat2x4; + + /// 32 bit signed integer 2x4 matrix. + /// + /// @see ext_matrix_int2x4_sized + typedef mat<2, 4, int32, defaultp> i32mat2x4; + + /// 64 bit signed integer 2x4 matrix. + /// + /// @see ext_matrix_int2x4_sized + typedef mat<2, 4, int64, defaultp> i64mat2x4; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_int3x2.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_int3x2.hpp new file mode 100644 index 0000000000000000000000000000000000000000..24ed22e8659908241bb45f0ca3e0afb310f8b9e6 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_int3x2.hpp @@ -0,0 +1,33 @@ +/// @ref ext_matrix_int3x2 +/// @file glm/ext/matrix_int3x2.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_int3x2 GLM_EXT_matrix_int3x2 +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat3x2.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_int3x2 extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_int3x2 + /// @{ + + /// Signed integer 3x2 matrix. + /// + /// @see ext_matrix_int3x2 + typedef mat<3, 2, int, defaultp> imat3x2; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_int3x2_sized.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_int3x2_sized.hpp new file mode 100644 index 0000000000000000000000000000000000000000..34888bc6c404ca6950b4697ce66631ded820586b --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_int3x2_sized.hpp @@ -0,0 +1,49 @@ +/// @ref ext_matrix_int3x2_sized +/// @file glm/ext/matrix_int3x2_sized.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_int3x2_sized GLM_EXT_matrix_int3x2_sized +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat3x2.hpp" +#include "../ext/scalar_int_sized.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_int3x2_sized extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_int3x2_sized + /// @{ + + /// 8 bit signed integer 3x2 matrix. + /// + /// @see ext_matrix_int3x2_sized + typedef mat<3, 2, int8, defaultp> i8mat3x2; + + /// 16 bit signed integer 3x2 matrix. + /// + /// @see ext_matrix_int3x2_sized + typedef mat<3, 2, int16, defaultp> i16mat3x2; + + /// 32 bit signed integer 3x2 matrix. + /// + /// @see ext_matrix_int3x2_sized + typedef mat<3, 2, int32, defaultp> i32mat3x2; + + /// 64 bit signed integer 3x2 matrix. + /// + /// @see ext_matrix_int3x2_sized + typedef mat<3, 2, int64, defaultp> i64mat3x2; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_int3x3.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_int3x3.hpp new file mode 100644 index 0000000000000000000000000000000000000000..11327b70ec67cb0e8c81d4cb66135f0fc3b73dc3 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_int3x3.hpp @@ -0,0 +1,38 @@ +/// @ref ext_matrix_int3x3 +/// @file glm/ext/matrix_int3x3.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_int3x3 GLM_EXT_matrix_int3x3 +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat3x3.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_int3x3 extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_int3x3 + /// @{ + + /// Signed integer 3x3 matrix. + /// + /// @see ext_matrix_int3x3 + typedef mat<3, 3, int, defaultp> imat3x3; + + /// Signed integer 3x3 matrix. + /// + /// @see ext_matrix_int3x3 + typedef mat<3, 3, int, defaultp> imat3; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_int3x3_sized.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_int3x3_sized.hpp new file mode 100644 index 0000000000000000000000000000000000000000..38048bd54393d1dcd3c23b15b86ee76d0609a69c --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_int3x3_sized.hpp @@ -0,0 +1,70 @@ +/// @ref ext_matrix_int3x3_sized +/// @file glm/ext/matrix_int3x3_sized.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_int3x3_sized GLM_EXT_matrix_int3x3_sized +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat3x3.hpp" +#include "../ext/scalar_int_sized.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_int3x3_sized extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_int3x3_sized + /// @{ + + /// 8 bit signed integer 3x3 matrix. + /// + /// @see ext_matrix_int3x3_sized + typedef mat<3, 3, int8, defaultp> i8mat3x3; + + /// 16 bit signed integer 3x3 matrix. + /// + /// @see ext_matrix_int3x3_sized + typedef mat<3, 3, int16, defaultp> i16mat3x3; + + /// 32 bit signed integer 3x3 matrix. + /// + /// @see ext_matrix_int3x3_sized + typedef mat<3, 3, int32, defaultp> i32mat3x3; + + /// 64 bit signed integer 3x3 matrix. + /// + /// @see ext_matrix_int3x3_sized + typedef mat<3, 3, int64, defaultp> i64mat3x3; + + + /// 8 bit signed integer 3x3 matrix. + /// + /// @see ext_matrix_int3x3_sized + typedef mat<3, 3, int8, defaultp> i8mat3; + + /// 16 bit signed integer 3x3 matrix. + /// + /// @see ext_matrix_int3x3_sized + typedef mat<3, 3, int16, defaultp> i16mat3; + + /// 32 bit signed integer 3x3 matrix. + /// + /// @see ext_matrix_int3x3_sized + typedef mat<3, 3, int32, defaultp> i32mat3; + + /// 64 bit signed integer 3x3 matrix. + /// + /// @see ext_matrix_int3x3_sized + typedef mat<3, 3, int64, defaultp> i64mat3; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_int3x4.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_int3x4.hpp new file mode 100644 index 0000000000000000000000000000000000000000..a784279515b711e018097989d71e4308bbf4db20 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_int3x4.hpp @@ -0,0 +1,33 @@ +/// @ref ext_matrix_int3x4 +/// @file glm/ext/matrix_int3x4.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_int3x4 GLM_EXT_matrix_int3x4 +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat3x4.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_int3x4 extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_int3x4 + /// @{ + + /// Signed integer 3x4 matrix. + /// + /// @see ext_matrix_int3x4 + typedef mat<3, 4, int, defaultp> imat3x4; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_int3x4_sized.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_int3x4_sized.hpp new file mode 100644 index 0000000000000000000000000000000000000000..b79b037ec6661ecf98db34113d51387c9521a163 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_int3x4_sized.hpp @@ -0,0 +1,49 @@ +/// @ref ext_matrix_int3x4_sized +/// @file glm/ext/matrix_int3x2_sized.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_int3x4_sized GLM_EXT_matrix_int3x4_sized +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat3x4.hpp" +#include "../ext/scalar_int_sized.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_int3x4_sized extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_int3x4_sized + /// @{ + + /// 8 bit signed integer 3x4 matrix. + /// + /// @see ext_matrix_int3x4_sized + typedef mat<3, 4, int8, defaultp> i8mat3x4; + + /// 16 bit signed integer 3x4 matrix. + /// + /// @see ext_matrix_int3x4_sized + typedef mat<3, 4, int16, defaultp> i16mat3x4; + + /// 32 bit signed integer 3x4 matrix. + /// + /// @see ext_matrix_int3x4_sized + typedef mat<3, 4, int32, defaultp> i32mat3x4; + + /// 64 bit signed integer 3x4 matrix. + /// + /// @see ext_matrix_int3x4_sized + typedef mat<3, 4, int64, defaultp> i64mat3x4; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_int4x2.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_int4x2.hpp new file mode 100644 index 0000000000000000000000000000000000000000..897322d7e4311526b86fa26a620f2623625cc708 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_int4x2.hpp @@ -0,0 +1,33 @@ +/// @ref ext_matrix_int4x2 +/// @file glm/ext/matrix_int4x2.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_int4x2 GLM_EXT_matrix_int4x2 +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat4x2.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_int4x2 extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_int4x2 + /// @{ + + /// Signed integer 4x2 matrix. + /// + /// @see ext_matrix_int4x2 + typedef mat<4, 2, int, defaultp> imat4x2; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_int4x2_sized.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_int4x2_sized.hpp new file mode 100644 index 0000000000000000000000000000000000000000..322e4e5ae2b2104c2f541a7430f18c8fc489f9e3 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_int4x2_sized.hpp @@ -0,0 +1,49 @@ +/// @ref ext_matrix_int4x2_sized +/// @file glm/ext/matrix_int4x2_sized.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_int4x2_sized GLM_EXT_matrix_int4x2_sized +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat4x2.hpp" +#include "../ext/scalar_int_sized.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_int4x2_sized extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_int4x2_sized + /// @{ + + /// 8 bit signed integer 4x2 matrix. + /// + /// @see ext_matrix_int4x2_sized + typedef mat<4, 2, int8, defaultp> i8mat4x2; + + /// 16 bit signed integer 4x2 matrix. + /// + /// @see ext_matrix_int4x2_sized + typedef mat<4, 2, int16, defaultp> i16mat4x2; + + /// 32 bit signed integer 4x2 matrix. + /// + /// @see ext_matrix_int4x2_sized + typedef mat<4, 2, int32, defaultp> i32mat4x2; + + /// 64 bit signed integer 4x2 matrix. + /// + /// @see ext_matrix_int4x2_sized + typedef mat<4, 2, int64, defaultp> i64mat4x2; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_int4x3.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_int4x3.hpp new file mode 100644 index 0000000000000000000000000000000000000000..c14a663ecc79e2cfb05c7ca282eb8b818bb01588 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_int4x3.hpp @@ -0,0 +1,33 @@ +/// @ref ext_matrix_int4x3 +/// @file glm/ext/matrix_int4x3.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_int4x3 GLM_EXT_matrix_int4x3 +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat4x3.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_int4x3 extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_int4x3 + /// @{ + + /// Signed integer 4x3 matrix. + /// + /// @see ext_matrix_int4x3 + typedef mat<4, 3, int, defaultp> imat4x3; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_int4x3_sized.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_int4x3_sized.hpp new file mode 100644 index 0000000000000000000000000000000000000000..1bd1e5181dbaa699dd2b50688419eaffa4b23981 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_int4x3_sized.hpp @@ -0,0 +1,49 @@ +/// @ref ext_matrix_int4x3_sized +/// @file glm/ext/matrix_int4x3_sized.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_int4x3_sized GLM_EXT_matrix_int4x3_sized +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat4x3.hpp" +#include "../ext/scalar_int_sized.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_int4x3_sized extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_int4x3_sized + /// @{ + + /// 8 bit signed integer 4x3 matrix. + /// + /// @see ext_matrix_int4x3_sized + typedef mat<4, 3, int8, defaultp> i8mat4x3; + + /// 16 bit signed integer 4x3 matrix. + /// + /// @see ext_matrix_int4x3_sized + typedef mat<4, 3, int16, defaultp> i16mat4x3; + + /// 32 bit signed integer 4x3 matrix. + /// + /// @see ext_matrix_int4x3_sized + typedef mat<4, 3, int32, defaultp> i32mat4x3; + + /// 64 bit signed integer 4x3 matrix. + /// + /// @see ext_matrix_int4x3_sized + typedef mat<4, 3, int64, defaultp> i64mat4x3; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_int4x4.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_int4x4.hpp new file mode 100644 index 0000000000000000000000000000000000000000..6daf759b3a3a14c4b0dd55c0b02bd009aa16d156 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_int4x4.hpp @@ -0,0 +1,38 @@ +/// @ref ext_matrix_int4x4 +/// @file glm/ext/matrix_int4x4.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_int4x4 GLM_EXT_matrix_int4x4 +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat4x4.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_int4x4 extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_int4x4 + /// @{ + + /// Signed integer 4x4 matrix. + /// + /// @see ext_matrix_int4x4 + typedef mat<4, 4, int, defaultp> imat4x4; + + /// Signed integer 4x4 matrix. + /// + /// @see ext_matrix_int4x4 + typedef mat<4, 4, int, defaultp> imat4; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_int4x4_sized.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_int4x4_sized.hpp new file mode 100644 index 0000000000000000000000000000000000000000..1e553b807a1aca09f331c3929d2395547ab32bf5 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_int4x4_sized.hpp @@ -0,0 +1,70 @@ +/// @ref ext_matrix_int4x4_sized +/// @file glm/ext/matrix_int4x4_sized.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_int4x4_sized GLM_EXT_matrix_int4x4_sized +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat4x4.hpp" +#include "../ext/scalar_int_sized.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_int4x4_sized extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_int4x4_sized + /// @{ + + /// 8 bit signed integer 4x4 matrix. + /// + /// @see ext_matrix_int4x4_sized + typedef mat<4, 4, int8, defaultp> i8mat4x4; + + /// 16 bit signed integer 4x4 matrix. + /// + /// @see ext_matrix_int4x4_sized + typedef mat<4, 4, int16, defaultp> i16mat4x4; + + /// 32 bit signed integer 4x4 matrix. + /// + /// @see ext_matrix_int4x4_sized + typedef mat<4, 4, int32, defaultp> i32mat4x4; + + /// 64 bit signed integer 4x4 matrix. + /// + /// @see ext_matrix_int4x4_sized + typedef mat<4, 4, int64, defaultp> i64mat4x4; + + + /// 8 bit signed integer 4x4 matrix. + /// + /// @see ext_matrix_int4x4_sized + typedef mat<4, 4, int8, defaultp> i8mat4; + + /// 16 bit signed integer 4x4 matrix. + /// + /// @see ext_matrix_int4x4_sized + typedef mat<4, 4, int16, defaultp> i16mat4; + + /// 32 bit signed integer 4x4 matrix. + /// + /// @see ext_matrix_int4x4_sized + typedef mat<4, 4, int32, defaultp> i32mat4; + + /// 64 bit signed integer 4x4 matrix. + /// + /// @see ext_matrix_int4x4_sized + typedef mat<4, 4, int64, defaultp> i64mat4; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_integer.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_integer.hpp new file mode 100644 index 0000000000000000000000000000000000000000..b65801b808efc772ba1748dd26912adab2e0fdcc --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_integer.hpp @@ -0,0 +1,91 @@ +/// @ref ext_matrix_integer +/// @file glm/ext/matrix_integer.hpp +/// +/// @defgroup ext_matrix_integer GLM_EXT_matrix_integer +/// @ingroup ext +/// +/// Defines functions that generate common transformation matrices. +/// +/// The matrices generated by this extension use standard OpenGL fixed-function +/// conventions. For example, the lookAt function generates a transform from world +/// space into the specific eye space that the projective matrix functions +/// (perspective, ortho, etc) are designed to expect. The OpenGL compatibility +/// specifications defines the particular layout of this eye space. +/// +/// Include to use the features of this extension. +/// +/// @see ext_matrix_projection +/// @see ext_matrix_clip_space + +#pragma once + +// Dependencies +#include "../gtc/constants.hpp" +#include "../geometric.hpp" +#include "../trigonometric.hpp" +#include "../matrix.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_integer extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_integer + /// @{ + + /// Multiply matrix x by matrix y component-wise, i.e., + /// result[i][j] is the scalar product of x[i][j] and y[i][j]. + /// + /// @tparam C Integer between 1 and 4 included that qualify the number a column + /// @tparam R Integer between 1 and 4 included that qualify the number a row + /// @tparam T Floating-point or signed integer scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see GLSL matrixCompMult man page + /// @see GLSL 4.20.8 specification, section 8.6 Matrix Functions + template + GLM_FUNC_DECL mat matrixCompMult(mat const& x, mat const& y); + + /// Treats the first parameter c as a column vector + /// and the second parameter r as a row vector + /// and does a linear algebraic matrix multiply c * r. + /// + /// @tparam C Integer between 1 and 4 included that qualify the number a column + /// @tparam R Integer between 1 and 4 included that qualify the number a row + /// @tparam T Floating-point or signed integer scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see GLSL outerProduct man page + /// @see GLSL 4.20.8 specification, section 8.6 Matrix Functions + template + GLM_FUNC_DECL typename detail::outerProduct_trait::type outerProduct(vec const& c, vec const& r); + + /// Returns the transposed matrix of x + /// + /// @tparam C Integer between 1 and 4 included that qualify the number a column + /// @tparam R Integer between 1 and 4 included that qualify the number a row + /// @tparam T Floating-point or signed integer scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see GLSL transpose man page + /// @see GLSL 4.20.8 specification, section 8.6 Matrix Functions + template + GLM_FUNC_DECL typename mat::transpose_type transpose(mat const& x); + + /// Return the determinant of a squared matrix. + /// + /// @tparam C Integer between 1 and 4 included that qualify the number a column + /// @tparam R Integer between 1 and 4 included that qualify the number a row + /// @tparam T Floating-point or signed integer scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see GLSL determinant man page + /// @see GLSL 4.20.8 specification, section 8.6 Matrix Functions + template + GLM_FUNC_DECL T determinant(mat const& m); + + /// @} +}//namespace glm + +#include "matrix_integer.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_integer.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_integer.inl new file mode 100644 index 0000000000000000000000000000000000000000..79f0dfad398c260aa70a5dbbc86c2690cbc44afa --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_integer.inl @@ -0,0 +1,38 @@ +namespace glm{ +namespace detail +{ + template + struct compute_matrixCompMult_type { + GLM_FUNC_QUALIFIER static mat call(mat const& x, mat const& y) + { + return detail::compute_matrixCompMult::value>::call(x, y); + } + }; + + template + struct compute_outerProduct_type { + GLM_FUNC_QUALIFIER static typename detail::outerProduct_trait::type call(vec const& c, vec const& r) + { + return detail::compute_outerProduct::call(c, r); + } + }; + + template + struct compute_transpose_type + { + GLM_FUNC_QUALIFIER static mat call(mat const& m) + { + return detail::compute_transpose::value>::call(m); + } + }; + + template + struct compute_determinant_type{ + + GLM_FUNC_QUALIFIER static T call(mat const& m) + { + return detail::compute_determinant::value>::call(m); + } + }; +}//namespace detail +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_projection.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_projection.hpp new file mode 100644 index 0000000000000000000000000000000000000000..4c2a4948be51387574974052c97d4702b36097fc --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_projection.hpp @@ -0,0 +1,149 @@ +/// @ref ext_matrix_projection +/// @file glm/ext/matrix_projection.hpp +/// +/// @defgroup ext_matrix_projection GLM_EXT_matrix_projection +/// @ingroup ext +/// +/// Functions that generate common projection transformation matrices. +/// +/// The matrices generated by this extension use standard OpenGL fixed-function +/// conventions. For example, the lookAt function generates a transform from world +/// space into the specific eye space that the projective matrix functions +/// (perspective, ortho, etc) are designed to expect. The OpenGL compatibility +/// specifications defines the particular layout of this eye space. +/// +/// Include to use the features of this extension. +/// +/// @see ext_matrix_transform +/// @see ext_matrix_clip_space + +#pragma once + +// Dependencies +#include "../gtc/constants.hpp" +#include "../geometric.hpp" +#include "../trigonometric.hpp" +#include "../matrix.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_projection extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_projection + /// @{ + + /// Map the specified object coordinates (obj.x, obj.y, obj.z) into window coordinates. + /// The near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) + /// + /// @param obj Specify the object coordinates. + /// @param model Specifies the current modelview matrix + /// @param proj Specifies the current projection matrix + /// @param viewport Specifies the current viewport + /// @return Return the computed window coordinates. + /// @tparam T Native type used for the computation. Currently supported: half (not recommended), float or double. + /// @tparam U Currently supported: Floating-point types and integer types. + /// + /// @see gluProject man page + template + GLM_FUNC_DECL vec<3, T, Q> projectZO( + vec<3, T, Q> const& obj, mat<4, 4, T, Q> const& model, mat<4, 4, T, Q> const& proj, vec<4, U, Q> const& viewport); + + /// Map the specified object coordinates (obj.x, obj.y, obj.z) into window coordinates. + /// The near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) + /// + /// @param obj Specify the object coordinates. + /// @param model Specifies the current modelview matrix + /// @param proj Specifies the current projection matrix + /// @param viewport Specifies the current viewport + /// @return Return the computed window coordinates. + /// @tparam T Native type used for the computation. Currently supported: half (not recommended), float or double. + /// @tparam U Currently supported: Floating-point types and integer types. + /// + /// @see gluProject man page + template + GLM_FUNC_DECL vec<3, T, Q> projectNO( + vec<3, T, Q> const& obj, mat<4, 4, T, Q> const& model, mat<4, 4, T, Q> const& proj, vec<4, U, Q> const& viewport); + + /// Map the specified object coordinates (obj.x, obj.y, obj.z) into window coordinates using default near and far clip planes definition. + /// To change default near and far clip planes definition use GLM_FORCE_DEPTH_ZERO_TO_ONE. + /// + /// @param obj Specify the object coordinates. + /// @param model Specifies the current modelview matrix + /// @param proj Specifies the current projection matrix + /// @param viewport Specifies the current viewport + /// @return Return the computed window coordinates. + /// @tparam T Native type used for the computation. Currently supported: half (not recommended), float or double. + /// @tparam U Currently supported: Floating-point types and integer types. + /// + /// @see gluProject man page + template + GLM_FUNC_DECL vec<3, T, Q> project( + vec<3, T, Q> const& obj, mat<4, 4, T, Q> const& model, mat<4, 4, T, Q> const& proj, vec<4, U, Q> const& viewport); + + /// Map the specified window coordinates (win.x, win.y, win.z) into object coordinates. + /// The near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) + /// + /// @param win Specify the window coordinates to be mapped. + /// @param model Specifies the modelview matrix + /// @param proj Specifies the projection matrix + /// @param viewport Specifies the viewport + /// @return Returns the computed object coordinates. + /// @tparam T Native type used for the computation. Currently supported: half (not recommended), float or double. + /// @tparam U Currently supported: Floating-point types and integer types. + /// + /// @see gluUnProject man page + template + GLM_FUNC_DECL vec<3, T, Q> unProjectZO( + vec<3, T, Q> const& win, mat<4, 4, T, Q> const& model, mat<4, 4, T, Q> const& proj, vec<4, U, Q> const& viewport); + + /// Map the specified window coordinates (win.x, win.y, win.z) into object coordinates. + /// The near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) + /// + /// @param win Specify the window coordinates to be mapped. + /// @param model Specifies the modelview matrix + /// @param proj Specifies the projection matrix + /// @param viewport Specifies the viewport + /// @return Returns the computed object coordinates. + /// @tparam T Native type used for the computation. Currently supported: half (not recommended), float or double. + /// @tparam U Currently supported: Floating-point types and integer types. + /// + /// @see gluUnProject man page + template + GLM_FUNC_DECL vec<3, T, Q> unProjectNO( + vec<3, T, Q> const& win, mat<4, 4, T, Q> const& model, mat<4, 4, T, Q> const& proj, vec<4, U, Q> const& viewport); + + /// Map the specified window coordinates (win.x, win.y, win.z) into object coordinates using default near and far clip planes definition. + /// To change default near and far clip planes definition use GLM_FORCE_DEPTH_ZERO_TO_ONE. + /// + /// @param win Specify the window coordinates to be mapped. + /// @param model Specifies the modelview matrix + /// @param proj Specifies the projection matrix + /// @param viewport Specifies the viewport + /// @return Returns the computed object coordinates. + /// @tparam T Native type used for the computation. Currently supported: half (not recommended), float or double. + /// @tparam U Currently supported: Floating-point types and integer types. + /// + /// @see gluUnProject man page + template + GLM_FUNC_DECL vec<3, T, Q> unProject( + vec<3, T, Q> const& win, mat<4, 4, T, Q> const& model, mat<4, 4, T, Q> const& proj, vec<4, U, Q> const& viewport); + + /// Define a picking region + /// + /// @param center Specify the center of a picking region in window coordinates. + /// @param delta Specify the width and height, respectively, of the picking region in window coordinates. + /// @param viewport Rendering viewport + /// @tparam T Native type used for the computation. Currently supported: half (not recommended), float or double. + /// @tparam U Currently supported: Floating-point types and integer types. + /// + /// @see gluPickMatrix man page + template + GLM_FUNC_DECL mat<4, 4, T, Q> pickMatrix( + vec<2, T, Q> const& center, vec<2, T, Q> const& delta, vec<4, U, Q> const& viewport); + + /// @} +}//namespace glm + +#include "matrix_projection.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_projection.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_projection.inl new file mode 100644 index 0000000000000000000000000000000000000000..af8c8f247458683110e5add437d48cd38a7f9f81 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_projection.inl @@ -0,0 +1,106 @@ +namespace glm +{ + template + GLM_FUNC_QUALIFIER vec<3, T, Q> projectZO(vec<3, T, Q> const& obj, mat<4, 4, T, Q> const& model, mat<4, 4, T, Q> const& proj, vec<4, U, Q> const& viewport) + { + vec<4, T, Q> tmp = vec<4, T, Q>(obj, static_cast(1)); + tmp = model * tmp; + tmp = proj * tmp; + + tmp /= tmp.w; + tmp.x = tmp.x * static_cast(0.5) + static_cast(0.5); + tmp.y = tmp.y * static_cast(0.5) + static_cast(0.5); + + tmp[0] = tmp[0] * T(viewport[2]) + T(viewport[0]); + tmp[1] = tmp[1] * T(viewport[3]) + T(viewport[1]); + + return vec<3, T, Q>(tmp); + } + + template + GLM_FUNC_QUALIFIER vec<3, T, Q> projectNO(vec<3, T, Q> const& obj, mat<4, 4, T, Q> const& model, mat<4, 4, T, Q> const& proj, vec<4, U, Q> const& viewport) + { + vec<4, T, Q> tmp = vec<4, T, Q>(obj, static_cast(1)); + tmp = model * tmp; + tmp = proj * tmp; + + tmp /= tmp.w; + tmp = tmp * static_cast(0.5) + static_cast(0.5); + tmp[0] = tmp[0] * T(viewport[2]) + T(viewport[0]); + tmp[1] = tmp[1] * T(viewport[3]) + T(viewport[1]); + + return vec<3, T, Q>(tmp); + } + + template + GLM_FUNC_QUALIFIER vec<3, T, Q> project(vec<3, T, Q> const& obj, mat<4, 4, T, Q> const& model, mat<4, 4, T, Q> const& proj, vec<4, U, Q> const& viewport) + { +# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_ZO_BIT + return projectZO(obj, model, proj, viewport); +# else + return projectNO(obj, model, proj, viewport); +# endif + } + + template + GLM_FUNC_QUALIFIER vec<3, T, Q> unProjectZO(vec<3, T, Q> const& win, mat<4, 4, T, Q> const& model, mat<4, 4, T, Q> const& proj, vec<4, U, Q> const& viewport) + { + mat<4, 4, T, Q> Inverse = inverse(proj * model); + + vec<4, T, Q> tmp = vec<4, T, Q>(win, T(1)); + tmp.x = (tmp.x - T(viewport[0])) / T(viewport[2]); + tmp.y = (tmp.y - T(viewport[1])) / T(viewport[3]); + tmp.x = tmp.x * static_cast(2) - static_cast(1); + tmp.y = tmp.y * static_cast(2) - static_cast(1); + + vec<4, T, Q> obj = Inverse * tmp; + obj /= obj.w; + + return vec<3, T, Q>(obj); + } + + template + GLM_FUNC_QUALIFIER vec<3, T, Q> unProjectNO(vec<3, T, Q> const& win, mat<4, 4, T, Q> const& model, mat<4, 4, T, Q> const& proj, vec<4, U, Q> const& viewport) + { + mat<4, 4, T, Q> Inverse = inverse(proj * model); + + vec<4, T, Q> tmp = vec<4, T, Q>(win, T(1)); + tmp.x = (tmp.x - T(viewport[0])) / T(viewport[2]); + tmp.y = (tmp.y - T(viewport[1])) / T(viewport[3]); + tmp = tmp * static_cast(2) - static_cast(1); + + vec<4, T, Q> obj = Inverse * tmp; + obj /= obj.w; + + return vec<3, T, Q>(obj); + } + + template + GLM_FUNC_QUALIFIER vec<3, T, Q> unProject(vec<3, T, Q> const& win, mat<4, 4, T, Q> const& model, mat<4, 4, T, Q> const& proj, vec<4, U, Q> const& viewport) + { +# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_ZO_BIT + return unProjectZO(win, model, proj, viewport); +# else + return unProjectNO(win, model, proj, viewport); +# endif + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> pickMatrix(vec<2, T, Q> const& center, vec<2, T, Q> const& delta, vec<4, U, Q> const& viewport) + { + assert(delta.x > static_cast(0) && delta.y > static_cast(0)); + mat<4, 4, T, Q> Result(static_cast(1)); + + if(!(delta.x > static_cast(0) && delta.y > static_cast(0))) + return Result; // Error + + vec<3, T, Q> Temp( + (static_cast(viewport[2]) - static_cast(2) * (center.x - static_cast(viewport[0]))) / delta.x, + (static_cast(viewport[3]) - static_cast(2) * (center.y - static_cast(viewport[1]))) / delta.y, + static_cast(0)); + + // Translate and scale the picked region to the entire window + Result = translate(Result, Temp); + return scale(Result, vec<3, T, Q>(static_cast(viewport[2]) / delta.x, static_cast(viewport[3]) / delta.y, static_cast(1))); + } +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_relational.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_relational.hpp new file mode 100644 index 0000000000000000000000000000000000000000..49d53f8305a6eb53b0e1798c1c58c7e088b2b2ac --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_relational.hpp @@ -0,0 +1,132 @@ +/// @ref ext_matrix_relational +/// @file glm/ext/matrix_relational.hpp +/// +/// @defgroup ext_matrix_relational GLM_EXT_matrix_relational +/// @ingroup ext +/// +/// Exposes comparison functions for matrix types that take a user defined epsilon values. +/// +/// Include to use the features of this extension. +/// +/// @see ext_vector_relational +/// @see ext_scalar_relational +/// @see ext_quaternion_relational + +#pragma once + +// Dependencies +#include "../detail/qualifier.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_relational extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_relational + /// @{ + + /// Perform a component-wise equal-to comparison of two matrices. + /// Return a boolean vector which components value is True if this expression is satisfied per column of the matrices. + /// + /// @tparam C Integer between 1 and 4 included that qualify the number of columns of the matrix + /// @tparam R Integer between 1 and 4 included that qualify the number of rows of the matrix + /// @tparam T Floating-point or integer scalar types + /// @tparam Q Value from qualifier enum + template + GLM_FUNC_DECL GLM_CONSTEXPR vec equal(mat const& x, mat const& y); + + /// Perform a component-wise not-equal-to comparison of two matrices. + /// Return a boolean vector which components value is True if this expression is satisfied per column of the matrices. + /// + /// @tparam C Integer between 1 and 4 included that qualify the number of columns of the matrix + /// @tparam R Integer between 1 and 4 included that qualify the number of rows of the matrix + /// @tparam T Floating-point or integer scalar types + /// @tparam Q Value from qualifier enum + template + GLM_FUNC_DECL GLM_CONSTEXPR vec notEqual(mat const& x, mat const& y); + + /// Returns the component-wise comparison of |x - y| < epsilon. + /// True if this expression is satisfied. + /// + /// @tparam C Integer between 1 and 4 included that qualify the number of columns of the matrix + /// @tparam R Integer between 1 and 4 included that qualify the number of rows of the matrix + /// @tparam T Floating-point or integer scalar types + /// @tparam Q Value from qualifier enum + template + GLM_FUNC_DECL GLM_CONSTEXPR vec equal(mat const& x, mat const& y, T epsilon); + + /// Returns the component-wise comparison of |x - y| < epsilon. + /// True if this expression is satisfied. + /// + /// @tparam C Integer between 1 and 4 included that qualify the number of columns of the matrix + /// @tparam R Integer between 1 and 4 included that qualify the number of rows of the matrix + /// @tparam T Floating-point or integer scalar types + /// @tparam Q Value from qualifier enum + template + GLM_FUNC_DECL GLM_CONSTEXPR vec equal(mat const& x, mat const& y, vec const& epsilon); + + /// Returns the component-wise comparison of |x - y| < epsilon. + /// True if this expression is not satisfied. + /// + /// @tparam C Integer between 1 and 4 included that qualify the number of columns of the matrix + /// @tparam R Integer between 1 and 4 included that qualify the number of rows of the matrix + /// @tparam T Floating-point or integer scalar types + /// @tparam Q Value from qualifier enum + template + GLM_FUNC_DECL GLM_CONSTEXPR vec notEqual(mat const& x, mat const& y, T epsilon); + + /// Returns the component-wise comparison of |x - y| >= epsilon. + /// True if this expression is not satisfied. + /// + /// @tparam C Integer between 1 and 4 included that qualify the number of columns of the matrix + /// @tparam R Integer between 1 and 4 included that qualify the number of rows of the matrix + /// @tparam T Floating-point or integer scalar types + /// @tparam Q Value from qualifier enum + template + GLM_FUNC_DECL GLM_CONSTEXPR vec notEqual(mat const& x, mat const& y, vec const& epsilon); + + /// Returns the component-wise comparison between two vectors in term of ULPs. + /// True if this expression is satisfied. + /// + /// @tparam C Integer between 1 and 4 included that qualify the number of columns of the matrix + /// @tparam R Integer between 1 and 4 included that qualify the number of rows of the matrix + /// @tparam T Floating-point + /// @tparam Q Value from qualifier enum + template + GLM_FUNC_DECL GLM_CONSTEXPR vec equal(mat const& x, mat const& y, int ULPs); + + /// Returns the component-wise comparison between two vectors in term of ULPs. + /// True if this expression is satisfied. + /// + /// @tparam C Integer between 1 and 4 included that qualify the number of columns of the matrix + /// @tparam R Integer between 1 and 4 included that qualify the number of rows of the matrix + /// @tparam T Floating-point + /// @tparam Q Value from qualifier enum + template + GLM_FUNC_DECL GLM_CONSTEXPR vec equal(mat const& x, mat const& y, vec const& ULPs); + + /// Returns the component-wise comparison between two vectors in term of ULPs. + /// True if this expression is not satisfied. + /// + /// @tparam C Integer between 1 and 4 included that qualify the number of columns of the matrix + /// @tparam R Integer between 1 and 4 included that qualify the number of rows of the matrix + /// @tparam T Floating-point + /// @tparam Q Value from qualifier enum + template + GLM_FUNC_DECL GLM_CONSTEXPR vec notEqual(mat const& x, mat const& y, int ULPs); + + /// Returns the component-wise comparison between two vectors in term of ULPs. + /// True if this expression is not satisfied. + /// + /// @tparam C Integer between 1 and 4 included that qualify the number of columns of the matrix + /// @tparam R Integer between 1 and 4 included that qualify the number of rows of the matrix + /// @tparam T Floating-point + /// @tparam Q Value from qualifier enum + template + GLM_FUNC_DECL GLM_CONSTEXPR vec notEqual(mat const& x, mat const& y, vec const& ULPs); + + /// @} +}//namespace glm + +#include "matrix_relational.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_relational.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_relational.inl new file mode 100644 index 0000000000000000000000000000000000000000..7d316778e3a90142195d3e833b5205cd058800a6 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_relational.inl @@ -0,0 +1,88 @@ +/// @ref ext_vector_relational +/// @file glm/ext/vector_relational.inl + +// Dependency: +#include "../ext/vector_relational.hpp" +#include "../common.hpp" + +namespace glm +{ + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec equal(mat const& a, mat const& b) + { + vec Result(true); + for(length_t i = 0; i < C; ++i) + Result[i] = all(equal(a[i], b[i])); + return Result; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec equal(mat const& a, mat const& b, T Epsilon) + { + return equal(a, b, vec(Epsilon)); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec equal(mat const& a, mat const& b, vec const& Epsilon) + { + vec Result(true); + for(length_t i = 0; i < C; ++i) + Result[i] = all(equal(a[i], b[i], Epsilon[i])); + return Result; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec notEqual(mat const& a, mat const& b) + { + vec Result(true); + for(length_t i = 0; i < C; ++i) + Result[i] = any(notEqual(a[i], b[i])); + return Result; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec notEqual(mat const& a, mat const& b, T Epsilon) + { + return notEqual(a, b, vec(Epsilon)); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec notEqual(mat const& a, mat const& b, vec const& Epsilon) + { + vec Result(true); + for(length_t i = 0; i < C; ++i) + Result[i] = any(notEqual(a[i], b[i], Epsilon[i])); + return Result; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec equal(mat const& a, mat const& b, int MaxULPs) + { + return equal(a, b, vec(MaxULPs)); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec equal(mat const& a, mat const& b, vec const& MaxULPs) + { + vec Result(true); + for(length_t i = 0; i < C; ++i) + Result[i] = all(equal(a[i], b[i], MaxULPs[i])); + return Result; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec notEqual(mat const& a, mat const& b, int MaxULPs) + { + return notEqual(a, b, vec(MaxULPs)); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec notEqual(mat const& a, mat const& b, vec const& MaxULPs) + { + vec Result(true); + for(length_t i = 0; i < C; ++i) + Result[i] = any(notEqual(a[i], b[i], MaxULPs[i])); + return Result; + } + +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_transform.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_transform.hpp new file mode 100644 index 0000000000000000000000000000000000000000..8977b33d6359bcf5559cffac06969a08e3ca37bf --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_transform.hpp @@ -0,0 +1,171 @@ +/// @ref ext_matrix_transform +/// @file glm/ext/matrix_transform.hpp +/// +/// @defgroup ext_matrix_transform GLM_EXT_matrix_transform +/// @ingroup ext +/// +/// Defines functions that generate common transformation matrices. +/// +/// The matrices generated by this extension use standard OpenGL fixed-function +/// conventions. For example, the lookAt function generates a transform from world +/// space into the specific eye space that the projective matrix functions +/// (perspective, ortho, etc) are designed to expect. The OpenGL compatibility +/// specifications defines the particular layout of this eye space. +/// +/// Include to use the features of this extension. +/// +/// @see ext_matrix_projection +/// @see ext_matrix_clip_space + +#pragma once + +// Dependencies +#include "../gtc/constants.hpp" +#include "../geometric.hpp" +#include "../trigonometric.hpp" +#include "../matrix.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_transform extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_transform + /// @{ + + /// Builds an identity matrix. + template + GLM_FUNC_DECL GLM_CONSTEXPR genType identity(); + + /// Builds a translation 4 * 4 matrix created from a vector of 3 components. + /// + /// @param m Input matrix multiplied by this translation matrix. + /// @param v Coordinates of a translation vector. + /// + /// @tparam T A floating-point scalar type + /// @tparam Q A value from qualifier enum + /// + /// @code + /// #include + /// #include + /// ... + /// glm::mat4 m = glm::translate(glm::mat4(1.0f), glm::vec3(1.0f)); + /// // m[0][0] == 1.0f, m[0][1] == 0.0f, m[0][2] == 0.0f, m[0][3] == 0.0f + /// // m[1][0] == 0.0f, m[1][1] == 1.0f, m[1][2] == 0.0f, m[1][3] == 0.0f + /// // m[2][0] == 0.0f, m[2][1] == 0.0f, m[2][2] == 1.0f, m[2][3] == 0.0f + /// // m[3][0] == 1.0f, m[3][1] == 1.0f, m[3][2] == 1.0f, m[3][3] == 1.0f + /// @endcode + /// + /// @see - translate(mat<4, 4, T, Q> const& m, T x, T y, T z) + /// @see - translate(vec<3, T, Q> const& v) + /// @see glTranslate man page + template + GLM_FUNC_DECL mat<4, 4, T, Q> translate( + mat<4, 4, T, Q> const& m, vec<3, T, Q> const& v); + + /// Builds a rotation 4 * 4 matrix created from an axis vector and an angle. + /// + /// @param m Input matrix multiplied by this rotation matrix. + /// @param angle Rotation angle expressed in radians. + /// @param axis Rotation axis, recommended to be normalized. + /// + /// @tparam T A floating-point scalar type + /// @tparam Q A value from qualifier enum + /// + /// @see - rotate(mat<4, 4, T, Q> const& m, T angle, T x, T y, T z) + /// @see - rotate(T angle, vec<3, T, Q> const& v) + /// @see glRotate man page + template + GLM_FUNC_DECL mat<4, 4, T, Q> rotate( + mat<4, 4, T, Q> const& m, T angle, vec<3, T, Q> const& axis); + + /// Builds a scale 4 * 4 matrix created from 3 scalars. + /// + /// @param m Input matrix multiplied by this scale matrix. + /// @param v Ratio of scaling for each axis. + /// + /// @tparam T A floating-point scalar type + /// @tparam Q A value from qualifier enum + /// + /// @see - scale(mat<4, 4, T, Q> const& m, T x, T y, T z) + /// @see - scale(vec<3, T, Q> const& v) + /// @see glScale man page + template + GLM_FUNC_DECL mat<4, 4, T, Q> scale( + mat<4, 4, T, Q> const& m, vec<3, T, Q> const& v); + + /// Builds a scale 4 * 4 matrix created from point referent 3 shearers. + /// + /// @param m Input matrix multiplied by this shear matrix. + /// @param p Point of shearing as reference. + /// @param l_x Ratio of matrix.x projection in YZ plane relative to the y-axis/z-axis. + /// @param l_y Ratio of matrix.y projection in XZ plane relative to the x-axis/z-axis. + /// @param l_z Ratio of matrix.z projection in XY plane relative to the x-axis/y-axis. + /// + /// as example: + /// [1 , l_xy, l_xz, -(l_xy+l_xz) * p_x] [x] T + /// [x`, y`, z`, w`] = [x`, y`, z`, w`] * [l_yx, 1 , l_yz, -(l_yx+l_yz) * p_y] [y] + /// [l_zx, l_zy, 1 , -(l_zx+l_zy) * p_z] [z] + /// [0 , 0 , 0 , 1 ] [w] + /// + /// @tparam T A floating-point shear type + /// @tparam Q A value from qualifier enum + /// + /// @see - shear(mat<4, 4, T, Q> const& m, T x, T y, T z) + /// @see - shear(vec<3, T, Q> const& p) + /// @see - shear(vec<2, T, Q> const& l_x) + /// @see - shear(vec<2, T, Q> const& l_y) + /// @see - shear(vec<2, T, Q> const& l_z) + /// @see no resource... + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> shear( + mat<4, 4, T, Q> const &m, vec<3, T, Q> const& p, vec<2, T, Q> const &l_x, vec<2, T, Q> const &l_y, vec<2, T, Q> const &l_z); + + /// Build a right handed look at view matrix. + /// + /// @param eye Position of the camera + /// @param center Position where the camera is looking at + /// @param up Normalized up vector, how the camera is oriented. Typically (0, 0, 1) + /// + /// @tparam T A floating-point scalar type + /// @tparam Q A value from qualifier enum + /// + /// @see - frustum(T const& left, T const& right, T const& bottom, T const& top, T const& nearVal, T const& farVal) frustum(T const& left, T const& right, T const& bottom, T const& top, T const& nearVal, T const& farVal) + template + GLM_FUNC_DECL mat<4, 4, T, Q> lookAtRH( + vec<3, T, Q> const& eye, vec<3, T, Q> const& center, vec<3, T, Q> const& up); + + /// Build a left handed look at view matrix. + /// + /// @param eye Position of the camera + /// @param center Position where the camera is looking at + /// @param up Normalized up vector, how the camera is oriented. Typically (0, 0, 1) + /// + /// @tparam T A floating-point scalar type + /// @tparam Q A value from qualifier enum + /// + /// @see - frustum(T const& left, T const& right, T const& bottom, T const& top, T const& nearVal, T const& farVal) frustum(T const& left, T const& right, T const& bottom, T const& top, T const& nearVal, T const& farVal) + template + GLM_FUNC_DECL mat<4, 4, T, Q> lookAtLH( + vec<3, T, Q> const& eye, vec<3, T, Q> const& center, vec<3, T, Q> const& up); + + /// Build a look at view matrix based on the default handedness. + /// + /// @param eye Position of the camera + /// @param center Position where the camera is looking at + /// @param up Normalized up vector, how the camera is oriented. Typically (0, 0, 1) + /// + /// @tparam T A floating-point scalar type + /// @tparam Q A value from qualifier enum + /// + /// @see - frustum(T const& left, T const& right, T const& bottom, T const& top, T const& nearVal, T const& farVal) frustum(T const& left, T const& right, T const& bottom, T const& top, T const& nearVal, T const& farVal) + /// @see gluLookAt man page + template + GLM_FUNC_DECL mat<4, 4, T, Q> lookAt( + vec<3, T, Q> const& eye, vec<3, T, Q> const& center, vec<3, T, Q> const& up); + + /// @} +}//namespace glm + +#include "matrix_transform.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_transform.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_transform.inl new file mode 100644 index 0000000000000000000000000000000000000000..21987723c87032a24e958adf58999c92ce600f66 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_transform.inl @@ -0,0 +1,207 @@ +namespace glm +{ + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType identity() + { + return detail::init_gentype::GENTYPE>::identity(); + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> translate(mat<4, 4, T, Q> const& m, vec<3, T, Q> const& v) + { + mat<4, 4, T, Q> Result(m); + Result[3] = m[0] * v[0] + m[1] * v[1] + m[2] * v[2] + m[3]; + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> rotate(mat<4, 4, T, Q> const& m, T angle, vec<3, T, Q> const& v) + { + T const a = angle; + T const c = cos(a); + T const s = sin(a); + + vec<3, T, Q> axis(normalize(v)); + vec<3, T, Q> temp((T(1) - c) * axis); + + mat<4, 4, T, Q> Rotate; + Rotate[0][0] = c + temp[0] * axis[0]; + Rotate[0][1] = temp[0] * axis[1] + s * axis[2]; + Rotate[0][2] = temp[0] * axis[2] - s * axis[1]; + + Rotate[1][0] = temp[1] * axis[0] - s * axis[2]; + Rotate[1][1] = c + temp[1] * axis[1]; + Rotate[1][2] = temp[1] * axis[2] + s * axis[0]; + + Rotate[2][0] = temp[2] * axis[0] + s * axis[1]; + Rotate[2][1] = temp[2] * axis[1] - s * axis[0]; + Rotate[2][2] = c + temp[2] * axis[2]; + + mat<4, 4, T, Q> Result; + Result[0] = m[0] * Rotate[0][0] + m[1] * Rotate[0][1] + m[2] * Rotate[0][2]; + Result[1] = m[0] * Rotate[1][0] + m[1] * Rotate[1][1] + m[2] * Rotate[1][2]; + Result[2] = m[0] * Rotate[2][0] + m[1] * Rotate[2][1] + m[2] * Rotate[2][2]; + Result[3] = m[3]; + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> rotate_slow(mat<4, 4, T, Q> const& m, T angle, vec<3, T, Q> const& v) + { + T const a = angle; + T const c = cos(a); + T const s = sin(a); + mat<4, 4, T, Q> Result; + + vec<3, T, Q> axis = normalize(v); + + Result[0][0] = c + (static_cast(1) - c) * axis.x * axis.x; + Result[0][1] = (static_cast(1) - c) * axis.x * axis.y + s * axis.z; + Result[0][2] = (static_cast(1) - c) * axis.x * axis.z - s * axis.y; + Result[0][3] = static_cast(0); + + Result[1][0] = (static_cast(1) - c) * axis.y * axis.x - s * axis.z; + Result[1][1] = c + (static_cast(1) - c) * axis.y * axis.y; + Result[1][2] = (static_cast(1) - c) * axis.y * axis.z + s * axis.x; + Result[1][3] = static_cast(0); + + Result[2][0] = (static_cast(1) - c) * axis.z * axis.x + s * axis.y; + Result[2][1] = (static_cast(1) - c) * axis.z * axis.y - s * axis.x; + Result[2][2] = c + (static_cast(1) - c) * axis.z * axis.z; + Result[2][3] = static_cast(0); + + Result[3] = vec<4, T, Q>(0, 0, 0, 1); + return m * Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> scale(mat<4, 4, T, Q> const& m, vec<3, T, Q> const& v) + { + mat<4, 4, T, Q> Result; + Result[0] = m[0] * v[0]; + Result[1] = m[1] * v[1]; + Result[2] = m[2] * v[2]; + Result[3] = m[3]; + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> scale_slow(mat<4, 4, T, Q> const& m, vec<3, T, Q> const& v) + { + mat<4, 4, T, Q> Result(T(1)); + Result[0][0] = v.x; + Result[1][1] = v.y; + Result[2][2] = v.z; + return m * Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> shear(mat<4, 4, T, Q> const &m, vec<3, T, Q> const& p, vec<2, T, Q> const &l_x, vec<2, T, Q> const &l_y, vec<2, T, Q> const &l_z) + { + T const lambda_xy = l_x[0]; + T const lambda_xz = l_x[1]; + T const lambda_yx = l_y[0]; + T const lambda_yz = l_y[1]; + T const lambda_zx = l_z[0]; + T const lambda_zy = l_z[1]; + + vec<3, T, Q> point_lambda = vec<3, T, Q>( + (lambda_xy + lambda_xz), (lambda_yx + lambda_yz), (lambda_zx + lambda_zy) + ); + + mat<4, 4, T, Q> Shear = mat<4, 4, T, Q>( + 1 , lambda_yx , lambda_zx , 0, + lambda_xy , 1 , lambda_zy , 0, + lambda_xz , lambda_yz , 1 , 0, + -point_lambda[0] * p[0], -point_lambda[1] * p[1], -point_lambda[2] * p[2], 1 + ); + + mat<4, 4, T, Q> Result; + Result[0] = Shear[0] * m[0][0] + Shear[1] * m[0][1] + Shear[2] * m[0][2] + Shear[3] * m[0][3]; + Result[1] = Shear[0] * m[1][0] + Shear[1] * m[1][1] + Shear[2] * m[1][2] + Shear[3] * m[1][3]; + Result[2] = Shear[0] * m[2][0] + Shear[1] * m[2][1] + Shear[2] * m[2][2] + Shear[3] * m[2][3]; + Result[3] = Shear[0] * m[3][0] + Shear[1] * m[3][1] + Shear[2] * m[3][2] + Shear[3] * m[3][3]; + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> shear_slow(mat<4, 4, T, Q> const &m, vec<3, T, Q> const& p, vec<2, T, Q> const &l_x, vec<2, T, Q> const &l_y, vec<2, T, Q> const &l_z) + { + T const lambda_xy = static_cast(l_x[0]); + T const lambda_xz = static_cast(l_x[1]); + T const lambda_yx = static_cast(l_y[0]); + T const lambda_yz = static_cast(l_y[1]); + T const lambda_zx = static_cast(l_z[0]); + T const lambda_zy = static_cast(l_z[1]); + + vec<3, T, Q> point_lambda = vec<3, T, Q>( + static_cast(lambda_xy + lambda_xz), + static_cast(lambda_yx + lambda_yz), + static_cast(lambda_zx + lambda_zy) + ); + + mat<4, 4, T, Q> Shear = mat<4, 4, T, Q>( + 1 , lambda_yx , lambda_zx , 0, + lambda_xy , 1 , lambda_zy , 0, + lambda_xz , lambda_yz , 1 , 0, + -point_lambda[0] * p[0], -point_lambda[1] * p[1], -point_lambda[2] * p[2], 1 + ); + return m * Shear; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> lookAtRH(vec<3, T, Q> const& eye, vec<3, T, Q> const& center, vec<3, T, Q> const& up) + { + vec<3, T, Q> const f(normalize(center - eye)); + vec<3, T, Q> const s(normalize(cross(f, up))); + vec<3, T, Q> const u(cross(s, f)); + + mat<4, 4, T, Q> Result(1); + Result[0][0] = s.x; + Result[1][0] = s.y; + Result[2][0] = s.z; + Result[0][1] = u.x; + Result[1][1] = u.y; + Result[2][1] = u.z; + Result[0][2] =-f.x; + Result[1][2] =-f.y; + Result[2][2] =-f.z; + Result[3][0] =-dot(s, eye); + Result[3][1] =-dot(u, eye); + Result[3][2] = dot(f, eye); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> lookAtLH(vec<3, T, Q> const& eye, vec<3, T, Q> const& center, vec<3, T, Q> const& up) + { + vec<3, T, Q> const f(normalize(center - eye)); + vec<3, T, Q> const s(normalize(cross(up, f))); + vec<3, T, Q> const u(cross(f, s)); + + mat<4, 4, T, Q> Result(1); + Result[0][0] = s.x; + Result[1][0] = s.y; + Result[2][0] = s.z; + Result[0][1] = u.x; + Result[1][1] = u.y; + Result[2][1] = u.z; + Result[0][2] = f.x; + Result[1][2] = f.y; + Result[2][2] = f.z; + Result[3][0] = -dot(s, eye); + Result[3][1] = -dot(u, eye); + Result[3][2] = -dot(f, eye); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> lookAt(vec<3, T, Q> const& eye, vec<3, T, Q> const& center, vec<3, T, Q> const& up) + { +# if (GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_LH_BIT) + return lookAtLH(eye, center, up); +# else + return lookAtRH(eye, center, up); +# endif + } +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_uint2x2.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_uint2x2.hpp new file mode 100644 index 0000000000000000000000000000000000000000..a98e5e40769a966244d5bf785cebc2affcdb71f4 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_uint2x2.hpp @@ -0,0 +1,38 @@ +/// @ref ext_matrix_uint2x2 +/// @file glm/ext/matrix_uint2x2.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_uint2x2 GLM_EXT_matrix_uint2x2 +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat2x2.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_uint2x2 extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_uint2x2 + /// @{ + + /// Unsigned integer 2x2 matrix. + /// + /// @see ext_matrix_uint2x2 + typedef mat<2, 2, uint, defaultp> umat2x2; + + /// Unsigned integer 2x2 matrix. + /// + /// @see ext_matrix_uint2x2 + typedef mat<2, 2, uint, defaultp> umat2; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_uint2x2_sized.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_uint2x2_sized.hpp new file mode 100644 index 0000000000000000000000000000000000000000..9429603d118681dcb455882312bac909d2624fb8 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_uint2x2_sized.hpp @@ -0,0 +1,70 @@ +/// @ref ext_matrix_uint2x2_sized +/// @file glm/ext/matrix_uint2x2_sized.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_uint2x2_sized GLM_EXT_matrix_uint2x2_sized +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat2x2.hpp" +#include "../ext/scalar_uint_sized.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_uint2x2_sized extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_uint2x2_sized + /// @{ + + /// 8 bit unsigned integer 2x2 matrix. + /// + /// @see ext_matrix_uint2x2_sized + typedef mat<2, 2, uint8, defaultp> u8mat2x2; + + /// 16 bit unsigned integer 2x2 matrix. + /// + /// @see ext_matrix_uint2x2_sized + typedef mat<2, 2, uint16, defaultp> u16mat2x2; + + /// 32 bit unsigned integer 2x2 matrix. + /// + /// @see ext_matrix_uint2x2_sized + typedef mat<2, 2, uint32, defaultp> u32mat2x2; + + /// 64 bit unsigned integer 2x2 matrix. + /// + /// @see ext_matrix_uint2x2_sized + typedef mat<2, 2, uint64, defaultp> u64mat2x2; + + + /// 8 bit unsigned integer 2x2 matrix. + /// + /// @see ext_matrix_uint2x2_sized + typedef mat<2, 2, uint8, defaultp> u8mat2; + + /// 16 bit unsigned integer 2x2 matrix. + /// + /// @see ext_matrix_uint2x2_sized + typedef mat<2, 2, uint16, defaultp> u16mat2; + + /// 32 bit unsigned integer 2x2 matrix. + /// + /// @see ext_matrix_uint2x2_sized + typedef mat<2, 2, uint32, defaultp> u32mat2; + + /// 64 bit unsigned integer 2x2 matrix. + /// + /// @see ext_matrix_uint2x2_sized + typedef mat<2, 2, uint64, defaultp> u64mat2; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_uint2x3.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_uint2x3.hpp new file mode 100644 index 0000000000000000000000000000000000000000..ab5202fa87324dcbeadc3fb2a3bcafc0e262e2e9 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_uint2x3.hpp @@ -0,0 +1,33 @@ +/// @ref ext_matrix_uint2x3 +/// @file glm/ext/matrix_uint2x3.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_uint2x3 GLM_EXT_matrix_uint2x3 +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat2x3.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_uint2x3 extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_uint2x3 + /// @{ + + /// Unsigned integer 2x3 matrix. + /// + /// @see ext_matrix_uint2x3 + typedef mat<2, 3, uint, defaultp> umat2x3; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_uint2x3_sized.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_uint2x3_sized.hpp new file mode 100644 index 0000000000000000000000000000000000000000..5dca9295ee210873672c1f0497a75249a042566d --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_uint2x3_sized.hpp @@ -0,0 +1,49 @@ +/// @ref ext_matrix_uint2x3_sized +/// @file glm/ext/matrix_uint2x3_sized.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_uint2x3_sized GLM_EXT_matrix_uint2x3_sized +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat2x3.hpp" +#include "../ext/scalar_uint_sized.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_uint2x3_sized extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_uint2x3_sized + /// @{ + + /// 8 bit unsigned integer 2x3 matrix. + /// + /// @see ext_matrix_uint2x3_sized + typedef mat<2, 3, uint8, defaultp> u8mat2x3; + + /// 16 bit unsigned integer 2x3 matrix. + /// + /// @see ext_matrix_uint2x3_sized + typedef mat<2, 3, uint16, defaultp> u16mat2x3; + + /// 32 bit unsigned integer 2x3 matrix. + /// + /// @see ext_matrix_uint2x3_sized + typedef mat<2, 3, uint32, defaultp> u32mat2x3; + + /// 64 bit unsigned integer 2x3 matrix. + /// + /// @see ext_matrix_uint2x3_sized + typedef mat<2, 3, uint64, defaultp> u64mat2x3; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_uint2x4.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_uint2x4.hpp new file mode 100644 index 0000000000000000000000000000000000000000..63bfbc2fdbc6ce3f7b51803d0250ac7038e06300 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_uint2x4.hpp @@ -0,0 +1,33 @@ +/// @ref ext_matrix_uint2x4 +/// @file glm/ext/matrix_uint2x4.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_uint2x4 GLM_EXT_matrix_int2x4 +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat2x4.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_uint2x4 extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_uint2x4 + /// @{ + + /// Unsigned integer 2x4 matrix. + /// + /// @see ext_matrix_uint2x4 + typedef mat<2, 4, uint, defaultp> umat2x4; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_uint2x4_sized.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_uint2x4_sized.hpp new file mode 100644 index 0000000000000000000000000000000000000000..df1bad9b77b3f6ba0962ee841aec2cdad31a1019 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_uint2x4_sized.hpp @@ -0,0 +1,49 @@ +/// @ref ext_matrix_uint2x4_sized +/// @file glm/ext/matrix_uint2x4_sized.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_uint2x4_sized GLM_EXT_matrix_uint2x4_sized +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat2x4.hpp" +#include "../ext/scalar_uint_sized.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_uint2x4_sized extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_uint2x4_sized + /// @{ + + /// 8 bit unsigned integer 2x4 matrix. + /// + /// @see ext_matrix_uint2x4_sized + typedef mat<2, 4, uint8, defaultp> u8mat2x4; + + /// 16 bit unsigned integer 2x4 matrix. + /// + /// @see ext_matrix_uint2x4_sized + typedef mat<2, 4, uint16, defaultp> u16mat2x4; + + /// 32 bit unsigned integer 2x4 matrix. + /// + /// @see ext_matrix_uint2x4_sized + typedef mat<2, 4, uint32, defaultp> u32mat2x4; + + /// 64 bit unsigned integer 2x4 matrix. + /// + /// @see ext_matrix_uint2x4_sized + typedef mat<2, 4, uint64, defaultp> u64mat2x4; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_uint3x2.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_uint3x2.hpp new file mode 100644 index 0000000000000000000000000000000000000000..e6d17212169a04c291eb94a5c0c4755a237020bb --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_uint3x2.hpp @@ -0,0 +1,33 @@ +/// @ref ext_matrix_uint3x2 +/// @file glm/ext/matrix_uint3x2.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_uint3x2 GLM_EXT_matrix_uint3x2 +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat3x2.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_uint3x2 extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_uint3x2 + /// @{ + + /// Unsigned integer 3x2 matrix. + /// + /// @see ext_matrix_uint3x2 + typedef mat<3, 2, uint, defaultp> umat3x2; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_uint3x2_sized.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_uint3x2_sized.hpp new file mode 100644 index 0000000000000000000000000000000000000000..7ed601fa75baba429161575ddcba7292e31c1955 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_uint3x2_sized.hpp @@ -0,0 +1,49 @@ +/// @ref ext_matrix_uint3x2_sized +/// @file glm/ext/matrix_uint3x2_sized.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_uint3x2_sized GLM_EXT_matrix_uint3x2_sized +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat3x2.hpp" +#include "../ext/scalar_uint_sized.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_uint3x2_sized extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_uint3x2_sized + /// @{ + + /// 8 bit signed integer 3x2 matrix. + /// + /// @see ext_matrix_uint3x2_sized + typedef mat<3, 2, uint8, defaultp> u8mat3x2; + + /// 16 bit signed integer 3x2 matrix. + /// + /// @see ext_matrix_uint3x2_sized + typedef mat<3, 2, uint16, defaultp> u16mat3x2; + + /// 32 bit signed integer 3x2 matrix. + /// + /// @see ext_matrix_uint3x2_sized + typedef mat<3, 2, uint32, defaultp> u32mat3x2; + + /// 64 bit signed integer 3x2 matrix. + /// + /// @see ext_matrix_uint3x2_sized + typedef mat<3, 2, uint64, defaultp> u64mat3x2; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_uint3x3.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_uint3x3.hpp new file mode 100644 index 0000000000000000000000000000000000000000..f66dca38ef096d35be3b68181e9baa5f0553bbc8 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_uint3x3.hpp @@ -0,0 +1,38 @@ +/// @ref ext_matrix_uint3x3 +/// @file glm/ext/matrix_uint3x3.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_uint3x3 GLM_EXT_matrix_uint3x3 +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat3x3.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_uint3x3 extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_uint3x3 + /// @{ + + /// Unsigned integer 3x3 matrix. + /// + /// @see ext_matrix_uint3x3 + typedef mat<3, 3, uint, defaultp> umat3x3; + + /// Unsigned integer 3x3 matrix. + /// + /// @see ext_matrix_uint3x3 + typedef mat<3, 3, uint, defaultp> umat3; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_uint3x3_sized.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_uint3x3_sized.hpp new file mode 100644 index 0000000000000000000000000000000000000000..86a2fdd81b1bc272e7f6d0ff26dcf68485e0f1e0 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_uint3x3_sized.hpp @@ -0,0 +1,70 @@ +/// @ref ext_matrix_uint3x3_sized +/// @file glm/ext/matrix_uint3x3_sized.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_uint3x3_sized GLM_EXT_matrix_uint3x3_sized +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat3x3.hpp" +#include "../ext/scalar_uint_sized.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_uint3x3_sized extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_uint3x3_sized + /// @{ + + /// 8 bit unsigned integer 3x3 matrix. + /// + /// @see ext_matrix_uint3x3_sized + typedef mat<3, 3, uint8, defaultp> u8mat3x3; + + /// 16 bit unsigned integer 3x3 matrix. + /// + /// @see ext_matrix_uint3x3_sized + typedef mat<3, 3, uint16, defaultp> u16mat3x3; + + /// 32 bit unsigned integer 3x3 matrix. + /// + /// @see ext_matrix_uint3x3_sized + typedef mat<3, 3, uint32, defaultp> u32mat3x3; + + /// 64 bit unsigned integer 3x3 matrix. + /// + /// @see ext_matrix_uint3x3_sized + typedef mat<3, 3, uint64, defaultp> u64mat3x3; + + + /// 8 bit unsigned integer 3x3 matrix. + /// + /// @see ext_matrix_uint3x3_sized + typedef mat<3, 3, uint8, defaultp> u8mat3; + + /// 16 bit unsigned integer 3x3 matrix. + /// + /// @see ext_matrix_uint3x3_sized + typedef mat<3, 3, uint16, defaultp> u16mat3; + + /// 32 bit unsigned integer 3x3 matrix. + /// + /// @see ext_matrix_uint3x3_sized + typedef mat<3, 3, uint32, defaultp> u32mat3; + + /// 64 bit unsigned integer 3x3 matrix. + /// + /// @see ext_matrix_uint3x3_sized + typedef mat<3, 3, uint64, defaultp> u64mat3; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_uint3x4.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_uint3x4.hpp new file mode 100644 index 0000000000000000000000000000000000000000..d5a16a254fa23f8b22b35d2b245a48196fb04eb9 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_uint3x4.hpp @@ -0,0 +1,33 @@ +/// @ref ext_matrix_uint3x4 +/// @file glm/ext/matrix_uint3x4.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_uint3x4 GLM_EXT_matrix_uint3x4 +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat3x4.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_uint3x4 extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_uint3x4 + /// @{ + + /// Signed integer 3x4 matrix. + /// + /// @see ext_matrix_uint3x4 + typedef mat<3, 4, uint, defaultp> umat3x4; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_uint3x4_sized.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_uint3x4_sized.hpp new file mode 100644 index 0000000000000000000000000000000000000000..0c7def3c904e7160603b35b04f7a8f0f3ec60612 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_uint3x4_sized.hpp @@ -0,0 +1,49 @@ +/// @ref ext_matrix_uint3x4_sized +/// @file glm/ext/matrix_uint3x2_sized.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_uint3x4_sized GLM_EXT_matrix_uint3x4_sized +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat3x4.hpp" +#include "../ext/scalar_uint_sized.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_uint3x4_sized extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_uint3x4_sized + /// @{ + + /// 8 bit unsigned integer 3x4 matrix. + /// + /// @see ext_matrix_uint3x4_sized + typedef mat<3, 4, uint8, defaultp> u8mat3x4; + + /// 16 bit unsigned integer 3x4 matrix. + /// + /// @see ext_matrix_uint3x4_sized + typedef mat<3, 4, uint16, defaultp> u16mat3x4; + + /// 32 bit unsigned integer 3x4 matrix. + /// + /// @see ext_matrix_uint3x4_sized + typedef mat<3, 4, uint32, defaultp> u32mat3x4; + + /// 64 bit unsigned integer 3x4 matrix. + /// + /// @see ext_matrix_uint3x4_sized + typedef mat<3, 4, uint64, defaultp> u64mat3x4; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_uint4x2.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_uint4x2.hpp new file mode 100644 index 0000000000000000000000000000000000000000..e602c4c3f48e4cbee7f5bea5d424751a82b7d548 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_uint4x2.hpp @@ -0,0 +1,33 @@ +/// @ref ext_matrix_uint4x2 +/// @file glm/ext/matrix_uint4x2.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_uint4x2 GLM_EXT_matrix_uint4x2 +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat4x2.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_uint4x2 extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_uint4x2 + /// @{ + + /// Unsigned integer 4x2 matrix. + /// + /// @see ext_matrix_uint4x2 + typedef mat<4, 2, uint, defaultp> umat4x2; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_uint4x2_sized.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_uint4x2_sized.hpp new file mode 100644 index 0000000000000000000000000000000000000000..02602d95ead2f8751d3c72e95a4345d8fa58ae62 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_uint4x2_sized.hpp @@ -0,0 +1,49 @@ +/// @ref ext_matrix_uint4x2_sized +/// @file glm/ext/matrix_uint4x2_sized.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_uint4x2_sized GLM_EXT_matrix_uint4x2_sized +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat4x2.hpp" +#include "../ext/scalar_uint_sized.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_uint4x2_sized extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_uint4x2_sized + /// @{ + + /// 8 bit unsigned integer 4x2 matrix. + /// + /// @see ext_matrix_uint4x2_sized + typedef mat<4, 2, uint8, defaultp> u8mat4x2; + + /// 16 bit unsigned integer 4x2 matrix. + /// + /// @see ext_matrix_uint4x2_sized + typedef mat<4, 2, uint16, defaultp> u16mat4x2; + + /// 32 bit unsigned integer 4x2 matrix. + /// + /// @see ext_matrix_uint4x2_sized + typedef mat<4, 2, uint32, defaultp> u32mat4x2; + + /// 64 bit unsigned integer 4x2 matrix. + /// + /// @see ext_matrix_uint4x2_sized + typedef mat<4, 2, uint64, defaultp> u64mat4x2; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_uint4x3.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_uint4x3.hpp new file mode 100644 index 0000000000000000000000000000000000000000..b56d786a7793935bda9795328b16ffcbb49cfe08 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_uint4x3.hpp @@ -0,0 +1,33 @@ +/// @ref ext_matrix_uint4x3 +/// @file glm/ext/matrix_uint4x3.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_uint4x3 GLM_EXT_matrix_uint4x3 +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat4x3.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_uint4x3 extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_uint4x3 + /// @{ + + /// Unsigned integer 4x3 matrix. + /// + /// @see ext_matrix_uint4x3 + typedef mat<4, 3, uint, defaultp> umat4x3; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_uint4x3_sized.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_uint4x3_sized.hpp new file mode 100644 index 0000000000000000000000000000000000000000..5a56796f755a0926f8e4abde62209a10211f8a68 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_uint4x3_sized.hpp @@ -0,0 +1,49 @@ +/// @ref ext_matrix_uint4x3_sized +/// @file glm/ext/matrix_uint4x3_sized.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_uint4x3_sized GLM_EXT_matrix_uint4x3_sized +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat4x3.hpp" +#include "../ext/scalar_uint_sized.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_uint4x3_sized extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_uint4x3_sized + /// @{ + + /// 8 bit unsigned integer 4x3 matrix. + /// + /// @see ext_matrix_uint4x3_sized + typedef mat<4, 3, uint8, defaultp> u8mat4x3; + + /// 16 bit unsigned integer 4x3 matrix. + /// + /// @see ext_matrix_uint4x3_sized + typedef mat<4, 3, uint16, defaultp> u16mat4x3; + + /// 32 bit unsigned integer 4x3 matrix. + /// + /// @see ext_matrix_uint4x3_sized + typedef mat<4, 3, uint32, defaultp> u32mat4x3; + + /// 64 bit unsigned integer 4x3 matrix. + /// + /// @see ext_matrix_uint4x3_sized + typedef mat<4, 3, uint64, defaultp> u64mat4x3; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_uint4x4.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_uint4x4.hpp new file mode 100644 index 0000000000000000000000000000000000000000..b3e949acdf71cef85d1da8a4b00e57ba5508e6e2 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_uint4x4.hpp @@ -0,0 +1,38 @@ +/// @ref ext_matrix_uint4x4 +/// @file glm/ext/matrix_uint4x4.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_uint4x4 GLM_EXT_matrix_uint4x4 +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat4x4.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_uint4x4 extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_uint4x4 + /// @{ + + /// Unsigned integer 4x4 matrix. + /// + /// @see ext_matrix_uint4x4 + typedef mat<4, 4, uint, defaultp> umat4x4; + + /// Unsigned integer 4x4 matrix. + /// + /// @see ext_matrix_uint4x4 + typedef mat<4, 4, uint, defaultp> umat4; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_uint4x4_sized.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_uint4x4_sized.hpp new file mode 100644 index 0000000000000000000000000000000000000000..60395d4251cf0584af7a33059a80a449105490a3 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/matrix_uint4x4_sized.hpp @@ -0,0 +1,70 @@ +/// @ref ext_matrix_uint4x4_sized +/// @file glm/ext/matrix_uint4x4_sized.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_matrix_uint4x4_sized GLM_EXT_matrix_uint4x4_sized +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat4x4.hpp" +#include "../ext/scalar_uint_sized.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_matrix_uint4x4_sized extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_matrix_uint4x4_sized + /// @{ + + /// 8 bit unsigned integer 4x4 matrix. + /// + /// @see ext_matrix_uint4x4_sized + typedef mat<4, 4, uint8, defaultp> u8mat4x4; + + /// 16 bit unsigned integer 4x4 matrix. + /// + /// @see ext_matrix_uint4x4_sized + typedef mat<4, 4, uint16, defaultp> u16mat4x4; + + /// 32 bit unsigned integer 4x4 matrix. + /// + /// @see ext_matrix_uint4x4_sized + typedef mat<4, 4, uint32, defaultp> u32mat4x4; + + /// 64 bit unsigned integer 4x4 matrix. + /// + /// @see ext_matrix_uint4x4_sized + typedef mat<4, 4, uint64, defaultp> u64mat4x4; + + + /// 8 bit unsigned integer 4x4 matrix. + /// + /// @see ext_matrix_uint4x4_sized + typedef mat<4, 4, uint8, defaultp> u8mat4; + + /// 16 bit unsigned integer 4x4 matrix. + /// + /// @see ext_matrix_uint4x4_sized + typedef mat<4, 4, uint16, defaultp> u16mat4; + + /// 32 bit unsigned integer 4x4 matrix. + /// + /// @see ext_matrix_uint4x4_sized + typedef mat<4, 4, uint32, defaultp> u32mat4; + + /// 64 bit unsigned integer 4x4 matrix. + /// + /// @see ext_matrix_uint4x4_sized + typedef mat<4, 4, uint64, defaultp> u64mat4; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/quaternion_common.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/quaternion_common.hpp new file mode 100644 index 0000000000000000000000000000000000000000..a146d4981297c8527849b2e9e6779c3e5496cf92 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/quaternion_common.hpp @@ -0,0 +1,135 @@ +/// @ref ext_quaternion_common +/// @file glm/ext/quaternion_common.hpp +/// +/// @defgroup ext_quaternion_common GLM_EXT_quaternion_common +/// @ingroup ext +/// +/// Provides common functions for quaternion types +/// +/// Include to use the features of this extension. +/// +/// @see ext_scalar_common +/// @see ext_vector_common +/// @see ext_quaternion_float +/// @see ext_quaternion_double +/// @see ext_quaternion_exponential +/// @see ext_quaternion_geometric +/// @see ext_quaternion_relational +/// @see ext_quaternion_trigonometric +/// @see ext_quaternion_transform + +#pragma once + +// Dependency: +#include "../ext/scalar_constants.hpp" +#include "../ext/quaternion_geometric.hpp" +#include "../common.hpp" +#include "../trigonometric.hpp" +#include "../exponential.hpp" +#include + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_quaternion_common extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_quaternion_common + /// @{ + + /// Spherical linear interpolation of two quaternions. + /// The interpolation is oriented and the rotation is performed at constant speed. + /// For short path spherical linear interpolation, use the slerp function. + /// + /// @param x A quaternion + /// @param y A quaternion + /// @param a Interpolation factor. The interpolation is defined beyond the range [0, 1]. + /// + /// @tparam T A floating-point scalar type + /// @tparam Q A value from qualifier enum + /// + /// @see - slerp(qua const& x, qua const& y, T const& a) + template + GLM_FUNC_DECL qua mix(qua const& x, qua const& y, T a); + + /// Linear interpolation of two quaternions. + /// The interpolation is oriented. + /// + /// @param x A quaternion + /// @param y A quaternion + /// @param a Interpolation factor. The interpolation is defined in the range [0, 1]. + /// + /// @tparam T A floating-point scalar type + /// @tparam Q A value from qualifier enum + template + GLM_FUNC_DECL qua lerp(qua const& x, qua const& y, T a); + + /// Spherical linear interpolation of two quaternions. + /// The interpolation always take the short path and the rotation is performed at constant speed. + /// + /// @param x A quaternion + /// @param y A quaternion + /// @param a Interpolation factor. The interpolation is defined beyond the range [0, 1]. + /// + /// @tparam T A floating-point scalar type + /// @tparam Q A value from qualifier enum + template + GLM_FUNC_DECL qua slerp(qua const& x, qua const& y, T a); + + /// Spherical linear interpolation of two quaternions with multiple spins over rotation axis. + /// The interpolation always take the short path when the spin count is positive and long path + /// when count is negative. Rotation is performed at constant speed. + /// + /// @param x A quaternion + /// @param y A quaternion + /// @param a Interpolation factor. The interpolation is defined beyond the range [0, 1]. + /// @param k Additional spin count. If Value is negative interpolation will be on "long" path. + /// + /// @tparam T A floating-point scalar type + /// @tparam S An integer scalar type + /// @tparam Q A value from qualifier enum + template + GLM_FUNC_DECL qua slerp(qua const& x, qua const& y, T a, S k); + + /// Returns the q conjugate. + /// + /// @tparam T A floating-point scalar type + /// @tparam Q A value from qualifier enum + template + GLM_FUNC_DECL qua conjugate(qua const& q); + + /// Returns the q inverse. + /// + /// @tparam T A floating-point scalar type + /// @tparam Q A value from qualifier enum + template + GLM_FUNC_DECL qua inverse(qua const& q); + + /// Returns true if x holds a NaN (not a number) + /// representation in the underlying implementation's set of + /// floating point representations. Returns false otherwise, + /// including for implementations with no NaN + /// representations. + /// + /// /!\ When using compiler fast math, this function may fail. + /// + /// @tparam T A floating-point scalar type + /// @tparam Q A value from qualifier enum + template + GLM_FUNC_DECL vec<4, bool, Q> isnan(qua const& x); + + /// Returns true if x holds a positive infinity or negative + /// infinity representation in the underlying implementation's + /// set of floating point representations. Returns false + /// otherwise, including for implementations with no infinity + /// representations. + /// + /// @tparam T A floating-point scalar type + /// @tparam Q A value from qualifier enum + template + GLM_FUNC_DECL vec<4, bool, Q> isinf(qua const& x); + + /// @} +} //namespace glm + +#include "quaternion_common.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/quaternion_common.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/quaternion_common.inl new file mode 100644 index 0000000000000000000000000000000000000000..af4d8880550bb1c43e52deb4602f0ef0acb0eae4 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/quaternion_common.inl @@ -0,0 +1,144 @@ +namespace glm +{ + template + GLM_FUNC_QUALIFIER qua mix(qua const& x, qua const& y, T a) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'mix' only accept floating-point inputs"); + + T const cosTheta = dot(x, y); + + // Perform a linear interpolation when cosTheta is close to 1 to avoid side effect of sin(angle) becoming a zero denominator + if(cosTheta > static_cast(1) - epsilon()) + { + // Linear interpolation + return qua( + mix(x.w, y.w, a), + mix(x.x, y.x, a), + mix(x.y, y.y, a), + mix(x.z, y.z, a)); + } + else + { + // Essential Mathematics, page 467 + T angle = acos(cosTheta); + return (sin((static_cast(1) - a) * angle) * x + sin(a * angle) * y) / sin(angle); + } + } + + template + GLM_FUNC_QUALIFIER qua lerp(qua const& x, qua const& y, T a) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'lerp' only accept floating-point inputs"); + + // Lerp is only defined in [0, 1] + assert(a >= static_cast(0)); + assert(a <= static_cast(1)); + + return x * (static_cast(1) - a) + (y * a); + } + + template + GLM_FUNC_QUALIFIER qua slerp(qua const& x, qua const& y, T a) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'slerp' only accept floating-point inputs"); + + qua z = y; + + T cosTheta = dot(x, y); + + // If cosTheta < 0, the interpolation will take the long way around the sphere. + // To fix this, one quat must be negated. + if(cosTheta < static_cast(0)) + { + z = -y; + cosTheta = -cosTheta; + } + + // Perform a linear interpolation when cosTheta is close to 1 to avoid side effect of sin(angle) becoming a zero denominator + if(cosTheta > static_cast(1) - epsilon()) + { + // Linear interpolation + return qua( + mix(x.w, z.w, a), + mix(x.x, z.x, a), + mix(x.y, z.y, a), + mix(x.z, z.z, a)); + } + else + { + // Essential Mathematics, page 467 + T angle = acos(cosTheta); + return (sin((static_cast(1) - a) * angle) * x + sin(a * angle) * z) / sin(angle); + } + } + + template + GLM_FUNC_QUALIFIER qua slerp(qua const& x, qua const& y, T a, S k) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'slerp' only accept floating-point inputs"); + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'slerp' only accept integer for spin count"); + + qua z = y; + + T cosTheta = dot(x, y); + + // If cosTheta < 0, the interpolation will take the long way around the sphere. + // To fix this, one quat must be negated. + if (cosTheta < static_cast(0)) + { + z = -y; + cosTheta = -cosTheta; + } + + // Perform a linear interpolation when cosTheta is close to 1 to avoid side effect of sin(angle) becoming a zero denominator + if (cosTheta > static_cast(1) - epsilon()) + { + // Linear interpolation + return qua( + mix(x.w, z.w, a), + mix(x.x, z.x, a), + mix(x.y, z.y, a), + mix(x.z, z.z, a)); + } + else + { + // Graphics Gems III, page 96 + T angle = acos(cosTheta); + T phi = angle + k * glm::pi(); + return (sin(angle - a * phi)* x + sin(a * phi) * z) / sin(angle); + } + } + + template + GLM_FUNC_QUALIFIER qua conjugate(qua const& q) + { + return qua(q.w, -q.x, -q.y, -q.z); + } + + template + GLM_FUNC_QUALIFIER qua inverse(qua const& q) + { + return conjugate(q) / dot(q, q); + } + + template + GLM_FUNC_QUALIFIER vec<4, bool, Q> isnan(qua const& q) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'isnan' only accept floating-point inputs"); + + return vec<4, bool, Q>(isnan(q.x), isnan(q.y), isnan(q.z), isnan(q.w)); + } + + template + GLM_FUNC_QUALIFIER vec<4, bool, Q> isinf(qua const& q) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'isinf' only accept floating-point inputs"); + + return vec<4, bool, Q>(isinf(q.x), isinf(q.y), isinf(q.z), isinf(q.w)); + } +}//namespace glm + +#if GLM_CONFIG_SIMD == GLM_ENABLE +# include "quaternion_common_simd.inl" +#endif + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/quaternion_common_simd.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/quaternion_common_simd.inl new file mode 100644 index 0000000000000000000000000000000000000000..c7abd88345c6129ac087940fe633d9b709f21e01 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/quaternion_common_simd.inl @@ -0,0 +1,18 @@ +#if GLM_ARCH & GLM_ARCH_SSE2_BIT + +namespace glm{ +namespace detail +{ + template + struct compute_dot, float, true> + { + static GLM_FUNC_QUALIFIER float call(qua const& x, qua const& y) + { + return _mm_cvtss_f32(glm_vec1_dot(x.data, y.data)); + } + }; +}//namespace detail +}//namespace glm + +#endif//GLM_ARCH & GLM_ARCH_SSE2_BIT + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/quaternion_double.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/quaternion_double.hpp new file mode 100644 index 0000000000000000000000000000000000000000..9ec2895540b1adc9377c6c4db2fb64e5f8c12ed6 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/quaternion_double.hpp @@ -0,0 +1,39 @@ +/// @ref ext_quaternion_double +/// @file glm/ext/quaternion_double.hpp +/// +/// @defgroup ext_quaternion_double GLM_EXT_quaternion_double +/// @ingroup ext +/// +/// Exposes double-precision floating point quaternion type. +/// +/// Include to use the features of this extension. +/// +/// @see ext_quaternion_float +/// @see ext_quaternion_double_precision +/// @see ext_quaternion_common +/// @see ext_quaternion_exponential +/// @see ext_quaternion_geometric +/// @see ext_quaternion_relational +/// @see ext_quaternion_transform +/// @see ext_quaternion_trigonometric + +#pragma once + +// Dependency: +#include "../detail/type_quat.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_quaternion_double extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_quaternion_double + /// @{ + + /// Quaternion of double-precision floating-point numbers. + typedef qua dquat; + + /// @} +} //namespace glm + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/quaternion_double_precision.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/quaternion_double_precision.hpp new file mode 100644 index 0000000000000000000000000000000000000000..9cf390a34b85cdae0a2c25ade81fab621fbf8f91 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/quaternion_double_precision.hpp @@ -0,0 +1,42 @@ +/// @ref ext_quaternion_double_precision +/// @file glm/ext/quaternion_double_precision.hpp +/// +/// @defgroup ext_quaternion_double_precision GLM_EXT_quaternion_double_precision +/// @ingroup ext +/// +/// Exposes double-precision floating point quaternion type with various precision in term of ULPs. +/// +/// Include to use the features of this extension. + +#pragma once + +// Dependency: +#include "../detail/type_quat.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_quaternion_double_precision extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_quaternion_double_precision + /// @{ + + /// Quaternion of double-precision floating-point numbers using high precision arithmetic in term of ULPs. + /// + /// @see ext_quaternion_double_precision + typedef qua lowp_dquat; + + /// Quaternion of medium double-qualifier floating-point numbers using high precision arithmetic in term of ULPs. + /// + /// @see ext_quaternion_double_precision + typedef qua mediump_dquat; + + /// Quaternion of high double-qualifier floating-point numbers using high precision arithmetic in term of ULPs. + /// + /// @see ext_quaternion_double_precision + typedef qua highp_dquat; + + /// @} +} //namespace glm + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/quaternion_exponential.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/quaternion_exponential.hpp new file mode 100644 index 0000000000000000000000000000000000000000..75a6441a7780dccbed0da26629b8801cb23738c7 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/quaternion_exponential.hpp @@ -0,0 +1,63 @@ +/// @ref ext_quaternion_exponential +/// @file glm/ext/quaternion_exponential.hpp +/// +/// @defgroup ext_quaternion_exponential GLM_EXT_quaternion_exponential +/// @ingroup ext +/// +/// Provides exponential functions for quaternion types +/// +/// Include to use the features of this extension. +/// +/// @see core_exponential +/// @see ext_quaternion_float +/// @see ext_quaternion_double + +#pragma once + +// Dependency: +#include "../common.hpp" +#include "../trigonometric.hpp" +#include "../geometric.hpp" +#include "../ext/scalar_constants.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_quaternion_exponential extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_quaternion_transform + /// @{ + + /// Returns a exponential of a quaternion. + /// + /// @tparam T A floating-point scalar type + /// @tparam Q A value from qualifier enum + template + GLM_FUNC_DECL qua exp(qua const& q); + + /// Returns a logarithm of a quaternion + /// + /// @tparam T A floating-point scalar type + /// @tparam Q A value from qualifier enum + template + GLM_FUNC_DECL qua log(qua const& q); + + /// Returns a quaternion raised to a power. + /// + /// @tparam T A floating-point scalar type + /// @tparam Q A value from qualifier enum + template + GLM_FUNC_DECL qua pow(qua const& q, T y); + + /// Returns the square root of a quaternion + /// + /// @tparam T A floating-point scalar type + /// @tparam Q A value from qualifier enum + template + GLM_FUNC_DECL qua sqrt(qua const& q); + + /// @} +} //namespace glm + +#include "quaternion_exponential.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/quaternion_exponential.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/quaternion_exponential.inl new file mode 100644 index 0000000000000000000000000000000000000000..bae942f73611bf78c4d8884cc97e9064aedd0c5d --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/quaternion_exponential.inl @@ -0,0 +1,89 @@ +#include "scalar_constants.hpp" + +namespace glm +{ + template + GLM_FUNC_QUALIFIER qua exp(qua const& q) + { + vec<3, T, Q> u(q.x, q.y, q.z); + T const Angle = glm::length(u); + if (Angle < epsilon()) + return qua(); + + vec<3, T, Q> const v(u / Angle); + return qua(cos(Angle), sin(Angle) * v); + } + + template + GLM_FUNC_QUALIFIER qua log(qua const& q) + { + vec<3, T, Q> u(q.x, q.y, q.z); + T Vec3Len = length(u); + + if (Vec3Len < epsilon()) + { + if(q.w > static_cast(0)) + return qua(log(q.w), static_cast(0), static_cast(0), static_cast(0)); + else if(q.w < static_cast(0)) + return qua(log(-q.w), pi(), static_cast(0), static_cast(0)); + else + return qua(std::numeric_limits::infinity(), std::numeric_limits::infinity(), std::numeric_limits::infinity(), std::numeric_limits::infinity()); + } + else + { + T t = atan(Vec3Len, T(q.w)) / Vec3Len; + T QuatLen2 = Vec3Len * Vec3Len + q.w * q.w; + return qua(static_cast(0.5) * log(QuatLen2), t * q.x, t * q.y, t * q.z); + } + } + + template + GLM_FUNC_QUALIFIER qua pow(qua const& x, T y) + { + //Raising to the power of 0 should yield 1 + //Needed to prevent a division by 0 error later on + if(y > -epsilon() && y < epsilon()) + return qua(1,0,0,0); + + //To deal with non-unit quaternions + T magnitude = sqrt(x.x * x.x + x.y * x.y + x.z * x.z + x.w *x.w); + + T Angle; + if(abs(x.w / magnitude) > cos_one_over_two()) + { + //Scalar component is close to 1; using it to recover angle would lose precision + //Instead, we use the non-scalar components since sin() is accurate around 0 + + //Prevent a division by 0 error later on + T VectorMagnitude = x.x * x.x + x.y * x.y + x.z * x.z; + //Despite the compiler might say, we actually want to compare + //VectorMagnitude to 0. here; we could use denorm_int() compiling a + //project with unsafe maths optimizations might make the comparison + //always false, even when VectorMagnitude is 0. + if (VectorMagnitude < std::numeric_limits::min()) { + //Equivalent to raising a real number to a power + return qua(pow(x.w, y), 0, 0, 0); + } + + Angle = asin(sqrt(VectorMagnitude) / magnitude); + } + else + { + //Scalar component is small, shouldn't cause loss of precision + Angle = acos(x.w / magnitude); + } + + T NewAngle = Angle * y; + T Div = sin(NewAngle) / sin(Angle); + T Mag = pow(magnitude, y - static_cast(1)); + return qua(cos(NewAngle) * magnitude * Mag, x.x * Div * Mag, x.y * Div * Mag, x.z * Div * Mag); + } + + template + GLM_FUNC_QUALIFIER qua sqrt(qua const& x) + { + return pow(x, static_cast(0.5)); + } +}//namespace glm + + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/quaternion_float.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/quaternion_float.hpp new file mode 100644 index 0000000000000000000000000000000000000000..1c4153008882a669c5ef31774ac2ad3eec633164 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/quaternion_float.hpp @@ -0,0 +1,39 @@ +/// @ref ext_quaternion_float +/// @file glm/ext/quaternion_float.hpp +/// +/// @defgroup ext_quaternion_float GLM_EXT_quaternion_float +/// @ingroup ext +/// +/// Exposes single-precision floating point quaternion type. +/// +/// Include to use the features of this extension. +/// +/// @see ext_quaternion_double +/// @see ext_quaternion_float_precision +/// @see ext_quaternion_common +/// @see ext_quaternion_exponential +/// @see ext_quaternion_geometric +/// @see ext_quaternion_relational +/// @see ext_quaternion_transform +/// @see ext_quaternion_trigonometric + +#pragma once + +// Dependency: +#include "../detail/type_quat.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_quaternion_float extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_quaternion_float + /// @{ + + /// Quaternion of single-precision floating-point numbers. + typedef qua quat; + + /// @} +} //namespace glm + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/quaternion_float_precision.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/quaternion_float_precision.hpp new file mode 100644 index 0000000000000000000000000000000000000000..0990aea819315004dd138dc54698c80a33b9bca1 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/quaternion_float_precision.hpp @@ -0,0 +1,36 @@ +/// @ref ext_quaternion_float_precision +/// @file glm/ext/quaternion_float_precision.hpp +/// +/// @defgroup ext_quaternion_float_precision GLM_EXT_quaternion_float_precision +/// @ingroup ext +/// +/// Exposes single-precision floating point quaternion type with various precision in term of ULPs. +/// +/// Include to use the features of this extension. + +#pragma once + +// Dependency: +#include "../detail/type_quat.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_quaternion_float_precision extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_quaternion_float_precision + /// @{ + + /// Quaternion of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef qua lowp_quat; + + /// Quaternion of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef qua mediump_quat; + + /// Quaternion of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef qua highp_quat; + + /// @} +} //namespace glm + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/quaternion_geometric.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/quaternion_geometric.hpp new file mode 100644 index 0000000000000000000000000000000000000000..1b48e982e95db37606deab105c596d7183dfae15 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/quaternion_geometric.hpp @@ -0,0 +1,70 @@ +/// @ref ext_quaternion_geometric +/// @file glm/ext/quaternion_geometric.hpp +/// +/// @defgroup ext_quaternion_geometric GLM_EXT_quaternion_geometric +/// @ingroup ext +/// +/// Provides geometric functions for quaternion types +/// +/// Include to use the features of this extension. +/// +/// @see core_func_geometric +/// @see ext_quaternion_float +/// @see ext_quaternion_double + +#pragma once + +// Dependency: +#include "../geometric.hpp" +#include "../exponential.hpp" +#include "../ext/vector_relational.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_quaternion_geometric extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_quaternion_geometric + /// @{ + + /// Returns the norm of a quaternions + /// + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see ext_quaternion_geometric + template + GLM_FUNC_DECL T length(qua const& q); + + /// Returns the normalized quaternion. + /// + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see ext_quaternion_geometric + template + GLM_FUNC_DECL qua normalize(qua const& q); + + /// Returns dot product of q1 and q2, i.e., q1[0] * q2[0] + q1[1] * q2[1] + ... + /// + /// @tparam T Floating-point scalar types. + /// @tparam Q Value from qualifier enum + /// + /// @see ext_quaternion_geometric + template + GLM_FUNC_DECL T dot(qua const& x, qua const& y); + + /// Compute a cross product. + /// + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see ext_quaternion_geometric + template + GLM_FUNC_QUALIFIER qua cross(qua const& q1, qua const& q2); + + /// @} +} //namespace glm + +#include "quaternion_geometric.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/quaternion_geometric.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/quaternion_geometric.inl new file mode 100644 index 0000000000000000000000000000000000000000..da4e9f4206d53656736e9eedbe44f4d12a4321ea --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/quaternion_geometric.inl @@ -0,0 +1,36 @@ +namespace glm +{ + template + GLM_FUNC_QUALIFIER T dot(qua const& x, qua const& y) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'dot' accepts only floating-point inputs"); + return detail::compute_dot, T, detail::is_aligned::value>::call(x, y); + } + + template + GLM_FUNC_QUALIFIER T length(qua const& q) + { + return glm::sqrt(dot(q, q)); + } + + template + GLM_FUNC_QUALIFIER qua normalize(qua const& q) + { + T len = length(q); + if(len <= static_cast(0)) // Problem + return qua(static_cast(1), static_cast(0), static_cast(0), static_cast(0)); + T oneOverLen = static_cast(1) / len; + return qua(q.w * oneOverLen, q.x * oneOverLen, q.y * oneOverLen, q.z * oneOverLen); + } + + template + GLM_FUNC_QUALIFIER qua cross(qua const& q1, qua const& q2) + { + return qua( + q1.w * q2.w - q1.x * q2.x - q1.y * q2.y - q1.z * q2.z, + q1.w * q2.x + q1.x * q2.w + q1.y * q2.z - q1.z * q2.y, + q1.w * q2.y + q1.y * q2.w + q1.z * q2.x - q1.x * q2.z, + q1.w * q2.z + q1.z * q2.w + q1.x * q2.y - q1.y * q2.x); + } +}//namespace glm + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/quaternion_relational.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/quaternion_relational.hpp new file mode 100644 index 0000000000000000000000000000000000000000..38504c9ac98184fcd764e5fa1e7fc5cc223d8c32 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/quaternion_relational.hpp @@ -0,0 +1,62 @@ +/// @ref ext_quaternion_relational +/// @file glm/ext/quaternion_relational.hpp +/// +/// @defgroup ext_quaternion_relational GLM_EXT_quaternion_relational +/// @ingroup ext +/// +/// Exposes comparison functions for quaternion types that take a user defined epsilon values. +/// +/// Include to use the features of this extension. +/// +/// @see core_vector_relational +/// @see ext_vector_relational +/// @see ext_matrix_relational +/// @see ext_quaternion_float +/// @see ext_quaternion_double + +#pragma once + +// Dependency: +#include "../vector_relational.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_quaternion_relational extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_quaternion_relational + /// @{ + + /// Returns the component-wise comparison of result x == y. + /// + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + template + GLM_FUNC_DECL vec<4, bool, Q> equal(qua const& x, qua const& y); + + /// Returns the component-wise comparison of |x - y| < epsilon. + /// + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + template + GLM_FUNC_DECL vec<4, bool, Q> equal(qua const& x, qua const& y, T epsilon); + + /// Returns the component-wise comparison of result x != y. + /// + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + template + GLM_FUNC_DECL vec<4, bool, Q> notEqual(qua const& x, qua const& y); + + /// Returns the component-wise comparison of |x - y| >= epsilon. + /// + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + template + GLM_FUNC_DECL vec<4, bool, Q> notEqual(qua const& x, qua const& y, T epsilon); + + /// @} +} //namespace glm + +#include "quaternion_relational.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/quaternion_relational.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/quaternion_relational.inl new file mode 100644 index 0000000000000000000000000000000000000000..e6802ed93d9d3e8874e9dbf12269851465d7f9dc --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/quaternion_relational.inl @@ -0,0 +1,35 @@ +namespace glm +{ + template + GLM_FUNC_QUALIFIER vec<4, bool, Q> equal(qua const& x, qua const& y) + { + vec<4, bool, Q> Result; + for(length_t i = 0; i < x.length(); ++i) + Result[i] = x[i] == y[i]; + return Result; + } + + template + GLM_FUNC_QUALIFIER vec<4, bool, Q> equal(qua const& x, qua const& y, T epsilon) + { + vec<4, T, Q> v(x.x - y.x, x.y - y.y, x.z - y.z, x.w - y.w); + return lessThan(abs(v), vec<4, T, Q>(epsilon)); + } + + template + GLM_FUNC_QUALIFIER vec<4, bool, Q> notEqual(qua const& x, qua const& y) + { + vec<4, bool, Q> Result; + for(length_t i = 0; i < x.length(); ++i) + Result[i] = x[i] != y[i]; + return Result; + } + + template + GLM_FUNC_QUALIFIER vec<4, bool, Q> notEqual(qua const& x, qua const& y, T epsilon) + { + vec<4, T, Q> v(x.x - y.x, x.y - y.y, x.z - y.z, x.w - y.w); + return greaterThanEqual(abs(v), vec<4, T, Q>(epsilon)); + } +}//namespace glm + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/quaternion_transform.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/quaternion_transform.hpp new file mode 100644 index 0000000000000000000000000000000000000000..7b5d7bd6ffa9dc175e6c8b75e5a19d0e8c57ebe6 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/quaternion_transform.hpp @@ -0,0 +1,47 @@ +/// @ref ext_quaternion_transform +/// @file glm/ext/quaternion_transform.hpp +/// +/// @defgroup ext_quaternion_transform GLM_EXT_quaternion_transform +/// @ingroup ext +/// +/// Provides transformation functions for quaternion types +/// +/// Include to use the features of this extension. +/// +/// @see ext_quaternion_float +/// @see ext_quaternion_double +/// @see ext_quaternion_exponential +/// @see ext_quaternion_geometric +/// @see ext_quaternion_relational +/// @see ext_quaternion_trigonometric + +#pragma once + +// Dependency: +#include "../common.hpp" +#include "../trigonometric.hpp" +#include "../geometric.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_quaternion_transform extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_quaternion_transform + /// @{ + + /// Rotates a quaternion from a vector of 3 components axis and an angle. + /// + /// @param q Source orientation + /// @param angle Angle expressed in radians. + /// @param axis Axis of the rotation + /// + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + template + GLM_FUNC_DECL qua rotate(qua const& q, T const& angle, vec<3, T, Q> const& axis); + /// @} +} //namespace glm + +#include "quaternion_transform.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/quaternion_transform.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/quaternion_transform.inl new file mode 100644 index 0000000000000000000000000000000000000000..4191b52a85db2f248fc695dd0ff19290630220c9 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/quaternion_transform.inl @@ -0,0 +1,24 @@ +namespace glm +{ + template + GLM_FUNC_QUALIFIER qua rotate(qua const& q, T const& angle, vec<3, T, Q> const& v) + { + vec<3, T, Q> Tmp = v; + + // Axis of rotation must be normalised + T len = glm::length(Tmp); + if(abs(len - static_cast(1)) > static_cast(0.001)) + { + T oneOverLen = static_cast(1) / len; + Tmp.x *= oneOverLen; + Tmp.y *= oneOverLen; + Tmp.z *= oneOverLen; + } + + T const AngleRad(angle); + T const Sin = sin(AngleRad * static_cast(0.5)); + + return q * qua(cos(AngleRad * static_cast(0.5)), Tmp.x * Sin, Tmp.y * Sin, Tmp.z * Sin); + } +}//namespace glm + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/quaternion_trigonometric.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/quaternion_trigonometric.hpp new file mode 100644 index 0000000000000000000000000000000000000000..08a6c05f78ca224a07f90fc557315ebad76f6506 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/quaternion_trigonometric.hpp @@ -0,0 +1,63 @@ +/// @ref ext_quaternion_trigonometric +/// @file glm/ext/quaternion_trigonometric.hpp +/// +/// @defgroup ext_quaternion_trigonometric GLM_EXT_quaternion_trigonometric +/// @ingroup ext +/// +/// Provides trigonometric functions for quaternion types +/// +/// Include to use the features of this extension. +/// +/// @see ext_quaternion_float +/// @see ext_quaternion_double +/// @see ext_quaternion_exponential +/// @see ext_quaternion_geometric +/// @see ext_quaternion_relational +/// @see ext_quaternion_transform + +#pragma once + +// Dependency: +#include "../trigonometric.hpp" +#include "../exponential.hpp" +#include "scalar_constants.hpp" +#include "vector_relational.hpp" +#include + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_quaternion_trigonometric extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_quaternion_trigonometric + /// @{ + + /// Returns the quaternion rotation angle. + /// + /// @tparam T A floating-point scalar type + /// @tparam Q A value from qualifier enum + template + GLM_FUNC_DECL T angle(qua const& x); + + /// Returns the q rotation axis. + /// + /// @tparam T A floating-point scalar type + /// @tparam Q A value from qualifier enum + template + GLM_FUNC_DECL vec<3, T, Q> axis(qua const& x); + + /// Build a quaternion from an angle and a normalized axis. + /// + /// @param angle Angle expressed in radians. + /// @param axis Axis of the quaternion, must be normalized. + /// + /// @tparam T A floating-point scalar type + /// @tparam Q A value from qualifier enum + template + GLM_FUNC_DECL qua angleAxis(T const& angle, vec<3, T, Q> const& axis); + + /// @} +} //namespace glm + +#include "quaternion_trigonometric.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/quaternion_trigonometric.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/quaternion_trigonometric.inl new file mode 100644 index 0000000000000000000000000000000000000000..e36abe6556fa4565c952fe3d584ca888e120c268 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/quaternion_trigonometric.inl @@ -0,0 +1,37 @@ +#include "scalar_constants.hpp" + +namespace glm +{ + template + GLM_FUNC_QUALIFIER T angle(qua const& x) + { + if (abs(x.w) > cos_one_over_two()) + { + T const a = asin(sqrt(x.x * x.x + x.y * x.y + x.z * x.z)) * static_cast(2); + if(x.w < static_cast(0)) + return pi() * static_cast(2) - a; + return a; + } + + return acos(x.w) * static_cast(2); + } + + template + GLM_FUNC_QUALIFIER vec<3, T, Q> axis(qua const& x) + { + T const tmp1 = static_cast(1) - x.w * x.w; + if(tmp1 <= static_cast(0)) + return vec<3, T, Q>(0, 0, 1); + T const tmp2 = static_cast(1) / sqrt(tmp1); + return vec<3, T, Q>(x.x * tmp2, x.y * tmp2, x.z * tmp2); + } + + template + GLM_FUNC_QUALIFIER qua angleAxis(T const& angle, vec<3, T, Q> const& v) + { + T const a(angle); + T const s = glm::sin(a * static_cast(0.5)); + + return qua(glm::cos(a * static_cast(0.5)), v * s); + } +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/scalar_common.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/scalar_common.hpp new file mode 100644 index 0000000000000000000000000000000000000000..f7809ec6eb25ad9b14b00637db8c08f477e4bae7 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/scalar_common.hpp @@ -0,0 +1,181 @@ +/// @ref ext_scalar_common +/// @file glm/ext/scalar_common.hpp +/// +/// @defgroup ext_scalar_common GLM_EXT_scalar_common +/// @ingroup ext +/// +/// Exposes min and max functions for 3 to 4 scalar parameters. +/// +/// Include to use the features of this extension. +/// +/// @see core_func_common +/// @see ext_vector_common + +#pragma once + +// Dependency: +#include "../common.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_scalar_common extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_scalar_common + /// @{ + + /// Returns the minimum component-wise values of 3 inputs + /// + /// @tparam T A floating-point scalar type. + /// + /// @see ext_scalar_common + template + GLM_FUNC_DECL T min(T a, T b, T c); + + /// Returns the minimum component-wise values of 4 inputs + /// + /// @tparam T A floating-point scalar type. + /// + /// @see ext_scalar_common + template + GLM_FUNC_DECL T min(T a, T b, T c, T d); + + /// Returns the maximum component-wise values of 3 inputs + /// + /// @tparam T A floating-point scalar type. + /// + /// @see ext_scalar_common + template + GLM_FUNC_DECL T max(T a, T b, T c); + + /// Returns the maximum component-wise values of 4 inputs + /// + /// @tparam T A floating-point scalar type. + /// + /// @see ext_scalar_common + template + GLM_FUNC_DECL T max(T a, T b, T c, T d); + + /// Returns the minimum component-wise values of 2 inputs. If one of the two arguments is NaN, the value of the other argument is returned. + /// + /// @tparam T A floating-point scalar type. + /// + /// @see std::fmin documentation + /// @see ext_scalar_common + template + GLM_FUNC_DECL T fmin(T a, T b); + + /// Returns the minimum component-wise values of 3 inputs. If one of the two arguments is NaN, the value of the other argument is returned. + /// + /// @tparam T A floating-point scalar type. + /// + /// @see std::fmin documentation + /// @see ext_scalar_common + template + GLM_FUNC_DECL T fmin(T a, T b, T c); + + /// Returns the minimum component-wise values of 4 inputs. If one of the two arguments is NaN, the value of the other argument is returned. + /// + /// @tparam T A floating-point scalar type. + /// + /// @see std::fmin documentation + /// @see ext_scalar_common + template + GLM_FUNC_DECL T fmin(T a, T b, T c, T d); + + /// Returns the maximum component-wise values of 2 inputs. If one of the two arguments is NaN, the value of the other argument is returned. + /// + /// @tparam T A floating-point scalar type. + /// + /// @see std::fmax documentation + /// @see ext_scalar_common + template + GLM_FUNC_DECL T fmax(T a, T b); + + /// Returns the maximum component-wise values of 3 inputs. If one of the two arguments is NaN, the value of the other argument is returned. + /// + /// @tparam T A floating-point scalar type. + /// + /// @see std::fmax documentation + /// @see ext_scalar_common + template + GLM_FUNC_DECL T fmax(T a, T b, T C); + + /// Returns the maximum component-wise values of 4 inputs. If one of the two arguments is NaN, the value of the other argument is returned. + /// + /// @tparam T A floating-point scalar type. + /// + /// @see std::fmax documentation + /// @see ext_scalar_common + template + GLM_FUNC_DECL T fmax(T a, T b, T C, T D); + + /// Returns min(max(x, minVal), maxVal) for each component in x. If one of the two arguments is NaN, the value of the other argument is returned. + /// + /// @tparam genType Floating-point scalar types. + /// + /// @see ext_scalar_common + template + GLM_FUNC_DECL genType fclamp(genType x, genType minVal, genType maxVal); + + /// Simulate GL_CLAMP OpenGL wrap mode + /// + /// @tparam genType Floating-point scalar types. + /// + /// @see ext_scalar_common extension. + template + GLM_FUNC_DECL genType clamp(genType const& Texcoord); + + /// Simulate GL_REPEAT OpenGL wrap mode + /// + /// @tparam genType Floating-point scalar types. + /// + /// @see ext_scalar_common extension. + template + GLM_FUNC_DECL genType repeat(genType const& Texcoord); + + /// Simulate GL_MIRRORED_REPEAT OpenGL wrap mode + /// + /// @tparam genType Floating-point scalar types. + /// + /// @see ext_scalar_common extension. + template + GLM_FUNC_DECL genType mirrorClamp(genType const& Texcoord); + + /// Simulate GL_MIRROR_REPEAT OpenGL wrap mode + /// + /// @tparam genType Floating-point scalar types. + /// + /// @see ext_scalar_common extension. + template + GLM_FUNC_DECL genType mirrorRepeat(genType const& Texcoord); + + /// Returns a value equal to the nearest integer to x. + /// The fraction 0.5 will round in a direction chosen by the + /// implementation, presumably the direction that is fastest. + /// + /// @param x The values of the argument must be greater or equal to zero. + /// @tparam genType floating point scalar types. + /// + /// @see GLSL round man page + /// @see ext_scalar_common extension. + template + GLM_FUNC_DECL int iround(genType const& x); + + /// Returns a value equal to the nearest integer to x. + /// The fraction 0.5 will round in a direction chosen by the + /// implementation, presumably the direction that is fastest. + /// + /// @param x The values of the argument must be greater or equal to zero. + /// @tparam genType floating point scalar types. + /// + /// @see GLSL round man page + /// @see ext_scalar_common extension. + template + GLM_FUNC_DECL uint uround(genType const& x); + + /// @} +}//namespace glm + +#include "scalar_common.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/scalar_common.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/scalar_common.inl new file mode 100644 index 0000000000000000000000000000000000000000..c882e6ad032e5962116b167db7e197b9f3ba2c57 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/scalar_common.inl @@ -0,0 +1,170 @@ +namespace glm +{ + template + GLM_FUNC_QUALIFIER T min(T a, T b, T c) + { + return glm::min(glm::min(a, b), c); + } + + template + GLM_FUNC_QUALIFIER T min(T a, T b, T c, T d) + { + return glm::min(glm::min(a, b), glm::min(c, d)); + } + + template + GLM_FUNC_QUALIFIER T max(T a, T b, T c) + { + return glm::max(glm::max(a, b), c); + } + + template + GLM_FUNC_QUALIFIER T max(T a, T b, T c, T d) + { + return glm::max(glm::max(a, b), glm::max(c, d)); + } + +# if GLM_HAS_CXX11_STL + using std::fmin; +# else + template + GLM_FUNC_QUALIFIER T fmin(T a, T b) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'fmin' only accept floating-point input"); + + if (isnan(a)) + return b; + return min(a, b); + } +# endif + + template + GLM_FUNC_QUALIFIER T fmin(T a, T b, T c) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'fmin' only accept floating-point input"); + + if (isnan(a)) + return fmin(b, c); + if (isnan(b)) + return fmin(a, c); + if (isnan(c)) + return min(a, b); + return min(a, b, c); + } + + template + GLM_FUNC_QUALIFIER T fmin(T a, T b, T c, T d) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'fmin' only accept floating-point input"); + + if (isnan(a)) + return fmin(b, c, d); + if (isnan(b)) + return min(a, fmin(c, d)); + if (isnan(c)) + return fmin(min(a, b), d); + if (isnan(d)) + return min(a, b, c); + return min(a, b, c, d); + } + + +# if GLM_HAS_CXX11_STL + using std::fmax; +# else + template + GLM_FUNC_QUALIFIER T fmax(T a, T b) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'fmax' only accept floating-point input"); + + if (isnan(a)) + return b; + return max(a, b); + } +# endif + + template + GLM_FUNC_QUALIFIER T fmax(T a, T b, T c) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'fmax' only accept floating-point input"); + + if (isnan(a)) + return fmax(b, c); + if (isnan(b)) + return fmax(a, c); + if (isnan(c)) + return max(a, b); + return max(a, b, c); + } + + template + GLM_FUNC_QUALIFIER T fmax(T a, T b, T c, T d) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'fmax' only accept floating-point input"); + + if (isnan(a)) + return fmax(b, c, d); + if (isnan(b)) + return max(a, fmax(c, d)); + if (isnan(c)) + return fmax(max(a, b), d); + if (isnan(d)) + return max(a, b, c); + return max(a, b, c, d); + } + + // fclamp + template + GLM_FUNC_QUALIFIER genType fclamp(genType x, genType minVal, genType maxVal) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'fclamp' only accept floating-point or integer inputs"); + return fmin(fmax(x, minVal), maxVal); + } + + template + GLM_FUNC_QUALIFIER genType clamp(genType const& Texcoord) + { + return glm::clamp(Texcoord, static_cast(0), static_cast(1)); + } + + template + GLM_FUNC_QUALIFIER genType repeat(genType const& Texcoord) + { + return glm::fract(Texcoord); + } + + template + GLM_FUNC_QUALIFIER genType mirrorClamp(genType const& Texcoord) + { + return glm::fract(glm::abs(Texcoord)); + } + + template + GLM_FUNC_QUALIFIER genType mirrorRepeat(genType const& Texcoord) + { + genType const Abs = glm::abs(Texcoord); + genType const Clamp = glm::mod(glm::floor(Abs), static_cast(2)); + genType const Floor = glm::floor(Abs); + genType const Rest = Abs - Floor; + genType const Mirror = Clamp + Rest; + return mix(Rest, static_cast(1) - Rest, Mirror >= static_cast(1)); + } + + template + GLM_FUNC_QUALIFIER int iround(genType const& x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'iround' only accept floating-point inputs"); + assert(static_cast(0.0) <= x); + + return static_cast(x + static_cast(0.5)); + } + + template + GLM_FUNC_QUALIFIER uint uround(genType const& x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'uround' only accept floating-point inputs"); + assert(static_cast(0.0) <= x); + + return static_cast(x + static_cast(0.5)); + } +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/scalar_constants.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/scalar_constants.hpp new file mode 100644 index 0000000000000000000000000000000000000000..99d88ca823d2d854a58e0982ac432a692718b12c --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/scalar_constants.hpp @@ -0,0 +1,40 @@ +/// @ref ext_scalar_constants +/// @file glm/ext/scalar_constants.hpp +/// +/// @defgroup ext_scalar_constants GLM_EXT_scalar_constants +/// @ingroup ext +/// +/// Provides a list of constants and precomputed useful values. +/// +/// Include to use the features of this extension. + +#pragma once + +// Dependencies +#include "../detail/setup.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_scalar_constants extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_scalar_constants + /// @{ + + /// Return the epsilon constant for floating point types. + template + GLM_FUNC_DECL GLM_CONSTEXPR genType epsilon(); + + /// Return the pi constant for floating point types. + template + GLM_FUNC_DECL GLM_CONSTEXPR genType pi(); + + /// Return the value of cos(1 / 2) for floating point types. + template + GLM_FUNC_DECL GLM_CONSTEXPR genType cos_one_over_two(); + + /// @} +} //namespace glm + +#include "scalar_constants.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/scalar_constants.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/scalar_constants.inl new file mode 100644 index 0000000000000000000000000000000000000000..4ce9f214e898b0897b1b2a5027bfb512ea0ff829 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/scalar_constants.inl @@ -0,0 +1,24 @@ +#include + +namespace glm +{ + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType epsilon() + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'epsilon' only accepts floating-point inputs"); + return std::numeric_limits::epsilon(); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType pi() + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'pi' only accepts floating-point inputs"); + return static_cast(3.14159265358979323846264338327950288); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType cos_one_over_two() + { + return genType(0.877582561890372716130286068203503191); + } +} //namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/scalar_int_sized.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/scalar_int_sized.hpp new file mode 100644 index 0000000000000000000000000000000000000000..af57a3022425b11bdcf485cc6f54e1449d99e77a --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/scalar_int_sized.hpp @@ -0,0 +1,70 @@ +/// @ref ext_scalar_int_sized +/// @file glm/ext/scalar_int_sized.hpp +/// +/// @defgroup ext_scalar_int_sized GLM_EXT_scalar_int_sized +/// @ingroup ext +/// +/// Exposes sized signed integer scalar types. +/// +/// Include to use the features of this extension. +/// +/// @see ext_scalar_uint_sized + +#pragma once + +#include "../detail/setup.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_scalar_int_sized extension included") +#endif + +namespace glm{ +namespace detail +{ +# if GLM_HAS_EXTENDED_INTEGER_TYPE + typedef std::int8_t int8; + typedef std::int16_t int16; + typedef std::int32_t int32; +# else + typedef signed char int8; + typedef signed short int16; + typedef signed int int32; +#endif// + + template<> + struct is_int + { + enum test {value = ~0}; + }; + + template<> + struct is_int + { + enum test {value = ~0}; + }; + + template<> + struct is_int + { + enum test {value = ~0}; + }; +}//namespace detail + + + /// @addtogroup ext_scalar_int_sized + /// @{ + + /// 8 bit signed integer type. + typedef detail::int8 int8; + + /// 16 bit signed integer type. + typedef detail::int16 int16; + + /// 32 bit signed integer type. + typedef detail::int32 int32; + + /// 64 bit signed integer type. + typedef detail::int64 int64; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/scalar_integer.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/scalar_integer.hpp new file mode 100644 index 0000000000000000000000000000000000000000..05b1b3180c62440cc84f5db445b360076436e240 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/scalar_integer.hpp @@ -0,0 +1,92 @@ +/// @ref ext_scalar_integer +/// @file glm/ext/scalar_integer.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_scalar_integer GLM_EXT_scalar_integer +/// @ingroup ext +/// +/// Include to use the features of this extension. + +#pragma once + +// Dependencies +#include "../detail/setup.hpp" +#include "../detail/qualifier.hpp" +#include "../detail/_vectorize.hpp" +#include "../detail/type_float.hpp" +#include "../vector_relational.hpp" +#include "../common.hpp" +#include + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_scalar_integer extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_scalar_integer + /// @{ + + /// Return true if the value is a power of two number. + /// + /// @see ext_scalar_integer + template + GLM_FUNC_DECL bool isPowerOfTwo(genIUType v); + + /// Return the power of two number which value is just higher the input value, + /// round up to a power of two. + /// + /// @see ext_scalar_integer + template + GLM_FUNC_DECL genIUType nextPowerOfTwo(genIUType v); + + /// Return the power of two number which value is just lower the input value, + /// round down to a power of two. + /// + /// @see ext_scalar_integer + template + GLM_FUNC_DECL genIUType prevPowerOfTwo(genIUType v); + + /// Return true if the 'Value' is a multiple of 'Multiple'. + /// + /// @see ext_scalar_integer + template + GLM_FUNC_DECL bool isMultiple(genIUType v, genIUType Multiple); + + /// Higher multiple number of Source. + /// + /// @tparam genIUType Integer scalar or vector types. + /// + /// @param v Source value to which is applied the function + /// @param Multiple Must be a null or positive value + /// + /// @see ext_scalar_integer + template + GLM_FUNC_DECL genIUType nextMultiple(genIUType v, genIUType Multiple); + + /// Lower multiple number of Source. + /// + /// @tparam genIUType Integer scalar or vector types. + /// + /// @param v Source value to which is applied the function + /// @param Multiple Must be a null or positive value + /// + /// @see ext_scalar_integer + template + GLM_FUNC_DECL genIUType prevMultiple(genIUType v, genIUType Multiple); + + /// Returns the bit number of the Nth significant bit set to + /// 1 in the binary representation of value. + /// If value bitcount is less than the Nth significant bit, -1 will be returned. + /// + /// @tparam genIUType Signed or unsigned integer scalar types. + /// + /// @see ext_scalar_integer + template + GLM_FUNC_DECL int findNSB(genIUType x, int significantBitCount); + + /// @} +} //namespace glm + +#include "scalar_integer.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/scalar_integer.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/scalar_integer.inl new file mode 100644 index 0000000000000000000000000000000000000000..0cc286ffb33970ecf85754becff41bd8a94ec085 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/scalar_integer.inl @@ -0,0 +1,243 @@ +#include "../integer.hpp" + +namespace glm{ +namespace detail +{ + template + struct compute_ceilShift + { + GLM_FUNC_QUALIFIER static vec call(vec const& v, T) + { + return v; + } + }; + + template + struct compute_ceilShift + { + GLM_FUNC_QUALIFIER static vec call(vec const& v, T Shift) + { + return v | (v >> Shift); + } + }; + + template + struct compute_ceilPowerOfTwo + { + GLM_FUNC_QUALIFIER static vec call(vec const& x) + { + GLM_STATIC_ASSERT(!std::numeric_limits::is_iec559, "'ceilPowerOfTwo' only accept integer scalar or vector inputs"); + + vec const Sign(sign(x)); + + vec v(abs(x)); + + v = v - static_cast(1); + v = v | (v >> static_cast(1)); + v = v | (v >> static_cast(2)); + v = v | (v >> static_cast(4)); + v = compute_ceilShift= 2>::call(v, 8); + v = compute_ceilShift= 4>::call(v, 16); + v = compute_ceilShift= 8>::call(v, 32); + return (v + static_cast(1)) * Sign; + } + }; + + template + struct compute_ceilPowerOfTwo + { + GLM_FUNC_QUALIFIER static vec call(vec const& x) + { + GLM_STATIC_ASSERT(!std::numeric_limits::is_iec559, "'ceilPowerOfTwo' only accept integer scalar or vector inputs"); + + vec v(x); + + v = v - static_cast(1); + v = v | (v >> static_cast(1)); + v = v | (v >> static_cast(2)); + v = v | (v >> static_cast(4)); + v = compute_ceilShift= 2>::call(v, 8); + v = compute_ceilShift= 4>::call(v, 16); + v = compute_ceilShift= 8>::call(v, 32); + return v + static_cast(1); + } + }; + + template + struct compute_ceilMultiple{}; + + template<> + struct compute_ceilMultiple + { + template + GLM_FUNC_QUALIFIER static genType call(genType Source, genType Multiple) + { + if(Source > genType(0)) + return Source + (Multiple - std::fmod(Source, Multiple)); + else + return Source + std::fmod(-Source, Multiple); + } + }; + + template<> + struct compute_ceilMultiple + { + template + GLM_FUNC_QUALIFIER static genType call(genType Source, genType Multiple) + { + genType Tmp = Source - genType(1); + return Tmp + (Multiple - (Tmp % Multiple)); + } + }; + + template<> + struct compute_ceilMultiple + { + template + GLM_FUNC_QUALIFIER static genType call(genType Source, genType Multiple) + { + assert(Multiple > genType(0)); + if(Source > genType(0)) + { + genType Tmp = Source - genType(1); + return Tmp + (Multiple - (Tmp % Multiple)); + } + else + return Source + (-Source % Multiple); + } + }; + + template + struct compute_floorMultiple{}; + + template<> + struct compute_floorMultiple + { + template + GLM_FUNC_QUALIFIER static genType call(genType Source, genType Multiple) + { + if(Source >= genType(0)) + return Source - std::fmod(Source, Multiple); + else + return Source - std::fmod(Source, Multiple) - Multiple; + } + }; + + template<> + struct compute_floorMultiple + { + template + GLM_FUNC_QUALIFIER static genType call(genType Source, genType Multiple) + { + if(Source >= genType(0)) + return Source - Source % Multiple; + else + { + genType Tmp = Source + genType(1); + return Tmp - Tmp % Multiple - Multiple; + } + } + }; + + template<> + struct compute_floorMultiple + { + template + GLM_FUNC_QUALIFIER static genType call(genType Source, genType Multiple) + { + if(Source >= genType(0)) + return Source - Source % Multiple; + else + { + genType Tmp = Source + genType(1); + return Tmp - Tmp % Multiple - Multiple; + } + } + }; +}//namespace detail + + template + GLM_FUNC_QUALIFIER bool isPowerOfTwo(genIUType Value) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'isPowerOfTwo' only accept integer inputs"); + + genIUType const Result = glm::abs(Value); + return !(Result & (Result - 1)); + } + + template + GLM_FUNC_QUALIFIER genIUType nextPowerOfTwo(genIUType value) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'nextPowerOfTwo' only accept integer inputs"); + + return detail::compute_ceilPowerOfTwo<1, genIUType, defaultp, std::numeric_limits::is_signed>::call(vec<1, genIUType, defaultp>(value)).x; + } + + template + GLM_FUNC_QUALIFIER genIUType prevPowerOfTwo(genIUType value) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'prevPowerOfTwo' only accept integer inputs"); + + return isPowerOfTwo(value) ? value : static_cast(static_cast(1) << static_cast(findMSB(value))); + } + + template + GLM_FUNC_QUALIFIER bool isMultiple(genIUType Value, genIUType Multiple) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'isMultiple' only accept integer inputs"); + + return isMultiple(vec<1, genIUType>(Value), vec<1, genIUType>(Multiple)).x; + } + + template + GLM_FUNC_QUALIFIER genIUType nextMultiple(genIUType Source, genIUType Multiple) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'nextMultiple' only accept integer inputs"); + + return detail::compute_ceilMultiple::is_iec559, std::numeric_limits::is_signed>::call(Source, Multiple); + } + + template + GLM_FUNC_QUALIFIER genIUType prevMultiple(genIUType Source, genIUType Multiple) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'prevMultiple' only accept integer inputs"); + + return detail::compute_floorMultiple::is_iec559, std::numeric_limits::is_signed>::call(Source, Multiple); + } + + template + GLM_FUNC_QUALIFIER int findNSB(genIUType x, int significantBitCount) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'findNSB' only accept integer inputs"); + + if(bitCount(x) < significantBitCount) + return -1; + + genIUType const One = static_cast(1); + int bitPos = 0; + + genIUType key = x; + int nBitCount = significantBitCount; + int Step = sizeof(x) * 8 / 2; + while (key > One) + { + genIUType Mask = static_cast((One << Step) - One); + genIUType currentKey = key & Mask; + int currentBitCount = bitCount(currentKey); + if (nBitCount > currentBitCount) + { + nBitCount -= currentBitCount; + bitPos += Step; + key >>= static_cast(Step); + } + else + { + key = key & Mask; + } + + Step >>= 1; + } + + return static_cast(bitPos); + } +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/scalar_packing.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/scalar_packing.hpp new file mode 100644 index 0000000000000000000000000000000000000000..4ebaa080832be7828abb77b2764be4877c76d445 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/scalar_packing.hpp @@ -0,0 +1,32 @@ +/// @ref ext_scalar_packing +/// @file glm/ext/scalar_packing.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_scalar_packing GLM_EXT_scalar_packing +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// This extension provides a set of function to convert scalar values to packed +/// formats. + +#pragma once + +// Dependency: +#include "../detail/qualifier.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_scalar_packing extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_scalar_packing + /// @{ + + + /// @} +}// namespace glm + +#include "scalar_packing.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/scalar_packing.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/scalar_packing.inl new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/scalar_reciprocal.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/scalar_reciprocal.hpp new file mode 100644 index 0000000000000000000000000000000000000000..1f9808f5700823f89ea7c9abc6de79d44968f05d --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/scalar_reciprocal.hpp @@ -0,0 +1,135 @@ +/// @ref ext_scalar_reciprocal +/// @file glm/ext/scalar_reciprocal.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_scalar_reciprocal GLM_EXT_scalar_reciprocal +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Define secant, cosecant and cotangent functions. + +#pragma once + +// Dependencies +#include "../detail/setup.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_scalar_reciprocal extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_scalar_reciprocal + /// @{ + + /// Secant function. + /// hypotenuse / adjacent or 1 / cos(x) + /// + /// @tparam genType Floating-point scalar or vector types. + /// + /// @see ext_scalar_reciprocal + template + GLM_FUNC_DECL genType sec(genType angle); + + /// Cosecant function. + /// hypotenuse / opposite or 1 / sin(x) + /// + /// @tparam genType Floating-point scalar or vector types. + /// + /// @see ext_scalar_reciprocal + template + GLM_FUNC_DECL genType csc(genType angle); + + /// Cotangent function. + /// adjacent / opposite or 1 / tan(x) + /// + /// @tparam genType Floating-point scalar or vector types. + /// + /// @see ext_scalar_reciprocal + template + GLM_FUNC_DECL genType cot(genType angle); + + /// Inverse secant function. + /// + /// @return Return an angle expressed in radians. + /// @tparam genType Floating-point scalar or vector types. + /// + /// @see ext_scalar_reciprocal + template + GLM_FUNC_DECL genType asec(genType x); + + /// Inverse cosecant function. + /// + /// @return Return an angle expressed in radians. + /// @tparam genType Floating-point scalar or vector types. + /// + /// @see ext_scalar_reciprocal + template + GLM_FUNC_DECL genType acsc(genType x); + + /// Inverse cotangent function. + /// + /// @return Return an angle expressed in radians. + /// @tparam genType Floating-point scalar or vector types. + /// + /// @see ext_scalar_reciprocal + template + GLM_FUNC_DECL genType acot(genType x); + + /// Secant hyperbolic function. + /// + /// @tparam genType Floating-point scalar or vector types. + /// + /// @see ext_scalar_reciprocal + template + GLM_FUNC_DECL genType sech(genType angle); + + /// Cosecant hyperbolic function. + /// + /// @tparam genType Floating-point scalar or vector types. + /// + /// @see ext_scalar_reciprocal + template + GLM_FUNC_DECL genType csch(genType angle); + + /// Cotangent hyperbolic function. + /// + /// @tparam genType Floating-point scalar or vector types. + /// + /// @see ext_scalar_reciprocal + template + GLM_FUNC_DECL genType coth(genType angle); + + /// Inverse secant hyperbolic function. + /// + /// @return Return an angle expressed in radians. + /// @tparam genType Floating-point scalar or vector types. + /// + /// @see ext_scalar_reciprocal + template + GLM_FUNC_DECL genType asech(genType x); + + /// Inverse cosecant hyperbolic function. + /// + /// @return Return an angle expressed in radians. + /// @tparam genType Floating-point scalar or vector types. + /// + /// @see ext_scalar_reciprocal + template + GLM_FUNC_DECL genType acsch(genType x); + + /// Inverse cotangent hyperbolic function. + /// + /// @return Return an angle expressed in radians. + /// @tparam genType Floating-point scalar or vector types. + /// + /// @see ext_scalar_reciprocal + template + GLM_FUNC_DECL genType acoth(genType x); + + /// @} +}//namespace glm + +#include "scalar_reciprocal.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/scalar_reciprocal.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/scalar_reciprocal.inl new file mode 100644 index 0000000000000000000000000000000000000000..07a2e38a273f52d074c01dc3fd4bc6797e8ae13a --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/scalar_reciprocal.inl @@ -0,0 +1,107 @@ +/// @ref ext_scalar_reciprocal + +#include "../trigonometric.hpp" +#include + +namespace glm +{ + // sec + template + GLM_FUNC_QUALIFIER genType sec(genType angle) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'sec' only accept floating-point values"); + return genType(1) / glm::cos(angle); + } + + // csc + template + GLM_FUNC_QUALIFIER genType csc(genType angle) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'csc' only accept floating-point values"); + return genType(1) / glm::sin(angle); + } + + // cot + template + GLM_FUNC_QUALIFIER genType cot(genType angle) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'cot' only accept floating-point values"); + + genType const pi_over_2 = genType(3.1415926535897932384626433832795 / 2.0); + return glm::tan(pi_over_2 - angle); + } + + // asec + template + GLM_FUNC_QUALIFIER genType asec(genType x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'asec' only accept floating-point values"); + return acos(genType(1) / x); + } + + // acsc + template + GLM_FUNC_QUALIFIER genType acsc(genType x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'acsc' only accept floating-point values"); + return asin(genType(1) / x); + } + + // acot + template + GLM_FUNC_QUALIFIER genType acot(genType x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'acot' only accept floating-point values"); + + genType const pi_over_2 = genType(3.1415926535897932384626433832795 / 2.0); + return pi_over_2 - atan(x); + } + + // sech + template + GLM_FUNC_QUALIFIER genType sech(genType angle) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'sech' only accept floating-point values"); + return genType(1) / glm::cosh(angle); + } + + // csch + template + GLM_FUNC_QUALIFIER genType csch(genType angle) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'csch' only accept floating-point values"); + return genType(1) / glm::sinh(angle); + } + + // coth + template + GLM_FUNC_QUALIFIER genType coth(genType angle) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'coth' only accept floating-point values"); + return glm::cosh(angle) / glm::sinh(angle); + } + + // asech + template + GLM_FUNC_QUALIFIER genType asech(genType x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'asech' only accept floating-point values"); + return acosh(genType(1) / x); + } + + // acsch + template + GLM_FUNC_QUALIFIER genType acsch(genType x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'acsch' only accept floating-point values"); + return asinh(genType(1) / x); + } + + // acoth + template + GLM_FUNC_QUALIFIER genType acoth(genType x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'acoth' only accept floating-point values"); + return atanh(genType(1) / x); + } +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/scalar_relational.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/scalar_relational.hpp new file mode 100644 index 0000000000000000000000000000000000000000..216933844b93c73d72c05c314dd17b167a681d28 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/scalar_relational.hpp @@ -0,0 +1,68 @@ +/// @ref ext_scalar_relational +/// @file glm/ext/scalar_relational.hpp +/// +/// @defgroup ext_scalar_relational GLM_EXT_scalar_relational +/// @ingroup ext +/// +/// Exposes comparison functions for scalar types that take a user defined epsilon values. +/// +/// Include to use the features of this extension. +/// +/// @see core_vector_relational +/// @see ext_vector_relational +/// @see ext_matrix_relational + +#pragma once + +// Dependencies +#include "../detail/qualifier.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_scalar_relational extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_scalar_relational + /// @{ + + /// Returns the component-wise comparison of |x - y| < epsilon. + /// True if this expression is satisfied. + /// + /// @tparam genType Floating-point or integer scalar types + template + GLM_FUNC_DECL GLM_CONSTEXPR bool equal(genType const& x, genType const& y, genType const& epsilon); + + /// Returns the component-wise comparison of |x - y| >= epsilon. + /// True if this expression is not satisfied. + /// + /// @tparam genType Floating-point or integer scalar types + template + GLM_FUNC_DECL GLM_CONSTEXPR bool notEqual(genType const& x, genType const& y, genType const& epsilon); + + /// Returns the component-wise comparison between two scalars in term of ULPs. + /// True if this expression is satisfied. + /// + /// @param x First operand. + /// @param y Second operand. + /// @param ULPs Maximum difference in ULPs between the two operators to consider them equal. + /// + /// @tparam genType Floating-point or integer scalar types + template + GLM_FUNC_DECL GLM_CONSTEXPR bool equal(genType const& x, genType const& y, int ULPs); + + /// Returns the component-wise comparison between two scalars in term of ULPs. + /// True if this expression is not satisfied. + /// + /// @param x First operand. + /// @param y Second operand. + /// @param ULPs Maximum difference in ULPs between the two operators to consider them not equal. + /// + /// @tparam genType Floating-point or integer scalar types + template + GLM_FUNC_DECL GLM_CONSTEXPR bool notEqual(genType const& x, genType const& y, int ULPs); + + /// @} +}//namespace glm + +#include "scalar_relational.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/scalar_relational.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/scalar_relational.inl new file mode 100644 index 0000000000000000000000000000000000000000..69157cad26680132e22283413b5cb725d48d77c7 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/scalar_relational.inl @@ -0,0 +1,40 @@ +#include "../common.hpp" +#include "../ext/scalar_int_sized.hpp" +#include "../ext/scalar_uint_sized.hpp" +#include "../detail/type_float.hpp" + +namespace glm +{ + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool equal(genType const& x, genType const& y, genType const& epsilon) + { + return abs(x - y) <= epsilon; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool notEqual(genType const& x, genType const& y, genType const& epsilon) + { + return abs(x - y) > epsilon; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool equal(genType const& x, genType const& y, int MaxULPs) + { + detail::float_t const a(x); + detail::float_t const b(y); + + // Different signs means they do not match. + if(a.negative() != b.negative()) + return false; + + // Find the difference in ULPs. + typename detail::float_t::int_type const DiffULPs = abs(a.i - b.i); + return DiffULPs <= MaxULPs; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool notEqual(genType const& x, genType const& y, int ULPs) + { + return !equal(x, y, ULPs); + } +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/scalar_uint_sized.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/scalar_uint_sized.hpp new file mode 100644 index 0000000000000000000000000000000000000000..6d7386af2d4085e7288a34ff086a19c4f7bd45b2 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/scalar_uint_sized.hpp @@ -0,0 +1,70 @@ +/// @ref ext_scalar_uint_sized +/// @file glm/ext/scalar_uint_sized.hpp +/// +/// @defgroup ext_scalar_uint_sized GLM_EXT_scalar_uint_sized +/// @ingroup ext +/// +/// Exposes sized unsigned integer scalar types. +/// +/// Include to use the features of this extension. +/// +/// @see ext_scalar_int_sized + +#pragma once + +#include "../detail/setup.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_scalar_uint_sized extension included") +#endif + +namespace glm{ +namespace detail +{ +# if GLM_HAS_EXTENDED_INTEGER_TYPE + typedef std::uint8_t uint8; + typedef std::uint16_t uint16; + typedef std::uint32_t uint32; +# else + typedef unsigned char uint8; + typedef unsigned short uint16; + typedef unsigned int uint32; +#endif + + template<> + struct is_int + { + enum test {value = ~0}; + }; + + template<> + struct is_int + { + enum test {value = ~0}; + }; + + template<> + struct is_int + { + enum test {value = ~0}; + }; +}//namespace detail + + + /// @addtogroup ext_scalar_uint_sized + /// @{ + + /// 8 bit unsigned integer type. + typedef detail::uint8 uint8; + + /// 16 bit unsigned integer type. + typedef detail::uint16 uint16; + + /// 32 bit unsigned integer type. + typedef detail::uint32 uint32; + + /// 64 bit unsigned integer type. + typedef detail::uint64 uint64; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/scalar_ulp.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/scalar_ulp.hpp new file mode 100644 index 0000000000000000000000000000000000000000..0fdf34700265e6da019b250a767f83383f631a99 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/scalar_ulp.hpp @@ -0,0 +1,77 @@ +/// @ref ext_scalar_ulp +/// @file glm/ext/scalar_ulp.hpp +/// +/// @defgroup ext_scalar_ulp GLM_EXT_scalar_ulp +/// @ingroup ext +/// +/// Allow the measurement of the accuracy of a function against a reference +/// implementation. This extension works on floating-point data and provide results +/// in ULP. +/// +/// Include to use the features of this extension. +/// +/// @see ext_vector_ulp +/// @see ext_scalar_relational + +#pragma once + +// Dependencies +#include "../ext/scalar_int_sized.hpp" +#include "../common.hpp" +#include "../detail/qualifier.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_scalar_ulp extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_scalar_ulp + /// @{ + + /// Return the next ULP value(s) after the input value(s). + /// + /// @tparam genType A floating-point scalar type. + /// + /// @see ext_scalar_ulp + template + GLM_FUNC_DECL genType nextFloat(genType x); + + /// Return the previous ULP value(s) before the input value(s). + /// + /// @tparam genType A floating-point scalar type. + /// + /// @see ext_scalar_ulp + template + GLM_FUNC_DECL genType prevFloat(genType x); + + /// Return the value(s) ULP distance after the input value(s). + /// + /// @tparam genType A floating-point scalar type. + /// + /// @see ext_scalar_ulp + template + GLM_FUNC_DECL genType nextFloat(genType x, int ULPs); + + /// Return the value(s) ULP distance before the input value(s). + /// + /// @tparam genType A floating-point scalar type. + /// + /// @see ext_scalar_ulp + template + GLM_FUNC_DECL genType prevFloat(genType x, int ULPs); + + /// Return the distance in the number of ULP between 2 single-precision floating-point scalars. + /// + /// @see ext_scalar_ulp + GLM_FUNC_DECL int floatDistance(float x, float y); + + /// Return the distance in the number of ULP between 2 double-precision floating-point scalars. + /// + /// @see ext_scalar_ulp + GLM_FUNC_DECL int64 floatDistance(double x, double y); + + /// @} +}//namespace glm + +#include "scalar_ulp.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/scalar_ulp.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/scalar_ulp.inl new file mode 100644 index 0000000000000000000000000000000000000000..53467eff525acaf79ad5ae50f11cb2e2930502c5 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/scalar_ulp.inl @@ -0,0 +1,284 @@ +/// Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. +/// +/// Developed at SunPro, a Sun Microsystems, Inc. business. +/// Permission to use, copy, modify, and distribute this +/// software is freely granted, provided that this notice +/// is preserved. + +#include "../detail/type_float.hpp" +#include "../ext/scalar_constants.hpp" +#include +#include + +#if(GLM_COMPILER & GLM_COMPILER_VC) +# pragma warning(push) +# pragma warning(disable : 4127) +#endif + +typedef union +{ + float value; + /* FIXME: Assumes 32 bit int. */ + unsigned int word; +} ieee_float_shape_type; + +typedef union +{ + double value; + struct + { + int lsw; + int msw; + } parts; +} ieee_double_shape_type; + +#define GLM_EXTRACT_WORDS(ix0,ix1,d) \ + do { \ + ieee_double_shape_type ew_u; \ + ew_u.value = (d); \ + (ix0) = ew_u.parts.msw; \ + (ix1) = ew_u.parts.lsw; \ + } while (0) + +#define GLM_GET_FLOAT_WORD(i,d) \ + do { \ + ieee_float_shape_type gf_u; \ + gf_u.value = (d); \ + (i) = gf_u.word; \ + } while (0) + +#define GLM_SET_FLOAT_WORD(d,i) \ + do { \ + ieee_float_shape_type sf_u; \ + sf_u.word = (i); \ + (d) = sf_u.value; \ + } while (0) + +#define GLM_INSERT_WORDS(d,ix0,ix1) \ + do { \ + ieee_double_shape_type iw_u; \ + iw_u.parts.msw = (ix0); \ + iw_u.parts.lsw = (ix1); \ + (d) = iw_u.value; \ + } while (0) + +namespace glm{ +namespace detail +{ + GLM_FUNC_QUALIFIER float nextafterf(float x, float y) + { + volatile float t; + int hx, hy, ix, iy; + + GLM_GET_FLOAT_WORD(hx, x); + GLM_GET_FLOAT_WORD(hy, y); + ix = hx & 0x7fffffff; // |x| + iy = hy & 0x7fffffff; // |y| + + if((ix > 0x7f800000) || // x is nan + (iy > 0x7f800000)) // y is nan + return x + y; + if(abs(y - x) <= epsilon()) + return y; // x=y, return y + if(ix == 0) + { // x == 0 + GLM_SET_FLOAT_WORD(x, (hy & 0x80000000) | 1);// return +-minsubnormal + t = x * x; + if(abs(t - x) <= epsilon()) + return t; + else + return x; // raise underflow flag + } + if(hx >= 0) + { // x > 0 + if(hx > hy) // x > y, x -= ulp + hx -= 1; + else // x < y, x += ulp + hx += 1; + } + else + { // x < 0 + if(hy >= 0 || hx > hy) // x < y, x -= ulp + hx -= 1; + else // x > y, x += ulp + hx += 1; + } + hy = hx & 0x7f800000; + if(hy >= 0x7f800000) + return x + x; // overflow + if(hy < 0x00800000) // underflow + { + t = x * x; + if(abs(t - x) > epsilon()) + { // raise underflow flag + GLM_SET_FLOAT_WORD(y, hx); + return y; + } + } + GLM_SET_FLOAT_WORD(x, hx); + return x; + } + + GLM_FUNC_QUALIFIER double nextafter(double x, double y) + { + volatile double t; + int hx, hy, ix, iy; + unsigned int lx, ly; + + GLM_EXTRACT_WORDS(hx, lx, x); + GLM_EXTRACT_WORDS(hy, ly, y); + ix = hx & 0x7fffffff; // |x| + iy = hy & 0x7fffffff; // |y| + + if(((ix >= 0x7ff00000) && ((ix - 0x7ff00000) | lx) != 0) || // x is nan + ((iy >= 0x7ff00000) && ((iy - 0x7ff00000) | ly) != 0)) // y is nan + return x + y; + if(abs(y - x) <= epsilon()) + return y; // x=y, return y + if((ix | lx) == 0) + { // x == 0 + GLM_INSERT_WORDS(x, hy & 0x80000000, 1); // return +-minsubnormal + t = x * x; + if(abs(t - x) <= epsilon()) + return t; + else + return x; // raise underflow flag + } + if(hx >= 0) { // x > 0 + if(hx > hy || ((hx == hy) && (lx > ly))) { // x > y, x -= ulp + if(lx == 0) hx -= 1; + lx -= 1; + } + else { // x < y, x += ulp + lx += 1; + if(lx == 0) hx += 1; + } + } + else { // x < 0 + if(hy >= 0 || hx > hy || ((hx == hy) && (lx > ly))){// x < y, x -= ulp + if(lx == 0) hx -= 1; + lx -= 1; + } + else { // x > y, x += ulp + lx += 1; + if(lx == 0) hx += 1; + } + } + hy = hx & 0x7ff00000; + if(hy >= 0x7ff00000) + return x + x; // overflow + if(hy < 0x00100000) + { // underflow + t = x * x; + if(abs(t - x) > epsilon()) + { // raise underflow flag + GLM_INSERT_WORDS(y, hx, lx); + return y; + } + } + GLM_INSERT_WORDS(x, hx, lx); + return x; + } +}//namespace detail +}//namespace glm + +#if(GLM_COMPILER & GLM_COMPILER_VC) +# pragma warning(pop) +#endif + +namespace glm +{ + template<> + GLM_FUNC_QUALIFIER float nextFloat(float x) + { +# if GLM_HAS_CXX11_STL + return std::nextafter(x, std::numeric_limits::max()); +# elif((GLM_COMPILER & GLM_COMPILER_VC) || ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_PLATFORM & GLM_PLATFORM_WINDOWS))) + return detail::nextafterf(x, FLT_MAX); +# elif(GLM_PLATFORM & GLM_PLATFORM_ANDROID) + return __builtin_nextafterf(x, FLT_MAX); +# else + return nextafterf(x, FLT_MAX); +# endif + } + + template<> + GLM_FUNC_QUALIFIER double nextFloat(double x) + { +# if GLM_HAS_CXX11_STL + return std::nextafter(x, std::numeric_limits::max()); +# elif((GLM_COMPILER & GLM_COMPILER_VC) || ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_PLATFORM & GLM_PLATFORM_WINDOWS))) + return detail::nextafter(x, std::numeric_limits::max()); +# elif(GLM_PLATFORM & GLM_PLATFORM_ANDROID) + return __builtin_nextafter(x, DBL_MAX); +# else + return nextafter(x, DBL_MAX); +# endif + } + + template + GLM_FUNC_QUALIFIER T nextFloat(T x, int ULPs) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'next_float' only accept floating-point input"); + assert(ULPs >= 0); + + T temp = x; + for(int i = 0; i < ULPs; ++i) + temp = nextFloat(temp); + return temp; + } + + GLM_FUNC_QUALIFIER float prevFloat(float x) + { +# if GLM_HAS_CXX11_STL + return std::nextafter(x, std::numeric_limits::min()); +# elif((GLM_COMPILER & GLM_COMPILER_VC) || ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_PLATFORM & GLM_PLATFORM_WINDOWS))) + return detail::nextafterf(x, FLT_MIN); +# elif(GLM_PLATFORM & GLM_PLATFORM_ANDROID) + return __builtin_nextafterf(x, FLT_MIN); +# else + return nextafterf(x, FLT_MIN); +# endif + } + + GLM_FUNC_QUALIFIER double prevFloat(double x) + { +# if GLM_HAS_CXX11_STL + return std::nextafter(x, std::numeric_limits::min()); +# elif((GLM_COMPILER & GLM_COMPILER_VC) || ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_PLATFORM & GLM_PLATFORM_WINDOWS))) + return _nextafter(x, DBL_MIN); +# elif(GLM_PLATFORM & GLM_PLATFORM_ANDROID) + return __builtin_nextafter(x, DBL_MIN); +# else + return nextafter(x, DBL_MIN); +# endif + } + + template + GLM_FUNC_QUALIFIER T prevFloat(T x, int ULPs) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'prev_float' only accept floating-point input"); + assert(ULPs >= 0); + + T temp = x; + for(int i = 0; i < ULPs; ++i) + temp = prevFloat(temp); + return temp; + } + + GLM_FUNC_QUALIFIER int floatDistance(float x, float y) + { + detail::float_t const a(x); + detail::float_t const b(y); + + return abs(a.i - b.i); + } + + GLM_FUNC_QUALIFIER int64 floatDistance(double x, double y) + { + detail::float_t const a(x); + detail::float_t const b(y); + + return abs(a.i - b.i); + } +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_bool1.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_bool1.hpp new file mode 100644 index 0000000000000000000000000000000000000000..33b98496305ea3f3e4291abbc6c411aeee54d528 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_bool1.hpp @@ -0,0 +1,30 @@ +/// @ref ext_vector_bool1 +/// @file glm/ext/vector_bool1.hpp +/// +/// @defgroup ext_vector_bool1 GLM_EXT_vector_bool1 +/// @ingroup ext +/// +/// Exposes bvec1 vector type. +/// +/// Include to use the features of this extension. +/// +/// @see ext_vector_bool1_precision extension. + +#pragma once + +#include "../detail/type_vec1.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_vector_bool1 extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_vector_bool1 + /// @{ + + /// 1 components vector of boolean. + typedef vec<1, bool, defaultp> bvec1; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_bool1_precision.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_bool1_precision.hpp new file mode 100644 index 0000000000000000000000000000000000000000..f97f168e854e81e027d62eab31d9ef557d9480de --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_bool1_precision.hpp @@ -0,0 +1,34 @@ +/// @ref ext_vector_bool1_precision +/// @file glm/ext/vector_bool1_precision.hpp +/// +/// @defgroup ext_vector_bool1_precision GLM_EXT_vector_bool1_precision +/// @ingroup ext +/// +/// Exposes highp_bvec1, mediump_bvec1 and lowp_bvec1 types. +/// +/// Include to use the features of this extension. + +#pragma once + +#include "../detail/type_vec1.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_vector_bool1_precision extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_vector_bool1_precision + /// @{ + + /// 1 component vector of bool values. + typedef vec<1, bool, highp> highp_bvec1; + + /// 1 component vector of bool values. + typedef vec<1, bool, mediump> mediump_bvec1; + + /// 1 component vector of bool values. + typedef vec<1, bool, lowp> lowp_bvec1; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_bool2.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_bool2.hpp new file mode 100644 index 0000000000000000000000000000000000000000..5e17539aaf3da0bf9a3ebc140fe002f996b9ecc2 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_bool2.hpp @@ -0,0 +1,18 @@ +/// @ref core +/// @file glm/ext/vector_bool2.hpp + +#pragma once +#include "../detail/type_vec2.hpp" + +namespace glm +{ + /// @addtogroup core_vector + /// @{ + + /// 2 components vector of boolean. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + typedef vec<2, bool, defaultp> bvec2; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_bool2_precision.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_bool2_precision.hpp new file mode 100644 index 0000000000000000000000000000000000000000..2e4ae804ddfa5de303e020719d4301bd658d560c --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_bool2_precision.hpp @@ -0,0 +1,31 @@ +/// @ref core +/// @file glm/ext/vector_bool2_precision.hpp + +#pragma once +#include "../detail/type_vec2.hpp" + +namespace glm +{ + /// @addtogroup core_vector_precision + /// @{ + + /// 2 components vector of high qualifier bool numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef vec<2, bool, highp> highp_bvec2; + + /// 2 components vector of medium qualifier bool numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef vec<2, bool, mediump> mediump_bvec2; + + /// 2 components vector of low qualifier bool numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef vec<2, bool, lowp> lowp_bvec2; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_bool3.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_bool3.hpp new file mode 100644 index 0000000000000000000000000000000000000000..4547898090caea120b4c6dd681e2ccc665085f79 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_bool3.hpp @@ -0,0 +1,18 @@ +/// @ref core +/// @file glm/ext/vector_bool3.hpp + +#pragma once +#include "../detail/type_vec3.hpp" + +namespace glm +{ + /// @addtogroup core_vector + /// @{ + + /// 3 components vector of boolean. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + typedef vec<3, bool, defaultp> bvec3; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_bool3_precision.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_bool3_precision.hpp new file mode 100644 index 0000000000000000000000000000000000000000..6af2bc9e08c2f97db728413b24427cf5bade4e8d --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_bool3_precision.hpp @@ -0,0 +1,31 @@ +/// @ref core +/// @file glm/ext/vector_bool3_precision.hpp + +#pragma once +#include "../detail/type_vec3.hpp" + +namespace glm +{ + /// @addtogroup core_vector_precision + /// @{ + + /// 3 components vector of high qualifier bool numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef vec<3, bool, highp> highp_bvec3; + + /// 3 components vector of medium qualifier bool numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef vec<3, bool, mediump> mediump_bvec3; + + /// 3 components vector of low qualifier bool numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef vec<3, bool, lowp> lowp_bvec3; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_bool4.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_bool4.hpp new file mode 100644 index 0000000000000000000000000000000000000000..93464d74f7f4fa38335713133a38c90ee3392db8 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_bool4.hpp @@ -0,0 +1,18 @@ +/// @ref core +/// @file glm/ext/vector_bool4.hpp + +#pragma once +#include "../detail/type_vec4.hpp" + +namespace glm +{ + /// @addtogroup core_vector + /// @{ + + /// 4 components vector of boolean. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + typedef vec<4, bool, defaultp> bvec4; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_bool4_precision.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_bool4_precision.hpp new file mode 100644 index 0000000000000000000000000000000000000000..968b494452864728522a61e814f09e17fa4bb05e --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_bool4_precision.hpp @@ -0,0 +1,31 @@ +/// @ref core +/// @file glm/ext/vector_bool4_precision.hpp + +#pragma once +#include "../detail/type_vec4.hpp" + +namespace glm +{ + /// @addtogroup core_vector_precision + /// @{ + + /// 4 components vector of high qualifier bool numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef vec<4, bool, highp> highp_bvec4; + + /// 4 components vector of medium qualifier bool numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef vec<4, bool, mediump> mediump_bvec4; + + /// 4 components vector of low qualifier bool numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef vec<4, bool, lowp> lowp_bvec4; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_common.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_common.hpp new file mode 100644 index 0000000000000000000000000000000000000000..c5086a8eef1318947235b59b5e7a80a8528761aa --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_common.hpp @@ -0,0 +1,228 @@ +/// @ref ext_vector_common +/// @file glm/ext/vector_common.hpp +/// +/// @defgroup ext_vector_common GLM_EXT_vector_common +/// @ingroup ext +/// +/// Exposes min and max functions for 3 to 4 vector parameters. +/// +/// Include to use the features of this extension. +/// +/// @see core_common +/// @see ext_scalar_common + +#pragma once + +// Dependency: +#include "../ext/scalar_common.hpp" +#include "../common.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_vector_common extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_vector_common + /// @{ + + /// Return the minimum component-wise values of 3 inputs + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point or integer scalar types + /// @tparam Q Value from qualifier enum + template + GLM_FUNC_DECL GLM_CONSTEXPR vec min(vec const& a, vec const& b, vec const& c); + + /// Return the minimum component-wise values of 4 inputs + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point or integer scalar types + /// @tparam Q Value from qualifier enum + template + GLM_FUNC_DECL GLM_CONSTEXPR vec min(vec const& a, vec const& b, vec const& c, vec const& d); + + /// Return the maximum component-wise values of 3 inputs + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point or integer scalar types + /// @tparam Q Value from qualifier enum + template + GLM_FUNC_DECL GLM_CONSTEXPR vec max(vec const& x, vec const& y, vec const& z); + + /// Return the maximum component-wise values of 4 inputs + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point or integer scalar types + /// @tparam Q Value from qualifier enum + template + GLM_FUNC_DECL GLM_CONSTEXPR vec max( vec const& x, vec const& y, vec const& z, vec const& w); + + /// Returns y if y < x; otherwise, it returns x. If one of the two arguments is NaN, the value of the other argument is returned. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see std::fmin documentation + template + GLM_FUNC_DECL vec fmin(vec const& x, T y); + + /// Returns y if y < x; otherwise, it returns x. If one of the two arguments is NaN, the value of the other argument is returned. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see std::fmin documentation + template + GLM_FUNC_DECL vec fmin(vec const& x, vec const& y); + + /// Returns y if y < x; otherwise, it returns x. If one of the two arguments is NaN, the value of the other argument is returned. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see std::fmin documentation + template + GLM_FUNC_DECL vec fmin(vec const& a, vec const& b, vec const& c); + + /// Returns y if y < x; otherwise, it returns x. If one of the two arguments is NaN, the value of the other argument is returned. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see std::fmin documentation + template + GLM_FUNC_DECL vec fmin(vec const& a, vec const& b, vec const& c, vec const& d); + + /// Returns y if x < y; otherwise, it returns x. If one of the two arguments is NaN, the value of the other argument is returned. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see std::fmax documentation + template + GLM_FUNC_DECL vec fmax(vec const& a, T b); + + /// Returns y if x < y; otherwise, it returns x. If one of the two arguments is NaN, the value of the other argument is returned. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see std::fmax documentation + template + GLM_FUNC_DECL vec fmax(vec const& a, vec const& b); + + /// Returns y if x < y; otherwise, it returns x. If one of the two arguments is NaN, the value of the other argument is returned. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see std::fmax documentation + template + GLM_FUNC_DECL vec fmax(vec const& a, vec const& b, vec const& c); + + /// Returns y if x < y; otherwise, it returns x. If one of the two arguments is NaN, the value of the other argument is returned. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see std::fmax documentation + template + GLM_FUNC_DECL vec fmax(vec const& a, vec const& b, vec const& c, vec const& d); + + /// Returns min(max(x, minVal), maxVal) for each component in x. If one of the two arguments is NaN, the value of the other argument is returned. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see ext_vector_common + template + GLM_FUNC_DECL vec fclamp(vec const& x, T minVal, T maxVal); + + /// Returns min(max(x, minVal), maxVal) for each component in x. If one of the two arguments is NaN, the value of the other argument is returned. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see ext_vector_common + template + GLM_FUNC_DECL vec fclamp(vec const& x, vec const& minVal, vec const& maxVal); + + /// Simulate GL_CLAMP OpenGL wrap mode + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see ext_vector_common extension. + template + GLM_FUNC_DECL vec clamp(vec const& Texcoord); + + /// Simulate GL_REPEAT OpenGL wrap mode + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see ext_vector_common extension. + template + GLM_FUNC_DECL vec repeat(vec const& Texcoord); + + /// Simulate GL_MIRRORED_REPEAT OpenGL wrap mode + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see ext_vector_common extension. + template + GLM_FUNC_DECL vec mirrorClamp(vec const& Texcoord); + + /// Simulate GL_MIRROR_REPEAT OpenGL wrap mode + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see ext_vector_common extension. + template + GLM_FUNC_DECL vec mirrorRepeat(vec const& Texcoord); + + /// Returns a value equal to the nearest integer to x. + /// The fraction 0.5 will round in a direction chosen by the + /// implementation, presumably the direction that is fastest. + /// + /// @param x The values of the argument must be greater or equal to zero. + /// @tparam T floating point scalar types. + /// + /// @see GLSL round man page + /// @see ext_vector_common extension. + template + GLM_FUNC_DECL vec iround(vec const& x); + + /// Returns a value equal to the nearest integer to x. + /// The fraction 0.5 will round in a direction chosen by the + /// implementation, presumably the direction that is fastest. + /// + /// @param x The values of the argument must be greater or equal to zero. + /// @tparam T floating point scalar types. + /// + /// @see GLSL round man page + /// @see ext_vector_common extension. + template + GLM_FUNC_DECL vec uround(vec const& x); + + /// @} +}//namespace glm + +#include "vector_common.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_common.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_common.inl new file mode 100644 index 0000000000000000000000000000000000000000..b4eef108dcd725f09785df6aa3d95e1a856ea112 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_common.inl @@ -0,0 +1,147 @@ +#include "../detail/_vectorize.hpp" + +namespace glm +{ + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec min(vec const& x, vec const& y, vec const& z) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer, "'min' only accept floating-point or integer inputs"); + return glm::min(glm::min(x, y), z); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec min(vec const& x, vec const& y, vec const& z, vec const& w) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer, "'min' only accept floating-point or integer inputs"); + return glm::min(glm::min(x, y), glm::min(z, w)); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec max(vec const& x, vec const& y, vec const& z) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer, "'max' only accept floating-point or integer inputs"); + return glm::max(glm::max(x, y), z); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec max(vec const& x, vec const& y, vec const& z, vec const& w) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer, "'max' only accept floating-point or integer inputs"); + return glm::max(glm::max(x, y), glm::max(z, w)); + } + + template + GLM_FUNC_QUALIFIER vec fmin(vec const& a, T b) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'fmin' only accept floating-point inputs"); + return detail::functor2::call(fmin, a, vec(b)); + } + + template + GLM_FUNC_QUALIFIER vec fmin(vec const& a, vec const& b) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'fmin' only accept floating-point inputs"); + return detail::functor2::call(fmin, a, b); + } + + template + GLM_FUNC_QUALIFIER vec fmin(vec const& a, vec const& b, vec const& c) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'fmin' only accept floating-point inputs"); + return fmin(fmin(a, b), c); + } + + template + GLM_FUNC_QUALIFIER vec fmin(vec const& a, vec const& b, vec const& c, vec const& d) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'fmin' only accept floating-point inputs"); + return fmin(fmin(a, b), fmin(c, d)); + } + + template + GLM_FUNC_QUALIFIER vec fmax(vec const& a, T b) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'fmax' only accept floating-point inputs"); + return detail::functor2::call(fmax, a, vec(b)); + } + + template + GLM_FUNC_QUALIFIER vec fmax(vec const& a, vec const& b) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'fmax' only accept floating-point inputs"); + return detail::functor2::call(fmax, a, b); + } + + template + GLM_FUNC_QUALIFIER vec fmax(vec const& a, vec const& b, vec const& c) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'fmax' only accept floating-point inputs"); + return fmax(fmax(a, b), c); + } + + template + GLM_FUNC_QUALIFIER vec fmax(vec const& a, vec const& b, vec const& c, vec const& d) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'fmax' only accept floating-point inputs"); + return fmax(fmax(a, b), fmax(c, d)); + } + + template + GLM_FUNC_QUALIFIER vec fclamp(vec const& x, T minVal, T maxVal) + { + return fmin(fmax(x, vec(minVal)), vec(maxVal)); + } + + template + GLM_FUNC_QUALIFIER vec fclamp(vec const& x, vec const& minVal, vec const& maxVal) + { + return fmin(fmax(x, minVal), maxVal); + } + + template + GLM_FUNC_QUALIFIER vec clamp(vec const& Texcoord) + { + return glm::clamp(Texcoord, vec(0), vec(1)); + } + + template + GLM_FUNC_QUALIFIER vec repeat(vec const& Texcoord) + { + return glm::fract(Texcoord); + } + + template + GLM_FUNC_QUALIFIER vec mirrorClamp(vec const& Texcoord) + { + return glm::fract(glm::abs(Texcoord)); + } + + template + GLM_FUNC_QUALIFIER vec mirrorRepeat(vec const& Texcoord) + { + vec const Abs = glm::abs(Texcoord); + vec const Clamp = glm::mod(glm::floor(Abs), vec(2)); + vec const Floor = glm::floor(Abs); + vec const Rest = Abs - Floor; + vec const Mirror = Clamp + Rest; + return mix(Rest, vec(1) - Rest, glm::greaterThanEqual(Mirror, vec(1))); + } + + template + GLM_FUNC_QUALIFIER vec iround(vec const& x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'iround' only accept floating-point inputs"); + assert(all(lessThanEqual(vec(0), x))); + + return vec(x + static_cast(0.5)); + } + + template + GLM_FUNC_QUALIFIER vec uround(vec const& x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'uround' only accept floating-point inputs"); + assert(all(lessThanEqual(vec(0), x))); + + return vec(x + static_cast(0.5)); + } +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_double1.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_double1.hpp new file mode 100644 index 0000000000000000000000000000000000000000..98fc569de01549eee39719712aad4597c1dea478 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_double1.hpp @@ -0,0 +1,31 @@ +/// @ref ext_vector_double1 +/// @file glm/ext/vector_double1.hpp +/// +/// @defgroup ext_vector_double1 GLM_EXT_vector_double1 +/// @ingroup ext +/// +/// Exposes double-precision floating point vector type with one component. +/// +/// Include to use the features of this extension. +/// +/// @see ext_vector_double1_precision extension. +/// @see ext_vector_float1 extension. + +#pragma once + +#include "../detail/type_vec1.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_vector_double1 extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_vector_double1 + /// @{ + + /// 1 components vector of double-precision floating-point numbers. + typedef vec<1, double, defaultp> dvec1; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_double1_precision.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_double1_precision.hpp new file mode 100644 index 0000000000000000000000000000000000000000..9c3d8fd6441c98663f5b64e31379b66a5579b1e8 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_double1_precision.hpp @@ -0,0 +1,36 @@ +/// @ref ext_vector_double1_precision +/// @file glm/ext/vector_double1_precision.hpp +/// +/// @defgroup ext_vector_double1_precision GLM_EXT_vector_double1_precision +/// @ingroup ext +/// +/// Exposes highp_dvec1, mediump_dvec1 and lowp_dvec1 types. +/// +/// Include to use the features of this extension. +/// +/// @see ext_vector_double1 + +#pragma once + +#include "../detail/type_vec1.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_vector_double1_precision extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_vector_double1_precision + /// @{ + + /// 1 component vector of double-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef vec<1, double, highp> highp_dvec1; + + /// 1 component vector of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef vec<1, double, mediump> mediump_dvec1; + + /// 1 component vector of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef vec<1, double, lowp> lowp_dvec1; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_double2.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_double2.hpp new file mode 100644 index 0000000000000000000000000000000000000000..63be40efea3370ad3cddf1bbb68685c1b01e2345 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_double2.hpp @@ -0,0 +1,18 @@ +/// @ref core +/// @file glm/ext/vector_double2.hpp + +#pragma once +#include "../detail/type_vec2.hpp" + +namespace glm +{ + /// @addtogroup core_vector + /// @{ + + /// 2 components vector of double-precision floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + typedef vec<2, double, defaultp> dvec2; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_double2_precision.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_double2_precision.hpp new file mode 100644 index 0000000000000000000000000000000000000000..f34e5eb61a8afc6d8e047b2adef16882a237ea97 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_double2_precision.hpp @@ -0,0 +1,31 @@ +/// @ref core +/// @file glm/ext/vector_double2_precision.hpp + +#pragma once +#include "../detail/type_vec2.hpp" + +namespace glm +{ + /// @addtogroup core_vector_precision + /// @{ + + /// 2 components vector of high double-qualifier floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef vec<2, double, highp> highp_dvec2; + + /// 2 components vector of medium double-qualifier floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef vec<2, double, mediump> mediump_dvec2; + + /// 2 components vector of low double-qualifier floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef vec<2, double, lowp> lowp_dvec2; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_double3.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_double3.hpp new file mode 100644 index 0000000000000000000000000000000000000000..d412e35d05ce7c471da531a6235a65d5e8650da5 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_double3.hpp @@ -0,0 +1,18 @@ +/// @ref core +/// @file glm/ext/vector_double3.hpp + +#pragma once +#include "../detail/type_vec3.hpp" + +namespace glm +{ + /// @addtogroup core_vector + /// @{ + + /// 3 components vector of double-precision floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + typedef vec<3, double, defaultp> dvec3; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_double3_precision.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_double3_precision.hpp new file mode 100644 index 0000000000000000000000000000000000000000..2bc81c38db671c3da373c43f871566d05d798679 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_double3_precision.hpp @@ -0,0 +1,34 @@ +/// @ref core +/// @file glm/ext/vector_double3_precision.hpp + +#pragma once +#include "../detail/type_vec3.hpp" + +namespace glm +{ + /// @addtogroup core_vector_precision + /// @{ + + /// 3 components vector of high double-qualifier floating-point numbers. + /// There is no guarantee on the actual qualifier. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef vec<3, double, highp> highp_dvec3; + + /// 3 components vector of medium double-qualifier floating-point numbers. + /// There is no guarantee on the actual qualifier. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef vec<3, double, mediump> mediump_dvec3; + + /// 3 components vector of low double-qualifier floating-point numbers. + /// There is no guarantee on the actual qualifier. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef vec<3, double, lowp> lowp_dvec3; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_double4.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_double4.hpp new file mode 100644 index 0000000000000000000000000000000000000000..39066c8f53690e2cdaf8122c417cb28c81be77af --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_double4.hpp @@ -0,0 +1,18 @@ +/// @ref core +/// @file glm/ext/vector_double4.hpp + +#pragma once +#include "../detail/type_vec4.hpp" + +namespace glm +{ + /// @addtogroup core_vector + /// @{ + + /// 4 components vector of double-precision floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + typedef vec<4, double, defaultp> dvec4; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_double4_precision.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_double4_precision.hpp new file mode 100644 index 0000000000000000000000000000000000000000..88b76c9246d4085fbadb85882cb22c3a9493b430 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_double4_precision.hpp @@ -0,0 +1,35 @@ +/// @ref core +/// @file glm/ext/vector_double4_precision.hpp + +#pragma once +#include "../detail/setup.hpp" +#include "../detail/type_vec4.hpp" + +namespace glm +{ + /// @addtogroup core_vector_precision + /// @{ + + /// 4 components vector of high double-qualifier floating-point numbers. + /// There is no guarantee on the actual qualifier. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef vec<4, double, highp> highp_dvec4; + + /// 4 components vector of medium double-qualifier floating-point numbers. + /// There is no guarantee on the actual qualifier. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef vec<4, double, mediump> mediump_dvec4; + + /// 4 components vector of low double-qualifier floating-point numbers. + /// There is no guarantee on the actual qualifier. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef vec<4, double, lowp> lowp_dvec4; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_float1.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_float1.hpp new file mode 100644 index 0000000000000000000000000000000000000000..fc94e29750982ea6f7aa081ce00dfdcbfe45f26a --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_float1.hpp @@ -0,0 +1,31 @@ +/// @ref ext_vector_float1 +/// @file glm/ext/vector_float1.hpp +/// +/// @defgroup ext_vector_float1 GLM_EXT_vector_float1 +/// @ingroup ext +/// +/// Exposes single-precision floating point vector type with one component. +/// +/// Include to use the features of this extension. +/// +/// @see ext_vector_float1_precision extension. +/// @see ext_vector_double1 extension. + +#pragma once + +#include "../detail/type_vec1.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_vector_float1 extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_vector_float1 + /// @{ + + /// 1 components vector of single-precision floating-point numbers. + typedef vec<1, float, defaultp> vec1; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_float1_precision.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_float1_precision.hpp new file mode 100644 index 0000000000000000000000000000000000000000..4a633f549abf4107eed3c8b43a1122971224c006 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_float1_precision.hpp @@ -0,0 +1,36 @@ +/// @ref ext_vector_float1_precision +/// @file glm/ext/vector_float1_precision.hpp +/// +/// @defgroup ext_vector_float1_precision GLM_EXT_vector_float1_precision +/// @ingroup ext +/// +/// Exposes highp_vec1, mediump_vec1 and lowp_vec1 types. +/// +/// Include to use the features of this extension. +/// +/// @see ext_vector_float1 extension. + +#pragma once + +#include "../detail/type_vec1.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_vector_float1_precision extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_vector_float1_precision + /// @{ + + /// 1 component vector of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef vec<1, float, highp> highp_vec1; + + /// 1 component vector of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef vec<1, float, mediump> mediump_vec1; + + /// 1 component vector of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef vec<1, float, lowp> lowp_vec1; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_float2.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_float2.hpp new file mode 100644 index 0000000000000000000000000000000000000000..e366549fea92a90595bbe7c3e4a8a3626fedf22a --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_float2.hpp @@ -0,0 +1,18 @@ +/// @ref core +/// @file glm/ext/vector_float2.hpp + +#pragma once +#include "../detail/type_vec2.hpp" + +namespace glm +{ + /// @addtogroup core_vector + /// @{ + + /// 2 components vector of single-precision floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + typedef vec<2, float, defaultp> vec2; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_float2_precision.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_float2_precision.hpp new file mode 100644 index 0000000000000000000000000000000000000000..b88e95ab80b3715a8966f6592ee73622e9c60cf3 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_float2_precision.hpp @@ -0,0 +1,31 @@ +/// @ref core +/// @file glm/ext/vector_float2_precision.hpp + +#pragma once +#include "../detail/type_vec2.hpp" + +namespace glm +{ + /// @addtogroup core_vector_precision + /// @{ + + /// 2 components vector of high single-qualifier floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef vec<2, float, highp> highp_vec2; + + /// 2 components vector of medium single-qualifier floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef vec<2, float, mediump> mediump_vec2; + + /// 2 components vector of low single-qualifier floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef vec<2, float, lowp> lowp_vec2; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_float3.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_float3.hpp new file mode 100644 index 0000000000000000000000000000000000000000..64bec8b5d86f5a1b02831808f5727059b490f5f1 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_float3.hpp @@ -0,0 +1,18 @@ +/// @ref core +/// @file glm/ext/vector_float3.hpp + +#pragma once +#include "../detail/type_vec3.hpp" + +namespace glm +{ + /// @addtogroup core_vector + /// @{ + + /// 3 components vector of single-precision floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + typedef vec<3, float, defaultp> vec3; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_float3_precision.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_float3_precision.hpp new file mode 100644 index 0000000000000000000000000000000000000000..abe7c4a808c8f03e1c8fec12b7e0adab63b29182 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_float3_precision.hpp @@ -0,0 +1,31 @@ +/// @ref core +/// @file glm/ext/vector_float3_precision.hpp + +#pragma once +#include "../detail/type_vec3.hpp" + +namespace glm +{ + /// @addtogroup core_vector_precision + /// @{ + + /// 3 components vector of high single-qualifier floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef vec<3, float, highp> highp_vec3; + + /// 3 components vector of medium single-qualifier floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef vec<3, float, mediump> mediump_vec3; + + /// 3 components vector of low single-qualifier floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef vec<3, float, lowp> lowp_vec3; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_float4.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_float4.hpp new file mode 100644 index 0000000000000000000000000000000000000000..ba10e232ca61a6960b912694111916301a53931a --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_float4.hpp @@ -0,0 +1,18 @@ +/// @ref core +/// @file glm/ext/vector_float4.hpp + +#pragma once +#include "../detail/type_vec4.hpp" + +namespace glm +{ + /// @addtogroup core_vector + /// @{ + + /// 4 components vector of single-precision floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + typedef vec<4, float, defaultp> vec4; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_float4_precision.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_float4_precision.hpp new file mode 100644 index 0000000000000000000000000000000000000000..ea7b5bac29201bce2778824d2ac2e93e6d79d8a8 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_float4_precision.hpp @@ -0,0 +1,31 @@ +/// @ref core +/// @file glm/ext/vector_float4_precision.hpp + +#pragma once +#include "../detail/type_vec4.hpp" + +namespace glm +{ + /// @addtogroup core_vector_precision + /// @{ + + /// 4 components vector of high single-qualifier floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef vec<4, float, highp> highp_vec4; + + /// 4 components vector of medium single-qualifier floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef vec<4, float, mediump> mediump_vec4; + + /// 4 components vector of low single-qualifier floating-point numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier + typedef vec<4, float, lowp> lowp_vec4; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_int1.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_int1.hpp new file mode 100644 index 0000000000000000000000000000000000000000..178be7b2bc028855ca24708d4201ecbd3b5c7333 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_int1.hpp @@ -0,0 +1,32 @@ +/// @ref ext_vector_int1 +/// @file glm/ext/vector_int1.hpp +/// +/// @defgroup ext_vector_int1 GLM_EXT_vector_int1 +/// @ingroup ext +/// +/// Exposes ivec1 vector type. +/// +/// Include to use the features of this extension. +/// +/// @see ext_vector_uint1 extension. +/// @see ext_vector_int1_precision extension. + +#pragma once + +#include "../detail/type_vec1.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_vector_int1 extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_vector_int1 + /// @{ + + /// 1 component vector of signed integer numbers. + typedef vec<1, int, defaultp> ivec1; + + /// @} +}//namespace glm + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_int1_sized.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_int1_sized.hpp new file mode 100644 index 0000000000000000000000000000000000000000..95a08e63440f455a4e75d00ec75790641cfab0ee --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_int1_sized.hpp @@ -0,0 +1,49 @@ +/// @ref ext_vector_int1_sized +/// @file glm/ext/vector_int1_sized.hpp +/// +/// @defgroup ext_vector_int1_sized GLM_EXT_vector_int1_sized +/// @ingroup ext +/// +/// Exposes sized signed integer vector types. +/// +/// Include to use the features of this extension. +/// +/// @see ext_scalar_int_sized +/// @see ext_vector_uint1_sized + +#pragma once + +#include "../ext/vector_int1.hpp" +#include "../ext/scalar_int_sized.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_vector_int1_sized extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_vector_int1_sized + /// @{ + + /// 8 bit signed integer vector of 1 component type. + /// + /// @see ext_vector_int1_sized + typedef vec<1, int8, defaultp> i8vec1; + + /// 16 bit signed integer vector of 1 component type. + /// + /// @see ext_vector_int1_sized + typedef vec<1, int16, defaultp> i16vec1; + + /// 32 bit signed integer vector of 1 component type. + /// + /// @see ext_vector_int1_sized + typedef vec<1, int32, defaultp> i32vec1; + + /// 64 bit signed integer vector of 1 component type. + /// + /// @see ext_vector_int1_sized + typedef vec<1, int64, defaultp> i64vec1; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_int2.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_int2.hpp new file mode 100644 index 0000000000000000000000000000000000000000..76a5e162b4978c92b107a7dd620d205fedcc3795 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_int2.hpp @@ -0,0 +1,18 @@ +/// @ref core +/// @file glm/ext/vector_int2.hpp + +#pragma once +#include "../detail/type_vec2.hpp" + +namespace glm +{ + /// @addtogroup core_vector + /// @{ + + /// 2 components vector of signed integer numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + typedef vec<2, int, defaultp> ivec2; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_int2_sized.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_int2_sized.hpp new file mode 100644 index 0000000000000000000000000000000000000000..610ca444b485b5a6b061c51387426b3cf8a3012c --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_int2_sized.hpp @@ -0,0 +1,49 @@ +/// @ref ext_vector_int2_sized +/// @file glm/ext/vector_int2_sized.hpp +/// +/// @defgroup ext_vector_int2_sized GLM_EXT_vector_int2_sized +/// @ingroup ext +/// +/// Exposes sized signed integer vector of 2 components type. +/// +/// Include to use the features of this extension. +/// +/// @see ext_scalar_int_sized +/// @see ext_vector_uint2_sized + +#pragma once + +#include "../ext/vector_int2.hpp" +#include "../ext/scalar_int_sized.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_vector_int2_sized extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_vector_int2_sized + /// @{ + + /// 8 bit signed integer vector of 2 components type. + /// + /// @see ext_vector_int2_sized + typedef vec<2, int8, defaultp> i8vec2; + + /// 16 bit signed integer vector of 2 components type. + /// + /// @see ext_vector_int2_sized + typedef vec<2, int16, defaultp> i16vec2; + + /// 32 bit signed integer vector of 2 components type. + /// + /// @see ext_vector_int2_sized + typedef vec<2, int32, defaultp> i32vec2; + + /// 64 bit signed integer vector of 2 components type. + /// + /// @see ext_vector_int2_sized + typedef vec<2, int64, defaultp> i64vec2; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_int3.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_int3.hpp new file mode 100644 index 0000000000000000000000000000000000000000..ee21b5e96c4ce285168555d42b58c2036cd10f69 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_int3.hpp @@ -0,0 +1,18 @@ +/// @ref core +/// @file glm/ext/vector_int3.hpp + +#pragma once +#include "../detail/type_vec3.hpp" + +namespace glm +{ + /// @addtogroup core_vector + /// @{ + + /// 3 components vector of signed integer numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + typedef vec<3, int, defaultp> ivec3; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_int3_sized.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_int3_sized.hpp new file mode 100644 index 0000000000000000000000000000000000000000..8d2d8b4b139c17d8ec2b175e1f34f3b802f2e0e9 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_int3_sized.hpp @@ -0,0 +1,49 @@ +/// @ref ext_vector_int3_sized +/// @file glm/ext/vector_int3_sized.hpp +/// +/// @defgroup ext_vector_int3_sized GLM_EXT_vector_int3_sized +/// @ingroup ext +/// +/// Exposes sized signed integer vector of 3 components type. +/// +/// Include to use the features of this extension. +/// +/// @see ext_scalar_int_sized +/// @see ext_vector_uint3_sized + +#pragma once + +#include "../ext/vector_int3.hpp" +#include "../ext/scalar_int_sized.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_vector_int3_sized extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_vector_int3_sized + /// @{ + + /// 8 bit signed integer vector of 3 components type. + /// + /// @see ext_vector_int3_sized + typedef vec<3, int8, defaultp> i8vec3; + + /// 16 bit signed integer vector of 3 components type. + /// + /// @see ext_vector_int3_sized + typedef vec<3, int16, defaultp> i16vec3; + + /// 32 bit signed integer vector of 3 components type. + /// + /// @see ext_vector_int3_sized + typedef vec<3, int32, defaultp> i32vec3; + + /// 64 bit signed integer vector of 3 components type. + /// + /// @see ext_vector_int3_sized + typedef vec<3, int64, defaultp> i64vec3; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_int4.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_int4.hpp new file mode 100644 index 0000000000000000000000000000000000000000..e29cdc7914a704ff699f1386df2afdf5de25081b --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_int4.hpp @@ -0,0 +1,18 @@ +/// @ref core +/// @file glm/ext/vector_int4.hpp + +#pragma once +#include "../detail/type_vec4.hpp" + +namespace glm +{ + /// @addtogroup core_vector + /// @{ + + /// 4 components vector of signed integer numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + typedef vec<4, int, defaultp> ivec4; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_int4_sized.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_int4_sized.hpp new file mode 100644 index 0000000000000000000000000000000000000000..34b678f95c0519dbf13ddfdd5c194e148c26d85a --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_int4_sized.hpp @@ -0,0 +1,49 @@ +/// @ref ext_vector_int4_sized +/// @file glm/ext/vector_int4_sized.hpp +/// +/// @defgroup ext_vector_int4_sized GLM_EXT_vector_int4_sized +/// @ingroup ext +/// +/// Exposes sized signed integer vector of 4 components type. +/// +/// Include to use the features of this extension. +/// +/// @see ext_scalar_int_sized +/// @see ext_vector_uint4_sized + +#pragma once + +#include "../ext/vector_int4.hpp" +#include "../ext/scalar_int_sized.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_vector_int4_sized extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_vector_int4_sized + /// @{ + + /// 8 bit signed integer vector of 4 components type. + /// + /// @see ext_vector_int4_sized + typedef vec<4, int8, defaultp> i8vec4; + + /// 16 bit signed integer vector of 4 components type. + /// + /// @see ext_vector_int4_sized + typedef vec<4, int16, defaultp> i16vec4; + + /// 32 bit signed integer vector of 4 components type. + /// + /// @see ext_vector_int4_sized + typedef vec<4, int32, defaultp> i32vec4; + + /// 64 bit signed integer vector of 4 components type. + /// + /// @see ext_vector_int4_sized + typedef vec<4, int64, defaultp> i64vec4; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_integer.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_integer.hpp new file mode 100644 index 0000000000000000000000000000000000000000..ef66f6c9cd7e7cf83da92b6eddb8f46db12b6b00 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_integer.hpp @@ -0,0 +1,149 @@ +/// @ref ext_vector_integer +/// @file glm/ext/vector_integer.hpp +/// +/// @see core (dependence) +/// @see ext_vector_integer (dependence) +/// +/// @defgroup ext_vector_integer GLM_EXT_vector_integer +/// @ingroup ext +/// +/// Include to use the features of this extension. + +#pragma once + +// Dependencies +#include "../detail/setup.hpp" +#include "../detail/qualifier.hpp" +#include "../detail/_vectorize.hpp" +#include "../vector_relational.hpp" +#include "../common.hpp" +#include + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_vector_integer extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_vector_integer + /// @{ + + /// Return true if the value is a power of two number. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Signed or unsigned integer scalar types. + /// @tparam Q Value from qualifier enum + /// + /// @see ext_vector_integer + template + GLM_FUNC_DECL vec isPowerOfTwo(vec const& v); + + /// Return the power of two number which value is just higher the input value, + /// round up to a power of two. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Signed or unsigned integer scalar types. + /// @tparam Q Value from qualifier enum + /// + /// @see ext_vector_integer + template + GLM_FUNC_DECL vec nextPowerOfTwo(vec const& v); + + /// Return the power of two number which value is just lower the input value, + /// round down to a power of two. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Signed or unsigned integer scalar types. + /// @tparam Q Value from qualifier enum + /// + /// @see ext_vector_integer + template + GLM_FUNC_DECL vec prevPowerOfTwo(vec const& v); + + /// Return true if the 'Value' is a multiple of 'Multiple'. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Signed or unsigned integer scalar types. + /// @tparam Q Value from qualifier enum + /// + /// @see ext_vector_integer + template + GLM_FUNC_DECL vec isMultiple(vec const& v, T Multiple); + + /// Return true if the 'Value' is a multiple of 'Multiple'. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Signed or unsigned integer scalar types. + /// @tparam Q Value from qualifier enum + /// + /// @see ext_vector_integer + template + GLM_FUNC_DECL vec isMultiple(vec const& v, vec const& Multiple); + + /// Higher multiple number of Source. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Signed or unsigned integer scalar types. + /// @tparam Q Value from qualifier enum + /// + /// @param v Source values to which is applied the function + /// @param Multiple Must be a null or positive value + /// + /// @see ext_vector_integer + template + GLM_FUNC_DECL vec nextMultiple(vec const& v, T Multiple); + + /// Higher multiple number of Source. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Signed or unsigned integer scalar types. + /// @tparam Q Value from qualifier enum + /// + /// @param v Source values to which is applied the function + /// @param Multiple Must be a null or positive value + /// + /// @see ext_vector_integer + template + GLM_FUNC_DECL vec nextMultiple(vec const& v, vec const& Multiple); + + /// Lower multiple number of Source. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Signed or unsigned integer scalar types. + /// @tparam Q Value from qualifier enum + /// + /// @param v Source values to which is applied the function + /// @param Multiple Must be a null or positive value + /// + /// @see ext_vector_integer + template + GLM_FUNC_DECL vec prevMultiple(vec const& v, T Multiple); + + /// Lower multiple number of Source. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Signed or unsigned integer scalar types. + /// @tparam Q Value from qualifier enum + /// + /// @param v Source values to which is applied the function + /// @param Multiple Must be a null or positive value + /// + /// @see ext_vector_integer + template + GLM_FUNC_DECL vec prevMultiple(vec const& v, vec const& Multiple); + + /// Returns the bit number of the Nth significant bit set to + /// 1 in the binary representation of value. + /// If value bitcount is less than the Nth significant bit, -1 will be returned. + /// + /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. + /// @tparam T Signed or unsigned integer scalar types. + /// + /// @see ext_vector_integer + template + GLM_FUNC_DECL vec findNSB(vec const& Source, vec SignificantBitCount); + + /// @} +} //namespace glm + +#include "vector_integer.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_integer.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_integer.inl new file mode 100644 index 0000000000000000000000000000000000000000..192d8ea4a91776f49cdc9d1f89ea663ee430d266 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_integer.inl @@ -0,0 +1,85 @@ +#include "scalar_integer.hpp" + +namespace glm +{ + template + GLM_FUNC_QUALIFIER vec isPowerOfTwo(vec const& Value) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'isPowerOfTwo' only accept integer inputs"); + + vec const Result(abs(Value)); + return equal(Result & (Result - vec(1)), vec(0)); + } + + template + GLM_FUNC_QUALIFIER vec nextPowerOfTwo(vec const& v) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'nextPowerOfTwo' only accept integer inputs"); + + return detail::compute_ceilPowerOfTwo::is_signed>::call(v); + } + + template + GLM_FUNC_QUALIFIER vec prevPowerOfTwo(vec const& v) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'prevPowerOfTwo' only accept integer inputs"); + + return detail::functor1::call(prevPowerOfTwo, v); + } + + template + GLM_FUNC_QUALIFIER vec isMultiple(vec const& Value, T Multiple) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'isMultiple' only accept integer inputs"); + + return equal(Value % Multiple, vec(0)); + } + + template + GLM_FUNC_QUALIFIER vec isMultiple(vec const& Value, vec const& Multiple) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'isMultiple' only accept integer inputs"); + + return equal(Value % Multiple, vec(0)); + } + + template + GLM_FUNC_QUALIFIER vec nextMultiple(vec const& Source, T Multiple) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'nextMultiple' only accept integer inputs"); + + return detail::functor2::call(nextMultiple, Source, vec(Multiple)); + } + + template + GLM_FUNC_QUALIFIER vec nextMultiple(vec const& Source, vec const& Multiple) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'nextMultiple' only accept integer inputs"); + + return detail::functor2::call(nextMultiple, Source, Multiple); + } + + template + GLM_FUNC_QUALIFIER vec prevMultiple(vec const& Source, T Multiple) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'prevMultiple' only accept integer inputs"); + + return detail::functor2::call(prevMultiple, Source, vec(Multiple)); + } + + template + GLM_FUNC_QUALIFIER vec prevMultiple(vec const& Source, vec const& Multiple) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'prevMultiple' only accept integer inputs"); + + return detail::functor2::call(prevMultiple, Source, Multiple); + } + + template + GLM_FUNC_QUALIFIER vec findNSB(vec const& Source, vec SignificantBitCount) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'findNSB' only accept integer inputs"); + + return detail::functor2_vec_int::call(findNSB, Source, SignificantBitCount); + } +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_packing.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_packing.hpp new file mode 100644 index 0000000000000000000000000000000000000000..e685233ea5aab61a7fd86604abe8fb002349147e --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_packing.hpp @@ -0,0 +1,32 @@ +/// @ref ext_vector_packing +/// @file glm/ext/vector_packing.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_vector_packing GLM_EXT_vector_packing +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// This extension provides a set of function to convert vectors to packed +/// formats. + +#pragma once + +// Dependency: +#include "../detail/qualifier.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_vector_packing extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_vector_packing + /// @{ + + + /// @} +}// namespace glm + +#include "vector_packing.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_packing.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_packing.inl new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_reciprocal.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_reciprocal.hpp new file mode 100644 index 0000000000000000000000000000000000000000..5b21b5a0f46d154bdb74367813410a41a4619090 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_reciprocal.hpp @@ -0,0 +1,135 @@ +/// @ref ext_vector_reciprocal +/// @file glm/ext/vector_reciprocal.hpp +/// +/// @see core (dependence) +/// +/// @defgroup ext_vector_reciprocal GLM_EXT_vector_reciprocal +/// @ingroup ext +/// +/// Include to use the features of this extension. +/// +/// Define secant, cosecant and cotangent functions. + +#pragma once + +// Dependencies +#include "../detail/setup.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_vector_reciprocal extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_vector_reciprocal + /// @{ + + /// Secant function. + /// hypotenuse / adjacent or 1 / cos(x) + /// + /// @tparam genType Floating-point scalar or vector types. + /// + /// @see ext_vector_reciprocal + template + GLM_FUNC_DECL genType sec(genType angle); + + /// Cosecant function. + /// hypotenuse / opposite or 1 / sin(x) + /// + /// @tparam genType Floating-point scalar or vector types. + /// + /// @see ext_vector_reciprocal + template + GLM_FUNC_DECL genType csc(genType angle); + + /// Cotangent function. + /// adjacent / opposite or 1 / tan(x) + /// + /// @tparam genType Floating-point scalar or vector types. + /// + /// @see ext_vector_reciprocal + template + GLM_FUNC_DECL genType cot(genType angle); + + /// Inverse secant function. + /// + /// @return Return an angle expressed in radians. + /// @tparam genType Floating-point scalar or vector types. + /// + /// @see ext_vector_reciprocal + template + GLM_FUNC_DECL genType asec(genType x); + + /// Inverse cosecant function. + /// + /// @return Return an angle expressed in radians. + /// @tparam genType Floating-point scalar or vector types. + /// + /// @see ext_vector_reciprocal + template + GLM_FUNC_DECL genType acsc(genType x); + + /// Inverse cotangent function. + /// + /// @return Return an angle expressed in radians. + /// @tparam genType Floating-point scalar or vector types. + /// + /// @see ext_vector_reciprocal + template + GLM_FUNC_DECL genType acot(genType x); + + /// Secant hyperbolic function. + /// + /// @tparam genType Floating-point scalar or vector types. + /// + /// @see ext_vector_reciprocal + template + GLM_FUNC_DECL genType sech(genType angle); + + /// Cosecant hyperbolic function. + /// + /// @tparam genType Floating-point scalar or vector types. + /// + /// @see ext_vector_reciprocal + template + GLM_FUNC_DECL genType csch(genType angle); + + /// Cotangent hyperbolic function. + /// + /// @tparam genType Floating-point scalar or vector types. + /// + /// @see ext_vector_reciprocal + template + GLM_FUNC_DECL genType coth(genType angle); + + /// Inverse secant hyperbolic function. + /// + /// @return Return an angle expressed in radians. + /// @tparam genType Floating-point scalar or vector types. + /// + /// @see ext_vector_reciprocal + template + GLM_FUNC_DECL genType asech(genType x); + + /// Inverse cosecant hyperbolic function. + /// + /// @return Return an angle expressed in radians. + /// @tparam genType Floating-point scalar or vector types. + /// + /// @see ext_vector_reciprocal + template + GLM_FUNC_DECL genType acsch(genType x); + + /// Inverse cotangent hyperbolic function. + /// + /// @return Return an angle expressed in radians. + /// @tparam genType Floating-point scalar or vector types. + /// + /// @see ext_vector_reciprocal + template + GLM_FUNC_DECL genType acoth(genType x); + + /// @} +}//namespace glm + +#include "vector_reciprocal.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_reciprocal.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_reciprocal.inl new file mode 100644 index 0000000000000000000000000000000000000000..4d45f9bf859385797391ab0df4a86b7368c5d8f5 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_reciprocal.inl @@ -0,0 +1,105 @@ +/// @ref ext_vector_reciprocal + +#include "../trigonometric.hpp" +#include + +namespace glm +{ + // sec + template + GLM_FUNC_QUALIFIER vec sec(vec const& x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'sec' only accept floating-point inputs"); + return static_cast(1) / detail::functor1::call(cos, x); + } + + // csc + template + GLM_FUNC_QUALIFIER vec csc(vec const& x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'csc' only accept floating-point inputs"); + return static_cast(1) / detail::functor1::call(sin, x); + } + + // cot + template + GLM_FUNC_QUALIFIER vec cot(vec const& x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'cot' only accept floating-point inputs"); + T const pi_over_2 = static_cast(3.1415926535897932384626433832795 / 2.0); + return detail::functor1::call(tan, pi_over_2 - x); + } + + // asec + template + GLM_FUNC_QUALIFIER vec asec(vec const& x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'asec' only accept floating-point inputs"); + return detail::functor1::call(acos, static_cast(1) / x); + } + + // acsc + template + GLM_FUNC_QUALIFIER vec acsc(vec const& x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'acsc' only accept floating-point inputs"); + return detail::functor1::call(asin, static_cast(1) / x); + } + + // acot + template + GLM_FUNC_QUALIFIER vec acot(vec const& x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'acot' only accept floating-point inputs"); + T const pi_over_2 = static_cast(3.1415926535897932384626433832795 / 2.0); + return pi_over_2 - detail::functor1::call(atan, x); + } + + // sech + template + GLM_FUNC_QUALIFIER vec sech(vec const& x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'sech' only accept floating-point inputs"); + return static_cast(1) / detail::functor1::call(cosh, x); + } + + // csch + template + GLM_FUNC_QUALIFIER vec csch(vec const& x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'csch' only accept floating-point inputs"); + return static_cast(1) / detail::functor1::call(sinh, x); + } + + // coth + template + GLM_FUNC_QUALIFIER vec coth(vec const& x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'coth' only accept floating-point inputs"); + return glm::cosh(x) / glm::sinh(x); + } + + // asech + template + GLM_FUNC_QUALIFIER vec asech(vec const& x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'asech' only accept floating-point inputs"); + return detail::functor1::call(acosh, static_cast(1) / x); + } + + // acsch + template + GLM_FUNC_QUALIFIER vec acsch(vec const& x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'acsch' only accept floating-point inputs"); + return detail::functor1::call(asinh, static_cast(1) / x); + } + + // acoth + template + GLM_FUNC_QUALIFIER vec acoth(vec const& x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'acoth' only accept floating-point inputs"); + return detail::functor1::call(atanh, static_cast(1) / x); + } +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_relational.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_relational.hpp new file mode 100644 index 0000000000000000000000000000000000000000..e6bb989177d1053ef4439f6f3c92999f2d617b1c --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_relational.hpp @@ -0,0 +1,107 @@ +/// @ref ext_vector_relational +/// @file glm/ext/vector_relational.hpp +/// +/// @see core (dependence) +/// @see ext_scalar_integer (dependence) +/// +/// @defgroup ext_vector_relational GLM_EXT_vector_relational +/// @ingroup ext +/// +/// Exposes comparison functions for vector types that take a user defined epsilon values. +/// +/// Include to use the features of this extension. +/// +/// @see core_vector_relational +/// @see ext_scalar_relational +/// @see ext_matrix_relational + +#pragma once + +// Dependencies +#include "../detail/qualifier.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_vector_relational extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_vector_relational + /// @{ + + /// Returns the component-wise comparison of |x - y| < epsilon. + /// True if this expression is satisfied. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point or integer scalar types + /// @tparam Q Value from qualifier enum + template + GLM_FUNC_DECL GLM_CONSTEXPR vec equal(vec const& x, vec const& y, T epsilon); + + /// Returns the component-wise comparison of |x - y| < epsilon. + /// True if this expression is satisfied. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point or integer scalar types + /// @tparam Q Value from qualifier enum + template + GLM_FUNC_DECL GLM_CONSTEXPR vec equal(vec const& x, vec const& y, vec const& epsilon); + + /// Returns the component-wise comparison of |x - y| >= epsilon. + /// True if this expression is not satisfied. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point or integer scalar types + /// @tparam Q Value from qualifier enum + template + GLM_FUNC_DECL GLM_CONSTEXPR vec notEqual(vec const& x, vec const& y, T epsilon); + + /// Returns the component-wise comparison of |x - y| >= epsilon. + /// True if this expression is not satisfied. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point or integer scalar types + /// @tparam Q Value from qualifier enum + template + GLM_FUNC_DECL GLM_CONSTEXPR vec notEqual(vec const& x, vec const& y, vec const& epsilon); + + /// Returns the component-wise comparison between two vectors in term of ULPs. + /// True if this expression is satisfied. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point + /// @tparam Q Value from qualifier enum + template + GLM_FUNC_DECL GLM_CONSTEXPR vec equal(vec const& x, vec const& y, int ULPs); + + /// Returns the component-wise comparison between two vectors in term of ULPs. + /// True if this expression is satisfied. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point + /// @tparam Q Value from qualifier enum + template + GLM_FUNC_DECL GLM_CONSTEXPR vec equal(vec const& x, vec const& y, vec const& ULPs); + + /// Returns the component-wise comparison between two vectors in term of ULPs. + /// True if this expression is not satisfied. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point + /// @tparam Q Value from qualifier enum + template + GLM_FUNC_DECL GLM_CONSTEXPR vec notEqual(vec const& x, vec const& y, int ULPs); + + /// Returns the component-wise comparison between two vectors in term of ULPs. + /// True if this expression is not satisfied. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point + /// @tparam Q Value from qualifier enum + template + GLM_FUNC_DECL GLM_CONSTEXPR vec notEqual(vec const& x, vec const& y, vec const& ULPs); + + /// @} +}//namespace glm + +#include "vector_relational.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_relational.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_relational.inl new file mode 100644 index 0000000000000000000000000000000000000000..4607eb16aeaf3b8cc6689b2911e25233c8ff94a8 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_relational.inl @@ -0,0 +1,75 @@ +#include "../vector_relational.hpp" +#include "../common.hpp" +#include "../detail/qualifier.hpp" +#include "../detail/type_float.hpp" + +namespace glm +{ + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec equal(vec const& x, vec const& y, T Epsilon) + { + return equal(x, y, vec(Epsilon)); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec equal(vec const& x, vec const& y, vec const& Epsilon) + { + return lessThanEqual(abs(x - y), Epsilon); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec notEqual(vec const& x, vec const& y, T Epsilon) + { + return notEqual(x, y, vec(Epsilon)); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec notEqual(vec const& x, vec const& y, vec const& Epsilon) + { + return greaterThan(abs(x - y), Epsilon); + } + + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec equal(vec const& x, vec const& y, int MaxULPs) + { + return equal(x, y, vec(MaxULPs)); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec equal(vec const& x, vec const& y, vec const& MaxULPs) + { + vec Result(false); + for(length_t i = 0; i < L; ++i) + { + detail::float_t const a(x[i]); + detail::float_t const b(y[i]); + + // Different signs means they do not match. + if(a.negative() != b.negative()) + { + // Check for equality to make sure +0==-0 + Result[i] = a.mantissa() == b.mantissa() && a.exponent() == b.exponent(); + } + else + { + // Find the difference in ULPs. + typename detail::float_t::int_type const DiffULPs = abs(a.i - b.i); + Result[i] = DiffULPs <= MaxULPs[i]; + } + } + return Result; + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec notEqual(vec const& x, vec const& y, int MaxULPs) + { + return notEqual(x, y, vec(MaxULPs)); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec notEqual(vec const& x, vec const& y, vec const& MaxULPs) + { + return not_(equal(x, y, MaxULPs)); + } +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_uint1.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_uint1.hpp new file mode 100644 index 0000000000000000000000000000000000000000..74835b2d3ba7a6fca626791d5fc23a926b43a2e3 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_uint1.hpp @@ -0,0 +1,32 @@ +/// @ref ext_vector_uint1 +/// @file glm/ext/vector_uint1.hpp +/// +/// @defgroup ext_vector_uint1 GLM_EXT_vector_uint1 +/// @ingroup ext +/// +/// Exposes uvec1 vector type. +/// +/// Include to use the features of this extension. +/// +/// @see ext_vector_int1 extension. +/// @see ext_vector_uint1_precision extension. + +#pragma once + +#include "../detail/type_vec1.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_vector_uint1 extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_vector_uint1 + /// @{ + + /// 1 component vector of unsigned integer numbers. + typedef vec<1, unsigned int, defaultp> uvec1; + + /// @} +}//namespace glm + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_uint1_sized.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_uint1_sized.hpp new file mode 100644 index 0000000000000000000000000000000000000000..f26d98ab2dff71d57b3e16e6ad5229f0e60338ef --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_uint1_sized.hpp @@ -0,0 +1,49 @@ +/// @ref ext_vector_uint1_sized +/// @file glm/ext/vector_uint1_sized.hpp +/// +/// @defgroup ext_vector_uint1_sized GLM_EXT_vector_uint1_sized +/// @ingroup ext +/// +/// Exposes sized unsigned integer vector types. +/// +/// Include to use the features of this extension. +/// +/// @see ext_scalar_uint_sized +/// @see ext_vector_int1_sized + +#pragma once + +#include "../ext/vector_uint1.hpp" +#include "../ext/scalar_uint_sized.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_vector_uint1_sized extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_vector_uint1_sized + /// @{ + + /// 8 bit unsigned integer vector of 1 component type. + /// + /// @see ext_vector_uint1_sized + typedef vec<1, uint8, defaultp> u8vec1; + + /// 16 bit unsigned integer vector of 1 component type. + /// + /// @see ext_vector_uint1_sized + typedef vec<1, uint16, defaultp> u16vec1; + + /// 32 bit unsigned integer vector of 1 component type. + /// + /// @see ext_vector_uint1_sized + typedef vec<1, uint32, defaultp> u32vec1; + + /// 64 bit unsigned integer vector of 1 component type. + /// + /// @see ext_vector_uint1_sized + typedef vec<1, uint64, defaultp> u64vec1; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_uint2.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_uint2.hpp new file mode 100644 index 0000000000000000000000000000000000000000..bb5969aded8f7ac02f9560143fe2566bceb28bf8 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_uint2.hpp @@ -0,0 +1,18 @@ +/// @ref core +/// @file glm/ext/vector_uint2.hpp + +#pragma once +#include "../detail/type_vec2.hpp" + +namespace glm +{ + /// @addtogroup core_vector + /// @{ + + /// 2 components vector of unsigned integer numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + typedef vec<2, unsigned int, defaultp> uvec2; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_uint2_sized.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_uint2_sized.hpp new file mode 100644 index 0000000000000000000000000000000000000000..9cef3a9ed635581b7f09684f50af4d198e58872b --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_uint2_sized.hpp @@ -0,0 +1,49 @@ +/// @ref ext_vector_uint2_sized +/// @file glm/ext/vector_uint2_sized.hpp +/// +/// @defgroup ext_vector_uint2_sized GLM_EXT_vector_uint2_sized +/// @ingroup ext +/// +/// Exposes sized unsigned integer vector of 2 components type. +/// +/// Include to use the features of this extension. +/// +/// @see ext_scalar_uint_sized +/// @see ext_vector_int2_sized + +#pragma once + +#include "../ext/vector_uint2.hpp" +#include "../ext/scalar_uint_sized.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_vector_uint2_sized extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_vector_uint2_sized + /// @{ + + /// 8 bit unsigned integer vector of 2 components type. + /// + /// @see ext_vector_uint2_sized + typedef vec<2, uint8, defaultp> u8vec2; + + /// 16 bit unsigned integer vector of 2 components type. + /// + /// @see ext_vector_uint2_sized + typedef vec<2, uint16, defaultp> u16vec2; + + /// 32 bit unsigned integer vector of 2 components type. + /// + /// @see ext_vector_uint2_sized + typedef vec<2, uint32, defaultp> u32vec2; + + /// 64 bit unsigned integer vector of 2 components type. + /// + /// @see ext_vector_uint2_sized + typedef vec<2, uint64, defaultp> u64vec2; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_uint3.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_uint3.hpp new file mode 100644 index 0000000000000000000000000000000000000000..f4475923c7c6ba6d25d8180be35769e8e19a0bb5 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_uint3.hpp @@ -0,0 +1,18 @@ +/// @ref core +/// @file glm/ext/vector_uint3.hpp + +#pragma once +#include "../detail/type_vec3.hpp" + +namespace glm +{ + /// @addtogroup core_vector + /// @{ + + /// 3 components vector of unsigned integer numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + typedef vec<3, unsigned int, defaultp> uvec3; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_uint3_sized.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_uint3_sized.hpp new file mode 100644 index 0000000000000000000000000000000000000000..fd4ea375da9e24b4979e6f22e4aa41248caa05c2 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_uint3_sized.hpp @@ -0,0 +1,49 @@ +/// @ref ext_vector_uint3_sized +/// @file glm/ext/vector_uint3_sized.hpp +/// +/// @defgroup ext_vector_uint3_sized GLM_EXT_vector_uint3_sized +/// @ingroup ext +/// +/// Exposes sized unsigned integer vector of 3 components type. +/// +/// Include to use the features of this extension. +/// +/// @see ext_scalar_uint_sized +/// @see ext_vector_int3_sized + +#pragma once + +#include "../ext/vector_uint3.hpp" +#include "../ext/scalar_uint_sized.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_vector_uint3_sized extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_vector_uint3_sized + /// @{ + + /// 8 bit unsigned integer vector of 3 components type. + /// + /// @see ext_vector_uint3_sized + typedef vec<3, uint8, defaultp> u8vec3; + + /// 16 bit unsigned integer vector of 3 components type. + /// + /// @see ext_vector_uint3_sized + typedef vec<3, uint16, defaultp> u16vec3; + + /// 32 bit unsigned integer vector of 3 components type. + /// + /// @see ext_vector_uint3_sized + typedef vec<3, uint32, defaultp> u32vec3; + + /// 64 bit unsigned integer vector of 3 components type. + /// + /// @see ext_vector_uint3_sized + typedef vec<3, uint64, defaultp> u64vec3; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_uint4.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_uint4.hpp new file mode 100644 index 0000000000000000000000000000000000000000..73e028ea26b9952679afefc42ce1d54f7760e890 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_uint4.hpp @@ -0,0 +1,18 @@ +/// @ref core +/// @file glm/ext/vector_uint4.hpp + +#pragma once +#include "../detail/type_vec4.hpp" + +namespace glm +{ + /// @addtogroup core_vector + /// @{ + + /// 4 components vector of unsigned integer numbers. + /// + /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors + typedef vec<4, unsigned int, defaultp> uvec4; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_uint4_sized.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_uint4_sized.hpp new file mode 100644 index 0000000000000000000000000000000000000000..6ccd1458d8392597808588472af69d81013bd949 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_uint4_sized.hpp @@ -0,0 +1,49 @@ +/// @ref ext_vector_uint4_sized +/// @file glm/ext/vector_uint4_sized.hpp +/// +/// @defgroup ext_vector_uint4_sized GLM_EXT_vector_uint4_sized +/// @ingroup ext +/// +/// Exposes sized unsigned integer vector of 4 components type. +/// +/// Include to use the features of this extension. +/// +/// @see ext_scalar_uint_sized +/// @see ext_vector_int4_sized + +#pragma once + +#include "../ext/vector_uint4.hpp" +#include "../ext/scalar_uint_sized.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_vector_uint4_sized extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_vector_uint4_sized + /// @{ + + /// 8 bit unsigned integer vector of 4 components type. + /// + /// @see ext_vector_uint4_sized + typedef vec<4, uint8, defaultp> u8vec4; + + /// 16 bit unsigned integer vector of 4 components type. + /// + /// @see ext_vector_uint4_sized + typedef vec<4, uint16, defaultp> u16vec4; + + /// 32 bit unsigned integer vector of 4 components type. + /// + /// @see ext_vector_uint4_sized + typedef vec<4, uint32, defaultp> u32vec4; + + /// 64 bit unsigned integer vector of 4 components type. + /// + /// @see ext_vector_uint4_sized + typedef vec<4, uint64, defaultp> u64vec4; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_ulp.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_ulp.hpp new file mode 100644 index 0000000000000000000000000000000000000000..d9fc09388e375ce2b6438e65b7ad13ebc915ad9d --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_ulp.hpp @@ -0,0 +1,112 @@ +/// @ref ext_vector_ulp +/// @file glm/ext/vector_ulp.hpp +/// +/// @defgroup ext_vector_ulp GLM_EXT_vector_ulp +/// @ingroup ext +/// +/// Allow the measurement of the accuracy of a function against a reference +/// implementation. This extension works on floating-point data and provide results +/// in ULP. +/// +/// Include to use the features of this extension. +/// +/// @see ext_scalar_ulp +/// @see ext_scalar_relational +/// @see ext_vector_relational + +#pragma once + +// Dependencies +#include "../ext/scalar_ulp.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_EXT_vector_ulp extension included") +#endif + +namespace glm +{ + /// @addtogroup ext_vector_ulp + /// @{ + + /// Return the next ULP value(s) after the input value(s). + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point + /// @tparam Q Value from qualifier enum + /// + /// @see ext_scalar_ulp + template + GLM_FUNC_DECL vec nextFloat(vec const& x); + + /// Return the value(s) ULP distance after the input value(s). + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point + /// @tparam Q Value from qualifier enum + /// + /// @see ext_scalar_ulp + template + GLM_FUNC_DECL vec nextFloat(vec const& x, int ULPs); + + /// Return the value(s) ULP distance after the input value(s). + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point + /// @tparam Q Value from qualifier enum + /// + /// @see ext_scalar_ulp + template + GLM_FUNC_DECL vec nextFloat(vec const& x, vec const& ULPs); + + /// Return the previous ULP value(s) before the input value(s). + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point + /// @tparam Q Value from qualifier enum + /// + /// @see ext_scalar_ulp + template + GLM_FUNC_DECL vec prevFloat(vec const& x); + + /// Return the value(s) ULP distance before the input value(s). + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point + /// @tparam Q Value from qualifier enum + /// + /// @see ext_scalar_ulp + template + GLM_FUNC_DECL vec prevFloat(vec const& x, int ULPs); + + /// Return the value(s) ULP distance before the input value(s). + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point + /// @tparam Q Value from qualifier enum + /// + /// @see ext_scalar_ulp + template + GLM_FUNC_DECL vec prevFloat(vec const& x, vec const& ULPs); + + /// Return the distance in the number of ULP between 2 single-precision floating-point scalars. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam Q Value from qualifier enum + /// + /// @see ext_scalar_ulp + template + GLM_FUNC_DECL vec floatDistance(vec const& x, vec const& y); + + /// Return the distance in the number of ULP between 2 double-precision floating-point scalars. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam Q Value from qualifier enum + /// + /// @see ext_scalar_ulp + template + GLM_FUNC_DECL vec floatDistance(vec const& x, vec const& y); + + /// @} +}//namespace glm + +#include "vector_ulp.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_ulp.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_ulp.inl new file mode 100644 index 0000000000000000000000000000000000000000..d4b84cb207d2e1c609825a9dc52e6281877d97b8 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/ext/vector_ulp.inl @@ -0,0 +1,74 @@ +namespace glm +{ + template + GLM_FUNC_QUALIFIER vec nextFloat(vec const& x) + { + vec Result; + for(length_t i = 0, n = Result.length(); i < n; ++i) + Result[i] = nextFloat(x[i]); + return Result; + } + + template + GLM_FUNC_QUALIFIER vec nextFloat(vec const& x, int ULPs) + { + vec Result; + for(length_t i = 0, n = Result.length(); i < n; ++i) + Result[i] = nextFloat(x[i], ULPs); + return Result; + } + + template + GLM_FUNC_QUALIFIER vec nextFloat(vec const& x, vec const& ULPs) + { + vec Result; + for(length_t i = 0, n = Result.length(); i < n; ++i) + Result[i] = nextFloat(x[i], ULPs[i]); + return Result; + } + + template + GLM_FUNC_QUALIFIER vec prevFloat(vec const& x) + { + vec Result; + for(length_t i = 0, n = Result.length(); i < n; ++i) + Result[i] = prevFloat(x[i]); + return Result; + } + + template + GLM_FUNC_QUALIFIER vec prevFloat(vec const& x, int ULPs) + { + vec Result; + for(length_t i = 0, n = Result.length(); i < n; ++i) + Result[i] = prevFloat(x[i], ULPs); + return Result; + } + + template + GLM_FUNC_QUALIFIER vec prevFloat(vec const& x, vec const& ULPs) + { + vec Result; + for(length_t i = 0, n = Result.length(); i < n; ++i) + Result[i] = prevFloat(x[i], ULPs[i]); + return Result; + } + + template + GLM_FUNC_QUALIFIER vec floatDistance(vec const& x, vec const& y) + { + vec Result; + for(length_t i = 0, n = Result.length(); i < n; ++i) + Result[i] = floatDistance(x[i], y[i]); + return Result; + } + + template + GLM_FUNC_QUALIFIER vec floatDistance(vec const& x, vec const& y) + { + vec Result; + for(length_t i = 0, n = Result.length(); i < n; ++i) + Result[i] = floatDistance(x[i], y[i]); + return Result; + } +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/fwd.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/fwd.hpp new file mode 100644 index 0000000000000000000000000000000000000000..1d39d4e3e86b537fd034f4beae4ca339cd6b4ba8 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/fwd.hpp @@ -0,0 +1,1233 @@ +#pragma once + +#include "detail/qualifier.hpp" + +namespace glm +{ +#if GLM_HAS_EXTENDED_INTEGER_TYPE + typedef std::int8_t int8; + typedef std::int16_t int16; + typedef std::int32_t int32; + typedef std::int64_t int64; + + typedef std::uint8_t uint8; + typedef std::uint16_t uint16; + typedef std::uint32_t uint32; + typedef std::uint64_t uint64; +#else + typedef signed char int8; + typedef signed short int16; + typedef signed int int32; + typedef detail::int64 int64; + + typedef unsigned char uint8; + typedef unsigned short uint16; + typedef unsigned int uint32; + typedef detail::uint64 uint64; +#endif + + // Scalar int + + typedef int8 lowp_i8; + typedef int8 mediump_i8; + typedef int8 highp_i8; + typedef int8 i8; + + typedef int8 lowp_int8; + typedef int8 mediump_int8; + typedef int8 highp_int8; + + typedef int8 lowp_int8_t; + typedef int8 mediump_int8_t; + typedef int8 highp_int8_t; + typedef int8 int8_t; + + typedef int16 lowp_i16; + typedef int16 mediump_i16; + typedef int16 highp_i16; + typedef int16 i16; + + typedef int16 lowp_int16; + typedef int16 mediump_int16; + typedef int16 highp_int16; + + typedef int16 lowp_int16_t; + typedef int16 mediump_int16_t; + typedef int16 highp_int16_t; + typedef int16 int16_t; + + typedef int32 lowp_i32; + typedef int32 mediump_i32; + typedef int32 highp_i32; + typedef int32 i32; + + typedef int32 lowp_int32; + typedef int32 mediump_int32; + typedef int32 highp_int32; + + typedef int32 lowp_int32_t; + typedef int32 mediump_int32_t; + typedef int32 highp_int32_t; + typedef int32 int32_t; + + typedef int64 lowp_i64; + typedef int64 mediump_i64; + typedef int64 highp_i64; + typedef int64 i64; + + typedef int64 lowp_int64; + typedef int64 mediump_int64; + typedef int64 highp_int64; + + typedef int64 lowp_int64_t; + typedef int64 mediump_int64_t; + typedef int64 highp_int64_t; + typedef int64 int64_t; + + // Scalar uint + + typedef unsigned int uint; + + typedef uint8 lowp_u8; + typedef uint8 mediump_u8; + typedef uint8 highp_u8; + typedef uint8 u8; + + typedef uint8 lowp_uint8; + typedef uint8 mediump_uint8; + typedef uint8 highp_uint8; + + typedef uint8 lowp_uint8_t; + typedef uint8 mediump_uint8_t; + typedef uint8 highp_uint8_t; + typedef uint8 uint8_t; + + typedef uint16 lowp_u16; + typedef uint16 mediump_u16; + typedef uint16 highp_u16; + typedef uint16 u16; + + typedef uint16 lowp_uint16; + typedef uint16 mediump_uint16; + typedef uint16 highp_uint16; + + typedef uint16 lowp_uint16_t; + typedef uint16 mediump_uint16_t; + typedef uint16 highp_uint16_t; + typedef uint16 uint16_t; + + typedef uint32 lowp_u32; + typedef uint32 mediump_u32; + typedef uint32 highp_u32; + typedef uint32 u32; + + typedef uint32 lowp_uint32; + typedef uint32 mediump_uint32; + typedef uint32 highp_uint32; + + typedef uint32 lowp_uint32_t; + typedef uint32 mediump_uint32_t; + typedef uint32 highp_uint32_t; + typedef uint32 uint32_t; + + typedef uint64 lowp_u64; + typedef uint64 mediump_u64; + typedef uint64 highp_u64; + typedef uint64 u64; + + typedef uint64 lowp_uint64; + typedef uint64 mediump_uint64; + typedef uint64 highp_uint64; + + typedef uint64 lowp_uint64_t; + typedef uint64 mediump_uint64_t; + typedef uint64 highp_uint64_t; + typedef uint64 uint64_t; + + // Scalar float + + typedef float lowp_f32; + typedef float mediump_f32; + typedef float highp_f32; + typedef float f32; + + typedef float lowp_float32; + typedef float mediump_float32; + typedef float highp_float32; + typedef float float32; + + typedef float lowp_float32_t; + typedef float mediump_float32_t; + typedef float highp_float32_t; + typedef float float32_t; + + + typedef double lowp_f64; + typedef double mediump_f64; + typedef double highp_f64; + typedef double f64; + + typedef double lowp_float64; + typedef double mediump_float64; + typedef double highp_float64; + typedef double float64; + + typedef double lowp_float64_t; + typedef double mediump_float64_t; + typedef double highp_float64_t; + typedef double float64_t; + + // Vector bool + + typedef vec<1, bool, lowp> lowp_bvec1; + typedef vec<2, bool, lowp> lowp_bvec2; + typedef vec<3, bool, lowp> lowp_bvec3; + typedef vec<4, bool, lowp> lowp_bvec4; + + typedef vec<1, bool, mediump> mediump_bvec1; + typedef vec<2, bool, mediump> mediump_bvec2; + typedef vec<3, bool, mediump> mediump_bvec3; + typedef vec<4, bool, mediump> mediump_bvec4; + + typedef vec<1, bool, highp> highp_bvec1; + typedef vec<2, bool, highp> highp_bvec2; + typedef vec<3, bool, highp> highp_bvec3; + typedef vec<4, bool, highp> highp_bvec4; + + typedef vec<1, bool, defaultp> bvec1; + typedef vec<2, bool, defaultp> bvec2; + typedef vec<3, bool, defaultp> bvec3; + typedef vec<4, bool, defaultp> bvec4; + + // Vector int + + typedef vec<1, int, lowp> lowp_ivec1; + typedef vec<2, int, lowp> lowp_ivec2; + typedef vec<3, int, lowp> lowp_ivec3; + typedef vec<4, int, lowp> lowp_ivec4; + + typedef vec<1, int, mediump> mediump_ivec1; + typedef vec<2, int, mediump> mediump_ivec2; + typedef vec<3, int, mediump> mediump_ivec3; + typedef vec<4, int, mediump> mediump_ivec4; + + typedef vec<1, int, highp> highp_ivec1; + typedef vec<2, int, highp> highp_ivec2; + typedef vec<3, int, highp> highp_ivec3; + typedef vec<4, int, highp> highp_ivec4; + + typedef vec<1, int, defaultp> ivec1; + typedef vec<2, int, defaultp> ivec2; + typedef vec<3, int, defaultp> ivec3; + typedef vec<4, int, defaultp> ivec4; + + typedef vec<1, i8, lowp> lowp_i8vec1; + typedef vec<2, i8, lowp> lowp_i8vec2; + typedef vec<3, i8, lowp> lowp_i8vec3; + typedef vec<4, i8, lowp> lowp_i8vec4; + + typedef vec<1, i8, mediump> mediump_i8vec1; + typedef vec<2, i8, mediump> mediump_i8vec2; + typedef vec<3, i8, mediump> mediump_i8vec3; + typedef vec<4, i8, mediump> mediump_i8vec4; + + typedef vec<1, i8, highp> highp_i8vec1; + typedef vec<2, i8, highp> highp_i8vec2; + typedef vec<3, i8, highp> highp_i8vec3; + typedef vec<4, i8, highp> highp_i8vec4; + + typedef vec<1, i8, defaultp> i8vec1; + typedef vec<2, i8, defaultp> i8vec2; + typedef vec<3, i8, defaultp> i8vec3; + typedef vec<4, i8, defaultp> i8vec4; + + typedef vec<1, i16, lowp> lowp_i16vec1; + typedef vec<2, i16, lowp> lowp_i16vec2; + typedef vec<3, i16, lowp> lowp_i16vec3; + typedef vec<4, i16, lowp> lowp_i16vec4; + + typedef vec<1, i16, mediump> mediump_i16vec1; + typedef vec<2, i16, mediump> mediump_i16vec2; + typedef vec<3, i16, mediump> mediump_i16vec3; + typedef vec<4, i16, mediump> mediump_i16vec4; + + typedef vec<1, i16, highp> highp_i16vec1; + typedef vec<2, i16, highp> highp_i16vec2; + typedef vec<3, i16, highp> highp_i16vec3; + typedef vec<4, i16, highp> highp_i16vec4; + + typedef vec<1, i16, defaultp> i16vec1; + typedef vec<2, i16, defaultp> i16vec2; + typedef vec<3, i16, defaultp> i16vec3; + typedef vec<4, i16, defaultp> i16vec4; + + typedef vec<1, i32, lowp> lowp_i32vec1; + typedef vec<2, i32, lowp> lowp_i32vec2; + typedef vec<3, i32, lowp> lowp_i32vec3; + typedef vec<4, i32, lowp> lowp_i32vec4; + + typedef vec<1, i32, mediump> mediump_i32vec1; + typedef vec<2, i32, mediump> mediump_i32vec2; + typedef vec<3, i32, mediump> mediump_i32vec3; + typedef vec<4, i32, mediump> mediump_i32vec4; + + typedef vec<1, i32, highp> highp_i32vec1; + typedef vec<2, i32, highp> highp_i32vec2; + typedef vec<3, i32, highp> highp_i32vec3; + typedef vec<4, i32, highp> highp_i32vec4; + + typedef vec<1, i32, defaultp> i32vec1; + typedef vec<2, i32, defaultp> i32vec2; + typedef vec<3, i32, defaultp> i32vec3; + typedef vec<4, i32, defaultp> i32vec4; + + typedef vec<1, i64, lowp> lowp_i64vec1; + typedef vec<2, i64, lowp> lowp_i64vec2; + typedef vec<3, i64, lowp> lowp_i64vec3; + typedef vec<4, i64, lowp> lowp_i64vec4; + + typedef vec<1, i64, mediump> mediump_i64vec1; + typedef vec<2, i64, mediump> mediump_i64vec2; + typedef vec<3, i64, mediump> mediump_i64vec3; + typedef vec<4, i64, mediump> mediump_i64vec4; + + typedef vec<1, i64, highp> highp_i64vec1; + typedef vec<2, i64, highp> highp_i64vec2; + typedef vec<3, i64, highp> highp_i64vec3; + typedef vec<4, i64, highp> highp_i64vec4; + + typedef vec<1, i64, defaultp> i64vec1; + typedef vec<2, i64, defaultp> i64vec2; + typedef vec<3, i64, defaultp> i64vec3; + typedef vec<4, i64, defaultp> i64vec4; + + // Vector uint + + typedef vec<1, uint, lowp> lowp_uvec1; + typedef vec<2, uint, lowp> lowp_uvec2; + typedef vec<3, uint, lowp> lowp_uvec3; + typedef vec<4, uint, lowp> lowp_uvec4; + + typedef vec<1, uint, mediump> mediump_uvec1; + typedef vec<2, uint, mediump> mediump_uvec2; + typedef vec<3, uint, mediump> mediump_uvec3; + typedef vec<4, uint, mediump> mediump_uvec4; + + typedef vec<1, uint, highp> highp_uvec1; + typedef vec<2, uint, highp> highp_uvec2; + typedef vec<3, uint, highp> highp_uvec3; + typedef vec<4, uint, highp> highp_uvec4; + + typedef vec<1, uint, defaultp> uvec1; + typedef vec<2, uint, defaultp> uvec2; + typedef vec<3, uint, defaultp> uvec3; + typedef vec<4, uint, defaultp> uvec4; + + typedef vec<1, u8, lowp> lowp_u8vec1; + typedef vec<2, u8, lowp> lowp_u8vec2; + typedef vec<3, u8, lowp> lowp_u8vec3; + typedef vec<4, u8, lowp> lowp_u8vec4; + + typedef vec<1, u8, mediump> mediump_u8vec1; + typedef vec<2, u8, mediump> mediump_u8vec2; + typedef vec<3, u8, mediump> mediump_u8vec3; + typedef vec<4, u8, mediump> mediump_u8vec4; + + typedef vec<1, u8, highp> highp_u8vec1; + typedef vec<2, u8, highp> highp_u8vec2; + typedef vec<3, u8, highp> highp_u8vec3; + typedef vec<4, u8, highp> highp_u8vec4; + + typedef vec<1, u8, defaultp> u8vec1; + typedef vec<2, u8, defaultp> u8vec2; + typedef vec<3, u8, defaultp> u8vec3; + typedef vec<4, u8, defaultp> u8vec4; + + typedef vec<1, u16, lowp> lowp_u16vec1; + typedef vec<2, u16, lowp> lowp_u16vec2; + typedef vec<3, u16, lowp> lowp_u16vec3; + typedef vec<4, u16, lowp> lowp_u16vec4; + + typedef vec<1, u16, mediump> mediump_u16vec1; + typedef vec<2, u16, mediump> mediump_u16vec2; + typedef vec<3, u16, mediump> mediump_u16vec3; + typedef vec<4, u16, mediump> mediump_u16vec4; + + typedef vec<1, u16, highp> highp_u16vec1; + typedef vec<2, u16, highp> highp_u16vec2; + typedef vec<3, u16, highp> highp_u16vec3; + typedef vec<4, u16, highp> highp_u16vec4; + + typedef vec<1, u16, defaultp> u16vec1; + typedef vec<2, u16, defaultp> u16vec2; + typedef vec<3, u16, defaultp> u16vec3; + typedef vec<4, u16, defaultp> u16vec4; + + typedef vec<1, u32, lowp> lowp_u32vec1; + typedef vec<2, u32, lowp> lowp_u32vec2; + typedef vec<3, u32, lowp> lowp_u32vec3; + typedef vec<4, u32, lowp> lowp_u32vec4; + + typedef vec<1, u32, mediump> mediump_u32vec1; + typedef vec<2, u32, mediump> mediump_u32vec2; + typedef vec<3, u32, mediump> mediump_u32vec3; + typedef vec<4, u32, mediump> mediump_u32vec4; + + typedef vec<1, u32, highp> highp_u32vec1; + typedef vec<2, u32, highp> highp_u32vec2; + typedef vec<3, u32, highp> highp_u32vec3; + typedef vec<4, u32, highp> highp_u32vec4; + + typedef vec<1, u32, defaultp> u32vec1; + typedef vec<2, u32, defaultp> u32vec2; + typedef vec<3, u32, defaultp> u32vec3; + typedef vec<4, u32, defaultp> u32vec4; + + typedef vec<1, u64, lowp> lowp_u64vec1; + typedef vec<2, u64, lowp> lowp_u64vec2; + typedef vec<3, u64, lowp> lowp_u64vec3; + typedef vec<4, u64, lowp> lowp_u64vec4; + + typedef vec<1, u64, mediump> mediump_u64vec1; + typedef vec<2, u64, mediump> mediump_u64vec2; + typedef vec<3, u64, mediump> mediump_u64vec3; + typedef vec<4, u64, mediump> mediump_u64vec4; + + typedef vec<1, u64, highp> highp_u64vec1; + typedef vec<2, u64, highp> highp_u64vec2; + typedef vec<3, u64, highp> highp_u64vec3; + typedef vec<4, u64, highp> highp_u64vec4; + + typedef vec<1, u64, defaultp> u64vec1; + typedef vec<2, u64, defaultp> u64vec2; + typedef vec<3, u64, defaultp> u64vec3; + typedef vec<4, u64, defaultp> u64vec4; + + // Vector float + + typedef vec<1, float, lowp> lowp_vec1; + typedef vec<2, float, lowp> lowp_vec2; + typedef vec<3, float, lowp> lowp_vec3; + typedef vec<4, float, lowp> lowp_vec4; + + typedef vec<1, float, mediump> mediump_vec1; + typedef vec<2, float, mediump> mediump_vec2; + typedef vec<3, float, mediump> mediump_vec3; + typedef vec<4, float, mediump> mediump_vec4; + + typedef vec<1, float, highp> highp_vec1; + typedef vec<2, float, highp> highp_vec2; + typedef vec<3, float, highp> highp_vec3; + typedef vec<4, float, highp> highp_vec4; + + typedef vec<1, float, defaultp> vec1; + typedef vec<2, float, defaultp> vec2; + typedef vec<3, float, defaultp> vec3; + typedef vec<4, float, defaultp> vec4; + + typedef vec<1, float, lowp> lowp_fvec1; + typedef vec<2, float, lowp> lowp_fvec2; + typedef vec<3, float, lowp> lowp_fvec3; + typedef vec<4, float, lowp> lowp_fvec4; + + typedef vec<1, float, mediump> mediump_fvec1; + typedef vec<2, float, mediump> mediump_fvec2; + typedef vec<3, float, mediump> mediump_fvec3; + typedef vec<4, float, mediump> mediump_fvec4; + + typedef vec<1, float, highp> highp_fvec1; + typedef vec<2, float, highp> highp_fvec2; + typedef vec<3, float, highp> highp_fvec3; + typedef vec<4, float, highp> highp_fvec4; + + typedef vec<1, f32, defaultp> fvec1; + typedef vec<2, f32, defaultp> fvec2; + typedef vec<3, f32, defaultp> fvec3; + typedef vec<4, f32, defaultp> fvec4; + + typedef vec<1, f32, lowp> lowp_f32vec1; + typedef vec<2, f32, lowp> lowp_f32vec2; + typedef vec<3, f32, lowp> lowp_f32vec3; + typedef vec<4, f32, lowp> lowp_f32vec4; + + typedef vec<1, f32, mediump> mediump_f32vec1; + typedef vec<2, f32, mediump> mediump_f32vec2; + typedef vec<3, f32, mediump> mediump_f32vec3; + typedef vec<4, f32, mediump> mediump_f32vec4; + + typedef vec<1, f32, highp> highp_f32vec1; + typedef vec<2, f32, highp> highp_f32vec2; + typedef vec<3, f32, highp> highp_f32vec3; + typedef vec<4, f32, highp> highp_f32vec4; + + typedef vec<1, f32, defaultp> f32vec1; + typedef vec<2, f32, defaultp> f32vec2; + typedef vec<3, f32, defaultp> f32vec3; + typedef vec<4, f32, defaultp> f32vec4; + + typedef vec<1, f64, lowp> lowp_dvec1; + typedef vec<2, f64, lowp> lowp_dvec2; + typedef vec<3, f64, lowp> lowp_dvec3; + typedef vec<4, f64, lowp> lowp_dvec4; + + typedef vec<1, f64, mediump> mediump_dvec1; + typedef vec<2, f64, mediump> mediump_dvec2; + typedef vec<3, f64, mediump> mediump_dvec3; + typedef vec<4, f64, mediump> mediump_dvec4; + + typedef vec<1, f64, highp> highp_dvec1; + typedef vec<2, f64, highp> highp_dvec2; + typedef vec<3, f64, highp> highp_dvec3; + typedef vec<4, f64, highp> highp_dvec4; + + typedef vec<1, f64, defaultp> dvec1; + typedef vec<2, f64, defaultp> dvec2; + typedef vec<3, f64, defaultp> dvec3; + typedef vec<4, f64, defaultp> dvec4; + + typedef vec<1, f64, lowp> lowp_f64vec1; + typedef vec<2, f64, lowp> lowp_f64vec2; + typedef vec<3, f64, lowp> lowp_f64vec3; + typedef vec<4, f64, lowp> lowp_f64vec4; + + typedef vec<1, f64, mediump> mediump_f64vec1; + typedef vec<2, f64, mediump> mediump_f64vec2; + typedef vec<3, f64, mediump> mediump_f64vec3; + typedef vec<4, f64, mediump> mediump_f64vec4; + + typedef vec<1, f64, highp> highp_f64vec1; + typedef vec<2, f64, highp> highp_f64vec2; + typedef vec<3, f64, highp> highp_f64vec3; + typedef vec<4, f64, highp> highp_f64vec4; + + typedef vec<1, f64, defaultp> f64vec1; + typedef vec<2, f64, defaultp> f64vec2; + typedef vec<3, f64, defaultp> f64vec3; + typedef vec<4, f64, defaultp> f64vec4; + + // Matrix NxN + + typedef mat<2, 2, f32, lowp> lowp_mat2; + typedef mat<3, 3, f32, lowp> lowp_mat3; + typedef mat<4, 4, f32, lowp> lowp_mat4; + + typedef mat<2, 2, f32, mediump> mediump_mat2; + typedef mat<3, 3, f32, mediump> mediump_mat3; + typedef mat<4, 4, f32, mediump> mediump_mat4; + + typedef mat<2, 2, f32, highp> highp_mat2; + typedef mat<3, 3, f32, highp> highp_mat3; + typedef mat<4, 4, f32, highp> highp_mat4; + + typedef mat<2, 2, f32, defaultp> mat2; + typedef mat<3, 3, f32, defaultp> mat3; + typedef mat<4, 4, f32, defaultp> mat4; + + typedef mat<2, 2, f32, lowp> lowp_fmat2; + typedef mat<3, 3, f32, lowp> lowp_fmat3; + typedef mat<4, 4, f32, lowp> lowp_fmat4; + + typedef mat<2, 2, f32, mediump> mediump_fmat2; + typedef mat<3, 3, f32, mediump> mediump_fmat3; + typedef mat<4, 4, f32, mediump> mediump_fmat4; + + typedef mat<2, 2, f32, highp> highp_fmat2; + typedef mat<3, 3, f32, highp> highp_fmat3; + typedef mat<4, 4, f32, highp> highp_fmat4; + + typedef mat<2, 2, f32, defaultp> fmat2; + typedef mat<3, 3, f32, defaultp> fmat3; + typedef mat<4, 4, f32, defaultp> fmat4; + + typedef mat<2, 2, f32, lowp> lowp_f32mat2; + typedef mat<3, 3, f32, lowp> lowp_f32mat3; + typedef mat<4, 4, f32, lowp> lowp_f32mat4; + + typedef mat<2, 2, f32, mediump> mediump_f32mat2; + typedef mat<3, 3, f32, mediump> mediump_f32mat3; + typedef mat<4, 4, f32, mediump> mediump_f32mat4; + + typedef mat<2, 2, f32, highp> highp_f32mat2; + typedef mat<3, 3, f32, highp> highp_f32mat3; + typedef mat<4, 4, f32, highp> highp_f32mat4; + + typedef mat<2, 2, f32, defaultp> f32mat2; + typedef mat<3, 3, f32, defaultp> f32mat3; + typedef mat<4, 4, f32, defaultp> f32mat4; + + typedef mat<2, 2, f64, lowp> lowp_dmat2; + typedef mat<3, 3, f64, lowp> lowp_dmat3; + typedef mat<4, 4, f64, lowp> lowp_dmat4; + + typedef mat<2, 2, f64, mediump> mediump_dmat2; + typedef mat<3, 3, f64, mediump> mediump_dmat3; + typedef mat<4, 4, f64, mediump> mediump_dmat4; + + typedef mat<2, 2, f64, highp> highp_dmat2; + typedef mat<3, 3, f64, highp> highp_dmat3; + typedef mat<4, 4, f64, highp> highp_dmat4; + + typedef mat<2, 2, f64, defaultp> dmat2; + typedef mat<3, 3, f64, defaultp> dmat3; + typedef mat<4, 4, f64, defaultp> dmat4; + + typedef mat<2, 2, f64, lowp> lowp_f64mat2; + typedef mat<3, 3, f64, lowp> lowp_f64mat3; + typedef mat<4, 4, f64, lowp> lowp_f64mat4; + + typedef mat<2, 2, f64, mediump> mediump_f64mat2; + typedef mat<3, 3, f64, mediump> mediump_f64mat3; + typedef mat<4, 4, f64, mediump> mediump_f64mat4; + + typedef mat<2, 2, f64, highp> highp_f64mat2; + typedef mat<3, 3, f64, highp> highp_f64mat3; + typedef mat<4, 4, f64, highp> highp_f64mat4; + + typedef mat<2, 2, f64, defaultp> f64mat2; + typedef mat<3, 3, f64, defaultp> f64mat3; + typedef mat<4, 4, f64, defaultp> f64mat4; + + // Matrix MxN + + typedef mat<2, 2, f32, lowp> lowp_mat2x2; + typedef mat<2, 3, f32, lowp> lowp_mat2x3; + typedef mat<2, 4, f32, lowp> lowp_mat2x4; + typedef mat<3, 2, f32, lowp> lowp_mat3x2; + typedef mat<3, 3, f32, lowp> lowp_mat3x3; + typedef mat<3, 4, f32, lowp> lowp_mat3x4; + typedef mat<4, 2, f32, lowp> lowp_mat4x2; + typedef mat<4, 3, f32, lowp> lowp_mat4x3; + typedef mat<4, 4, f32, lowp> lowp_mat4x4; + + typedef mat<2, 2, f32, mediump> mediump_mat2x2; + typedef mat<2, 3, f32, mediump> mediump_mat2x3; + typedef mat<2, 4, f32, mediump> mediump_mat2x4; + typedef mat<3, 2, f32, mediump> mediump_mat3x2; + typedef mat<3, 3, f32, mediump> mediump_mat3x3; + typedef mat<3, 4, f32, mediump> mediump_mat3x4; + typedef mat<4, 2, f32, mediump> mediump_mat4x2; + typedef mat<4, 3, f32, mediump> mediump_mat4x3; + typedef mat<4, 4, f32, mediump> mediump_mat4x4; + + typedef mat<2, 2, f32, highp> highp_mat2x2; + typedef mat<2, 3, f32, highp> highp_mat2x3; + typedef mat<2, 4, f32, highp> highp_mat2x4; + typedef mat<3, 2, f32, highp> highp_mat3x2; + typedef mat<3, 3, f32, highp> highp_mat3x3; + typedef mat<3, 4, f32, highp> highp_mat3x4; + typedef mat<4, 2, f32, highp> highp_mat4x2; + typedef mat<4, 3, f32, highp> highp_mat4x3; + typedef mat<4, 4, f32, highp> highp_mat4x4; + + typedef mat<2, 2, f32, defaultp> mat2x2; + typedef mat<2, 3, f32, defaultp> mat2x3; + typedef mat<2, 4, f32, defaultp> mat2x4; + typedef mat<3, 2, f32, defaultp> mat3x2; + typedef mat<3, 3, f32, defaultp> mat3x3; + typedef mat<3, 4, f32, defaultp> mat3x4; + typedef mat<4, 2, f32, defaultp> mat4x2; + typedef mat<4, 3, f32, defaultp> mat4x3; + typedef mat<4, 4, f32, defaultp> mat4x4; + + typedef mat<2, 2, f32, lowp> lowp_fmat2x2; + typedef mat<2, 3, f32, lowp> lowp_fmat2x3; + typedef mat<2, 4, f32, lowp> lowp_fmat2x4; + typedef mat<3, 2, f32, lowp> lowp_fmat3x2; + typedef mat<3, 3, f32, lowp> lowp_fmat3x3; + typedef mat<3, 4, f32, lowp> lowp_fmat3x4; + typedef mat<4, 2, f32, lowp> lowp_fmat4x2; + typedef mat<4, 3, f32, lowp> lowp_fmat4x3; + typedef mat<4, 4, f32, lowp> lowp_fmat4x4; + + typedef mat<2, 2, f32, mediump> mediump_fmat2x2; + typedef mat<2, 3, f32, mediump> mediump_fmat2x3; + typedef mat<2, 4, f32, mediump> mediump_fmat2x4; + typedef mat<3, 2, f32, mediump> mediump_fmat3x2; + typedef mat<3, 3, f32, mediump> mediump_fmat3x3; + typedef mat<3, 4, f32, mediump> mediump_fmat3x4; + typedef mat<4, 2, f32, mediump> mediump_fmat4x2; + typedef mat<4, 3, f32, mediump> mediump_fmat4x3; + typedef mat<4, 4, f32, mediump> mediump_fmat4x4; + + typedef mat<2, 2, f32, highp> highp_fmat2x2; + typedef mat<2, 3, f32, highp> highp_fmat2x3; + typedef mat<2, 4, f32, highp> highp_fmat2x4; + typedef mat<3, 2, f32, highp> highp_fmat3x2; + typedef mat<3, 3, f32, highp> highp_fmat3x3; + typedef mat<3, 4, f32, highp> highp_fmat3x4; + typedef mat<4, 2, f32, highp> highp_fmat4x2; + typedef mat<4, 3, f32, highp> highp_fmat4x3; + typedef mat<4, 4, f32, highp> highp_fmat4x4; + + typedef mat<2, 2, f32, defaultp> fmat2x2; + typedef mat<2, 3, f32, defaultp> fmat2x3; + typedef mat<2, 4, f32, defaultp> fmat2x4; + typedef mat<3, 2, f32, defaultp> fmat3x2; + typedef mat<3, 3, f32, defaultp> fmat3x3; + typedef mat<3, 4, f32, defaultp> fmat3x4; + typedef mat<4, 2, f32, defaultp> fmat4x2; + typedef mat<4, 3, f32, defaultp> fmat4x3; + typedef mat<4, 4, f32, defaultp> fmat4x4; + + typedef mat<2, 2, f32, lowp> lowp_f32mat2x2; + typedef mat<2, 3, f32, lowp> lowp_f32mat2x3; + typedef mat<2, 4, f32, lowp> lowp_f32mat2x4; + typedef mat<3, 2, f32, lowp> lowp_f32mat3x2; + typedef mat<3, 3, f32, lowp> lowp_f32mat3x3; + typedef mat<3, 4, f32, lowp> lowp_f32mat3x4; + typedef mat<4, 2, f32, lowp> lowp_f32mat4x2; + typedef mat<4, 3, f32, lowp> lowp_f32mat4x3; + typedef mat<4, 4, f32, lowp> lowp_f32mat4x4; + + typedef mat<2, 2, f32, mediump> mediump_f32mat2x2; + typedef mat<2, 3, f32, mediump> mediump_f32mat2x3; + typedef mat<2, 4, f32, mediump> mediump_f32mat2x4; + typedef mat<3, 2, f32, mediump> mediump_f32mat3x2; + typedef mat<3, 3, f32, mediump> mediump_f32mat3x3; + typedef mat<3, 4, f32, mediump> mediump_f32mat3x4; + typedef mat<4, 2, f32, mediump> mediump_f32mat4x2; + typedef mat<4, 3, f32, mediump> mediump_f32mat4x3; + typedef mat<4, 4, f32, mediump> mediump_f32mat4x4; + + typedef mat<2, 2, f32, highp> highp_f32mat2x2; + typedef mat<2, 3, f32, highp> highp_f32mat2x3; + typedef mat<2, 4, f32, highp> highp_f32mat2x4; + typedef mat<3, 2, f32, highp> highp_f32mat3x2; + typedef mat<3, 3, f32, highp> highp_f32mat3x3; + typedef mat<3, 4, f32, highp> highp_f32mat3x4; + typedef mat<4, 2, f32, highp> highp_f32mat4x2; + typedef mat<4, 3, f32, highp> highp_f32mat4x3; + typedef mat<4, 4, f32, highp> highp_f32mat4x4; + + typedef mat<2, 2, f32, defaultp> f32mat2x2; + typedef mat<2, 3, f32, defaultp> f32mat2x3; + typedef mat<2, 4, f32, defaultp> f32mat2x4; + typedef mat<3, 2, f32, defaultp> f32mat3x2; + typedef mat<3, 3, f32, defaultp> f32mat3x3; + typedef mat<3, 4, f32, defaultp> f32mat3x4; + typedef mat<4, 2, f32, defaultp> f32mat4x2; + typedef mat<4, 3, f32, defaultp> f32mat4x3; + typedef mat<4, 4, f32, defaultp> f32mat4x4; + + typedef mat<2, 2, double, lowp> lowp_dmat2x2; + typedef mat<2, 3, double, lowp> lowp_dmat2x3; + typedef mat<2, 4, double, lowp> lowp_dmat2x4; + typedef mat<3, 2, double, lowp> lowp_dmat3x2; + typedef mat<3, 3, double, lowp> lowp_dmat3x3; + typedef mat<3, 4, double, lowp> lowp_dmat3x4; + typedef mat<4, 2, double, lowp> lowp_dmat4x2; + typedef mat<4, 3, double, lowp> lowp_dmat4x3; + typedef mat<4, 4, double, lowp> lowp_dmat4x4; + + typedef mat<2, 2, double, mediump> mediump_dmat2x2; + typedef mat<2, 3, double, mediump> mediump_dmat2x3; + typedef mat<2, 4, double, mediump> mediump_dmat2x4; + typedef mat<3, 2, double, mediump> mediump_dmat3x2; + typedef mat<3, 3, double, mediump> mediump_dmat3x3; + typedef mat<3, 4, double, mediump> mediump_dmat3x4; + typedef mat<4, 2, double, mediump> mediump_dmat4x2; + typedef mat<4, 3, double, mediump> mediump_dmat4x3; + typedef mat<4, 4, double, mediump> mediump_dmat4x4; + + typedef mat<2, 2, double, highp> highp_dmat2x2; + typedef mat<2, 3, double, highp> highp_dmat2x3; + typedef mat<2, 4, double, highp> highp_dmat2x4; + typedef mat<3, 2, double, highp> highp_dmat3x2; + typedef mat<3, 3, double, highp> highp_dmat3x3; + typedef mat<3, 4, double, highp> highp_dmat3x4; + typedef mat<4, 2, double, highp> highp_dmat4x2; + typedef mat<4, 3, double, highp> highp_dmat4x3; + typedef mat<4, 4, double, highp> highp_dmat4x4; + + typedef mat<2, 2, double, defaultp> dmat2x2; + typedef mat<2, 3, double, defaultp> dmat2x3; + typedef mat<2, 4, double, defaultp> dmat2x4; + typedef mat<3, 2, double, defaultp> dmat3x2; + typedef mat<3, 3, double, defaultp> dmat3x3; + typedef mat<3, 4, double, defaultp> dmat3x4; + typedef mat<4, 2, double, defaultp> dmat4x2; + typedef mat<4, 3, double, defaultp> dmat4x3; + typedef mat<4, 4, double, defaultp> dmat4x4; + + typedef mat<2, 2, f64, lowp> lowp_f64mat2x2; + typedef mat<2, 3, f64, lowp> lowp_f64mat2x3; + typedef mat<2, 4, f64, lowp> lowp_f64mat2x4; + typedef mat<3, 2, f64, lowp> lowp_f64mat3x2; + typedef mat<3, 3, f64, lowp> lowp_f64mat3x3; + typedef mat<3, 4, f64, lowp> lowp_f64mat3x4; + typedef mat<4, 2, f64, lowp> lowp_f64mat4x2; + typedef mat<4, 3, f64, lowp> lowp_f64mat4x3; + typedef mat<4, 4, f64, lowp> lowp_f64mat4x4; + + typedef mat<2, 2, f64, mediump> mediump_f64mat2x2; + typedef mat<2, 3, f64, mediump> mediump_f64mat2x3; + typedef mat<2, 4, f64, mediump> mediump_f64mat2x4; + typedef mat<3, 2, f64, mediump> mediump_f64mat3x2; + typedef mat<3, 3, f64, mediump> mediump_f64mat3x3; + typedef mat<3, 4, f64, mediump> mediump_f64mat3x4; + typedef mat<4, 2, f64, mediump> mediump_f64mat4x2; + typedef mat<4, 3, f64, mediump> mediump_f64mat4x3; + typedef mat<4, 4, f64, mediump> mediump_f64mat4x4; + + typedef mat<2, 2, f64, highp> highp_f64mat2x2; + typedef mat<2, 3, f64, highp> highp_f64mat2x3; + typedef mat<2, 4, f64, highp> highp_f64mat2x4; + typedef mat<3, 2, f64, highp> highp_f64mat3x2; + typedef mat<3, 3, f64, highp> highp_f64mat3x3; + typedef mat<3, 4, f64, highp> highp_f64mat3x4; + typedef mat<4, 2, f64, highp> highp_f64mat4x2; + typedef mat<4, 3, f64, highp> highp_f64mat4x3; + typedef mat<4, 4, f64, highp> highp_f64mat4x4; + + typedef mat<2, 2, f64, defaultp> f64mat2x2; + typedef mat<2, 3, f64, defaultp> f64mat2x3; + typedef mat<2, 4, f64, defaultp> f64mat2x4; + typedef mat<3, 2, f64, defaultp> f64mat3x2; + typedef mat<3, 3, f64, defaultp> f64mat3x3; + typedef mat<3, 4, f64, defaultp> f64mat3x4; + typedef mat<4, 2, f64, defaultp> f64mat4x2; + typedef mat<4, 3, f64, defaultp> f64mat4x3; + typedef mat<4, 4, f64, defaultp> f64mat4x4; + + // Signed integer matrix MxN + + typedef mat<2, 2, int, lowp> lowp_imat2x2; + typedef mat<2, 3, int, lowp> lowp_imat2x3; + typedef mat<2, 4, int, lowp> lowp_imat2x4; + typedef mat<3, 2, int, lowp> lowp_imat3x2; + typedef mat<3, 3, int, lowp> lowp_imat3x3; + typedef mat<3, 4, int, lowp> lowp_imat3x4; + typedef mat<4, 2, int, lowp> lowp_imat4x2; + typedef mat<4, 3, int, lowp> lowp_imat4x3; + typedef mat<4, 4, int, lowp> lowp_imat4x4; + + typedef mat<2, 2, int, mediump> mediump_imat2x2; + typedef mat<2, 3, int, mediump> mediump_imat2x3; + typedef mat<2, 4, int, mediump> mediump_imat2x4; + typedef mat<3, 2, int, mediump> mediump_imat3x2; + typedef mat<3, 3, int, mediump> mediump_imat3x3; + typedef mat<3, 4, int, mediump> mediump_imat3x4; + typedef mat<4, 2, int, mediump> mediump_imat4x2; + typedef mat<4, 3, int, mediump> mediump_imat4x3; + typedef mat<4, 4, int, mediump> mediump_imat4x4; + + typedef mat<2, 2, int, highp> highp_imat2x2; + typedef mat<2, 3, int, highp> highp_imat2x3; + typedef mat<2, 4, int, highp> highp_imat2x4; + typedef mat<3, 2, int, highp> highp_imat3x2; + typedef mat<3, 3, int, highp> highp_imat3x3; + typedef mat<3, 4, int, highp> highp_imat3x4; + typedef mat<4, 2, int, highp> highp_imat4x2; + typedef mat<4, 3, int, highp> highp_imat4x3; + typedef mat<4, 4, int, highp> highp_imat4x4; + + typedef mat<2, 2, int, defaultp> imat2x2; + typedef mat<2, 3, int, defaultp> imat2x3; + typedef mat<2, 4, int, defaultp> imat2x4; + typedef mat<3, 2, int, defaultp> imat3x2; + typedef mat<3, 3, int, defaultp> imat3x3; + typedef mat<3, 4, int, defaultp> imat3x4; + typedef mat<4, 2, int, defaultp> imat4x2; + typedef mat<4, 3, int, defaultp> imat4x3; + typedef mat<4, 4, int, defaultp> imat4x4; + + + typedef mat<2, 2, int8, lowp> lowp_i8mat2x2; + typedef mat<2, 3, int8, lowp> lowp_i8mat2x3; + typedef mat<2, 4, int8, lowp> lowp_i8mat2x4; + typedef mat<3, 2, int8, lowp> lowp_i8mat3x2; + typedef mat<3, 3, int8, lowp> lowp_i8mat3x3; + typedef mat<3, 4, int8, lowp> lowp_i8mat3x4; + typedef mat<4, 2, int8, lowp> lowp_i8mat4x2; + typedef mat<4, 3, int8, lowp> lowp_i8mat4x3; + typedef mat<4, 4, int8, lowp> lowp_i8mat4x4; + + typedef mat<2, 2, int8, mediump> mediump_i8mat2x2; + typedef mat<2, 3, int8, mediump> mediump_i8mat2x3; + typedef mat<2, 4, int8, mediump> mediump_i8mat2x4; + typedef mat<3, 2, int8, mediump> mediump_i8mat3x2; + typedef mat<3, 3, int8, mediump> mediump_i8mat3x3; + typedef mat<3, 4, int8, mediump> mediump_i8mat3x4; + typedef mat<4, 2, int8, mediump> mediump_i8mat4x2; + typedef mat<4, 3, int8, mediump> mediump_i8mat4x3; + typedef mat<4, 4, int8, mediump> mediump_i8mat4x4; + + typedef mat<2, 2, int8, highp> highp_i8mat2x2; + typedef mat<2, 3, int8, highp> highp_i8mat2x3; + typedef mat<2, 4, int8, highp> highp_i8mat2x4; + typedef mat<3, 2, int8, highp> highp_i8mat3x2; + typedef mat<3, 3, int8, highp> highp_i8mat3x3; + typedef mat<3, 4, int8, highp> highp_i8mat3x4; + typedef mat<4, 2, int8, highp> highp_i8mat4x2; + typedef mat<4, 3, int8, highp> highp_i8mat4x3; + typedef mat<4, 4, int8, highp> highp_i8mat4x4; + + typedef mat<2, 2, int8, defaultp> i8mat2x2; + typedef mat<2, 3, int8, defaultp> i8mat2x3; + typedef mat<2, 4, int8, defaultp> i8mat2x4; + typedef mat<3, 2, int8, defaultp> i8mat3x2; + typedef mat<3, 3, int8, defaultp> i8mat3x3; + typedef mat<3, 4, int8, defaultp> i8mat3x4; + typedef mat<4, 2, int8, defaultp> i8mat4x2; + typedef mat<4, 3, int8, defaultp> i8mat4x3; + typedef mat<4, 4, int8, defaultp> i8mat4x4; + + + typedef mat<2, 2, int16, lowp> lowp_i16mat2x2; + typedef mat<2, 3, int16, lowp> lowp_i16mat2x3; + typedef mat<2, 4, int16, lowp> lowp_i16mat2x4; + typedef mat<3, 2, int16, lowp> lowp_i16mat3x2; + typedef mat<3, 3, int16, lowp> lowp_i16mat3x3; + typedef mat<3, 4, int16, lowp> lowp_i16mat3x4; + typedef mat<4, 2, int16, lowp> lowp_i16mat4x2; + typedef mat<4, 3, int16, lowp> lowp_i16mat4x3; + typedef mat<4, 4, int16, lowp> lowp_i16mat4x4; + + typedef mat<2, 2, int16, mediump> mediump_i16mat2x2; + typedef mat<2, 3, int16, mediump> mediump_i16mat2x3; + typedef mat<2, 4, int16, mediump> mediump_i16mat2x4; + typedef mat<3, 2, int16, mediump> mediump_i16mat3x2; + typedef mat<3, 3, int16, mediump> mediump_i16mat3x3; + typedef mat<3, 4, int16, mediump> mediump_i16mat3x4; + typedef mat<4, 2, int16, mediump> mediump_i16mat4x2; + typedef mat<4, 3, int16, mediump> mediump_i16mat4x3; + typedef mat<4, 4, int16, mediump> mediump_i16mat4x4; + + typedef mat<2, 2, int16, highp> highp_i16mat2x2; + typedef mat<2, 3, int16, highp> highp_i16mat2x3; + typedef mat<2, 4, int16, highp> highp_i16mat2x4; + typedef mat<3, 2, int16, highp> highp_i16mat3x2; + typedef mat<3, 3, int16, highp> highp_i16mat3x3; + typedef mat<3, 4, int16, highp> highp_i16mat3x4; + typedef mat<4, 2, int16, highp> highp_i16mat4x2; + typedef mat<4, 3, int16, highp> highp_i16mat4x3; + typedef mat<4, 4, int16, highp> highp_i16mat4x4; + + typedef mat<2, 2, int16, defaultp> i16mat2x2; + typedef mat<2, 3, int16, defaultp> i16mat2x3; + typedef mat<2, 4, int16, defaultp> i16mat2x4; + typedef mat<3, 2, int16, defaultp> i16mat3x2; + typedef mat<3, 3, int16, defaultp> i16mat3x3; + typedef mat<3, 4, int16, defaultp> i16mat3x4; + typedef mat<4, 2, int16, defaultp> i16mat4x2; + typedef mat<4, 3, int16, defaultp> i16mat4x3; + typedef mat<4, 4, int16, defaultp> i16mat4x4; + + + typedef mat<2, 2, int32, lowp> lowp_i32mat2x2; + typedef mat<2, 3, int32, lowp> lowp_i32mat2x3; + typedef mat<2, 4, int32, lowp> lowp_i32mat2x4; + typedef mat<3, 2, int32, lowp> lowp_i32mat3x2; + typedef mat<3, 3, int32, lowp> lowp_i32mat3x3; + typedef mat<3, 4, int32, lowp> lowp_i32mat3x4; + typedef mat<4, 2, int32, lowp> lowp_i32mat4x2; + typedef mat<4, 3, int32, lowp> lowp_i32mat4x3; + typedef mat<4, 4, int32, lowp> lowp_i32mat4x4; + + typedef mat<2, 2, int32, mediump> mediump_i32mat2x2; + typedef mat<2, 3, int32, mediump> mediump_i32mat2x3; + typedef mat<2, 4, int32, mediump> mediump_i32mat2x4; + typedef mat<3, 2, int32, mediump> mediump_i32mat3x2; + typedef mat<3, 3, int32, mediump> mediump_i32mat3x3; + typedef mat<3, 4, int32, mediump> mediump_i32mat3x4; + typedef mat<4, 2, int32, mediump> mediump_i32mat4x2; + typedef mat<4, 3, int32, mediump> mediump_i32mat4x3; + typedef mat<4, 4, int32, mediump> mediump_i32mat4x4; + + typedef mat<2, 2, int32, highp> highp_i32mat2x2; + typedef mat<2, 3, int32, highp> highp_i32mat2x3; + typedef mat<2, 4, int32, highp> highp_i32mat2x4; + typedef mat<3, 2, int32, highp> highp_i32mat3x2; + typedef mat<3, 3, int32, highp> highp_i32mat3x3; + typedef mat<3, 4, int32, highp> highp_i32mat3x4; + typedef mat<4, 2, int32, highp> highp_i32mat4x2; + typedef mat<4, 3, int32, highp> highp_i32mat4x3; + typedef mat<4, 4, int32, highp> highp_i32mat4x4; + + typedef mat<2, 2, int32, defaultp> i32mat2x2; + typedef mat<2, 3, int32, defaultp> i32mat2x3; + typedef mat<2, 4, int32, defaultp> i32mat2x4; + typedef mat<3, 2, int32, defaultp> i32mat3x2; + typedef mat<3, 3, int32, defaultp> i32mat3x3; + typedef mat<3, 4, int32, defaultp> i32mat3x4; + typedef mat<4, 2, int32, defaultp> i32mat4x2; + typedef mat<4, 3, int32, defaultp> i32mat4x3; + typedef mat<4, 4, int32, defaultp> i32mat4x4; + + + typedef mat<2, 2, int64, lowp> lowp_i64mat2x2; + typedef mat<2, 3, int64, lowp> lowp_i64mat2x3; + typedef mat<2, 4, int64, lowp> lowp_i64mat2x4; + typedef mat<3, 2, int64, lowp> lowp_i64mat3x2; + typedef mat<3, 3, int64, lowp> lowp_i64mat3x3; + typedef mat<3, 4, int64, lowp> lowp_i64mat3x4; + typedef mat<4, 2, int64, lowp> lowp_i64mat4x2; + typedef mat<4, 3, int64, lowp> lowp_i64mat4x3; + typedef mat<4, 4, int64, lowp> lowp_i64mat4x4; + + typedef mat<2, 2, int64, mediump> mediump_i64mat2x2; + typedef mat<2, 3, int64, mediump> mediump_i64mat2x3; + typedef mat<2, 4, int64, mediump> mediump_i64mat2x4; + typedef mat<3, 2, int64, mediump> mediump_i64mat3x2; + typedef mat<3, 3, int64, mediump> mediump_i64mat3x3; + typedef mat<3, 4, int64, mediump> mediump_i64mat3x4; + typedef mat<4, 2, int64, mediump> mediump_i64mat4x2; + typedef mat<4, 3, int64, mediump> mediump_i64mat4x3; + typedef mat<4, 4, int64, mediump> mediump_i64mat4x4; + + typedef mat<2, 2, int64, highp> highp_i64mat2x2; + typedef mat<2, 3, int64, highp> highp_i64mat2x3; + typedef mat<2, 4, int64, highp> highp_i64mat2x4; + typedef mat<3, 2, int64, highp> highp_i64mat3x2; + typedef mat<3, 3, int64, highp> highp_i64mat3x3; + typedef mat<3, 4, int64, highp> highp_i64mat3x4; + typedef mat<4, 2, int64, highp> highp_i64mat4x2; + typedef mat<4, 3, int64, highp> highp_i64mat4x3; + typedef mat<4, 4, int64, highp> highp_i64mat4x4; + + typedef mat<2, 2, int64, defaultp> i64mat2x2; + typedef mat<2, 3, int64, defaultp> i64mat2x3; + typedef mat<2, 4, int64, defaultp> i64mat2x4; + typedef mat<3, 2, int64, defaultp> i64mat3x2; + typedef mat<3, 3, int64, defaultp> i64mat3x3; + typedef mat<3, 4, int64, defaultp> i64mat3x4; + typedef mat<4, 2, int64, defaultp> i64mat4x2; + typedef mat<4, 3, int64, defaultp> i64mat4x3; + typedef mat<4, 4, int64, defaultp> i64mat4x4; + + + // Unsigned integer matrix MxN + + typedef mat<2, 2, uint, lowp> lowp_umat2x2; + typedef mat<2, 3, uint, lowp> lowp_umat2x3; + typedef mat<2, 4, uint, lowp> lowp_umat2x4; + typedef mat<3, 2, uint, lowp> lowp_umat3x2; + typedef mat<3, 3, uint, lowp> lowp_umat3x3; + typedef mat<3, 4, uint, lowp> lowp_umat3x4; + typedef mat<4, 2, uint, lowp> lowp_umat4x2; + typedef mat<4, 3, uint, lowp> lowp_umat4x3; + typedef mat<4, 4, uint, lowp> lowp_umat4x4; + + typedef mat<2, 2, uint, mediump> mediump_umat2x2; + typedef mat<2, 3, uint, mediump> mediump_umat2x3; + typedef mat<2, 4, uint, mediump> mediump_umat2x4; + typedef mat<3, 2, uint, mediump> mediump_umat3x2; + typedef mat<3, 3, uint, mediump> mediump_umat3x3; + typedef mat<3, 4, uint, mediump> mediump_umat3x4; + typedef mat<4, 2, uint, mediump> mediump_umat4x2; + typedef mat<4, 3, uint, mediump> mediump_umat4x3; + typedef mat<4, 4, uint, mediump> mediump_umat4x4; + + typedef mat<2, 2, uint, highp> highp_umat2x2; + typedef mat<2, 3, uint, highp> highp_umat2x3; + typedef mat<2, 4, uint, highp> highp_umat2x4; + typedef mat<3, 2, uint, highp> highp_umat3x2; + typedef mat<3, 3, uint, highp> highp_umat3x3; + typedef mat<3, 4, uint, highp> highp_umat3x4; + typedef mat<4, 2, uint, highp> highp_umat4x2; + typedef mat<4, 3, uint, highp> highp_umat4x3; + typedef mat<4, 4, uint, highp> highp_umat4x4; + + typedef mat<2, 2, uint, defaultp> umat2x2; + typedef mat<2, 3, uint, defaultp> umat2x3; + typedef mat<2, 4, uint, defaultp> umat2x4; + typedef mat<3, 2, uint, defaultp> umat3x2; + typedef mat<3, 3, uint, defaultp> umat3x3; + typedef mat<3, 4, uint, defaultp> umat3x4; + typedef mat<4, 2, uint, defaultp> umat4x2; + typedef mat<4, 3, uint, defaultp> umat4x3; + typedef mat<4, 4, uint, defaultp> umat4x4; + + + typedef mat<2, 2, uint8, lowp> lowp_u8mat2x2; + typedef mat<2, 3, uint8, lowp> lowp_u8mat2x3; + typedef mat<2, 4, uint8, lowp> lowp_u8mat2x4; + typedef mat<3, 2, uint8, lowp> lowp_u8mat3x2; + typedef mat<3, 3, uint8, lowp> lowp_u8mat3x3; + typedef mat<3, 4, uint8, lowp> lowp_u8mat3x4; + typedef mat<4, 2, uint8, lowp> lowp_u8mat4x2; + typedef mat<4, 3, uint8, lowp> lowp_u8mat4x3; + typedef mat<4, 4, uint8, lowp> lowp_u8mat4x4; + + typedef mat<2, 2, uint8, mediump> mediump_u8mat2x2; + typedef mat<2, 3, uint8, mediump> mediump_u8mat2x3; + typedef mat<2, 4, uint8, mediump> mediump_u8mat2x4; + typedef mat<3, 2, uint8, mediump> mediump_u8mat3x2; + typedef mat<3, 3, uint8, mediump> mediump_u8mat3x3; + typedef mat<3, 4, uint8, mediump> mediump_u8mat3x4; + typedef mat<4, 2, uint8, mediump> mediump_u8mat4x2; + typedef mat<4, 3, uint8, mediump> mediump_u8mat4x3; + typedef mat<4, 4, uint8, mediump> mediump_u8mat4x4; + + typedef mat<2, 2, uint8, highp> highp_u8mat2x2; + typedef mat<2, 3, uint8, highp> highp_u8mat2x3; + typedef mat<2, 4, uint8, highp> highp_u8mat2x4; + typedef mat<3, 2, uint8, highp> highp_u8mat3x2; + typedef mat<3, 3, uint8, highp> highp_u8mat3x3; + typedef mat<3, 4, uint8, highp> highp_u8mat3x4; + typedef mat<4, 2, uint8, highp> highp_u8mat4x2; + typedef mat<4, 3, uint8, highp> highp_u8mat4x3; + typedef mat<4, 4, uint8, highp> highp_u8mat4x4; + + typedef mat<2, 2, uint8, defaultp> u8mat2x2; + typedef mat<2, 3, uint8, defaultp> u8mat2x3; + typedef mat<2, 4, uint8, defaultp> u8mat2x4; + typedef mat<3, 2, uint8, defaultp> u8mat3x2; + typedef mat<3, 3, uint8, defaultp> u8mat3x3; + typedef mat<3, 4, uint8, defaultp> u8mat3x4; + typedef mat<4, 2, uint8, defaultp> u8mat4x2; + typedef mat<4, 3, uint8, defaultp> u8mat4x3; + typedef mat<4, 4, uint8, defaultp> u8mat4x4; + + + typedef mat<2, 2, uint16, lowp> lowp_u16mat2x2; + typedef mat<2, 3, uint16, lowp> lowp_u16mat2x3; + typedef mat<2, 4, uint16, lowp> lowp_u16mat2x4; + typedef mat<3, 2, uint16, lowp> lowp_u16mat3x2; + typedef mat<3, 3, uint16, lowp> lowp_u16mat3x3; + typedef mat<3, 4, uint16, lowp> lowp_u16mat3x4; + typedef mat<4, 2, uint16, lowp> lowp_u16mat4x2; + typedef mat<4, 3, uint16, lowp> lowp_u16mat4x3; + typedef mat<4, 4, uint16, lowp> lowp_u16mat4x4; + + typedef mat<2, 2, uint16, mediump> mediump_u16mat2x2; + typedef mat<2, 3, uint16, mediump> mediump_u16mat2x3; + typedef mat<2, 4, uint16, mediump> mediump_u16mat2x4; + typedef mat<3, 2, uint16, mediump> mediump_u16mat3x2; + typedef mat<3, 3, uint16, mediump> mediump_u16mat3x3; + typedef mat<3, 4, uint16, mediump> mediump_u16mat3x4; + typedef mat<4, 2, uint16, mediump> mediump_u16mat4x2; + typedef mat<4, 3, uint16, mediump> mediump_u16mat4x3; + typedef mat<4, 4, uint16, mediump> mediump_u16mat4x4; + + typedef mat<2, 2, uint16, highp> highp_u16mat2x2; + typedef mat<2, 3, uint16, highp> highp_u16mat2x3; + typedef mat<2, 4, uint16, highp> highp_u16mat2x4; + typedef mat<3, 2, uint16, highp> highp_u16mat3x2; + typedef mat<3, 3, uint16, highp> highp_u16mat3x3; + typedef mat<3, 4, uint16, highp> highp_u16mat3x4; + typedef mat<4, 2, uint16, highp> highp_u16mat4x2; + typedef mat<4, 3, uint16, highp> highp_u16mat4x3; + typedef mat<4, 4, uint16, highp> highp_u16mat4x4; + + typedef mat<2, 2, uint16, defaultp> u16mat2x2; + typedef mat<2, 3, uint16, defaultp> u16mat2x3; + typedef mat<2, 4, uint16, defaultp> u16mat2x4; + typedef mat<3, 2, uint16, defaultp> u16mat3x2; + typedef mat<3, 3, uint16, defaultp> u16mat3x3; + typedef mat<3, 4, uint16, defaultp> u16mat3x4; + typedef mat<4, 2, uint16, defaultp> u16mat4x2; + typedef mat<4, 3, uint16, defaultp> u16mat4x3; + typedef mat<4, 4, uint16, defaultp> u16mat4x4; + + + typedef mat<2, 2, uint32, lowp> lowp_u32mat2x2; + typedef mat<2, 3, uint32, lowp> lowp_u32mat2x3; + typedef mat<2, 4, uint32, lowp> lowp_u32mat2x4; + typedef mat<3, 2, uint32, lowp> lowp_u32mat3x2; + typedef mat<3, 3, uint32, lowp> lowp_u32mat3x3; + typedef mat<3, 4, uint32, lowp> lowp_u32mat3x4; + typedef mat<4, 2, uint32, lowp> lowp_u32mat4x2; + typedef mat<4, 3, uint32, lowp> lowp_u32mat4x3; + typedef mat<4, 4, uint32, lowp> lowp_u32mat4x4; + + typedef mat<2, 2, uint32, mediump> mediump_u32mat2x2; + typedef mat<2, 3, uint32, mediump> mediump_u32mat2x3; + typedef mat<2, 4, uint32, mediump> mediump_u32mat2x4; + typedef mat<3, 2, uint32, mediump> mediump_u32mat3x2; + typedef mat<3, 3, uint32, mediump> mediump_u32mat3x3; + typedef mat<3, 4, uint32, mediump> mediump_u32mat3x4; + typedef mat<4, 2, uint32, mediump> mediump_u32mat4x2; + typedef mat<4, 3, uint32, mediump> mediump_u32mat4x3; + typedef mat<4, 4, uint32, mediump> mediump_u32mat4x4; + + typedef mat<2, 2, uint32, highp> highp_u32mat2x2; + typedef mat<2, 3, uint32, highp> highp_u32mat2x3; + typedef mat<2, 4, uint32, highp> highp_u32mat2x4; + typedef mat<3, 2, uint32, highp> highp_u32mat3x2; + typedef mat<3, 3, uint32, highp> highp_u32mat3x3; + typedef mat<3, 4, uint32, highp> highp_u32mat3x4; + typedef mat<4, 2, uint32, highp> highp_u32mat4x2; + typedef mat<4, 3, uint32, highp> highp_u32mat4x3; + typedef mat<4, 4, uint32, highp> highp_u32mat4x4; + + typedef mat<2, 2, uint32, defaultp> u32mat2x2; + typedef mat<2, 3, uint32, defaultp> u32mat2x3; + typedef mat<2, 4, uint32, defaultp> u32mat2x4; + typedef mat<3, 2, uint32, defaultp> u32mat3x2; + typedef mat<3, 3, uint32, defaultp> u32mat3x3; + typedef mat<3, 4, uint32, defaultp> u32mat3x4; + typedef mat<4, 2, uint32, defaultp> u32mat4x2; + typedef mat<4, 3, uint32, defaultp> u32mat4x3; + typedef mat<4, 4, uint32, defaultp> u32mat4x4; + + + typedef mat<2, 2, uint64, lowp> lowp_u64mat2x2; + typedef mat<2, 3, uint64, lowp> lowp_u64mat2x3; + typedef mat<2, 4, uint64, lowp> lowp_u64mat2x4; + typedef mat<3, 2, uint64, lowp> lowp_u64mat3x2; + typedef mat<3, 3, uint64, lowp> lowp_u64mat3x3; + typedef mat<3, 4, uint64, lowp> lowp_u64mat3x4; + typedef mat<4, 2, uint64, lowp> lowp_u64mat4x2; + typedef mat<4, 3, uint64, lowp> lowp_u64mat4x3; + typedef mat<4, 4, uint64, lowp> lowp_u64mat4x4; + + typedef mat<2, 2, uint64, mediump> mediump_u64mat2x2; + typedef mat<2, 3, uint64, mediump> mediump_u64mat2x3; + typedef mat<2, 4, uint64, mediump> mediump_u64mat2x4; + typedef mat<3, 2, uint64, mediump> mediump_u64mat3x2; + typedef mat<3, 3, uint64, mediump> mediump_u64mat3x3; + typedef mat<3, 4, uint64, mediump> mediump_u64mat3x4; + typedef mat<4, 2, uint64, mediump> mediump_u64mat4x2; + typedef mat<4, 3, uint64, mediump> mediump_u64mat4x3; + typedef mat<4, 4, uint64, mediump> mediump_u64mat4x4; + + typedef mat<2, 2, uint64, highp> highp_u64mat2x2; + typedef mat<2, 3, uint64, highp> highp_u64mat2x3; + typedef mat<2, 4, uint64, highp> highp_u64mat2x4; + typedef mat<3, 2, uint64, highp> highp_u64mat3x2; + typedef mat<3, 3, uint64, highp> highp_u64mat3x3; + typedef mat<3, 4, uint64, highp> highp_u64mat3x4; + typedef mat<4, 2, uint64, highp> highp_u64mat4x2; + typedef mat<4, 3, uint64, highp> highp_u64mat4x3; + typedef mat<4, 4, uint64, highp> highp_u64mat4x4; + + typedef mat<2, 2, uint64, defaultp> u64mat2x2; + typedef mat<2, 3, uint64, defaultp> u64mat2x3; + typedef mat<2, 4, uint64, defaultp> u64mat2x4; + typedef mat<3, 2, uint64, defaultp> u64mat3x2; + typedef mat<3, 3, uint64, defaultp> u64mat3x3; + typedef mat<3, 4, uint64, defaultp> u64mat3x4; + typedef mat<4, 2, uint64, defaultp> u64mat4x2; + typedef mat<4, 3, uint64, defaultp> u64mat4x3; + typedef mat<4, 4, uint64, defaultp> u64mat4x4; + + // Quaternion + + typedef qua lowp_quat; + typedef qua mediump_quat; + typedef qua highp_quat; + typedef qua quat; + + typedef qua lowp_fquat; + typedef qua mediump_fquat; + typedef qua highp_fquat; + typedef qua fquat; + + typedef qua lowp_f32quat; + typedef qua mediump_f32quat; + typedef qua highp_f32quat; + typedef qua f32quat; + + typedef qua lowp_dquat; + typedef qua mediump_dquat; + typedef qua highp_dquat; + typedef qua dquat; + + typedef qua lowp_f64quat; + typedef qua mediump_f64quat; + typedef qua highp_f64quat; + typedef qua f64quat; +}//namespace glm + + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/geometric.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/geometric.hpp new file mode 100644 index 0000000000000000000000000000000000000000..bd8f000447c3f1eb90d5d733c1508a8565a8b3a4 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/geometric.hpp @@ -0,0 +1,116 @@ +/// @ref core +/// @file glm/geometric.hpp +/// +/// @see GLSL 4.20.8 specification, section 8.5 Geometric Functions +/// +/// @defgroup core_func_geometric Geometric functions +/// @ingroup core +/// +/// These operate on vectors as vectors, not component-wise. +/// +/// Include to use these core features. + +#pragma once + +#include "detail/type_vec3.hpp" + +namespace glm +{ + /// @addtogroup core_func_geometric + /// @{ + + /// Returns the length of x, i.e., sqrt(x * x). + /// + /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. + /// @tparam T Floating-point scalar types. + /// + /// @see GLSL length man page + /// @see GLSL 4.20.8 specification, section 8.5 Geometric Functions + template + GLM_FUNC_DECL T length(vec const& x); + + /// Returns the distance between p0 and p1, i.e., length(p0 - p1). + /// + /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. + /// @tparam T Floating-point scalar types. + /// + /// @see GLSL distance man page + /// @see GLSL 4.20.8 specification, section 8.5 Geometric Functions + template + GLM_FUNC_DECL T distance(vec const& p0, vec const& p1); + + /// Returns the dot product of x and y, i.e., result = x * y. + /// + /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. + /// @tparam T Floating-point scalar types. + /// + /// @see GLSL dot man page + /// @see GLSL 4.20.8 specification, section 8.5 Geometric Functions + template + GLM_FUNC_DECL GLM_CONSTEXPR T dot(vec const& x, vec const& y); + + /// Returns the cross product of x and y. + /// + /// @tparam T Floating-point scalar types. + /// + /// @see GLSL cross man page + /// @see GLSL 4.20.8 specification, section 8.5 Geometric Functions + template + GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> cross(vec<3, T, Q> const& x, vec<3, T, Q> const& y); + + /// Returns a vector in the same direction as x but with length of 1. + /// According to issue 10 GLSL 1.10 specification, if length(x) == 0 then result is undefined and generate an error. + /// + /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. + /// @tparam T Floating-point scalar types. + /// + /// @see GLSL normalize man page + /// @see GLSL 4.20.8 specification, section 8.5 Geometric Functions + template + GLM_FUNC_DECL vec normalize(vec const& x); + + /// If dot(Nref, I) < 0.0, return N, otherwise, return -N. + /// + /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. + /// @tparam T Floating-point scalar types. + /// + /// @see GLSL faceforward man page + /// @see GLSL 4.20.8 specification, section 8.5 Geometric Functions + template + GLM_FUNC_DECL vec faceforward( + vec const& N, + vec const& I, + vec const& Nref); + + /// For the incident vector I and surface orientation N, + /// returns the reflection direction : result = I - 2.0 * dot(N, I) * N. + /// + /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. + /// @tparam T Floating-point scalar types. + /// + /// @see GLSL reflect man page + /// @see GLSL 4.20.8 specification, section 8.5 Geometric Functions + template + GLM_FUNC_DECL vec reflect( + vec const& I, + vec const& N); + + /// For the incident vector I and surface normal N, + /// and the ratio of indices of refraction eta, + /// return the refraction vector. + /// + /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. + /// @tparam T Floating-point scalar types. + /// + /// @see GLSL refract man page + /// @see GLSL 4.20.8 specification, section 8.5 Geometric Functions + template + GLM_FUNC_DECL vec refract( + vec const& I, + vec const& N, + T eta); + + /// @} +}//namespace glm + +#include "detail/func_geometric.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/glm.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/glm.hpp new file mode 100644 index 0000000000000000000000000000000000000000..a217bd85bc4df243e31f0677242088f4c8bf2911 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/glm.hpp @@ -0,0 +1,137 @@ +/// @ref core +/// @file glm/glm.hpp +/// +/// @mainpage OpenGL Mathematics (GLM) +/// - Website: glm.g-truc.net +/// - GLM API documentation +/// - GLM Manual +/// +/// @defgroup core Core features +/// +/// @brief Features that implement in C++ the GLSL specification as closely as possible. +/// +/// The GLM core consists of C++ types that mirror GLSL types and +/// C++ functions that mirror the GLSL functions. +/// +/// The best documentation for GLM Core is the current GLSL specification, +/// version 4.2 +/// (pdf file). +/// +/// GLM core functionalities require to be included to be used. +/// +/// +/// @defgroup core_vector Vector types +/// +/// Vector types of two to four components with an exhaustive set of operators. +/// +/// @ingroup core +/// +/// +/// @defgroup core_vector_precision Vector types with precision qualifiers +/// +/// @brief Vector types with precision qualifiers which may result in various precision in term of ULPs +/// +/// GLSL allows defining qualifiers for particular variables. +/// With OpenGL's GLSL, these qualifiers have no effect; they are there for compatibility, +/// with OpenGL ES's GLSL, these qualifiers do have an effect. +/// +/// C++ has no language equivalent to qualifier qualifiers. So GLM provides the next-best thing: +/// a number of typedefs that use a particular qualifier. +/// +/// None of these types make any guarantees about the actual qualifier used. +/// +/// @ingroup core +/// +/// +/// @defgroup core_matrix Matrix types +/// +/// Matrix types of with C columns and R rows where C and R are values between 2 to 4 included. +/// These types have exhaustive sets of operators. +/// +/// @ingroup core +/// +/// +/// @defgroup core_matrix_precision Matrix types with precision qualifiers +/// +/// @brief Matrix types with precision qualifiers which may result in various precision in term of ULPs +/// +/// GLSL allows defining qualifiers for particular variables. +/// With OpenGL's GLSL, these qualifiers have no effect; they are there for compatibility, +/// with OpenGL ES's GLSL, these qualifiers do have an effect. +/// +/// C++ has no language equivalent to qualifier qualifiers. So GLM provides the next-best thing: +/// a number of typedefs that use a particular qualifier. +/// +/// None of these types make any guarantees about the actual qualifier used. +/// +/// @ingroup core +/// +/// +/// @defgroup ext Stable extensions +/// +/// @brief Additional features not specified by GLSL specification. +/// +/// EXT extensions are fully tested and documented. +/// +/// Even if it's highly unrecommended, it's possible to include all the extensions at once by +/// including . Otherwise, each extension needs to be included a specific file. +/// +/// +/// @defgroup gtc Recommended extensions +/// +/// @brief Additional features not specified by GLSL specification. +/// +/// GTC extensions aim to be stable with tests and documentation. +/// +/// Even if it's highly unrecommended, it's possible to include all the extensions at once by +/// including . Otherwise, each extension needs to be included a specific file. +/// +/// +/// @defgroup gtx Experimental extensions +/// +/// @brief Experimental features not specified by GLSL specification. +/// +/// Experimental extensions are useful functions and types, but the development of +/// their API and functionality is not necessarily stable. They can change +/// substantially between versions. Backwards compatibility is not much of an issue +/// for them. +/// +/// Even if it's highly unrecommended, it's possible to include all the extensions +/// at once by including . Otherwise, each extension needs to be +/// included a specific file. +/// + +#include "detail/_fixes.hpp" + +#include "detail/setup.hpp" + +#pragma once + +#include +#include +#include +#include +#include +#include "fwd.hpp" + +#include "vec2.hpp" +#include "vec3.hpp" +#include "vec4.hpp" +#include "mat2x2.hpp" +#include "mat2x3.hpp" +#include "mat2x4.hpp" +#include "mat3x2.hpp" +#include "mat3x3.hpp" +#include "mat3x4.hpp" +#include "mat4x2.hpp" +#include "mat4x3.hpp" +#include "mat4x4.hpp" + +#include "trigonometric.hpp" +#include "exponential.hpp" +#include "common.hpp" +#include "packing.hpp" +#include "geometric.hpp" +#include "matrix.hpp" +#include "vector_relational.hpp" +#include "integer.hpp" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/bitfield.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/bitfield.hpp new file mode 100644 index 0000000000000000000000000000000000000000..d6548b374f1931a22e0dd1e56f1fd97147468743 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/bitfield.hpp @@ -0,0 +1,266 @@ +/// @ref gtc_bitfield +/// @file glm/gtc/bitfield.hpp +/// +/// @see core (dependence) +/// @see gtc_bitfield (dependence) +/// +/// @defgroup gtc_bitfield GLM_GTC_bitfield +/// @ingroup gtc +/// +/// Include to use the features of this extension. +/// +/// Allow to perform bit operations on integer values + +#include "../detail/setup.hpp" + +#pragma once + +// Dependencies +#include "../ext/scalar_int_sized.hpp" +#include "../ext/scalar_uint_sized.hpp" +#include "../detail/qualifier.hpp" +#include "../detail/_vectorize.hpp" +#include "type_precision.hpp" +#include + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_GTC_bitfield extension included") +#endif + +namespace glm +{ + /// @addtogroup gtc_bitfield + /// @{ + + /// Build a mask of 'count' bits + /// + /// @see gtc_bitfield + template + GLM_FUNC_DECL genIUType mask(genIUType Bits); + + /// Build a mask of 'count' bits + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Signed and unsigned integer scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see gtc_bitfield + template + GLM_FUNC_DECL vec mask(vec const& v); + + /// Rotate all bits to the right. All the bits dropped in the right side are inserted back on the left side. + /// + /// @see gtc_bitfield + template + GLM_FUNC_DECL genIUType bitfieldRotateRight(genIUType In, int Shift); + + /// Rotate all bits to the right. All the bits dropped in the right side are inserted back on the left side. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Signed and unsigned integer scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see gtc_bitfield + template + GLM_FUNC_DECL vec bitfieldRotateRight(vec const& In, int Shift); + + /// Rotate all bits to the left. All the bits dropped in the left side are inserted back on the right side. + /// + /// @see gtc_bitfield + template + GLM_FUNC_DECL genIUType bitfieldRotateLeft(genIUType In, int Shift); + + /// Rotate all bits to the left. All the bits dropped in the left side are inserted back on the right side. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Signed and unsigned integer scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see gtc_bitfield + template + GLM_FUNC_DECL vec bitfieldRotateLeft(vec const& In, int Shift); + + /// Set to 1 a range of bits. + /// + /// @see gtc_bitfield + template + GLM_FUNC_DECL genIUType bitfieldFillOne(genIUType Value, int FirstBit, int BitCount); + + /// Set to 1 a range of bits. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Signed and unsigned integer scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see gtc_bitfield + template + GLM_FUNC_DECL vec bitfieldFillOne(vec const& Value, int FirstBit, int BitCount); + + /// Set to 0 a range of bits. + /// + /// @see gtc_bitfield + template + GLM_FUNC_DECL genIUType bitfieldFillZero(genIUType Value, int FirstBit, int BitCount); + + /// Set to 0 a range of bits. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Signed and unsigned integer scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see gtc_bitfield + template + GLM_FUNC_DECL vec bitfieldFillZero(vec const& Value, int FirstBit, int BitCount); + + /// Interleaves the bits of x and y. + /// The first bit is the first bit of x followed by the first bit of y. + /// The other bits are interleaved following the previous sequence. + /// + /// @see gtc_bitfield + GLM_FUNC_DECL int16 bitfieldInterleave(int8 x, int8 y); + + /// Interleaves the bits of x and y. + /// The first bit is the first bit of x followed by the first bit of y. + /// The other bits are interleaved following the previous sequence. + /// + /// @see gtc_bitfield + GLM_FUNC_DECL uint16 bitfieldInterleave(uint8 x, uint8 y); + + /// Interleaves the bits of x and y. + /// The first bit is the first bit of v.x followed by the first bit of v.y. + /// The other bits are interleaved following the previous sequence. + /// + /// @see gtc_bitfield + GLM_FUNC_DECL uint16 bitfieldInterleave(u8vec2 const& v); + + /// Deinterleaves the bits of x. + /// + /// @see gtc_bitfield + GLM_FUNC_DECL glm::u8vec2 bitfieldDeinterleave(glm::uint16 x); + + /// Interleaves the bits of x and y. + /// The first bit is the first bit of x followed by the first bit of y. + /// The other bits are interleaved following the previous sequence. + /// + /// @see gtc_bitfield + GLM_FUNC_DECL int32 bitfieldInterleave(int16 x, int16 y); + + /// Interleaves the bits of x and y. + /// The first bit is the first bit of x followed by the first bit of y. + /// The other bits are interleaved following the previous sequence. + /// + /// @see gtc_bitfield + GLM_FUNC_DECL uint32 bitfieldInterleave(uint16 x, uint16 y); + + /// Interleaves the bits of x and y. + /// The first bit is the first bit of v.x followed by the first bit of v.y. + /// The other bits are interleaved following the previous sequence. + /// + /// @see gtc_bitfield + GLM_FUNC_DECL uint32 bitfieldInterleave(u16vec2 const& v); + + /// Deinterleaves the bits of x. + /// + /// @see gtc_bitfield + GLM_FUNC_DECL glm::u16vec2 bitfieldDeinterleave(glm::uint32 x); + + /// Interleaves the bits of x and y. + /// The first bit is the first bit of x followed by the first bit of y. + /// The other bits are interleaved following the previous sequence. + /// + /// @see gtc_bitfield + GLM_FUNC_DECL int64 bitfieldInterleave(int32 x, int32 y); + + /// Interleaves the bits of x and y. + /// The first bit is the first bit of x followed by the first bit of y. + /// The other bits are interleaved following the previous sequence. + /// + /// @see gtc_bitfield + GLM_FUNC_DECL uint64 bitfieldInterleave(uint32 x, uint32 y); + + /// Interleaves the bits of x and y. + /// The first bit is the first bit of v.x followed by the first bit of v.y. + /// The other bits are interleaved following the previous sequence. + /// + /// @see gtc_bitfield + GLM_FUNC_DECL uint64 bitfieldInterleave(u32vec2 const& v); + + /// Deinterleaves the bits of x. + /// + /// @see gtc_bitfield + GLM_FUNC_DECL glm::u32vec2 bitfieldDeinterleave(glm::uint64 x); + + /// Interleaves the bits of x, y and z. + /// The first bit is the first bit of x followed by the first bit of y and the first bit of z. + /// The other bits are interleaved following the previous sequence. + /// + /// @see gtc_bitfield + GLM_FUNC_DECL int32 bitfieldInterleave(int8 x, int8 y, int8 z); + + /// Interleaves the bits of x, y and z. + /// The first bit is the first bit of x followed by the first bit of y and the first bit of z. + /// The other bits are interleaved following the previous sequence. + /// + /// @see gtc_bitfield + GLM_FUNC_DECL uint32 bitfieldInterleave(uint8 x, uint8 y, uint8 z); + + /// Interleaves the bits of x, y and z. + /// The first bit is the first bit of x followed by the first bit of y and the first bit of z. + /// The other bits are interleaved following the previous sequence. + /// + /// @see gtc_bitfield + GLM_FUNC_DECL int64 bitfieldInterleave(int16 x, int16 y, int16 z); + + /// Interleaves the bits of x, y and z. + /// The first bit is the first bit of x followed by the first bit of y and the first bit of z. + /// The other bits are interleaved following the previous sequence. + /// + /// @see gtc_bitfield + GLM_FUNC_DECL uint64 bitfieldInterleave(uint16 x, uint16 y, uint16 z); + + /// Interleaves the bits of x, y and z. + /// The first bit is the first bit of x followed by the first bit of y and the first bit of z. + /// The other bits are interleaved following the previous sequence. + /// + /// @see gtc_bitfield + GLM_FUNC_DECL int64 bitfieldInterleave(int32 x, int32 y, int32 z); + + /// Interleaves the bits of x, y and z. + /// The first bit is the first bit of x followed by the first bit of y and the first bit of z. + /// The other bits are interleaved following the previous sequence. + /// + /// @see gtc_bitfield + GLM_FUNC_DECL uint64 bitfieldInterleave(uint32 x, uint32 y, uint32 z); + + /// Interleaves the bits of x, y, z and w. + /// The first bit is the first bit of x followed by the first bit of y, the first bit of z and finally the first bit of w. + /// The other bits are interleaved following the previous sequence. + /// + /// @see gtc_bitfield + GLM_FUNC_DECL int32 bitfieldInterleave(int8 x, int8 y, int8 z, int8 w); + + /// Interleaves the bits of x, y, z and w. + /// The first bit is the first bit of x followed by the first bit of y, the first bit of z and finally the first bit of w. + /// The other bits are interleaved following the previous sequence. + /// + /// @see gtc_bitfield + GLM_FUNC_DECL uint32 bitfieldInterleave(uint8 x, uint8 y, uint8 z, uint8 w); + + /// Interleaves the bits of x, y, z and w. + /// The first bit is the first bit of x followed by the first bit of y, the first bit of z and finally the first bit of w. + /// The other bits are interleaved following the previous sequence. + /// + /// @see gtc_bitfield + GLM_FUNC_DECL int64 bitfieldInterleave(int16 x, int16 y, int16 z, int16 w); + + /// Interleaves the bits of x, y, z and w. + /// The first bit is the first bit of x followed by the first bit of y, the first bit of z and finally the first bit of w. + /// The other bits are interleaved following the previous sequence. + /// + /// @see gtc_bitfield + GLM_FUNC_DECL uint64 bitfieldInterleave(uint16 x, uint16 y, uint16 z, uint16 w); + + /// @} +} //namespace glm + +#include "bitfield.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/bitfield.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/bitfield.inl new file mode 100644 index 0000000000000000000000000000000000000000..1ac6f87c92432ddf8654859f15c7dcaef246c6c7 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/bitfield.inl @@ -0,0 +1,626 @@ +/// @ref gtc_bitfield + +#include "../simd/integer.h" + +namespace glm{ +namespace detail +{ + template + GLM_FUNC_DECL RET bitfieldInterleave(PARAM x, PARAM y); + + template + GLM_FUNC_DECL RET bitfieldInterleave(PARAM x, PARAM y, PARAM z); + + template + GLM_FUNC_DECL RET bitfieldInterleave(PARAM x, PARAM y, PARAM z, PARAM w); + + template<> + GLM_FUNC_QUALIFIER glm::uint16 bitfieldInterleave(glm::uint8 x, glm::uint8 y) + { + glm::uint16 REG1(x); + glm::uint16 REG2(y); + + REG1 = ((REG1 << 4) | REG1) & static_cast(0x0F0F); + REG2 = ((REG2 << 4) | REG2) & static_cast(0x0F0F); + + REG1 = ((REG1 << 2) | REG1) & static_cast(0x3333); + REG2 = ((REG2 << 2) | REG2) & static_cast(0x3333); + + REG1 = ((REG1 << 1) | REG1) & static_cast(0x5555); + REG2 = ((REG2 << 1) | REG2) & static_cast(0x5555); + + return REG1 | static_cast(REG2 << 1); + } + + template<> + GLM_FUNC_QUALIFIER glm::uint32 bitfieldInterleave(glm::uint16 x, glm::uint16 y) + { + glm::uint32 REG1(x); + glm::uint32 REG2(y); + + REG1 = ((REG1 << 8) | REG1) & static_cast(0x00FF00FF); + REG2 = ((REG2 << 8) | REG2) & static_cast(0x00FF00FF); + + REG1 = ((REG1 << 4) | REG1) & static_cast(0x0F0F0F0F); + REG2 = ((REG2 << 4) | REG2) & static_cast(0x0F0F0F0F); + + REG1 = ((REG1 << 2) | REG1) & static_cast(0x33333333); + REG2 = ((REG2 << 2) | REG2) & static_cast(0x33333333); + + REG1 = ((REG1 << 1) | REG1) & static_cast(0x55555555); + REG2 = ((REG2 << 1) | REG2) & static_cast(0x55555555); + + return REG1 | (REG2 << 1); + } + + template<> + GLM_FUNC_QUALIFIER glm::uint64 bitfieldInterleave(glm::uint32 x, glm::uint32 y) + { + glm::uint64 REG1(x); + glm::uint64 REG2(y); + + REG1 = ((REG1 << 16) | REG1) & static_cast(0x0000FFFF0000FFFFull); + REG2 = ((REG2 << 16) | REG2) & static_cast(0x0000FFFF0000FFFFull); + + REG1 = ((REG1 << 8) | REG1) & static_cast(0x00FF00FF00FF00FFull); + REG2 = ((REG2 << 8) | REG2) & static_cast(0x00FF00FF00FF00FFull); + + REG1 = ((REG1 << 4) | REG1) & static_cast(0x0F0F0F0F0F0F0F0Full); + REG2 = ((REG2 << 4) | REG2) & static_cast(0x0F0F0F0F0F0F0F0Full); + + REG1 = ((REG1 << 2) | REG1) & static_cast(0x3333333333333333ull); + REG2 = ((REG2 << 2) | REG2) & static_cast(0x3333333333333333ull); + + REG1 = ((REG1 << 1) | REG1) & static_cast(0x5555555555555555ull); + REG2 = ((REG2 << 1) | REG2) & static_cast(0x5555555555555555ull); + + return REG1 | (REG2 << 1); + } + + template<> + GLM_FUNC_QUALIFIER glm::uint32 bitfieldInterleave(glm::uint8 x, glm::uint8 y, glm::uint8 z) + { + glm::uint32 REG1(x); + glm::uint32 REG2(y); + glm::uint32 REG3(z); + + REG1 = ((REG1 << 16) | REG1) & static_cast(0xFF0000FFu); + REG2 = ((REG2 << 16) | REG2) & static_cast(0xFF0000FFu); + REG3 = ((REG3 << 16) | REG3) & static_cast(0xFF0000FFu); + + REG1 = ((REG1 << 8) | REG1) & static_cast(0x0F00F00Fu); + REG2 = ((REG2 << 8) | REG2) & static_cast(0x0F00F00Fu); + REG3 = ((REG3 << 8) | REG3) & static_cast(0x0F00F00Fu); + + REG1 = ((REG1 << 4) | REG1) & static_cast(0xC30C30C3u); + REG2 = ((REG2 << 4) | REG2) & static_cast(0xC30C30C3u); + REG3 = ((REG3 << 4) | REG3) & static_cast(0xC30C30C3u); + + REG1 = ((REG1 << 2) | REG1) & static_cast(0x49249249u); + REG2 = ((REG2 << 2) | REG2) & static_cast(0x49249249u); + REG3 = ((REG3 << 2) | REG3) & static_cast(0x49249249u); + + return REG1 | (REG2 << 1) | (REG3 << 2); + } + + template<> + GLM_FUNC_QUALIFIER glm::uint64 bitfieldInterleave(glm::uint16 x, glm::uint16 y, glm::uint16 z) + { + glm::uint64 REG1(x); + glm::uint64 REG2(y); + glm::uint64 REG3(z); + + REG1 = ((REG1 << 32) | REG1) & static_cast(0xFFFF00000000FFFFull); + REG2 = ((REG2 << 32) | REG2) & static_cast(0xFFFF00000000FFFFull); + REG3 = ((REG3 << 32) | REG3) & static_cast(0xFFFF00000000FFFFull); + + REG1 = ((REG1 << 16) | REG1) & static_cast(0x00FF0000FF0000FFull); + REG2 = ((REG2 << 16) | REG2) & static_cast(0x00FF0000FF0000FFull); + REG3 = ((REG3 << 16) | REG3) & static_cast(0x00FF0000FF0000FFull); + + REG1 = ((REG1 << 8) | REG1) & static_cast(0xF00F00F00F00F00Full); + REG2 = ((REG2 << 8) | REG2) & static_cast(0xF00F00F00F00F00Full); + REG3 = ((REG3 << 8) | REG3) & static_cast(0xF00F00F00F00F00Full); + + REG1 = ((REG1 << 4) | REG1) & static_cast(0x30C30C30C30C30C3ull); + REG2 = ((REG2 << 4) | REG2) & static_cast(0x30C30C30C30C30C3ull); + REG3 = ((REG3 << 4) | REG3) & static_cast(0x30C30C30C30C30C3ull); + + REG1 = ((REG1 << 2) | REG1) & static_cast(0x9249249249249249ull); + REG2 = ((REG2 << 2) | REG2) & static_cast(0x9249249249249249ull); + REG3 = ((REG3 << 2) | REG3) & static_cast(0x9249249249249249ull); + + return REG1 | (REG2 << 1) | (REG3 << 2); + } + + template<> + GLM_FUNC_QUALIFIER glm::uint64 bitfieldInterleave(glm::uint32 x, glm::uint32 y, glm::uint32 z) + { + glm::uint64 REG1(x); + glm::uint64 REG2(y); + glm::uint64 REG3(z); + + REG1 = ((REG1 << 32) | REG1) & static_cast(0xFFFF00000000FFFFull); + REG2 = ((REG2 << 32) | REG2) & static_cast(0xFFFF00000000FFFFull); + REG3 = ((REG3 << 32) | REG3) & static_cast(0xFFFF00000000FFFFull); + + REG1 = ((REG1 << 16) | REG1) & static_cast(0x00FF0000FF0000FFull); + REG2 = ((REG2 << 16) | REG2) & static_cast(0x00FF0000FF0000FFull); + REG3 = ((REG3 << 16) | REG3) & static_cast(0x00FF0000FF0000FFull); + + REG1 = ((REG1 << 8) | REG1) & static_cast(0xF00F00F00F00F00Full); + REG2 = ((REG2 << 8) | REG2) & static_cast(0xF00F00F00F00F00Full); + REG3 = ((REG3 << 8) | REG3) & static_cast(0xF00F00F00F00F00Full); + + REG1 = ((REG1 << 4) | REG1) & static_cast(0x30C30C30C30C30C3ull); + REG2 = ((REG2 << 4) | REG2) & static_cast(0x30C30C30C30C30C3ull); + REG3 = ((REG3 << 4) | REG3) & static_cast(0x30C30C30C30C30C3ull); + + REG1 = ((REG1 << 2) | REG1) & static_cast(0x9249249249249249ull); + REG2 = ((REG2 << 2) | REG2) & static_cast(0x9249249249249249ull); + REG3 = ((REG3 << 2) | REG3) & static_cast(0x9249249249249249ull); + + return REG1 | (REG2 << 1) | (REG3 << 2); + } + + template<> + GLM_FUNC_QUALIFIER glm::uint32 bitfieldInterleave(glm::uint8 x, glm::uint8 y, glm::uint8 z, glm::uint8 w) + { + glm::uint32 REG1(x); + glm::uint32 REG2(y); + glm::uint32 REG3(z); + glm::uint32 REG4(w); + + REG1 = ((REG1 << 12) | REG1) & static_cast(0x000F000Fu); + REG2 = ((REG2 << 12) | REG2) & static_cast(0x000F000Fu); + REG3 = ((REG3 << 12) | REG3) & static_cast(0x000F000Fu); + REG4 = ((REG4 << 12) | REG4) & static_cast(0x000F000Fu); + + REG1 = ((REG1 << 6) | REG1) & static_cast(0x03030303u); + REG2 = ((REG2 << 6) | REG2) & static_cast(0x03030303u); + REG3 = ((REG3 << 6) | REG3) & static_cast(0x03030303u); + REG4 = ((REG4 << 6) | REG4) & static_cast(0x03030303u); + + REG1 = ((REG1 << 3) | REG1) & static_cast(0x11111111u); + REG2 = ((REG2 << 3) | REG2) & static_cast(0x11111111u); + REG3 = ((REG3 << 3) | REG3) & static_cast(0x11111111u); + REG4 = ((REG4 << 3) | REG4) & static_cast(0x11111111u); + + return REG1 | (REG2 << 1) | (REG3 << 2) | (REG4 << 3); + } + + template<> + GLM_FUNC_QUALIFIER glm::uint64 bitfieldInterleave(glm::uint16 x, glm::uint16 y, glm::uint16 z, glm::uint16 w) + { + glm::uint64 REG1(x); + glm::uint64 REG2(y); + glm::uint64 REG3(z); + glm::uint64 REG4(w); + + REG1 = ((REG1 << 24) | REG1) & static_cast(0x000000FF000000FFull); + REG2 = ((REG2 << 24) | REG2) & static_cast(0x000000FF000000FFull); + REG3 = ((REG3 << 24) | REG3) & static_cast(0x000000FF000000FFull); + REG4 = ((REG4 << 24) | REG4) & static_cast(0x000000FF000000FFull); + + REG1 = ((REG1 << 12) | REG1) & static_cast(0x000F000F000F000Full); + REG2 = ((REG2 << 12) | REG2) & static_cast(0x000F000F000F000Full); + REG3 = ((REG3 << 12) | REG3) & static_cast(0x000F000F000F000Full); + REG4 = ((REG4 << 12) | REG4) & static_cast(0x000F000F000F000Full); + + REG1 = ((REG1 << 6) | REG1) & static_cast(0x0303030303030303ull); + REG2 = ((REG2 << 6) | REG2) & static_cast(0x0303030303030303ull); + REG3 = ((REG3 << 6) | REG3) & static_cast(0x0303030303030303ull); + REG4 = ((REG4 << 6) | REG4) & static_cast(0x0303030303030303ull); + + REG1 = ((REG1 << 3) | REG1) & static_cast(0x1111111111111111ull); + REG2 = ((REG2 << 3) | REG2) & static_cast(0x1111111111111111ull); + REG3 = ((REG3 << 3) | REG3) & static_cast(0x1111111111111111ull); + REG4 = ((REG4 << 3) | REG4) & static_cast(0x1111111111111111ull); + + return REG1 | (REG2 << 1) | (REG3 << 2) | (REG4 << 3); + } +}//namespace detail + + template + GLM_FUNC_QUALIFIER genIUType mask(genIUType Bits) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'mask' accepts only integer values"); + + return Bits >= sizeof(genIUType) * 8 ? ~static_cast(0) : (static_cast(1) << Bits) - static_cast(1); + } + + template + GLM_FUNC_QUALIFIER vec mask(vec const& v) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'mask' accepts only integer values"); + + return detail::functor1::call(mask, v); + } + + template + GLM_FUNC_QUALIFIER genIType bitfieldRotateRight(genIType In, int Shift) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'bitfieldRotateRight' accepts only integer values"); + + int const BitSize = static_cast(sizeof(genIType) * 8); + return (In << static_cast(Shift)) | (In >> static_cast(BitSize - Shift)); + } + + template + GLM_FUNC_QUALIFIER vec bitfieldRotateRight(vec const& In, int Shift) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'bitfieldRotateRight' accepts only integer values"); + + int const BitSize = static_cast(sizeof(T) * 8); + return (In << static_cast(Shift)) | (In >> static_cast(BitSize - Shift)); + } + + template + GLM_FUNC_QUALIFIER genIType bitfieldRotateLeft(genIType In, int Shift) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'bitfieldRotateLeft' accepts only integer values"); + + int const BitSize = static_cast(sizeof(genIType) * 8); + return (In >> static_cast(Shift)) | (In << static_cast(BitSize - Shift)); + } + + template + GLM_FUNC_QUALIFIER vec bitfieldRotateLeft(vec const& In, int Shift) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'bitfieldRotateLeft' accepts only integer values"); + + int const BitSize = static_cast(sizeof(T) * 8); + return (In >> static_cast(Shift)) | (In << static_cast(BitSize - Shift)); + } + + template + GLM_FUNC_QUALIFIER genIUType bitfieldFillOne(genIUType Value, int FirstBit, int BitCount) + { + return Value | static_cast(mask(BitCount) << FirstBit); + } + + template + GLM_FUNC_QUALIFIER vec bitfieldFillOne(vec const& Value, int FirstBit, int BitCount) + { + return Value | static_cast(mask(BitCount) << FirstBit); + } + + template + GLM_FUNC_QUALIFIER genIUType bitfieldFillZero(genIUType Value, int FirstBit, int BitCount) + { + return Value & static_cast(~(mask(BitCount) << FirstBit)); + } + + template + GLM_FUNC_QUALIFIER vec bitfieldFillZero(vec const& Value, int FirstBit, int BitCount) + { + return Value & static_cast(~(mask(BitCount) << FirstBit)); + } + + GLM_FUNC_QUALIFIER int16 bitfieldInterleave(int8 x, int8 y) + { + union sign8 + { + int8 i; + uint8 u; + } sign_x, sign_y; + + union sign16 + { + int16 i; + uint16 u; + } result; + + sign_x.i = x; + sign_y.i = y; + result.u = bitfieldInterleave(sign_x.u, sign_y.u); + + return result.i; + } + + GLM_FUNC_QUALIFIER uint16 bitfieldInterleave(uint8 x, uint8 y) + { + return detail::bitfieldInterleave(x, y); + } + + GLM_FUNC_QUALIFIER uint16 bitfieldInterleave(u8vec2 const& v) + { + return detail::bitfieldInterleave(v.x, v.y); + } + + GLM_FUNC_QUALIFIER u8vec2 bitfieldDeinterleave(glm::uint16 x) + { + uint16 REG1(x); + uint16 REG2(x >>= 1); + + REG1 = REG1 & static_cast(0x5555); + REG2 = REG2 & static_cast(0x5555); + + REG1 = ((REG1 >> 1) | REG1) & static_cast(0x3333); + REG2 = ((REG2 >> 1) | REG2) & static_cast(0x3333); + + REG1 = ((REG1 >> 2) | REG1) & static_cast(0x0F0F); + REG2 = ((REG2 >> 2) | REG2) & static_cast(0x0F0F); + + REG1 = ((REG1 >> 4) | REG1) & static_cast(0x00FF); + REG2 = ((REG2 >> 4) | REG2) & static_cast(0x00FF); + + REG1 = ((REG1 >> 8) | REG1) & static_cast(0xFFFF); + REG2 = ((REG2 >> 8) | REG2) & static_cast(0xFFFF); + + return glm::u8vec2(REG1, REG2); + } + + GLM_FUNC_QUALIFIER int32 bitfieldInterleave(int16 x, int16 y) + { + union sign16 + { + int16 i; + uint16 u; + } sign_x, sign_y; + + union sign32 + { + int32 i; + uint32 u; + } result; + + sign_x.i = x; + sign_y.i = y; + result.u = bitfieldInterleave(sign_x.u, sign_y.u); + + return result.i; + } + + GLM_FUNC_QUALIFIER uint32 bitfieldInterleave(uint16 x, uint16 y) + { + return detail::bitfieldInterleave(x, y); + } + + GLM_FUNC_QUALIFIER glm::uint32 bitfieldInterleave(u16vec2 const& v) + { + return detail::bitfieldInterleave(v.x, v.y); + } + + GLM_FUNC_QUALIFIER glm::u16vec2 bitfieldDeinterleave(glm::uint32 x) + { + glm::uint32 REG1(x); + glm::uint32 REG2(x >>= 1); + + REG1 = REG1 & static_cast(0x55555555); + REG2 = REG2 & static_cast(0x55555555); + + REG1 = ((REG1 >> 1) | REG1) & static_cast(0x33333333); + REG2 = ((REG2 >> 1) | REG2) & static_cast(0x33333333); + + REG1 = ((REG1 >> 2) | REG1) & static_cast(0x0F0F0F0F); + REG2 = ((REG2 >> 2) | REG2) & static_cast(0x0F0F0F0F); + + REG1 = ((REG1 >> 4) | REG1) & static_cast(0x00FF00FF); + REG2 = ((REG2 >> 4) | REG2) & static_cast(0x00FF00FF); + + REG1 = ((REG1 >> 8) | REG1) & static_cast(0x0000FFFF); + REG2 = ((REG2 >> 8) | REG2) & static_cast(0x0000FFFF); + + return glm::u16vec2(REG1, REG2); + } + + GLM_FUNC_QUALIFIER int64 bitfieldInterleave(int32 x, int32 y) + { + union sign32 + { + int32 i; + uint32 u; + } sign_x, sign_y; + + union sign64 + { + int64 i; + uint64 u; + } result; + + sign_x.i = x; + sign_y.i = y; + result.u = bitfieldInterleave(sign_x.u, sign_y.u); + + return result.i; + } + + GLM_FUNC_QUALIFIER uint64 bitfieldInterleave(uint32 x, uint32 y) + { + return detail::bitfieldInterleave(x, y); + } + + GLM_FUNC_QUALIFIER glm::uint64 bitfieldInterleave(u32vec2 const& v) + { + return detail::bitfieldInterleave(v.x, v.y); + } + + GLM_FUNC_QUALIFIER glm::u32vec2 bitfieldDeinterleave(glm::uint64 x) + { + glm::uint64 REG1(x); + glm::uint64 REG2(x >>= 1); + + REG1 = REG1 & static_cast(0x5555555555555555ull); + REG2 = REG2 & static_cast(0x5555555555555555ull); + + REG1 = ((REG1 >> 1) | REG1) & static_cast(0x3333333333333333ull); + REG2 = ((REG2 >> 1) | REG2) & static_cast(0x3333333333333333ull); + + REG1 = ((REG1 >> 2) | REG1) & static_cast(0x0F0F0F0F0F0F0F0Full); + REG2 = ((REG2 >> 2) | REG2) & static_cast(0x0F0F0F0F0F0F0F0Full); + + REG1 = ((REG1 >> 4) | REG1) & static_cast(0x00FF00FF00FF00FFull); + REG2 = ((REG2 >> 4) | REG2) & static_cast(0x00FF00FF00FF00FFull); + + REG1 = ((REG1 >> 8) | REG1) & static_cast(0x0000FFFF0000FFFFull); + REG2 = ((REG2 >> 8) | REG2) & static_cast(0x0000FFFF0000FFFFull); + + REG1 = ((REG1 >> 16) | REG1) & static_cast(0x00000000FFFFFFFFull); + REG2 = ((REG2 >> 16) | REG2) & static_cast(0x00000000FFFFFFFFull); + + return glm::u32vec2(REG1, REG2); + } + + GLM_FUNC_QUALIFIER int32 bitfieldInterleave(int8 x, int8 y, int8 z) + { + union sign8 + { + int8 i; + uint8 u; + } sign_x, sign_y, sign_z; + + union sign32 + { + int32 i; + uint32 u; + } result; + + sign_x.i = x; + sign_y.i = y; + sign_z.i = z; + result.u = bitfieldInterleave(sign_x.u, sign_y.u, sign_z.u); + + return result.i; + } + + GLM_FUNC_QUALIFIER uint32 bitfieldInterleave(uint8 x, uint8 y, uint8 z) + { + return detail::bitfieldInterleave(x, y, z); + } + + GLM_FUNC_QUALIFIER uint32 bitfieldInterleave(u8vec3 const& v) + { + return detail::bitfieldInterleave(v.x, v.y, v.z); + } + + GLM_FUNC_QUALIFIER int64 bitfieldInterleave(int16 x, int16 y, int16 z) + { + union sign16 + { + int16 i; + uint16 u; + } sign_x, sign_y, sign_z; + + union sign64 + { + int64 i; + uint64 u; + } result; + + sign_x.i = x; + sign_y.i = y; + sign_z.i = z; + result.u = bitfieldInterleave(sign_x.u, sign_y.u, sign_z.u); + + return result.i; + } + + GLM_FUNC_QUALIFIER uint64 bitfieldInterleave(uint16 x, uint16 y, uint16 z) + { + return detail::bitfieldInterleave(x, y, z); + } + + GLM_FUNC_QUALIFIER uint64 bitfieldInterleave(u16vec3 const& v) + { + return detail::bitfieldInterleave(v.x, v.y, v.z); + } + + GLM_FUNC_QUALIFIER int64 bitfieldInterleave(int32 x, int32 y, int32 z) + { + union sign16 + { + int32 i; + uint32 u; + } sign_x, sign_y, sign_z; + + union sign64 + { + int64 i; + uint64 u; + } result; + + sign_x.i = x; + sign_y.i = y; + sign_z.i = z; + result.u = bitfieldInterleave(sign_x.u, sign_y.u, sign_z.u); + + return result.i; + } + + GLM_FUNC_QUALIFIER uint64 bitfieldInterleave(uint32 x, uint32 y, uint32 z) + { + return detail::bitfieldInterleave(x, y, z); + } + + GLM_FUNC_QUALIFIER uint64 bitfieldInterleave(u32vec3 const& v) + { + return detail::bitfieldInterleave(v.x, v.y, v.z); + } + + GLM_FUNC_QUALIFIER int32 bitfieldInterleave(int8 x, int8 y, int8 z, int8 w) + { + union sign8 + { + int8 i; + uint8 u; + } sign_x, sign_y, sign_z, sign_w; + + union sign32 + { + int32 i; + uint32 u; + } result; + + sign_x.i = x; + sign_y.i = y; + sign_z.i = z; + sign_w.i = w; + result.u = bitfieldInterleave(sign_x.u, sign_y.u, sign_z.u, sign_w.u); + + return result.i; + } + + GLM_FUNC_QUALIFIER uint32 bitfieldInterleave(uint8 x, uint8 y, uint8 z, uint8 w) + { + return detail::bitfieldInterleave(x, y, z, w); + } + + GLM_FUNC_QUALIFIER uint32 bitfieldInterleave(u8vec4 const& v) + { + return detail::bitfieldInterleave(v.x, v.y, v.z, v.w); + } + + GLM_FUNC_QUALIFIER int64 bitfieldInterleave(int16 x, int16 y, int16 z, int16 w) + { + union sign16 + { + int16 i; + uint16 u; + } sign_x, sign_y, sign_z, sign_w; + + union sign64 + { + int64 i; + uint64 u; + } result; + + sign_x.i = x; + sign_y.i = y; + sign_z.i = z; + sign_w.i = w; + result.u = bitfieldInterleave(sign_x.u, sign_y.u, sign_z.u, sign_w.u); + + return result.i; + } + + GLM_FUNC_QUALIFIER uint64 bitfieldInterleave(uint16 x, uint16 y, uint16 z, uint16 w) + { + return detail::bitfieldInterleave(x, y, z, w); + } + + GLM_FUNC_QUALIFIER uint64 bitfieldInterleave(u16vec4 const& v) + { + return detail::bitfieldInterleave(v.x, v.y, v.z, v.w); + } +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/color_space.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/color_space.hpp new file mode 100644 index 0000000000000000000000000000000000000000..4c63077d6c982be0f7d371de7e1cff0792a0fe26 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/color_space.hpp @@ -0,0 +1,56 @@ +/// @ref gtc_color_space +/// @file glm/gtc/color_space.hpp +/// +/// @see core (dependence) +/// @see gtc_color_space (dependence) +/// +/// @defgroup gtc_color_space GLM_GTC_color_space +/// @ingroup gtc +/// +/// Include to use the features of this extension. +/// +/// Allow to perform bit operations on integer values + +#pragma once + +// Dependencies +#include "../detail/setup.hpp" +#include "../detail/qualifier.hpp" +#include "../exponential.hpp" +#include "../vec3.hpp" +#include "../vec4.hpp" +#include + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_GTC_color_space extension included") +#endif + +namespace glm +{ + /// @addtogroup gtc_color_space + /// @{ + + /// Convert a linear color to sRGB color using a standard gamma correction. + /// IEC 61966-2-1:1999 / Rec. 709 specification https://www.w3.org/Graphics/Color/srgb + template + GLM_FUNC_DECL vec convertLinearToSRGB(vec const& ColorLinear); + + /// Convert a linear color to sRGB color using a custom gamma correction. + /// IEC 61966-2-1:1999 / Rec. 709 specification https://www.w3.org/Graphics/Color/srgb + template + GLM_FUNC_DECL vec convertLinearToSRGB(vec const& ColorLinear, T Gamma); + + /// Convert a sRGB color to linear color using a standard gamma correction. + /// IEC 61966-2-1:1999 / Rec. 709 specification https://www.w3.org/Graphics/Color/srgb + template + GLM_FUNC_DECL vec convertSRGBToLinear(vec const& ColorSRGB); + + /// Convert a sRGB color to linear color using a custom gamma correction. + // IEC 61966-2-1:1999 / Rec. 709 specification https://www.w3.org/Graphics/Color/srgb + template + GLM_FUNC_DECL vec convertSRGBToLinear(vec const& ColorSRGB, T Gamma); + + /// @} +} //namespace glm + +#include "color_space.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/color_space.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/color_space.inl new file mode 100644 index 0000000000000000000000000000000000000000..2b72d701051f409857a9fa065306545f90b97eb6 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/color_space.inl @@ -0,0 +1,84 @@ +/// @ref gtc_color_space + +namespace glm{ +namespace detail +{ + template + struct compute_rgbToSrgb + { + GLM_FUNC_QUALIFIER static vec call(vec const& ColorRGB, T GammaCorrection) + { + vec const ClampedColor(clamp(ColorRGB, static_cast(0), static_cast(1))); + + return mix( + pow(ClampedColor, vec(GammaCorrection)) * static_cast(1.055) - static_cast(0.055), + ClampedColor * static_cast(12.92), + lessThan(ClampedColor, vec(static_cast(0.0031308)))); + } + }; + + template + struct compute_rgbToSrgb<4, T, Q> + { + GLM_FUNC_QUALIFIER static vec<4, T, Q> call(vec<4, T, Q> const& ColorRGB, T GammaCorrection) + { + return vec<4, T, Q>(compute_rgbToSrgb<3, T, Q>::call(vec<3, T, Q>(ColorRGB), GammaCorrection), ColorRGB.w); + } + }; + + template + struct compute_srgbToRgb + { + GLM_FUNC_QUALIFIER static vec call(vec const& ColorSRGB, T Gamma) + { + return mix( + pow((ColorSRGB + static_cast(0.055)) * static_cast(0.94786729857819905213270142180095), vec(Gamma)), + ColorSRGB * static_cast(0.07739938080495356037151702786378), + lessThanEqual(ColorSRGB, vec(static_cast(0.04045)))); + } + }; + + template + struct compute_srgbToRgb<4, T, Q> + { + GLM_FUNC_QUALIFIER static vec<4, T, Q> call(vec<4, T, Q> const& ColorSRGB, T Gamma) + { + return vec<4, T, Q>(compute_srgbToRgb<3, T, Q>::call(vec<3, T, Q>(ColorSRGB), Gamma), ColorSRGB.w); + } + }; +}//namespace detail + + template + GLM_FUNC_QUALIFIER vec convertLinearToSRGB(vec const& ColorLinear) + { + return detail::compute_rgbToSrgb::call(ColorLinear, static_cast(0.41666)); + } + + // Based on Ian Taylor http://chilliant.blogspot.fr/2012/08/srgb-approximations-for-hlsl.html + template<> + GLM_FUNC_QUALIFIER vec<3, float, lowp> convertLinearToSRGB(vec<3, float, lowp> const& ColorLinear) + { + vec<3, float, lowp> S1 = sqrt(ColorLinear); + vec<3, float, lowp> S2 = sqrt(S1); + vec<3, float, lowp> S3 = sqrt(S2); + return 0.662002687f * S1 + 0.684122060f * S2 - 0.323583601f * S3 - 0.0225411470f * ColorLinear; + } + + template + GLM_FUNC_QUALIFIER vec convertLinearToSRGB(vec const& ColorLinear, T Gamma) + { + return detail::compute_rgbToSrgb::call(ColorLinear, static_cast(1) / Gamma); + } + + template + GLM_FUNC_QUALIFIER vec convertSRGBToLinear(vec const& ColorSRGB) + { + return detail::compute_srgbToRgb::call(ColorSRGB, static_cast(2.4)); + } + + template + GLM_FUNC_QUALIFIER vec convertSRGBToLinear(vec const& ColorSRGB, T Gamma) + { + return detail::compute_srgbToRgb::call(ColorSRGB, Gamma); + } +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/constants.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/constants.hpp new file mode 100644 index 0000000000000000000000000000000000000000..4777ee4fb368f7412c25730161bd719dd82a16ac --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/constants.hpp @@ -0,0 +1,165 @@ +/// @ref gtc_constants +/// @file glm/gtc/constants.hpp +/// +/// @see core (dependence) +/// +/// @defgroup gtc_constants GLM_GTC_constants +/// @ingroup gtc +/// +/// Include to use the features of this extension. +/// +/// Provide a list of constants and precomputed useful values. + +#pragma once + +// Dependencies +#include "../ext/scalar_constants.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_GTC_constants extension included") +#endif + +namespace glm +{ + /// @addtogroup gtc_constants + /// @{ + + /// Return 0. + /// @see gtc_constants + template + GLM_FUNC_DECL GLM_CONSTEXPR genType zero(); + + /// Return 1. + /// @see gtc_constants + template + GLM_FUNC_DECL GLM_CONSTEXPR genType one(); + + /// Return pi * 2. + /// @see gtc_constants + template + GLM_FUNC_DECL GLM_CONSTEXPR genType two_pi(); + + /// Return square root of pi. + /// @see gtc_constants + template + GLM_FUNC_DECL GLM_CONSTEXPR genType root_pi(); + + /// Return pi / 2. + /// @see gtc_constants + template + GLM_FUNC_DECL GLM_CONSTEXPR genType half_pi(); + + /// Return pi / 2 * 3. + /// @see gtc_constants + template + GLM_FUNC_DECL GLM_CONSTEXPR genType three_over_two_pi(); + + /// Return pi / 4. + /// @see gtc_constants + template + GLM_FUNC_DECL GLM_CONSTEXPR genType quarter_pi(); + + /// Return 1 / pi. + /// @see gtc_constants + template + GLM_FUNC_DECL GLM_CONSTEXPR genType one_over_pi(); + + /// Return 1 / (pi * 2). + /// @see gtc_constants + template + GLM_FUNC_DECL GLM_CONSTEXPR genType one_over_two_pi(); + + /// Return 2 / pi. + /// @see gtc_constants + template + GLM_FUNC_DECL GLM_CONSTEXPR genType two_over_pi(); + + /// Return 4 / pi. + /// @see gtc_constants + template + GLM_FUNC_DECL GLM_CONSTEXPR genType four_over_pi(); + + /// Return 2 / sqrt(pi). + /// @see gtc_constants + template + GLM_FUNC_DECL GLM_CONSTEXPR genType two_over_root_pi(); + + /// Return 1 / sqrt(2). + /// @see gtc_constants + template + GLM_FUNC_DECL GLM_CONSTEXPR genType one_over_root_two(); + + /// Return sqrt(pi / 2). + /// @see gtc_constants + template + GLM_FUNC_DECL GLM_CONSTEXPR genType root_half_pi(); + + /// Return sqrt(2 * pi). + /// @see gtc_constants + template + GLM_FUNC_DECL GLM_CONSTEXPR genType root_two_pi(); + + /// Return sqrt(ln(4)). + /// @see gtc_constants + template + GLM_FUNC_DECL GLM_CONSTEXPR genType root_ln_four(); + + /// Return e constant. + /// @see gtc_constants + template + GLM_FUNC_DECL GLM_CONSTEXPR genType e(); + + /// Return Euler's constant. + /// @see gtc_constants + template + GLM_FUNC_DECL GLM_CONSTEXPR genType euler(); + + /// Return sqrt(2). + /// @see gtc_constants + template + GLM_FUNC_DECL GLM_CONSTEXPR genType root_two(); + + /// Return sqrt(3). + /// @see gtc_constants + template + GLM_FUNC_DECL GLM_CONSTEXPR genType root_three(); + + /// Return sqrt(5). + /// @see gtc_constants + template + GLM_FUNC_DECL GLM_CONSTEXPR genType root_five(); + + /// Return ln(2). + /// @see gtc_constants + template + GLM_FUNC_DECL GLM_CONSTEXPR genType ln_two(); + + /// Return ln(10). + /// @see gtc_constants + template + GLM_FUNC_DECL GLM_CONSTEXPR genType ln_ten(); + + /// Return ln(ln(2)). + /// @see gtc_constants + template + GLM_FUNC_DECL GLM_CONSTEXPR genType ln_ln_two(); + + /// Return 1 / 3. + /// @see gtc_constants + template + GLM_FUNC_DECL GLM_CONSTEXPR genType third(); + + /// Return 2 / 3. + /// @see gtc_constants + template + GLM_FUNC_DECL GLM_CONSTEXPR genType two_thirds(); + + /// Return the golden ratio constant. + /// @see gtc_constants + template + GLM_FUNC_DECL GLM_CONSTEXPR genType golden_ratio(); + + /// @} +} //namespace glm + +#include "constants.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/constants.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/constants.inl new file mode 100644 index 0000000000000000000000000000000000000000..23289ffe48d1f9cf53682951c80b880e3db283d7 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/constants.inl @@ -0,0 +1,167 @@ +/// @ref gtc_constants + +namespace glm +{ + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType zero() + { + return genType(0); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType one() + { + return genType(1); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType two_pi() + { + return genType(6.28318530717958647692528676655900576); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType root_pi() + { + return genType(1.772453850905516027); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType half_pi() + { + return genType(1.57079632679489661923132169163975144); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType three_over_two_pi() + { + return genType(4.71238898038468985769396507491925432); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType quarter_pi() + { + return genType(0.785398163397448309615660845819875721); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType one_over_pi() + { + return genType(0.318309886183790671537767526745028724); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType one_over_two_pi() + { + return genType(0.159154943091895335768883763372514362); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType two_over_pi() + { + return genType(0.636619772367581343075535053490057448); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType four_over_pi() + { + return genType(1.273239544735162686151070106980114898); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType two_over_root_pi() + { + return genType(1.12837916709551257389615890312154517); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType one_over_root_two() + { + return genType(0.707106781186547524400844362104849039); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType root_half_pi() + { + return genType(1.253314137315500251); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType root_two_pi() + { + return genType(2.506628274631000502); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType root_ln_four() + { + return genType(1.17741002251547469); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType e() + { + return genType(2.71828182845904523536); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType euler() + { + return genType(0.577215664901532860606); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType root_two() + { + return genType(1.41421356237309504880168872420969808); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType root_three() + { + return genType(1.73205080756887729352744634150587236); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType root_five() + { + return genType(2.23606797749978969640917366873127623); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType ln_two() + { + return genType(0.693147180559945309417232121458176568); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType ln_ten() + { + return genType(2.30258509299404568401799145468436421); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType ln_ln_two() + { + return genType(-0.3665129205816643); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType third() + { + return genType(0.3333333333333333333333333333333333333333); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType two_thirds() + { + return genType(0.666666666666666666666666666666666666667); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType golden_ratio() + { + return genType(1.61803398874989484820458683436563811); + } + +} //namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/epsilon.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/epsilon.hpp new file mode 100644 index 0000000000000000000000000000000000000000..e2d5b81a6f9857e1f47ce70b7093e589d9d0bb75 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/epsilon.hpp @@ -0,0 +1,60 @@ +/// @ref gtc_epsilon +/// @file glm/gtc/epsilon.hpp +/// +/// @see core (dependence) +/// @see gtc_quaternion (dependence) +/// +/// @defgroup gtc_epsilon GLM_GTC_epsilon +/// @ingroup gtc +/// +/// Include to use the features of this extension. +/// +/// Comparison functions for a user defined epsilon values. + +#pragma once + +// Dependencies +#include "../detail/setup.hpp" +#include "../detail/qualifier.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_GTC_epsilon extension included") +#endif + +namespace glm +{ + /// @addtogroup gtc_epsilon + /// @{ + + /// Returns the component-wise comparison of |x - y| < epsilon. + /// True if this expression is satisfied. + /// + /// @see gtc_epsilon + template + GLM_FUNC_DECL vec epsilonEqual(vec const& x, vec const& y, T const& epsilon); + + /// Returns the component-wise comparison of |x - y| < epsilon. + /// True if this expression is satisfied. + /// + /// @see gtc_epsilon + template + GLM_FUNC_DECL bool epsilonEqual(genType const& x, genType const& y, genType const& epsilon); + + /// Returns the component-wise comparison of |x - y| < epsilon. + /// True if this expression is not satisfied. + /// + /// @see gtc_epsilon + template + GLM_FUNC_DECL vec epsilonNotEqual(vec const& x, vec const& y, T const& epsilon); + + /// Returns the component-wise comparison of |x - y| >= epsilon. + /// True if this expression is not satisfied. + /// + /// @see gtc_epsilon + template + GLM_FUNC_DECL bool epsilonNotEqual(genType const& x, genType const& y, genType const& epsilon); + + /// @} +}//namespace glm + +#include "epsilon.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/epsilon.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/epsilon.inl new file mode 100644 index 0000000000000000000000000000000000000000..5c1b2ea3a8ade0f2c069f5bf3906e36e191ee1a4 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/epsilon.inl @@ -0,0 +1,80 @@ +/// @ref gtc_epsilon + +// Dependency: +#include "../vector_relational.hpp" +#include "../common.hpp" + +namespace glm +{ + template<> + GLM_FUNC_QUALIFIER bool epsilonEqual + ( + float const& x, + float const& y, + float const& epsilon + ) + { + return abs(x - y) < epsilon; + } + + template<> + GLM_FUNC_QUALIFIER bool epsilonEqual + ( + double const& x, + double const& y, + double const& epsilon + ) + { + return abs(x - y) < epsilon; + } + + template + GLM_FUNC_QUALIFIER vec epsilonEqual(vec const& x, vec const& y, T const& epsilon) + { + return lessThan(abs(x - y), vec(epsilon)); + } + + template + GLM_FUNC_QUALIFIER vec epsilonEqual(vec const& x, vec const& y, vec const& epsilon) + { + return lessThan(abs(x - y), vec(epsilon)); + } + + template<> + GLM_FUNC_QUALIFIER bool epsilonNotEqual(float const& x, float const& y, float const& epsilon) + { + return abs(x - y) >= epsilon; + } + + template<> + GLM_FUNC_QUALIFIER bool epsilonNotEqual(double const& x, double const& y, double const& epsilon) + { + return abs(x - y) >= epsilon; + } + + template + GLM_FUNC_QUALIFIER vec epsilonNotEqual(vec const& x, vec const& y, T const& epsilon) + { + return greaterThanEqual(abs(x - y), vec(epsilon)); + } + + template + GLM_FUNC_QUALIFIER vec epsilonNotEqual(vec const& x, vec const& y, vec const& epsilon) + { + return greaterThanEqual(abs(x - y), vec(epsilon)); + } + + template + GLM_FUNC_QUALIFIER vec<4, bool, Q> epsilonEqual(qua const& x, qua const& y, T const& epsilon) + { + vec<4, T, Q> v(x.x - y.x, x.y - y.y, x.z - y.z, x.w - y.w); + return lessThan(abs(v), vec<4, T, Q>(epsilon)); + } + + template + GLM_FUNC_QUALIFIER vec<4, bool, Q> epsilonNotEqual(qua const& x, qua const& y, T const& epsilon) + { + vec<4, T, Q> v(x.x - y.x, x.y - y.y, x.z - y.z, x.w - y.w); + return greaterThanEqual(abs(v), vec<4, T, Q>(epsilon)); + } +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/integer.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/integer.hpp new file mode 100644 index 0000000000000000000000000000000000000000..fb670a03367d41cf67515065c2c0b730b55b7901 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/integer.hpp @@ -0,0 +1,43 @@ +/// @ref gtc_integer +/// @file glm/gtc/integer.hpp +/// +/// @see core (dependence) +/// @see gtc_integer (dependence) +/// +/// @defgroup gtc_integer GLM_GTC_integer +/// @ingroup gtc +/// +/// Include to use the features of this extension. +/// +/// @brief Allow to perform bit operations on integer values + +#pragma once + +// Dependencies +#include "../detail/setup.hpp" +#include "../detail/qualifier.hpp" +#include "../common.hpp" +#include "../integer.hpp" +#include "../exponential.hpp" +#include "../ext/scalar_common.hpp" +#include "../ext/vector_common.hpp" +#include + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_GTC_integer extension included") +#endif + +namespace glm +{ + /// @addtogroup gtc_integer + /// @{ + + /// Returns the log2 of x for integer values. Useful to compute mipmap count from the texture size. + /// @see gtc_integer + template + GLM_FUNC_DECL genIUType log2(genIUType x); + + /// @} +} //namespace glm + +#include "integer.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/integer.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/integer.inl new file mode 100644 index 0000000000000000000000000000000000000000..90103297016b354f560de6a6dec6e382cc42a85e --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/integer.inl @@ -0,0 +1,33 @@ +/// @ref gtc_integer + +namespace glm{ +namespace detail +{ + template + struct compute_log2 + { + GLM_FUNC_QUALIFIER static vec call(vec const& v) + { + //Equivalent to return findMSB(vec); but save one function call in ASM with VC + //return findMSB(vec); + return vec(detail::compute_findMSB_vec::call(v)); + } + }; + +# if GLM_HAS_BITSCAN_WINDOWS + template + struct compute_log2<4, int, Q, false, Aligned> + { + GLM_FUNC_QUALIFIER static vec<4, int, Q> call(vec<4, int, Q> const& v) + { + vec<4, int, Q> Result; + _BitScanReverse(reinterpret_cast(&Result.x), v.x); + _BitScanReverse(reinterpret_cast(&Result.y), v.y); + _BitScanReverse(reinterpret_cast(&Result.z), v.z); + _BitScanReverse(reinterpret_cast(&Result.w), v.w); + return Result; + } + }; +# endif//GLM_HAS_BITSCAN_WINDOWS +}//namespace detail +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/matrix_access.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/matrix_access.hpp new file mode 100644 index 0000000000000000000000000000000000000000..70ffea9c1a4086256df2c29373d1516993422e5a --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/matrix_access.hpp @@ -0,0 +1,60 @@ +/// @ref gtc_matrix_access +/// @file glm/gtc/matrix_access.hpp +/// +/// @see core (dependence) +/// +/// @defgroup gtc_matrix_access GLM_GTC_matrix_access +/// @ingroup gtc +/// +/// Include to use the features of this extension. +/// +/// Defines functions to access rows or columns of a matrix easily. + +#pragma once + +// Dependency: +#include "../detail/setup.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_GTC_matrix_access extension included") +#endif + +namespace glm +{ + /// @addtogroup gtc_matrix_access + /// @{ + + /// Get a specific row of a matrix. + /// @see gtc_matrix_access + template + GLM_FUNC_DECL typename genType::row_type row( + genType const& m, + length_t index); + + /// Set a specific row to a matrix. + /// @see gtc_matrix_access + template + GLM_FUNC_DECL genType row( + genType const& m, + length_t index, + typename genType::row_type const& x); + + /// Get a specific column of a matrix. + /// @see gtc_matrix_access + template + GLM_FUNC_DECL typename genType::col_type column( + genType const& m, + length_t index); + + /// Set a specific column to a matrix. + /// @see gtc_matrix_access + template + GLM_FUNC_DECL genType column( + genType const& m, + length_t index, + typename genType::col_type const& x); + + /// @} +}//namespace glm + +#include "matrix_access.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/matrix_access.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/matrix_access.inl new file mode 100644 index 0000000000000000000000000000000000000000..5341b9c13b5f8357f7dfecc71ea51f2a22b8a35d --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/matrix_access.inl @@ -0,0 +1,62 @@ +/// @ref gtc_matrix_access + +namespace glm +{ + template + GLM_FUNC_QUALIFIER genType row + ( + genType const& m, + length_t index, + typename genType::row_type const& x + ) + { + assert(index >= 0 && index < m[0].length()); + + genType Result = m; + for(length_t i = 0; i < m.length(); ++i) + Result[i][index] = x[i]; + return Result; + } + + template + GLM_FUNC_QUALIFIER typename genType::row_type row + ( + genType const& m, + length_t index + ) + { + assert(index >= 0 && index < m[0].length()); + + typename genType::row_type Result(0); + for(length_t i = 0; i < m.length(); ++i) + Result[i] = m[i][index]; + return Result; + } + + template + GLM_FUNC_QUALIFIER genType column + ( + genType const& m, + length_t index, + typename genType::col_type const& x + ) + { + assert(index >= 0 && index < m.length()); + + genType Result = m; + Result[index] = x; + return Result; + } + + template + GLM_FUNC_QUALIFIER typename genType::col_type column + ( + genType const& m, + length_t index + ) + { + assert(index >= 0 && index < m.length()); + + return m[index]; + } +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/matrix_integer.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/matrix_integer.hpp new file mode 100644 index 0000000000000000000000000000000000000000..cbe3be1777d0a68ad6cabc98247a346112a8e980 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/matrix_integer.hpp @@ -0,0 +1,433 @@ +/// @ref gtc_matrix_integer +/// @file glm/gtc/matrix_integer.hpp +/// +/// @see core (dependence) +/// +/// @defgroup gtc_matrix_integer GLM_GTC_matrix_integer +/// @ingroup gtc +/// +/// Include to use the features of this extension. +/// +/// Defines a number of matrices with integer types. + +#pragma once + +// Dependency: +#include "../mat2x2.hpp" +#include "../mat2x3.hpp" +#include "../mat2x4.hpp" +#include "../mat3x2.hpp" +#include "../mat3x3.hpp" +#include "../mat3x4.hpp" +#include "../mat4x2.hpp" +#include "../mat4x3.hpp" +#include "../mat4x4.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_GTC_matrix_integer extension included") +#endif + +namespace glm +{ + /// @addtogroup gtc_matrix_integer + /// @{ + + /// High-qualifier signed integer 2x2 matrix. + /// @see gtc_matrix_integer + typedef mat<2, 2, int, highp> highp_imat2; + + /// High-qualifier signed integer 3x3 matrix. + /// @see gtc_matrix_integer + typedef mat<3, 3, int, highp> highp_imat3; + + /// High-qualifier signed integer 4x4 matrix. + /// @see gtc_matrix_integer + typedef mat<4, 4, int, highp> highp_imat4; + + /// High-qualifier signed integer 2x2 matrix. + /// @see gtc_matrix_integer + typedef mat<2, 2, int, highp> highp_imat2x2; + + /// High-qualifier signed integer 2x3 matrix. + /// @see gtc_matrix_integer + typedef mat<2, 3, int, highp> highp_imat2x3; + + /// High-qualifier signed integer 2x4 matrix. + /// @see gtc_matrix_integer + typedef mat<2, 4, int, highp> highp_imat2x4; + + /// High-qualifier signed integer 3x2 matrix. + /// @see gtc_matrix_integer + typedef mat<3, 2, int, highp> highp_imat3x2; + + /// High-qualifier signed integer 3x3 matrix. + /// @see gtc_matrix_integer + typedef mat<3, 3, int, highp> highp_imat3x3; + + /// High-qualifier signed integer 3x4 matrix. + /// @see gtc_matrix_integer + typedef mat<3, 4, int, highp> highp_imat3x4; + + /// High-qualifier signed integer 4x2 matrix. + /// @see gtc_matrix_integer + typedef mat<4, 2, int, highp> highp_imat4x2; + + /// High-qualifier signed integer 4x3 matrix. + /// @see gtc_matrix_integer + typedef mat<4, 3, int, highp> highp_imat4x3; + + /// High-qualifier signed integer 4x4 matrix. + /// @see gtc_matrix_integer + typedef mat<4, 4, int, highp> highp_imat4x4; + + + /// Medium-qualifier signed integer 2x2 matrix. + /// @see gtc_matrix_integer + typedef mat<2, 2, int, mediump> mediump_imat2; + + /// Medium-qualifier signed integer 3x3 matrix. + /// @see gtc_matrix_integer + typedef mat<3, 3, int, mediump> mediump_imat3; + + /// Medium-qualifier signed integer 4x4 matrix. + /// @see gtc_matrix_integer + typedef mat<4, 4, int, mediump> mediump_imat4; + + + /// Medium-qualifier signed integer 2x2 matrix. + /// @see gtc_matrix_integer + typedef mat<2, 2, int, mediump> mediump_imat2x2; + + /// Medium-qualifier signed integer 2x3 matrix. + /// @see gtc_matrix_integer + typedef mat<2, 3, int, mediump> mediump_imat2x3; + + /// Medium-qualifier signed integer 2x4 matrix. + /// @see gtc_matrix_integer + typedef mat<2, 4, int, mediump> mediump_imat2x4; + + /// Medium-qualifier signed integer 3x2 matrix. + /// @see gtc_matrix_integer + typedef mat<3, 2, int, mediump> mediump_imat3x2; + + /// Medium-qualifier signed integer 3x3 matrix. + /// @see gtc_matrix_integer + typedef mat<3, 3, int, mediump> mediump_imat3x3; + + /// Medium-qualifier signed integer 3x4 matrix. + /// @see gtc_matrix_integer + typedef mat<3, 4, int, mediump> mediump_imat3x4; + + /// Medium-qualifier signed integer 4x2 matrix. + /// @see gtc_matrix_integer + typedef mat<4, 2, int, mediump> mediump_imat4x2; + + /// Medium-qualifier signed integer 4x3 matrix. + /// @see gtc_matrix_integer + typedef mat<4, 3, int, mediump> mediump_imat4x3; + + /// Medium-qualifier signed integer 4x4 matrix. + /// @see gtc_matrix_integer + typedef mat<4, 4, int, mediump> mediump_imat4x4; + + + /// Low-qualifier signed integer 2x2 matrix. + /// @see gtc_matrix_integer + typedef mat<2, 2, int, lowp> lowp_imat2; + + /// Low-qualifier signed integer 3x3 matrix. + /// @see gtc_matrix_integer + typedef mat<3, 3, int, lowp> lowp_imat3; + + /// Low-qualifier signed integer 4x4 matrix. + /// @see gtc_matrix_integer + typedef mat<4, 4, int, lowp> lowp_imat4; + + + /// Low-qualifier signed integer 2x2 matrix. + /// @see gtc_matrix_integer + typedef mat<2, 2, int, lowp> lowp_imat2x2; + + /// Low-qualifier signed integer 2x3 matrix. + /// @see gtc_matrix_integer + typedef mat<2, 3, int, lowp> lowp_imat2x3; + + /// Low-qualifier signed integer 2x4 matrix. + /// @see gtc_matrix_integer + typedef mat<2, 4, int, lowp> lowp_imat2x4; + + /// Low-qualifier signed integer 3x2 matrix. + /// @see gtc_matrix_integer + typedef mat<3, 2, int, lowp> lowp_imat3x2; + + /// Low-qualifier signed integer 3x3 matrix. + /// @see gtc_matrix_integer + typedef mat<3, 3, int, lowp> lowp_imat3x3; + + /// Low-qualifier signed integer 3x4 matrix. + /// @see gtc_matrix_integer + typedef mat<3, 4, int, lowp> lowp_imat3x4; + + /// Low-qualifier signed integer 4x2 matrix. + /// @see gtc_matrix_integer + typedef mat<4, 2, int, lowp> lowp_imat4x2; + + /// Low-qualifier signed integer 4x3 matrix. + /// @see gtc_matrix_integer + typedef mat<4, 3, int, lowp> lowp_imat4x3; + + /// Low-qualifier signed integer 4x4 matrix. + /// @see gtc_matrix_integer + typedef mat<4, 4, int, lowp> lowp_imat4x4; + + + /// High-qualifier unsigned integer 2x2 matrix. + /// @see gtc_matrix_integer + typedef mat<2, 2, uint, highp> highp_umat2; + + /// High-qualifier unsigned integer 3x3 matrix. + /// @see gtc_matrix_integer + typedef mat<3, 3, uint, highp> highp_umat3; + + /// High-qualifier unsigned integer 4x4 matrix. + /// @see gtc_matrix_integer + typedef mat<4, 4, uint, highp> highp_umat4; + + /// High-qualifier unsigned integer 2x2 matrix. + /// @see gtc_matrix_integer + typedef mat<2, 2, uint, highp> highp_umat2x2; + + /// High-qualifier unsigned integer 2x3 matrix. + /// @see gtc_matrix_integer + typedef mat<2, 3, uint, highp> highp_umat2x3; + + /// High-qualifier unsigned integer 2x4 matrix. + /// @see gtc_matrix_integer + typedef mat<2, 4, uint, highp> highp_umat2x4; + + /// High-qualifier unsigned integer 3x2 matrix. + /// @see gtc_matrix_integer + typedef mat<3, 2, uint, highp> highp_umat3x2; + + /// High-qualifier unsigned integer 3x3 matrix. + /// @see gtc_matrix_integer + typedef mat<3, 3, uint, highp> highp_umat3x3; + + /// High-qualifier unsigned integer 3x4 matrix. + /// @see gtc_matrix_integer + typedef mat<3, 4, uint, highp> highp_umat3x4; + + /// High-qualifier unsigned integer 4x2 matrix. + /// @see gtc_matrix_integer + typedef mat<4, 2, uint, highp> highp_umat4x2; + + /// High-qualifier unsigned integer 4x3 matrix. + /// @see gtc_matrix_integer + typedef mat<4, 3, uint, highp> highp_umat4x3; + + /// High-qualifier unsigned integer 4x4 matrix. + /// @see gtc_matrix_integer + typedef mat<4, 4, uint, highp> highp_umat4x4; + + + /// Medium-qualifier unsigned integer 2x2 matrix. + /// @see gtc_matrix_integer + typedef mat<2, 2, uint, mediump> mediump_umat2; + + /// Medium-qualifier unsigned integer 3x3 matrix. + /// @see gtc_matrix_integer + typedef mat<3, 3, uint, mediump> mediump_umat3; + + /// Medium-qualifier unsigned integer 4x4 matrix. + /// @see gtc_matrix_integer + typedef mat<4, 4, uint, mediump> mediump_umat4; + + + /// Medium-qualifier unsigned integer 2x2 matrix. + /// @see gtc_matrix_integer + typedef mat<2, 2, uint, mediump> mediump_umat2x2; + + /// Medium-qualifier unsigned integer 2x3 matrix. + /// @see gtc_matrix_integer + typedef mat<2, 3, uint, mediump> mediump_umat2x3; + + /// Medium-qualifier unsigned integer 2x4 matrix. + /// @see gtc_matrix_integer + typedef mat<2, 4, uint, mediump> mediump_umat2x4; + + /// Medium-qualifier unsigned integer 3x2 matrix. + /// @see gtc_matrix_integer + typedef mat<3, 2, uint, mediump> mediump_umat3x2; + + /// Medium-qualifier unsigned integer 3x3 matrix. + /// @see gtc_matrix_integer + typedef mat<3, 3, uint, mediump> mediump_umat3x3; + + /// Medium-qualifier unsigned integer 3x4 matrix. + /// @see gtc_matrix_integer + typedef mat<3, 4, uint, mediump> mediump_umat3x4; + + /// Medium-qualifier unsigned integer 4x2 matrix. + /// @see gtc_matrix_integer + typedef mat<4, 2, uint, mediump> mediump_umat4x2; + + /// Medium-qualifier unsigned integer 4x3 matrix. + /// @see gtc_matrix_integer + typedef mat<4, 3, uint, mediump> mediump_umat4x3; + + /// Medium-qualifier unsigned integer 4x4 matrix. + /// @see gtc_matrix_integer + typedef mat<4, 4, uint, mediump> mediump_umat4x4; + + + /// Low-qualifier unsigned integer 2x2 matrix. + /// @see gtc_matrix_integer + typedef mat<2, 2, uint, lowp> lowp_umat2; + + /// Low-qualifier unsigned integer 3x3 matrix. + /// @see gtc_matrix_integer + typedef mat<3, 3, uint, lowp> lowp_umat3; + + /// Low-qualifier unsigned integer 4x4 matrix. + /// @see gtc_matrix_integer + typedef mat<4, 4, uint, lowp> lowp_umat4; + + + /// Low-qualifier unsigned integer 2x2 matrix. + /// @see gtc_matrix_integer + typedef mat<2, 2, uint, lowp> lowp_umat2x2; + + /// Low-qualifier unsigned integer 2x3 matrix. + /// @see gtc_matrix_integer + typedef mat<2, 3, uint, lowp> lowp_umat2x3; + + /// Low-qualifier unsigned integer 2x4 matrix. + /// @see gtc_matrix_integer + typedef mat<2, 4, uint, lowp> lowp_umat2x4; + + /// Low-qualifier unsigned integer 3x2 matrix. + /// @see gtc_matrix_integer + typedef mat<3, 2, uint, lowp> lowp_umat3x2; + + /// Low-qualifier unsigned integer 3x3 matrix. + /// @see gtc_matrix_integer + typedef mat<3, 3, uint, lowp> lowp_umat3x3; + + /// Low-qualifier unsigned integer 3x4 matrix. + /// @see gtc_matrix_integer + typedef mat<3, 4, uint, lowp> lowp_umat3x4; + + /// Low-qualifier unsigned integer 4x2 matrix. + /// @see gtc_matrix_integer + typedef mat<4, 2, uint, lowp> lowp_umat4x2; + + /// Low-qualifier unsigned integer 4x3 matrix. + /// @see gtc_matrix_integer + typedef mat<4, 3, uint, lowp> lowp_umat4x3; + + /// Low-qualifier unsigned integer 4x4 matrix. + /// @see gtc_matrix_integer + typedef mat<4, 4, uint, lowp> lowp_umat4x4; + + + + /// Signed integer 2x2 matrix. + /// @see gtc_matrix_integer + typedef mat<2, 2, int, defaultp> imat2; + + /// Signed integer 3x3 matrix. + /// @see gtc_matrix_integer + typedef mat<3, 3, int, defaultp> imat3; + + /// Signed integer 4x4 matrix. + /// @see gtc_matrix_integer + typedef mat<4, 4, int, defaultp> imat4; + + /// Signed integer 2x2 matrix. + /// @see gtc_matrix_integer + typedef mat<2, 2, int, defaultp> imat2x2; + + /// Signed integer 2x3 matrix. + /// @see gtc_matrix_integer + typedef mat<2, 3, int, defaultp> imat2x3; + + /// Signed integer 2x4 matrix. + /// @see gtc_matrix_integer + typedef mat<2, 4, int, defaultp> imat2x4; + + /// Signed integer 3x2 matrix. + /// @see gtc_matrix_integer + typedef mat<3, 2, int, defaultp> imat3x2; + + /// Signed integer 3x3 matrix. + /// @see gtc_matrix_integer + typedef mat<3, 3, int, defaultp> imat3x3; + + /// Signed integer 3x4 matrix. + /// @see gtc_matrix_integer + typedef mat<3, 4, int, defaultp> imat3x4; + + /// Signed integer 4x2 matrix. + /// @see gtc_matrix_integer + typedef mat<4, 2, int, defaultp> imat4x2; + + /// Signed integer 4x3 matrix. + /// @see gtc_matrix_integer + typedef mat<4, 3, int, defaultp> imat4x3; + + /// Signed integer 4x4 matrix. + /// @see gtc_matrix_integer + typedef mat<4, 4, int, defaultp> imat4x4; + + + + /// Unsigned integer 2x2 matrix. + /// @see gtc_matrix_integer + typedef mat<2, 2, uint, defaultp> umat2; + + /// Unsigned integer 3x3 matrix. + /// @see gtc_matrix_integer + typedef mat<3, 3, uint, defaultp> umat3; + + /// Unsigned integer 4x4 matrix. + /// @see gtc_matrix_integer + typedef mat<4, 4, uint, defaultp> umat4; + + /// Unsigned integer 2x2 matrix. + /// @see gtc_matrix_integer + typedef mat<2, 2, uint, defaultp> umat2x2; + + /// Unsigned integer 2x3 matrix. + /// @see gtc_matrix_integer + typedef mat<2, 3, uint, defaultp> umat2x3; + + /// Unsigned integer 2x4 matrix. + /// @see gtc_matrix_integer + typedef mat<2, 4, uint, defaultp> umat2x4; + + /// Unsigned integer 3x2 matrix. + /// @see gtc_matrix_integer + typedef mat<3, 2, uint, defaultp> umat3x2; + + /// Unsigned integer 3x3 matrix. + /// @see gtc_matrix_integer + typedef mat<3, 3, uint, defaultp> umat3x3; + + /// Unsigned integer 3x4 matrix. + /// @see gtc_matrix_integer + typedef mat<3, 4, uint, defaultp> umat3x4; + + /// Unsigned integer 4x2 matrix. + /// @see gtc_matrix_integer + typedef mat<4, 2, uint, defaultp> umat4x2; + + /// Unsigned integer 4x3 matrix. + /// @see gtc_matrix_integer + typedef mat<4, 3, uint, defaultp> umat4x3; + + /// Unsigned integer 4x4 matrix. + /// @see gtc_matrix_integer + typedef mat<4, 4, uint, defaultp> umat4x4; + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/matrix_inverse.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/matrix_inverse.hpp new file mode 100644 index 0000000000000000000000000000000000000000..b74994498f633e54776f5d32d459a0fbcd315620 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/matrix_inverse.hpp @@ -0,0 +1,50 @@ +/// @ref gtc_matrix_inverse +/// @file glm/gtc/matrix_inverse.hpp +/// +/// @see core (dependence) +/// +/// @defgroup gtc_matrix_inverse GLM_GTC_matrix_inverse +/// @ingroup gtc +/// +/// Include to use the features of this extension. +/// +/// Defines additional matrix inverting functions. + +#pragma once + +// Dependencies +#include "../detail/setup.hpp" +#include "../matrix.hpp" +#include "../mat2x2.hpp" +#include "../mat3x3.hpp" +#include "../mat4x4.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_GTC_matrix_inverse extension included") +#endif + +namespace glm +{ + /// @addtogroup gtc_matrix_inverse + /// @{ + + /// Fast matrix inverse for affine matrix. + /// + /// @param m Input matrix to invert. + /// @tparam genType Squared floating-point matrix: half, float or double. Inverse of matrix based of half-qualifier floating point value is highly inaccurate. + /// @see gtc_matrix_inverse + template + GLM_FUNC_DECL genType affineInverse(genType const& m); + + /// Compute the inverse transpose of a matrix. + /// + /// @param m Input matrix to invert transpose. + /// @tparam genType Squared floating-point matrix: half, float or double. Inverse of matrix based of half-qualifier floating point value is highly inaccurate. + /// @see gtc_matrix_inverse + template + GLM_FUNC_DECL genType inverseTranspose(genType const& m); + + /// @} +}//namespace glm + +#include "matrix_inverse.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/matrix_inverse.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/matrix_inverse.inl new file mode 100644 index 0000000000000000000000000000000000000000..2964b9da5f90e4f4c103344aa899c8b687c329f5 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/matrix_inverse.inl @@ -0,0 +1,118 @@ +/// @ref gtc_matrix_inverse + +namespace glm +{ + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> affineInverse(mat<3, 3, T, Q> const& m) + { + mat<2, 2, T, Q> const Inv(inverse(mat<2, 2, T, Q>(m))); + + return mat<3, 3, T, Q>( + vec<3, T, Q>(Inv[0], static_cast(0)), + vec<3, T, Q>(Inv[1], static_cast(0)), + vec<3, T, Q>(-Inv * vec<2, T, Q>(m[2]), static_cast(1))); + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> affineInverse(mat<4, 4, T, Q> const& m) + { + mat<3, 3, T, Q> const Inv(inverse(mat<3, 3, T, Q>(m))); + + return mat<4, 4, T, Q>( + vec<4, T, Q>(Inv[0], static_cast(0)), + vec<4, T, Q>(Inv[1], static_cast(0)), + vec<4, T, Q>(Inv[2], static_cast(0)), + vec<4, T, Q>(-Inv * vec<3, T, Q>(m[3]), static_cast(1))); + } + + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q> inverseTranspose(mat<2, 2, T, Q> const& m) + { + T Determinant = m[0][0] * m[1][1] - m[1][0] * m[0][1]; + + mat<2, 2, T, Q> Inverse( + + m[1][1] / Determinant, + - m[0][1] / Determinant, + - m[1][0] / Determinant, + + m[0][0] / Determinant); + + return Inverse; + } + + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> inverseTranspose(mat<3, 3, T, Q> const& m) + { + T Determinant = + + m[0][0] * (m[1][1] * m[2][2] - m[1][2] * m[2][1]) + - m[0][1] * (m[1][0] * m[2][2] - m[1][2] * m[2][0]) + + m[0][2] * (m[1][0] * m[2][1] - m[1][1] * m[2][0]); + + mat<3, 3, T, Q> Inverse; + Inverse[0][0] = + (m[1][1] * m[2][2] - m[2][1] * m[1][2]); + Inverse[0][1] = - (m[1][0] * m[2][2] - m[2][0] * m[1][2]); + Inverse[0][2] = + (m[1][0] * m[2][1] - m[2][0] * m[1][1]); + Inverse[1][0] = - (m[0][1] * m[2][2] - m[2][1] * m[0][2]); + Inverse[1][1] = + (m[0][0] * m[2][2] - m[2][0] * m[0][2]); + Inverse[1][2] = - (m[0][0] * m[2][1] - m[2][0] * m[0][1]); + Inverse[2][0] = + (m[0][1] * m[1][2] - m[1][1] * m[0][2]); + Inverse[2][1] = - (m[0][0] * m[1][2] - m[1][0] * m[0][2]); + Inverse[2][2] = + (m[0][0] * m[1][1] - m[1][0] * m[0][1]); + Inverse /= Determinant; + + return Inverse; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> inverseTranspose(mat<4, 4, T, Q> const& m) + { + T SubFactor00 = m[2][2] * m[3][3] - m[3][2] * m[2][3]; + T SubFactor01 = m[2][1] * m[3][3] - m[3][1] * m[2][3]; + T SubFactor02 = m[2][1] * m[3][2] - m[3][1] * m[2][2]; + T SubFactor03 = m[2][0] * m[3][3] - m[3][0] * m[2][3]; + T SubFactor04 = m[2][0] * m[3][2] - m[3][0] * m[2][2]; + T SubFactor05 = m[2][0] * m[3][1] - m[3][0] * m[2][1]; + T SubFactor06 = m[1][2] * m[3][3] - m[3][2] * m[1][3]; + T SubFactor07 = m[1][1] * m[3][3] - m[3][1] * m[1][3]; + T SubFactor08 = m[1][1] * m[3][2] - m[3][1] * m[1][2]; + T SubFactor09 = m[1][0] * m[3][3] - m[3][0] * m[1][3]; + T SubFactor10 = m[1][0] * m[3][2] - m[3][0] * m[1][2]; + T SubFactor11 = m[1][0] * m[3][1] - m[3][0] * m[1][1]; + T SubFactor12 = m[1][2] * m[2][3] - m[2][2] * m[1][3]; + T SubFactor13 = m[1][1] * m[2][3] - m[2][1] * m[1][3]; + T SubFactor14 = m[1][1] * m[2][2] - m[2][1] * m[1][2]; + T SubFactor15 = m[1][0] * m[2][3] - m[2][0] * m[1][3]; + T SubFactor16 = m[1][0] * m[2][2] - m[2][0] * m[1][2]; + T SubFactor17 = m[1][0] * m[2][1] - m[2][0] * m[1][1]; + + mat<4, 4, T, Q> Inverse; + Inverse[0][0] = + (m[1][1] * SubFactor00 - m[1][2] * SubFactor01 + m[1][3] * SubFactor02); + Inverse[0][1] = - (m[1][0] * SubFactor00 - m[1][2] * SubFactor03 + m[1][3] * SubFactor04); + Inverse[0][2] = + (m[1][0] * SubFactor01 - m[1][1] * SubFactor03 + m[1][3] * SubFactor05); + Inverse[0][3] = - (m[1][0] * SubFactor02 - m[1][1] * SubFactor04 + m[1][2] * SubFactor05); + + Inverse[1][0] = - (m[0][1] * SubFactor00 - m[0][2] * SubFactor01 + m[0][3] * SubFactor02); + Inverse[1][1] = + (m[0][0] * SubFactor00 - m[0][2] * SubFactor03 + m[0][3] * SubFactor04); + Inverse[1][2] = - (m[0][0] * SubFactor01 - m[0][1] * SubFactor03 + m[0][3] * SubFactor05); + Inverse[1][3] = + (m[0][0] * SubFactor02 - m[0][1] * SubFactor04 + m[0][2] * SubFactor05); + + Inverse[2][0] = + (m[0][1] * SubFactor06 - m[0][2] * SubFactor07 + m[0][3] * SubFactor08); + Inverse[2][1] = - (m[0][0] * SubFactor06 - m[0][2] * SubFactor09 + m[0][3] * SubFactor10); + Inverse[2][2] = + (m[0][0] * SubFactor07 - m[0][1] * SubFactor09 + m[0][3] * SubFactor11); + Inverse[2][3] = - (m[0][0] * SubFactor08 - m[0][1] * SubFactor10 + m[0][2] * SubFactor11); + + Inverse[3][0] = - (m[0][1] * SubFactor12 - m[0][2] * SubFactor13 + m[0][3] * SubFactor14); + Inverse[3][1] = + (m[0][0] * SubFactor12 - m[0][2] * SubFactor15 + m[0][3] * SubFactor16); + Inverse[3][2] = - (m[0][0] * SubFactor13 - m[0][1] * SubFactor15 + m[0][3] * SubFactor17); + Inverse[3][3] = + (m[0][0] * SubFactor14 - m[0][1] * SubFactor16 + m[0][2] * SubFactor17); + + T Determinant = + + m[0][0] * Inverse[0][0] + + m[0][1] * Inverse[0][1] + + m[0][2] * Inverse[0][2] + + m[0][3] * Inverse[0][3]; + + Inverse /= Determinant; + + return Inverse; + } +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/matrix_transform.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/matrix_transform.hpp new file mode 100644 index 0000000000000000000000000000000000000000..22ddf1d712a5f6696056b84eddac10b005fd1c1c --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/matrix_transform.hpp @@ -0,0 +1,36 @@ +/// @ref gtc_matrix_transform +/// @file glm/gtc/matrix_transform.hpp +/// +/// @see core (dependence) +/// @see gtx_transform +/// @see gtx_transform2 +/// +/// @defgroup gtc_matrix_transform GLM_GTC_matrix_transform +/// @ingroup gtc +/// +/// Include to use the features of this extension. +/// +/// Defines functions that generate common transformation matrices. +/// +/// The matrices generated by this extension use standard OpenGL fixed-function +/// conventions. For example, the lookAt function generates a transform from world +/// space into the specific eye space that the projective matrix functions +/// (perspective, ortho, etc) are designed to expect. The OpenGL compatibility +/// specifications defines the particular layout of this eye space. + +#pragma once + +// Dependencies +#include "../mat4x4.hpp" +#include "../vec2.hpp" +#include "../vec3.hpp" +#include "../vec4.hpp" +#include "../ext/matrix_projection.hpp" +#include "../ext/matrix_clip_space.hpp" +#include "../ext/matrix_transform.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_GTC_matrix_transform extension included") +#endif + +#include "matrix_transform.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/matrix_transform.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/matrix_transform.inl new file mode 100644 index 0000000000000000000000000000000000000000..075e850a66a4cb93c13717fa05a630131401ac1f --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/matrix_transform.inl @@ -0,0 +1,3 @@ +#include "../geometric.hpp" +#include "../trigonometric.hpp" +#include "../matrix.hpp" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/noise.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/noise.hpp new file mode 100644 index 0000000000000000000000000000000000000000..3199cb33c5dc881dbf28ac07ba42a15bbe0eab0c --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/noise.hpp @@ -0,0 +1,61 @@ +/// @ref gtc_noise +/// @file glm/gtc/noise.hpp +/// +/// @see core (dependence) +/// +/// @defgroup gtc_noise GLM_GTC_noise +/// @ingroup gtc +/// +/// Include to use the features of this extension. +/// +/// Defines 2D, 3D and 4D procedural noise functions +/// Based on the work of Stefan Gustavson and Ashima Arts on "webgl-noise": +/// https://github.com/ashima/webgl-noise +/// Following Stefan Gustavson's paper "Simplex noise demystified": +/// http://www.itn.liu.se/~stegu/simplexnoise/simplexnoise.pdf + +#pragma once + +// Dependencies +#include "../detail/setup.hpp" +#include "../detail/qualifier.hpp" +#include "../detail/_noise.hpp" +#include "../geometric.hpp" +#include "../common.hpp" +#include "../vector_relational.hpp" +#include "../vec2.hpp" +#include "../vec3.hpp" +#include "../vec4.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_GTC_noise extension included") +#endif + +namespace glm +{ + /// @addtogroup gtc_noise + /// @{ + + /// Classic perlin noise. + /// @see gtc_noise + template + GLM_FUNC_DECL T perlin( + vec const& p); + + /// Periodic perlin noise. + /// @see gtc_noise + template + GLM_FUNC_DECL T perlin( + vec const& p, + vec const& rep); + + /// Simplex noise. + /// @see gtc_noise + template + GLM_FUNC_DECL T simplex( + vec const& p); + + /// @} +}//namespace glm + +#include "noise.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/noise.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/noise.inl new file mode 100644 index 0000000000000000000000000000000000000000..01acc1a531e0224a4fbd2a3c32a37fc2320c6bbb --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/noise.inl @@ -0,0 +1,807 @@ +/// @ref gtc_noise +/// +// Based on the work of Stefan Gustavson and Ashima Arts on "webgl-noise": +// https://github.com/ashima/webgl-noise +// Following Stefan Gustavson's paper "Simplex noise demystified": +// http://www.itn.liu.se/~stegu/simplexnoise/simplexnoise.pdf + +namespace glm{ +namespace gtc +{ + template + GLM_FUNC_QUALIFIER vec<4, T, Q> grad4(T const& j, vec<4, T, Q> const& ip) + { + vec<3, T, Q> pXYZ = floor(fract(vec<3, T, Q>(j) * vec<3, T, Q>(ip)) * T(7)) * ip[2] - T(1); + T pW = static_cast(1.5) - dot(abs(pXYZ), vec<3, T, Q>(1)); + vec<4, T, Q> s = vec<4, T, Q>(lessThan(vec<4, T, Q>(pXYZ, pW), vec<4, T, Q>(0.0))); + pXYZ = pXYZ + (vec<3, T, Q>(s) * T(2) - T(1)) * s.w; + return vec<4, T, Q>(pXYZ, pW); + } +}//namespace gtc + + // Classic Perlin noise + template + GLM_FUNC_QUALIFIER T perlin(vec<2, T, Q> const& Position) + { + vec<4, T, Q> Pi = glm::floor(vec<4, T, Q>(Position.x, Position.y, Position.x, Position.y)) + vec<4, T, Q>(0.0, 0.0, 1.0, 1.0); + vec<4, T, Q> Pf = glm::fract(vec<4, T, Q>(Position.x, Position.y, Position.x, Position.y)) - vec<4, T, Q>(0.0, 0.0, 1.0, 1.0); + Pi = mod(Pi, vec<4, T, Q>(289)); // To avoid truncation effects in permutation + vec<4, T, Q> ix(Pi.x, Pi.z, Pi.x, Pi.z); + vec<4, T, Q> iy(Pi.y, Pi.y, Pi.w, Pi.w); + vec<4, T, Q> fx(Pf.x, Pf.z, Pf.x, Pf.z); + vec<4, T, Q> fy(Pf.y, Pf.y, Pf.w, Pf.w); + + vec<4, T, Q> i = detail::permute(detail::permute(ix) + iy); + + vec<4, T, Q> gx = static_cast(2) * glm::fract(i / T(41)) - T(1); + vec<4, T, Q> gy = glm::abs(gx) - T(0.5); + vec<4, T, Q> tx = glm::floor(gx + T(0.5)); + gx = gx - tx; + + vec<2, T, Q> g00(gx.x, gy.x); + vec<2, T, Q> g10(gx.y, gy.y); + vec<2, T, Q> g01(gx.z, gy.z); + vec<2, T, Q> g11(gx.w, gy.w); + + vec<4, T, Q> norm = detail::taylorInvSqrt(vec<4, T, Q>(dot(g00, g00), dot(g01, g01), dot(g10, g10), dot(g11, g11))); + g00 *= norm.x; + g01 *= norm.y; + g10 *= norm.z; + g11 *= norm.w; + + T n00 = dot(g00, vec<2, T, Q>(fx.x, fy.x)); + T n10 = dot(g10, vec<2, T, Q>(fx.y, fy.y)); + T n01 = dot(g01, vec<2, T, Q>(fx.z, fy.z)); + T n11 = dot(g11, vec<2, T, Q>(fx.w, fy.w)); + + vec<2, T, Q> fade_xy = detail::fade(vec<2, T, Q>(Pf.x, Pf.y)); + vec<2, T, Q> n_x = mix(vec<2, T, Q>(n00, n01), vec<2, T, Q>(n10, n11), fade_xy.x); + T n_xy = mix(n_x.x, n_x.y, fade_xy.y); + return T(2.3) * n_xy; + } + + // Classic Perlin noise + template + GLM_FUNC_QUALIFIER T perlin(vec<3, T, Q> const& Position) + { + vec<3, T, Q> Pi0 = floor(Position); // Integer part for indexing + vec<3, T, Q> Pi1 = Pi0 + T(1); // Integer part + 1 + Pi0 = detail::mod289(Pi0); + Pi1 = detail::mod289(Pi1); + vec<3, T, Q> Pf0 = fract(Position); // Fractional part for interpolation + vec<3, T, Q> Pf1 = Pf0 - T(1); // Fractional part - 1.0 + vec<4, T, Q> ix(Pi0.x, Pi1.x, Pi0.x, Pi1.x); + vec<4, T, Q> iy = vec<4, T, Q>(vec<2, T, Q>(Pi0.y), vec<2, T, Q>(Pi1.y)); + vec<4, T, Q> iz0(Pi0.z); + vec<4, T, Q> iz1(Pi1.z); + + vec<4, T, Q> ixy = detail::permute(detail::permute(ix) + iy); + vec<4, T, Q> ixy0 = detail::permute(ixy + iz0); + vec<4, T, Q> ixy1 = detail::permute(ixy + iz1); + + vec<4, T, Q> gx0 = ixy0 * T(1.0 / 7.0); + vec<4, T, Q> gy0 = fract(floor(gx0) * T(1.0 / 7.0)) - T(0.5); + gx0 = fract(gx0); + vec<4, T, Q> gz0 = vec<4, T, Q>(0.5) - abs(gx0) - abs(gy0); + vec<4, T, Q> sz0 = step(gz0, vec<4, T, Q>(0.0)); + gx0 -= sz0 * (step(T(0), gx0) - T(0.5)); + gy0 -= sz0 * (step(T(0), gy0) - T(0.5)); + + vec<4, T, Q> gx1 = ixy1 * T(1.0 / 7.0); + vec<4, T, Q> gy1 = fract(floor(gx1) * T(1.0 / 7.0)) - T(0.5); + gx1 = fract(gx1); + vec<4, T, Q> gz1 = vec<4, T, Q>(0.5) - abs(gx1) - abs(gy1); + vec<4, T, Q> sz1 = step(gz1, vec<4, T, Q>(0.0)); + gx1 -= sz1 * (step(T(0), gx1) - T(0.5)); + gy1 -= sz1 * (step(T(0), gy1) - T(0.5)); + + vec<3, T, Q> g000(gx0.x, gy0.x, gz0.x); + vec<3, T, Q> g100(gx0.y, gy0.y, gz0.y); + vec<3, T, Q> g010(gx0.z, gy0.z, gz0.z); + vec<3, T, Q> g110(gx0.w, gy0.w, gz0.w); + vec<3, T, Q> g001(gx1.x, gy1.x, gz1.x); + vec<3, T, Q> g101(gx1.y, gy1.y, gz1.y); + vec<3, T, Q> g011(gx1.z, gy1.z, gz1.z); + vec<3, T, Q> g111(gx1.w, gy1.w, gz1.w); + + vec<4, T, Q> norm0 = detail::taylorInvSqrt(vec<4, T, Q>(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110))); + g000 *= norm0.x; + g010 *= norm0.y; + g100 *= norm0.z; + g110 *= norm0.w; + vec<4, T, Q> norm1 = detail::taylorInvSqrt(vec<4, T, Q>(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111))); + g001 *= norm1.x; + g011 *= norm1.y; + g101 *= norm1.z; + g111 *= norm1.w; + + T n000 = dot(g000, Pf0); + T n100 = dot(g100, vec<3, T, Q>(Pf1.x, Pf0.y, Pf0.z)); + T n010 = dot(g010, vec<3, T, Q>(Pf0.x, Pf1.y, Pf0.z)); + T n110 = dot(g110, vec<3, T, Q>(Pf1.x, Pf1.y, Pf0.z)); + T n001 = dot(g001, vec<3, T, Q>(Pf0.x, Pf0.y, Pf1.z)); + T n101 = dot(g101, vec<3, T, Q>(Pf1.x, Pf0.y, Pf1.z)); + T n011 = dot(g011, vec<3, T, Q>(Pf0.x, Pf1.y, Pf1.z)); + T n111 = dot(g111, Pf1); + + vec<3, T, Q> fade_xyz = detail::fade(Pf0); + vec<4, T, Q> n_z = mix(vec<4, T, Q>(n000, n100, n010, n110), vec<4, T, Q>(n001, n101, n011, n111), fade_xyz.z); + vec<2, T, Q> n_yz = mix(vec<2, T, Q>(n_z.x, n_z.y), vec<2, T, Q>(n_z.z, n_z.w), fade_xyz.y); + T n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x); + return T(2.2) * n_xyz; + } + /* + // Classic Perlin noise + template + GLM_FUNC_QUALIFIER T perlin(vec<3, T, Q> const& P) + { + vec<3, T, Q> Pi0 = floor(P); // Integer part for indexing + vec<3, T, Q> Pi1 = Pi0 + T(1); // Integer part + 1 + Pi0 = mod(Pi0, T(289)); + Pi1 = mod(Pi1, T(289)); + vec<3, T, Q> Pf0 = fract(P); // Fractional part for interpolation + vec<3, T, Q> Pf1 = Pf0 - T(1); // Fractional part - 1.0 + vec<4, T, Q> ix(Pi0.x, Pi1.x, Pi0.x, Pi1.x); + vec<4, T, Q> iy(Pi0.y, Pi0.y, Pi1.y, Pi1.y); + vec<4, T, Q> iz0(Pi0.z); + vec<4, T, Q> iz1(Pi1.z); + + vec<4, T, Q> ixy = permute(permute(ix) + iy); + vec<4, T, Q> ixy0 = permute(ixy + iz0); + vec<4, T, Q> ixy1 = permute(ixy + iz1); + + vec<4, T, Q> gx0 = ixy0 / T(7); + vec<4, T, Q> gy0 = fract(floor(gx0) / T(7)) - T(0.5); + gx0 = fract(gx0); + vec<4, T, Q> gz0 = vec<4, T, Q>(0.5) - abs(gx0) - abs(gy0); + vec<4, T, Q> sz0 = step(gz0, vec<4, T, Q>(0.0)); + gx0 -= sz0 * (step(0.0, gx0) - T(0.5)); + gy0 -= sz0 * (step(0.0, gy0) - T(0.5)); + + vec<4, T, Q> gx1 = ixy1 / T(7); + vec<4, T, Q> gy1 = fract(floor(gx1) / T(7)) - T(0.5); + gx1 = fract(gx1); + vec<4, T, Q> gz1 = vec<4, T, Q>(0.5) - abs(gx1) - abs(gy1); + vec<4, T, Q> sz1 = step(gz1, vec<4, T, Q>(0.0)); + gx1 -= sz1 * (step(T(0), gx1) - T(0.5)); + gy1 -= sz1 * (step(T(0), gy1) - T(0.5)); + + vec<3, T, Q> g000(gx0.x, gy0.x, gz0.x); + vec<3, T, Q> g100(gx0.y, gy0.y, gz0.y); + vec<3, T, Q> g010(gx0.z, gy0.z, gz0.z); + vec<3, T, Q> g110(gx0.w, gy0.w, gz0.w); + vec<3, T, Q> g001(gx1.x, gy1.x, gz1.x); + vec<3, T, Q> g101(gx1.y, gy1.y, gz1.y); + vec<3, T, Q> g011(gx1.z, gy1.z, gz1.z); + vec<3, T, Q> g111(gx1.w, gy1.w, gz1.w); + + vec<4, T, Q> norm0 = taylorInvSqrt(vec<4, T, Q>(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110))); + g000 *= norm0.x; + g010 *= norm0.y; + g100 *= norm0.z; + g110 *= norm0.w; + vec<4, T, Q> norm1 = taylorInvSqrt(vec<4, T, Q>(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111))); + g001 *= norm1.x; + g011 *= norm1.y; + g101 *= norm1.z; + g111 *= norm1.w; + + T n000 = dot(g000, Pf0); + T n100 = dot(g100, vec<3, T, Q>(Pf1.x, Pf0.y, Pf0.z)); + T n010 = dot(g010, vec<3, T, Q>(Pf0.x, Pf1.y, Pf0.z)); + T n110 = dot(g110, vec<3, T, Q>(Pf1.x, Pf1.y, Pf0.z)); + T n001 = dot(g001, vec<3, T, Q>(Pf0.x, Pf0.y, Pf1.z)); + T n101 = dot(g101, vec<3, T, Q>(Pf1.x, Pf0.y, Pf1.z)); + T n011 = dot(g011, vec<3, T, Q>(Pf0.x, Pf1.y, Pf1.z)); + T n111 = dot(g111, Pf1); + + vec<3, T, Q> fade_xyz = fade(Pf0); + vec<4, T, Q> n_z = mix(vec<4, T, Q>(n000, n100, n010, n110), vec<4, T, Q>(n001, n101, n011, n111), fade_xyz.z); + vec<2, T, Q> n_yz = mix( + vec<2, T, Q>(n_z.x, n_z.y), + vec<2, T, Q>(n_z.z, n_z.w), fade_xyz.y); + T n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x); + return T(2.2) * n_xyz; + } + */ + // Classic Perlin noise + template + GLM_FUNC_QUALIFIER T perlin(vec<4, T, Q> const& Position) + { + vec<4, T, Q> Pi0 = floor(Position); // Integer part for indexing + vec<4, T, Q> Pi1 = Pi0 + T(1); // Integer part + 1 + Pi0 = mod(Pi0, vec<4, T, Q>(289)); + Pi1 = mod(Pi1, vec<4, T, Q>(289)); + vec<4, T, Q> Pf0 = fract(Position); // Fractional part for interpolation + vec<4, T, Q> Pf1 = Pf0 - T(1); // Fractional part - 1.0 + vec<4, T, Q> ix(Pi0.x, Pi1.x, Pi0.x, Pi1.x); + vec<4, T, Q> iy(Pi0.y, Pi0.y, Pi1.y, Pi1.y); + vec<4, T, Q> iz0(Pi0.z); + vec<4, T, Q> iz1(Pi1.z); + vec<4, T, Q> iw0(Pi0.w); + vec<4, T, Q> iw1(Pi1.w); + + vec<4, T, Q> ixy = detail::permute(detail::permute(ix) + iy); + vec<4, T, Q> ixy0 = detail::permute(ixy + iz0); + vec<4, T, Q> ixy1 = detail::permute(ixy + iz1); + vec<4, T, Q> ixy00 = detail::permute(ixy0 + iw0); + vec<4, T, Q> ixy01 = detail::permute(ixy0 + iw1); + vec<4, T, Q> ixy10 = detail::permute(ixy1 + iw0); + vec<4, T, Q> ixy11 = detail::permute(ixy1 + iw1); + + vec<4, T, Q> gx00 = ixy00 / T(7); + vec<4, T, Q> gy00 = floor(gx00) / T(7); + vec<4, T, Q> gz00 = floor(gy00) / T(6); + gx00 = fract(gx00) - T(0.5); + gy00 = fract(gy00) - T(0.5); + gz00 = fract(gz00) - T(0.5); + vec<4, T, Q> gw00 = vec<4, T, Q>(0.75) - abs(gx00) - abs(gy00) - abs(gz00); + vec<4, T, Q> sw00 = step(gw00, vec<4, T, Q>(0.0)); + gx00 -= sw00 * (step(T(0), gx00) - T(0.5)); + gy00 -= sw00 * (step(T(0), gy00) - T(0.5)); + + vec<4, T, Q> gx01 = ixy01 / T(7); + vec<4, T, Q> gy01 = floor(gx01) / T(7); + vec<4, T, Q> gz01 = floor(gy01) / T(6); + gx01 = fract(gx01) - T(0.5); + gy01 = fract(gy01) - T(0.5); + gz01 = fract(gz01) - T(0.5); + vec<4, T, Q> gw01 = vec<4, T, Q>(0.75) - abs(gx01) - abs(gy01) - abs(gz01); + vec<4, T, Q> sw01 = step(gw01, vec<4, T, Q>(0.0)); + gx01 -= sw01 * (step(T(0), gx01) - T(0.5)); + gy01 -= sw01 * (step(T(0), gy01) - T(0.5)); + + vec<4, T, Q> gx10 = ixy10 / T(7); + vec<4, T, Q> gy10 = floor(gx10) / T(7); + vec<4, T, Q> gz10 = floor(gy10) / T(6); + gx10 = fract(gx10) - T(0.5); + gy10 = fract(gy10) - T(0.5); + gz10 = fract(gz10) - T(0.5); + vec<4, T, Q> gw10 = vec<4, T, Q>(0.75) - abs(gx10) - abs(gy10) - abs(gz10); + vec<4, T, Q> sw10 = step(gw10, vec<4, T, Q>(0)); + gx10 -= sw10 * (step(T(0), gx10) - T(0.5)); + gy10 -= sw10 * (step(T(0), gy10) - T(0.5)); + + vec<4, T, Q> gx11 = ixy11 / T(7); + vec<4, T, Q> gy11 = floor(gx11) / T(7); + vec<4, T, Q> gz11 = floor(gy11) / T(6); + gx11 = fract(gx11) - T(0.5); + gy11 = fract(gy11) - T(0.5); + gz11 = fract(gz11) - T(0.5); + vec<4, T, Q> gw11 = vec<4, T, Q>(0.75) - abs(gx11) - abs(gy11) - abs(gz11); + vec<4, T, Q> sw11 = step(gw11, vec<4, T, Q>(0.0)); + gx11 -= sw11 * (step(T(0), gx11) - T(0.5)); + gy11 -= sw11 * (step(T(0), gy11) - T(0.5)); + + vec<4, T, Q> g0000(gx00.x, gy00.x, gz00.x, gw00.x); + vec<4, T, Q> g1000(gx00.y, gy00.y, gz00.y, gw00.y); + vec<4, T, Q> g0100(gx00.z, gy00.z, gz00.z, gw00.z); + vec<4, T, Q> g1100(gx00.w, gy00.w, gz00.w, gw00.w); + vec<4, T, Q> g0010(gx10.x, gy10.x, gz10.x, gw10.x); + vec<4, T, Q> g1010(gx10.y, gy10.y, gz10.y, gw10.y); + vec<4, T, Q> g0110(gx10.z, gy10.z, gz10.z, gw10.z); + vec<4, T, Q> g1110(gx10.w, gy10.w, gz10.w, gw10.w); + vec<4, T, Q> g0001(gx01.x, gy01.x, gz01.x, gw01.x); + vec<4, T, Q> g1001(gx01.y, gy01.y, gz01.y, gw01.y); + vec<4, T, Q> g0101(gx01.z, gy01.z, gz01.z, gw01.z); + vec<4, T, Q> g1101(gx01.w, gy01.w, gz01.w, gw01.w); + vec<4, T, Q> g0011(gx11.x, gy11.x, gz11.x, gw11.x); + vec<4, T, Q> g1011(gx11.y, gy11.y, gz11.y, gw11.y); + vec<4, T, Q> g0111(gx11.z, gy11.z, gz11.z, gw11.z); + vec<4, T, Q> g1111(gx11.w, gy11.w, gz11.w, gw11.w); + + vec<4, T, Q> norm00 = detail::taylorInvSqrt(vec<4, T, Q>(dot(g0000, g0000), dot(g0100, g0100), dot(g1000, g1000), dot(g1100, g1100))); + g0000 *= norm00.x; + g0100 *= norm00.y; + g1000 *= norm00.z; + g1100 *= norm00.w; + + vec<4, T, Q> norm01 = detail::taylorInvSqrt(vec<4, T, Q>(dot(g0001, g0001), dot(g0101, g0101), dot(g1001, g1001), dot(g1101, g1101))); + g0001 *= norm01.x; + g0101 *= norm01.y; + g1001 *= norm01.z; + g1101 *= norm01.w; + + vec<4, T, Q> norm10 = detail::taylorInvSqrt(vec<4, T, Q>(dot(g0010, g0010), dot(g0110, g0110), dot(g1010, g1010), dot(g1110, g1110))); + g0010 *= norm10.x; + g0110 *= norm10.y; + g1010 *= norm10.z; + g1110 *= norm10.w; + + vec<4, T, Q> norm11 = detail::taylorInvSqrt(vec<4, T, Q>(dot(g0011, g0011), dot(g0111, g0111), dot(g1011, g1011), dot(g1111, g1111))); + g0011 *= norm11.x; + g0111 *= norm11.y; + g1011 *= norm11.z; + g1111 *= norm11.w; + + T n0000 = dot(g0000, Pf0); + T n1000 = dot(g1000, vec<4, T, Q>(Pf1.x, Pf0.y, Pf0.z, Pf0.w)); + T n0100 = dot(g0100, vec<4, T, Q>(Pf0.x, Pf1.y, Pf0.z, Pf0.w)); + T n1100 = dot(g1100, vec<4, T, Q>(Pf1.x, Pf1.y, Pf0.z, Pf0.w)); + T n0010 = dot(g0010, vec<4, T, Q>(Pf0.x, Pf0.y, Pf1.z, Pf0.w)); + T n1010 = dot(g1010, vec<4, T, Q>(Pf1.x, Pf0.y, Pf1.z, Pf0.w)); + T n0110 = dot(g0110, vec<4, T, Q>(Pf0.x, Pf1.y, Pf1.z, Pf0.w)); + T n1110 = dot(g1110, vec<4, T, Q>(Pf1.x, Pf1.y, Pf1.z, Pf0.w)); + T n0001 = dot(g0001, vec<4, T, Q>(Pf0.x, Pf0.y, Pf0.z, Pf1.w)); + T n1001 = dot(g1001, vec<4, T, Q>(Pf1.x, Pf0.y, Pf0.z, Pf1.w)); + T n0101 = dot(g0101, vec<4, T, Q>(Pf0.x, Pf1.y, Pf0.z, Pf1.w)); + T n1101 = dot(g1101, vec<4, T, Q>(Pf1.x, Pf1.y, Pf0.z, Pf1.w)); + T n0011 = dot(g0011, vec<4, T, Q>(Pf0.x, Pf0.y, Pf1.z, Pf1.w)); + T n1011 = dot(g1011, vec<4, T, Q>(Pf1.x, Pf0.y, Pf1.z, Pf1.w)); + T n0111 = dot(g0111, vec<4, T, Q>(Pf0.x, Pf1.y, Pf1.z, Pf1.w)); + T n1111 = dot(g1111, Pf1); + + vec<4, T, Q> fade_xyzw = detail::fade(Pf0); + vec<4, T, Q> n_0w = mix(vec<4, T, Q>(n0000, n1000, n0100, n1100), vec<4, T, Q>(n0001, n1001, n0101, n1101), fade_xyzw.w); + vec<4, T, Q> n_1w = mix(vec<4, T, Q>(n0010, n1010, n0110, n1110), vec<4, T, Q>(n0011, n1011, n0111, n1111), fade_xyzw.w); + vec<4, T, Q> n_zw = mix(n_0w, n_1w, fade_xyzw.z); + vec<2, T, Q> n_yzw = mix(vec<2, T, Q>(n_zw.x, n_zw.y), vec<2, T, Q>(n_zw.z, n_zw.w), fade_xyzw.y); + T n_xyzw = mix(n_yzw.x, n_yzw.y, fade_xyzw.x); + return T(2.2) * n_xyzw; + } + + // Classic Perlin noise, periodic variant + template + GLM_FUNC_QUALIFIER T perlin(vec<2, T, Q> const& Position, vec<2, T, Q> const& rep) + { + vec<4, T, Q> Pi = floor(vec<4, T, Q>(Position.x, Position.y, Position.x, Position.y)) + vec<4, T, Q>(0.0, 0.0, 1.0, 1.0); + vec<4, T, Q> Pf = fract(vec<4, T, Q>(Position.x, Position.y, Position.x, Position.y)) - vec<4, T, Q>(0.0, 0.0, 1.0, 1.0); + Pi = mod(Pi, vec<4, T, Q>(rep.x, rep.y, rep.x, rep.y)); // To create noise with explicit period + Pi = mod(Pi, vec<4, T, Q>(289)); // To avoid truncation effects in permutation + vec<4, T, Q> ix(Pi.x, Pi.z, Pi.x, Pi.z); + vec<4, T, Q> iy(Pi.y, Pi.y, Pi.w, Pi.w); + vec<4, T, Q> fx(Pf.x, Pf.z, Pf.x, Pf.z); + vec<4, T, Q> fy(Pf.y, Pf.y, Pf.w, Pf.w); + + vec<4, T, Q> i = detail::permute(detail::permute(ix) + iy); + + vec<4, T, Q> gx = static_cast(2) * fract(i / T(41)) - T(1); + vec<4, T, Q> gy = abs(gx) - T(0.5); + vec<4, T, Q> tx = floor(gx + T(0.5)); + gx = gx - tx; + + vec<2, T, Q> g00(gx.x, gy.x); + vec<2, T, Q> g10(gx.y, gy.y); + vec<2, T, Q> g01(gx.z, gy.z); + vec<2, T, Q> g11(gx.w, gy.w); + + vec<4, T, Q> norm = detail::taylorInvSqrt(vec<4, T, Q>(dot(g00, g00), dot(g01, g01), dot(g10, g10), dot(g11, g11))); + g00 *= norm.x; + g01 *= norm.y; + g10 *= norm.z; + g11 *= norm.w; + + T n00 = dot(g00, vec<2, T, Q>(fx.x, fy.x)); + T n10 = dot(g10, vec<2, T, Q>(fx.y, fy.y)); + T n01 = dot(g01, vec<2, T, Q>(fx.z, fy.z)); + T n11 = dot(g11, vec<2, T, Q>(fx.w, fy.w)); + + vec<2, T, Q> fade_xy = detail::fade(vec<2, T, Q>(Pf.x, Pf.y)); + vec<2, T, Q> n_x = mix(vec<2, T, Q>(n00, n01), vec<2, T, Q>(n10, n11), fade_xy.x); + T n_xy = mix(n_x.x, n_x.y, fade_xy.y); + return T(2.3) * n_xy; + } + + // Classic Perlin noise, periodic variant + template + GLM_FUNC_QUALIFIER T perlin(vec<3, T, Q> const& Position, vec<3, T, Q> const& rep) + { + vec<3, T, Q> Pi0 = mod(floor(Position), rep); // Integer part, modulo period + vec<3, T, Q> Pi1 = mod(Pi0 + vec<3, T, Q>(T(1)), rep); // Integer part + 1, mod period + Pi0 = mod(Pi0, vec<3, T, Q>(289)); + Pi1 = mod(Pi1, vec<3, T, Q>(289)); + vec<3, T, Q> Pf0 = fract(Position); // Fractional part for interpolation + vec<3, T, Q> Pf1 = Pf0 - vec<3, T, Q>(T(1)); // Fractional part - 1.0 + vec<4, T, Q> ix = vec<4, T, Q>(Pi0.x, Pi1.x, Pi0.x, Pi1.x); + vec<4, T, Q> iy = vec<4, T, Q>(Pi0.y, Pi0.y, Pi1.y, Pi1.y); + vec<4, T, Q> iz0(Pi0.z); + vec<4, T, Q> iz1(Pi1.z); + + vec<4, T, Q> ixy = detail::permute(detail::permute(ix) + iy); + vec<4, T, Q> ixy0 = detail::permute(ixy + iz0); + vec<4, T, Q> ixy1 = detail::permute(ixy + iz1); + + vec<4, T, Q> gx0 = ixy0 / T(7); + vec<4, T, Q> gy0 = fract(floor(gx0) / T(7)) - T(0.5); + gx0 = fract(gx0); + vec<4, T, Q> gz0 = vec<4, T, Q>(0.5) - abs(gx0) - abs(gy0); + vec<4, T, Q> sz0 = step(gz0, vec<4, T, Q>(0)); + gx0 -= sz0 * (step(T(0), gx0) - T(0.5)); + gy0 -= sz0 * (step(T(0), gy0) - T(0.5)); + + vec<4, T, Q> gx1 = ixy1 / T(7); + vec<4, T, Q> gy1 = fract(floor(gx1) / T(7)) - T(0.5); + gx1 = fract(gx1); + vec<4, T, Q> gz1 = vec<4, T, Q>(0.5) - abs(gx1) - abs(gy1); + vec<4, T, Q> sz1 = step(gz1, vec<4, T, Q>(T(0))); + gx1 -= sz1 * (step(T(0), gx1) - T(0.5)); + gy1 -= sz1 * (step(T(0), gy1) - T(0.5)); + + vec<3, T, Q> g000 = vec<3, T, Q>(gx0.x, gy0.x, gz0.x); + vec<3, T, Q> g100 = vec<3, T, Q>(gx0.y, gy0.y, gz0.y); + vec<3, T, Q> g010 = vec<3, T, Q>(gx0.z, gy0.z, gz0.z); + vec<3, T, Q> g110 = vec<3, T, Q>(gx0.w, gy0.w, gz0.w); + vec<3, T, Q> g001 = vec<3, T, Q>(gx1.x, gy1.x, gz1.x); + vec<3, T, Q> g101 = vec<3, T, Q>(gx1.y, gy1.y, gz1.y); + vec<3, T, Q> g011 = vec<3, T, Q>(gx1.z, gy1.z, gz1.z); + vec<3, T, Q> g111 = vec<3, T, Q>(gx1.w, gy1.w, gz1.w); + + vec<4, T, Q> norm0 = detail::taylorInvSqrt(vec<4, T, Q>(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110))); + g000 *= norm0.x; + g010 *= norm0.y; + g100 *= norm0.z; + g110 *= norm0.w; + vec<4, T, Q> norm1 = detail::taylorInvSqrt(vec<4, T, Q>(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111))); + g001 *= norm1.x; + g011 *= norm1.y; + g101 *= norm1.z; + g111 *= norm1.w; + + T n000 = dot(g000, Pf0); + T n100 = dot(g100, vec<3, T, Q>(Pf1.x, Pf0.y, Pf0.z)); + T n010 = dot(g010, vec<3, T, Q>(Pf0.x, Pf1.y, Pf0.z)); + T n110 = dot(g110, vec<3, T, Q>(Pf1.x, Pf1.y, Pf0.z)); + T n001 = dot(g001, vec<3, T, Q>(Pf0.x, Pf0.y, Pf1.z)); + T n101 = dot(g101, vec<3, T, Q>(Pf1.x, Pf0.y, Pf1.z)); + T n011 = dot(g011, vec<3, T, Q>(Pf0.x, Pf1.y, Pf1.z)); + T n111 = dot(g111, Pf1); + + vec<3, T, Q> fade_xyz = detail::fade(Pf0); + vec<4, T, Q> n_z = mix(vec<4, T, Q>(n000, n100, n010, n110), vec<4, T, Q>(n001, n101, n011, n111), fade_xyz.z); + vec<2, T, Q> n_yz = mix(vec<2, T, Q>(n_z.x, n_z.y), vec<2, T, Q>(n_z.z, n_z.w), fade_xyz.y); + T n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x); + return T(2.2) * n_xyz; + } + + // Classic Perlin noise, periodic version + template + GLM_FUNC_QUALIFIER T perlin(vec<4, T, Q> const& Position, vec<4, T, Q> const& rep) + { + vec<4, T, Q> Pi0 = mod(floor(Position), rep); // Integer part modulo rep + vec<4, T, Q> Pi1 = mod(Pi0 + T(1), rep); // Integer part + 1 mod rep + vec<4, T, Q> Pf0 = fract(Position); // Fractional part for interpolation + vec<4, T, Q> Pf1 = Pf0 - T(1); // Fractional part - 1.0 + vec<4, T, Q> ix = vec<4, T, Q>(Pi0.x, Pi1.x, Pi0.x, Pi1.x); + vec<4, T, Q> iy = vec<4, T, Q>(Pi0.y, Pi0.y, Pi1.y, Pi1.y); + vec<4, T, Q> iz0(Pi0.z); + vec<4, T, Q> iz1(Pi1.z); + vec<4, T, Q> iw0(Pi0.w); + vec<4, T, Q> iw1(Pi1.w); + + vec<4, T, Q> ixy = detail::permute(detail::permute(ix) + iy); + vec<4, T, Q> ixy0 = detail::permute(ixy + iz0); + vec<4, T, Q> ixy1 = detail::permute(ixy + iz1); + vec<4, T, Q> ixy00 = detail::permute(ixy0 + iw0); + vec<4, T, Q> ixy01 = detail::permute(ixy0 + iw1); + vec<4, T, Q> ixy10 = detail::permute(ixy1 + iw0); + vec<4, T, Q> ixy11 = detail::permute(ixy1 + iw1); + + vec<4, T, Q> gx00 = ixy00 / T(7); + vec<4, T, Q> gy00 = floor(gx00) / T(7); + vec<4, T, Q> gz00 = floor(gy00) / T(6); + gx00 = fract(gx00) - T(0.5); + gy00 = fract(gy00) - T(0.5); + gz00 = fract(gz00) - T(0.5); + vec<4, T, Q> gw00 = vec<4, T, Q>(0.75) - abs(gx00) - abs(gy00) - abs(gz00); + vec<4, T, Q> sw00 = step(gw00, vec<4, T, Q>(0)); + gx00 -= sw00 * (step(T(0), gx00) - T(0.5)); + gy00 -= sw00 * (step(T(0), gy00) - T(0.5)); + + vec<4, T, Q> gx01 = ixy01 / T(7); + vec<4, T, Q> gy01 = floor(gx01) / T(7); + vec<4, T, Q> gz01 = floor(gy01) / T(6); + gx01 = fract(gx01) - T(0.5); + gy01 = fract(gy01) - T(0.5); + gz01 = fract(gz01) - T(0.5); + vec<4, T, Q> gw01 = vec<4, T, Q>(0.75) - abs(gx01) - abs(gy01) - abs(gz01); + vec<4, T, Q> sw01 = step(gw01, vec<4, T, Q>(0.0)); + gx01 -= sw01 * (step(T(0), gx01) - T(0.5)); + gy01 -= sw01 * (step(T(0), gy01) - T(0.5)); + + vec<4, T, Q> gx10 = ixy10 / T(7); + vec<4, T, Q> gy10 = floor(gx10) / T(7); + vec<4, T, Q> gz10 = floor(gy10) / T(6); + gx10 = fract(gx10) - T(0.5); + gy10 = fract(gy10) - T(0.5); + gz10 = fract(gz10) - T(0.5); + vec<4, T, Q> gw10 = vec<4, T, Q>(0.75) - abs(gx10) - abs(gy10) - abs(gz10); + vec<4, T, Q> sw10 = step(gw10, vec<4, T, Q>(0.0)); + gx10 -= sw10 * (step(T(0), gx10) - T(0.5)); + gy10 -= sw10 * (step(T(0), gy10) - T(0.5)); + + vec<4, T, Q> gx11 = ixy11 / T(7); + vec<4, T, Q> gy11 = floor(gx11) / T(7); + vec<4, T, Q> gz11 = floor(gy11) / T(6); + gx11 = fract(gx11) - T(0.5); + gy11 = fract(gy11) - T(0.5); + gz11 = fract(gz11) - T(0.5); + vec<4, T, Q> gw11 = vec<4, T, Q>(0.75) - abs(gx11) - abs(gy11) - abs(gz11); + vec<4, T, Q> sw11 = step(gw11, vec<4, T, Q>(T(0))); + gx11 -= sw11 * (step(T(0), gx11) - T(0.5)); + gy11 -= sw11 * (step(T(0), gy11) - T(0.5)); + + vec<4, T, Q> g0000(gx00.x, gy00.x, gz00.x, gw00.x); + vec<4, T, Q> g1000(gx00.y, gy00.y, gz00.y, gw00.y); + vec<4, T, Q> g0100(gx00.z, gy00.z, gz00.z, gw00.z); + vec<4, T, Q> g1100(gx00.w, gy00.w, gz00.w, gw00.w); + vec<4, T, Q> g0010(gx10.x, gy10.x, gz10.x, gw10.x); + vec<4, T, Q> g1010(gx10.y, gy10.y, gz10.y, gw10.y); + vec<4, T, Q> g0110(gx10.z, gy10.z, gz10.z, gw10.z); + vec<4, T, Q> g1110(gx10.w, gy10.w, gz10.w, gw10.w); + vec<4, T, Q> g0001(gx01.x, gy01.x, gz01.x, gw01.x); + vec<4, T, Q> g1001(gx01.y, gy01.y, gz01.y, gw01.y); + vec<4, T, Q> g0101(gx01.z, gy01.z, gz01.z, gw01.z); + vec<4, T, Q> g1101(gx01.w, gy01.w, gz01.w, gw01.w); + vec<4, T, Q> g0011(gx11.x, gy11.x, gz11.x, gw11.x); + vec<4, T, Q> g1011(gx11.y, gy11.y, gz11.y, gw11.y); + vec<4, T, Q> g0111(gx11.z, gy11.z, gz11.z, gw11.z); + vec<4, T, Q> g1111(gx11.w, gy11.w, gz11.w, gw11.w); + + vec<4, T, Q> norm00 = detail::taylorInvSqrt(vec<4, T, Q>(dot(g0000, g0000), dot(g0100, g0100), dot(g1000, g1000), dot(g1100, g1100))); + g0000 *= norm00.x; + g0100 *= norm00.y; + g1000 *= norm00.z; + g1100 *= norm00.w; + + vec<4, T, Q> norm01 = detail::taylorInvSqrt(vec<4, T, Q>(dot(g0001, g0001), dot(g0101, g0101), dot(g1001, g1001), dot(g1101, g1101))); + g0001 *= norm01.x; + g0101 *= norm01.y; + g1001 *= norm01.z; + g1101 *= norm01.w; + + vec<4, T, Q> norm10 = detail::taylorInvSqrt(vec<4, T, Q>(dot(g0010, g0010), dot(g0110, g0110), dot(g1010, g1010), dot(g1110, g1110))); + g0010 *= norm10.x; + g0110 *= norm10.y; + g1010 *= norm10.z; + g1110 *= norm10.w; + + vec<4, T, Q> norm11 = detail::taylorInvSqrt(vec<4, T, Q>(dot(g0011, g0011), dot(g0111, g0111), dot(g1011, g1011), dot(g1111, g1111))); + g0011 *= norm11.x; + g0111 *= norm11.y; + g1011 *= norm11.z; + g1111 *= norm11.w; + + T n0000 = dot(g0000, Pf0); + T n1000 = dot(g1000, vec<4, T, Q>(Pf1.x, Pf0.y, Pf0.z, Pf0.w)); + T n0100 = dot(g0100, vec<4, T, Q>(Pf0.x, Pf1.y, Pf0.z, Pf0.w)); + T n1100 = dot(g1100, vec<4, T, Q>(Pf1.x, Pf1.y, Pf0.z, Pf0.w)); + T n0010 = dot(g0010, vec<4, T, Q>(Pf0.x, Pf0.y, Pf1.z, Pf0.w)); + T n1010 = dot(g1010, vec<4, T, Q>(Pf1.x, Pf0.y, Pf1.z, Pf0.w)); + T n0110 = dot(g0110, vec<4, T, Q>(Pf0.x, Pf1.y, Pf1.z, Pf0.w)); + T n1110 = dot(g1110, vec<4, T, Q>(Pf1.x, Pf1.y, Pf1.z, Pf0.w)); + T n0001 = dot(g0001, vec<4, T, Q>(Pf0.x, Pf0.y, Pf0.z, Pf1.w)); + T n1001 = dot(g1001, vec<4, T, Q>(Pf1.x, Pf0.y, Pf0.z, Pf1.w)); + T n0101 = dot(g0101, vec<4, T, Q>(Pf0.x, Pf1.y, Pf0.z, Pf1.w)); + T n1101 = dot(g1101, vec<4, T, Q>(Pf1.x, Pf1.y, Pf0.z, Pf1.w)); + T n0011 = dot(g0011, vec<4, T, Q>(Pf0.x, Pf0.y, Pf1.z, Pf1.w)); + T n1011 = dot(g1011, vec<4, T, Q>(Pf1.x, Pf0.y, Pf1.z, Pf1.w)); + T n0111 = dot(g0111, vec<4, T, Q>(Pf0.x, Pf1.y, Pf1.z, Pf1.w)); + T n1111 = dot(g1111, Pf1); + + vec<4, T, Q> fade_xyzw = detail::fade(Pf0); + vec<4, T, Q> n_0w = mix(vec<4, T, Q>(n0000, n1000, n0100, n1100), vec<4, T, Q>(n0001, n1001, n0101, n1101), fade_xyzw.w); + vec<4, T, Q> n_1w = mix(vec<4, T, Q>(n0010, n1010, n0110, n1110), vec<4, T, Q>(n0011, n1011, n0111, n1111), fade_xyzw.w); + vec<4, T, Q> n_zw = mix(n_0w, n_1w, fade_xyzw.z); + vec<2, T, Q> n_yzw = mix(vec<2, T, Q>(n_zw.x, n_zw.y), vec<2, T, Q>(n_zw.z, n_zw.w), fade_xyzw.y); + T n_xyzw = mix(n_yzw.x, n_yzw.y, fade_xyzw.x); + return T(2.2) * n_xyzw; + } + + template + GLM_FUNC_QUALIFIER T simplex(glm::vec<2, T, Q> const& v) + { + vec<4, T, Q> const C = vec<4, T, Q>( + T( 0.211324865405187), // (3.0 - sqrt(3.0)) / 6.0 + T( 0.366025403784439), // 0.5 * (sqrt(3.0) - 1.0) + T(-0.577350269189626), // -1.0 + 2.0 * C.x + T( 0.024390243902439)); // 1.0 / 41.0 + + // First corner + vec<2, T, Q> i = floor(v + dot(v, vec<2, T, Q>(C[1]))); + vec<2, T, Q> x0 = v - i + dot(i, vec<2, T, Q>(C[0])); + + // Other corners + //i1.x = step( x0.y, x0.x ); // x0.x > x0.y ? 1.0 : 0.0 + //i1.y = 1.0 - i1.x; + vec<2, T, Q> i1 = (x0.x > x0.y) ? vec<2, T, Q>(1, 0) : vec<2, T, Q>(0, 1); + // x0 = x0 - 0.0 + 0.0 * C.xx ; + // x1 = x0 - i1 + 1.0 * C.xx ; + // x2 = x0 - 1.0 + 2.0 * C.xx ; + vec<4, T, Q> x12 = vec<4, T, Q>(x0.x, x0.y, x0.x, x0.y) + vec<4, T, Q>(C.x, C.x, C.z, C.z); + x12 = vec<4, T, Q>(vec<2, T, Q>(x12) - i1, x12.z, x12.w); + + // Permutations + i = mod(i, vec<2, T, Q>(289)); // Avoid truncation effects in permutation + vec<3, T, Q> p = detail::permute( + detail::permute(i.y + vec<3, T, Q>(T(0), i1.y, T(1))) + + i.x + vec<3, T, Q>(T(0), i1.x, T(1))); + + vec<3, T, Q> m = max(vec<3, T, Q>(0.5) - vec<3, T, Q>( + dot(x0, x0), + dot(vec<2, T, Q>(x12.x, x12.y), vec<2, T, Q>(x12.x, x12.y)), + dot(vec<2, T, Q>(x12.z, x12.w), vec<2, T, Q>(x12.z, x12.w))), vec<3, T, Q>(0)); + m = m * m ; + m = m * m ; + + // Gradients: 41 points uniformly over a line, mapped onto a diamond. + // The ring size 17*17 = 289 is close to a multiple of 41 (41*7 = 287) + + vec<3, T, Q> x = static_cast(2) * fract(p * C.w) - T(1); + vec<3, T, Q> h = abs(x) - T(0.5); + vec<3, T, Q> ox = floor(x + T(0.5)); + vec<3, T, Q> a0 = x - ox; + + // Normalise gradients implicitly by scaling m + // Inlined for speed: m *= taylorInvSqrt( a0*a0 + h*h ); + m *= static_cast(1.79284291400159) - T(0.85373472095314) * (a0 * a0 + h * h); + + // Compute final noise value at P + vec<3, T, Q> g; + g.x = a0.x * x0.x + h.x * x0.y; + //g.yz = a0.yz * x12.xz + h.yz * x12.yw; + g.y = a0.y * x12.x + h.y * x12.y; + g.z = a0.z * x12.z + h.z * x12.w; + return T(130) * dot(m, g); + } + + template + GLM_FUNC_QUALIFIER T simplex(vec<3, T, Q> const& v) + { + vec<2, T, Q> const C(1.0 / 6.0, 1.0 / 3.0); + vec<4, T, Q> const D(0.0, 0.5, 1.0, 2.0); + + // First corner + vec<3, T, Q> i(floor(v + dot(v, vec<3, T, Q>(C.y)))); + vec<3, T, Q> x0(v - i + dot(i, vec<3, T, Q>(C.x))); + + // Other corners + vec<3, T, Q> g(step(vec<3, T, Q>(x0.y, x0.z, x0.x), x0)); + vec<3, T, Q> l(T(1) - g); + vec<3, T, Q> i1(min(g, vec<3, T, Q>(l.z, l.x, l.y))); + vec<3, T, Q> i2(max(g, vec<3, T, Q>(l.z, l.x, l.y))); + + // x0 = x0 - 0.0 + 0.0 * C.xxx; + // x1 = x0 - i1 + 1.0 * C.xxx; + // x2 = x0 - i2 + 2.0 * C.xxx; + // x3 = x0 - 1.0 + 3.0 * C.xxx; + vec<3, T, Q> x1(x0 - i1 + C.x); + vec<3, T, Q> x2(x0 - i2 + C.y); // 2.0*C.x = 1/3 = C.y + vec<3, T, Q> x3(x0 - D.y); // -1.0+3.0*C.x = -0.5 = -D.y + + // Permutations + i = detail::mod289(i); + vec<4, T, Q> p(detail::permute(detail::permute(detail::permute( + i.z + vec<4, T, Q>(T(0), i1.z, i2.z, T(1))) + + i.y + vec<4, T, Q>(T(0), i1.y, i2.y, T(1))) + + i.x + vec<4, T, Q>(T(0), i1.x, i2.x, T(1)))); + + // Gradients: 7x7 points over a square, mapped onto an octahedron. + // The ring size 17*17 = 289 is close to a multiple of 49 (49*6 = 294) + T n_ = static_cast(0.142857142857); // 1.0/7.0 + vec<3, T, Q> ns(n_ * vec<3, T, Q>(D.w, D.y, D.z) - vec<3, T, Q>(D.x, D.z, D.x)); + + vec<4, T, Q> j(p - T(49) * floor(p * ns.z * ns.z)); // mod(p,7*7) + + vec<4, T, Q> x_(floor(j * ns.z)); + vec<4, T, Q> y_(floor(j - T(7) * x_)); // mod(j,N) + + vec<4, T, Q> x(x_ * ns.x + ns.y); + vec<4, T, Q> y(y_ * ns.x + ns.y); + vec<4, T, Q> h(T(1) - abs(x) - abs(y)); + + vec<4, T, Q> b0(x.x, x.y, y.x, y.y); + vec<4, T, Q> b1(x.z, x.w, y.z, y.w); + + // vec4 s0 = vec4(lessThan(b0,0.0))*2.0 - 1.0; + // vec4 s1 = vec4(lessThan(b1,0.0))*2.0 - 1.0; + vec<4, T, Q> s0(floor(b0) * T(2) + T(1)); + vec<4, T, Q> s1(floor(b1) * T(2) + T(1)); + vec<4, T, Q> sh(-step(h, vec<4, T, Q>(0.0))); + + vec<4, T, Q> a0 = vec<4, T, Q>(b0.x, b0.z, b0.y, b0.w) + vec<4, T, Q>(s0.x, s0.z, s0.y, s0.w) * vec<4, T, Q>(sh.x, sh.x, sh.y, sh.y); + vec<4, T, Q> a1 = vec<4, T, Q>(b1.x, b1.z, b1.y, b1.w) + vec<4, T, Q>(s1.x, s1.z, s1.y, s1.w) * vec<4, T, Q>(sh.z, sh.z, sh.w, sh.w); + + vec<3, T, Q> p0(a0.x, a0.y, h.x); + vec<3, T, Q> p1(a0.z, a0.w, h.y); + vec<3, T, Q> p2(a1.x, a1.y, h.z); + vec<3, T, Q> p3(a1.z, a1.w, h.w); + + // Normalise gradients + vec<4, T, Q> norm = detail::taylorInvSqrt(vec<4, T, Q>(dot(p0, p0), dot(p1, p1), dot(p2, p2), dot(p3, p3))); + p0 *= norm.x; + p1 *= norm.y; + p2 *= norm.z; + p3 *= norm.w; + + // Mix final noise value + vec<4, T, Q> m = max(T(0.6) - vec<4, T, Q>(dot(x0, x0), dot(x1, x1), dot(x2, x2), dot(x3, x3)), vec<4, T, Q>(0)); + m = m * m; + return T(42) * dot(m * m, vec<4, T, Q>(dot(p0, x0), dot(p1, x1), dot(p2, x2), dot(p3, x3))); + } + + template + GLM_FUNC_QUALIFIER T simplex(vec<4, T, Q> const& v) + { + vec<4, T, Q> const C( + 0.138196601125011, // (5 - sqrt(5))/20 G4 + 0.276393202250021, // 2 * G4 + 0.414589803375032, // 3 * G4 + -0.447213595499958); // -1 + 4 * G4 + + // (sqrt(5) - 1)/4 = F4, used once below + T const F4 = static_cast(0.309016994374947451); + + // First corner + vec<4, T, Q> i = floor(v + dot(v, vec<4, T, Q>(F4))); + vec<4, T, Q> x0 = v - i + dot(i, vec<4, T, Q>(C.x)); + + // Other corners + + // Rank sorting originally contributed by Bill Licea-Kane, AMD (formerly ATI) + vec<4, T, Q> i0; + vec<3, T, Q> isX = step(vec<3, T, Q>(x0.y, x0.z, x0.w), vec<3, T, Q>(x0.x)); + vec<3, T, Q> isYZ = step(vec<3, T, Q>(x0.z, x0.w, x0.w), vec<3, T, Q>(x0.y, x0.y, x0.z)); + // i0.x = dot(isX, vec3(1.0)); + //i0.x = isX.x + isX.y + isX.z; + //i0.yzw = static_cast(1) - isX; + i0 = vec<4, T, Q>(isX.x + isX.y + isX.z, T(1) - isX); + // i0.y += dot(isYZ.xy, vec2(1.0)); + i0.y += isYZ.x + isYZ.y; + //i0.zw += 1.0 - vec<2, T, Q>(isYZ.x, isYZ.y); + i0.z += static_cast(1) - isYZ.x; + i0.w += static_cast(1) - isYZ.y; + i0.z += isYZ.z; + i0.w += static_cast(1) - isYZ.z; + + // i0 now contains the unique values 0,1,2,3 in each channel + vec<4, T, Q> i3 = clamp(i0, T(0), T(1)); + vec<4, T, Q> i2 = clamp(i0 - T(1), T(0), T(1)); + vec<4, T, Q> i1 = clamp(i0 - T(2), T(0), T(1)); + + // x0 = x0 - 0.0 + 0.0 * C.xxxx + // x1 = x0 - i1 + 0.0 * C.xxxx + // x2 = x0 - i2 + 0.0 * C.xxxx + // x3 = x0 - i3 + 0.0 * C.xxxx + // x4 = x0 - 1.0 + 4.0 * C.xxxx + vec<4, T, Q> x1 = x0 - i1 + C.x; + vec<4, T, Q> x2 = x0 - i2 + C.y; + vec<4, T, Q> x3 = x0 - i3 + C.z; + vec<4, T, Q> x4 = x0 + C.w; + + // Permutations + i = mod(i, vec<4, T, Q>(289)); + T j0 = detail::permute(detail::permute(detail::permute(detail::permute(i.w) + i.z) + i.y) + i.x); + vec<4, T, Q> j1 = detail::permute(detail::permute(detail::permute(detail::permute( + i.w + vec<4, T, Q>(i1.w, i2.w, i3.w, T(1))) + + i.z + vec<4, T, Q>(i1.z, i2.z, i3.z, T(1))) + + i.y + vec<4, T, Q>(i1.y, i2.y, i3.y, T(1))) + + i.x + vec<4, T, Q>(i1.x, i2.x, i3.x, T(1))); + + // Gradients: 7x7x6 points over a cube, mapped onto a 4-cross polytope + // 7*7*6 = 294, which is close to the ring size 17*17 = 289. + vec<4, T, Q> ip = vec<4, T, Q>(T(1) / T(294), T(1) / T(49), T(1) / T(7), T(0)); + + vec<4, T, Q> p0 = gtc::grad4(j0, ip); + vec<4, T, Q> p1 = gtc::grad4(j1.x, ip); + vec<4, T, Q> p2 = gtc::grad4(j1.y, ip); + vec<4, T, Q> p3 = gtc::grad4(j1.z, ip); + vec<4, T, Q> p4 = gtc::grad4(j1.w, ip); + + // Normalise gradients + vec<4, T, Q> norm = detail::taylorInvSqrt(vec<4, T, Q>(dot(p0, p0), dot(p1, p1), dot(p2, p2), dot(p3, p3))); + p0 *= norm.x; + p1 *= norm.y; + p2 *= norm.z; + p3 *= norm.w; + p4 *= detail::taylorInvSqrt(dot(p4, p4)); + + // Mix contributions from the five corners + vec<3, T, Q> m0 = max(T(0.6) - vec<3, T, Q>(dot(x0, x0), dot(x1, x1), dot(x2, x2)), vec<3, T, Q>(0)); + vec<2, T, Q> m1 = max(T(0.6) - vec<2, T, Q>(dot(x3, x3), dot(x4, x4) ), vec<2, T, Q>(0)); + m0 = m0 * m0; + m1 = m1 * m1; + return T(49) * + (dot(m0 * m0, vec<3, T, Q>(dot(p0, x0), dot(p1, x1), dot(p2, x2))) + + dot(m1 * m1, vec<2, T, Q>(dot(p3, x3), dot(p4, x4)))); + } +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/packing.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/packing.hpp new file mode 100644 index 0000000000000000000000000000000000000000..d8c9bcfa90d52ef141f00d93f4b155a34dd6cc64 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/packing.hpp @@ -0,0 +1,728 @@ +/// @ref gtc_packing +/// @file glm/gtc/packing.hpp +/// +/// @see core (dependence) +/// +/// @defgroup gtc_packing GLM_GTC_packing +/// @ingroup gtc +/// +/// Include to use the features of this extension. +/// +/// This extension provides a set of function to convert vertors to packed +/// formats. + +#pragma once + +// Dependency: +#include "type_precision.hpp" +#include "../ext/vector_packing.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_GTC_packing extension included") +#endif + +namespace glm +{ + /// @addtogroup gtc_packing + /// @{ + + /// First, converts the normalized floating-point value v into a 8-bit integer value. + /// Then, the results are packed into the returned 8-bit unsigned integer. + /// + /// The conversion for component c of v to fixed point is done as follows: + /// packUnorm1x8: round(clamp(c, 0, +1) * 255.0) + /// + /// @see gtc_packing + /// @see uint16 packUnorm2x8(vec2 const& v) + /// @see uint32 packUnorm4x8(vec4 const& v) + /// @see GLSL packUnorm4x8 man page + /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions + GLM_FUNC_DECL uint8 packUnorm1x8(float v); + + /// Convert a single 8-bit integer to a normalized floating-point value. + /// + /// The conversion for unpacked fixed-point value f to floating point is done as follows: + /// unpackUnorm4x8: f / 255.0 + /// + /// @see gtc_packing + /// @see vec2 unpackUnorm2x8(uint16 p) + /// @see vec4 unpackUnorm4x8(uint32 p) + /// @see GLSL unpackUnorm4x8 man page + /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions + GLM_FUNC_DECL float unpackUnorm1x8(uint8 p); + + /// First, converts each component of the normalized floating-point value v into 8-bit integer values. + /// Then, the results are packed into the returned 16-bit unsigned integer. + /// + /// The conversion for component c of v to fixed point is done as follows: + /// packUnorm2x8: round(clamp(c, 0, +1) * 255.0) + /// + /// The first component of the vector will be written to the least significant bits of the output; + /// the last component will be written to the most significant bits. + /// + /// @see gtc_packing + /// @see uint8 packUnorm1x8(float const& v) + /// @see uint32 packUnorm4x8(vec4 const& v) + /// @see GLSL packUnorm4x8 man page + /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions + GLM_FUNC_DECL uint16 packUnorm2x8(vec2 const& v); + + /// First, unpacks a single 16-bit unsigned integer p into a pair of 8-bit unsigned integers. + /// Then, each component is converted to a normalized floating-point value to generate the returned two-component vector. + /// + /// The conversion for unpacked fixed-point value f to floating point is done as follows: + /// unpackUnorm4x8: f / 255.0 + /// + /// The first component of the returned vector will be extracted from the least significant bits of the input; + /// the last component will be extracted from the most significant bits. + /// + /// @see gtc_packing + /// @see float unpackUnorm1x8(uint8 v) + /// @see vec4 unpackUnorm4x8(uint32 p) + /// @see GLSL unpackUnorm4x8 man page + /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions + GLM_FUNC_DECL vec2 unpackUnorm2x8(uint16 p); + + /// First, converts the normalized floating-point value v into 8-bit integer value. + /// Then, the results are packed into the returned 8-bit unsigned integer. + /// + /// The conversion to fixed point is done as follows: + /// packSnorm1x8: round(clamp(s, -1, +1) * 127.0) + /// + /// @see gtc_packing + /// @see uint16 packSnorm2x8(vec2 const& v) + /// @see uint32 packSnorm4x8(vec4 const& v) + /// @see GLSL packSnorm4x8 man page + /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions + GLM_FUNC_DECL uint8 packSnorm1x8(float s); + + /// First, unpacks a single 8-bit unsigned integer p into a single 8-bit signed integers. + /// Then, the value is converted to a normalized floating-point value to generate the returned scalar. + /// + /// The conversion for unpacked fixed-point value f to floating point is done as follows: + /// unpackSnorm1x8: clamp(f / 127.0, -1, +1) + /// + /// @see gtc_packing + /// @see vec2 unpackSnorm2x8(uint16 p) + /// @see vec4 unpackSnorm4x8(uint32 p) + /// @see GLSL unpackSnorm4x8 man page + /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions + GLM_FUNC_DECL float unpackSnorm1x8(uint8 p); + + /// First, converts each component of the normalized floating-point value v into 8-bit integer values. + /// Then, the results are packed into the returned 16-bit unsigned integer. + /// + /// The conversion for component c of v to fixed point is done as follows: + /// packSnorm2x8: round(clamp(c, -1, +1) * 127.0) + /// + /// The first component of the vector will be written to the least significant bits of the output; + /// the last component will be written to the most significant bits. + /// + /// @see gtc_packing + /// @see uint8 packSnorm1x8(float const& v) + /// @see uint32 packSnorm4x8(vec4 const& v) + /// @see GLSL packSnorm4x8 man page + /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions + GLM_FUNC_DECL uint16 packSnorm2x8(vec2 const& v); + + /// First, unpacks a single 16-bit unsigned integer p into a pair of 8-bit signed integers. + /// Then, each component is converted to a normalized floating-point value to generate the returned two-component vector. + /// + /// The conversion for unpacked fixed-point value f to floating point is done as follows: + /// unpackSnorm2x8: clamp(f / 127.0, -1, +1) + /// + /// The first component of the returned vector will be extracted from the least significant bits of the input; + /// the last component will be extracted from the most significant bits. + /// + /// @see gtc_packing + /// @see float unpackSnorm1x8(uint8 p) + /// @see vec4 unpackSnorm4x8(uint32 p) + /// @see GLSL unpackSnorm4x8 man page + /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions + GLM_FUNC_DECL vec2 unpackSnorm2x8(uint16 p); + + /// First, converts the normalized floating-point value v into a 16-bit integer value. + /// Then, the results are packed into the returned 16-bit unsigned integer. + /// + /// The conversion for component c of v to fixed point is done as follows: + /// packUnorm1x16: round(clamp(c, 0, +1) * 65535.0) + /// + /// @see gtc_packing + /// @see uint16 packSnorm1x16(float const& v) + /// @see uint64 packSnorm4x16(vec4 const& v) + /// @see GLSL packUnorm4x8 man page + /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions + GLM_FUNC_DECL uint16 packUnorm1x16(float v); + + /// First, unpacks a single 16-bit unsigned integer p into a of 16-bit unsigned integers. + /// Then, the value is converted to a normalized floating-point value to generate the returned scalar. + /// + /// The conversion for unpacked fixed-point value f to floating point is done as follows: + /// unpackUnorm1x16: f / 65535.0 + /// + /// @see gtc_packing + /// @see vec2 unpackUnorm2x16(uint32 p) + /// @see vec4 unpackUnorm4x16(uint64 p) + /// @see GLSL unpackUnorm2x16 man page + /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions + GLM_FUNC_DECL float unpackUnorm1x16(uint16 p); + + /// First, converts each component of the normalized floating-point value v into 16-bit integer values. + /// Then, the results are packed into the returned 64-bit unsigned integer. + /// + /// The conversion for component c of v to fixed point is done as follows: + /// packUnorm4x16: round(clamp(c, 0, +1) * 65535.0) + /// + /// The first component of the vector will be written to the least significant bits of the output; + /// the last component will be written to the most significant bits. + /// + /// @see gtc_packing + /// @see uint16 packUnorm1x16(float const& v) + /// @see uint32 packUnorm2x16(vec2 const& v) + /// @see GLSL packUnorm4x8 man page + /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions + GLM_FUNC_DECL uint64 packUnorm4x16(vec4 const& v); + + /// First, unpacks a single 64-bit unsigned integer p into four 16-bit unsigned integers. + /// Then, each component is converted to a normalized floating-point value to generate the returned four-component vector. + /// + /// The conversion for unpacked fixed-point value f to floating point is done as follows: + /// unpackUnormx4x16: f / 65535.0 + /// + /// The first component of the returned vector will be extracted from the least significant bits of the input; + /// the last component will be extracted from the most significant bits. + /// + /// @see gtc_packing + /// @see float unpackUnorm1x16(uint16 p) + /// @see vec2 unpackUnorm2x16(uint32 p) + /// @see GLSL unpackUnorm2x16 man page + /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions + GLM_FUNC_DECL vec4 unpackUnorm4x16(uint64 p); + + /// First, converts the normalized floating-point value v into 16-bit integer value. + /// Then, the results are packed into the returned 16-bit unsigned integer. + /// + /// The conversion to fixed point is done as follows: + /// packSnorm1x8: round(clamp(s, -1, +1) * 32767.0) + /// + /// @see gtc_packing + /// @see uint32 packSnorm2x16(vec2 const& v) + /// @see uint64 packSnorm4x16(vec4 const& v) + /// @see GLSL packSnorm4x8 man page + /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions + GLM_FUNC_DECL uint16 packSnorm1x16(float v); + + /// First, unpacks a single 16-bit unsigned integer p into a single 16-bit signed integers. + /// Then, each component is converted to a normalized floating-point value to generate the returned scalar. + /// + /// The conversion for unpacked fixed-point value f to floating point is done as follows: + /// unpackSnorm1x16: clamp(f / 32767.0, -1, +1) + /// + /// @see gtc_packing + /// @see vec2 unpackSnorm2x16(uint32 p) + /// @see vec4 unpackSnorm4x16(uint64 p) + /// @see GLSL unpackSnorm4x8 man page + /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions + GLM_FUNC_DECL float unpackSnorm1x16(uint16 p); + + /// First, converts each component of the normalized floating-point value v into 16-bit integer values. + /// Then, the results are packed into the returned 64-bit unsigned integer. + /// + /// The conversion for component c of v to fixed point is done as follows: + /// packSnorm2x8: round(clamp(c, -1, +1) * 32767.0) + /// + /// The first component of the vector will be written to the least significant bits of the output; + /// the last component will be written to the most significant bits. + /// + /// @see gtc_packing + /// @see uint16 packSnorm1x16(float const& v) + /// @see uint32 packSnorm2x16(vec2 const& v) + /// @see GLSL packSnorm4x8 man page + /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions + GLM_FUNC_DECL uint64 packSnorm4x16(vec4 const& v); + + /// First, unpacks a single 64-bit unsigned integer p into four 16-bit signed integers. + /// Then, each component is converted to a normalized floating-point value to generate the returned four-component vector. + /// + /// The conversion for unpacked fixed-point value f to floating point is done as follows: + /// unpackSnorm4x16: clamp(f / 32767.0, -1, +1) + /// + /// The first component of the returned vector will be extracted from the least significant bits of the input; + /// the last component will be extracted from the most significant bits. + /// + /// @see gtc_packing + /// @see float unpackSnorm1x16(uint16 p) + /// @see vec2 unpackSnorm2x16(uint32 p) + /// @see GLSL unpackSnorm4x8 man page + /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions + GLM_FUNC_DECL vec4 unpackSnorm4x16(uint64 p); + + /// Returns an unsigned integer obtained by converting the components of a floating-point scalar + /// to the 16-bit floating-point representation found in the OpenGL Specification, + /// and then packing this 16-bit value into a 16-bit unsigned integer. + /// + /// @see gtc_packing + /// @see uint32 packHalf2x16(vec2 const& v) + /// @see uint64 packHalf4x16(vec4 const& v) + /// @see GLSL packHalf2x16 man page + /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions + GLM_FUNC_DECL uint16 packHalf1x16(float v); + + /// Returns a floating-point scalar with components obtained by unpacking a 16-bit unsigned integer into a 16-bit value, + /// interpreted as a 16-bit floating-point number according to the OpenGL Specification, + /// and converting it to 32-bit floating-point values. + /// + /// @see gtc_packing + /// @see vec2 unpackHalf2x16(uint32 const& v) + /// @see vec4 unpackHalf4x16(uint64 const& v) + /// @see GLSL unpackHalf2x16 man page + /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions + GLM_FUNC_DECL float unpackHalf1x16(uint16 v); + + /// Returns an unsigned integer obtained by converting the components of a four-component floating-point vector + /// to the 16-bit floating-point representation found in the OpenGL Specification, + /// and then packing these four 16-bit values into a 64-bit unsigned integer. + /// The first vector component specifies the 16 least-significant bits of the result; + /// the forth component specifies the 16 most-significant bits. + /// + /// @see gtc_packing + /// @see uint16 packHalf1x16(float const& v) + /// @see uint32 packHalf2x16(vec2 const& v) + /// @see GLSL packHalf2x16 man page + /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions + GLM_FUNC_DECL uint64 packHalf4x16(vec4 const& v); + + /// Returns a four-component floating-point vector with components obtained by unpacking a 64-bit unsigned integer into four 16-bit values, + /// interpreting those values as 16-bit floating-point numbers according to the OpenGL Specification, + /// and converting them to 32-bit floating-point values. + /// The first component of the vector is obtained from the 16 least-significant bits of v; + /// the forth component is obtained from the 16 most-significant bits of v. + /// + /// @see gtc_packing + /// @see float unpackHalf1x16(uint16 const& v) + /// @see vec2 unpackHalf2x16(uint32 const& v) + /// @see GLSL unpackHalf2x16 man page + /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions + GLM_FUNC_DECL vec4 unpackHalf4x16(uint64 p); + + /// Returns an unsigned integer obtained by converting the components of a four-component signed integer vector + /// to the 10-10-10-2-bit signed integer representation found in the OpenGL Specification, + /// and then packing these four values into a 32-bit unsigned integer. + /// The first vector component specifies the 10 least-significant bits of the result; + /// the forth component specifies the 2 most-significant bits. + /// + /// @see gtc_packing + /// @see uint32 packI3x10_1x2(uvec4 const& v) + /// @see uint32 packSnorm3x10_1x2(vec4 const& v) + /// @see uint32 packUnorm3x10_1x2(vec4 const& v) + /// @see ivec4 unpackI3x10_1x2(uint32 const& p) + GLM_FUNC_DECL uint32 packI3x10_1x2(ivec4 const& v); + + /// Unpacks a single 32-bit unsigned integer p into three 10-bit and one 2-bit signed integers. + /// + /// The first component of the returned vector will be extracted from the least significant bits of the input; + /// the last component will be extracted from the most significant bits. + /// + /// @see gtc_packing + /// @see uint32 packU3x10_1x2(uvec4 const& v) + /// @see vec4 unpackSnorm3x10_1x2(uint32 const& p); + /// @see uvec4 unpackI3x10_1x2(uint32 const& p); + GLM_FUNC_DECL ivec4 unpackI3x10_1x2(uint32 p); + + /// Returns an unsigned integer obtained by converting the components of a four-component unsigned integer vector + /// to the 10-10-10-2-bit unsigned integer representation found in the OpenGL Specification, + /// and then packing these four values into a 32-bit unsigned integer. + /// The first vector component specifies the 10 least-significant bits of the result; + /// the forth component specifies the 2 most-significant bits. + /// + /// @see gtc_packing + /// @see uint32 packI3x10_1x2(ivec4 const& v) + /// @see uint32 packSnorm3x10_1x2(vec4 const& v) + /// @see uint32 packUnorm3x10_1x2(vec4 const& v) + /// @see ivec4 unpackU3x10_1x2(uint32 const& p) + GLM_FUNC_DECL uint32 packU3x10_1x2(uvec4 const& v); + + /// Unpacks a single 32-bit unsigned integer p into three 10-bit and one 2-bit unsigned integers. + /// + /// The first component of the returned vector will be extracted from the least significant bits of the input; + /// the last component will be extracted from the most significant bits. + /// + /// @see gtc_packing + /// @see uint32 packU3x10_1x2(uvec4 const& v) + /// @see vec4 unpackSnorm3x10_1x2(uint32 const& p); + /// @see uvec4 unpackI3x10_1x2(uint32 const& p); + GLM_FUNC_DECL uvec4 unpackU3x10_1x2(uint32 p); + + /// First, converts the first three components of the normalized floating-point value v into 10-bit signed integer values. + /// Then, converts the forth component of the normalized floating-point value v into 2-bit signed integer values. + /// Then, the results are packed into the returned 32-bit unsigned integer. + /// + /// The conversion for component c of v to fixed point is done as follows: + /// packSnorm3x10_1x2(xyz): round(clamp(c, -1, +1) * 511.0) + /// packSnorm3x10_1x2(w): round(clamp(c, -1, +1) * 1.0) + /// + /// The first vector component specifies the 10 least-significant bits of the result; + /// the forth component specifies the 2 most-significant bits. + /// + /// @see gtc_packing + /// @see vec4 unpackSnorm3x10_1x2(uint32 const& p) + /// @see uint32 packUnorm3x10_1x2(vec4 const& v) + /// @see uint32 packU3x10_1x2(uvec4 const& v) + /// @see uint32 packI3x10_1x2(ivec4 const& v) + GLM_FUNC_DECL uint32 packSnorm3x10_1x2(vec4 const& v); + + /// First, unpacks a single 32-bit unsigned integer p into four 16-bit signed integers. + /// Then, each component is converted to a normalized floating-point value to generate the returned four-component vector. + /// + /// The conversion for unpacked fixed-point value f to floating point is done as follows: + /// unpackSnorm3x10_1x2(xyz): clamp(f / 511.0, -1, +1) + /// unpackSnorm3x10_1x2(w): clamp(f / 511.0, -1, +1) + /// + /// The first component of the returned vector will be extracted from the least significant bits of the input; + /// the last component will be extracted from the most significant bits. + /// + /// @see gtc_packing + /// @see uint32 packSnorm3x10_1x2(vec4 const& v) + /// @see vec4 unpackUnorm3x10_1x2(uint32 const& p)) + /// @see uvec4 unpackI3x10_1x2(uint32 const& p) + /// @see uvec4 unpackU3x10_1x2(uint32 const& p) + GLM_FUNC_DECL vec4 unpackSnorm3x10_1x2(uint32 p); + + /// First, converts the first three components of the normalized floating-point value v into 10-bit unsigned integer values. + /// Then, converts the forth component of the normalized floating-point value v into 2-bit signed uninteger values. + /// Then, the results are packed into the returned 32-bit unsigned integer. + /// + /// The conversion for component c of v to fixed point is done as follows: + /// packUnorm3x10_1x2(xyz): round(clamp(c, 0, +1) * 1023.0) + /// packUnorm3x10_1x2(w): round(clamp(c, 0, +1) * 3.0) + /// + /// The first vector component specifies the 10 least-significant bits of the result; + /// the forth component specifies the 2 most-significant bits. + /// + /// @see gtc_packing + /// @see vec4 unpackUnorm3x10_1x2(uint32 const& p) + /// @see uint32 packUnorm3x10_1x2(vec4 const& v) + /// @see uint32 packU3x10_1x2(uvec4 const& v) + /// @see uint32 packI3x10_1x2(ivec4 const& v) + GLM_FUNC_DECL uint32 packUnorm3x10_1x2(vec4 const& v); + + /// First, unpacks a single 32-bit unsigned integer p into four 16-bit signed integers. + /// Then, each component is converted to a normalized floating-point value to generate the returned four-component vector. + /// + /// The conversion for unpacked fixed-point value f to floating point is done as follows: + /// unpackSnorm3x10_1x2(xyz): clamp(f / 1023.0, 0, +1) + /// unpackSnorm3x10_1x2(w): clamp(f / 3.0, 0, +1) + /// + /// The first component of the returned vector will be extracted from the least significant bits of the input; + /// the last component will be extracted from the most significant bits. + /// + /// @see gtc_packing + /// @see uint32 packSnorm3x10_1x2(vec4 const& v) + /// @see vec4 unpackInorm3x10_1x2(uint32 const& p)) + /// @see uvec4 unpackI3x10_1x2(uint32 const& p) + /// @see uvec4 unpackU3x10_1x2(uint32 const& p) + GLM_FUNC_DECL vec4 unpackUnorm3x10_1x2(uint32 p); + + /// First, converts the first two components of the normalized floating-point value v into 11-bit signless floating-point values. + /// Then, converts the third component of the normalized floating-point value v into a 10-bit signless floating-point value. + /// Then, the results are packed into the returned 32-bit unsigned integer. + /// + /// The first vector component specifies the 11 least-significant bits of the result; + /// the last component specifies the 10 most-significant bits. + /// + /// @see gtc_packing + /// @see vec3 unpackF2x11_1x10(uint32 const& p) + GLM_FUNC_DECL uint32 packF2x11_1x10(vec3 const& v); + + /// First, unpacks a single 32-bit unsigned integer p into two 11-bit signless floating-point values and one 10-bit signless floating-point value . + /// Then, each component is converted to a normalized floating-point value to generate the returned three-component vector. + /// + /// The first component of the returned vector will be extracted from the least significant bits of the input; + /// the last component will be extracted from the most significant bits. + /// + /// @see gtc_packing + /// @see uint32 packF2x11_1x10(vec3 const& v) + GLM_FUNC_DECL vec3 unpackF2x11_1x10(uint32 p); + + + /// First, converts the first two components of the normalized floating-point value v into 11-bit signless floating-point values. + /// Then, converts the third component of the normalized floating-point value v into a 10-bit signless floating-point value. + /// Then, the results are packed into the returned 32-bit unsigned integer. + /// + /// The first vector component specifies the 11 least-significant bits of the result; + /// the last component specifies the 10 most-significant bits. + /// + /// packF3x9_E1x5 allows encoding into RGBE / RGB9E5 format + /// + /// @see gtc_packing + /// @see vec3 unpackF3x9_E1x5(uint32 const& p) + GLM_FUNC_DECL uint32 packF3x9_E1x5(vec3 const& v); + + /// First, unpacks a single 32-bit unsigned integer p into two 11-bit signless floating-point values and one 10-bit signless floating-point value . + /// Then, each component is converted to a normalized floating-point value to generate the returned three-component vector. + /// + /// The first component of the returned vector will be extracted from the least significant bits of the input; + /// the last component will be extracted from the most significant bits. + /// + /// unpackF3x9_E1x5 allows decoding RGBE / RGB9E5 data + /// + /// @see gtc_packing + /// @see uint32 packF3x9_E1x5(vec3 const& v) + GLM_FUNC_DECL vec3 unpackF3x9_E1x5(uint32 p); + + /// Returns an unsigned integer vector obtained by converting the components of a floating-point vector + /// to the 16-bit floating-point representation found in the OpenGL Specification. + /// The first vector component specifies the 16 least-significant bits of the result; + /// the forth component specifies the 16 most-significant bits. + /// + /// @see gtc_packing + /// @see vec<3, T, Q> unpackRGBM(vec<4, T, Q> const& p) + /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions + template + GLM_FUNC_DECL vec<4, T, Q> packRGBM(vec<3, T, Q> const& rgb); + + /// Returns a floating-point vector with components obtained by reinterpreting an integer vector as 16-bit floating-point numbers and converting them to 32-bit floating-point values. + /// The first component of the vector is obtained from the 16 least-significant bits of v; + /// the forth component is obtained from the 16 most-significant bits of v. + /// + /// @see gtc_packing + /// @see vec<4, T, Q> packRGBM(vec<3, float, Q> const& v) + /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions + template + GLM_FUNC_DECL vec<3, T, Q> unpackRGBM(vec<4, T, Q> const& rgbm); + + /// Returns an unsigned integer vector obtained by converting the components of a floating-point vector + /// to the 16-bit floating-point representation found in the OpenGL Specification. + /// The first vector component specifies the 16 least-significant bits of the result; + /// the forth component specifies the 16 most-significant bits. + /// + /// @see gtc_packing + /// @see vec unpackHalf(vec const& p) + /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions + template + GLM_FUNC_DECL vec packHalf(vec const& v); + + /// Returns a floating-point vector with components obtained by reinterpreting an integer vector as 16-bit floating-point numbers and converting them to 32-bit floating-point values. + /// The first component of the vector is obtained from the 16 least-significant bits of v; + /// the forth component is obtained from the 16 most-significant bits of v. + /// + /// @see gtc_packing + /// @see vec packHalf(vec const& v) + /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions + template + GLM_FUNC_DECL vec unpackHalf(vec const& p); + + /// Convert each component of the normalized floating-point vector into unsigned integer values. + /// + /// @see gtc_packing + /// @see vec unpackUnorm(vec const& p); + template + GLM_FUNC_DECL vec packUnorm(vec const& v); + + /// Convert a packed integer to a normalized floating-point vector. + /// + /// @see gtc_packing + /// @see vec packUnorm(vec const& v) + template + GLM_FUNC_DECL vec unpackUnorm(vec const& v); + + /// Convert each component of the normalized floating-point vector into signed integer values. + /// + /// @see gtc_packing + /// @see vec unpackSnorm(vec const& p); + template + GLM_FUNC_DECL vec packSnorm(vec const& v); + + /// Convert a packed integer to a normalized floating-point vector. + /// + /// @see gtc_packing + /// @see vec packSnorm(vec const& v) + template + GLM_FUNC_DECL vec unpackSnorm(vec const& v); + + /// Convert each component of the normalized floating-point vector into unsigned integer values. + /// + /// @see gtc_packing + /// @see vec2 unpackUnorm2x4(uint8 p) + GLM_FUNC_DECL uint8 packUnorm2x4(vec2 const& v); + + /// Convert a packed integer to a normalized floating-point vector. + /// + /// @see gtc_packing + /// @see uint8 packUnorm2x4(vec2 const& v) + GLM_FUNC_DECL vec2 unpackUnorm2x4(uint8 p); + + /// Convert each component of the normalized floating-point vector into unsigned integer values. + /// + /// @see gtc_packing + /// @see vec4 unpackUnorm4x4(uint16 p) + GLM_FUNC_DECL uint16 packUnorm4x4(vec4 const& v); + + /// Convert a packed integer to a normalized floating-point vector. + /// + /// @see gtc_packing + /// @see uint16 packUnorm4x4(vec4 const& v) + GLM_FUNC_DECL vec4 unpackUnorm4x4(uint16 p); + + /// Convert each component of the normalized floating-point vector into unsigned integer values. + /// + /// @see gtc_packing + /// @see vec3 unpackUnorm1x5_1x6_1x5(uint16 p) + GLM_FUNC_DECL uint16 packUnorm1x5_1x6_1x5(vec3 const& v); + + /// Convert a packed integer to a normalized floating-point vector. + /// + /// @see gtc_packing + /// @see uint16 packUnorm1x5_1x6_1x5(vec3 const& v) + GLM_FUNC_DECL vec3 unpackUnorm1x5_1x6_1x5(uint16 p); + + /// Convert each component of the normalized floating-point vector into unsigned integer values. + /// + /// @see gtc_packing + /// @see vec4 unpackUnorm3x5_1x1(uint16 p) + GLM_FUNC_DECL uint16 packUnorm3x5_1x1(vec4 const& v); + + /// Convert a packed integer to a normalized floating-point vector. + /// + /// @see gtc_packing + /// @see uint16 packUnorm3x5_1x1(vec4 const& v) + GLM_FUNC_DECL vec4 unpackUnorm3x5_1x1(uint16 p); + + /// Convert each component of the normalized floating-point vector into unsigned integer values. + /// + /// @see gtc_packing + /// @see vec3 unpackUnorm2x3_1x2(uint8 p) + GLM_FUNC_DECL uint8 packUnorm2x3_1x2(vec3 const& v); + + /// Convert a packed integer to a normalized floating-point vector. + /// + /// @see gtc_packing + /// @see uint8 packUnorm2x3_1x2(vec3 const& v) + GLM_FUNC_DECL vec3 unpackUnorm2x3_1x2(uint8 p); + + + + /// Convert each component from an integer vector into a packed integer. + /// + /// @see gtc_packing + /// @see i8vec2 unpackInt2x8(int16 p) + GLM_FUNC_DECL int16 packInt2x8(i8vec2 const& v); + + /// Convert a packed integer into an integer vector. + /// + /// @see gtc_packing + /// @see int16 packInt2x8(i8vec2 const& v) + GLM_FUNC_DECL i8vec2 unpackInt2x8(int16 p); + + /// Convert each component from an integer vector into a packed unsigned integer. + /// + /// @see gtc_packing + /// @see u8vec2 unpackInt2x8(uint16 p) + GLM_FUNC_DECL uint16 packUint2x8(u8vec2 const& v); + + /// Convert a packed integer into an integer vector. + /// + /// @see gtc_packing + /// @see uint16 packInt2x8(u8vec2 const& v) + GLM_FUNC_DECL u8vec2 unpackUint2x8(uint16 p); + + /// Convert each component from an integer vector into a packed integer. + /// + /// @see gtc_packing + /// @see i8vec4 unpackInt4x8(int32 p) + GLM_FUNC_DECL int32 packInt4x8(i8vec4 const& v); + + /// Convert a packed integer into an integer vector. + /// + /// @see gtc_packing + /// @see int32 packInt2x8(i8vec4 const& v) + GLM_FUNC_DECL i8vec4 unpackInt4x8(int32 p); + + /// Convert each component from an integer vector into a packed unsigned integer. + /// + /// @see gtc_packing + /// @see u8vec4 unpackUint4x8(uint32 p) + GLM_FUNC_DECL uint32 packUint4x8(u8vec4 const& v); + + /// Convert a packed integer into an integer vector. + /// + /// @see gtc_packing + /// @see uint32 packUint4x8(u8vec2 const& v) + GLM_FUNC_DECL u8vec4 unpackUint4x8(uint32 p); + + /// Convert each component from an integer vector into a packed integer. + /// + /// @see gtc_packing + /// @see i16vec2 unpackInt2x16(int p) + GLM_FUNC_DECL int packInt2x16(i16vec2 const& v); + + /// Convert a packed integer into an integer vector. + /// + /// @see gtc_packing + /// @see int packInt2x16(i16vec2 const& v) + GLM_FUNC_DECL i16vec2 unpackInt2x16(int p); + + /// Convert each component from an integer vector into a packed integer. + /// + /// @see gtc_packing + /// @see i16vec4 unpackInt4x16(int64 p) + GLM_FUNC_DECL int64 packInt4x16(i16vec4 const& v); + + /// Convert a packed integer into an integer vector. + /// + /// @see gtc_packing + /// @see int64 packInt4x16(i16vec4 const& v) + GLM_FUNC_DECL i16vec4 unpackInt4x16(int64 p); + + /// Convert each component from an integer vector into a packed unsigned integer. + /// + /// @see gtc_packing + /// @see u16vec2 unpackUint2x16(uint p) + GLM_FUNC_DECL uint packUint2x16(u16vec2 const& v); + + /// Convert a packed integer into an integer vector. + /// + /// @see gtc_packing + /// @see uint packUint2x16(u16vec2 const& v) + GLM_FUNC_DECL u16vec2 unpackUint2x16(uint p); + + /// Convert each component from an integer vector into a packed unsigned integer. + /// + /// @see gtc_packing + /// @see u16vec4 unpackUint4x16(uint64 p) + GLM_FUNC_DECL uint64 packUint4x16(u16vec4 const& v); + + /// Convert a packed integer into an integer vector. + /// + /// @see gtc_packing + /// @see uint64 packUint4x16(u16vec4 const& v) + GLM_FUNC_DECL u16vec4 unpackUint4x16(uint64 p); + + /// Convert each component from an integer vector into a packed integer. + /// + /// @see gtc_packing + /// @see i32vec2 unpackInt2x32(int p) + GLM_FUNC_DECL int64 packInt2x32(i32vec2 const& v); + + /// Convert a packed integer into an integer vector. + /// + /// @see gtc_packing + /// @see int packInt2x16(i32vec2 const& v) + GLM_FUNC_DECL i32vec2 unpackInt2x32(int64 p); + + /// Convert each component from an integer vector into a packed unsigned integer. + /// + /// @see gtc_packing + /// @see u32vec2 unpackUint2x32(int p) + GLM_FUNC_DECL uint64 packUint2x32(u32vec2 const& v); + + /// Convert a packed integer into an integer vector. + /// + /// @see gtc_packing + /// @see int packUint2x16(u32vec2 const& v) + GLM_FUNC_DECL u32vec2 unpackUint2x32(uint64 p); + + /// @} +}// namespace glm + +#include "packing.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/packing.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/packing.inl new file mode 100644 index 0000000000000000000000000000000000000000..82a15be8e5c53eb6036bf3dd3d5484155e691804 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/packing.inl @@ -0,0 +1,938 @@ +/// @ref gtc_packing + +#include "../ext/scalar_relational.hpp" +#include "../ext/vector_relational.hpp" +#include "../common.hpp" +#include "../vec2.hpp" +#include "../vec3.hpp" +#include "../vec4.hpp" +#include "../detail/type_half.hpp" +#include +#include + +namespace glm{ +namespace detail +{ + GLM_FUNC_QUALIFIER glm::uint16 float2half(glm::uint32 f) + { + // 10 bits => EE EEEFFFFF + // 11 bits => EEE EEFFFFFF + // Half bits => SEEEEEFF FFFFFFFF + // Float bits => SEEEEEEE EFFFFFFF FFFFFFFF FFFFFFFF + + // 0x00007c00 => 00000000 00000000 01111100 00000000 + // 0x000003ff => 00000000 00000000 00000011 11111111 + // 0x38000000 => 00111000 00000000 00000000 00000000 + // 0x7f800000 => 01111111 10000000 00000000 00000000 + // 0x00008000 => 00000000 00000000 10000000 00000000 + return + ((f >> 16) & 0x8000) | // sign + ((((f & 0x7f800000) - 0x38000000) >> 13) & 0x7c00) | // exponential + ((f >> 13) & 0x03ff); // Mantissa + } + + GLM_FUNC_QUALIFIER glm::uint32 float2packed11(glm::uint32 f) + { + // 10 bits => EE EEEFFFFF + // 11 bits => EEE EEFFFFFF + // Half bits => SEEEEEFF FFFFFFFF + // Float bits => SEEEEEEE EFFFFFFF FFFFFFFF FFFFFFFF + + // 0x000007c0 => 00000000 00000000 00000111 11000000 + // 0x00007c00 => 00000000 00000000 01111100 00000000 + // 0x000003ff => 00000000 00000000 00000011 11111111 + // 0x38000000 => 00111000 00000000 00000000 00000000 + // 0x7f800000 => 01111111 10000000 00000000 00000000 + // 0x00008000 => 00000000 00000000 10000000 00000000 + return + ((((f & 0x7f800000) - 0x38000000) >> 17) & 0x07c0) | // exponential + ((f >> 17) & 0x003f); // Mantissa + } + + GLM_FUNC_QUALIFIER glm::uint32 packed11ToFloat(glm::uint32 p) + { + // 10 bits => EE EEEFFFFF + // 11 bits => EEE EEFFFFFF + // Half bits => SEEEEEFF FFFFFFFF + // Float bits => SEEEEEEE EFFFFFFF FFFFFFFF FFFFFFFF + + // 0x000007c0 => 00000000 00000000 00000111 11000000 + // 0x00007c00 => 00000000 00000000 01111100 00000000 + // 0x000003ff => 00000000 00000000 00000011 11111111 + // 0x38000000 => 00111000 00000000 00000000 00000000 + // 0x7f800000 => 01111111 10000000 00000000 00000000 + // 0x00008000 => 00000000 00000000 10000000 00000000 + return + ((((p & 0x07c0) << 17) + 0x38000000) & 0x7f800000) | // exponential + ((p & 0x003f) << 17); // Mantissa + } + + GLM_FUNC_QUALIFIER glm::uint32 float2packed10(glm::uint32 f) + { + // 10 bits => EE EEEFFFFF + // 11 bits => EEE EEFFFFFF + // Half bits => SEEEEEFF FFFFFFFF + // Float bits => SEEEEEEE EFFFFFFF FFFFFFFF FFFFFFFF + + // 0x0000001F => 00000000 00000000 00000000 00011111 + // 0x0000003F => 00000000 00000000 00000000 00111111 + // 0x000003E0 => 00000000 00000000 00000011 11100000 + // 0x000007C0 => 00000000 00000000 00000111 11000000 + // 0x00007C00 => 00000000 00000000 01111100 00000000 + // 0x000003FF => 00000000 00000000 00000011 11111111 + // 0x38000000 => 00111000 00000000 00000000 00000000 + // 0x7f800000 => 01111111 10000000 00000000 00000000 + // 0x00008000 => 00000000 00000000 10000000 00000000 + return + ((((f & 0x7f800000) - 0x38000000) >> 18) & 0x03E0) | // exponential + ((f >> 18) & 0x001f); // Mantissa + } + + GLM_FUNC_QUALIFIER glm::uint32 packed10ToFloat(glm::uint32 p) + { + // 10 bits => EE EEEFFFFF + // 11 bits => EEE EEFFFFFF + // Half bits => SEEEEEFF FFFFFFFF + // Float bits => SEEEEEEE EFFFFFFF FFFFFFFF FFFFFFFF + + // 0x0000001F => 00000000 00000000 00000000 00011111 + // 0x0000003F => 00000000 00000000 00000000 00111111 + // 0x000003E0 => 00000000 00000000 00000011 11100000 + // 0x000007C0 => 00000000 00000000 00000111 11000000 + // 0x00007C00 => 00000000 00000000 01111100 00000000 + // 0x000003FF => 00000000 00000000 00000011 11111111 + // 0x38000000 => 00111000 00000000 00000000 00000000 + // 0x7f800000 => 01111111 10000000 00000000 00000000 + // 0x00008000 => 00000000 00000000 10000000 00000000 + return + ((((p & 0x03E0) << 18) + 0x38000000) & 0x7f800000) | // exponential + ((p & 0x001f) << 18); // Mantissa + } + + GLM_FUNC_QUALIFIER glm::uint half2float(glm::uint h) + { + return ((h & 0x8000) << 16) | ((( h & 0x7c00) + 0x1C000) << 13) | ((h & 0x03FF) << 13); + } + + GLM_FUNC_QUALIFIER glm::uint floatTo11bit(float x) + { + if(x == 0.0f) + return 0u; + else if(glm::isnan(x)) + return ~0u; + else if(glm::isinf(x)) + return 0x1Fu << 6u; + + uint Pack = 0u; + memcpy(&Pack, &x, sizeof(Pack)); + return float2packed11(Pack); + } + + GLM_FUNC_QUALIFIER float packed11bitToFloat(glm::uint x) + { + if(x == 0) + return 0.0f; + else if(x == ((1 << 11) - 1)) + return ~0;//NaN + else if(x == (0x1f << 6)) + return ~0;//Inf + + uint Result = packed11ToFloat(x); + + float Temp = 0; + memcpy(&Temp, &Result, sizeof(Temp)); + return Temp; + } + + GLM_FUNC_QUALIFIER glm::uint floatTo10bit(float x) + { + if(x == 0.0f) + return 0u; + else if(glm::isnan(x)) + return ~0u; + else if(glm::isinf(x)) + return 0x1Fu << 5u; + + uint Pack = 0; + memcpy(&Pack, &x, sizeof(Pack)); + return float2packed10(Pack); + } + + GLM_FUNC_QUALIFIER float packed10bitToFloat(glm::uint x) + { + if(x == 0) + return 0.0f; + else if(x == ((1 << 10) - 1)) + return ~0;//NaN + else if(x == (0x1f << 5)) + return ~0;//Inf + + uint Result = packed10ToFloat(x); + + float Temp = 0; + memcpy(&Temp, &Result, sizeof(Temp)); + return Temp; + } + +// GLM_FUNC_QUALIFIER glm::uint f11_f11_f10(float x, float y, float z) +// { +// return ((floatTo11bit(x) & ((1 << 11) - 1)) << 0) | ((floatTo11bit(y) & ((1 << 11) - 1)) << 11) | ((floatTo10bit(z) & ((1 << 10) - 1)) << 22); +// } + + union u3u3u2 + { + struct + { + uint x : 3; + uint y : 3; + uint z : 2; + } data; + uint8 pack; + }; + + union u4u4 + { + struct + { + uint x : 4; + uint y : 4; + } data; + uint8 pack; + }; + + union u4u4u4u4 + { + struct + { + uint x : 4; + uint y : 4; + uint z : 4; + uint w : 4; + } data; + uint16 pack; + }; + + union u5u6u5 + { + struct + { + uint x : 5; + uint y : 6; + uint z : 5; + } data; + uint16 pack; + }; + + union u5u5u5u1 + { + struct + { + uint x : 5; + uint y : 5; + uint z : 5; + uint w : 1; + } data; + uint16 pack; + }; + + union u10u10u10u2 + { + struct + { + uint x : 10; + uint y : 10; + uint z : 10; + uint w : 2; + } data; + uint32 pack; + }; + + union i10i10i10i2 + { + struct + { + int x : 10; + int y : 10; + int z : 10; + int w : 2; + } data; + uint32 pack; + }; + + union u9u9u9e5 + { + struct + { + uint x : 9; + uint y : 9; + uint z : 9; + uint w : 5; + } data; + uint32 pack; + }; + + template + struct compute_half + {}; + + template + struct compute_half<1, Q> + { + GLM_FUNC_QUALIFIER static vec<1, uint16, Q> pack(vec<1, float, Q> const& v) + { + int16 const Unpack(detail::toFloat16(v.x)); + u16vec1 Packed; + memcpy(&Packed, &Unpack, sizeof(Packed)); + return Packed; + } + + GLM_FUNC_QUALIFIER static vec<1, float, Q> unpack(vec<1, uint16, Q> const& v) + { + i16vec1 Unpack; + memcpy(&Unpack, &v, sizeof(Unpack)); + return vec<1, float, Q>(detail::toFloat32(v.x)); + } + }; + + template + struct compute_half<2, Q> + { + GLM_FUNC_QUALIFIER static vec<2, uint16, Q> pack(vec<2, float, Q> const& v) + { + vec<2, int16, Q> const Unpack(detail::toFloat16(v.x), detail::toFloat16(v.y)); + u16vec2 Packed; + memcpy(&Packed, &Unpack, sizeof(Packed)); + return Packed; + } + + GLM_FUNC_QUALIFIER static vec<2, float, Q> unpack(vec<2, uint16, Q> const& v) + { + i16vec2 Unpack; + memcpy(&Unpack, &v, sizeof(Unpack)); + return vec<2, float, Q>(detail::toFloat32(v.x), detail::toFloat32(v.y)); + } + }; + + template + struct compute_half<3, Q> + { + GLM_FUNC_QUALIFIER static vec<3, uint16, Q> pack(vec<3, float, Q> const& v) + { + vec<3, int16, Q> const Unpack(detail::toFloat16(v.x), detail::toFloat16(v.y), detail::toFloat16(v.z)); + u16vec3 Packed; + memcpy(&Packed, &Unpack, sizeof(Packed)); + return Packed; + } + + GLM_FUNC_QUALIFIER static vec<3, float, Q> unpack(vec<3, uint16, Q> const& v) + { + i16vec3 Unpack; + memcpy(&Unpack, &v, sizeof(Unpack)); + return vec<3, float, Q>(detail::toFloat32(v.x), detail::toFloat32(v.y), detail::toFloat32(v.z)); + } + }; + + template + struct compute_half<4, Q> + { + GLM_FUNC_QUALIFIER static vec<4, uint16, Q> pack(vec<4, float, Q> const& v) + { + vec<4, int16, Q> const Unpack(detail::toFloat16(v.x), detail::toFloat16(v.y), detail::toFloat16(v.z), detail::toFloat16(v.w)); + u16vec4 Packed; + memcpy(&Packed, &Unpack, sizeof(Packed)); + return Packed; + } + + GLM_FUNC_QUALIFIER static vec<4, float, Q> unpack(vec<4, uint16, Q> const& v) + { + i16vec4 Unpack; + memcpy(&Unpack, &v, sizeof(Unpack)); + return vec<4, float, Q>(detail::toFloat32(v.x), detail::toFloat32(v.y), detail::toFloat32(v.z), detail::toFloat32(v.w)); + } + }; +}//namespace detail + + GLM_FUNC_QUALIFIER uint8 packUnorm1x8(float v) + { + return static_cast(round(clamp(v, 0.0f, 1.0f) * 255.0f)); + } + + GLM_FUNC_QUALIFIER float unpackUnorm1x8(uint8 p) + { + float const Unpack(p); + return Unpack * static_cast(0.0039215686274509803921568627451); // 1 / 255 + } + + GLM_FUNC_QUALIFIER uint16 packUnorm2x8(vec2 const& v) + { + u8vec2 const Topack(round(clamp(v, 0.0f, 1.0f) * 255.0f)); + + uint16 Unpack = 0; + memcpy(&Unpack, &Topack, sizeof(Unpack)); + return Unpack; + } + + GLM_FUNC_QUALIFIER vec2 unpackUnorm2x8(uint16 p) + { + u8vec2 Unpack; + memcpy(&Unpack, &p, sizeof(Unpack)); + return vec2(Unpack) * float(0.0039215686274509803921568627451); // 1 / 255 + } + + GLM_FUNC_QUALIFIER uint8 packSnorm1x8(float v) + { + int8 const Topack(static_cast(round(clamp(v ,-1.0f, 1.0f) * 127.0f))); + uint8 Packed = 0; + memcpy(&Packed, &Topack, sizeof(Packed)); + return Packed; + } + + GLM_FUNC_QUALIFIER float unpackSnorm1x8(uint8 p) + { + int8 Unpack = 0; + memcpy(&Unpack, &p, sizeof(Unpack)); + return clamp( + static_cast(Unpack) * 0.00787401574803149606299212598425f, // 1.0f / 127.0f + -1.0f, 1.0f); + } + + GLM_FUNC_QUALIFIER uint16 packSnorm2x8(vec2 const& v) + { + i8vec2 const Topack(round(clamp(v, -1.0f, 1.0f) * 127.0f)); + uint16 Packed = 0; + memcpy(&Packed, &Topack, sizeof(Packed)); + return Packed; + } + + GLM_FUNC_QUALIFIER vec2 unpackSnorm2x8(uint16 p) + { + i8vec2 Unpack; + memcpy(&Unpack, &p, sizeof(Unpack)); + return clamp( + vec2(Unpack) * 0.00787401574803149606299212598425f, // 1.0f / 127.0f + -1.0f, 1.0f); + } + + GLM_FUNC_QUALIFIER uint16 packUnorm1x16(float s) + { + return static_cast(round(clamp(s, 0.0f, 1.0f) * 65535.0f)); + } + + GLM_FUNC_QUALIFIER float unpackUnorm1x16(uint16 p) + { + float const Unpack(p); + return Unpack * 1.5259021896696421759365224689097e-5f; // 1.0 / 65535.0 + } + + GLM_FUNC_QUALIFIER uint64 packUnorm4x16(vec4 const& v) + { + u16vec4 const Topack(round(clamp(v , 0.0f, 1.0f) * 65535.0f)); + uint64 Packed = 0; + memcpy(&Packed, &Topack, sizeof(Packed)); + return Packed; + } + + GLM_FUNC_QUALIFIER vec4 unpackUnorm4x16(uint64 p) + { + u16vec4 Unpack; + memcpy(&Unpack, &p, sizeof(Unpack)); + return vec4(Unpack) * 1.5259021896696421759365224689097e-5f; // 1.0 / 65535.0 + } + + GLM_FUNC_QUALIFIER uint16 packSnorm1x16(float v) + { + int16 const Topack = static_cast(round(clamp(v ,-1.0f, 1.0f) * 32767.0f)); + uint16 Packed = 0; + memcpy(&Packed, &Topack, sizeof(Packed)); + return Packed; + } + + GLM_FUNC_QUALIFIER float unpackSnorm1x16(uint16 p) + { + int16 Unpack = 0; + memcpy(&Unpack, &p, sizeof(Unpack)); + return clamp( + static_cast(Unpack) * 3.0518509475997192297128208258309e-5f, //1.0f / 32767.0f, + -1.0f, 1.0f); + } + + GLM_FUNC_QUALIFIER uint64 packSnorm4x16(vec4 const& v) + { + i16vec4 const Topack(round(clamp(v ,-1.0f, 1.0f) * 32767.0f)); + uint64 Packed = 0; + memcpy(&Packed, &Topack, sizeof(Packed)); + return Packed; + } + + GLM_FUNC_QUALIFIER vec4 unpackSnorm4x16(uint64 p) + { + i16vec4 Unpack; + memcpy(&Unpack, &p, sizeof(Unpack)); + return clamp( + vec4(Unpack) * 3.0518509475997192297128208258309e-5f, //1.0f / 32767.0f, + -1.0f, 1.0f); + } + + GLM_FUNC_QUALIFIER uint16 packHalf1x16(float v) + { + int16 const Topack(detail::toFloat16(v)); + uint16 Packed = 0; + memcpy(&Packed, &Topack, sizeof(Packed)); + return Packed; + } + + GLM_FUNC_QUALIFIER float unpackHalf1x16(uint16 v) + { + int16 Unpack = 0; + memcpy(&Unpack, &v, sizeof(Unpack)); + return detail::toFloat32(Unpack); + } + + GLM_FUNC_QUALIFIER uint64 packHalf4x16(glm::vec4 const& v) + { + i16vec4 const Unpack( + detail::toFloat16(v.x), + detail::toFloat16(v.y), + detail::toFloat16(v.z), + detail::toFloat16(v.w)); + uint64 Packed = 0; + memcpy(&Packed, &Unpack, sizeof(Packed)); + return Packed; + } + + GLM_FUNC_QUALIFIER glm::vec4 unpackHalf4x16(uint64 v) + { + i16vec4 Unpack; + memcpy(&Unpack, &v, sizeof(Unpack)); + return vec4( + detail::toFloat32(Unpack.x), + detail::toFloat32(Unpack.y), + detail::toFloat32(Unpack.z), + detail::toFloat32(Unpack.w)); + } + + GLM_FUNC_QUALIFIER uint32 packI3x10_1x2(ivec4 const& v) + { + detail::i10i10i10i2 Result; + Result.data.x = v.x; + Result.data.y = v.y; + Result.data.z = v.z; + Result.data.w = v.w; + return Result.pack; + } + + GLM_FUNC_QUALIFIER ivec4 unpackI3x10_1x2(uint32 v) + { + detail::i10i10i10i2 Unpack; + Unpack.pack = v; + return ivec4( + Unpack.data.x, + Unpack.data.y, + Unpack.data.z, + Unpack.data.w); + } + + GLM_FUNC_QUALIFIER uint32 packU3x10_1x2(uvec4 const& v) + { + detail::u10u10u10u2 Result; + Result.data.x = v.x; + Result.data.y = v.y; + Result.data.z = v.z; + Result.data.w = v.w; + return Result.pack; + } + + GLM_FUNC_QUALIFIER uvec4 unpackU3x10_1x2(uint32 v) + { + detail::u10u10u10u2 Unpack; + Unpack.pack = v; + return uvec4( + Unpack.data.x, + Unpack.data.y, + Unpack.data.z, + Unpack.data.w); + } + + GLM_FUNC_QUALIFIER uint32 packSnorm3x10_1x2(vec4 const& v) + { + ivec4 const Pack(round(clamp(v,-1.0f, 1.0f) * vec4(511.f, 511.f, 511.f, 1.f))); + + detail::i10i10i10i2 Result; + Result.data.x = Pack.x; + Result.data.y = Pack.y; + Result.data.z = Pack.z; + Result.data.w = Pack.w; + return Result.pack; + } + + GLM_FUNC_QUALIFIER vec4 unpackSnorm3x10_1x2(uint32 v) + { + detail::i10i10i10i2 Unpack; + Unpack.pack = v; + + vec4 const Result(Unpack.data.x, Unpack.data.y, Unpack.data.z, Unpack.data.w); + + return clamp(Result * vec4(1.f / 511.f, 1.f / 511.f, 1.f / 511.f, 1.f), -1.0f, 1.0f); + } + + GLM_FUNC_QUALIFIER uint32 packUnorm3x10_1x2(vec4 const& v) + { + uvec4 const Unpack(round(clamp(v, 0.0f, 1.0f) * vec4(1023.f, 1023.f, 1023.f, 3.f))); + + detail::u10u10u10u2 Result; + Result.data.x = Unpack.x; + Result.data.y = Unpack.y; + Result.data.z = Unpack.z; + Result.data.w = Unpack.w; + return Result.pack; + } + + GLM_FUNC_QUALIFIER vec4 unpackUnorm3x10_1x2(uint32 v) + { + vec4 const ScaleFactors(1.0f / 1023.f, 1.0f / 1023.f, 1.0f / 1023.f, 1.0f / 3.f); + + detail::u10u10u10u2 Unpack; + Unpack.pack = v; + return vec4(Unpack.data.x, Unpack.data.y, Unpack.data.z, Unpack.data.w) * ScaleFactors; + } + + GLM_FUNC_QUALIFIER uint32 packF2x11_1x10(vec3 const& v) + { + return + ((detail::floatTo11bit(v.x) & ((1 << 11) - 1)) << 0) | + ((detail::floatTo11bit(v.y) & ((1 << 11) - 1)) << 11) | + ((detail::floatTo10bit(v.z) & ((1 << 10) - 1)) << 22); + } + + GLM_FUNC_QUALIFIER vec3 unpackF2x11_1x10(uint32 v) + { + return vec3( + detail::packed11bitToFloat(v >> 0), + detail::packed11bitToFloat(v >> 11), + detail::packed10bitToFloat(v >> 22)); + } + + GLM_FUNC_QUALIFIER uint32 packF3x9_E1x5(vec3 const& v) + { + float const SharedExpMax = (pow(2.0f, 9.0f - 1.0f) / pow(2.0f, 9.0f)) * pow(2.0f, 31.f - 15.f); + vec3 const Color = clamp(v, 0.0f, SharedExpMax); + float const MaxColor = max(Color.x, max(Color.y, Color.z)); + + float const ExpSharedP = max(-15.f - 1.f, floor(log2(MaxColor))) + 1.0f + 15.f; + float const MaxShared = floor(MaxColor / pow(2.0f, (ExpSharedP - 15.f - 9.f)) + 0.5f); + float const ExpShared = equal(MaxShared, pow(2.0f, 9.0f), epsilon()) ? ExpSharedP + 1.0f : ExpSharedP; + + uvec3 const ColorComp(floor(Color / pow(2.f, (ExpShared - 15.f - 9.f)) + 0.5f)); + + detail::u9u9u9e5 Unpack; + Unpack.data.x = ColorComp.x; + Unpack.data.y = ColorComp.y; + Unpack.data.z = ColorComp.z; + Unpack.data.w = uint(ExpShared); + return Unpack.pack; + } + + GLM_FUNC_QUALIFIER vec3 unpackF3x9_E1x5(uint32 v) + { + detail::u9u9u9e5 Unpack; + Unpack.pack = v; + + return vec3(Unpack.data.x, Unpack.data.y, Unpack.data.z) * pow(2.0f, Unpack.data.w - 15.f - 9.f); + } + + // Based on Brian Karis http://graphicrants.blogspot.fr/2009/04/rgbm-color-encoding.html + template + GLM_FUNC_QUALIFIER vec<4, T, Q> packRGBM(vec<3, T, Q> const& rgb) + { + vec<3, T, Q> const Color(rgb * static_cast(1.0 / 6.0)); + T Alpha = clamp(max(max(Color.x, Color.y), max(Color.z, static_cast(1e-6))), static_cast(0), static_cast(1)); + Alpha = ceil(Alpha * static_cast(255.0)) / static_cast(255.0); + return vec<4, T, Q>(Color / Alpha, Alpha); + } + + template + GLM_FUNC_QUALIFIER vec<3, T, Q> unpackRGBM(vec<4, T, Q> const& rgbm) + { + return vec<3, T, Q>(rgbm.x, rgbm.y, rgbm.z) * rgbm.w * static_cast(6); + } + + template + GLM_FUNC_QUALIFIER vec packHalf(vec const& v) + { + return detail::compute_half::pack(v); + } + + template + GLM_FUNC_QUALIFIER vec unpackHalf(vec const& v) + { + return detail::compute_half::unpack(v); + } + + template + GLM_FUNC_QUALIFIER vec packUnorm(vec const& v) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "uintType must be an integer type"); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "floatType must be a floating point type"); + + return vec(round(clamp(v, static_cast(0), static_cast(1)) * static_cast(std::numeric_limits::max()))); + } + + template + GLM_FUNC_QUALIFIER vec unpackUnorm(vec const& v) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "uintType must be an integer type"); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "floatType must be a floating point type"); + + return vec(v) * (static_cast(1) / static_cast(std::numeric_limits::max())); + } + + template + GLM_FUNC_QUALIFIER vec packSnorm(vec const& v) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "uintType must be an integer type"); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "floatType must be a floating point type"); + + return vec(round(clamp(v , static_cast(-1), static_cast(1)) * static_cast(std::numeric_limits::max()))); + } + + template + GLM_FUNC_QUALIFIER vec unpackSnorm(vec const& v) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "uintType must be an integer type"); + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "floatType must be a floating point type"); + + return clamp(vec(v) * (static_cast(1) / static_cast(std::numeric_limits::max())), static_cast(-1), static_cast(1)); + } + + GLM_FUNC_QUALIFIER uint8 packUnorm2x4(vec2 const& v) + { + u32vec2 const Unpack(round(clamp(v, 0.0f, 1.0f) * 15.0f)); + detail::u4u4 Result; + Result.data.x = Unpack.x; + Result.data.y = Unpack.y; + return Result.pack; + } + + GLM_FUNC_QUALIFIER vec2 unpackUnorm2x4(uint8 v) + { + float const ScaleFactor(1.f / 15.f); + detail::u4u4 Unpack; + Unpack.pack = v; + return vec2(Unpack.data.x, Unpack.data.y) * ScaleFactor; + } + + GLM_FUNC_QUALIFIER uint16 packUnorm4x4(vec4 const& v) + { + u32vec4 const Unpack(round(clamp(v, 0.0f, 1.0f) * 15.0f)); + detail::u4u4u4u4 Result; + Result.data.x = Unpack.x; + Result.data.y = Unpack.y; + Result.data.z = Unpack.z; + Result.data.w = Unpack.w; + return Result.pack; + } + + GLM_FUNC_QUALIFIER vec4 unpackUnorm4x4(uint16 v) + { + float const ScaleFactor(1.f / 15.f); + detail::u4u4u4u4 Unpack; + Unpack.pack = v; + return vec4(Unpack.data.x, Unpack.data.y, Unpack.data.z, Unpack.data.w) * ScaleFactor; + } + + GLM_FUNC_QUALIFIER uint16 packUnorm1x5_1x6_1x5(vec3 const& v) + { + u32vec3 const Unpack(round(clamp(v, 0.0f, 1.0f) * vec3(31.f, 63.f, 31.f))); + detail::u5u6u5 Result; + Result.data.x = Unpack.x; + Result.data.y = Unpack.y; + Result.data.z = Unpack.z; + return Result.pack; + } + + GLM_FUNC_QUALIFIER vec3 unpackUnorm1x5_1x6_1x5(uint16 v) + { + vec3 const ScaleFactor(1.f / 31.f, 1.f / 63.f, 1.f / 31.f); + detail::u5u6u5 Unpack; + Unpack.pack = v; + return vec3(Unpack.data.x, Unpack.data.y, Unpack.data.z) * ScaleFactor; + } + + GLM_FUNC_QUALIFIER uint16 packUnorm3x5_1x1(vec4 const& v) + { + u32vec4 const Unpack(round(clamp(v, 0.0f, 1.0f) * vec4(31.f, 31.f, 31.f, 1.f))); + detail::u5u5u5u1 Result; + Result.data.x = Unpack.x; + Result.data.y = Unpack.y; + Result.data.z = Unpack.z; + Result.data.w = Unpack.w; + return Result.pack; + } + + GLM_FUNC_QUALIFIER vec4 unpackUnorm3x5_1x1(uint16 v) + { + vec4 const ScaleFactor(1.f / 31.f, 1.f / 31.f, 1.f / 31.f, 1.f); + detail::u5u5u5u1 Unpack; + Unpack.pack = v; + return vec4(Unpack.data.x, Unpack.data.y, Unpack.data.z, Unpack.data.w) * ScaleFactor; + } + + GLM_FUNC_QUALIFIER uint8 packUnorm2x3_1x2(vec3 const& v) + { + u32vec3 const Unpack(round(clamp(v, 0.0f, 1.0f) * vec3(7.f, 7.f, 3.f))); + detail::u3u3u2 Result; + Result.data.x = Unpack.x; + Result.data.y = Unpack.y; + Result.data.z = Unpack.z; + return Result.pack; + } + + GLM_FUNC_QUALIFIER vec3 unpackUnorm2x3_1x2(uint8 v) + { + vec3 const ScaleFactor(1.f / 7.f, 1.f / 7.f, 1.f / 3.f); + detail::u3u3u2 Unpack; + Unpack.pack = v; + return vec3(Unpack.data.x, Unpack.data.y, Unpack.data.z) * ScaleFactor; + } + + GLM_FUNC_QUALIFIER int16 packInt2x8(i8vec2 const& v) + { + int16 Pack = 0; + memcpy(&Pack, &v, sizeof(Pack)); + return Pack; + } + + GLM_FUNC_QUALIFIER i8vec2 unpackInt2x8(int16 p) + { + i8vec2 Unpack; + memcpy(&Unpack, &p, sizeof(Unpack)); + return Unpack; + } + + GLM_FUNC_QUALIFIER uint16 packUint2x8(u8vec2 const& v) + { + uint16 Pack = 0; + memcpy(&Pack, &v, sizeof(Pack)); + return Pack; + } + + GLM_FUNC_QUALIFIER u8vec2 unpackUint2x8(uint16 p) + { + u8vec2 Unpack; + memcpy(&Unpack, &p, sizeof(Unpack)); + return Unpack; + } + + GLM_FUNC_QUALIFIER int32 packInt4x8(i8vec4 const& v) + { + int32 Pack = 0; + memcpy(&Pack, &v, sizeof(Pack)); + return Pack; + } + + GLM_FUNC_QUALIFIER i8vec4 unpackInt4x8(int32 p) + { + i8vec4 Unpack; + memcpy(&Unpack, &p, sizeof(Unpack)); + return Unpack; + } + + GLM_FUNC_QUALIFIER uint32 packUint4x8(u8vec4 const& v) + { + uint32 Pack = 0; + memcpy(&Pack, &v, sizeof(Pack)); + return Pack; + } + + GLM_FUNC_QUALIFIER u8vec4 unpackUint4x8(uint32 p) + { + u8vec4 Unpack; + memcpy(&Unpack, &p, sizeof(Unpack)); + return Unpack; + } + + GLM_FUNC_QUALIFIER int packInt2x16(i16vec2 const& v) + { + int Pack = 0; + memcpy(&Pack, &v, sizeof(Pack)); + return Pack; + } + + GLM_FUNC_QUALIFIER i16vec2 unpackInt2x16(int p) + { + i16vec2 Unpack; + memcpy(&Unpack, &p, sizeof(Unpack)); + return Unpack; + } + + GLM_FUNC_QUALIFIER int64 packInt4x16(i16vec4 const& v) + { + int64 Pack = 0; + memcpy(&Pack, &v, sizeof(Pack)); + return Pack; + } + + GLM_FUNC_QUALIFIER i16vec4 unpackInt4x16(int64 p) + { + i16vec4 Unpack; + memcpy(&Unpack, &p, sizeof(Unpack)); + return Unpack; + } + + GLM_FUNC_QUALIFIER uint packUint2x16(u16vec2 const& v) + { + uint Pack = 0; + memcpy(&Pack, &v, sizeof(Pack)); + return Pack; + } + + GLM_FUNC_QUALIFIER u16vec2 unpackUint2x16(uint p) + { + u16vec2 Unpack; + memcpy(&Unpack, &p, sizeof(Unpack)); + return Unpack; + } + + GLM_FUNC_QUALIFIER uint64 packUint4x16(u16vec4 const& v) + { + uint64 Pack = 0; + memcpy(&Pack, &v, sizeof(Pack)); + return Pack; + } + + GLM_FUNC_QUALIFIER u16vec4 unpackUint4x16(uint64 p) + { + u16vec4 Unpack; + memcpy(&Unpack, &p, sizeof(Unpack)); + return Unpack; + } + + GLM_FUNC_QUALIFIER int64 packInt2x32(i32vec2 const& v) + { + int64 Pack = 0; + memcpy(&Pack, &v, sizeof(Pack)); + return Pack; + } + + GLM_FUNC_QUALIFIER i32vec2 unpackInt2x32(int64 p) + { + i32vec2 Unpack; + memcpy(&Unpack, &p, sizeof(Unpack)); + return Unpack; + } + + GLM_FUNC_QUALIFIER uint64 packUint2x32(u32vec2 const& v) + { + uint64 Pack = 0; + memcpy(&Pack, &v, sizeof(Pack)); + return Pack; + } + + GLM_FUNC_QUALIFIER u32vec2 unpackUint2x32(uint64 p) + { + u32vec2 Unpack; + memcpy(&Unpack, &p, sizeof(Unpack)); + return Unpack; + } +}//namespace glm + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/quaternion.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/quaternion.hpp new file mode 100644 index 0000000000000000000000000000000000000000..d8e85500d44521379963cb32a45d0a130133515e --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/quaternion.hpp @@ -0,0 +1,173 @@ +/// @ref gtc_quaternion +/// @file glm/gtc/quaternion.hpp +/// +/// @see core (dependence) +/// @see gtc_constants (dependence) +/// +/// @defgroup gtc_quaternion GLM_GTC_quaternion +/// @ingroup gtc +/// +/// Include to use the features of this extension. +/// +/// Defines a templated quaternion type and several quaternion operations. + +#pragma once + +// Dependency: +#include "../gtc/constants.hpp" +#include "../gtc/matrix_transform.hpp" +#include "../ext/vector_relational.hpp" +#include "../ext/quaternion_common.hpp" +#include "../ext/quaternion_float.hpp" +#include "../ext/quaternion_float_precision.hpp" +#include "../ext/quaternion_double.hpp" +#include "../ext/quaternion_double_precision.hpp" +#include "../ext/quaternion_relational.hpp" +#include "../ext/quaternion_geometric.hpp" +#include "../ext/quaternion_trigonometric.hpp" +#include "../ext/quaternion_transform.hpp" +#include "../detail/type_mat3x3.hpp" +#include "../detail/type_mat4x4.hpp" +#include "../detail/type_vec3.hpp" +#include "../detail/type_vec4.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_GTC_quaternion extension included") +#endif + +namespace glm +{ + /// @addtogroup gtc_quaternion + /// @{ + + /// Returns euler angles, pitch as x, yaw as y, roll as z. + /// The result is expressed in radians. + /// + /// @tparam T Floating-point scalar types. + /// + /// @see gtc_quaternion + template + GLM_FUNC_DECL vec<3, T, Q> eulerAngles(qua const& x); + + /// Returns roll value of euler angles expressed in radians. + /// + /// @tparam T Floating-point scalar types. + /// + /// @see gtc_quaternion + template + GLM_FUNC_DECL T roll(qua const& x); + + /// Returns pitch value of euler angles expressed in radians. + /// + /// @tparam T Floating-point scalar types. + /// + /// @see gtc_quaternion + template + GLM_FUNC_DECL T pitch(qua const& x); + + /// Returns yaw value of euler angles expressed in radians. + /// + /// @tparam T Floating-point scalar types. + /// + /// @see gtc_quaternion + template + GLM_FUNC_DECL T yaw(qua const& x); + + /// Converts a quaternion to a 3 * 3 matrix. + /// + /// @tparam T Floating-point scalar types. + /// + /// @see gtc_quaternion + template + GLM_FUNC_DECL mat<3, 3, T, Q> mat3_cast(qua const& x); + + /// Converts a quaternion to a 4 * 4 matrix. + /// + /// @tparam T Floating-point scalar types. + /// + /// @see gtc_quaternion + template + GLM_FUNC_DECL mat<4, 4, T, Q> mat4_cast(qua const& x); + + /// Converts a pure rotation 3 * 3 matrix to a quaternion. + /// + /// @tparam T Floating-point scalar types. + /// + /// @see gtc_quaternion + template + GLM_FUNC_DECL qua quat_cast(mat<3, 3, T, Q> const& x); + + /// Converts a pure rotation 4 * 4 matrix to a quaternion. + /// + /// @tparam T Floating-point scalar types. + /// + /// @see gtc_quaternion + template + GLM_FUNC_DECL qua quat_cast(mat<4, 4, T, Q> const& x); + + /// Returns the component-wise comparison result of x < y. + /// + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see ext_quaternion_relational + template + GLM_FUNC_DECL vec<4, bool, Q> lessThan(qua const& x, qua const& y); + + /// Returns the component-wise comparison of result x <= y. + /// + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see ext_quaternion_relational + template + GLM_FUNC_DECL vec<4, bool, Q> lessThanEqual(qua const& x, qua const& y); + + /// Returns the component-wise comparison of result x > y. + /// + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see ext_quaternion_relational + template + GLM_FUNC_DECL vec<4, bool, Q> greaterThan(qua const& x, qua const& y); + + /// Returns the component-wise comparison of result x >= y. + /// + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see ext_quaternion_relational + template + GLM_FUNC_DECL vec<4, bool, Q> greaterThanEqual(qua const& x, qua const& y); + + /// Build a look at quaternion based on the default handedness. + /// + /// @param direction Desired forward direction. Needs to be normalized. + /// @param up Up vector, how the camera is oriented. Typically (0, 1, 0). + template + GLM_FUNC_DECL qua quatLookAt( + vec<3, T, Q> const& direction, + vec<3, T, Q> const& up); + + /// Build a right-handed look at quaternion. + /// + /// @param direction Desired forward direction onto which the -z-axis gets mapped. Needs to be normalized. + /// @param up Up vector, how the camera is oriented. Typically (0, 1, 0). + template + GLM_FUNC_DECL qua quatLookAtRH( + vec<3, T, Q> const& direction, + vec<3, T, Q> const& up); + + /// Build a left-handed look at quaternion. + /// + /// @param direction Desired forward direction onto which the +z-axis gets mapped. Needs to be normalized. + /// @param up Up vector, how the camera is oriented. Typically (0, 1, 0). + template + GLM_FUNC_DECL qua quatLookAtLH( + vec<3, T, Q> const& direction, + vec<3, T, Q> const& up); + /// @} +} //namespace glm + +#include "quaternion.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/quaternion.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/quaternion.inl new file mode 100644 index 0000000000000000000000000000000000000000..3a936364e18d4776d9f2423c45ef7404adc7ad9f --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/quaternion.inl @@ -0,0 +1,208 @@ +#include "../trigonometric.hpp" +#include "../geometric.hpp" +#include "../exponential.hpp" +#include "epsilon.hpp" +#include + +namespace glm +{ + template + GLM_FUNC_QUALIFIER vec<3, T, Q> eulerAngles(qua const& x) + { + return vec<3, T, Q>(pitch(x), yaw(x), roll(x)); + } + + template + GLM_FUNC_QUALIFIER T roll(qua const& q) + { + T const y = static_cast(2) * (q.x * q.y + q.w * q.z); + T const x = q.w * q.w + q.x * q.x - q.y * q.y - q.z * q.z; + + if(all(equal(vec<2, T, Q>(x, y), vec<2, T, Q>(0), epsilon()))) //avoid atan2(0,0) - handle singularity - Matiis + return static_cast(0); + + return static_cast(atan(y, x)); + } + + template + GLM_FUNC_QUALIFIER T pitch(qua const& q) + { + //return T(atan(T(2) * (q.y * q.z + q.w * q.x), q.w * q.w - q.x * q.x - q.y * q.y + q.z * q.z)); + T const y = static_cast(2) * (q.y * q.z + q.w * q.x); + T const x = q.w * q.w - q.x * q.x - q.y * q.y + q.z * q.z; + + if(all(equal(vec<2, T, Q>(x, y), vec<2, T, Q>(0), epsilon()))) //avoid atan2(0,0) - handle singularity - Matiis + return static_cast(static_cast(2) * atan(q.x, q.w)); + + return static_cast(atan(y, x)); + } + + template + GLM_FUNC_QUALIFIER T yaw(qua const& q) + { + return asin(clamp(static_cast(-2) * (q.x * q.z - q.w * q.y), static_cast(-1), static_cast(1))); + } + + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> mat3_cast(qua const& q) + { + mat<3, 3, T, Q> Result(T(1)); + T qxx(q.x * q.x); + T qyy(q.y * q.y); + T qzz(q.z * q.z); + T qxz(q.x * q.z); + T qxy(q.x * q.y); + T qyz(q.y * q.z); + T qwx(q.w * q.x); + T qwy(q.w * q.y); + T qwz(q.w * q.z); + + Result[0][0] = T(1) - T(2) * (qyy + qzz); + Result[0][1] = T(2) * (qxy + qwz); + Result[0][2] = T(2) * (qxz - qwy); + + Result[1][0] = T(2) * (qxy - qwz); + Result[1][1] = T(1) - T(2) * (qxx + qzz); + Result[1][2] = T(2) * (qyz + qwx); + + Result[2][0] = T(2) * (qxz + qwy); + Result[2][1] = T(2) * (qyz - qwx); + Result[2][2] = T(1) - T(2) * (qxx + qyy); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> mat4_cast(qua const& q) + { + return mat<4, 4, T, Q>(mat3_cast(q)); + } + + template + GLM_FUNC_QUALIFIER qua quat_cast(mat<3, 3, T, Q> const& m) + { + T fourXSquaredMinus1 = m[0][0] - m[1][1] - m[2][2]; + T fourYSquaredMinus1 = m[1][1] - m[0][0] - m[2][2]; + T fourZSquaredMinus1 = m[2][2] - m[0][0] - m[1][1]; + T fourWSquaredMinus1 = m[0][0] + m[1][1] + m[2][2]; + + int biggestIndex = 0; + T fourBiggestSquaredMinus1 = fourWSquaredMinus1; + if(fourXSquaredMinus1 > fourBiggestSquaredMinus1) + { + fourBiggestSquaredMinus1 = fourXSquaredMinus1; + biggestIndex = 1; + } + if(fourYSquaredMinus1 > fourBiggestSquaredMinus1) + { + fourBiggestSquaredMinus1 = fourYSquaredMinus1; + biggestIndex = 2; + } + if(fourZSquaredMinus1 > fourBiggestSquaredMinus1) + { + fourBiggestSquaredMinus1 = fourZSquaredMinus1; + biggestIndex = 3; + } + + T biggestVal = sqrt(fourBiggestSquaredMinus1 + static_cast(1)) * static_cast(0.5); + T mult = static_cast(0.25) / biggestVal; + + switch(biggestIndex) + { + case 0: + return qua(biggestVal, (m[1][2] - m[2][1]) * mult, (m[2][0] - m[0][2]) * mult, (m[0][1] - m[1][0]) * mult); + case 1: + return qua((m[1][2] - m[2][1]) * mult, biggestVal, (m[0][1] + m[1][0]) * mult, (m[2][0] + m[0][2]) * mult); + case 2: + return qua((m[2][0] - m[0][2]) * mult, (m[0][1] + m[1][0]) * mult, biggestVal, (m[1][2] + m[2][1]) * mult); + case 3: + return qua((m[0][1] - m[1][0]) * mult, (m[2][0] + m[0][2]) * mult, (m[1][2] + m[2][1]) * mult, biggestVal); + default: // Silence a -Wswitch-default warning in GCC. Should never actually get here. Assert is just for sanity. + assert(false); + return qua(1, 0, 0, 0); + } + } + + template + GLM_FUNC_QUALIFIER qua quat_cast(mat<4, 4, T, Q> const& m4) + { + return quat_cast(mat<3, 3, T, Q>(m4)); + } + + template + GLM_FUNC_QUALIFIER vec<4, bool, Q> lessThan(qua const& x, qua const& y) + { + vec<4, bool, Q> Result; + for(length_t i = 0; i < x.length(); ++i) + Result[i] = x[i] < y[i]; + return Result; + } + + template + GLM_FUNC_QUALIFIER vec<4, bool, Q> lessThanEqual(qua const& x, qua const& y) + { + vec<4, bool, Q> Result; + for(length_t i = 0; i < x.length(); ++i) + Result[i] = x[i] <= y[i]; + return Result; + } + + template + GLM_FUNC_QUALIFIER vec<4, bool, Q> greaterThan(qua const& x, qua const& y) + { + vec<4, bool, Q> Result; + for(length_t i = 0; i < x.length(); ++i) + Result[i] = x[i] > y[i]; + return Result; + } + + template + GLM_FUNC_QUALIFIER vec<4, bool, Q> greaterThanEqual(qua const& x, qua const& y) + { + vec<4, bool, Q> Result; + for(length_t i = 0; i < x.length(); ++i) + Result[i] = x[i] >= y[i]; + return Result; + } + + + template + GLM_FUNC_QUALIFIER qua quatLookAt(vec<3, T, Q> const& direction, vec<3, T, Q> const& up) + { +# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_LH_BIT + return quatLookAtLH(direction, up); +# else + return quatLookAtRH(direction, up); +# endif + } + + template + GLM_FUNC_QUALIFIER qua quatLookAtRH(vec<3, T, Q> const& direction, vec<3, T, Q> const& up) + { + mat<3, 3, T, Q> Result; + + Result[2] = -direction; + vec<3, T, Q> const& Right = cross(up, Result[2]); + Result[0] = Right * inversesqrt(max(static_cast(0.00001), dot(Right, Right))); + Result[1] = cross(Result[2], Result[0]); + + return quat_cast(Result); + } + + template + GLM_FUNC_QUALIFIER qua quatLookAtLH(vec<3, T, Q> const& direction, vec<3, T, Q> const& up) + { + mat<3, 3, T, Q> Result; + + Result[2] = direction; + vec<3, T, Q> const& Right = cross(up, Result[2]); + Result[0] = Right * inversesqrt(max(static_cast(0.00001), dot(Right, Right))); + Result[1] = cross(Result[2], Result[0]); + + return quat_cast(Result); + } +}//namespace glm + +#if GLM_CONFIG_SIMD == GLM_ENABLE +# include "quaternion_simd.inl" +#endif + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/quaternion_simd.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/quaternion_simd.inl new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/random.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/random.hpp new file mode 100644 index 0000000000000000000000000000000000000000..3e4dd4bccea250874836a8b21660ada00d768812 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/random.hpp @@ -0,0 +1,82 @@ +/// @ref gtc_random +/// @file glm/gtc/random.hpp +/// +/// @see core (dependence) +/// @see gtx_random (extended) +/// +/// @defgroup gtc_random GLM_GTC_random +/// @ingroup gtc +/// +/// Include to use the features of this extension. +/// +/// Generate random number from various distribution methods. + +#pragma once + +// Dependency: +#include "../ext/scalar_int_sized.hpp" +#include "../ext/scalar_uint_sized.hpp" +#include "../detail/qualifier.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_GTC_random extension included") +#endif + +namespace glm +{ + /// @addtogroup gtc_random + /// @{ + + /// Generate random numbers in the interval [Min, Max], according a linear distribution + /// + /// @param Min Minimum value included in the sampling + /// @param Max Maximum value included in the sampling + /// @tparam genType Value type. Currently supported: float or double scalars. + /// @see gtc_random + template + GLM_FUNC_DECL genType linearRand(genType Min, genType Max); + + /// Generate random numbers in the interval [Min, Max], according a linear distribution + /// + /// @param Min Minimum value included in the sampling + /// @param Max Maximum value included in the sampling + /// @tparam T Value type. Currently supported: float or double. + /// + /// @see gtc_random + template + GLM_FUNC_DECL vec linearRand(vec const& Min, vec const& Max); + + /// Generate random numbers in the interval [Min, Max], according a gaussian distribution + /// + /// @see gtc_random + template + GLM_FUNC_DECL genType gaussRand(genType Mean, genType Deviation); + + /// Generate a random 2D vector which coordinates are regularly distributed on a circle of a given radius + /// + /// @see gtc_random + template + GLM_FUNC_DECL vec<2, T, defaultp> circularRand(T Radius); + + /// Generate a random 3D vector which coordinates are regularly distributed on a sphere of a given radius + /// + /// @see gtc_random + template + GLM_FUNC_DECL vec<3, T, defaultp> sphericalRand(T Radius); + + /// Generate a random 2D vector which coordinates are regularly distributed within the area of a disk of a given radius + /// + /// @see gtc_random + template + GLM_FUNC_DECL vec<2, T, defaultp> diskRand(T Radius); + + /// Generate a random 3D vector which coordinates are regularly distributed within the volume of a ball of a given radius + /// + /// @see gtc_random + template + GLM_FUNC_DECL vec<3, T, defaultp> ballRand(T Radius); + + /// @} +}//namespace glm + +#include "random.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/random.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/random.inl new file mode 100644 index 0000000000000000000000000000000000000000..69439fa344b29f55952e970a8e492e08da49cb02 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/random.inl @@ -0,0 +1,303 @@ +#include "../geometric.hpp" +#include "../exponential.hpp" +#include "../trigonometric.hpp" +#include "../detail/type_vec1.hpp" +#include +#include +#include +#include + +namespace glm{ +namespace detail +{ + template + struct compute_rand + { + GLM_FUNC_QUALIFIER static vec call(); + }; + + template + struct compute_rand<1, uint8, P> + { + GLM_FUNC_QUALIFIER static vec<1, uint8, P> call() + { + return vec<1, uint8, P>( + static_cast(std::rand() % std::numeric_limits::max())); + } + }; + + template + struct compute_rand<2, uint8, P> + { + GLM_FUNC_QUALIFIER static vec<2, uint8, P> call() + { + return vec<2, uint8, P>( + std::rand() % std::numeric_limits::max(), + std::rand() % std::numeric_limits::max()); + } + }; + + template + struct compute_rand<3, uint8, P> + { + GLM_FUNC_QUALIFIER static vec<3, uint8, P> call() + { + return vec<3, uint8, P>( + std::rand() % std::numeric_limits::max(), + std::rand() % std::numeric_limits::max(), + std::rand() % std::numeric_limits::max()); + } + }; + + template + struct compute_rand<4, uint8, P> + { + GLM_FUNC_QUALIFIER static vec<4, uint8, P> call() + { + return vec<4, uint8, P>( + std::rand() % std::numeric_limits::max(), + std::rand() % std::numeric_limits::max(), + std::rand() % std::numeric_limits::max(), + std::rand() % std::numeric_limits::max()); + } + }; + + template + struct compute_rand + { + GLM_FUNC_QUALIFIER static vec call() + { + return + (vec(compute_rand::call()) << static_cast(8)) | + (vec(compute_rand::call()) << static_cast(0)); + } + }; + + template + struct compute_rand + { + GLM_FUNC_QUALIFIER static vec call() + { + return + (vec(compute_rand::call()) << static_cast(16)) | + (vec(compute_rand::call()) << static_cast(0)); + } + }; + + template + struct compute_rand + { + GLM_FUNC_QUALIFIER static vec call() + { + return + (vec(compute_rand::call()) << static_cast(32)) | + (vec(compute_rand::call()) << static_cast(0)); + } + }; + + template + struct compute_linearRand + { + GLM_FUNC_QUALIFIER static vec call(vec const& Min, vec const& Max); + }; + + template + struct compute_linearRand + { + GLM_FUNC_QUALIFIER static vec call(vec const& Min, vec const& Max) + { + return (vec(compute_rand::call() % vec(Max + static_cast(1) - Min))) + Min; + } + }; + + template + struct compute_linearRand + { + GLM_FUNC_QUALIFIER static vec call(vec const& Min, vec const& Max) + { + return (compute_rand::call() % (Max + static_cast(1) - Min)) + Min; + } + }; + + template + struct compute_linearRand + { + GLM_FUNC_QUALIFIER static vec call(vec const& Min, vec const& Max) + { + return (vec(compute_rand::call() % vec(Max + static_cast(1) - Min))) + Min; + } + }; + + template + struct compute_linearRand + { + GLM_FUNC_QUALIFIER static vec call(vec const& Min, vec const& Max) + { + return (compute_rand::call() % (Max + static_cast(1) - Min)) + Min; + } + }; + + template + struct compute_linearRand + { + GLM_FUNC_QUALIFIER static vec call(vec const& Min, vec const& Max) + { + return (vec(compute_rand::call() % vec(Max + static_cast(1) - Min))) + Min; + } + }; + + template + struct compute_linearRand + { + GLM_FUNC_QUALIFIER static vec call(vec const& Min, vec const& Max) + { + return (compute_rand::call() % (Max + static_cast(1) - Min)) + Min; + } + }; + + template + struct compute_linearRand + { + GLM_FUNC_QUALIFIER static vec call(vec const& Min, vec const& Max) + { + return (vec(compute_rand::call() % vec(Max + static_cast(1) - Min))) + Min; + } + }; + + template + struct compute_linearRand + { + GLM_FUNC_QUALIFIER static vec call(vec const& Min, vec const& Max) + { + return (compute_rand::call() % (Max + static_cast(1) - Min)) + Min; + } + }; + + template + struct compute_linearRand + { + GLM_FUNC_QUALIFIER static vec call(vec const& Min, vec const& Max) + { + return vec(compute_rand::call()) / static_cast(std::numeric_limits::max()) * (Max - Min) + Min; + } + }; + + template + struct compute_linearRand + { + GLM_FUNC_QUALIFIER static vec call(vec const& Min, vec const& Max) + { + return vec(compute_rand::call()) / static_cast(std::numeric_limits::max()) * (Max - Min) + Min; + } + }; + + template + struct compute_linearRand + { + GLM_FUNC_QUALIFIER static vec call(vec const& Min, vec const& Max) + { + return vec(compute_rand::call()) / static_cast(std::numeric_limits::max()) * (Max - Min) + Min; + } + }; +}//namespace detail + + template + GLM_FUNC_QUALIFIER genType linearRand(genType Min, genType Max) + { + return detail::compute_linearRand<1, genType, highp>::call( + vec<1, genType, highp>(Min), + vec<1, genType, highp>(Max)).x; + } + + template + GLM_FUNC_QUALIFIER vec linearRand(vec const& Min, vec const& Max) + { + return detail::compute_linearRand::call(Min, Max); + } + + template + GLM_FUNC_QUALIFIER genType gaussRand(genType Mean, genType Deviation) + { + genType w, x1, x2; + + do + { + x1 = linearRand(genType(-1), genType(1)); + x2 = linearRand(genType(-1), genType(1)); + + w = x1 * x1 + x2 * x2; + } while(w > genType(1)); + + return static_cast(x2 * Deviation * Deviation * sqrt((genType(-2) * log(w)) / w) + Mean); + } + + template + GLM_FUNC_QUALIFIER vec gaussRand(vec const& Mean, vec const& Deviation) + { + return detail::functor2::call(gaussRand, Mean, Deviation); + } + + template + GLM_FUNC_QUALIFIER vec<2, T, defaultp> diskRand(T Radius) + { + assert(Radius > static_cast(0)); + + vec<2, T, defaultp> Result(T(0)); + T LenRadius(T(0)); + + do + { + Result = linearRand( + vec<2, T, defaultp>(-Radius), + vec<2, T, defaultp>(Radius)); + LenRadius = length(Result); + } + while(LenRadius > Radius); + + return Result; + } + + template + GLM_FUNC_QUALIFIER vec<3, T, defaultp> ballRand(T Radius) + { + assert(Radius > static_cast(0)); + + vec<3, T, defaultp> Result(T(0)); + T LenRadius(T(0)); + + do + { + Result = linearRand( + vec<3, T, defaultp>(-Radius), + vec<3, T, defaultp>(Radius)); + LenRadius = length(Result); + } + while(LenRadius > Radius); + + return Result; + } + + template + GLM_FUNC_QUALIFIER vec<2, T, defaultp> circularRand(T Radius) + { + assert(Radius > static_cast(0)); + + T a = linearRand(T(0), static_cast(6.283185307179586476925286766559)); + return vec<2, T, defaultp>(glm::cos(a), glm::sin(a)) * Radius; + } + + template + GLM_FUNC_QUALIFIER vec<3, T, defaultp> sphericalRand(T Radius) + { + assert(Radius > static_cast(0)); + + T theta = linearRand(T(0), T(6.283185307179586476925286766559f)); + T phi = std::acos(linearRand(T(-1.0f), T(1.0f))); + + T x = std::sin(phi) * std::cos(theta); + T y = std::sin(phi) * std::sin(theta); + T z = std::cos(phi); + + return vec<3, T, defaultp>(x, y, z) * Radius; + } +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/reciprocal.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/reciprocal.hpp new file mode 100644 index 0000000000000000000000000000000000000000..c371495d42378e17354eb5671d54327acd937208 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/reciprocal.hpp @@ -0,0 +1,24 @@ +/// @ref gtc_reciprocal +/// @file glm/gtc/reciprocal.hpp +/// +/// @see core (dependence) +/// +/// @defgroup gtc_reciprocal GLM_GTC_reciprocal +/// @ingroup gtc +/// +/// Include to use the features of this extension. +/// +/// Define secant, cosecant and cotangent functions. + +#pragma once + +// Dependencies +#include "../detail/setup.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_GTC_reciprocal extension included") +#endif + +#include "../ext/scalar_reciprocal.hpp" +#include "../ext/vector_reciprocal.hpp" + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/round.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/round.hpp new file mode 100644 index 0000000000000000000000000000000000000000..1a9f7aabf98086e4226c37ec5d803ac61b77d6cc --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/round.hpp @@ -0,0 +1,160 @@ +/// @ref gtc_round +/// @file glm/gtc/round.hpp +/// +/// @see core (dependence) +/// @see gtc_round (dependence) +/// +/// @defgroup gtc_round GLM_GTC_round +/// @ingroup gtc +/// +/// Include to use the features of this extension. +/// +/// Rounding value to specific boundings + +#pragma once + +// Dependencies +#include "../detail/setup.hpp" +#include "../detail/qualifier.hpp" +#include "../detail/_vectorize.hpp" +#include "../vector_relational.hpp" +#include "../common.hpp" +#include + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_GTC_round extension included") +#endif + +namespace glm +{ + /// @addtogroup gtc_round + /// @{ + + /// Return the power of two number which value is just higher the input value, + /// round up to a power of two. + /// + /// @see gtc_round + template + GLM_FUNC_DECL genIUType ceilPowerOfTwo(genIUType v); + + /// Return the power of two number which value is just higher the input value, + /// round up to a power of two. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point or integer scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see gtc_round + template + GLM_FUNC_DECL vec ceilPowerOfTwo(vec const& v); + + /// Return the power of two number which value is just lower the input value, + /// round down to a power of two. + /// + /// @see gtc_round + template + GLM_FUNC_DECL genIUType floorPowerOfTwo(genIUType v); + + /// Return the power of two number which value is just lower the input value, + /// round down to a power of two. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point or integer scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see gtc_round + template + GLM_FUNC_DECL vec floorPowerOfTwo(vec const& v); + + /// Return the power of two number which value is the closet to the input value. + /// + /// @see gtc_round + template + GLM_FUNC_DECL genIUType roundPowerOfTwo(genIUType v); + + /// Return the power of two number which value is the closet to the input value. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point or integer scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see gtc_round + template + GLM_FUNC_DECL vec roundPowerOfTwo(vec const& v); + + /// Higher multiple number of Source. + /// + /// @tparam genType Floating-point or integer scalar or vector types. + /// + /// @param v Source value to which is applied the function + /// @param Multiple Must be a null or positive value + /// + /// @see gtc_round + template + GLM_FUNC_DECL genType ceilMultiple(genType v, genType Multiple); + + /// Higher multiple number of Source. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point or integer scalar types + /// @tparam Q Value from qualifier enum + /// + /// @param v Source values to which is applied the function + /// @param Multiple Must be a null or positive value + /// + /// @see gtc_round + template + GLM_FUNC_DECL vec ceilMultiple(vec const& v, vec const& Multiple); + + /// Lower multiple number of Source. + /// + /// @tparam genType Floating-point or integer scalar or vector types. + /// + /// @param v Source value to which is applied the function + /// @param Multiple Must be a null or positive value + /// + /// @see gtc_round + template + GLM_FUNC_DECL genType floorMultiple(genType v, genType Multiple); + + /// Lower multiple number of Source. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point or integer scalar types + /// @tparam Q Value from qualifier enum + /// + /// @param v Source values to which is applied the function + /// @param Multiple Must be a null or positive value + /// + /// @see gtc_round + template + GLM_FUNC_DECL vec floorMultiple(vec const& v, vec const& Multiple); + + /// Lower multiple number of Source. + /// + /// @tparam genType Floating-point or integer scalar or vector types. + /// + /// @param v Source value to which is applied the function + /// @param Multiple Must be a null or positive value + /// + /// @see gtc_round + template + GLM_FUNC_DECL genType roundMultiple(genType v, genType Multiple); + + /// Lower multiple number of Source. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point or integer scalar types + /// @tparam Q Value from qualifier enum + /// + /// @param v Source values to which is applied the function + /// @param Multiple Must be a null or positive value + /// + /// @see gtc_round + template + GLM_FUNC_DECL vec roundMultiple(vec const& v, vec const& Multiple); + + /// @} +} //namespace glm + +#include "round.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/round.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/round.inl new file mode 100644 index 0000000000000000000000000000000000000000..a1beda57830372de001bdcdd1a4b78135fa540fe --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/round.inl @@ -0,0 +1,155 @@ +/// @ref gtc_round + +#include "../integer.hpp" +#include "../ext/vector_integer.hpp" + +namespace glm{ +namespace detail +{ + template + struct compute_roundMultiple {}; + + template<> + struct compute_roundMultiple + { + template + GLM_FUNC_QUALIFIER static genType call(genType Source, genType Multiple) + { + if (Source >= genType(0)) + return Source - std::fmod(Source, Multiple); + else + { + genType Tmp = Source + genType(1); + return Tmp - std::fmod(Tmp, Multiple) - Multiple; + } + } + }; + + template<> + struct compute_roundMultiple + { + template + GLM_FUNC_QUALIFIER static genType call(genType Source, genType Multiple) + { + if (Source >= genType(0)) + return Source - Source % Multiple; + else + { + genType Tmp = Source + genType(1); + return Tmp - Tmp % Multiple - Multiple; + } + } + }; + + template<> + struct compute_roundMultiple + { + template + GLM_FUNC_QUALIFIER static genType call(genType Source, genType Multiple) + { + if (Source >= genType(0)) + return Source - Source % Multiple; + else + { + genType Tmp = Source + genType(1); + return Tmp - Tmp % Multiple - Multiple; + } + } + }; +}//namespace detail + + ////////////////// + // ceilPowerOfTwo + + template + GLM_FUNC_QUALIFIER genType ceilPowerOfTwo(genType value) + { + return detail::compute_ceilPowerOfTwo<1, genType, defaultp, std::numeric_limits::is_signed>::call(vec<1, genType, defaultp>(value)).x; + } + + template + GLM_FUNC_QUALIFIER vec ceilPowerOfTwo(vec const& v) + { + return detail::compute_ceilPowerOfTwo::is_signed>::call(v); + } + + /////////////////// + // floorPowerOfTwo + + template + GLM_FUNC_QUALIFIER genType floorPowerOfTwo(genType value) + { + return isPowerOfTwo(value) ? value : static_cast(1) << findMSB(value); + } + + template + GLM_FUNC_QUALIFIER vec floorPowerOfTwo(vec const& v) + { + return detail::functor1::call(floorPowerOfTwo, v); + } + + /////////////////// + // roundPowerOfTwo + + template + GLM_FUNC_QUALIFIER genIUType roundPowerOfTwo(genIUType value) + { + if(isPowerOfTwo(value)) + return value; + + genIUType const prev = static_cast(1) << findMSB(value); + genIUType const next = prev << static_cast(1); + return (next - value) < (value - prev) ? next : prev; + } + + template + GLM_FUNC_QUALIFIER vec roundPowerOfTwo(vec const& v) + { + return detail::functor1::call(roundPowerOfTwo, v); + } + + ////////////////////// + // ceilMultiple + + template + GLM_FUNC_QUALIFIER genType ceilMultiple(genType Source, genType Multiple) + { + return detail::compute_ceilMultiple::is_iec559, std::numeric_limits::is_signed>::call(Source, Multiple); + } + + template + GLM_FUNC_QUALIFIER vec ceilMultiple(vec const& Source, vec const& Multiple) + { + return detail::functor2::call(ceilMultiple, Source, Multiple); + } + + ////////////////////// + // floorMultiple + + template + GLM_FUNC_QUALIFIER genType floorMultiple(genType Source, genType Multiple) + { + return detail::compute_floorMultiple::is_iec559, std::numeric_limits::is_signed>::call(Source, Multiple); + } + + template + GLM_FUNC_QUALIFIER vec floorMultiple(vec const& Source, vec const& Multiple) + { + return detail::functor2::call(floorMultiple, Source, Multiple); + } + + ////////////////////// + // roundMultiple + + template + GLM_FUNC_QUALIFIER genType roundMultiple(genType Source, genType Multiple) + { + return detail::compute_roundMultiple::is_iec559, std::numeric_limits::is_signed>::call(Source, Multiple); + } + + template + GLM_FUNC_QUALIFIER vec roundMultiple(vec const& Source, vec const& Multiple) + { + return detail::functor2::call(roundMultiple, Source, Multiple); + } +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/type_aligned.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/type_aligned.hpp new file mode 100644 index 0000000000000000000000000000000000000000..56b2c1bea638adc916966035f8684349853353dc --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/type_aligned.hpp @@ -0,0 +1,1315 @@ +/// @ref gtc_type_aligned +/// @file glm/gtc/type_aligned.hpp +/// +/// @see core (dependence) +/// +/// @defgroup gtc_type_aligned GLM_GTC_type_aligned +/// @ingroup gtc +/// +/// Include to use the features of this extension. +/// +/// Aligned types allowing SIMD optimizations of vectors and matrices types + +#pragma once + +#if (GLM_CONFIG_ALIGNED_GENTYPES == GLM_DISABLE) +# error "GLM: Aligned gentypes require to enable C++ language extensions. Define GLM_FORCE_ALIGNED_GENTYPES before including GLM headers to use aligned types." +#endif + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_GTC_type_aligned extension included") +#endif + +#include "../mat4x4.hpp" +#include "../mat4x3.hpp" +#include "../mat4x2.hpp" +#include "../mat3x4.hpp" +#include "../mat3x3.hpp" +#include "../mat3x2.hpp" +#include "../mat2x4.hpp" +#include "../mat2x3.hpp" +#include "../mat2x2.hpp" +#include "../gtc/vec1.hpp" +#include "../vec2.hpp" +#include "../vec3.hpp" +#include "../vec4.hpp" + +namespace glm +{ + /// @addtogroup gtc_type_aligned + /// @{ + + // -- *vec1 -- + + /// 1 component vector aligned in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef vec<1, float, aligned_highp> aligned_highp_vec1; + + /// 1 component vector aligned in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef vec<1, float, aligned_mediump> aligned_mediump_vec1; + + /// 1 component vector aligned in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef vec<1, float, aligned_lowp> aligned_lowp_vec1; + + /// 1 component vector aligned in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef vec<1, double, aligned_highp> aligned_highp_dvec1; + + /// 1 component vector aligned in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef vec<1, double, aligned_mediump> aligned_mediump_dvec1; + + /// 1 component vector aligned in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef vec<1, double, aligned_lowp> aligned_lowp_dvec1; + + /// 1 component vector aligned in memory of signed integer numbers. + typedef vec<1, int, aligned_highp> aligned_highp_ivec1; + + /// 1 component vector aligned in memory of signed integer numbers. + typedef vec<1, int, aligned_mediump> aligned_mediump_ivec1; + + /// 1 component vector aligned in memory of signed integer numbers. + typedef vec<1, int, aligned_lowp> aligned_lowp_ivec1; + + /// 1 component vector aligned in memory of unsigned integer numbers. + typedef vec<1, uint, aligned_highp> aligned_highp_uvec1; + + /// 1 component vector aligned in memory of unsigned integer numbers. + typedef vec<1, uint, aligned_mediump> aligned_mediump_uvec1; + + /// 1 component vector aligned in memory of unsigned integer numbers. + typedef vec<1, uint, aligned_lowp> aligned_lowp_uvec1; + + /// 1 component vector aligned in memory of bool values. + typedef vec<1, bool, aligned_highp> aligned_highp_bvec1; + + /// 1 component vector aligned in memory of bool values. + typedef vec<1, bool, aligned_mediump> aligned_mediump_bvec1; + + /// 1 component vector aligned in memory of bool values. + typedef vec<1, bool, aligned_lowp> aligned_lowp_bvec1; + + /// 1 component vector tightly packed in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef vec<1, float, packed_highp> packed_highp_vec1; + + /// 1 component vector tightly packed in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef vec<1, float, packed_mediump> packed_mediump_vec1; + + /// 1 component vector tightly packed in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef vec<1, float, packed_lowp> packed_lowp_vec1; + + /// 1 component vector tightly packed in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef vec<1, double, packed_highp> packed_highp_dvec1; + + /// 1 component vector tightly packed in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef vec<1, double, packed_mediump> packed_mediump_dvec1; + + /// 1 component vector tightly packed in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef vec<1, double, packed_lowp> packed_lowp_dvec1; + + /// 1 component vector tightly packed in memory of signed integer numbers. + typedef vec<1, int, packed_highp> packed_highp_ivec1; + + /// 1 component vector tightly packed in memory of signed integer numbers. + typedef vec<1, int, packed_mediump> packed_mediump_ivec1; + + /// 1 component vector tightly packed in memory of signed integer numbers. + typedef vec<1, int, packed_lowp> packed_lowp_ivec1; + + /// 1 component vector tightly packed in memory of unsigned integer numbers. + typedef vec<1, uint, packed_highp> packed_highp_uvec1; + + /// 1 component vector tightly packed in memory of unsigned integer numbers. + typedef vec<1, uint, packed_mediump> packed_mediump_uvec1; + + /// 1 component vector tightly packed in memory of unsigned integer numbers. + typedef vec<1, uint, packed_lowp> packed_lowp_uvec1; + + /// 1 component vector tightly packed in memory of bool values. + typedef vec<1, bool, packed_highp> packed_highp_bvec1; + + /// 1 component vector tightly packed in memory of bool values. + typedef vec<1, bool, packed_mediump> packed_mediump_bvec1; + + /// 1 component vector tightly packed in memory of bool values. + typedef vec<1, bool, packed_lowp> packed_lowp_bvec1; + + // -- *vec2 -- + + /// 2 components vector aligned in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef vec<2, float, aligned_highp> aligned_highp_vec2; + + /// 2 components vector aligned in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef vec<2, float, aligned_mediump> aligned_mediump_vec2; + + /// 2 components vector aligned in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef vec<2, float, aligned_lowp> aligned_lowp_vec2; + + /// 2 components vector aligned in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef vec<2, double, aligned_highp> aligned_highp_dvec2; + + /// 2 components vector aligned in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef vec<2, double, aligned_mediump> aligned_mediump_dvec2; + + /// 2 components vector aligned in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef vec<2, double, aligned_lowp> aligned_lowp_dvec2; + + /// 2 components vector aligned in memory of signed integer numbers. + typedef vec<2, int, aligned_highp> aligned_highp_ivec2; + + /// 2 components vector aligned in memory of signed integer numbers. + typedef vec<2, int, aligned_mediump> aligned_mediump_ivec2; + + /// 2 components vector aligned in memory of signed integer numbers. + typedef vec<2, int, aligned_lowp> aligned_lowp_ivec2; + + /// 2 components vector aligned in memory of unsigned integer numbers. + typedef vec<2, uint, aligned_highp> aligned_highp_uvec2; + + /// 2 components vector aligned in memory of unsigned integer numbers. + typedef vec<2, uint, aligned_mediump> aligned_mediump_uvec2; + + /// 2 components vector aligned in memory of unsigned integer numbers. + typedef vec<2, uint, aligned_lowp> aligned_lowp_uvec2; + + /// 2 components vector aligned in memory of bool values. + typedef vec<2, bool, aligned_highp> aligned_highp_bvec2; + + /// 2 components vector aligned in memory of bool values. + typedef vec<2, bool, aligned_mediump> aligned_mediump_bvec2; + + /// 2 components vector aligned in memory of bool values. + typedef vec<2, bool, aligned_lowp> aligned_lowp_bvec2; + + /// 2 components vector tightly packed in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef vec<2, float, packed_highp> packed_highp_vec2; + + /// 2 components vector tightly packed in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef vec<2, float, packed_mediump> packed_mediump_vec2; + + /// 2 components vector tightly packed in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef vec<2, float, packed_lowp> packed_lowp_vec2; + + /// 2 components vector tightly packed in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef vec<2, double, packed_highp> packed_highp_dvec2; + + /// 2 components vector tightly packed in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef vec<2, double, packed_mediump> packed_mediump_dvec2; + + /// 2 components vector tightly packed in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef vec<2, double, packed_lowp> packed_lowp_dvec2; + + /// 2 components vector tightly packed in memory of signed integer numbers. + typedef vec<2, int, packed_highp> packed_highp_ivec2; + + /// 2 components vector tightly packed in memory of signed integer numbers. + typedef vec<2, int, packed_mediump> packed_mediump_ivec2; + + /// 2 components vector tightly packed in memory of signed integer numbers. + typedef vec<2, int, packed_lowp> packed_lowp_ivec2; + + /// 2 components vector tightly packed in memory of unsigned integer numbers. + typedef vec<2, uint, packed_highp> packed_highp_uvec2; + + /// 2 components vector tightly packed in memory of unsigned integer numbers. + typedef vec<2, uint, packed_mediump> packed_mediump_uvec2; + + /// 2 components vector tightly packed in memory of unsigned integer numbers. + typedef vec<2, uint, packed_lowp> packed_lowp_uvec2; + + /// 2 components vector tightly packed in memory of bool values. + typedef vec<2, bool, packed_highp> packed_highp_bvec2; + + /// 2 components vector tightly packed in memory of bool values. + typedef vec<2, bool, packed_mediump> packed_mediump_bvec2; + + /// 2 components vector tightly packed in memory of bool values. + typedef vec<2, bool, packed_lowp> packed_lowp_bvec2; + + // -- *vec3 -- + + /// 3 components vector aligned in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef vec<3, float, aligned_highp> aligned_highp_vec3; + + /// 3 components vector aligned in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef vec<3, float, aligned_mediump> aligned_mediump_vec3; + + /// 3 components vector aligned in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef vec<3, float, aligned_lowp> aligned_lowp_vec3; + + /// 3 components vector aligned in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef vec<3, double, aligned_highp> aligned_highp_dvec3; + + /// 3 components vector aligned in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef vec<3, double, aligned_mediump> aligned_mediump_dvec3; + + /// 3 components vector aligned in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef vec<3, double, aligned_lowp> aligned_lowp_dvec3; + + /// 3 components vector aligned in memory of signed integer numbers. + typedef vec<3, int, aligned_highp> aligned_highp_ivec3; + + /// 3 components vector aligned in memory of signed integer numbers. + typedef vec<3, int, aligned_mediump> aligned_mediump_ivec3; + + /// 3 components vector aligned in memory of signed integer numbers. + typedef vec<3, int, aligned_lowp> aligned_lowp_ivec3; + + /// 3 components vector aligned in memory of unsigned integer numbers. + typedef vec<3, uint, aligned_highp> aligned_highp_uvec3; + + /// 3 components vector aligned in memory of unsigned integer numbers. + typedef vec<3, uint, aligned_mediump> aligned_mediump_uvec3; + + /// 3 components vector aligned in memory of unsigned integer numbers. + typedef vec<3, uint, aligned_lowp> aligned_lowp_uvec3; + + /// 3 components vector aligned in memory of bool values. + typedef vec<3, bool, aligned_highp> aligned_highp_bvec3; + + /// 3 components vector aligned in memory of bool values. + typedef vec<3, bool, aligned_mediump> aligned_mediump_bvec3; + + /// 3 components vector aligned in memory of bool values. + typedef vec<3, bool, aligned_lowp> aligned_lowp_bvec3; + + /// 3 components vector tightly packed in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef vec<3, float, packed_highp> packed_highp_vec3; + + /// 3 components vector tightly packed in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef vec<3, float, packed_mediump> packed_mediump_vec3; + + /// 3 components vector tightly packed in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef vec<3, float, packed_lowp> packed_lowp_vec3; + + /// 3 components vector tightly packed in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef vec<3, double, packed_highp> packed_highp_dvec3; + + /// 3 components vector tightly packed in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef vec<3, double, packed_mediump> packed_mediump_dvec3; + + /// 3 components vector tightly packed in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef vec<3, double, packed_lowp> packed_lowp_dvec3; + + /// 3 components vector tightly packed in memory of signed integer numbers. + typedef vec<3, int, packed_highp> packed_highp_ivec3; + + /// 3 components vector tightly packed in memory of signed integer numbers. + typedef vec<3, int, packed_mediump> packed_mediump_ivec3; + + /// 3 components vector tightly packed in memory of signed integer numbers. + typedef vec<3, int, packed_lowp> packed_lowp_ivec3; + + /// 3 components vector tightly packed in memory of unsigned integer numbers. + typedef vec<3, uint, packed_highp> packed_highp_uvec3; + + /// 3 components vector tightly packed in memory of unsigned integer numbers. + typedef vec<3, uint, packed_mediump> packed_mediump_uvec3; + + /// 3 components vector tightly packed in memory of unsigned integer numbers. + typedef vec<3, uint, packed_lowp> packed_lowp_uvec3; + + /// 3 components vector tightly packed in memory of bool values. + typedef vec<3, bool, packed_highp> packed_highp_bvec3; + + /// 3 components vector tightly packed in memory of bool values. + typedef vec<3, bool, packed_mediump> packed_mediump_bvec3; + + /// 3 components vector tightly packed in memory of bool values. + typedef vec<3, bool, packed_lowp> packed_lowp_bvec3; + + // -- *vec4 -- + + /// 4 components vector aligned in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef vec<4, float, aligned_highp> aligned_highp_vec4; + + /// 4 components vector aligned in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef vec<4, float, aligned_mediump> aligned_mediump_vec4; + + /// 4 components vector aligned in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef vec<4, float, aligned_lowp> aligned_lowp_vec4; + + /// 4 components vector aligned in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef vec<4, double, aligned_highp> aligned_highp_dvec4; + + /// 4 components vector aligned in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef vec<4, double, aligned_mediump> aligned_mediump_dvec4; + + /// 4 components vector aligned in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef vec<4, double, aligned_lowp> aligned_lowp_dvec4; + + /// 4 components vector aligned in memory of signed integer numbers. + typedef vec<4, int, aligned_highp> aligned_highp_ivec4; + + /// 4 components vector aligned in memory of signed integer numbers. + typedef vec<4, int, aligned_mediump> aligned_mediump_ivec4; + + /// 4 components vector aligned in memory of signed integer numbers. + typedef vec<4, int, aligned_lowp> aligned_lowp_ivec4; + + /// 4 components vector aligned in memory of unsigned integer numbers. + typedef vec<4, uint, aligned_highp> aligned_highp_uvec4; + + /// 4 components vector aligned in memory of unsigned integer numbers. + typedef vec<4, uint, aligned_mediump> aligned_mediump_uvec4; + + /// 4 components vector aligned in memory of unsigned integer numbers. + typedef vec<4, uint, aligned_lowp> aligned_lowp_uvec4; + + /// 4 components vector aligned in memory of bool values. + typedef vec<4, bool, aligned_highp> aligned_highp_bvec4; + + /// 4 components vector aligned in memory of bool values. + typedef vec<4, bool, aligned_mediump> aligned_mediump_bvec4; + + /// 4 components vector aligned in memory of bool values. + typedef vec<4, bool, aligned_lowp> aligned_lowp_bvec4; + + /// 4 components vector tightly packed in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef vec<4, float, packed_highp> packed_highp_vec4; + + /// 4 components vector tightly packed in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef vec<4, float, packed_mediump> packed_mediump_vec4; + + /// 4 components vector tightly packed in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef vec<4, float, packed_lowp> packed_lowp_vec4; + + /// 4 components vector tightly packed in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef vec<4, double, packed_highp> packed_highp_dvec4; + + /// 4 components vector tightly packed in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef vec<4, double, packed_mediump> packed_mediump_dvec4; + + /// 4 components vector tightly packed in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef vec<4, double, packed_lowp> packed_lowp_dvec4; + + /// 4 components vector tightly packed in memory of signed integer numbers. + typedef vec<4, int, packed_highp> packed_highp_ivec4; + + /// 4 components vector tightly packed in memory of signed integer numbers. + typedef vec<4, int, packed_mediump> packed_mediump_ivec4; + + /// 4 components vector tightly packed in memory of signed integer numbers. + typedef vec<4, int, packed_lowp> packed_lowp_ivec4; + + /// 4 components vector tightly packed in memory of unsigned integer numbers. + typedef vec<4, uint, packed_highp> packed_highp_uvec4; + + /// 4 components vector tightly packed in memory of unsigned integer numbers. + typedef vec<4, uint, packed_mediump> packed_mediump_uvec4; + + /// 4 components vector tightly packed in memory of unsigned integer numbers. + typedef vec<4, uint, packed_lowp> packed_lowp_uvec4; + + /// 4 components vector tightly packed in memory of bool values. + typedef vec<4, bool, packed_highp> packed_highp_bvec4; + + /// 4 components vector tightly packed in memory of bool values. + typedef vec<4, bool, packed_mediump> packed_mediump_bvec4; + + /// 4 components vector tightly packed in memory of bool values. + typedef vec<4, bool, packed_lowp> packed_lowp_bvec4; + + // -- *mat2 -- + + /// 2 by 2 matrix aligned in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<2, 2, float, aligned_highp> aligned_highp_mat2; + + /// 2 by 2 matrix aligned in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<2, 2, float, aligned_mediump> aligned_mediump_mat2; + + /// 2 by 2 matrix aligned in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<2, 2, float, aligned_lowp> aligned_lowp_mat2; + + /// 2 by 2 matrix aligned in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<2, 2, double, aligned_highp> aligned_highp_dmat2; + + /// 2 by 2 matrix aligned in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<2, 2, double, aligned_mediump> aligned_mediump_dmat2; + + /// 2 by 2 matrix aligned in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<2, 2, double, aligned_lowp> aligned_lowp_dmat2; + + /// 2 by 2 matrix tightly packed in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<2, 2, float, packed_highp> packed_highp_mat2; + + /// 2 by 2 matrix tightly packed in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<2, 2, float, packed_mediump> packed_mediump_mat2; + + /// 2 by 2 matrix tightly packed in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<2, 2, float, packed_lowp> packed_lowp_mat2; + + /// 2 by 2 matrix tightly packed in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<2, 2, double, packed_highp> packed_highp_dmat2; + + /// 2 by 2 matrix tightly packed in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<2, 2, double, packed_mediump> packed_mediump_dmat2; + + /// 2 by 2 matrix tightly packed in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<2, 2, double, packed_lowp> packed_lowp_dmat2; + + // -- *mat3 -- + + /// 3 by 3 matrix aligned in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<3, 3, float, aligned_highp> aligned_highp_mat3; + + /// 3 by 3 matrix aligned in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<3, 3, float, aligned_mediump> aligned_mediump_mat3; + + /// 3 by 3 matrix aligned in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<3, 3, float, aligned_lowp> aligned_lowp_mat3; + + /// 3 by 3 matrix aligned in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<3, 3, double, aligned_highp> aligned_highp_dmat3; + + /// 3 by 3 matrix aligned in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<3, 3, double, aligned_mediump> aligned_mediump_dmat3; + + /// 3 by 3 matrix aligned in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<3, 3, double, aligned_lowp> aligned_lowp_dmat3; + + /// 3 by 3 matrix tightly packed in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<3, 3, float, packed_highp> packed_highp_mat3; + + /// 3 by 3 matrix tightly packed in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<3, 3, float, packed_mediump> packed_mediump_mat3; + + /// 3 by 3 matrix tightly packed in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<3, 3, float, packed_lowp> packed_lowp_mat3; + + /// 3 by 3 matrix tightly packed in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<3, 3, double, packed_highp> packed_highp_dmat3; + + /// 3 by 3 matrix tightly packed in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<3, 3, double, packed_mediump> packed_mediump_dmat3; + + /// 3 by 3 matrix tightly packed in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<3, 3, double, packed_lowp> packed_lowp_dmat3; + + // -- *mat4 -- + + /// 4 by 4 matrix aligned in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<4, 4, float, aligned_highp> aligned_highp_mat4; + + /// 4 by 4 matrix aligned in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<4, 4, float, aligned_mediump> aligned_mediump_mat4; + + /// 4 by 4 matrix aligned in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<4, 4, float, aligned_lowp> aligned_lowp_mat4; + + /// 4 by 4 matrix aligned in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<4, 4, double, aligned_highp> aligned_highp_dmat4; + + /// 4 by 4 matrix aligned in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<4, 4, double, aligned_mediump> aligned_mediump_dmat4; + + /// 4 by 4 matrix aligned in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<4, 4, double, aligned_lowp> aligned_lowp_dmat4; + + /// 4 by 4 matrix tightly packed in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<4, 4, float, packed_highp> packed_highp_mat4; + + /// 4 by 4 matrix tightly packed in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<4, 4, float, packed_mediump> packed_mediump_mat4; + + /// 4 by 4 matrix tightly packed in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<4, 4, float, packed_lowp> packed_lowp_mat4; + + /// 4 by 4 matrix tightly packed in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<4, 4, double, packed_highp> packed_highp_dmat4; + + /// 4 by 4 matrix tightly packed in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<4, 4, double, packed_mediump> packed_mediump_dmat4; + + /// 4 by 4 matrix tightly packed in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<4, 4, double, packed_lowp> packed_lowp_dmat4; + + // -- *mat2x2 -- + + /// 2 by 2 matrix aligned in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<2, 2, float, aligned_highp> aligned_highp_mat2x2; + + /// 2 by 2 matrix aligned in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<2, 2, float, aligned_mediump> aligned_mediump_mat2x2; + + /// 2 by 2 matrix aligned in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<2, 2, float, aligned_lowp> aligned_lowp_mat2x2; + + /// 2 by 2 matrix aligned in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<2, 2, double, aligned_highp> aligned_highp_dmat2x2; + + /// 2 by 2 matrix aligned in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<2, 2, double, aligned_mediump> aligned_mediump_dmat2x2; + + /// 2 by 2 matrix aligned in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<2, 2, double, aligned_lowp> aligned_lowp_dmat2x2; + + /// 2 by 2 matrix tightly packed in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<2, 2, float, packed_highp> packed_highp_mat2x2; + + /// 2 by 2 matrix tightly packed in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<2, 2, float, packed_mediump> packed_mediump_mat2x2; + + /// 2 by 2 matrix tightly packed in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<2, 2, float, packed_lowp> packed_lowp_mat2x2; + + /// 2 by 2 matrix tightly packed in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<2, 2, double, packed_highp> packed_highp_dmat2x2; + + /// 2 by 2 matrix tightly packed in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<2, 2, double, packed_mediump> packed_mediump_dmat2x2; + + /// 2 by 2 matrix tightly packed in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<2, 2, double, packed_lowp> packed_lowp_dmat2x2; + + // -- *mat2x3 -- + + /// 2 by 3 matrix aligned in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<2, 3, float, aligned_highp> aligned_highp_mat2x3; + + /// 2 by 3 matrix aligned in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<2, 3, float, aligned_mediump> aligned_mediump_mat2x3; + + /// 2 by 3 matrix aligned in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<2, 3, float, aligned_lowp> aligned_lowp_mat2x3; + + /// 2 by 3 matrix aligned in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<2, 3, double, aligned_highp> aligned_highp_dmat2x3; + + /// 2 by 3 matrix aligned in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<2, 3, double, aligned_mediump> aligned_mediump_dmat2x3; + + /// 2 by 3 matrix aligned in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<2, 3, double, aligned_lowp> aligned_lowp_dmat2x3; + + /// 2 by 3 matrix tightly packed in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<2, 3, float, packed_highp> packed_highp_mat2x3; + + /// 2 by 3 matrix tightly packed in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<2, 3, float, packed_mediump> packed_mediump_mat2x3; + + /// 2 by 3 matrix tightly packed in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<2, 3, float, packed_lowp> packed_lowp_mat2x3; + + /// 2 by 3 matrix tightly packed in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<2, 3, double, packed_highp> packed_highp_dmat2x3; + + /// 2 by 3 matrix tightly packed in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<2, 3, double, packed_mediump> packed_mediump_dmat2x3; + + /// 2 by 3 matrix tightly packed in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<2, 3, double, packed_lowp> packed_lowp_dmat2x3; + + // -- *mat2x4 -- + + /// 2 by 4 matrix aligned in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<2, 4, float, aligned_highp> aligned_highp_mat2x4; + + /// 2 by 4 matrix aligned in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<2, 4, float, aligned_mediump> aligned_mediump_mat2x4; + + /// 2 by 4 matrix aligned in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<2, 4, float, aligned_lowp> aligned_lowp_mat2x4; + + /// 2 by 4 matrix aligned in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<2, 4, double, aligned_highp> aligned_highp_dmat2x4; + + /// 2 by 4 matrix aligned in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<2, 4, double, aligned_mediump> aligned_mediump_dmat2x4; + + /// 2 by 4 matrix aligned in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<2, 4, double, aligned_lowp> aligned_lowp_dmat2x4; + + /// 2 by 4 matrix tightly packed in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<2, 4, float, packed_highp> packed_highp_mat2x4; + + /// 2 by 4 matrix tightly packed in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<2, 4, float, packed_mediump> packed_mediump_mat2x4; + + /// 2 by 4 matrix tightly packed in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<2, 4, float, packed_lowp> packed_lowp_mat2x4; + + /// 2 by 4 matrix tightly packed in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<2, 4, double, packed_highp> packed_highp_dmat2x4; + + /// 2 by 4 matrix tightly packed in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<2, 4, double, packed_mediump> packed_mediump_dmat2x4; + + /// 2 by 4 matrix tightly packed in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<2, 4, double, packed_lowp> packed_lowp_dmat2x4; + + // -- *mat3x2 -- + + /// 3 by 2 matrix aligned in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<3, 2, float, aligned_highp> aligned_highp_mat3x2; + + /// 3 by 2 matrix aligned in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<3, 2, float, aligned_mediump> aligned_mediump_mat3x2; + + /// 3 by 2 matrix aligned in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<3, 2, float, aligned_lowp> aligned_lowp_mat3x2; + + /// 3 by 2 matrix aligned in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<3, 2, double, aligned_highp> aligned_highp_dmat3x2; + + /// 3 by 2 matrix aligned in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<3, 2, double, aligned_mediump> aligned_mediump_dmat3x2; + + /// 3 by 2 matrix aligned in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<3, 2, double, aligned_lowp> aligned_lowp_dmat3x2; + + /// 3 by 2 matrix tightly packed in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<3, 2, float, packed_highp> packed_highp_mat3x2; + + /// 3 by 2 matrix tightly packed in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<3, 2, float, packed_mediump> packed_mediump_mat3x2; + + /// 3 by 2 matrix tightly packed in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<3, 2, float, packed_lowp> packed_lowp_mat3x2; + + /// 3 by 2 matrix tightly packed in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<3, 2, double, packed_highp> packed_highp_dmat3x2; + + /// 3 by 2 matrix tightly packed in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<3, 2, double, packed_mediump> packed_mediump_dmat3x2; + + /// 3 by 2 matrix tightly packed in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<3, 2, double, packed_lowp> packed_lowp_dmat3x2; + + // -- *mat3x3 -- + + /// 3 by 3 matrix aligned in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<3, 3, float, aligned_highp> aligned_highp_mat3x3; + + /// 3 by 3 matrix aligned in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<3, 3, float, aligned_mediump> aligned_mediump_mat3x3; + + /// 3 by 3 matrix aligned in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<3, 3, float, aligned_lowp> aligned_lowp_mat3x3; + + /// 3 by 3 matrix aligned in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<3, 3, double, aligned_highp> aligned_highp_dmat3x3; + + /// 3 by 3 matrix aligned in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<3, 3, double, aligned_mediump> aligned_mediump_dmat3x3; + + /// 3 by 3 matrix aligned in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<3, 3, double, aligned_lowp> aligned_lowp_dmat3x3; + + /// 3 by 3 matrix tightly packed in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<3, 3, float, packed_highp> packed_highp_mat3x3; + + /// 3 by 3 matrix tightly packed in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<3, 3, float, packed_mediump> packed_mediump_mat3x3; + + /// 3 by 3 matrix tightly packed in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<3, 3, float, packed_lowp> packed_lowp_mat3x3; + + /// 3 by 3 matrix tightly packed in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<3, 3, double, packed_highp> packed_highp_dmat3x3; + + /// 3 by 3 matrix tightly packed in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<3, 3, double, packed_mediump> packed_mediump_dmat3x3; + + /// 3 by 3 matrix tightly packed in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<3, 3, double, packed_lowp> packed_lowp_dmat3x3; + + // -- *mat3x4 -- + + /// 3 by 4 matrix aligned in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<3, 4, float, aligned_highp> aligned_highp_mat3x4; + + /// 3 by 4 matrix aligned in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<3, 4, float, aligned_mediump> aligned_mediump_mat3x4; + + /// 3 by 4 matrix aligned in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<3, 4, float, aligned_lowp> aligned_lowp_mat3x4; + + /// 3 by 4 matrix aligned in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<3, 4, double, aligned_highp> aligned_highp_dmat3x4; + + /// 3 by 4 matrix aligned in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<3, 4, double, aligned_mediump> aligned_mediump_dmat3x4; + + /// 3 by 4 matrix aligned in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<3, 4, double, aligned_lowp> aligned_lowp_dmat3x4; + + /// 3 by 4 matrix tightly packed in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<3, 4, float, packed_highp> packed_highp_mat3x4; + + /// 3 by 4 matrix tightly packed in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<3, 4, float, packed_mediump> packed_mediump_mat3x4; + + /// 3 by 4 matrix tightly packed in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<3, 4, float, packed_lowp> packed_lowp_mat3x4; + + /// 3 by 4 matrix tightly packed in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<3, 4, double, packed_highp> packed_highp_dmat3x4; + + /// 3 by 4 matrix tightly packed in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<3, 4, double, packed_mediump> packed_mediump_dmat3x4; + + /// 3 by 4 matrix tightly packed in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<3, 4, double, packed_lowp> packed_lowp_dmat3x4; + + // -- *mat4x2 -- + + /// 4 by 2 matrix aligned in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<4, 2, float, aligned_highp> aligned_highp_mat4x2; + + /// 4 by 2 matrix aligned in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<4, 2, float, aligned_mediump> aligned_mediump_mat4x2; + + /// 4 by 2 matrix aligned in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<4, 2, float, aligned_lowp> aligned_lowp_mat4x2; + + /// 4 by 2 matrix aligned in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<4, 2, double, aligned_highp> aligned_highp_dmat4x2; + + /// 4 by 2 matrix aligned in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<4, 2, double, aligned_mediump> aligned_mediump_dmat4x2; + + /// 4 by 2 matrix aligned in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<4, 2, double, aligned_lowp> aligned_lowp_dmat4x2; + + /// 4 by 2 matrix tightly packed in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<4, 2, float, packed_highp> packed_highp_mat4x2; + + /// 4 by 2 matrix tightly packed in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<4, 2, float, packed_mediump> packed_mediump_mat4x2; + + /// 4 by 2 matrix tightly packed in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<4, 2, float, packed_lowp> packed_lowp_mat4x2; + + /// 4 by 2 matrix tightly packed in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<4, 2, double, packed_highp> packed_highp_dmat4x2; + + /// 4 by 2 matrix tightly packed in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<4, 2, double, packed_mediump> packed_mediump_dmat4x2; + + /// 4 by 2 matrix tightly packed in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<4, 2, double, packed_lowp> packed_lowp_dmat4x2; + + // -- *mat4x3 -- + + /// 4 by 3 matrix aligned in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<4, 3, float, aligned_highp> aligned_highp_mat4x3; + + /// 4 by 3 matrix aligned in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<4, 3, float, aligned_mediump> aligned_mediump_mat4x3; + + /// 4 by 3 matrix aligned in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<4, 3, float, aligned_lowp> aligned_lowp_mat4x3; + + /// 4 by 3 matrix aligned in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<4, 3, double, aligned_highp> aligned_highp_dmat4x3; + + /// 4 by 3 matrix aligned in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<4, 3, double, aligned_mediump> aligned_mediump_dmat4x3; + + /// 4 by 3 matrix aligned in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<4, 3, double, aligned_lowp> aligned_lowp_dmat4x3; + + /// 4 by 3 matrix tightly packed in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<4, 3, float, packed_highp> packed_highp_mat4x3; + + /// 4 by 3 matrix tightly packed in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<4, 3, float, packed_mediump> packed_mediump_mat4x3; + + /// 4 by 3 matrix tightly packed in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<4, 3, float, packed_lowp> packed_lowp_mat4x3; + + /// 4 by 3 matrix tightly packed in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<4, 3, double, packed_highp> packed_highp_dmat4x3; + + /// 4 by 3 matrix tightly packed in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<4, 3, double, packed_mediump> packed_mediump_dmat4x3; + + /// 4 by 3 matrix tightly packed in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<4, 3, double, packed_lowp> packed_lowp_dmat4x3; + + // -- *mat4x4 -- + + /// 4 by 4 matrix aligned in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<4, 4, float, aligned_highp> aligned_highp_mat4x4; + + /// 4 by 4 matrix aligned in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<4, 4, float, aligned_mediump> aligned_mediump_mat4x4; + + /// 4 by 4 matrix aligned in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<4, 4, float, aligned_lowp> aligned_lowp_mat4x4; + + /// 4 by 4 matrix aligned in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<4, 4, double, aligned_highp> aligned_highp_dmat4x4; + + /// 4 by 4 matrix aligned in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<4, 4, double, aligned_mediump> aligned_mediump_dmat4x4; + + /// 4 by 4 matrix aligned in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<4, 4, double, aligned_lowp> aligned_lowp_dmat4x4; + + /// 4 by 4 matrix tightly packed in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<4, 4, float, packed_highp> packed_highp_mat4x4; + + /// 4 by 4 matrix tightly packed in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<4, 4, float, packed_mediump> packed_mediump_mat4x4; + + /// 4 by 4 matrix tightly packed in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<4, 4, float, packed_lowp> packed_lowp_mat4x4; + + /// 4 by 4 matrix tightly packed in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. + typedef mat<4, 4, double, packed_highp> packed_highp_dmat4x4; + + /// 4 by 4 matrix tightly packed in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. + typedef mat<4, 4, double, packed_mediump> packed_mediump_dmat4x4; + + /// 4 by 4 matrix tightly packed in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. + typedef mat<4, 4, double, packed_lowp> packed_lowp_dmat4x4; + + // -- default -- + +#if(defined(GLM_PRECISION_LOWP_FLOAT)) + typedef aligned_lowp_vec1 aligned_vec1; + typedef aligned_lowp_vec2 aligned_vec2; + typedef aligned_lowp_vec3 aligned_vec3; + typedef aligned_lowp_vec4 aligned_vec4; + typedef packed_lowp_vec1 packed_vec1; + typedef packed_lowp_vec2 packed_vec2; + typedef packed_lowp_vec3 packed_vec3; + typedef packed_lowp_vec4 packed_vec4; + + typedef aligned_lowp_mat2 aligned_mat2; + typedef aligned_lowp_mat3 aligned_mat3; + typedef aligned_lowp_mat4 aligned_mat4; + typedef packed_lowp_mat2 packed_mat2; + typedef packed_lowp_mat3 packed_mat3; + typedef packed_lowp_mat4 packed_mat4; + + typedef aligned_lowp_mat2x2 aligned_mat2x2; + typedef aligned_lowp_mat2x3 aligned_mat2x3; + typedef aligned_lowp_mat2x4 aligned_mat2x4; + typedef aligned_lowp_mat3x2 aligned_mat3x2; + typedef aligned_lowp_mat3x3 aligned_mat3x3; + typedef aligned_lowp_mat3x4 aligned_mat3x4; + typedef aligned_lowp_mat4x2 aligned_mat4x2; + typedef aligned_lowp_mat4x3 aligned_mat4x3; + typedef aligned_lowp_mat4x4 aligned_mat4x4; + typedef packed_lowp_mat2x2 packed_mat2x2; + typedef packed_lowp_mat2x3 packed_mat2x3; + typedef packed_lowp_mat2x4 packed_mat2x4; + typedef packed_lowp_mat3x2 packed_mat3x2; + typedef packed_lowp_mat3x3 packed_mat3x3; + typedef packed_lowp_mat3x4 packed_mat3x4; + typedef packed_lowp_mat4x2 packed_mat4x2; + typedef packed_lowp_mat4x3 packed_mat4x3; + typedef packed_lowp_mat4x4 packed_mat4x4; +#elif(defined(GLM_PRECISION_MEDIUMP_FLOAT)) + typedef aligned_mediump_vec1 aligned_vec1; + typedef aligned_mediump_vec2 aligned_vec2; + typedef aligned_mediump_vec3 aligned_vec3; + typedef aligned_mediump_vec4 aligned_vec4; + typedef packed_mediump_vec1 packed_vec1; + typedef packed_mediump_vec2 packed_vec2; + typedef packed_mediump_vec3 packed_vec3; + typedef packed_mediump_vec4 packed_vec4; + + typedef aligned_mediump_mat2 aligned_mat2; + typedef aligned_mediump_mat3 aligned_mat3; + typedef aligned_mediump_mat4 aligned_mat4; + typedef packed_mediump_mat2 packed_mat2; + typedef packed_mediump_mat3 packed_mat3; + typedef packed_mediump_mat4 packed_mat4; + + typedef aligned_mediump_mat2x2 aligned_mat2x2; + typedef aligned_mediump_mat2x3 aligned_mat2x3; + typedef aligned_mediump_mat2x4 aligned_mat2x4; + typedef aligned_mediump_mat3x2 aligned_mat3x2; + typedef aligned_mediump_mat3x3 aligned_mat3x3; + typedef aligned_mediump_mat3x4 aligned_mat3x4; + typedef aligned_mediump_mat4x2 aligned_mat4x2; + typedef aligned_mediump_mat4x3 aligned_mat4x3; + typedef aligned_mediump_mat4x4 aligned_mat4x4; + typedef packed_mediump_mat2x2 packed_mat2x2; + typedef packed_mediump_mat2x3 packed_mat2x3; + typedef packed_mediump_mat2x4 packed_mat2x4; + typedef packed_mediump_mat3x2 packed_mat3x2; + typedef packed_mediump_mat3x3 packed_mat3x3; + typedef packed_mediump_mat3x4 packed_mat3x4; + typedef packed_mediump_mat4x2 packed_mat4x2; + typedef packed_mediump_mat4x3 packed_mat4x3; + typedef packed_mediump_mat4x4 packed_mat4x4; +#else //defined(GLM_PRECISION_HIGHP_FLOAT) + /// 1 component vector aligned in memory of single-precision floating-point numbers. + typedef aligned_highp_vec1 aligned_vec1; + + /// 2 components vector aligned in memory of single-precision floating-point numbers. + typedef aligned_highp_vec2 aligned_vec2; + + /// 3 components vector aligned in memory of single-precision floating-point numbers. + typedef aligned_highp_vec3 aligned_vec3; + + /// 4 components vector aligned in memory of single-precision floating-point numbers. + typedef aligned_highp_vec4 aligned_vec4; + + /// 1 component vector tightly packed in memory of single-precision floating-point numbers. + typedef packed_highp_vec1 packed_vec1; + + /// 2 components vector tightly packed in memory of single-precision floating-point numbers. + typedef packed_highp_vec2 packed_vec2; + + /// 3 components vector tightly packed in memory of single-precision floating-point numbers. + typedef packed_highp_vec3 packed_vec3; + + /// 4 components vector tightly packed in memory of single-precision floating-point numbers. + typedef packed_highp_vec4 packed_vec4; + + /// 2 by 2 matrix tightly aligned in memory of single-precision floating-point numbers. + typedef aligned_highp_mat2 aligned_mat2; + + /// 3 by 3 matrix tightly aligned in memory of single-precision floating-point numbers. + typedef aligned_highp_mat3 aligned_mat3; + + /// 4 by 4 matrix tightly aligned in memory of single-precision floating-point numbers. + typedef aligned_highp_mat4 aligned_mat4; + + /// 2 by 2 matrix tightly packed in memory of single-precision floating-point numbers. + typedef packed_highp_mat2 packed_mat2; + + /// 3 by 3 matrix tightly packed in memory of single-precision floating-point numbers. + typedef packed_highp_mat3 packed_mat3; + + /// 4 by 4 matrix tightly packed in memory of single-precision floating-point numbers. + typedef packed_highp_mat4 packed_mat4; + + /// 2 by 2 matrix tightly aligned in memory of single-precision floating-point numbers. + typedef aligned_highp_mat2x2 aligned_mat2x2; + + /// 2 by 3 matrix tightly aligned in memory of single-precision floating-point numbers. + typedef aligned_highp_mat2x3 aligned_mat2x3; + + /// 2 by 4 matrix tightly aligned in memory of single-precision floating-point numbers. + typedef aligned_highp_mat2x4 aligned_mat2x4; + + /// 3 by 2 matrix tightly aligned in memory of single-precision floating-point numbers. + typedef aligned_highp_mat3x2 aligned_mat3x2; + + /// 3 by 3 matrix tightly aligned in memory of single-precision floating-point numbers. + typedef aligned_highp_mat3x3 aligned_mat3x3; + + /// 3 by 4 matrix tightly aligned in memory of single-precision floating-point numbers. + typedef aligned_highp_mat3x4 aligned_mat3x4; + + /// 4 by 2 matrix tightly aligned in memory of single-precision floating-point numbers. + typedef aligned_highp_mat4x2 aligned_mat4x2; + + /// 4 by 3 matrix tightly aligned in memory of single-precision floating-point numbers. + typedef aligned_highp_mat4x3 aligned_mat4x3; + + /// 4 by 4 matrix tightly aligned in memory of single-precision floating-point numbers. + typedef aligned_highp_mat4x4 aligned_mat4x4; + + /// 2 by 2 matrix tightly packed in memory of single-precision floating-point numbers. + typedef packed_highp_mat2x2 packed_mat2x2; + + /// 2 by 3 matrix tightly packed in memory of single-precision floating-point numbers. + typedef packed_highp_mat2x3 packed_mat2x3; + + /// 2 by 4 matrix tightly packed in memory of single-precision floating-point numbers. + typedef packed_highp_mat2x4 packed_mat2x4; + + /// 3 by 2 matrix tightly packed in memory of single-precision floating-point numbers. + typedef packed_highp_mat3x2 packed_mat3x2; + + /// 3 by 3 matrix tightly packed in memory of single-precision floating-point numbers. + typedef packed_highp_mat3x3 packed_mat3x3; + + /// 3 by 4 matrix tightly packed in memory of single-precision floating-point numbers. + typedef packed_highp_mat3x4 packed_mat3x4; + + /// 4 by 2 matrix tightly packed in memory of single-precision floating-point numbers. + typedef packed_highp_mat4x2 packed_mat4x2; + + /// 4 by 3 matrix tightly packed in memory of single-precision floating-point numbers. + typedef packed_highp_mat4x3 packed_mat4x3; + + /// 4 by 4 matrix tightly packed in memory of single-precision floating-point numbers. + typedef packed_highp_mat4x4 packed_mat4x4; +#endif//GLM_PRECISION + +#if(defined(GLM_PRECISION_LOWP_DOUBLE)) + typedef aligned_lowp_dvec1 aligned_dvec1; + typedef aligned_lowp_dvec2 aligned_dvec2; + typedef aligned_lowp_dvec3 aligned_dvec3; + typedef aligned_lowp_dvec4 aligned_dvec4; + typedef packed_lowp_dvec1 packed_dvec1; + typedef packed_lowp_dvec2 packed_dvec2; + typedef packed_lowp_dvec3 packed_dvec3; + typedef packed_lowp_dvec4 packed_dvec4; + + typedef aligned_lowp_dmat2 aligned_dmat2; + typedef aligned_lowp_dmat3 aligned_dmat3; + typedef aligned_lowp_dmat4 aligned_dmat4; + typedef packed_lowp_dmat2 packed_dmat2; + typedef packed_lowp_dmat3 packed_dmat3; + typedef packed_lowp_dmat4 packed_dmat4; + + typedef aligned_lowp_dmat2x2 aligned_dmat2x2; + typedef aligned_lowp_dmat2x3 aligned_dmat2x3; + typedef aligned_lowp_dmat2x4 aligned_dmat2x4; + typedef aligned_lowp_dmat3x2 aligned_dmat3x2; + typedef aligned_lowp_dmat3x3 aligned_dmat3x3; + typedef aligned_lowp_dmat3x4 aligned_dmat3x4; + typedef aligned_lowp_dmat4x2 aligned_dmat4x2; + typedef aligned_lowp_dmat4x3 aligned_dmat4x3; + typedef aligned_lowp_dmat4x4 aligned_dmat4x4; + typedef packed_lowp_dmat2x2 packed_dmat2x2; + typedef packed_lowp_dmat2x3 packed_dmat2x3; + typedef packed_lowp_dmat2x4 packed_dmat2x4; + typedef packed_lowp_dmat3x2 packed_dmat3x2; + typedef packed_lowp_dmat3x3 packed_dmat3x3; + typedef packed_lowp_dmat3x4 packed_dmat3x4; + typedef packed_lowp_dmat4x2 packed_dmat4x2; + typedef packed_lowp_dmat4x3 packed_dmat4x3; + typedef packed_lowp_dmat4x4 packed_dmat4x4; +#elif(defined(GLM_PRECISION_MEDIUMP_DOUBLE)) + typedef aligned_mediump_dvec1 aligned_dvec1; + typedef aligned_mediump_dvec2 aligned_dvec2; + typedef aligned_mediump_dvec3 aligned_dvec3; + typedef aligned_mediump_dvec4 aligned_dvec4; + typedef packed_mediump_dvec1 packed_dvec1; + typedef packed_mediump_dvec2 packed_dvec2; + typedef packed_mediump_dvec3 packed_dvec3; + typedef packed_mediump_dvec4 packed_dvec4; + + typedef aligned_mediump_dmat2 aligned_dmat2; + typedef aligned_mediump_dmat3 aligned_dmat3; + typedef aligned_mediump_dmat4 aligned_dmat4; + typedef packed_mediump_dmat2 packed_dmat2; + typedef packed_mediump_dmat3 packed_dmat3; + typedef packed_mediump_dmat4 packed_dmat4; + + typedef aligned_mediump_dmat2x2 aligned_dmat2x2; + typedef aligned_mediump_dmat2x3 aligned_dmat2x3; + typedef aligned_mediump_dmat2x4 aligned_dmat2x4; + typedef aligned_mediump_dmat3x2 aligned_dmat3x2; + typedef aligned_mediump_dmat3x3 aligned_dmat3x3; + typedef aligned_mediump_dmat3x4 aligned_dmat3x4; + typedef aligned_mediump_dmat4x2 aligned_dmat4x2; + typedef aligned_mediump_dmat4x3 aligned_dmat4x3; + typedef aligned_mediump_dmat4x4 aligned_dmat4x4; + typedef packed_mediump_dmat2x2 packed_dmat2x2; + typedef packed_mediump_dmat2x3 packed_dmat2x3; + typedef packed_mediump_dmat2x4 packed_dmat2x4; + typedef packed_mediump_dmat3x2 packed_dmat3x2; + typedef packed_mediump_dmat3x3 packed_dmat3x3; + typedef packed_mediump_dmat3x4 packed_dmat3x4; + typedef packed_mediump_dmat4x2 packed_dmat4x2; + typedef packed_mediump_dmat4x3 packed_dmat4x3; + typedef packed_mediump_dmat4x4 packed_dmat4x4; +#else //defined(GLM_PRECISION_HIGHP_DOUBLE) + /// 1 component vector aligned in memory of double-precision floating-point numbers. + typedef aligned_highp_dvec1 aligned_dvec1; + + /// 2 components vector aligned in memory of double-precision floating-point numbers. + typedef aligned_highp_dvec2 aligned_dvec2; + + /// 3 components vector aligned in memory of double-precision floating-point numbers. + typedef aligned_highp_dvec3 aligned_dvec3; + + /// 4 components vector aligned in memory of double-precision floating-point numbers. + typedef aligned_highp_dvec4 aligned_dvec4; + + /// 1 component vector tightly packed in memory of double-precision floating-point numbers. + typedef packed_highp_dvec1 packed_dvec1; + + /// 2 components vector tightly packed in memory of double-precision floating-point numbers. + typedef packed_highp_dvec2 packed_dvec2; + + /// 3 components vector tightly packed in memory of double-precision floating-point numbers. + typedef packed_highp_dvec3 packed_dvec3; + + /// 4 components vector tightly packed in memory of double-precision floating-point numbers. + typedef packed_highp_dvec4 packed_dvec4; + + /// 2 by 2 matrix tightly aligned in memory of double-precision floating-point numbers. + typedef aligned_highp_dmat2 aligned_dmat2; + + /// 3 by 3 matrix tightly aligned in memory of double-precision floating-point numbers. + typedef aligned_highp_dmat3 aligned_dmat3; + + /// 4 by 4 matrix tightly aligned in memory of double-precision floating-point numbers. + typedef aligned_highp_dmat4 aligned_dmat4; + + /// 2 by 2 matrix tightly packed in memory of double-precision floating-point numbers. + typedef packed_highp_dmat2 packed_dmat2; + + /// 3 by 3 matrix tightly packed in memory of double-precision floating-point numbers. + typedef packed_highp_dmat3 packed_dmat3; + + /// 4 by 4 matrix tightly packed in memory of double-precision floating-point numbers. + typedef packed_highp_dmat4 packed_dmat4; + + /// 2 by 2 matrix tightly aligned in memory of double-precision floating-point numbers. + typedef aligned_highp_dmat2x2 aligned_dmat2x2; + + /// 2 by 3 matrix tightly aligned in memory of double-precision floating-point numbers. + typedef aligned_highp_dmat2x3 aligned_dmat2x3; + + /// 2 by 4 matrix tightly aligned in memory of double-precision floating-point numbers. + typedef aligned_highp_dmat2x4 aligned_dmat2x4; + + /// 3 by 2 matrix tightly aligned in memory of double-precision floating-point numbers. + typedef aligned_highp_dmat3x2 aligned_dmat3x2; + + /// 3 by 3 matrix tightly aligned in memory of double-precision floating-point numbers. + typedef aligned_highp_dmat3x3 aligned_dmat3x3; + + /// 3 by 4 matrix tightly aligned in memory of double-precision floating-point numbers. + typedef aligned_highp_dmat3x4 aligned_dmat3x4; + + /// 4 by 2 matrix tightly aligned in memory of double-precision floating-point numbers. + typedef aligned_highp_dmat4x2 aligned_dmat4x2; + + /// 4 by 3 matrix tightly aligned in memory of double-precision floating-point numbers. + typedef aligned_highp_dmat4x3 aligned_dmat4x3; + + /// 4 by 4 matrix tightly aligned in memory of double-precision floating-point numbers. + typedef aligned_highp_dmat4x4 aligned_dmat4x4; + + /// 2 by 2 matrix tightly packed in memory of double-precision floating-point numbers. + typedef packed_highp_dmat2x2 packed_dmat2x2; + + /// 2 by 3 matrix tightly packed in memory of double-precision floating-point numbers. + typedef packed_highp_dmat2x3 packed_dmat2x3; + + /// 2 by 4 matrix tightly packed in memory of double-precision floating-point numbers. + typedef packed_highp_dmat2x4 packed_dmat2x4; + + /// 3 by 2 matrix tightly packed in memory of double-precision floating-point numbers. + typedef packed_highp_dmat3x2 packed_dmat3x2; + + /// 3 by 3 matrix tightly packed in memory of double-precision floating-point numbers. + typedef packed_highp_dmat3x3 packed_dmat3x3; + + /// 3 by 4 matrix tightly packed in memory of double-precision floating-point numbers. + typedef packed_highp_dmat3x4 packed_dmat3x4; + + /// 4 by 2 matrix tightly packed in memory of double-precision floating-point numbers. + typedef packed_highp_dmat4x2 packed_dmat4x2; + + /// 4 by 3 matrix tightly packed in memory of double-precision floating-point numbers. + typedef packed_highp_dmat4x3 packed_dmat4x3; + + /// 4 by 4 matrix tightly packed in memory of double-precision floating-point numbers. + typedef packed_highp_dmat4x4 packed_dmat4x4; +#endif//GLM_PRECISION + +#if(defined(GLM_PRECISION_LOWP_INT)) + typedef aligned_lowp_ivec1 aligned_ivec1; + typedef aligned_lowp_ivec2 aligned_ivec2; + typedef aligned_lowp_ivec3 aligned_ivec3; + typedef aligned_lowp_ivec4 aligned_ivec4; +#elif(defined(GLM_PRECISION_MEDIUMP_INT)) + typedef aligned_mediump_ivec1 aligned_ivec1; + typedef aligned_mediump_ivec2 aligned_ivec2; + typedef aligned_mediump_ivec3 aligned_ivec3; + typedef aligned_mediump_ivec4 aligned_ivec4; +#else //defined(GLM_PRECISION_HIGHP_INT) + /// 1 component vector aligned in memory of signed integer numbers. + typedef aligned_highp_ivec1 aligned_ivec1; + + /// 2 components vector aligned in memory of signed integer numbers. + typedef aligned_highp_ivec2 aligned_ivec2; + + /// 3 components vector aligned in memory of signed integer numbers. + typedef aligned_highp_ivec3 aligned_ivec3; + + /// 4 components vector aligned in memory of signed integer numbers. + typedef aligned_highp_ivec4 aligned_ivec4; + + /// 1 component vector tightly packed in memory of signed integer numbers. + typedef packed_highp_ivec1 packed_ivec1; + + /// 2 components vector tightly packed in memory of signed integer numbers. + typedef packed_highp_ivec2 packed_ivec2; + + /// 3 components vector tightly packed in memory of signed integer numbers. + typedef packed_highp_ivec3 packed_ivec3; + + /// 4 components vector tightly packed in memory of signed integer numbers. + typedef packed_highp_ivec4 packed_ivec4; +#endif//GLM_PRECISION + + // -- Unsigned integer definition -- + +#if(defined(GLM_PRECISION_LOWP_UINT)) + typedef aligned_lowp_uvec1 aligned_uvec1; + typedef aligned_lowp_uvec2 aligned_uvec2; + typedef aligned_lowp_uvec3 aligned_uvec3; + typedef aligned_lowp_uvec4 aligned_uvec4; +#elif(defined(GLM_PRECISION_MEDIUMP_UINT)) + typedef aligned_mediump_uvec1 aligned_uvec1; + typedef aligned_mediump_uvec2 aligned_uvec2; + typedef aligned_mediump_uvec3 aligned_uvec3; + typedef aligned_mediump_uvec4 aligned_uvec4; +#else //defined(GLM_PRECISION_HIGHP_UINT) + /// 1 component vector aligned in memory of unsigned integer numbers. + typedef aligned_highp_uvec1 aligned_uvec1; + + /// 2 components vector aligned in memory of unsigned integer numbers. + typedef aligned_highp_uvec2 aligned_uvec2; + + /// 3 components vector aligned in memory of unsigned integer numbers. + typedef aligned_highp_uvec3 aligned_uvec3; + + /// 4 components vector aligned in memory of unsigned integer numbers. + typedef aligned_highp_uvec4 aligned_uvec4; + + /// 1 component vector tightly packed in memory of unsigned integer numbers. + typedef packed_highp_uvec1 packed_uvec1; + + /// 2 components vector tightly packed in memory of unsigned integer numbers. + typedef packed_highp_uvec2 packed_uvec2; + + /// 3 components vector tightly packed in memory of unsigned integer numbers. + typedef packed_highp_uvec3 packed_uvec3; + + /// 4 components vector tightly packed in memory of unsigned integer numbers. + typedef packed_highp_uvec4 packed_uvec4; +#endif//GLM_PRECISION + +#if(defined(GLM_PRECISION_LOWP_BOOL)) + typedef aligned_lowp_bvec1 aligned_bvec1; + typedef aligned_lowp_bvec2 aligned_bvec2; + typedef aligned_lowp_bvec3 aligned_bvec3; + typedef aligned_lowp_bvec4 aligned_bvec4; +#elif(defined(GLM_PRECISION_MEDIUMP_BOOL)) + typedef aligned_mediump_bvec1 aligned_bvec1; + typedef aligned_mediump_bvec2 aligned_bvec2; + typedef aligned_mediump_bvec3 aligned_bvec3; + typedef aligned_mediump_bvec4 aligned_bvec4; +#else //defined(GLM_PRECISION_HIGHP_BOOL) + /// 1 component vector aligned in memory of bool values. + typedef aligned_highp_bvec1 aligned_bvec1; + + /// 2 components vector aligned in memory of bool values. + typedef aligned_highp_bvec2 aligned_bvec2; + + /// 3 components vector aligned in memory of bool values. + typedef aligned_highp_bvec3 aligned_bvec3; + + /// 4 components vector aligned in memory of bool values. + typedef aligned_highp_bvec4 aligned_bvec4; + + /// 1 components vector tightly packed in memory of bool values. + typedef packed_highp_bvec1 packed_bvec1; + + /// 2 components vector tightly packed in memory of bool values. + typedef packed_highp_bvec2 packed_bvec2; + + /// 3 components vector tightly packed in memory of bool values. + typedef packed_highp_bvec3 packed_bvec3; + + /// 4 components vector tightly packed in memory of bool values. + typedef packed_highp_bvec4 packed_bvec4; +#endif//GLM_PRECISION + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/type_precision.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/type_precision.hpp new file mode 100644 index 0000000000000000000000000000000000000000..54c07dc4dad96d641e4029d94e08910e22c89b09 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/type_precision.hpp @@ -0,0 +1,2094 @@ +/// @ref gtc_type_precision +/// @file glm/gtc/type_precision.hpp +/// +/// @see core (dependence) +/// @see gtc_quaternion (dependence) +/// +/// @defgroup gtc_type_precision GLM_GTC_type_precision +/// @ingroup gtc +/// +/// Include to use the features of this extension. +/// +/// Defines specific C++-based qualifier types. + +#pragma once + +// Dependency: +#include "../gtc/quaternion.hpp" +#include "../gtc/vec1.hpp" +#include "../ext/vector_int1_sized.hpp" +#include "../ext/vector_int2_sized.hpp" +#include "../ext/vector_int3_sized.hpp" +#include "../ext/vector_int4_sized.hpp" +#include "../ext/scalar_int_sized.hpp" +#include "../ext/vector_uint1_sized.hpp" +#include "../ext/vector_uint2_sized.hpp" +#include "../ext/vector_uint3_sized.hpp" +#include "../ext/vector_uint4_sized.hpp" +#include "../ext/scalar_uint_sized.hpp" +#include "../detail/type_vec2.hpp" +#include "../detail/type_vec3.hpp" +#include "../detail/type_vec4.hpp" +#include "../detail/type_mat2x2.hpp" +#include "../detail/type_mat2x3.hpp" +#include "../detail/type_mat2x4.hpp" +#include "../detail/type_mat3x2.hpp" +#include "../detail/type_mat3x3.hpp" +#include "../detail/type_mat3x4.hpp" +#include "../detail/type_mat4x2.hpp" +#include "../detail/type_mat4x3.hpp" +#include "../detail/type_mat4x4.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_GTC_type_precision extension included") +#endif + +namespace glm +{ + /////////////////////////// + // Signed int vector types + + /// @addtogroup gtc_type_precision + /// @{ + + /// Low qualifier 8 bit signed integer type. + /// @see gtc_type_precision + typedef detail::int8 lowp_int8; + + /// Low qualifier 16 bit signed integer type. + /// @see gtc_type_precision + typedef detail::int16 lowp_int16; + + /// Low qualifier 32 bit signed integer type. + /// @see gtc_type_precision + typedef detail::int32 lowp_int32; + + /// Low qualifier 64 bit signed integer type. + /// @see gtc_type_precision + typedef detail::int64 lowp_int64; + + /// Low qualifier 8 bit signed integer type. + /// @see gtc_type_precision + typedef detail::int8 lowp_int8_t; + + /// Low qualifier 16 bit signed integer type. + /// @see gtc_type_precision + typedef detail::int16 lowp_int16_t; + + /// Low qualifier 32 bit signed integer type. + /// @see gtc_type_precision + typedef detail::int32 lowp_int32_t; + + /// Low qualifier 64 bit signed integer type. + /// @see gtc_type_precision + typedef detail::int64 lowp_int64_t; + + /// Low qualifier 8 bit signed integer type. + /// @see gtc_type_precision + typedef detail::int8 lowp_i8; + + /// Low qualifier 16 bit signed integer type. + /// @see gtc_type_precision + typedef detail::int16 lowp_i16; + + /// Low qualifier 32 bit signed integer type. + /// @see gtc_type_precision + typedef detail::int32 lowp_i32; + + /// Low qualifier 64 bit signed integer type. + /// @see gtc_type_precision + typedef detail::int64 lowp_i64; + + /// Medium qualifier 8 bit signed integer type. + /// @see gtc_type_precision + typedef detail::int8 mediump_int8; + + /// Medium qualifier 16 bit signed integer type. + /// @see gtc_type_precision + typedef detail::int16 mediump_int16; + + /// Medium qualifier 32 bit signed integer type. + /// @see gtc_type_precision + typedef detail::int32 mediump_int32; + + /// Medium qualifier 64 bit signed integer type. + /// @see gtc_type_precision + typedef detail::int64 mediump_int64; + + /// Medium qualifier 8 bit signed integer type. + /// @see gtc_type_precision + typedef detail::int8 mediump_int8_t; + + /// Medium qualifier 16 bit signed integer type. + /// @see gtc_type_precision + typedef detail::int16 mediump_int16_t; + + /// Medium qualifier 32 bit signed integer type. + /// @see gtc_type_precision + typedef detail::int32 mediump_int32_t; + + /// Medium qualifier 64 bit signed integer type. + /// @see gtc_type_precision + typedef detail::int64 mediump_int64_t; + + /// Medium qualifier 8 bit signed integer type. + /// @see gtc_type_precision + typedef detail::int8 mediump_i8; + + /// Medium qualifier 16 bit signed integer type. + /// @see gtc_type_precision + typedef detail::int16 mediump_i16; + + /// Medium qualifier 32 bit signed integer type. + /// @see gtc_type_precision + typedef detail::int32 mediump_i32; + + /// Medium qualifier 64 bit signed integer type. + /// @see gtc_type_precision + typedef detail::int64 mediump_i64; + + /// High qualifier 8 bit signed integer type. + /// @see gtc_type_precision + typedef detail::int8 highp_int8; + + /// High qualifier 16 bit signed integer type. + /// @see gtc_type_precision + typedef detail::int16 highp_int16; + + /// High qualifier 32 bit signed integer type. + /// @see gtc_type_precision + typedef detail::int32 highp_int32; + + /// High qualifier 64 bit signed integer type. + /// @see gtc_type_precision + typedef detail::int64 highp_int64; + + /// High qualifier 8 bit signed integer type. + /// @see gtc_type_precision + typedef detail::int8 highp_int8_t; + + /// High qualifier 16 bit signed integer type. + /// @see gtc_type_precision + typedef detail::int16 highp_int16_t; + + /// 32 bit signed integer type. + /// @see gtc_type_precision + typedef detail::int32 highp_int32_t; + + /// High qualifier 64 bit signed integer type. + /// @see gtc_type_precision + typedef detail::int64 highp_int64_t; + + /// High qualifier 8 bit signed integer type. + /// @see gtc_type_precision + typedef detail::int8 highp_i8; + + /// High qualifier 16 bit signed integer type. + /// @see gtc_type_precision + typedef detail::int16 highp_i16; + + /// High qualifier 32 bit signed integer type. + /// @see gtc_type_precision + typedef detail::int32 highp_i32; + + /// High qualifier 64 bit signed integer type. + /// @see gtc_type_precision + typedef detail::int64 highp_i64; + + +#if GLM_HAS_EXTENDED_INTEGER_TYPE + using std::int8_t; + using std::int16_t; + using std::int32_t; + using std::int64_t; +#else + /// 8 bit signed integer type. + /// @see gtc_type_precision + typedef detail::int8 int8_t; + + /// 16 bit signed integer type. + /// @see gtc_type_precision + typedef detail::int16 int16_t; + + /// 32 bit signed integer type. + /// @see gtc_type_precision + typedef detail::int32 int32_t; + + /// 64 bit signed integer type. + /// @see gtc_type_precision + typedef detail::int64 int64_t; +#endif + + /// 8 bit signed integer type. + /// @see gtc_type_precision + typedef detail::int8 i8; + + /// 16 bit signed integer type. + /// @see gtc_type_precision + typedef detail::int16 i16; + + /// 32 bit signed integer type. + /// @see gtc_type_precision + typedef detail::int32 i32; + + /// 64 bit signed integer type. + /// @see gtc_type_precision + typedef detail::int64 i64; + + ///////////////////////////// + // Unsigned int vector types + + /// Low qualifier 8 bit unsigned integer type. + /// @see gtc_type_precision + typedef detail::uint8 lowp_uint8; + + /// Low qualifier 16 bit unsigned integer type. + /// @see gtc_type_precision + typedef detail::uint16 lowp_uint16; + + /// Low qualifier 32 bit unsigned integer type. + /// @see gtc_type_precision + typedef detail::uint32 lowp_uint32; + + /// Low qualifier 64 bit unsigned integer type. + /// @see gtc_type_precision + typedef detail::uint64 lowp_uint64; + + /// Low qualifier 8 bit unsigned integer type. + /// @see gtc_type_precision + typedef detail::uint8 lowp_uint8_t; + + /// Low qualifier 16 bit unsigned integer type. + /// @see gtc_type_precision + typedef detail::uint16 lowp_uint16_t; + + /// Low qualifier 32 bit unsigned integer type. + /// @see gtc_type_precision + typedef detail::uint32 lowp_uint32_t; + + /// Low qualifier 64 bit unsigned integer type. + /// @see gtc_type_precision + typedef detail::uint64 lowp_uint64_t; + + /// Low qualifier 8 bit unsigned integer type. + /// @see gtc_type_precision + typedef detail::uint8 lowp_u8; + + /// Low qualifier 16 bit unsigned integer type. + /// @see gtc_type_precision + typedef detail::uint16 lowp_u16; + + /// Low qualifier 32 bit unsigned integer type. + /// @see gtc_type_precision + typedef detail::uint32 lowp_u32; + + /// Low qualifier 64 bit unsigned integer type. + /// @see gtc_type_precision + typedef detail::uint64 lowp_u64; + + /// Medium qualifier 8 bit unsigned integer type. + /// @see gtc_type_precision + typedef detail::uint8 mediump_uint8; + + /// Medium qualifier 16 bit unsigned integer type. + /// @see gtc_type_precision + typedef detail::uint16 mediump_uint16; + + /// Medium qualifier 32 bit unsigned integer type. + /// @see gtc_type_precision + typedef detail::uint32 mediump_uint32; + + /// Medium qualifier 64 bit unsigned integer type. + /// @see gtc_type_precision + typedef detail::uint64 mediump_uint64; + + /// Medium qualifier 8 bit unsigned integer type. + /// @see gtc_type_precision + typedef detail::uint8 mediump_uint8_t; + + /// Medium qualifier 16 bit unsigned integer type. + /// @see gtc_type_precision + typedef detail::uint16 mediump_uint16_t; + + /// Medium qualifier 32 bit unsigned integer type. + /// @see gtc_type_precision + typedef detail::uint32 mediump_uint32_t; + + /// Medium qualifier 64 bit unsigned integer type. + /// @see gtc_type_precision + typedef detail::uint64 mediump_uint64_t; + + /// Medium qualifier 8 bit unsigned integer type. + /// @see gtc_type_precision + typedef detail::uint8 mediump_u8; + + /// Medium qualifier 16 bit unsigned integer type. + /// @see gtc_type_precision + typedef detail::uint16 mediump_u16; + + /// Medium qualifier 32 bit unsigned integer type. + /// @see gtc_type_precision + typedef detail::uint32 mediump_u32; + + /// Medium qualifier 64 bit unsigned integer type. + /// @see gtc_type_precision + typedef detail::uint64 mediump_u64; + + /// High qualifier 8 bit unsigned integer type. + /// @see gtc_type_precision + typedef detail::uint8 highp_uint8; + + /// High qualifier 16 bit unsigned integer type. + /// @see gtc_type_precision + typedef detail::uint16 highp_uint16; + + /// High qualifier 32 bit unsigned integer type. + /// @see gtc_type_precision + typedef detail::uint32 highp_uint32; + + /// High qualifier 64 bit unsigned integer type. + /// @see gtc_type_precision + typedef detail::uint64 highp_uint64; + + /// High qualifier 8 bit unsigned integer type. + /// @see gtc_type_precision + typedef detail::uint8 highp_uint8_t; + + /// High qualifier 16 bit unsigned integer type. + /// @see gtc_type_precision + typedef detail::uint16 highp_uint16_t; + + /// High qualifier 32 bit unsigned integer type. + /// @see gtc_type_precision + typedef detail::uint32 highp_uint32_t; + + /// High qualifier 64 bit unsigned integer type. + /// @see gtc_type_precision + typedef detail::uint64 highp_uint64_t; + + /// High qualifier 8 bit unsigned integer type. + /// @see gtc_type_precision + typedef detail::uint8 highp_u8; + + /// High qualifier 16 bit unsigned integer type. + /// @see gtc_type_precision + typedef detail::uint16 highp_u16; + + /// High qualifier 32 bit unsigned integer type. + /// @see gtc_type_precision + typedef detail::uint32 highp_u32; + + /// High qualifier 64 bit unsigned integer type. + /// @see gtc_type_precision + typedef detail::uint64 highp_u64; + +#if GLM_HAS_EXTENDED_INTEGER_TYPE + using std::uint8_t; + using std::uint16_t; + using std::uint32_t; + using std::uint64_t; +#else + /// Default qualifier 8 bit unsigned integer type. + /// @see gtc_type_precision + typedef detail::uint8 uint8_t; + + /// Default qualifier 16 bit unsigned integer type. + /// @see gtc_type_precision + typedef detail::uint16 uint16_t; + + /// Default qualifier 32 bit unsigned integer type. + /// @see gtc_type_precision + typedef detail::uint32 uint32_t; + + /// Default qualifier 64 bit unsigned integer type. + /// @see gtc_type_precision + typedef detail::uint64 uint64_t; +#endif + + /// Default qualifier 8 bit unsigned integer type. + /// @see gtc_type_precision + typedef detail::uint8 u8; + + /// Default qualifier 16 bit unsigned integer type. + /// @see gtc_type_precision + typedef detail::uint16 u16; + + /// Default qualifier 32 bit unsigned integer type. + /// @see gtc_type_precision + typedef detail::uint32 u32; + + /// Default qualifier 64 bit unsigned integer type. + /// @see gtc_type_precision + typedef detail::uint64 u64; + + + + + + ////////////////////// + // Float vector types + + /// Single-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef float float32; + + /// Double-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef double float64; + + /// Low 32 bit single-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef float32 lowp_float32; + + /// Low 64 bit double-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef float64 lowp_float64; + + /// Low 32 bit single-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef float32 lowp_float32_t; + + /// Low 64 bit double-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef float64 lowp_float64_t; + + /// Low 32 bit single-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef float32 lowp_f32; + + /// Low 64 bit double-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef float64 lowp_f64; + + /// Low 32 bit single-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef float32 lowp_float32; + + /// Low 64 bit double-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef float64 lowp_float64; + + /// Low 32 bit single-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef float32 lowp_float32_t; + + /// Low 64 bit double-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef float64 lowp_float64_t; + + /// Low 32 bit single-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef float32 lowp_f32; + + /// Low 64 bit double-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef float64 lowp_f64; + + + /// Low 32 bit single-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef float32 lowp_float32; + + /// Low 64 bit double-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef float64 lowp_float64; + + /// Low 32 bit single-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef float32 lowp_float32_t; + + /// Low 64 bit double-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef float64 lowp_float64_t; + + /// Low 32 bit single-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef float32 lowp_f32; + + /// Low 64 bit double-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef float64 lowp_f64; + + + /// Medium 32 bit single-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef float32 mediump_float32; + + /// Medium 64 bit double-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef float64 mediump_float64; + + /// Medium 32 bit single-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef float32 mediump_float32_t; + + /// Medium 64 bit double-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef float64 mediump_float64_t; + + /// Medium 32 bit single-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef float32 mediump_f32; + + /// Medium 64 bit double-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef float64 mediump_f64; + + + /// High 32 bit single-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef float32 highp_float32; + + /// High 64 bit double-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef float64 highp_float64; + + /// High 32 bit single-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef float32 highp_float32_t; + + /// High 64 bit double-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef float64 highp_float64_t; + + /// High 32 bit single-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef float32 highp_f32; + + /// High 64 bit double-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef float64 highp_f64; + + +#if(defined(GLM_PRECISION_LOWP_FLOAT)) + /// Default 32 bit single-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef lowp_float32_t float32_t; + + /// Default 64 bit double-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef lowp_float64_t float64_t; + + /// Default 32 bit single-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef lowp_f32 f32; + + /// Default 64 bit double-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef lowp_f64 f64; + +#elif(defined(GLM_PRECISION_MEDIUMP_FLOAT)) + /// Default 32 bit single-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef mediump_float32 float32_t; + + /// Default 64 bit double-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef mediump_float64 float64_t; + + /// Default 32 bit single-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef mediump_float32 f32; + + /// Default 64 bit double-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef mediump_float64 f64; + +#else//(defined(GLM_PRECISION_HIGHP_FLOAT)) + + /// Default 32 bit single-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef highp_float32_t float32_t; + + /// Default 64 bit double-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef highp_float64_t float64_t; + + /// Default 32 bit single-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef highp_float32_t f32; + + /// Default 64 bit double-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef highp_float64_t f64; +#endif + + + /// Low single-qualifier floating-point vector of 1 component. + /// @see gtc_type_precision + typedef vec<1, float, lowp> lowp_fvec1; + + /// Low single-qualifier floating-point vector of 2 components. + /// @see gtc_type_precision + typedef vec<2, float, lowp> lowp_fvec2; + + /// Low single-qualifier floating-point vector of 3 components. + /// @see gtc_type_precision + typedef vec<3, float, lowp> lowp_fvec3; + + /// Low single-qualifier floating-point vector of 4 components. + /// @see gtc_type_precision + typedef vec<4, float, lowp> lowp_fvec4; + + + /// Medium single-qualifier floating-point vector of 1 component. + /// @see gtc_type_precision + typedef vec<1, float, mediump> mediump_fvec1; + + /// Medium Single-qualifier floating-point vector of 2 components. + /// @see gtc_type_precision + typedef vec<2, float, mediump> mediump_fvec2; + + /// Medium Single-qualifier floating-point vector of 3 components. + /// @see gtc_type_precision + typedef vec<3, float, mediump> mediump_fvec3; + + /// Medium Single-qualifier floating-point vector of 4 components. + /// @see gtc_type_precision + typedef vec<4, float, mediump> mediump_fvec4; + + + /// High single-qualifier floating-point vector of 1 component. + /// @see gtc_type_precision + typedef vec<1, float, highp> highp_fvec1; + + /// High Single-qualifier floating-point vector of 2 components. + /// @see core_precision + typedef vec<2, float, highp> highp_fvec2; + + /// High Single-qualifier floating-point vector of 3 components. + /// @see core_precision + typedef vec<3, float, highp> highp_fvec3; + + /// High Single-qualifier floating-point vector of 4 components. + /// @see core_precision + typedef vec<4, float, highp> highp_fvec4; + + + /// Low single-qualifier floating-point vector of 1 component. + /// @see gtc_type_precision + typedef vec<1, f32, lowp> lowp_f32vec1; + + /// Low single-qualifier floating-point vector of 2 components. + /// @see core_precision + typedef vec<2, f32, lowp> lowp_f32vec2; + + /// Low single-qualifier floating-point vector of 3 components. + /// @see core_precision + typedef vec<3, f32, lowp> lowp_f32vec3; + + /// Low single-qualifier floating-point vector of 4 components. + /// @see core_precision + typedef vec<4, f32, lowp> lowp_f32vec4; + + /// Medium single-qualifier floating-point vector of 1 component. + /// @see gtc_type_precision + typedef vec<1, f32, mediump> mediump_f32vec1; + + /// Medium single-qualifier floating-point vector of 2 components. + /// @see core_precision + typedef vec<2, f32, mediump> mediump_f32vec2; + + /// Medium single-qualifier floating-point vector of 3 components. + /// @see core_precision + typedef vec<3, f32, mediump> mediump_f32vec3; + + /// Medium single-qualifier floating-point vector of 4 components. + /// @see core_precision + typedef vec<4, f32, mediump> mediump_f32vec4; + + /// High single-qualifier floating-point vector of 1 component. + /// @see gtc_type_precision + typedef vec<1, f32, highp> highp_f32vec1; + + /// High single-qualifier floating-point vector of 2 components. + /// @see gtc_type_precision + typedef vec<2, f32, highp> highp_f32vec2; + + /// High single-qualifier floating-point vector of 3 components. + /// @see gtc_type_precision + typedef vec<3, f32, highp> highp_f32vec3; + + /// High single-qualifier floating-point vector of 4 components. + /// @see gtc_type_precision + typedef vec<4, f32, highp> highp_f32vec4; + + + /// Low double-qualifier floating-point vector of 1 component. + /// @see gtc_type_precision + typedef vec<1, f64, lowp> lowp_f64vec1; + + /// Low double-qualifier floating-point vector of 2 components. + /// @see gtc_type_precision + typedef vec<2, f64, lowp> lowp_f64vec2; + + /// Low double-qualifier floating-point vector of 3 components. + /// @see gtc_type_precision + typedef vec<3, f64, lowp> lowp_f64vec3; + + /// Low double-qualifier floating-point vector of 4 components. + /// @see gtc_type_precision + typedef vec<4, f64, lowp> lowp_f64vec4; + + /// Medium double-qualifier floating-point vector of 1 component. + /// @see gtc_type_precision + typedef vec<1, f64, mediump> mediump_f64vec1; + + /// Medium double-qualifier floating-point vector of 2 components. + /// @see gtc_type_precision + typedef vec<2, f64, mediump> mediump_f64vec2; + + /// Medium double-qualifier floating-point vector of 3 components. + /// @see gtc_type_precision + typedef vec<3, f64, mediump> mediump_f64vec3; + + /// Medium double-qualifier floating-point vector of 4 components. + /// @see gtc_type_precision + typedef vec<4, f64, mediump> mediump_f64vec4; + + /// High double-qualifier floating-point vector of 1 component. + /// @see gtc_type_precision + typedef vec<1, f64, highp> highp_f64vec1; + + /// High double-qualifier floating-point vector of 2 components. + /// @see gtc_type_precision + typedef vec<2, f64, highp> highp_f64vec2; + + /// High double-qualifier floating-point vector of 3 components. + /// @see gtc_type_precision + typedef vec<3, f64, highp> highp_f64vec3; + + /// High double-qualifier floating-point vector of 4 components. + /// @see gtc_type_precision + typedef vec<4, f64, highp> highp_f64vec4; + + + + ////////////////////// + // Float matrix types + + /// Low single-qualifier floating-point 1x1 matrix. + /// @see gtc_type_precision + //typedef lowp_f32 lowp_fmat1x1; + + /// Low single-qualifier floating-point 2x2 matrix. + /// @see gtc_type_precision + typedef mat<2, 2, f32, lowp> lowp_fmat2x2; + + /// Low single-qualifier floating-point 2x3 matrix. + /// @see gtc_type_precision + typedef mat<2, 3, f32, lowp> lowp_fmat2x3; + + /// Low single-qualifier floating-point 2x4 matrix. + /// @see gtc_type_precision + typedef mat<2, 4, f32, lowp> lowp_fmat2x4; + + /// Low single-qualifier floating-point 3x2 matrix. + /// @see gtc_type_precision + typedef mat<3, 2, f32, lowp> lowp_fmat3x2; + + /// Low single-qualifier floating-point 3x3 matrix. + /// @see gtc_type_precision + typedef mat<3, 3, f32, lowp> lowp_fmat3x3; + + /// Low single-qualifier floating-point 3x4 matrix. + /// @see gtc_type_precision + typedef mat<3, 4, f32, lowp> lowp_fmat3x4; + + /// Low single-qualifier floating-point 4x2 matrix. + /// @see gtc_type_precision + typedef mat<4, 2, f32, lowp> lowp_fmat4x2; + + /// Low single-qualifier floating-point 4x3 matrix. + /// @see gtc_type_precision + typedef mat<4, 3, f32, lowp> lowp_fmat4x3; + + /// Low single-qualifier floating-point 4x4 matrix. + /// @see gtc_type_precision + typedef mat<4, 4, f32, lowp> lowp_fmat4x4; + + /// Low single-qualifier floating-point 1x1 matrix. + /// @see gtc_type_precision + //typedef lowp_fmat1x1 lowp_fmat1; + + /// Low single-qualifier floating-point 2x2 matrix. + /// @see gtc_type_precision + typedef lowp_fmat2x2 lowp_fmat2; + + /// Low single-qualifier floating-point 3x3 matrix. + /// @see gtc_type_precision + typedef lowp_fmat3x3 lowp_fmat3; + + /// Low single-qualifier floating-point 4x4 matrix. + /// @see gtc_type_precision + typedef lowp_fmat4x4 lowp_fmat4; + + + /// Medium single-qualifier floating-point 1x1 matrix. + /// @see gtc_type_precision + //typedef mediump_f32 mediump_fmat1x1; + + /// Medium single-qualifier floating-point 2x2 matrix. + /// @see gtc_type_precision + typedef mat<2, 2, f32, mediump> mediump_fmat2x2; + + /// Medium single-qualifier floating-point 2x3 matrix. + /// @see gtc_type_precision + typedef mat<2, 3, f32, mediump> mediump_fmat2x3; + + /// Medium single-qualifier floating-point 2x4 matrix. + /// @see gtc_type_precision + typedef mat<2, 4, f32, mediump> mediump_fmat2x4; + + /// Medium single-qualifier floating-point 3x2 matrix. + /// @see gtc_type_precision + typedef mat<3, 2, f32, mediump> mediump_fmat3x2; + + /// Medium single-qualifier floating-point 3x3 matrix. + /// @see gtc_type_precision + typedef mat<3, 3, f32, mediump> mediump_fmat3x3; + + /// Medium single-qualifier floating-point 3x4 matrix. + /// @see gtc_type_precision + typedef mat<3, 4, f32, mediump> mediump_fmat3x4; + + /// Medium single-qualifier floating-point 4x2 matrix. + /// @see gtc_type_precision + typedef mat<4, 2, f32, mediump> mediump_fmat4x2; + + /// Medium single-qualifier floating-point 4x3 matrix. + /// @see gtc_type_precision + typedef mat<4, 3, f32, mediump> mediump_fmat4x3; + + /// Medium single-qualifier floating-point 4x4 matrix. + /// @see gtc_type_precision + typedef mat<4, 4, f32, mediump> mediump_fmat4x4; + + /// Medium single-qualifier floating-point 1x1 matrix. + /// @see gtc_type_precision + //typedef mediump_fmat1x1 mediump_fmat1; + + /// Medium single-qualifier floating-point 2x2 matrix. + /// @see gtc_type_precision + typedef mediump_fmat2x2 mediump_fmat2; + + /// Medium single-qualifier floating-point 3x3 matrix. + /// @see gtc_type_precision + typedef mediump_fmat3x3 mediump_fmat3; + + /// Medium single-qualifier floating-point 4x4 matrix. + /// @see gtc_type_precision + typedef mediump_fmat4x4 mediump_fmat4; + + + /// High single-qualifier floating-point 1x1 matrix. + /// @see gtc_type_precision + //typedef highp_f32 highp_fmat1x1; + + /// High single-qualifier floating-point 2x2 matrix. + /// @see gtc_type_precision + typedef mat<2, 2, f32, highp> highp_fmat2x2; + + /// High single-qualifier floating-point 2x3 matrix. + /// @see gtc_type_precision + typedef mat<2, 3, f32, highp> highp_fmat2x3; + + /// High single-qualifier floating-point 2x4 matrix. + /// @see gtc_type_precision + typedef mat<2, 4, f32, highp> highp_fmat2x4; + + /// High single-qualifier floating-point 3x2 matrix. + /// @see gtc_type_precision + typedef mat<3, 2, f32, highp> highp_fmat3x2; + + /// High single-qualifier floating-point 3x3 matrix. + /// @see gtc_type_precision + typedef mat<3, 3, f32, highp> highp_fmat3x3; + + /// High single-qualifier floating-point 3x4 matrix. + /// @see gtc_type_precision + typedef mat<3, 4, f32, highp> highp_fmat3x4; + + /// High single-qualifier floating-point 4x2 matrix. + /// @see gtc_type_precision + typedef mat<4, 2, f32, highp> highp_fmat4x2; + + /// High single-qualifier floating-point 4x3 matrix. + /// @see gtc_type_precision + typedef mat<4, 3, f32, highp> highp_fmat4x3; + + /// High single-qualifier floating-point 4x4 matrix. + /// @see gtc_type_precision + typedef mat<4, 4, f32, highp> highp_fmat4x4; + + /// High single-qualifier floating-point 1x1 matrix. + /// @see gtc_type_precision + //typedef highp_fmat1x1 highp_fmat1; + + /// High single-qualifier floating-point 2x2 matrix. + /// @see gtc_type_precision + typedef highp_fmat2x2 highp_fmat2; + + /// High single-qualifier floating-point 3x3 matrix. + /// @see gtc_type_precision + typedef highp_fmat3x3 highp_fmat3; + + /// High single-qualifier floating-point 4x4 matrix. + /// @see gtc_type_precision + typedef highp_fmat4x4 highp_fmat4; + + + /// Low single-qualifier floating-point 1x1 matrix. + /// @see gtc_type_precision + //typedef f32 lowp_f32mat1x1; + + /// Low single-qualifier floating-point 2x2 matrix. + /// @see gtc_type_precision + typedef mat<2, 2, f32, lowp> lowp_f32mat2x2; + + /// Low single-qualifier floating-point 2x3 matrix. + /// @see gtc_type_precision + typedef mat<2, 3, f32, lowp> lowp_f32mat2x3; + + /// Low single-qualifier floating-point 2x4 matrix. + /// @see gtc_type_precision + typedef mat<2, 4, f32, lowp> lowp_f32mat2x4; + + /// Low single-qualifier floating-point 3x2 matrix. + /// @see gtc_type_precision + typedef mat<3, 2, f32, lowp> lowp_f32mat3x2; + + /// Low single-qualifier floating-point 3x3 matrix. + /// @see gtc_type_precision + typedef mat<3, 3, f32, lowp> lowp_f32mat3x3; + + /// Low single-qualifier floating-point 3x4 matrix. + /// @see gtc_type_precision + typedef mat<3, 4, f32, lowp> lowp_f32mat3x4; + + /// Low single-qualifier floating-point 4x2 matrix. + /// @see gtc_type_precision + typedef mat<4, 2, f32, lowp> lowp_f32mat4x2; + + /// Low single-qualifier floating-point 4x3 matrix. + /// @see gtc_type_precision + typedef mat<4, 3, f32, lowp> lowp_f32mat4x3; + + /// Low single-qualifier floating-point 4x4 matrix. + /// @see gtc_type_precision + typedef mat<4, 4, f32, lowp> lowp_f32mat4x4; + + /// Low single-qualifier floating-point 1x1 matrix. + /// @see gtc_type_precision + //typedef detail::tmat1x1 lowp_f32mat1; + + /// Low single-qualifier floating-point 2x2 matrix. + /// @see gtc_type_precision + typedef lowp_f32mat2x2 lowp_f32mat2; + + /// Low single-qualifier floating-point 3x3 matrix. + /// @see gtc_type_precision + typedef lowp_f32mat3x3 lowp_f32mat3; + + /// Low single-qualifier floating-point 4x4 matrix. + /// @see gtc_type_precision + typedef lowp_f32mat4x4 lowp_f32mat4; + + + /// High single-qualifier floating-point 1x1 matrix. + /// @see gtc_type_precision + //typedef f32 mediump_f32mat1x1; + + /// Low single-qualifier floating-point 2x2 matrix. + /// @see gtc_type_precision + typedef mat<2, 2, f32, mediump> mediump_f32mat2x2; + + /// Medium single-qualifier floating-point 2x3 matrix. + /// @see gtc_type_precision + typedef mat<2, 3, f32, mediump> mediump_f32mat2x3; + + /// Medium single-qualifier floating-point 2x4 matrix. + /// @see gtc_type_precision + typedef mat<2, 4, f32, mediump> mediump_f32mat2x4; + + /// Medium single-qualifier floating-point 3x2 matrix. + /// @see gtc_type_precision + typedef mat<3, 2, f32, mediump> mediump_f32mat3x2; + + /// Medium single-qualifier floating-point 3x3 matrix. + /// @see gtc_type_precision + typedef mat<3, 3, f32, mediump> mediump_f32mat3x3; + + /// Medium single-qualifier floating-point 3x4 matrix. + /// @see gtc_type_precision + typedef mat<3, 4, f32, mediump> mediump_f32mat3x4; + + /// Medium single-qualifier floating-point 4x2 matrix. + /// @see gtc_type_precision + typedef mat<4, 2, f32, mediump> mediump_f32mat4x2; + + /// Medium single-qualifier floating-point 4x3 matrix. + /// @see gtc_type_precision + typedef mat<4, 3, f32, mediump> mediump_f32mat4x3; + + /// Medium single-qualifier floating-point 4x4 matrix. + /// @see gtc_type_precision + typedef mat<4, 4, f32, mediump> mediump_f32mat4x4; + + /// Medium single-qualifier floating-point 1x1 matrix. + /// @see gtc_type_precision + //typedef detail::tmat1x1 f32mat1; + + /// Medium single-qualifier floating-point 2x2 matrix. + /// @see gtc_type_precision + typedef mediump_f32mat2x2 mediump_f32mat2; + + /// Medium single-qualifier floating-point 3x3 matrix. + /// @see gtc_type_precision + typedef mediump_f32mat3x3 mediump_f32mat3; + + /// Medium single-qualifier floating-point 4x4 matrix. + /// @see gtc_type_precision + typedef mediump_f32mat4x4 mediump_f32mat4; + + + /// High single-qualifier floating-point 1x1 matrix. + /// @see gtc_type_precision + //typedef f32 highp_f32mat1x1; + + /// High single-qualifier floating-point 2x2 matrix. + /// @see gtc_type_precision + typedef mat<2, 2, f32, highp> highp_f32mat2x2; + + /// High single-qualifier floating-point 2x3 matrix. + /// @see gtc_type_precision + typedef mat<2, 3, f32, highp> highp_f32mat2x3; + + /// High single-qualifier floating-point 2x4 matrix. + /// @see gtc_type_precision + typedef mat<2, 4, f32, highp> highp_f32mat2x4; + + /// High single-qualifier floating-point 3x2 matrix. + /// @see gtc_type_precision + typedef mat<3, 2, f32, highp> highp_f32mat3x2; + + /// High single-qualifier floating-point 3x3 matrix. + /// @see gtc_type_precision + typedef mat<3, 3, f32, highp> highp_f32mat3x3; + + /// High single-qualifier floating-point 3x4 matrix. + /// @see gtc_type_precision + typedef mat<3, 4, f32, highp> highp_f32mat3x4; + + /// High single-qualifier floating-point 4x2 matrix. + /// @see gtc_type_precision + typedef mat<4, 2, f32, highp> highp_f32mat4x2; + + /// High single-qualifier floating-point 4x3 matrix. + /// @see gtc_type_precision + typedef mat<4, 3, f32, highp> highp_f32mat4x3; + + /// High single-qualifier floating-point 4x4 matrix. + /// @see gtc_type_precision + typedef mat<4, 4, f32, highp> highp_f32mat4x4; + + /// High single-qualifier floating-point 1x1 matrix. + /// @see gtc_type_precision + //typedef detail::tmat1x1 f32mat1; + + /// High single-qualifier floating-point 2x2 matrix. + /// @see gtc_type_precision + typedef highp_f32mat2x2 highp_f32mat2; + + /// High single-qualifier floating-point 3x3 matrix. + /// @see gtc_type_precision + typedef highp_f32mat3x3 highp_f32mat3; + + /// High single-qualifier floating-point 4x4 matrix. + /// @see gtc_type_precision + typedef highp_f32mat4x4 highp_f32mat4; + + + /// Low double-qualifier floating-point 1x1 matrix. + /// @see gtc_type_precision + //typedef f64 lowp_f64mat1x1; + + /// Low double-qualifier floating-point 2x2 matrix. + /// @see gtc_type_precision + typedef mat<2, 2, f64, lowp> lowp_f64mat2x2; + + /// Low double-qualifier floating-point 2x3 matrix. + /// @see gtc_type_precision + typedef mat<2, 3, f64, lowp> lowp_f64mat2x3; + + /// Low double-qualifier floating-point 2x4 matrix. + /// @see gtc_type_precision + typedef mat<2, 4, f64, lowp> lowp_f64mat2x4; + + /// Low double-qualifier floating-point 3x2 matrix. + /// @see gtc_type_precision + typedef mat<3, 2, f64, lowp> lowp_f64mat3x2; + + /// Low double-qualifier floating-point 3x3 matrix. + /// @see gtc_type_precision + typedef mat<3, 3, f64, lowp> lowp_f64mat3x3; + + /// Low double-qualifier floating-point 3x4 matrix. + /// @see gtc_type_precision + typedef mat<3, 4, f64, lowp> lowp_f64mat3x4; + + /// Low double-qualifier floating-point 4x2 matrix. + /// @see gtc_type_precision + typedef mat<4, 2, f64, lowp> lowp_f64mat4x2; + + /// Low double-qualifier floating-point 4x3 matrix. + /// @see gtc_type_precision + typedef mat<4, 3, f64, lowp> lowp_f64mat4x3; + + /// Low double-qualifier floating-point 4x4 matrix. + /// @see gtc_type_precision + typedef mat<4, 4, f64, lowp> lowp_f64mat4x4; + + /// Low double-qualifier floating-point 1x1 matrix. + /// @see gtc_type_precision + //typedef lowp_f64mat1x1 lowp_f64mat1; + + /// Low double-qualifier floating-point 2x2 matrix. + /// @see gtc_type_precision + typedef lowp_f64mat2x2 lowp_f64mat2; + + /// Low double-qualifier floating-point 3x3 matrix. + /// @see gtc_type_precision + typedef lowp_f64mat3x3 lowp_f64mat3; + + /// Low double-qualifier floating-point 4x4 matrix. + /// @see gtc_type_precision + typedef lowp_f64mat4x4 lowp_f64mat4; + + + /// Medium double-qualifier floating-point 1x1 matrix. + /// @see gtc_type_precision + //typedef f64 Highp_f64mat1x1; + + /// Medium double-qualifier floating-point 2x2 matrix. + /// @see gtc_type_precision + typedef mat<2, 2, f64, mediump> mediump_f64mat2x2; + + /// Medium double-qualifier floating-point 2x3 matrix. + /// @see gtc_type_precision + typedef mat<2, 3, f64, mediump> mediump_f64mat2x3; + + /// Medium double-qualifier floating-point 2x4 matrix. + /// @see gtc_type_precision + typedef mat<2, 4, f64, mediump> mediump_f64mat2x4; + + /// Medium double-qualifier floating-point 3x2 matrix. + /// @see gtc_type_precision + typedef mat<3, 2, f64, mediump> mediump_f64mat3x2; + + /// Medium double-qualifier floating-point 3x3 matrix. + /// @see gtc_type_precision + typedef mat<3, 3, f64, mediump> mediump_f64mat3x3; + + /// Medium double-qualifier floating-point 3x4 matrix. + /// @see gtc_type_precision + typedef mat<3, 4, f64, mediump> mediump_f64mat3x4; + + /// Medium double-qualifier floating-point 4x2 matrix. + /// @see gtc_type_precision + typedef mat<4, 2, f64, mediump> mediump_f64mat4x2; + + /// Medium double-qualifier floating-point 4x3 matrix. + /// @see gtc_type_precision + typedef mat<4, 3, f64, mediump> mediump_f64mat4x3; + + /// Medium double-qualifier floating-point 4x4 matrix. + /// @see gtc_type_precision + typedef mat<4, 4, f64, mediump> mediump_f64mat4x4; + + /// Medium double-qualifier floating-point 1x1 matrix. + /// @see gtc_type_precision + //typedef mediump_f64mat1x1 mediump_f64mat1; + + /// Medium double-qualifier floating-point 2x2 matrix. + /// @see gtc_type_precision + typedef mediump_f64mat2x2 mediump_f64mat2; + + /// Medium double-qualifier floating-point 3x3 matrix. + /// @see gtc_type_precision + typedef mediump_f64mat3x3 mediump_f64mat3; + + /// Medium double-qualifier floating-point 4x4 matrix. + /// @see gtc_type_precision + typedef mediump_f64mat4x4 mediump_f64mat4; + + /// High double-qualifier floating-point 1x1 matrix. + /// @see gtc_type_precision + //typedef f64 highp_f64mat1x1; + + /// High double-qualifier floating-point 2x2 matrix. + /// @see gtc_type_precision + typedef mat<2, 2, f64, highp> highp_f64mat2x2; + + /// High double-qualifier floating-point 2x3 matrix. + /// @see gtc_type_precision + typedef mat<2, 3, f64, highp> highp_f64mat2x3; + + /// High double-qualifier floating-point 2x4 matrix. + /// @see gtc_type_precision + typedef mat<2, 4, f64, highp> highp_f64mat2x4; + + /// High double-qualifier floating-point 3x2 matrix. + /// @see gtc_type_precision + typedef mat<3, 2, f64, highp> highp_f64mat3x2; + + /// High double-qualifier floating-point 3x3 matrix. + /// @see gtc_type_precision + typedef mat<3, 3, f64, highp> highp_f64mat3x3; + + /// High double-qualifier floating-point 3x4 matrix. + /// @see gtc_type_precision + typedef mat<3, 4, f64, highp> highp_f64mat3x4; + + /// High double-qualifier floating-point 4x2 matrix. + /// @see gtc_type_precision + typedef mat<4, 2, f64, highp> highp_f64mat4x2; + + /// High double-qualifier floating-point 4x3 matrix. + /// @see gtc_type_precision + typedef mat<4, 3, f64, highp> highp_f64mat4x3; + + /// High double-qualifier floating-point 4x4 matrix. + /// @see gtc_type_precision + typedef mat<4, 4, f64, highp> highp_f64mat4x4; + + /// High double-qualifier floating-point 1x1 matrix. + /// @see gtc_type_precision + //typedef highp_f64mat1x1 highp_f64mat1; + + /// High double-qualifier floating-point 2x2 matrix. + /// @see gtc_type_precision + typedef highp_f64mat2x2 highp_f64mat2; + + /// High double-qualifier floating-point 3x3 matrix. + /// @see gtc_type_precision + typedef highp_f64mat3x3 highp_f64mat3; + + /// High double-qualifier floating-point 4x4 matrix. + /// @see gtc_type_precision + typedef highp_f64mat4x4 highp_f64mat4; + + + ///////////////////////////// + // Signed int vector types + + /// Low qualifier signed integer vector of 1 component type. + /// @see gtc_type_precision + typedef vec<1, int, lowp> lowp_ivec1; + + /// Low qualifier signed integer vector of 2 components type. + /// @see gtc_type_precision + typedef vec<2, int, lowp> lowp_ivec2; + + /// Low qualifier signed integer vector of 3 components type. + /// @see gtc_type_precision + typedef vec<3, int, lowp> lowp_ivec3; + + /// Low qualifier signed integer vector of 4 components type. + /// @see gtc_type_precision + typedef vec<4, int, lowp> lowp_ivec4; + + + /// Medium qualifier signed integer vector of 1 component type. + /// @see gtc_type_precision + typedef vec<1, int, mediump> mediump_ivec1; + + /// Medium qualifier signed integer vector of 2 components type. + /// @see gtc_type_precision + typedef vec<2, int, mediump> mediump_ivec2; + + /// Medium qualifier signed integer vector of 3 components type. + /// @see gtc_type_precision + typedef vec<3, int, mediump> mediump_ivec3; + + /// Medium qualifier signed integer vector of 4 components type. + /// @see gtc_type_precision + typedef vec<4, int, mediump> mediump_ivec4; + + + /// High qualifier signed integer vector of 1 component type. + /// @see gtc_type_precision + typedef vec<1, int, highp> highp_ivec1; + + /// High qualifier signed integer vector of 2 components type. + /// @see gtc_type_precision + typedef vec<2, int, highp> highp_ivec2; + + /// High qualifier signed integer vector of 3 components type. + /// @see gtc_type_precision + typedef vec<3, int, highp> highp_ivec3; + + /// High qualifier signed integer vector of 4 components type. + /// @see gtc_type_precision + typedef vec<4, int, highp> highp_ivec4; + + + /// Low qualifier 8 bit signed integer vector of 1 component type. + /// @see gtc_type_precision + typedef vec<1, i8, lowp> lowp_i8vec1; + + /// Low qualifier 8 bit signed integer vector of 2 components type. + /// @see gtc_type_precision + typedef vec<2, i8, lowp> lowp_i8vec2; + + /// Low qualifier 8 bit signed integer vector of 3 components type. + /// @see gtc_type_precision + typedef vec<3, i8, lowp> lowp_i8vec3; + + /// Low qualifier 8 bit signed integer vector of 4 components type. + /// @see gtc_type_precision + typedef vec<4, i8, lowp> lowp_i8vec4; + + + /// Medium qualifier 8 bit signed integer scalar type. + /// @see gtc_type_precision + typedef vec<1, i8, mediump> mediump_i8vec1; + + /// Medium qualifier 8 bit signed integer vector of 2 components type. + /// @see gtc_type_precision + typedef vec<2, i8, mediump> mediump_i8vec2; + + /// Medium qualifier 8 bit signed integer vector of 3 components type. + /// @see gtc_type_precision + typedef vec<3, i8, mediump> mediump_i8vec3; + + /// Medium qualifier 8 bit signed integer vector of 4 components type. + /// @see gtc_type_precision + typedef vec<4, i8, mediump> mediump_i8vec4; + + + /// High qualifier 8 bit signed integer scalar type. + /// @see gtc_type_precision + typedef vec<1, i8, highp> highp_i8vec1; + + /// High qualifier 8 bit signed integer vector of 2 components type. + /// @see gtc_type_precision + typedef vec<2, i8, highp> highp_i8vec2; + + /// High qualifier 8 bit signed integer vector of 3 components type. + /// @see gtc_type_precision + typedef vec<3, i8, highp> highp_i8vec3; + + /// High qualifier 8 bit signed integer vector of 4 components type. + /// @see gtc_type_precision + typedef vec<4, i8, highp> highp_i8vec4; + + + /// Low qualifier 16 bit signed integer scalar type. + /// @see gtc_type_precision + typedef vec<1, i16, lowp> lowp_i16vec1; + + /// Low qualifier 16 bit signed integer vector of 2 components type. + /// @see gtc_type_precision + typedef vec<2, i16, lowp> lowp_i16vec2; + + /// Low qualifier 16 bit signed integer vector of 3 components type. + /// @see gtc_type_precision + typedef vec<3, i16, lowp> lowp_i16vec3; + + /// Low qualifier 16 bit signed integer vector of 4 components type. + /// @see gtc_type_precision + typedef vec<4, i16, lowp> lowp_i16vec4; + + + /// Medium qualifier 16 bit signed integer scalar type. + /// @see gtc_type_precision + typedef vec<1, i16, mediump> mediump_i16vec1; + + /// Medium qualifier 16 bit signed integer vector of 2 components type. + /// @see gtc_type_precision + typedef vec<2, i16, mediump> mediump_i16vec2; + + /// Medium qualifier 16 bit signed integer vector of 3 components type. + /// @see gtc_type_precision + typedef vec<3, i16, mediump> mediump_i16vec3; + + /// Medium qualifier 16 bit signed integer vector of 4 components type. + /// @see gtc_type_precision + typedef vec<4, i16, mediump> mediump_i16vec4; + + + /// High qualifier 16 bit signed integer scalar type. + /// @see gtc_type_precision + typedef vec<1, i16, highp> highp_i16vec1; + + /// High qualifier 16 bit signed integer vector of 2 components type. + /// @see gtc_type_precision + typedef vec<2, i16, highp> highp_i16vec2; + + /// High qualifier 16 bit signed integer vector of 3 components type. + /// @see gtc_type_precision + typedef vec<3, i16, highp> highp_i16vec3; + + /// High qualifier 16 bit signed integer vector of 4 components type. + /// @see gtc_type_precision + typedef vec<4, i16, highp> highp_i16vec4; + + + /// Low qualifier 32 bit signed integer scalar type. + /// @see gtc_type_precision + typedef vec<1, i32, lowp> lowp_i32vec1; + + /// Low qualifier 32 bit signed integer vector of 2 components type. + /// @see gtc_type_precision + typedef vec<2, i32, lowp> lowp_i32vec2; + + /// Low qualifier 32 bit signed integer vector of 3 components type. + /// @see gtc_type_precision + typedef vec<3, i32, lowp> lowp_i32vec3; + + /// Low qualifier 32 bit signed integer vector of 4 components type. + /// @see gtc_type_precision + typedef vec<4, i32, lowp> lowp_i32vec4; + + + /// Medium qualifier 32 bit signed integer scalar type. + /// @see gtc_type_precision + typedef vec<1, i32, mediump> mediump_i32vec1; + + /// Medium qualifier 32 bit signed integer vector of 2 components type. + /// @see gtc_type_precision + typedef vec<2, i32, mediump> mediump_i32vec2; + + /// Medium qualifier 32 bit signed integer vector of 3 components type. + /// @see gtc_type_precision + typedef vec<3, i32, mediump> mediump_i32vec3; + + /// Medium qualifier 32 bit signed integer vector of 4 components type. + /// @see gtc_type_precision + typedef vec<4, i32, mediump> mediump_i32vec4; + + + /// High qualifier 32 bit signed integer scalar type. + /// @see gtc_type_precision + typedef vec<1, i32, highp> highp_i32vec1; + + /// High qualifier 32 bit signed integer vector of 2 components type. + /// @see gtc_type_precision + typedef vec<2, i32, highp> highp_i32vec2; + + /// High qualifier 32 bit signed integer vector of 3 components type. + /// @see gtc_type_precision + typedef vec<3, i32, highp> highp_i32vec3; + + /// High qualifier 32 bit signed integer vector of 4 components type. + /// @see gtc_type_precision + typedef vec<4, i32, highp> highp_i32vec4; + + + /// Low qualifier 64 bit signed integer scalar type. + /// @see gtc_type_precision + typedef vec<1, i64, lowp> lowp_i64vec1; + + /// Low qualifier 64 bit signed integer vector of 2 components type. + /// @see gtc_type_precision + typedef vec<2, i64, lowp> lowp_i64vec2; + + /// Low qualifier 64 bit signed integer vector of 3 components type. + /// @see gtc_type_precision + typedef vec<3, i64, lowp> lowp_i64vec3; + + /// Low qualifier 64 bit signed integer vector of 4 components type. + /// @see gtc_type_precision + typedef vec<4, i64, lowp> lowp_i64vec4; + + + /// Medium qualifier 64 bit signed integer scalar type. + /// @see gtc_type_precision + typedef vec<1, i64, mediump> mediump_i64vec1; + + /// Medium qualifier 64 bit signed integer vector of 2 components type. + /// @see gtc_type_precision + typedef vec<2, i64, mediump> mediump_i64vec2; + + /// Medium qualifier 64 bit signed integer vector of 3 components type. + /// @see gtc_type_precision + typedef vec<3, i64, mediump> mediump_i64vec3; + + /// Medium qualifier 64 bit signed integer vector of 4 components type. + /// @see gtc_type_precision + typedef vec<4, i64, mediump> mediump_i64vec4; + + + /// High qualifier 64 bit signed integer scalar type. + /// @see gtc_type_precision + typedef vec<1, i64, highp> highp_i64vec1; + + /// High qualifier 64 bit signed integer vector of 2 components type. + /// @see gtc_type_precision + typedef vec<2, i64, highp> highp_i64vec2; + + /// High qualifier 64 bit signed integer vector of 3 components type. + /// @see gtc_type_precision + typedef vec<3, i64, highp> highp_i64vec3; + + /// High qualifier 64 bit signed integer vector of 4 components type. + /// @see gtc_type_precision + typedef vec<4, i64, highp> highp_i64vec4; + + + ///////////////////////////// + // Unsigned int vector types + + /// Low qualifier unsigned integer vector of 1 component type. + /// @see gtc_type_precision + typedef vec<1, uint, lowp> lowp_uvec1; + + /// Low qualifier unsigned integer vector of 2 components type. + /// @see gtc_type_precision + typedef vec<2, uint, lowp> lowp_uvec2; + + /// Low qualifier unsigned integer vector of 3 components type. + /// @see gtc_type_precision + typedef vec<3, uint, lowp> lowp_uvec3; + + /// Low qualifier unsigned integer vector of 4 components type. + /// @see gtc_type_precision + typedef vec<4, uint, lowp> lowp_uvec4; + + + /// Medium qualifier unsigned integer vector of 1 component type. + /// @see gtc_type_precision + typedef vec<1, uint, mediump> mediump_uvec1; + + /// Medium qualifier unsigned integer vector of 2 components type. + /// @see gtc_type_precision + typedef vec<2, uint, mediump> mediump_uvec2; + + /// Medium qualifier unsigned integer vector of 3 components type. + /// @see gtc_type_precision + typedef vec<3, uint, mediump> mediump_uvec3; + + /// Medium qualifier unsigned integer vector of 4 components type. + /// @see gtc_type_precision + typedef vec<4, uint, mediump> mediump_uvec4; + + + /// High qualifier unsigned integer vector of 1 component type. + /// @see gtc_type_precision + typedef vec<1, uint, highp> highp_uvec1; + + /// High qualifier unsigned integer vector of 2 components type. + /// @see gtc_type_precision + typedef vec<2, uint, highp> highp_uvec2; + + /// High qualifier unsigned integer vector of 3 components type. + /// @see gtc_type_precision + typedef vec<3, uint, highp> highp_uvec3; + + /// High qualifier unsigned integer vector of 4 components type. + /// @see gtc_type_precision + typedef vec<4, uint, highp> highp_uvec4; + + + /// Low qualifier 8 bit unsigned integer scalar type. + /// @see gtc_type_precision + typedef vec<1, u8, lowp> lowp_u8vec1; + + /// Low qualifier 8 bit unsigned integer vector of 2 components type. + /// @see gtc_type_precision + typedef vec<2, u8, lowp> lowp_u8vec2; + + /// Low qualifier 8 bit unsigned integer vector of 3 components type. + /// @see gtc_type_precision + typedef vec<3, u8, lowp> lowp_u8vec3; + + /// Low qualifier 8 bit unsigned integer vector of 4 components type. + /// @see gtc_type_precision + typedef vec<4, u8, lowp> lowp_u8vec4; + + + /// Medium qualifier 8 bit unsigned integer scalar type. + /// @see gtc_type_precision + typedef vec<1, u8, mediump> mediump_u8vec1; + + /// Medium qualifier 8 bit unsigned integer vector of 2 components type. + /// @see gtc_type_precision + typedef vec<2, u8, mediump> mediump_u8vec2; + + /// Medium qualifier 8 bit unsigned integer vector of 3 components type. + /// @see gtc_type_precision + typedef vec<3, u8, mediump> mediump_u8vec3; + + /// Medium qualifier 8 bit unsigned integer vector of 4 components type. + /// @see gtc_type_precision + typedef vec<4, u8, mediump> mediump_u8vec4; + + + /// High qualifier 8 bit unsigned integer scalar type. + /// @see gtc_type_precision + typedef vec<1, u8, highp> highp_u8vec1; + + /// High qualifier 8 bit unsigned integer vector of 2 components type. + /// @see gtc_type_precision + typedef vec<2, u8, highp> highp_u8vec2; + + /// High qualifier 8 bit unsigned integer vector of 3 components type. + /// @see gtc_type_precision + typedef vec<3, u8, highp> highp_u8vec3; + + /// High qualifier 8 bit unsigned integer vector of 4 components type. + /// @see gtc_type_precision + typedef vec<4, u8, highp> highp_u8vec4; + + + /// Low qualifier 16 bit unsigned integer scalar type. + /// @see gtc_type_precision + typedef vec<1, u16, lowp> lowp_u16vec1; + + /// Low qualifier 16 bit unsigned integer vector of 2 components type. + /// @see gtc_type_precision + typedef vec<2, u16, lowp> lowp_u16vec2; + + /// Low qualifier 16 bit unsigned integer vector of 3 components type. + /// @see gtc_type_precision + typedef vec<3, u16, lowp> lowp_u16vec3; + + /// Low qualifier 16 bit unsigned integer vector of 4 components type. + /// @see gtc_type_precision + typedef vec<4, u16, lowp> lowp_u16vec4; + + + /// Medium qualifier 16 bit unsigned integer scalar type. + /// @see gtc_type_precision + typedef vec<1, u16, mediump> mediump_u16vec1; + + /// Medium qualifier 16 bit unsigned integer vector of 2 components type. + /// @see gtc_type_precision + typedef vec<2, u16, mediump> mediump_u16vec2; + + /// Medium qualifier 16 bit unsigned integer vector of 3 components type. + /// @see gtc_type_precision + typedef vec<3, u16, mediump> mediump_u16vec3; + + /// Medium qualifier 16 bit unsigned integer vector of 4 components type. + /// @see gtc_type_precision + typedef vec<4, u16, mediump> mediump_u16vec4; + + + /// High qualifier 16 bit unsigned integer scalar type. + /// @see gtc_type_precision + typedef vec<1, u16, highp> highp_u16vec1; + + /// High qualifier 16 bit unsigned integer vector of 2 components type. + /// @see gtc_type_precision + typedef vec<2, u16, highp> highp_u16vec2; + + /// High qualifier 16 bit unsigned integer vector of 3 components type. + /// @see gtc_type_precision + typedef vec<3, u16, highp> highp_u16vec3; + + /// High qualifier 16 bit unsigned integer vector of 4 components type. + /// @see gtc_type_precision + typedef vec<4, u16, highp> highp_u16vec4; + + + /// Low qualifier 32 bit unsigned integer scalar type. + /// @see gtc_type_precision + typedef vec<1, u32, lowp> lowp_u32vec1; + + /// Low qualifier 32 bit unsigned integer vector of 2 components type. + /// @see gtc_type_precision + typedef vec<2, u32, lowp> lowp_u32vec2; + + /// Low qualifier 32 bit unsigned integer vector of 3 components type. + /// @see gtc_type_precision + typedef vec<3, u32, lowp> lowp_u32vec3; + + /// Low qualifier 32 bit unsigned integer vector of 4 components type. + /// @see gtc_type_precision + typedef vec<4, u32, lowp> lowp_u32vec4; + + + /// Medium qualifier 32 bit unsigned integer scalar type. + /// @see gtc_type_precision + typedef vec<1, u32, mediump> mediump_u32vec1; + + /// Medium qualifier 32 bit unsigned integer vector of 2 components type. + /// @see gtc_type_precision + typedef vec<2, u32, mediump> mediump_u32vec2; + + /// Medium qualifier 32 bit unsigned integer vector of 3 components type. + /// @see gtc_type_precision + typedef vec<3, u32, mediump> mediump_u32vec3; + + /// Medium qualifier 32 bit unsigned integer vector of 4 components type. + /// @see gtc_type_precision + typedef vec<4, u32, mediump> mediump_u32vec4; + + + /// High qualifier 32 bit unsigned integer scalar type. + /// @see gtc_type_precision + typedef vec<1, u32, highp> highp_u32vec1; + + /// High qualifier 32 bit unsigned integer vector of 2 components type. + /// @see gtc_type_precision + typedef vec<2, u32, highp> highp_u32vec2; + + /// High qualifier 32 bit unsigned integer vector of 3 components type. + /// @see gtc_type_precision + typedef vec<3, u32, highp> highp_u32vec3; + + /// High qualifier 32 bit unsigned integer vector of 4 components type. + /// @see gtc_type_precision + typedef vec<4, u32, highp> highp_u32vec4; + + + /// Low qualifier 64 bit unsigned integer scalar type. + /// @see gtc_type_precision + typedef vec<1, u64, lowp> lowp_u64vec1; + + /// Low qualifier 64 bit unsigned integer vector of 2 components type. + /// @see gtc_type_precision + typedef vec<2, u64, lowp> lowp_u64vec2; + + /// Low qualifier 64 bit unsigned integer vector of 3 components type. + /// @see gtc_type_precision + typedef vec<3, u64, lowp> lowp_u64vec3; + + /// Low qualifier 64 bit unsigned integer vector of 4 components type. + /// @see gtc_type_precision + typedef vec<4, u64, lowp> lowp_u64vec4; + + + /// Medium qualifier 64 bit unsigned integer scalar type. + /// @see gtc_type_precision + typedef vec<1, u64, mediump> mediump_u64vec1; + + /// Medium qualifier 64 bit unsigned integer vector of 2 components type. + /// @see gtc_type_precision + typedef vec<2, u64, mediump> mediump_u64vec2; + + /// Medium qualifier 64 bit unsigned integer vector of 3 components type. + /// @see gtc_type_precision + typedef vec<3, u64, mediump> mediump_u64vec3; + + /// Medium qualifier 64 bit unsigned integer vector of 4 components type. + /// @see gtc_type_precision + typedef vec<4, u64, mediump> mediump_u64vec4; + + + /// High qualifier 64 bit unsigned integer scalar type. + /// @see gtc_type_precision + typedef vec<1, u64, highp> highp_u64vec1; + + /// High qualifier 64 bit unsigned integer vector of 2 components type. + /// @see gtc_type_precision + typedef vec<2, u64, highp> highp_u64vec2; + + /// High qualifier 64 bit unsigned integer vector of 3 components type. + /// @see gtc_type_precision + typedef vec<3, u64, highp> highp_u64vec3; + + /// High qualifier 64 bit unsigned integer vector of 4 components type. + /// @see gtc_type_precision + typedef vec<4, u64, highp> highp_u64vec4; + + + ////////////////////// + // Float vector types + + /// 32 bit single-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef float32 float32_t; + + /// 32 bit single-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef float32 f32; + +# ifndef GLM_FORCE_SINGLE_ONLY + + /// 64 bit double-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef float64 float64_t; + + /// 64 bit double-qualifier floating-point scalar. + /// @see gtc_type_precision + typedef float64 f64; +# endif//GLM_FORCE_SINGLE_ONLY + + /// Single-qualifier floating-point vector of 1 component. + /// @see gtc_type_precision + typedef vec<1, float, defaultp> fvec1; + + /// Single-qualifier floating-point vector of 2 components. + /// @see gtc_type_precision + typedef vec<2, float, defaultp> fvec2; + + /// Single-qualifier floating-point vector of 3 components. + /// @see gtc_type_precision + typedef vec<3, float, defaultp> fvec3; + + /// Single-qualifier floating-point vector of 4 components. + /// @see gtc_type_precision + typedef vec<4, float, defaultp> fvec4; + + + /// Single-qualifier floating-point vector of 1 component. + /// @see gtc_type_precision + typedef vec<1, f32, defaultp> f32vec1; + + /// Single-qualifier floating-point vector of 2 components. + /// @see gtc_type_precision + typedef vec<2, f32, defaultp> f32vec2; + + /// Single-qualifier floating-point vector of 3 components. + /// @see gtc_type_precision + typedef vec<3, f32, defaultp> f32vec3; + + /// Single-qualifier floating-point vector of 4 components. + /// @see gtc_type_precision + typedef vec<4, f32, defaultp> f32vec4; + +# ifndef GLM_FORCE_SINGLE_ONLY + /// Double-qualifier floating-point vector of 1 component. + /// @see gtc_type_precision + typedef vec<1, f64, defaultp> f64vec1; + + /// Double-qualifier floating-point vector of 2 components. + /// @see gtc_type_precision + typedef vec<2, f64, defaultp> f64vec2; + + /// Double-qualifier floating-point vector of 3 components. + /// @see gtc_type_precision + typedef vec<3, f64, defaultp> f64vec3; + + /// Double-qualifier floating-point vector of 4 components. + /// @see gtc_type_precision + typedef vec<4, f64, defaultp> f64vec4; +# endif//GLM_FORCE_SINGLE_ONLY + + + ////////////////////// + // Float matrix types + + /// Single-qualifier floating-point 1x1 matrix. + /// @see gtc_type_precision + //typedef detail::tmat1x1 fmat1; + + /// Single-qualifier floating-point 2x2 matrix. + /// @see gtc_type_precision + typedef mat<2, 2, f32, defaultp> fmat2; + + /// Single-qualifier floating-point 3x3 matrix. + /// @see gtc_type_precision + typedef mat<3, 3, f32, defaultp> fmat3; + + /// Single-qualifier floating-point 4x4 matrix. + /// @see gtc_type_precision + typedef mat<4, 4, f32, defaultp> fmat4; + + + /// Single-qualifier floating-point 1x1 matrix. + /// @see gtc_type_precision + //typedef f32 fmat1x1; + + /// Single-qualifier floating-point 2x2 matrix. + /// @see gtc_type_precision + typedef mat<2, 2, f32, defaultp> fmat2x2; + + /// Single-qualifier floating-point 2x3 matrix. + /// @see gtc_type_precision + typedef mat<2, 3, f32, defaultp> fmat2x3; + + /// Single-qualifier floating-point 2x4 matrix. + /// @see gtc_type_precision + typedef mat<2, 4, f32, defaultp> fmat2x4; + + /// Single-qualifier floating-point 3x2 matrix. + /// @see gtc_type_precision + typedef mat<3, 2, f32, defaultp> fmat3x2; + + /// Single-qualifier floating-point 3x3 matrix. + /// @see gtc_type_precision + typedef mat<3, 3, f32, defaultp> fmat3x3; + + /// Single-qualifier floating-point 3x4 matrix. + /// @see gtc_type_precision + typedef mat<3, 4, f32, defaultp> fmat3x4; + + /// Single-qualifier floating-point 4x2 matrix. + /// @see gtc_type_precision + typedef mat<4, 2, f32, defaultp> fmat4x2; + + /// Single-qualifier floating-point 4x3 matrix. + /// @see gtc_type_precision + typedef mat<4, 3, f32, defaultp> fmat4x3; + + /// Single-qualifier floating-point 4x4 matrix. + /// @see gtc_type_precision + typedef mat<4, 4, f32, defaultp> fmat4x4; + + + /// Single-qualifier floating-point 1x1 matrix. + /// @see gtc_type_precision + //typedef detail::tmat1x1 f32mat1; + + /// Single-qualifier floating-point 2x2 matrix. + /// @see gtc_type_precision + typedef mat<2, 2, f32, defaultp> f32mat2; + + /// Single-qualifier floating-point 3x3 matrix. + /// @see gtc_type_precision + typedef mat<3, 3, f32, defaultp> f32mat3; + + /// Single-qualifier floating-point 4x4 matrix. + /// @see gtc_type_precision + typedef mat<4, 4, f32, defaultp> f32mat4; + + + /// Single-qualifier floating-point 1x1 matrix. + /// @see gtc_type_precision + //typedef f32 f32mat1x1; + + /// Single-qualifier floating-point 2x2 matrix. + /// @see gtc_type_precision + typedef mat<2, 2, f32, defaultp> f32mat2x2; + + /// Single-qualifier floating-point 2x3 matrix. + /// @see gtc_type_precision + typedef mat<2, 3, f32, defaultp> f32mat2x3; + + /// Single-qualifier floating-point 2x4 matrix. + /// @see gtc_type_precision + typedef mat<2, 4, f32, defaultp> f32mat2x4; + + /// Single-qualifier floating-point 3x2 matrix. + /// @see gtc_type_precision + typedef mat<3, 2, f32, defaultp> f32mat3x2; + + /// Single-qualifier floating-point 3x3 matrix. + /// @see gtc_type_precision + typedef mat<3, 3, f32, defaultp> f32mat3x3; + + /// Single-qualifier floating-point 3x4 matrix. + /// @see gtc_type_precision + typedef mat<3, 4, f32, defaultp> f32mat3x4; + + /// Single-qualifier floating-point 4x2 matrix. + /// @see gtc_type_precision + typedef mat<4, 2, f32, defaultp> f32mat4x2; + + /// Single-qualifier floating-point 4x3 matrix. + /// @see gtc_type_precision + typedef mat<4, 3, f32, defaultp> f32mat4x3; + + /// Single-qualifier floating-point 4x4 matrix. + /// @see gtc_type_precision + typedef mat<4, 4, f32, defaultp> f32mat4x4; + + +# ifndef GLM_FORCE_SINGLE_ONLY + + /// Double-qualifier floating-point 1x1 matrix. + /// @see gtc_type_precision + //typedef detail::tmat1x1 f64mat1; + + /// Double-qualifier floating-point 2x2 matrix. + /// @see gtc_type_precision + typedef mat<2, 2, f64, defaultp> f64mat2; + + /// Double-qualifier floating-point 3x3 matrix. + /// @see gtc_type_precision + typedef mat<3, 3, f64, defaultp> f64mat3; + + /// Double-qualifier floating-point 4x4 matrix. + /// @see gtc_type_precision + typedef mat<4, 4, f64, defaultp> f64mat4; + + + /// Double-qualifier floating-point 1x1 matrix. + /// @see gtc_type_precision + //typedef f64 f64mat1x1; + + /// Double-qualifier floating-point 2x2 matrix. + /// @see gtc_type_precision + typedef mat<2, 2, f64, defaultp> f64mat2x2; + + /// Double-qualifier floating-point 2x3 matrix. + /// @see gtc_type_precision + typedef mat<2, 3, f64, defaultp> f64mat2x3; + + /// Double-qualifier floating-point 2x4 matrix. + /// @see gtc_type_precision + typedef mat<2, 4, f64, defaultp> f64mat2x4; + + /// Double-qualifier floating-point 3x2 matrix. + /// @see gtc_type_precision + typedef mat<3, 2, f64, defaultp> f64mat3x2; + + /// Double-qualifier floating-point 3x3 matrix. + /// @see gtc_type_precision + typedef mat<3, 3, f64, defaultp> f64mat3x3; + + /// Double-qualifier floating-point 3x4 matrix. + /// @see gtc_type_precision + typedef mat<3, 4, f64, defaultp> f64mat3x4; + + /// Double-qualifier floating-point 4x2 matrix. + /// @see gtc_type_precision + typedef mat<4, 2, f64, defaultp> f64mat4x2; + + /// Double-qualifier floating-point 4x3 matrix. + /// @see gtc_type_precision + typedef mat<4, 3, f64, defaultp> f64mat4x3; + + /// Double-qualifier floating-point 4x4 matrix. + /// @see gtc_type_precision + typedef mat<4, 4, f64, defaultp> f64mat4x4; + +# endif//GLM_FORCE_SINGLE_ONLY + + ////////////////////////// + // Quaternion types + + /// Single-qualifier floating-point quaternion. + /// @see gtc_type_precision + typedef qua f32quat; + + /// Low single-qualifier floating-point quaternion. + /// @see gtc_type_precision + typedef qua lowp_f32quat; + + /// Low double-qualifier floating-point quaternion. + /// @see gtc_type_precision + typedef qua lowp_f64quat; + + /// Medium single-qualifier floating-point quaternion. + /// @see gtc_type_precision + typedef qua mediump_f32quat; + +# ifndef GLM_FORCE_SINGLE_ONLY + + /// Medium double-qualifier floating-point quaternion. + /// @see gtc_type_precision + typedef qua mediump_f64quat; + + /// High single-qualifier floating-point quaternion. + /// @see gtc_type_precision + typedef qua highp_f32quat; + + /// High double-qualifier floating-point quaternion. + /// @see gtc_type_precision + typedef qua highp_f64quat; + + /// Double-qualifier floating-point quaternion. + /// @see gtc_type_precision + typedef qua f64quat; + +# endif//GLM_FORCE_SINGLE_ONLY + + /// @} +}//namespace glm + +#include "type_precision.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/type_precision.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/type_precision.inl new file mode 100644 index 0000000000000000000000000000000000000000..16f56c19d90e233cc58bd63c3f73c3d0bd50c09d --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/type_precision.inl @@ -0,0 +1,6 @@ +/// @ref gtc_precision + +namespace glm +{ + +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/type_ptr.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/type_ptr.hpp new file mode 100644 index 0000000000000000000000000000000000000000..18f299929424468514a29c372140fd5f58fdef5e --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/type_ptr.hpp @@ -0,0 +1,230 @@ +/// @ref gtc_type_ptr +/// @file glm/gtc/type_ptr.hpp +/// +/// @see core (dependence) +/// @see gtc_quaternion (dependence) +/// +/// @defgroup gtc_type_ptr GLM_GTC_type_ptr +/// @ingroup gtc +/// +/// Include to use the features of this extension. +/// +/// Handles the interaction between pointers and vector, matrix types. +/// +/// This extension defines an overloaded function, glm::value_ptr. It returns +/// a pointer to the memory layout of the object. Matrix types store their values +/// in column-major order. +/// +/// This is useful for uploading data to matrices or copying data to buffer objects. +/// +/// Example: +/// @code +/// #include +/// #include +/// +/// glm::vec3 aVector(3); +/// glm::mat4 someMatrix(1.0); +/// +/// glUniform3fv(uniformLoc, 1, glm::value_ptr(aVector)); +/// glUniformMatrix4fv(uniformMatrixLoc, 1, GL_FALSE, glm::value_ptr(someMatrix)); +/// @endcode +/// +/// need to be included to use the features of this extension. + +#pragma once + +// Dependency: +#include "../gtc/quaternion.hpp" +#include "../gtc/vec1.hpp" +#include "../vec2.hpp" +#include "../vec3.hpp" +#include "../vec4.hpp" +#include "../mat2x2.hpp" +#include "../mat2x3.hpp" +#include "../mat2x4.hpp" +#include "../mat3x2.hpp" +#include "../mat3x3.hpp" +#include "../mat3x4.hpp" +#include "../mat4x2.hpp" +#include "../mat4x3.hpp" +#include "../mat4x4.hpp" +#include + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_GTC_type_ptr extension included") +#endif + +namespace glm +{ + /// @addtogroup gtc_type_ptr + /// @{ + + /// Return the constant address to the data of the input parameter. + /// @see gtc_type_ptr + template + GLM_FUNC_DECL typename genType::value_type const * value_ptr(genType const& v); + + /// Build a vector from a pointer. + /// @see gtc_type_ptr + template + GLM_FUNC_DECL vec<1, T, Q> make_vec1(vec<1, T, Q> const& v); + + /// Build a vector from a pointer. + /// @see gtc_type_ptr + template + GLM_FUNC_DECL vec<1, T, Q> make_vec1(vec<2, T, Q> const& v); + + /// Build a vector from a pointer. + /// @see gtc_type_ptr + template + GLM_FUNC_DECL vec<1, T, Q> make_vec1(vec<3, T, Q> const& v); + + /// Build a vector from a pointer. + /// @see gtc_type_ptr + template + GLM_FUNC_DECL vec<1, T, Q> make_vec1(vec<4, T, Q> const& v); + + /// Build a vector from a pointer. + /// @see gtc_type_ptr + template + GLM_FUNC_DECL vec<2, T, Q> make_vec2(vec<1, T, Q> const& v); + + /// Build a vector from a pointer. + /// @see gtc_type_ptr + template + GLM_FUNC_DECL vec<2, T, Q> make_vec2(vec<2, T, Q> const& v); + + /// Build a vector from a pointer. + /// @see gtc_type_ptr + template + GLM_FUNC_DECL vec<2, T, Q> make_vec2(vec<3, T, Q> const& v); + + /// Build a vector from a pointer. + /// @see gtc_type_ptr + template + GLM_FUNC_DECL vec<2, T, Q> make_vec2(vec<4, T, Q> const& v); + + /// Build a vector from a pointer. + /// @see gtc_type_ptr + template + GLM_FUNC_DECL vec<3, T, Q> make_vec3(vec<1, T, Q> const& v); + + /// Build a vector from a pointer. + /// @see gtc_type_ptr + template + GLM_FUNC_DECL vec<3, T, Q> make_vec3(vec<2, T, Q> const& v); + + /// Build a vector from a pointer. + /// @see gtc_type_ptr + template + GLM_FUNC_DECL vec<3, T, Q> make_vec3(vec<3, T, Q> const& v); + + /// Build a vector from a pointer. + /// @see gtc_type_ptr + template + GLM_FUNC_DECL vec<3, T, Q> make_vec3(vec<4, T, Q> const& v); + + /// Build a vector from a pointer. + /// @see gtc_type_ptr + template + GLM_FUNC_DECL vec<4, T, Q> make_vec4(vec<1, T, Q> const& v); + + /// Build a vector from a pointer. + /// @see gtc_type_ptr + template + GLM_FUNC_DECL vec<4, T, Q> make_vec4(vec<2, T, Q> const& v); + + /// Build a vector from a pointer. + /// @see gtc_type_ptr + template + GLM_FUNC_DECL vec<4, T, Q> make_vec4(vec<3, T, Q> const& v); + + /// Build a vector from a pointer. + /// @see gtc_type_ptr + template + GLM_FUNC_DECL vec<4, T, Q> make_vec4(vec<4, T, Q> const& v); + + /// Build a vector from a pointer. + /// @see gtc_type_ptr + template + GLM_FUNC_DECL vec<2, T, defaultp> make_vec2(T const * const ptr); + + /// Build a vector from a pointer. + /// @see gtc_type_ptr + template + GLM_FUNC_DECL vec<3, T, defaultp> make_vec3(T const * const ptr); + + /// Build a vector from a pointer. + /// @see gtc_type_ptr + template + GLM_FUNC_DECL vec<4, T, defaultp> make_vec4(T const * const ptr); + + /// Build a matrix from a pointer. + /// @see gtc_type_ptr + template + GLM_FUNC_DECL mat<2, 2, T, defaultp> make_mat2x2(T const * const ptr); + + /// Build a matrix from a pointer. + /// @see gtc_type_ptr + template + GLM_FUNC_DECL mat<2, 3, T, defaultp> make_mat2x3(T const * const ptr); + + /// Build a matrix from a pointer. + /// @see gtc_type_ptr + template + GLM_FUNC_DECL mat<2, 4, T, defaultp> make_mat2x4(T const * const ptr); + + /// Build a matrix from a pointer. + /// @see gtc_type_ptr + template + GLM_FUNC_DECL mat<3, 2, T, defaultp> make_mat3x2(T const * const ptr); + + /// Build a matrix from a pointer. + /// @see gtc_type_ptr + template + GLM_FUNC_DECL mat<3, 3, T, defaultp> make_mat3x3(T const * const ptr); + + /// Build a matrix from a pointer. + /// @see gtc_type_ptr + template + GLM_FUNC_DECL mat<3, 4, T, defaultp> make_mat3x4(T const * const ptr); + + /// Build a matrix from a pointer. + /// @see gtc_type_ptr + template + GLM_FUNC_DECL mat<4, 2, T, defaultp> make_mat4x2(T const * const ptr); + + /// Build a matrix from a pointer. + /// @see gtc_type_ptr + template + GLM_FUNC_DECL mat<4, 3, T, defaultp> make_mat4x3(T const * const ptr); + + /// Build a matrix from a pointer. + /// @see gtc_type_ptr + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> make_mat4x4(T const * const ptr); + + /// Build a matrix from a pointer. + /// @see gtc_type_ptr + template + GLM_FUNC_DECL mat<2, 2, T, defaultp> make_mat2(T const * const ptr); + + /// Build a matrix from a pointer. + /// @see gtc_type_ptr + template + GLM_FUNC_DECL mat<3, 3, T, defaultp> make_mat3(T const * const ptr); + + /// Build a matrix from a pointer. + /// @see gtc_type_ptr + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> make_mat4(T const * const ptr); + + /// Build a quaternion from a pointer. + /// @see gtc_type_ptr + template + GLM_FUNC_DECL qua make_quat(T const * const ptr); + + /// @} +}//namespace glm + +#include "type_ptr.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/type_ptr.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/type_ptr.inl new file mode 100644 index 0000000000000000000000000000000000000000..b8fc4a6ddbd99c91343dcd3fd20aea89ebd8c9af --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/type_ptr.inl @@ -0,0 +1,386 @@ +/// @ref gtc_type_ptr + +#include + +namespace glm +{ + /// @addtogroup gtc_type_ptr + /// @{ + + template + GLM_FUNC_QUALIFIER T const* value_ptr(vec<2, T, Q> const& v) + { + return &(v.x); + } + + template + GLM_FUNC_QUALIFIER T* value_ptr(vec<2, T, Q>& v) + { + return &(v.x); + } + + template + GLM_FUNC_QUALIFIER T const * value_ptr(vec<3, T, Q> const& v) + { + return &(v.x); + } + + template + GLM_FUNC_QUALIFIER T* value_ptr(vec<3, T, Q>& v) + { + return &(v.x); + } + + template + GLM_FUNC_QUALIFIER T const* value_ptr(vec<4, T, Q> const& v) + { + return &(v.x); + } + + template + GLM_FUNC_QUALIFIER T* value_ptr(vec<4, T, Q>& v) + { + return &(v.x); + } + + template + GLM_FUNC_QUALIFIER T const* value_ptr(mat<2, 2, T, Q> const& m) + { + return &(m[0].x); + } + + template + GLM_FUNC_QUALIFIER T* value_ptr(mat<2, 2, T, Q>& m) + { + return &(m[0].x); + } + + template + GLM_FUNC_QUALIFIER T const* value_ptr(mat<3, 3, T, Q> const& m) + { + return &(m[0].x); + } + + template + GLM_FUNC_QUALIFIER T* value_ptr(mat<3, 3, T, Q>& m) + { + return &(m[0].x); + } + + template + GLM_FUNC_QUALIFIER T const* value_ptr(mat<4, 4, T, Q> const& m) + { + return &(m[0].x); + } + + template + GLM_FUNC_QUALIFIER T* value_ptr(mat<4, 4, T, Q>& m) + { + return &(m[0].x); + } + + template + GLM_FUNC_QUALIFIER T const* value_ptr(mat<2, 3, T, Q> const& m) + { + return &(m[0].x); + } + + template + GLM_FUNC_QUALIFIER T* value_ptr(mat<2, 3, T, Q>& m) + { + return &(m[0].x); + } + + template + GLM_FUNC_QUALIFIER T const* value_ptr(mat<3, 2, T, Q> const& m) + { + return &(m[0].x); + } + + template + GLM_FUNC_QUALIFIER T* value_ptr(mat<3, 2, T, Q>& m) + { + return &(m[0].x); + } + + template + GLM_FUNC_QUALIFIER T const* value_ptr(mat<2, 4, T, Q> const& m) + { + return &(m[0].x); + } + + template + GLM_FUNC_QUALIFIER T* value_ptr(mat<2, 4, T, Q>& m) + { + return &(m[0].x); + } + + template + GLM_FUNC_QUALIFIER T const* value_ptr(mat<4, 2, T, Q> const& m) + { + return &(m[0].x); + } + + template + GLM_FUNC_QUALIFIER T* value_ptr(mat<4, 2, T, Q>& m) + { + return &(m[0].x); + } + + template + GLM_FUNC_QUALIFIER T const* value_ptr(mat<3, 4, T, Q> const& m) + { + return &(m[0].x); + } + + template + GLM_FUNC_QUALIFIER T* value_ptr(mat<3, 4, T, Q>& m) + { + return &(m[0].x); + } + + template + GLM_FUNC_QUALIFIER T const* value_ptr(mat<4, 3, T, Q> const& m) + { + return &(m[0].x); + } + + template + GLM_FUNC_QUALIFIER T * value_ptr(mat<4, 3, T, Q>& m) + { + return &(m[0].x); + } + + template + GLM_FUNC_QUALIFIER T const * value_ptr(qua const& q) + { + return &(q[0]); + } + + template + GLM_FUNC_QUALIFIER T* value_ptr(qua& q) + { + return &(q[0]); + } + + template + GLM_FUNC_DECL vec<1, T, Q> make_vec1(vec<1, T, Q> const& v) + { + return v; + } + + template + GLM_FUNC_DECL vec<1, T, Q> make_vec1(vec<2, T, Q> const& v) + { + return vec<1, T, Q>(v); + } + + template + GLM_FUNC_DECL vec<1, T, Q> make_vec1(vec<3, T, Q> const& v) + { + return vec<1, T, Q>(v); + } + + template + GLM_FUNC_DECL vec<1, T, Q> make_vec1(vec<4, T, Q> const& v) + { + return vec<1, T, Q>(v); + } + + template + GLM_FUNC_DECL vec<2, T, Q> make_vec2(vec<1, T, Q> const& v) + { + return vec<2, T, Q>(v.x, static_cast(0)); + } + + template + GLM_FUNC_DECL vec<2, T, Q> make_vec2(vec<2, T, Q> const& v) + { + return v; + } + + template + GLM_FUNC_DECL vec<2, T, Q> make_vec2(vec<3, T, Q> const& v) + { + return vec<2, T, Q>(v); + } + + template + GLM_FUNC_DECL vec<2, T, Q> make_vec2(vec<4, T, Q> const& v) + { + return vec<2, T, Q>(v); + } + + template + GLM_FUNC_DECL vec<3, T, Q> make_vec3(vec<1, T, Q> const& v) + { + return vec<3, T, Q>(v.x, static_cast(0), static_cast(0)); + } + + template + GLM_FUNC_DECL vec<3, T, Q> make_vec3(vec<2, T, Q> const& v) + { + return vec<3, T, Q>(v.x, v.y, static_cast(0)); + } + + template + GLM_FUNC_DECL vec<3, T, Q> make_vec3(vec<3, T, Q> const& v) + { + return v; + } + + template + GLM_FUNC_DECL vec<3, T, Q> make_vec3(vec<4, T, Q> const& v) + { + return vec<3, T, Q>(v); + } + + template + GLM_FUNC_DECL vec<4, T, Q> make_vec4(vec<1, T, Q> const& v) + { + return vec<4, T, Q>(v.x, static_cast(0), static_cast(0), static_cast(1)); + } + + template + GLM_FUNC_DECL vec<4, T, Q> make_vec4(vec<2, T, Q> const& v) + { + return vec<4, T, Q>(v.x, v.y, static_cast(0), static_cast(1)); + } + + template + GLM_FUNC_DECL vec<4, T, Q> make_vec4(vec<3, T, Q> const& v) + { + return vec<4, T, Q>(v.x, v.y, v.z, static_cast(1)); + } + + template + GLM_FUNC_DECL vec<4, T, Q> make_vec4(vec<4, T, Q> const& v) + { + return v; + } + + template + GLM_FUNC_QUALIFIER vec<2, T, defaultp> make_vec2(T const *const ptr) + { + vec<2, T, defaultp> Result; + memcpy(value_ptr(Result), ptr, sizeof(vec<2, T, defaultp>)); + return Result; + } + + template + GLM_FUNC_QUALIFIER vec<3, T, defaultp> make_vec3(T const *const ptr) + { + vec<3, T, defaultp> Result; + memcpy(value_ptr(Result), ptr, sizeof(vec<3, T, defaultp>)); + return Result; + } + + template + GLM_FUNC_QUALIFIER vec<4, T, defaultp> make_vec4(T const *const ptr) + { + vec<4, T, defaultp> Result; + memcpy(value_ptr(Result), ptr, sizeof(vec<4, T, defaultp>)); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<2, 2, T, defaultp> make_mat2x2(T const *const ptr) + { + mat<2, 2, T, defaultp> Result; + memcpy(value_ptr(Result), ptr, sizeof(mat<2, 2, T, defaultp>)); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<2, 3, T, defaultp> make_mat2x3(T const *const ptr) + { + mat<2, 3, T, defaultp> Result; + memcpy(value_ptr(Result), ptr, sizeof(mat<2, 3, T, defaultp>)); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<2, 4, T, defaultp> make_mat2x4(T const *const ptr) + { + mat<2, 4, T, defaultp> Result; + memcpy(value_ptr(Result), ptr, sizeof(mat<2, 4, T, defaultp>)); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<3, 2, T, defaultp> make_mat3x2(T const *const ptr) + { + mat<3, 2, T, defaultp> Result; + memcpy(value_ptr(Result), ptr, sizeof(mat<3, 2, T, defaultp>)); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<3, 3, T, defaultp> make_mat3x3(T const *const ptr) + { + mat<3, 3, T, defaultp> Result; + memcpy(value_ptr(Result), ptr, sizeof(mat<3, 3, T, defaultp>)); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<3, 4, T, defaultp> make_mat3x4(T const *const ptr) + { + mat<3, 4, T, defaultp> Result; + memcpy(value_ptr(Result), ptr, sizeof(mat<3, 4, T, defaultp>)); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 2, T, defaultp> make_mat4x2(T const *const ptr) + { + mat<4, 2, T, defaultp> Result; + memcpy(value_ptr(Result), ptr, sizeof(mat<4, 2, T, defaultp>)); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 3, T, defaultp> make_mat4x3(T const *const ptr) + { + mat<4, 3, T, defaultp> Result; + memcpy(value_ptr(Result), ptr, sizeof(mat<4, 3, T, defaultp>)); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> make_mat4x4(T const *const ptr) + { + mat<4, 4, T, defaultp> Result; + memcpy(value_ptr(Result), ptr, sizeof(mat<4, 4, T, defaultp>)); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<2, 2, T, defaultp> make_mat2(T const *const ptr) + { + return make_mat2x2(ptr); + } + + template + GLM_FUNC_QUALIFIER mat<3, 3, T, defaultp> make_mat3(T const *const ptr) + { + return make_mat3x3(ptr); + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> make_mat4(T const *const ptr) + { + return make_mat4x4(ptr); + } + + template + GLM_FUNC_QUALIFIER qua make_quat(T const *const ptr) + { + qua Result; + memcpy(value_ptr(Result), ptr, sizeof(qua)); + return Result; + } + + /// @} +}//namespace glm + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/ulp.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/ulp.hpp new file mode 100644 index 0000000000000000000000000000000000000000..1769ce1e5fff029d8976e9d4022abc5470942f30 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/ulp.hpp @@ -0,0 +1,155 @@ +/// @ref gtc_ulp +/// @file glm/gtc/ulp.hpp +/// +/// @see core (dependence) +/// +/// @defgroup gtc_ulp GLM_GTC_ulp +/// @ingroup gtc +/// +/// Include to use the features of this extension. +/// +/// Allow the measurement of the accuracy of a function against a reference +/// implementation. This extension works on floating-point data and provide results +/// in ULP. + +#pragma once + +// Dependencies +#include "../detail/setup.hpp" +#include "../detail/qualifier.hpp" +#include "../detail/_vectorize.hpp" +#include "../ext/scalar_int_sized.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_GTC_ulp extension included") +#endif + +namespace glm +{ + /// @addtogroup gtc_ulp + /// @{ + + /// Return the next ULP value(s) after the input value(s). + /// + /// @tparam genType A floating-point scalar type. + /// + /// @see gtc_ulp + template + GLM_FUNC_DECL genType next_float(genType x); + + /// Return the previous ULP value(s) before the input value(s). + /// + /// @tparam genType A floating-point scalar type. + /// + /// @see gtc_ulp + template + GLM_FUNC_DECL genType prev_float(genType x); + + /// Return the value(s) ULP distance after the input value(s). + /// + /// @tparam genType A floating-point scalar type. + /// + /// @see gtc_ulp + template + GLM_FUNC_DECL genType next_float(genType x, int ULPs); + + /// Return the value(s) ULP distance before the input value(s). + /// + /// @tparam genType A floating-point scalar type. + /// + /// @see gtc_ulp + template + GLM_FUNC_DECL genType prev_float(genType x, int ULPs); + + /// Return the distance in the number of ULP between 2 single-precision floating-point scalars. + /// + /// @see gtc_ulp + GLM_FUNC_DECL int float_distance(float x, float y); + + /// Return the distance in the number of ULP between 2 double-precision floating-point scalars. + /// + /// @see gtc_ulp + GLM_FUNC_DECL int64 float_distance(double x, double y); + + /// Return the next ULP value(s) after the input value(s). + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point + /// @tparam Q Value from qualifier enum + /// + /// @see gtc_ulp + template + GLM_FUNC_DECL vec next_float(vec const& x); + + /// Return the value(s) ULP distance after the input value(s). + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point + /// @tparam Q Value from qualifier enum + /// + /// @see gtc_ulp + template + GLM_FUNC_DECL vec next_float(vec const& x, int ULPs); + + /// Return the value(s) ULP distance after the input value(s). + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point + /// @tparam Q Value from qualifier enum + /// + /// @see gtc_ulp + template + GLM_FUNC_DECL vec next_float(vec const& x, vec const& ULPs); + + /// Return the previous ULP value(s) before the input value(s). + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point + /// @tparam Q Value from qualifier enum + /// + /// @see gtc_ulp + template + GLM_FUNC_DECL vec prev_float(vec const& x); + + /// Return the value(s) ULP distance before the input value(s). + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point + /// @tparam Q Value from qualifier enum + /// + /// @see gtc_ulp + template + GLM_FUNC_DECL vec prev_float(vec const& x, int ULPs); + + /// Return the value(s) ULP distance before the input value(s). + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point + /// @tparam Q Value from qualifier enum + /// + /// @see gtc_ulp + template + GLM_FUNC_DECL vec prev_float(vec const& x, vec const& ULPs); + + /// Return the distance in the number of ULP between 2 single-precision floating-point scalars. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam Q Value from qualifier enum + /// + /// @see gtc_ulp + template + GLM_FUNC_DECL vec float_distance(vec const& x, vec const& y); + + /// Return the distance in the number of ULP between 2 double-precision floating-point scalars. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam Q Value from qualifier enum + /// + /// @see gtc_ulp + template + GLM_FUNC_DECL vec float_distance(vec const& x, vec const& y); + + /// @} +}//namespace glm + +#include "ulp.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/ulp.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/ulp.inl new file mode 100644 index 0000000000000000000000000000000000000000..5fef5b20d61b096ce61d87d7bb6d7318cb9e5fb4 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/ulp.inl @@ -0,0 +1,173 @@ +/// @ref gtc_ulp + +#include "../ext/scalar_ulp.hpp" + +namespace glm +{ + template<> + GLM_FUNC_QUALIFIER float next_float(float x) + { +# if GLM_HAS_CXX11_STL + return std::nextafter(x, std::numeric_limits::max()); +# elif((GLM_COMPILER & GLM_COMPILER_VC) || ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_PLATFORM & GLM_PLATFORM_WINDOWS))) + return detail::nextafterf(x, FLT_MAX); +# elif(GLM_PLATFORM & GLM_PLATFORM_ANDROID) + return __builtin_nextafterf(x, FLT_MAX); +# else + return nextafterf(x, FLT_MAX); +# endif + } + + template<> + GLM_FUNC_QUALIFIER double next_float(double x) + { +# if GLM_HAS_CXX11_STL + return std::nextafter(x, std::numeric_limits::max()); +# elif((GLM_COMPILER & GLM_COMPILER_VC) || ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_PLATFORM & GLM_PLATFORM_WINDOWS))) + return detail::nextafter(x, std::numeric_limits::max()); +# elif(GLM_PLATFORM & GLM_PLATFORM_ANDROID) + return __builtin_nextafter(x, DBL_MAX); +# else + return nextafter(x, DBL_MAX); +# endif + } + + template + GLM_FUNC_QUALIFIER T next_float(T x, int ULPs) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'next_float' only accept floating-point input"); + assert(ULPs >= 0); + + T temp = x; + for (int i = 0; i < ULPs; ++i) + temp = next_float(temp); + return temp; + } + + GLM_FUNC_QUALIFIER float prev_float(float x) + { +# if GLM_HAS_CXX11_STL + return std::nextafter(x, std::numeric_limits::min()); +# elif((GLM_COMPILER & GLM_COMPILER_VC) || ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_PLATFORM & GLM_PLATFORM_WINDOWS))) + return detail::nextafterf(x, FLT_MIN); +# elif(GLM_PLATFORM & GLM_PLATFORM_ANDROID) + return __builtin_nextafterf(x, FLT_MIN); +# else + return nextafterf(x, FLT_MIN); +# endif + } + + GLM_FUNC_QUALIFIER double prev_float(double x) + { +# if GLM_HAS_CXX11_STL + return std::nextafter(x, std::numeric_limits::min()); +# elif((GLM_COMPILER & GLM_COMPILER_VC) || ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_PLATFORM & GLM_PLATFORM_WINDOWS))) + return _nextafter(x, DBL_MIN); +# elif(GLM_PLATFORM & GLM_PLATFORM_ANDROID) + return __builtin_nextafter(x, DBL_MIN); +# else + return nextafter(x, DBL_MIN); +# endif + } + + template + GLM_FUNC_QUALIFIER T prev_float(T x, int ULPs) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'prev_float' only accept floating-point input"); + assert(ULPs >= 0); + + T temp = x; + for (int i = 0; i < ULPs; ++i) + temp = prev_float(temp); + return temp; + } + + GLM_FUNC_QUALIFIER int float_distance(float x, float y) + { + detail::float_t const a(x); + detail::float_t const b(y); + + return abs(a.i - b.i); + } + + GLM_FUNC_QUALIFIER int64 float_distance(double x, double y) + { + detail::float_t const a(x); + detail::float_t const b(y); + + return abs(a.i - b.i); + } + + template + GLM_FUNC_QUALIFIER vec next_float(vec const& x) + { + vec Result; + for (length_t i = 0, n = Result.length(); i < n; ++i) + Result[i] = next_float(x[i]); + return Result; + } + + template + GLM_FUNC_QUALIFIER vec next_float(vec const& x, int ULPs) + { + vec Result; + for (length_t i = 0, n = Result.length(); i < n; ++i) + Result[i] = next_float(x[i], ULPs); + return Result; + } + + template + GLM_FUNC_QUALIFIER vec next_float(vec const& x, vec const& ULPs) + { + vec Result; + for (length_t i = 0, n = Result.length(); i < n; ++i) + Result[i] = next_float(x[i], ULPs[i]); + return Result; + } + + template + GLM_FUNC_QUALIFIER vec prev_float(vec const& x) + { + vec Result; + for (length_t i = 0, n = Result.length(); i < n; ++i) + Result[i] = prev_float(x[i]); + return Result; + } + + template + GLM_FUNC_QUALIFIER vec prev_float(vec const& x, int ULPs) + { + vec Result; + for (length_t i = 0, n = Result.length(); i < n; ++i) + Result[i] = prev_float(x[i], ULPs); + return Result; + } + + template + GLM_FUNC_QUALIFIER vec prev_float(vec const& x, vec const& ULPs) + { + vec Result; + for (length_t i = 0, n = Result.length(); i < n; ++i) + Result[i] = prev_float(x[i], ULPs[i]); + return Result; + } + + template + GLM_FUNC_QUALIFIER vec float_distance(vec const& x, vec const& y) + { + vec Result; + for (length_t i = 0, n = Result.length(); i < n; ++i) + Result[i] = float_distance(x[i], y[i]); + return Result; + } + + template + GLM_FUNC_QUALIFIER vec float_distance(vec const& x, vec const& y) + { + vec Result; + for (length_t i = 0, n = Result.length(); i < n; ++i) + Result[i] = float_distance(x[i], y[i]); + return Result; + } +}//namespace glm + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/vec1.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/vec1.hpp new file mode 100644 index 0000000000000000000000000000000000000000..3464671a260f4651908a87e671ea4606a861b0f3 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtc/vec1.hpp @@ -0,0 +1,30 @@ +/// @ref gtc_vec1 +/// @file glm/gtc/vec1.hpp +/// +/// @see core (dependence) +/// +/// @defgroup gtc_vec1 GLM_GTC_vec1 +/// @ingroup gtc +/// +/// Include to use the features of this extension. +/// +/// Add vec1, ivec1, uvec1 and bvec1 types. + +#pragma once + +// Dependency: +#include "../ext/vector_bool1.hpp" +#include "../ext/vector_bool1_precision.hpp" +#include "../ext/vector_float1.hpp" +#include "../ext/vector_float1_precision.hpp" +#include "../ext/vector_double1.hpp" +#include "../ext/vector_double1_precision.hpp" +#include "../ext/vector_int1.hpp" +#include "../ext/vector_int1_sized.hpp" +#include "../ext/vector_uint1.hpp" +#include "../ext/vector_uint1_sized.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# pragma message("GLM: GLM_GTC_vec1 extension included") +#endif + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/associated_min_max.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/associated_min_max.hpp new file mode 100644 index 0000000000000000000000000000000000000000..946b9a056dba28db7124e5c0d2b7c035cd55b4bd --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/associated_min_max.hpp @@ -0,0 +1,207 @@ +/// @ref gtx_associated_min_max +/// @file glm/gtx/associated_min_max.hpp +/// +/// @see core (dependence) +/// @see gtx_extented_min_max (dependence) +/// +/// @defgroup gtx_associated_min_max GLM_GTX_associated_min_max +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// @brief Min and max functions that return associated values not the compared ones. + +#pragma once + +// Dependency: +#include "../glm.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_associated_min_max is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_associated_min_max extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_associated_min_max + /// @{ + + /// Minimum comparison between 2 variables and returns 2 associated variable values + /// @see gtx_associated_min_max + template + GLM_FUNC_DECL U associatedMin(T x, U a, T y, U b); + + /// Minimum comparison between 2 variables and returns 2 associated variable values + /// @see gtx_associated_min_max + template + GLM_FUNC_DECL vec associatedMin( + vec const& x, vec const& a, + vec const& y, vec const& b); + + /// Minimum comparison between 2 variables and returns 2 associated variable values + /// @see gtx_associated_min_max + template + GLM_FUNC_DECL vec associatedMin( + T x, const vec& a, + T y, const vec& b); + + /// Minimum comparison between 2 variables and returns 2 associated variable values + /// @see gtx_associated_min_max + template + GLM_FUNC_DECL vec associatedMin( + vec const& x, U a, + vec const& y, U b); + + /// Minimum comparison between 3 variables and returns 3 associated variable values + /// @see gtx_associated_min_max + template + GLM_FUNC_DECL U associatedMin( + T x, U a, + T y, U b, + T z, U c); + + /// Minimum comparison between 3 variables and returns 3 associated variable values + /// @see gtx_associated_min_max + template + GLM_FUNC_DECL vec associatedMin( + vec const& x, vec const& a, + vec const& y, vec const& b, + vec const& z, vec const& c); + + /// Minimum comparison between 4 variables and returns 4 associated variable values + /// @see gtx_associated_min_max + template + GLM_FUNC_DECL U associatedMin( + T x, U a, + T y, U b, + T z, U c, + T w, U d); + + /// Minimum comparison between 4 variables and returns 4 associated variable values + /// @see gtx_associated_min_max + template + GLM_FUNC_DECL vec associatedMin( + vec const& x, vec const& a, + vec const& y, vec const& b, + vec const& z, vec const& c, + vec const& w, vec const& d); + + /// Minimum comparison between 4 variables and returns 4 associated variable values + /// @see gtx_associated_min_max + template + GLM_FUNC_DECL vec associatedMin( + T x, vec const& a, + T y, vec const& b, + T z, vec const& c, + T w, vec const& d); + + /// Minimum comparison between 4 variables and returns 4 associated variable values + /// @see gtx_associated_min_max + template + GLM_FUNC_DECL vec associatedMin( + vec const& x, U a, + vec const& y, U b, + vec const& z, U c, + vec const& w, U d); + + /// Maximum comparison between 2 variables and returns 2 associated variable values + /// @see gtx_associated_min_max + template + GLM_FUNC_DECL U associatedMax(T x, U a, T y, U b); + + /// Maximum comparison between 2 variables and returns 2 associated variable values + /// @see gtx_associated_min_max + template + GLM_FUNC_DECL vec associatedMax( + vec const& x, vec const& a, + vec const& y, vec const& b); + + /// Maximum comparison between 2 variables and returns 2 associated variable values + /// @see gtx_associated_min_max + template + GLM_FUNC_DECL vec associatedMax( + T x, vec const& a, + T y, vec const& b); + + /// Maximum comparison between 2 variables and returns 2 associated variable values + /// @see gtx_associated_min_max + template + GLM_FUNC_DECL vec associatedMax( + vec const& x, U a, + vec const& y, U b); + + /// Maximum comparison between 3 variables and returns 3 associated variable values + /// @see gtx_associated_min_max + template + GLM_FUNC_DECL U associatedMax( + T x, U a, + T y, U b, + T z, U c); + + /// Maximum comparison between 3 variables and returns 3 associated variable values + /// @see gtx_associated_min_max + template + GLM_FUNC_DECL vec associatedMax( + vec const& x, vec const& a, + vec const& y, vec const& b, + vec const& z, vec const& c); + + /// Maximum comparison between 3 variables and returns 3 associated variable values + /// @see gtx_associated_min_max + template + GLM_FUNC_DECL vec associatedMax( + T x, vec const& a, + T y, vec const& b, + T z, vec const& c); + + /// Maximum comparison between 3 variables and returns 3 associated variable values + /// @see gtx_associated_min_max + template + GLM_FUNC_DECL vec associatedMax( + vec const& x, U a, + vec const& y, U b, + vec const& z, U c); + + /// Maximum comparison between 4 variables and returns 4 associated variable values + /// @see gtx_associated_min_max + template + GLM_FUNC_DECL U associatedMax( + T x, U a, + T y, U b, + T z, U c, + T w, U d); + + /// Maximum comparison between 4 variables and returns 4 associated variable values + /// @see gtx_associated_min_max + template + GLM_FUNC_DECL vec associatedMax( + vec const& x, vec const& a, + vec const& y, vec const& b, + vec const& z, vec const& c, + vec const& w, vec const& d); + + /// Maximum comparison between 4 variables and returns 4 associated variable values + /// @see gtx_associated_min_max + template + GLM_FUNC_DECL vec associatedMax( + T x, vec const& a, + T y, vec const& b, + T z, vec const& c, + T w, vec const& d); + + /// Maximum comparison between 4 variables and returns 4 associated variable values + /// @see gtx_associated_min_max + template + GLM_FUNC_DECL vec associatedMax( + vec const& x, U a, + vec const& y, U b, + vec const& z, U c, + vec const& w, U d); + + /// @} +} //namespace glm + +#include "associated_min_max.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/associated_min_max.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/associated_min_max.inl new file mode 100644 index 0000000000000000000000000000000000000000..bdf47e752532ad6afc9c3d7ee2dc3566b0003740 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/associated_min_max.inl @@ -0,0 +1,354 @@ +/// @ref gtx_associated_min_max + +namespace glm{ + +// Min comparison between 2 variables +template +GLM_FUNC_QUALIFIER U associatedMin(T x, U a, T y, U b) +{ + return x < y ? a : b; +} + +template +GLM_FUNC_QUALIFIER vec associatedMin +( + vec const& x, vec const& a, + vec const& y, vec const& b +) +{ + vec Result; + for(length_t i = 0, n = Result.length(); i < n; ++i) + Result[i] = x[i] < y[i] ? a[i] : b[i]; + return Result; +} + +template +GLM_FUNC_QUALIFIER vec associatedMin +( + T x, const vec& a, + T y, const vec& b +) +{ + vec Result; + for(length_t i = 0, n = Result.length(); i < n; ++i) + Result[i] = x < y ? a[i] : b[i]; + return Result; +} + +template +GLM_FUNC_QUALIFIER vec associatedMin +( + vec const& x, U a, + vec const& y, U b +) +{ + vec Result; + for(length_t i = 0, n = Result.length(); i < n; ++i) + Result[i] = x[i] < y[i] ? a : b; + return Result; +} + +// Min comparison between 3 variables +template +GLM_FUNC_QUALIFIER U associatedMin +( + T x, U a, + T y, U b, + T z, U c +) +{ + U Result = x < y ? (x < z ? a : c) : (y < z ? b : c); + return Result; +} + +template +GLM_FUNC_QUALIFIER vec associatedMin +( + vec const& x, vec const& a, + vec const& y, vec const& b, + vec const& z, vec const& c +) +{ + vec Result; + for(length_t i = 0, n = Result.length(); i < n; ++i) + Result[i] = x[i] < y[i] ? (x[i] < z[i] ? a[i] : c[i]) : (y[i] < z[i] ? b[i] : c[i]); + return Result; +} + +// Min comparison between 4 variables +template +GLM_FUNC_QUALIFIER U associatedMin +( + T x, U a, + T y, U b, + T z, U c, + T w, U d +) +{ + T Test1 = min(x, y); + T Test2 = min(z, w); + U Result1 = x < y ? a : b; + U Result2 = z < w ? c : d; + U Result = Test1 < Test2 ? Result1 : Result2; + return Result; +} + +// Min comparison between 4 variables +template +GLM_FUNC_QUALIFIER vec associatedMin +( + vec const& x, vec const& a, + vec const& y, vec const& b, + vec const& z, vec const& c, + vec const& w, vec const& d +) +{ + vec Result; + for(length_t i = 0, n = Result.length(); i < n; ++i) + { + T Test1 = min(x[i], y[i]); + T Test2 = min(z[i], w[i]); + U Result1 = x[i] < y[i] ? a[i] : b[i]; + U Result2 = z[i] < w[i] ? c[i] : d[i]; + Result[i] = Test1 < Test2 ? Result1 : Result2; + } + return Result; +} + +// Min comparison between 4 variables +template +GLM_FUNC_QUALIFIER vec associatedMin +( + T x, vec const& a, + T y, vec const& b, + T z, vec const& c, + T w, vec const& d +) +{ + T Test1 = min(x, y); + T Test2 = min(z, w); + + vec Result; + for(length_t i = 0, n = Result.length(); i < n; ++i) + { + U Result1 = x < y ? a[i] : b[i]; + U Result2 = z < w ? c[i] : d[i]; + Result[i] = Test1 < Test2 ? Result1 : Result2; + } + return Result; +} + +// Min comparison between 4 variables +template +GLM_FUNC_QUALIFIER vec associatedMin +( + vec const& x, U a, + vec const& y, U b, + vec const& z, U c, + vec const& w, U d +) +{ + vec Result; + for(length_t i = 0, n = Result.length(); i < n; ++i) + { + T Test1 = min(x[i], y[i]); + T Test2 = min(z[i], w[i]); + U Result1 = x[i] < y[i] ? a : b; + U Result2 = z[i] < w[i] ? c : d; + Result[i] = Test1 < Test2 ? Result1 : Result2; + } + return Result; +} + +// Max comparison between 2 variables +template +GLM_FUNC_QUALIFIER U associatedMax(T x, U a, T y, U b) +{ + return x > y ? a : b; +} + +// Max comparison between 2 variables +template +GLM_FUNC_QUALIFIER vec associatedMax +( + vec const& x, vec const& a, + vec const& y, vec const& b +) +{ + vec Result; + for(length_t i = 0, n = Result.length(); i < n; ++i) + Result[i] = x[i] > y[i] ? a[i] : b[i]; + return Result; +} + +// Max comparison between 2 variables +template +GLM_FUNC_QUALIFIER vec associatedMax +( + T x, vec const& a, + T y, vec const& b +) +{ + vec Result; + for(length_t i = 0, n = Result.length(); i < n; ++i) + Result[i] = x > y ? a[i] : b[i]; + return Result; +} + +// Max comparison between 2 variables +template +GLM_FUNC_QUALIFIER vec associatedMax +( + vec const& x, U a, + vec const& y, U b +) +{ + vec Result; + for(length_t i = 0, n = Result.length(); i < n; ++i) + Result[i] = x[i] > y[i] ? a : b; + return Result; +} + +// Max comparison between 3 variables +template +GLM_FUNC_QUALIFIER U associatedMax +( + T x, U a, + T y, U b, + T z, U c +) +{ + U Result = x > y ? (x > z ? a : c) : (y > z ? b : c); + return Result; +} + +// Max comparison between 3 variables +template +GLM_FUNC_QUALIFIER vec associatedMax +( + vec const& x, vec const& a, + vec const& y, vec const& b, + vec const& z, vec const& c +) +{ + vec Result; + for(length_t i = 0, n = Result.length(); i < n; ++i) + Result[i] = x[i] > y[i] ? (x[i] > z[i] ? a[i] : c[i]) : (y[i] > z[i] ? b[i] : c[i]); + return Result; +} + +// Max comparison between 3 variables +template +GLM_FUNC_QUALIFIER vec associatedMax +( + T x, vec const& a, + T y, vec const& b, + T z, vec const& c +) +{ + vec Result; + for(length_t i = 0, n = Result.length(); i < n; ++i) + Result[i] = x > y ? (x > z ? a[i] : c[i]) : (y > z ? b[i] : c[i]); + return Result; +} + +// Max comparison between 3 variables +template +GLM_FUNC_QUALIFIER vec associatedMax +( + vec const& x, U a, + vec const& y, U b, + vec const& z, U c +) +{ + vec Result; + for(length_t i = 0, n = Result.length(); i < n; ++i) + Result[i] = x[i] > y[i] ? (x[i] > z[i] ? a : c) : (y[i] > z[i] ? b : c); + return Result; +} + +// Max comparison between 4 variables +template +GLM_FUNC_QUALIFIER U associatedMax +( + T x, U a, + T y, U b, + T z, U c, + T w, U d +) +{ + T Test1 = max(x, y); + T Test2 = max(z, w); + U Result1 = x > y ? a : b; + U Result2 = z > w ? c : d; + U Result = Test1 > Test2 ? Result1 : Result2; + return Result; +} + +// Max comparison between 4 variables +template +GLM_FUNC_QUALIFIER vec associatedMax +( + vec const& x, vec const& a, + vec const& y, vec const& b, + vec const& z, vec const& c, + vec const& w, vec const& d +) +{ + vec Result; + for(length_t i = 0, n = Result.length(); i < n; ++i) + { + T Test1 = max(x[i], y[i]); + T Test2 = max(z[i], w[i]); + U Result1 = x[i] > y[i] ? a[i] : b[i]; + U Result2 = z[i] > w[i] ? c[i] : d[i]; + Result[i] = Test1 > Test2 ? Result1 : Result2; + } + return Result; +} + +// Max comparison between 4 variables +template +GLM_FUNC_QUALIFIER vec associatedMax +( + T x, vec const& a, + T y, vec const& b, + T z, vec const& c, + T w, vec const& d +) +{ + T Test1 = max(x, y); + T Test2 = max(z, w); + + vec Result; + for(length_t i = 0, n = Result.length(); i < n; ++i) + { + U Result1 = x > y ? a[i] : b[i]; + U Result2 = z > w ? c[i] : d[i]; + Result[i] = Test1 > Test2 ? Result1 : Result2; + } + return Result; +} + +// Max comparison between 4 variables +template +GLM_FUNC_QUALIFIER vec associatedMax +( + vec const& x, U a, + vec const& y, U b, + vec const& z, U c, + vec const& w, U d +) +{ + vec Result; + for(length_t i = 0, n = Result.length(); i < n; ++i) + { + T Test1 = max(x[i], y[i]); + T Test2 = max(z[i], w[i]); + U Result1 = x[i] > y[i] ? a : b; + U Result2 = z[i] > w[i] ? c : d; + Result[i] = Test1 > Test2 ? Result1 : Result2; + } + return Result; +} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/bit.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/bit.hpp new file mode 100644 index 0000000000000000000000000000000000000000..7171a0724c4b593cdea21937945ee826fc43fe5b --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/bit.hpp @@ -0,0 +1,98 @@ +/// @ref gtx_bit +/// @file glm/gtx/bit.hpp +/// +/// @see core (dependence) +/// +/// @defgroup gtx_bit GLM_GTX_bit +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Allow to perform bit operations on integer values + +#pragma once + +// Dependencies +#include "../gtc/bitfield.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_bit is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_bit extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_bit + /// @{ + + /// @see gtx_bit + template + GLM_FUNC_DECL genIUType highestBitValue(genIUType Value); + + /// @see gtx_bit + template + GLM_FUNC_DECL genIUType lowestBitValue(genIUType Value); + + /// Find the highest bit set to 1 in a integer variable and return its value. + /// + /// @see gtx_bit + template + GLM_FUNC_DECL vec highestBitValue(vec const& value); + + /// Return the power of two number which value is just higher the input value. + /// Deprecated, use ceilPowerOfTwo from GTC_round instead + /// + /// @see gtc_round + /// @see gtx_bit + template + GLM_DEPRECATED GLM_FUNC_DECL genIUType powerOfTwoAbove(genIUType Value); + + /// Return the power of two number which value is just higher the input value. + /// Deprecated, use ceilPowerOfTwo from GTC_round instead + /// + /// @see gtc_round + /// @see gtx_bit + template + GLM_DEPRECATED GLM_FUNC_DECL vec powerOfTwoAbove(vec const& value); + + /// Return the power of two number which value is just lower the input value. + /// Deprecated, use floorPowerOfTwo from GTC_round instead + /// + /// @see gtc_round + /// @see gtx_bit + template + GLM_DEPRECATED GLM_FUNC_DECL genIUType powerOfTwoBelow(genIUType Value); + + /// Return the power of two number which value is just lower the input value. + /// Deprecated, use floorPowerOfTwo from GTC_round instead + /// + /// @see gtc_round + /// @see gtx_bit + template + GLM_DEPRECATED GLM_FUNC_DECL vec powerOfTwoBelow(vec const& value); + + /// Return the power of two number which value is the closet to the input value. + /// Deprecated, use roundPowerOfTwo from GTC_round instead + /// + /// @see gtc_round + /// @see gtx_bit + template + GLM_DEPRECATED GLM_FUNC_DECL genIUType powerOfTwoNearest(genIUType Value); + + /// Return the power of two number which value is the closet to the input value. + /// Deprecated, use roundPowerOfTwo from GTC_round instead + /// + /// @see gtc_round + /// @see gtx_bit + template + GLM_DEPRECATED GLM_FUNC_DECL vec powerOfTwoNearest(vec const& value); + + /// @} +} //namespace glm + + +#include "bit.inl" + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/bit.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/bit.inl new file mode 100644 index 0000000000000000000000000000000000000000..ef9603c3862f95c139f947f2c25fd5236a5c375a --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/bit.inl @@ -0,0 +1,92 @@ +/// @ref gtx_bit + +namespace glm +{ + /////////////////// + // highestBitValue + + template + GLM_FUNC_QUALIFIER genIUType highestBitValue(genIUType Value) + { + genIUType tmp = Value; + genIUType result = genIUType(0); + while(tmp) + { + result = (tmp & (~tmp + 1)); // grab lowest bit + tmp &= ~result; // clear lowest bit + } + return result; + } + + template + GLM_FUNC_QUALIFIER vec highestBitValue(vec const& v) + { + return detail::functor1::call(highestBitValue, v); + } + + /////////////////// + // lowestBitValue + + template + GLM_FUNC_QUALIFIER genIUType lowestBitValue(genIUType Value) + { + return (Value & (~Value + 1)); + } + + template + GLM_FUNC_QUALIFIER vec lowestBitValue(vec const& v) + { + return detail::functor1::call(lowestBitValue, v); + } + + /////////////////// + // powerOfTwoAbove + + template + GLM_FUNC_QUALIFIER genType powerOfTwoAbove(genType value) + { + return isPowerOfTwo(value) ? value : highestBitValue(value) << 1; + } + + template + GLM_FUNC_QUALIFIER vec powerOfTwoAbove(vec const& v) + { + return detail::functor1::call(powerOfTwoAbove, v); + } + + /////////////////// + // powerOfTwoBelow + + template + GLM_FUNC_QUALIFIER genType powerOfTwoBelow(genType value) + { + return isPowerOfTwo(value) ? value : highestBitValue(value); + } + + template + GLM_FUNC_QUALIFIER vec powerOfTwoBelow(vec const& v) + { + return detail::functor1::call(powerOfTwoBelow, v); + } + + ///////////////////// + // powerOfTwoNearest + + template + GLM_FUNC_QUALIFIER genType powerOfTwoNearest(genType value) + { + if(isPowerOfTwo(value)) + return value; + + genType const prev = highestBitValue(value); + genType const next = prev << 1; + return (next - value) < (value - prev) ? next : prev; + } + + template + GLM_FUNC_QUALIFIER vec powerOfTwoNearest(vec const& v) + { + return detail::functor1::call(powerOfTwoNearest, v); + } + +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/closest_point.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/closest_point.hpp new file mode 100644 index 0000000000000000000000000000000000000000..335f7e4b2bd4cdf4c5f88b50c00c52132bd79b85 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/closest_point.hpp @@ -0,0 +1,49 @@ +/// @ref gtx_closest_point +/// @file glm/gtx/closest_point.hpp +/// +/// @see core (dependence) +/// +/// @defgroup gtx_closest_point GLM_GTX_closest_point +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Find the point on a straight line which is the closet of a point. + +#pragma once + +// Dependency: +#include "../glm.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_closest_point is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_closest_point extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_closest_point + /// @{ + + /// Find the point on a straight line which is the closet of a point. + /// @see gtx_closest_point + template + GLM_FUNC_DECL vec<3, T, Q> closestPointOnLine( + vec<3, T, Q> const& point, + vec<3, T, Q> const& a, + vec<3, T, Q> const& b); + + /// 2d lines work as well + template + GLM_FUNC_DECL vec<2, T, Q> closestPointOnLine( + vec<2, T, Q> const& point, + vec<2, T, Q> const& a, + vec<2, T, Q> const& b); + + /// @} +}// namespace glm + +#include "closest_point.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/closest_point.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/closest_point.inl new file mode 100644 index 0000000000000000000000000000000000000000..4c17506dc387a54cc75b040d652985ec0fa40ae8 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/closest_point.inl @@ -0,0 +1,45 @@ +/// @ref gtx_closest_point + +namespace glm +{ + template + GLM_FUNC_QUALIFIER vec<3, T, Q> closestPointOnLine + ( + vec<3, T, Q> const& point, + vec<3, T, Q> const& a, + vec<3, T, Q> const& b + ) + { + T LineLength = distance(a, b); + vec<3, T, Q> Vector = point - a; + vec<3, T, Q> LineDirection = (b - a) / LineLength; + + // Project Vector to LineDirection to get the distance of point from a + T Distance = dot(Vector, LineDirection); + + if(Distance <= T(0)) return a; + if(Distance >= LineLength) return b; + return a + LineDirection * Distance; + } + + template + GLM_FUNC_QUALIFIER vec<2, T, Q> closestPointOnLine + ( + vec<2, T, Q> const& point, + vec<2, T, Q> const& a, + vec<2, T, Q> const& b + ) + { + T LineLength = distance(a, b); + vec<2, T, Q> Vector = point - a; + vec<2, T, Q> LineDirection = (b - a) / LineLength; + + // Project Vector to LineDirection to get the distance of point from a + T Distance = dot(Vector, LineDirection); + + if(Distance <= T(0)) return a; + if(Distance >= LineLength) return b; + return a + LineDirection * Distance; + } + +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/color_encoding.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/color_encoding.hpp new file mode 100644 index 0000000000000000000000000000000000000000..aa79dd2bbd4a288cd76d501447f5645f64e5e5eb --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/color_encoding.hpp @@ -0,0 +1,54 @@ +/// @ref gtx_color_encoding +/// @file glm/gtx/color_encoding.hpp +/// +/// @see core (dependence) +/// @see gtx_color_encoding (dependence) +/// +/// @defgroup gtx_color_encoding GLM_GTX_color_encoding +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// @brief Allow to perform bit operations on integer values + +#pragma once + +// Dependencies +#include "../detail/setup.hpp" +#include "../detail/qualifier.hpp" +#include "../vec3.hpp" +#include + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTC_color_encoding is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTC_color_encoding extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_color_encoding + /// @{ + + /// Convert a linear sRGB color to D65 YUV. + template + GLM_FUNC_DECL vec<3, T, Q> convertLinearSRGBToD65XYZ(vec<3, T, Q> const& ColorLinearSRGB); + + /// Convert a linear sRGB color to D50 YUV. + template + GLM_FUNC_DECL vec<3, T, Q> convertLinearSRGBToD50XYZ(vec<3, T, Q> const& ColorLinearSRGB); + + /// Convert a D65 YUV color to linear sRGB. + template + GLM_FUNC_DECL vec<3, T, Q> convertD65XYZToLinearSRGB(vec<3, T, Q> const& ColorD65XYZ); + + /// Convert a D65 YUV color to D50 YUV. + template + GLM_FUNC_DECL vec<3, T, Q> convertD65XYZToD50XYZ(vec<3, T, Q> const& ColorD65XYZ); + + /// @} +} //namespace glm + +#include "color_encoding.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/color_encoding.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/color_encoding.inl new file mode 100644 index 0000000000000000000000000000000000000000..dc996649528912d4fba72e4631e5c8aeb3838097 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/color_encoding.inl @@ -0,0 +1,45 @@ +/// @ref gtx_color_encoding + +namespace glm +{ + template + GLM_FUNC_QUALIFIER vec<3, T, Q> convertLinearSRGBToD65XYZ(vec<3, T, Q> const& ColorLinearSRGB) + { + vec<3, T, Q> const M(0.490f, 0.17697f, 0.2f); + vec<3, T, Q> const N(0.31f, 0.8124f, 0.01063f); + vec<3, T, Q> const O(0.490f, 0.01f, 0.99f); + + return (M * ColorLinearSRGB + N * ColorLinearSRGB + O * ColorLinearSRGB) * static_cast(5.650675255693055f); + } + + template + GLM_FUNC_QUALIFIER vec<3, T, Q> convertLinearSRGBToD50XYZ(vec<3, T, Q> const& ColorLinearSRGB) + { + vec<3, T, Q> const M(0.436030342570117f, 0.222438466210245f, 0.013897440074263f); + vec<3, T, Q> const N(0.385101860087134f, 0.716942745571917f, 0.097076381494207f); + vec<3, T, Q> const O(0.143067806654203f, 0.060618777416563f, 0.713926257896652f); + + return M * ColorLinearSRGB + N * ColorLinearSRGB + O * ColorLinearSRGB; + } + + template + GLM_FUNC_QUALIFIER vec<3, T, Q> convertD65XYZToLinearSRGB(vec<3, T, Q> const& ColorD65XYZ) + { + vec<3, T, Q> const M(0.41847f, -0.091169f, 0.0009209f); + vec<3, T, Q> const N(-0.15866f, 0.25243f, 0.015708f); + vec<3, T, Q> const O(0.0009209f, -0.0025498f, 0.1786f); + + return M * ColorD65XYZ + N * ColorD65XYZ + O * ColorD65XYZ; + } + + template + GLM_FUNC_QUALIFIER vec<3, T, Q> convertD65XYZToD50XYZ(vec<3, T, Q> const& ColorD65XYZ) + { + vec<3, T, Q> const M(+1.047844353856414f, +0.029549007606644f, -0.009250984365223f); + vec<3, T, Q> const N(+0.022898981050086f, +0.990508028941971f, +0.015072338237051f); + vec<3, T, Q> const O(-0.050206647741605f, -0.017074711360960f, +0.751717835079977f); + + return M * ColorD65XYZ + N * ColorD65XYZ + O * ColorD65XYZ; + } + +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/color_space.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/color_space.hpp new file mode 100644 index 0000000000000000000000000000000000000000..16b06e1715041410b71415b9d55ef60b403fdffc --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/color_space.hpp @@ -0,0 +1,72 @@ +/// @ref gtx_color_space +/// @file glm/gtx/color_space.hpp +/// +/// @see core (dependence) +/// +/// @defgroup gtx_color_space GLM_GTX_color_space +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Related to RGB to HSV conversions and operations. + +#pragma once + +// Dependency: +#include "../glm.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_color_space is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_color_space extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_color_space + /// @{ + + /// Converts a color from HSV color space to its color in RGB color space. + /// @see gtx_color_space + template + GLM_FUNC_DECL vec<3, T, Q> rgbColor( + vec<3, T, Q> const& hsvValue); + + /// Converts a color from RGB color space to its color in HSV color space. + /// @see gtx_color_space + template + GLM_FUNC_DECL vec<3, T, Q> hsvColor( + vec<3, T, Q> const& rgbValue); + + /// Build a saturation matrix. + /// @see gtx_color_space + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> saturation( + T const s); + + /// Modify the saturation of a color. + /// @see gtx_color_space + template + GLM_FUNC_DECL vec<3, T, Q> saturation( + T const s, + vec<3, T, Q> const& color); + + /// Modify the saturation of a color. + /// @see gtx_color_space + template + GLM_FUNC_DECL vec<4, T, Q> saturation( + T const s, + vec<4, T, Q> const& color); + + /// Compute color luminosity associating ratios (0.33, 0.59, 0.11) to RGB canals. + /// @see gtx_color_space + template + GLM_FUNC_DECL T luminosity( + vec<3, T, Q> const& color); + + /// @} +}//namespace glm + +#include "color_space.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/color_space.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/color_space.inl new file mode 100644 index 0000000000000000000000000000000000000000..e04407e7b975ad5a195980df2960a328b00926b0 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/color_space.inl @@ -0,0 +1,141 @@ +/// @ref gtx_color_space + +namespace glm +{ + template + GLM_FUNC_QUALIFIER vec<3, T, Q> rgbColor(const vec<3, T, Q>& hsvColor) + { + vec<3, T, Q> hsv = hsvColor; + vec<3, T, Q> rgbColor; + + if(hsv.y == static_cast(0)) + // achromatic (grey) + rgbColor = vec<3, T, Q>(hsv.z); + else + { + T sector = floor(hsv.x * (T(1) / T(60))); + T frac = (hsv.x * (T(1) / T(60))) - sector; + // factorial part of h + T o = hsv.z * (T(1) - hsv.y); + T p = hsv.z * (T(1) - hsv.y * frac); + T q = hsv.z * (T(1) - hsv.y * (T(1) - frac)); + + switch(int(sector)) + { + default: + case 0: + rgbColor.r = hsv.z; + rgbColor.g = q; + rgbColor.b = o; + break; + case 1: + rgbColor.r = p; + rgbColor.g = hsv.z; + rgbColor.b = o; + break; + case 2: + rgbColor.r = o; + rgbColor.g = hsv.z; + rgbColor.b = q; + break; + case 3: + rgbColor.r = o; + rgbColor.g = p; + rgbColor.b = hsv.z; + break; + case 4: + rgbColor.r = q; + rgbColor.g = o; + rgbColor.b = hsv.z; + break; + case 5: + rgbColor.r = hsv.z; + rgbColor.g = o; + rgbColor.b = p; + break; + } + } + + return rgbColor; + } + + template + GLM_FUNC_QUALIFIER vec<3, T, Q> hsvColor(const vec<3, T, Q>& rgbColor) + { + vec<3, T, Q> hsv = rgbColor; + T Min = min(min(rgbColor.r, rgbColor.g), rgbColor.b); + T Max = max(max(rgbColor.r, rgbColor.g), rgbColor.b); + T Delta = Max - Min; + + hsv.z = Max; + + if(Max != static_cast(0)) + { + hsv.y = Delta / hsv.z; + T h = static_cast(0); + + if(rgbColor.r == Max) + // between yellow & magenta + h = static_cast(0) + T(60) * (rgbColor.g - rgbColor.b) / Delta; + else if(rgbColor.g == Max) + // between cyan & yellow + h = static_cast(120) + T(60) * (rgbColor.b - rgbColor.r) / Delta; + else + // between magenta & cyan + h = static_cast(240) + T(60) * (rgbColor.r - rgbColor.g) / Delta; + + if(h < T(0)) + hsv.x = h + T(360); + else + hsv.x = h; + } + else + { + // If r = g = b = 0 then s = 0, h is undefined + hsv.y = static_cast(0); + hsv.x = static_cast(0); + } + + return hsv; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> saturation(T const s) + { + vec<3, T, defaultp> rgbw = vec<3, T, defaultp>(T(0.2126), T(0.7152), T(0.0722)); + + vec<3, T, defaultp> const col((T(1) - s) * rgbw); + + mat<4, 4, T, defaultp> result(T(1)); + result[0][0] = col.x + s; + result[0][1] = col.x; + result[0][2] = col.x; + result[1][0] = col.y; + result[1][1] = col.y + s; + result[1][2] = col.y; + result[2][0] = col.z; + result[2][1] = col.z; + result[2][2] = col.z + s; + + return result; + } + + template + GLM_FUNC_QUALIFIER vec<3, T, Q> saturation(const T s, const vec<3, T, Q>& color) + { + return vec<3, T, Q>(saturation(s) * vec<4, T, Q>(color, T(0))); + } + + template + GLM_FUNC_QUALIFIER vec<4, T, Q> saturation(const T s, const vec<4, T, Q>& color) + { + return saturation(s) * color; + } + + template + GLM_FUNC_QUALIFIER T luminosity(const vec<3, T, Q>& color) + { + const vec<3, T, Q> tmp = vec<3, T, Q>(0.33, 0.59, 0.11); + return dot(color, tmp); + } +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/color_space_YCoCg.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/color_space_YCoCg.hpp new file mode 100644 index 0000000000000000000000000000000000000000..3d2e3d459485f46a715d20df91338e48bda61f3e --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/color_space_YCoCg.hpp @@ -0,0 +1,60 @@ +/// @ref gtx_color_space_YCoCg +/// @file glm/gtx/color_space_YCoCg.hpp +/// +/// @see core (dependence) +/// +/// @defgroup gtx_color_space_YCoCg GLM_GTX_color_space_YCoCg +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// RGB to YCoCg conversions and operations + +#pragma once + +// Dependency: +#include "../glm.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_color_space_YCoCg is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_color_space_YCoCg extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_color_space_YCoCg + /// @{ + + /// Convert a color from RGB color space to YCoCg color space. + /// @see gtx_color_space_YCoCg + template + GLM_FUNC_DECL vec<3, T, Q> rgb2YCoCg( + vec<3, T, Q> const& rgbColor); + + /// Convert a color from YCoCg color space to RGB color space. + /// @see gtx_color_space_YCoCg + template + GLM_FUNC_DECL vec<3, T, Q> YCoCg2rgb( + vec<3, T, Q> const& YCoCgColor); + + /// Convert a color from RGB color space to YCoCgR color space. + /// @see "YCoCg-R: A Color Space with RGB Reversibility and Low Dynamic Range" + /// @see gtx_color_space_YCoCg + template + GLM_FUNC_DECL vec<3, T, Q> rgb2YCoCgR( + vec<3, T, Q> const& rgbColor); + + /// Convert a color from YCoCgR color space to RGB color space. + /// @see "YCoCg-R: A Color Space with RGB Reversibility and Low Dynamic Range" + /// @see gtx_color_space_YCoCg + template + GLM_FUNC_DECL vec<3, T, Q> YCoCgR2rgb( + vec<3, T, Q> const& YCoCgColor); + + /// @} +}//namespace glm + +#include "color_space_YCoCg.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/color_space_YCoCg.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/color_space_YCoCg.inl new file mode 100644 index 0000000000000000000000000000000000000000..7c410c14cdb75e6e32e38aa1d4ab811ebde494d2 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/color_space_YCoCg.inl @@ -0,0 +1,107 @@ +/// @ref gtx_color_space_YCoCg + +namespace glm +{ + template + GLM_FUNC_QUALIFIER vec<3, T, Q> rgb2YCoCg + ( + vec<3, T, Q> const& rgbColor + ) + { + vec<3, T, Q> result; + result.x/*Y */ = rgbColor.r / T(4) + rgbColor.g / T(2) + rgbColor.b / T(4); + result.y/*Co*/ = rgbColor.r / T(2) + rgbColor.g * T(0) - rgbColor.b / T(2); + result.z/*Cg*/ = - rgbColor.r / T(4) + rgbColor.g / T(2) - rgbColor.b / T(4); + return result; + } + + template + GLM_FUNC_QUALIFIER vec<3, T, Q> YCoCg2rgb + ( + vec<3, T, Q> const& YCoCgColor + ) + { + vec<3, T, Q> result; + result.r = YCoCgColor.x + YCoCgColor.y - YCoCgColor.z; + result.g = YCoCgColor.x + YCoCgColor.z; + result.b = YCoCgColor.x - YCoCgColor.y - YCoCgColor.z; + return result; + } + + template + class compute_YCoCgR { + public: + static GLM_FUNC_QUALIFIER vec<3, T, Q> rgb2YCoCgR + ( + vec<3, T, Q> const& rgbColor + ) + { + vec<3, T, Q> result; + result.x/*Y */ = rgbColor.g * static_cast(0.5) + (rgbColor.r + rgbColor.b) * static_cast(0.25); + result.y/*Co*/ = rgbColor.r - rgbColor.b; + result.z/*Cg*/ = rgbColor.g - (rgbColor.r + rgbColor.b) * static_cast(0.5); + return result; + } + + static GLM_FUNC_QUALIFIER vec<3, T, Q> YCoCgR2rgb + ( + vec<3, T, Q> const& YCoCgRColor + ) + { + vec<3, T, Q> result; + T tmp = YCoCgRColor.x - (YCoCgRColor.z * static_cast(0.5)); + result.g = YCoCgRColor.z + tmp; + result.b = tmp - (YCoCgRColor.y * static_cast(0.5)); + result.r = result.b + YCoCgRColor.y; + return result; + } + }; + + template + class compute_YCoCgR { + public: + static GLM_FUNC_QUALIFIER vec<3, T, Q> rgb2YCoCgR + ( + vec<3, T, Q> const& rgbColor + ) + { + vec<3, T, Q> result; + result.y/*Co*/ = rgbColor.r - rgbColor.b; + T tmp = rgbColor.b + (result.y >> 1); + result.z/*Cg*/ = rgbColor.g - tmp; + result.x/*Y */ = tmp + (result.z >> 1); + return result; + } + + static GLM_FUNC_QUALIFIER vec<3, T, Q> YCoCgR2rgb + ( + vec<3, T, Q> const& YCoCgRColor + ) + { + vec<3, T, Q> result; + T tmp = YCoCgRColor.x - (YCoCgRColor.z >> 1); + result.g = YCoCgRColor.z + tmp; + result.b = tmp - (YCoCgRColor.y >> 1); + result.r = result.b + YCoCgRColor.y; + return result; + } + }; + + template + GLM_FUNC_QUALIFIER vec<3, T, Q> rgb2YCoCgR + ( + vec<3, T, Q> const& rgbColor + ) + { + return compute_YCoCgR::is_integer>::rgb2YCoCgR(rgbColor); + } + + template + GLM_FUNC_QUALIFIER vec<3, T, Q> YCoCgR2rgb + ( + vec<3, T, Q> const& YCoCgRColor + ) + { + return compute_YCoCgR::is_integer>::YCoCgR2rgb(YCoCgRColor); + } +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/common.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/common.hpp new file mode 100644 index 0000000000000000000000000000000000000000..da40332b5ef0de090bc732ab4c8139b547d1c020 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/common.hpp @@ -0,0 +1,76 @@ +/// @ref gtx_common +/// @file glm/gtx/common.hpp +/// +/// @see core (dependence) +/// +/// @defgroup gtx_common GLM_GTX_common +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// @brief Provide functions to increase the compatibility with Cg and HLSL languages + +#pragma once + +// Dependencies: +#include "../vec2.hpp" +#include "../vec3.hpp" +#include "../vec4.hpp" +#include "../gtc/vec1.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_common is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_common extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_common + /// @{ + + /// Returns true if x is a denormalized number + /// Numbers whose absolute value is too small to be represented in the normal format are represented in an alternate, denormalized format. + /// This format is less precise but can represent values closer to zero. + /// + /// @tparam genType Floating-point scalar or vector types. + /// + /// @see GLSL isnan man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template + GLM_FUNC_DECL typename genType::bool_type isdenormal(genType const& x); + + /// Similar to 'mod' but with a different rounding and integer support. + /// Returns 'x - y * trunc(x/y)' instead of 'x - y * floor(x/y)' + /// + /// @see GLSL mod vs HLSL fmod + /// @see GLSL mod man page + template + GLM_FUNC_DECL vec fmod(vec const& v); + + /// Returns whether vector components values are within an interval. A open interval excludes its endpoints, and is denoted with square brackets. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point or integer scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see ext_vector_relational + template + GLM_FUNC_DECL vec openBounded(vec const& Value, vec const& Min, vec const& Max); + + /// Returns whether vector components values are within an interval. A closed interval includes its endpoints, and is denoted with square brackets. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point or integer scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see ext_vector_relational + template + GLM_FUNC_DECL vec closeBounded(vec const& Value, vec const& Min, vec const& Max); + + /// @} +}//namespace glm + +#include "common.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/common.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/common.inl new file mode 100644 index 0000000000000000000000000000000000000000..a5be4d4a1c6259a1c71d3b62a08d9db677b86db6 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/common.inl @@ -0,0 +1,125 @@ +/// @ref gtx_common + +#include +#include "../gtc/epsilon.hpp" +#include "../gtc/constants.hpp" + +namespace glm{ +namespace detail +{ + template + struct compute_fmod + { + GLM_FUNC_QUALIFIER static vec call(vec const& a, vec const& b) + { + return detail::functor2::call(std::fmod, a, b); + } + }; + + template + struct compute_fmod + { + GLM_FUNC_QUALIFIER static vec call(vec const& a, vec const& b) + { + return a % b; + } + }; +}//namespace detail + + template + GLM_FUNC_QUALIFIER bool isdenormal(T const& x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'isdenormal' only accept floating-point inputs"); + +# if GLM_HAS_CXX11_STL + return std::fpclassify(x) == FP_SUBNORMAL; +# else + return epsilonNotEqual(x, static_cast(0), epsilon()) && std::fabs(x) < std::numeric_limits::min(); +# endif + } + + template + GLM_FUNC_QUALIFIER typename vec<1, T, Q>::bool_type isdenormal + ( + vec<1, T, Q> const& x + ) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'isdenormal' only accept floating-point inputs"); + + return typename vec<1, T, Q>::bool_type( + isdenormal(x.x)); + } + + template + GLM_FUNC_QUALIFIER typename vec<2, T, Q>::bool_type isdenormal + ( + vec<2, T, Q> const& x + ) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'isdenormal' only accept floating-point inputs"); + + return typename vec<2, T, Q>::bool_type( + isdenormal(x.x), + isdenormal(x.y)); + } + + template + GLM_FUNC_QUALIFIER typename vec<3, T, Q>::bool_type isdenormal + ( + vec<3, T, Q> const& x + ) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'isdenormal' only accept floating-point inputs"); + + return typename vec<3, T, Q>::bool_type( + isdenormal(x.x), + isdenormal(x.y), + isdenormal(x.z)); + } + + template + GLM_FUNC_QUALIFIER typename vec<4, T, Q>::bool_type isdenormal + ( + vec<4, T, Q> const& x + ) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'isdenormal' only accept floating-point inputs"); + + return typename vec<4, T, Q>::bool_type( + isdenormal(x.x), + isdenormal(x.y), + isdenormal(x.z), + isdenormal(x.w)); + } + + // fmod + template + GLM_FUNC_QUALIFIER genType fmod(genType x, genType y) + { + return fmod(vec<1, genType>(x), y).x; + } + + template + GLM_FUNC_QUALIFIER vec fmod(vec const& x, T y) + { + return detail::compute_fmod::is_iec559>::call(x, vec(y)); + } + + template + GLM_FUNC_QUALIFIER vec fmod(vec const& x, vec const& y) + { + return detail::compute_fmod::is_iec559>::call(x, y); + } + + template + GLM_FUNC_QUALIFIER vec openBounded(vec const& Value, vec const& Min, vec const& Max) + { + return greaterThan(Value, Min) && lessThan(Value, Max); + } + + template + GLM_FUNC_QUALIFIER vec closeBounded(vec const& Value, vec const& Min, vec const& Max) + { + return greaterThanEqual(Value, Min) && lessThanEqual(Value, Max); + } +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/compatibility.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/compatibility.hpp new file mode 100644 index 0000000000000000000000000000000000000000..79c78d08567fdb5c6b943a489ca86d71a3a00e3d --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/compatibility.hpp @@ -0,0 +1,133 @@ +/// @ref gtx_compatibility +/// @file glm/gtx/compatibility.hpp +/// +/// @see core (dependence) +/// +/// @defgroup gtx_compatibility GLM_GTX_compatibility +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Provide functions to increase the compatibility with Cg and HLSL languages + +#pragma once + +// Dependency: +#include "../glm.hpp" +#include "../gtc/quaternion.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_compatibility is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_compatibility extension included") +# endif +#endif + +#if GLM_COMPILER & GLM_COMPILER_VC +# include +#elif GLM_COMPILER & GLM_COMPILER_GCC +# include +# if(GLM_PLATFORM & GLM_PLATFORM_ANDROID) +# undef isfinite +# endif +#endif//GLM_COMPILER + +namespace glm +{ + /// @addtogroup gtx_compatibility + /// @{ + + template GLM_FUNC_QUALIFIER T lerp(T x, T y, T a){return mix(x, y, a);} //!< \brief Returns x * (1.0 - a) + y * a, i.e., the linear blend of x and y using the floating-point value a. The value for a is not restricted to the range [0, 1]. (From GLM_GTX_compatibility) + template GLM_FUNC_QUALIFIER vec<2, T, Q> lerp(const vec<2, T, Q>& x, const vec<2, T, Q>& y, T a){return mix(x, y, a);} //!< \brief Returns x * (1.0 - a) + y * a, i.e., the linear blend of x and y using the floating-point value a. The value for a is not restricted to the range [0, 1]. (From GLM_GTX_compatibility) + + template GLM_FUNC_QUALIFIER vec<3, T, Q> lerp(const vec<3, T, Q>& x, const vec<3, T, Q>& y, T a){return mix(x, y, a);} //!< \brief Returns x * (1.0 - a) + y * a, i.e., the linear blend of x and y using the floating-point value a. The value for a is not restricted to the range [0, 1]. (From GLM_GTX_compatibility) + template GLM_FUNC_QUALIFIER vec<4, T, Q> lerp(const vec<4, T, Q>& x, const vec<4, T, Q>& y, T a){return mix(x, y, a);} //!< \brief Returns x * (1.0 - a) + y * a, i.e., the linear blend of x and y using the floating-point value a. The value for a is not restricted to the range [0, 1]. (From GLM_GTX_compatibility) + template GLM_FUNC_QUALIFIER vec<2, T, Q> lerp(const vec<2, T, Q>& x, const vec<2, T, Q>& y, const vec<2, T, Q>& a){return mix(x, y, a);} //!< \brief Returns the component-wise result of x * (1.0 - a) + y * a, i.e., the linear blend of x and y using vector a. The value for a is not restricted to the range [0, 1]. (From GLM_GTX_compatibility) + template GLM_FUNC_QUALIFIER vec<3, T, Q> lerp(const vec<3, T, Q>& x, const vec<3, T, Q>& y, const vec<3, T, Q>& a){return mix(x, y, a);} //!< \brief Returns the component-wise result of x * (1.0 - a) + y * a, i.e., the linear blend of x and y using vector a. The value for a is not restricted to the range [0, 1]. (From GLM_GTX_compatibility) + template GLM_FUNC_QUALIFIER vec<4, T, Q> lerp(const vec<4, T, Q>& x, const vec<4, T, Q>& y, const vec<4, T, Q>& a){return mix(x, y, a);} //!< \brief Returns the component-wise result of x * (1.0 - a) + y * a, i.e., the linear blend of x and y using vector a. The value for a is not restricted to the range [0, 1]. (From GLM_GTX_compatibility) + + template GLM_FUNC_QUALIFIER T saturate(T x){return clamp(x, T(0), T(1));} //!< \brief Returns clamp(x, 0, 1) for each component in x. (From GLM_GTX_compatibility) + template GLM_FUNC_QUALIFIER vec<2, T, Q> saturate(const vec<2, T, Q>& x){return clamp(x, T(0), T(1));} //!< \brief Returns clamp(x, 0, 1) for each component in x. (From GLM_GTX_compatibility) + template GLM_FUNC_QUALIFIER vec<3, T, Q> saturate(const vec<3, T, Q>& x){return clamp(x, T(0), T(1));} //!< \brief Returns clamp(x, 0, 1) for each component in x. (From GLM_GTX_compatibility) + template GLM_FUNC_QUALIFIER vec<4, T, Q> saturate(const vec<4, T, Q>& x){return clamp(x, T(0), T(1));} //!< \brief Returns clamp(x, 0, 1) for each component in x. (From GLM_GTX_compatibility) + + template GLM_FUNC_QUALIFIER T atan2(T x, T y){return atan(x, y);} //!< \brief Arc tangent. Returns an angle whose tangent is y/x. The signs of x and y are used to determine what quadrant the angle is in. The range of values returned by this function is [-PI, PI]. Results are undefined if x and y are both 0. (From GLM_GTX_compatibility) + template GLM_FUNC_QUALIFIER vec<2, T, Q> atan2(const vec<2, T, Q>& x, const vec<2, T, Q>& y){return atan(x, y);} //!< \brief Arc tangent. Returns an angle whose tangent is y/x. The signs of x and y are used to determine what quadrant the angle is in. The range of values returned by this function is [-PI, PI]. Results are undefined if x and y are both 0. (From GLM_GTX_compatibility) + template GLM_FUNC_QUALIFIER vec<3, T, Q> atan2(const vec<3, T, Q>& x, const vec<3, T, Q>& y){return atan(x, y);} //!< \brief Arc tangent. Returns an angle whose tangent is y/x. The signs of x and y are used to determine what quadrant the angle is in. The range of values returned by this function is [-PI, PI]. Results are undefined if x and y are both 0. (From GLM_GTX_compatibility) + template GLM_FUNC_QUALIFIER vec<4, T, Q> atan2(const vec<4, T, Q>& x, const vec<4, T, Q>& y){return atan(x, y);} //!< \brief Arc tangent. Returns an angle whose tangent is y/x. The signs of x and y are used to determine what quadrant the angle is in. The range of values returned by this function is [-PI, PI]. Results are undefined if x and y are both 0. (From GLM_GTX_compatibility) + + template GLM_FUNC_DECL bool isfinite(genType const& x); //!< \brief Test whether or not a scalar or each vector component is a finite value. (From GLM_GTX_compatibility) + template GLM_FUNC_DECL vec<1, bool, Q> isfinite(const vec<1, T, Q>& x); //!< \brief Test whether or not a scalar or each vector component is a finite value. (From GLM_GTX_compatibility) + template GLM_FUNC_DECL vec<2, bool, Q> isfinite(const vec<2, T, Q>& x); //!< \brief Test whether or not a scalar or each vector component is a finite value. (From GLM_GTX_compatibility) + template GLM_FUNC_DECL vec<3, bool, Q> isfinite(const vec<3, T, Q>& x); //!< \brief Test whether or not a scalar or each vector component is a finite value. (From GLM_GTX_compatibility) + template GLM_FUNC_DECL vec<4, bool, Q> isfinite(const vec<4, T, Q>& x); //!< \brief Test whether or not a scalar or each vector component is a finite value. (From GLM_GTX_compatibility) + + typedef bool bool1; //!< \brief boolean type with 1 component. (From GLM_GTX_compatibility extension) + typedef vec<2, bool, highp> bool2; //!< \brief boolean type with 2 components. (From GLM_GTX_compatibility extension) + typedef vec<3, bool, highp> bool3; //!< \brief boolean type with 3 components. (From GLM_GTX_compatibility extension) + typedef vec<4, bool, highp> bool4; //!< \brief boolean type with 4 components. (From GLM_GTX_compatibility extension) + + typedef bool bool1x1; //!< \brief boolean matrix with 1 x 1 component. (From GLM_GTX_compatibility extension) + typedef mat<2, 2, bool, highp> bool2x2; //!< \brief boolean matrix with 2 x 2 components. (From GLM_GTX_compatibility extension) + typedef mat<2, 3, bool, highp> bool2x3; //!< \brief boolean matrix with 2 x 3 components. (From GLM_GTX_compatibility extension) + typedef mat<2, 4, bool, highp> bool2x4; //!< \brief boolean matrix with 2 x 4 components. (From GLM_GTX_compatibility extension) + typedef mat<3, 2, bool, highp> bool3x2; //!< \brief boolean matrix with 3 x 2 components. (From GLM_GTX_compatibility extension) + typedef mat<3, 3, bool, highp> bool3x3; //!< \brief boolean matrix with 3 x 3 components. (From GLM_GTX_compatibility extension) + typedef mat<3, 4, bool, highp> bool3x4; //!< \brief boolean matrix with 3 x 4 components. (From GLM_GTX_compatibility extension) + typedef mat<4, 2, bool, highp> bool4x2; //!< \brief boolean matrix with 4 x 2 components. (From GLM_GTX_compatibility extension) + typedef mat<4, 3, bool, highp> bool4x3; //!< \brief boolean matrix with 4 x 3 components. (From GLM_GTX_compatibility extension) + typedef mat<4, 4, bool, highp> bool4x4; //!< \brief boolean matrix with 4 x 4 components. (From GLM_GTX_compatibility extension) + + typedef int int1; //!< \brief integer vector with 1 component. (From GLM_GTX_compatibility extension) + typedef vec<2, int, highp> int2; //!< \brief integer vector with 2 components. (From GLM_GTX_compatibility extension) + typedef vec<3, int, highp> int3; //!< \brief integer vector with 3 components. (From GLM_GTX_compatibility extension) + typedef vec<4, int, highp> int4; //!< \brief integer vector with 4 components. (From GLM_GTX_compatibility extension) + + typedef int int1x1; //!< \brief integer matrix with 1 component. (From GLM_GTX_compatibility extension) + typedef mat<2, 2, int, highp> int2x2; //!< \brief integer matrix with 2 x 2 components. (From GLM_GTX_compatibility extension) + typedef mat<2, 3, int, highp> int2x3; //!< \brief integer matrix with 2 x 3 components. (From GLM_GTX_compatibility extension) + typedef mat<2, 4, int, highp> int2x4; //!< \brief integer matrix with 2 x 4 components. (From GLM_GTX_compatibility extension) + typedef mat<3, 2, int, highp> int3x2; //!< \brief integer matrix with 3 x 2 components. (From GLM_GTX_compatibility extension) + typedef mat<3, 3, int, highp> int3x3; //!< \brief integer matrix with 3 x 3 components. (From GLM_GTX_compatibility extension) + typedef mat<3, 4, int, highp> int3x4; //!< \brief integer matrix with 3 x 4 components. (From GLM_GTX_compatibility extension) + typedef mat<4, 2, int, highp> int4x2; //!< \brief integer matrix with 4 x 2 components. (From GLM_GTX_compatibility extension) + typedef mat<4, 3, int, highp> int4x3; //!< \brief integer matrix with 4 x 3 components. (From GLM_GTX_compatibility extension) + typedef mat<4, 4, int, highp> int4x4; //!< \brief integer matrix with 4 x 4 components. (From GLM_GTX_compatibility extension) + + typedef float float1; //!< \brief single-qualifier floating-point vector with 1 component. (From GLM_GTX_compatibility extension) + typedef vec<2, float, highp> float2; //!< \brief single-qualifier floating-point vector with 2 components. (From GLM_GTX_compatibility extension) + typedef vec<3, float, highp> float3; //!< \brief single-qualifier floating-point vector with 3 components. (From GLM_GTX_compatibility extension) + typedef vec<4, float, highp> float4; //!< \brief single-qualifier floating-point vector with 4 components. (From GLM_GTX_compatibility extension) + + typedef float float1x1; //!< \brief single-qualifier floating-point matrix with 1 component. (From GLM_GTX_compatibility extension) + typedef mat<2, 2, float, highp> float2x2; //!< \brief single-qualifier floating-point matrix with 2 x 2 components. (From GLM_GTX_compatibility extension) + typedef mat<2, 3, float, highp> float2x3; //!< \brief single-qualifier floating-point matrix with 2 x 3 components. (From GLM_GTX_compatibility extension) + typedef mat<2, 4, float, highp> float2x4; //!< \brief single-qualifier floating-point matrix with 2 x 4 components. (From GLM_GTX_compatibility extension) + typedef mat<3, 2, float, highp> float3x2; //!< \brief single-qualifier floating-point matrix with 3 x 2 components. (From GLM_GTX_compatibility extension) + typedef mat<3, 3, float, highp> float3x3; //!< \brief single-qualifier floating-point matrix with 3 x 3 components. (From GLM_GTX_compatibility extension) + typedef mat<3, 4, float, highp> float3x4; //!< \brief single-qualifier floating-point matrix with 3 x 4 components. (From GLM_GTX_compatibility extension) + typedef mat<4, 2, float, highp> float4x2; //!< \brief single-qualifier floating-point matrix with 4 x 2 components. (From GLM_GTX_compatibility extension) + typedef mat<4, 3, float, highp> float4x3; //!< \brief single-qualifier floating-point matrix with 4 x 3 components. (From GLM_GTX_compatibility extension) + typedef mat<4, 4, float, highp> float4x4; //!< \brief single-qualifier floating-point matrix with 4 x 4 components. (From GLM_GTX_compatibility extension) + + typedef double double1; //!< \brief double-qualifier floating-point vector with 1 component. (From GLM_GTX_compatibility extension) + typedef vec<2, double, highp> double2; //!< \brief double-qualifier floating-point vector with 2 components. (From GLM_GTX_compatibility extension) + typedef vec<3, double, highp> double3; //!< \brief double-qualifier floating-point vector with 3 components. (From GLM_GTX_compatibility extension) + typedef vec<4, double, highp> double4; //!< \brief double-qualifier floating-point vector with 4 components. (From GLM_GTX_compatibility extension) + + typedef double double1x1; //!< \brief double-qualifier floating-point matrix with 1 component. (From GLM_GTX_compatibility extension) + typedef mat<2, 2, double, highp> double2x2; //!< \brief double-qualifier floating-point matrix with 2 x 2 components. (From GLM_GTX_compatibility extension) + typedef mat<2, 3, double, highp> double2x3; //!< \brief double-qualifier floating-point matrix with 2 x 3 components. (From GLM_GTX_compatibility extension) + typedef mat<2, 4, double, highp> double2x4; //!< \brief double-qualifier floating-point matrix with 2 x 4 components. (From GLM_GTX_compatibility extension) + typedef mat<3, 2, double, highp> double3x2; //!< \brief double-qualifier floating-point matrix with 3 x 2 components. (From GLM_GTX_compatibility extension) + typedef mat<3, 3, double, highp> double3x3; //!< \brief double-qualifier floating-point matrix with 3 x 3 components. (From GLM_GTX_compatibility extension) + typedef mat<3, 4, double, highp> double3x4; //!< \brief double-qualifier floating-point matrix with 3 x 4 components. (From GLM_GTX_compatibility extension) + typedef mat<4, 2, double, highp> double4x2; //!< \brief double-qualifier floating-point matrix with 4 x 2 components. (From GLM_GTX_compatibility extension) + typedef mat<4, 3, double, highp> double4x3; //!< \brief double-qualifier floating-point matrix with 4 x 3 components. (From GLM_GTX_compatibility extension) + typedef mat<4, 4, double, highp> double4x4; //!< \brief double-qualifier floating-point matrix with 4 x 4 components. (From GLM_GTX_compatibility extension) + + /// @} +}//namespace glm + +#include "compatibility.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/compatibility.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/compatibility.inl new file mode 100644 index 0000000000000000000000000000000000000000..cbac88ff8825cac55fde85d9a43e5b80b4c77194 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/compatibility.inl @@ -0,0 +1,62 @@ +#include + +namespace glm +{ + // isfinite + template + GLM_FUNC_QUALIFIER bool isfinite( + genType const& x) + { +# if GLM_HAS_CXX11_STL + return std::isfinite(x) != 0; +# elif GLM_COMPILER & GLM_COMPILER_VC + return _finite(x) != 0; +# elif GLM_COMPILER & GLM_COMPILER_GCC && GLM_PLATFORM & GLM_PLATFORM_ANDROID + return _isfinite(x) != 0; +# else + if (std::numeric_limits::is_integer || std::denorm_absent == std::numeric_limits::has_denorm) + return std::numeric_limits::min() <= x && std::numeric_limits::max() >= x; + else + return -std::numeric_limits::max() <= x && std::numeric_limits::max() >= x; +# endif + } + + template + GLM_FUNC_QUALIFIER vec<1, bool, Q> isfinite( + vec<1, T, Q> const& x) + { + return vec<1, bool, Q>( + isfinite(x.x)); + } + + template + GLM_FUNC_QUALIFIER vec<2, bool, Q> isfinite( + vec<2, T, Q> const& x) + { + return vec<2, bool, Q>( + isfinite(x.x), + isfinite(x.y)); + } + + template + GLM_FUNC_QUALIFIER vec<3, bool, Q> isfinite( + vec<3, T, Q> const& x) + { + return vec<3, bool, Q>( + isfinite(x.x), + isfinite(x.y), + isfinite(x.z)); + } + + template + GLM_FUNC_QUALIFIER vec<4, bool, Q> isfinite( + vec<4, T, Q> const& x) + { + return vec<4, bool, Q>( + isfinite(x.x), + isfinite(x.y), + isfinite(x.z), + isfinite(x.w)); + } + +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/component_wise.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/component_wise.hpp new file mode 100644 index 0000000000000000000000000000000000000000..0803185dba72604ff205c6a7311bffdacc08a36b --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/component_wise.hpp @@ -0,0 +1,69 @@ +/// @ref gtx_component_wise +/// @file glm/gtx/component_wise.hpp +/// @date 2007-05-21 / 2011-06-07 +/// @author Christophe Riccio +/// +/// @see core (dependence) +/// +/// @defgroup gtx_component_wise GLM_GTX_component_wise +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Operations between components of a type + +#pragma once + +// Dependencies +#include "../detail/setup.hpp" +#include "../detail/qualifier.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_component_wise is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_component_wise extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_component_wise + /// @{ + + /// Convert an integer vector to a normalized float vector. + /// If the parameter value type is already a floating qualifier type, the value is passed through. + /// @see gtx_component_wise + template + GLM_FUNC_DECL vec compNormalize(vec const& v); + + /// Convert a normalized float vector to an integer vector. + /// If the parameter value type is already a floating qualifier type, the value is passed through. + /// @see gtx_component_wise + template + GLM_FUNC_DECL vec compScale(vec const& v); + + /// Add all vector components together. + /// @see gtx_component_wise + template + GLM_FUNC_DECL typename genType::value_type compAdd(genType const& v); + + /// Multiply all vector components together. + /// @see gtx_component_wise + template + GLM_FUNC_DECL typename genType::value_type compMul(genType const& v); + + /// Find the minimum value between single vector components. + /// @see gtx_component_wise + template + GLM_FUNC_DECL typename genType::value_type compMin(genType const& v); + + /// Find the maximum value between single vector components. + /// @see gtx_component_wise + template + GLM_FUNC_DECL typename genType::value_type compMax(genType const& v); + + /// @} +}//namespace glm + +#include "component_wise.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/component_wise.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/component_wise.inl new file mode 100644 index 0000000000000000000000000000000000000000..4bafb147a2e5cfed68d78694c3db10cff4fc2ca5 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/component_wise.inl @@ -0,0 +1,127 @@ +/// @ref gtx_component_wise + +#include + +namespace glm{ +namespace detail +{ + template + struct compute_compNormalize + {}; + + template + struct compute_compNormalize + { + GLM_FUNC_QUALIFIER static vec call(vec const& v) + { + floatType const Min = static_cast(std::numeric_limits::min()); + floatType const Max = static_cast(std::numeric_limits::max()); + return (vec(v) - Min) / (Max - Min) * static_cast(2) - static_cast(1); + } + }; + + template + struct compute_compNormalize + { + GLM_FUNC_QUALIFIER static vec call(vec const& v) + { + return vec(v) / static_cast(std::numeric_limits::max()); + } + }; + + template + struct compute_compNormalize + { + GLM_FUNC_QUALIFIER static vec call(vec const& v) + { + return v; + } + }; + + template + struct compute_compScale + {}; + + template + struct compute_compScale + { + GLM_FUNC_QUALIFIER static vec call(vec const& v) + { + floatType const Max = static_cast(std::numeric_limits::max()) + static_cast(0.5); + vec const Scaled(v * Max); + vec const Result(Scaled - static_cast(0.5)); + return Result; + } + }; + + template + struct compute_compScale + { + GLM_FUNC_QUALIFIER static vec call(vec const& v) + { + return vec(vec(v) * static_cast(std::numeric_limits::max())); + } + }; + + template + struct compute_compScale + { + GLM_FUNC_QUALIFIER static vec call(vec const& v) + { + return v; + } + }; +}//namespace detail + + template + GLM_FUNC_QUALIFIER vec compNormalize(vec const& v) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'compNormalize' accepts only floating-point types for 'floatType' template parameter"); + + return detail::compute_compNormalize::is_integer, std::numeric_limits::is_signed>::call(v); + } + + template + GLM_FUNC_QUALIFIER vec compScale(vec const& v) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'compScale' accepts only floating-point types for 'floatType' template parameter"); + + return detail::compute_compScale::is_integer, std::numeric_limits::is_signed>::call(v); + } + + template + GLM_FUNC_QUALIFIER T compAdd(vec const& v) + { + T Result(0); + for(length_t i = 0, n = v.length(); i < n; ++i) + Result += v[i]; + return Result; + } + + template + GLM_FUNC_QUALIFIER T compMul(vec const& v) + { + T Result(1); + for(length_t i = 0, n = v.length(); i < n; ++i) + Result *= v[i]; + return Result; + } + + template + GLM_FUNC_QUALIFIER T compMin(vec const& v) + { + T Result(v[0]); + for(length_t i = 1, n = v.length(); i < n; ++i) + Result = min(Result, v[i]); + return Result; + } + + template + GLM_FUNC_QUALIFIER T compMax(vec const& v) + { + T Result(v[0]); + for(length_t i = 1, n = v.length(); i < n; ++i) + Result = max(Result, v[i]); + return Result; + } +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/dual_quaternion.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/dual_quaternion.hpp new file mode 100644 index 0000000000000000000000000000000000000000..302d8ad4239f4a079fe211ce6262463ab1281f1d --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/dual_quaternion.hpp @@ -0,0 +1,274 @@ +/// @ref gtx_dual_quaternion +/// @file glm/gtx/dual_quaternion.hpp +/// @author Maksim Vorobiev (msomeone@gmail.com) +/// +/// @see core (dependence) +/// @see gtc_constants (dependence) +/// @see gtc_quaternion (dependence) +/// +/// @defgroup gtx_dual_quaternion GLM_GTX_dual_quaternion +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Defines a templated dual-quaternion type and several dual-quaternion operations. + +#pragma once + +// Dependency: +#include "../glm.hpp" +#include "../gtc/constants.hpp" +#include "../gtc/quaternion.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_dual_quaternion is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_dual_quaternion extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_dual_quaternion + /// @{ + + template + struct tdualquat + { + // -- Implementation detail -- + + typedef T value_type; + typedef qua part_type; + + // -- Data -- + + qua real, dual; + + // -- Component accesses -- + + typedef length_t length_type; + /// Return the count of components of a dual quaternion + GLM_FUNC_DECL static GLM_CONSTEXPR length_type length(){return 2;} + + GLM_FUNC_DECL part_type & operator[](length_type i); + GLM_FUNC_DECL part_type const& operator[](length_type i) const; + + // -- Implicit basic constructors -- + + GLM_FUNC_DECL GLM_CONSTEXPR tdualquat() GLM_DEFAULT; + GLM_FUNC_DECL GLM_CONSTEXPR tdualquat(tdualquat const& d) GLM_DEFAULT; + template + GLM_FUNC_DECL GLM_CONSTEXPR tdualquat(tdualquat const& d); + + // -- Explicit basic constructors -- + + GLM_FUNC_DECL GLM_CONSTEXPR tdualquat(qua const& real); + GLM_FUNC_DECL GLM_CONSTEXPR tdualquat(qua const& orientation, vec<3, T, Q> const& translation); + GLM_FUNC_DECL GLM_CONSTEXPR tdualquat(qua const& real, qua const& dual); + + // -- Conversion constructors -- + + template + GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT tdualquat(tdualquat const& q); + + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR tdualquat(mat<2, 4, T, Q> const& holder_mat); + GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR tdualquat(mat<3, 4, T, Q> const& aug_mat); + + // -- Unary arithmetic operators -- + + GLM_FUNC_DECL tdualquat & operator=(tdualquat const& m) GLM_DEFAULT; + + template + GLM_FUNC_DECL tdualquat & operator=(tdualquat const& m); + template + GLM_FUNC_DECL tdualquat & operator*=(U s); + template + GLM_FUNC_DECL tdualquat & operator/=(U s); + }; + + // -- Unary bit operators -- + + template + GLM_FUNC_DECL tdualquat operator+(tdualquat const& q); + + template + GLM_FUNC_DECL tdualquat operator-(tdualquat const& q); + + // -- Binary operators -- + + template + GLM_FUNC_DECL tdualquat operator+(tdualquat const& q, tdualquat const& p); + + template + GLM_FUNC_DECL tdualquat operator*(tdualquat const& q, tdualquat const& p); + + template + GLM_FUNC_DECL vec<3, T, Q> operator*(tdualquat const& q, vec<3, T, Q> const& v); + + template + GLM_FUNC_DECL vec<3, T, Q> operator*(vec<3, T, Q> const& v, tdualquat const& q); + + template + GLM_FUNC_DECL vec<4, T, Q> operator*(tdualquat const& q, vec<4, T, Q> const& v); + + template + GLM_FUNC_DECL vec<4, T, Q> operator*(vec<4, T, Q> const& v, tdualquat const& q); + + template + GLM_FUNC_DECL tdualquat operator*(tdualquat const& q, T const& s); + + template + GLM_FUNC_DECL tdualquat operator*(T const& s, tdualquat const& q); + + template + GLM_FUNC_DECL tdualquat operator/(tdualquat const& q, T const& s); + + // -- Boolean operators -- + + template + GLM_FUNC_DECL bool operator==(tdualquat const& q1, tdualquat const& q2); + + template + GLM_FUNC_DECL bool operator!=(tdualquat const& q1, tdualquat const& q2); + + /// Creates an identity dual quaternion. + /// + /// @see gtx_dual_quaternion + template + GLM_FUNC_DECL tdualquat dual_quat_identity(); + + /// Returns the normalized quaternion. + /// + /// @see gtx_dual_quaternion + template + GLM_FUNC_DECL tdualquat normalize(tdualquat const& q); + + /// Returns the linear interpolation of two dual quaternion. + /// + /// @see gtc_dual_quaternion + template + GLM_FUNC_DECL tdualquat lerp(tdualquat const& x, tdualquat const& y, T const& a); + + /// Returns the q inverse. + /// + /// @see gtx_dual_quaternion + template + GLM_FUNC_DECL tdualquat inverse(tdualquat const& q); + + /// Converts a quaternion to a 2 * 4 matrix. + /// + /// @see gtx_dual_quaternion + template + GLM_FUNC_DECL mat<2, 4, T, Q> mat2x4_cast(tdualquat const& x); + + /// Converts a quaternion to a 3 * 4 matrix. + /// + /// @see gtx_dual_quaternion + template + GLM_FUNC_DECL mat<3, 4, T, Q> mat3x4_cast(tdualquat const& x); + + /// Converts a 2 * 4 matrix (matrix which holds real and dual parts) to a quaternion. + /// + /// @see gtx_dual_quaternion + template + GLM_FUNC_DECL tdualquat dualquat_cast(mat<2, 4, T, Q> const& x); + + /// Converts a 3 * 4 matrix (augmented matrix rotation + translation) to a quaternion. + /// + /// @see gtx_dual_quaternion + template + GLM_FUNC_DECL tdualquat dualquat_cast(mat<3, 4, T, Q> const& x); + + + /// Dual-quaternion of low single-qualifier floating-point numbers. + /// + /// @see gtx_dual_quaternion + typedef tdualquat lowp_dualquat; + + /// Dual-quaternion of medium single-qualifier floating-point numbers. + /// + /// @see gtx_dual_quaternion + typedef tdualquat mediump_dualquat; + + /// Dual-quaternion of high single-qualifier floating-point numbers. + /// + /// @see gtx_dual_quaternion + typedef tdualquat highp_dualquat; + + + /// Dual-quaternion of low single-qualifier floating-point numbers. + /// + /// @see gtx_dual_quaternion + typedef tdualquat lowp_fdualquat; + + /// Dual-quaternion of medium single-qualifier floating-point numbers. + /// + /// @see gtx_dual_quaternion + typedef tdualquat mediump_fdualquat; + + /// Dual-quaternion of high single-qualifier floating-point numbers. + /// + /// @see gtx_dual_quaternion + typedef tdualquat highp_fdualquat; + + + /// Dual-quaternion of low double-qualifier floating-point numbers. + /// + /// @see gtx_dual_quaternion + typedef tdualquat lowp_ddualquat; + + /// Dual-quaternion of medium double-qualifier floating-point numbers. + /// + /// @see gtx_dual_quaternion + typedef tdualquat mediump_ddualquat; + + /// Dual-quaternion of high double-qualifier floating-point numbers. + /// + /// @see gtx_dual_quaternion + typedef tdualquat highp_ddualquat; + + +#if(!defined(GLM_PRECISION_HIGHP_FLOAT) && !defined(GLM_PRECISION_MEDIUMP_FLOAT) && !defined(GLM_PRECISION_LOWP_FLOAT)) + /// Dual-quaternion of floating-point numbers. + /// + /// @see gtx_dual_quaternion + typedef highp_fdualquat dualquat; + + /// Dual-quaternion of single-qualifier floating-point numbers. + /// + /// @see gtx_dual_quaternion + typedef highp_fdualquat fdualquat; +#elif(defined(GLM_PRECISION_HIGHP_FLOAT) && !defined(GLM_PRECISION_MEDIUMP_FLOAT) && !defined(GLM_PRECISION_LOWP_FLOAT)) + typedef highp_fdualquat dualquat; + typedef highp_fdualquat fdualquat; +#elif(!defined(GLM_PRECISION_HIGHP_FLOAT) && defined(GLM_PRECISION_MEDIUMP_FLOAT) && !defined(GLM_PRECISION_LOWP_FLOAT)) + typedef mediump_fdualquat dualquat; + typedef mediump_fdualquat fdualquat; +#elif(!defined(GLM_PRECISION_HIGHP_FLOAT) && !defined(GLM_PRECISION_MEDIUMP_FLOAT) && defined(GLM_PRECISION_LOWP_FLOAT)) + typedef lowp_fdualquat dualquat; + typedef lowp_fdualquat fdualquat; +#else +# error "GLM error: multiple default precision requested for single-precision floating-point types" +#endif + + +#if(!defined(GLM_PRECISION_HIGHP_DOUBLE) && !defined(GLM_PRECISION_MEDIUMP_DOUBLE) && !defined(GLM_PRECISION_LOWP_DOUBLE)) + /// Dual-quaternion of default double-qualifier floating-point numbers. + /// + /// @see gtx_dual_quaternion + typedef highp_ddualquat ddualquat; +#elif(defined(GLM_PRECISION_HIGHP_DOUBLE) && !defined(GLM_PRECISION_MEDIUMP_DOUBLE) && !defined(GLM_PRECISION_LOWP_DOUBLE)) + typedef highp_ddualquat ddualquat; +#elif(!defined(GLM_PRECISION_HIGHP_DOUBLE) && defined(GLM_PRECISION_MEDIUMP_DOUBLE) && !defined(GLM_PRECISION_LOWP_DOUBLE)) + typedef mediump_ddualquat ddualquat; +#elif(!defined(GLM_PRECISION_HIGHP_DOUBLE) && !defined(GLM_PRECISION_MEDIUMP_DOUBLE) && defined(GLM_PRECISION_LOWP_DOUBLE)) + typedef lowp_ddualquat ddualquat; +#else +# error "GLM error: Multiple default precision requested for double-precision floating-point types" +#endif + + /// @} +} //namespace glm + +#include "dual_quaternion.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/dual_quaternion.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/dual_quaternion.inl new file mode 100644 index 0000000000000000000000000000000000000000..4fc8b57f01bfa7e93d9f364ab5b00cac51d89c54 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/dual_quaternion.inl @@ -0,0 +1,352 @@ +/// @ref gtx_dual_quaternion + +#include "../geometric.hpp" +#include + +namespace glm +{ + // -- Component accesses -- + + template + GLM_FUNC_QUALIFIER typename tdualquat::part_type & tdualquat::operator[](typename tdualquat::length_type i) + { + assert(i >= 0 && i < this->length()); + return (&real)[i]; + } + + template + GLM_FUNC_QUALIFIER typename tdualquat::part_type const& tdualquat::operator[](typename tdualquat::length_type i) const + { + assert(i >= 0 && i < this->length()); + return (&real)[i]; + } + + // -- Implicit basic constructors -- + +# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR tdualquat::tdualquat() +# if GLM_CONFIG_DEFAULTED_FUNCTIONS != GLM_DISABLE + : real(qua()) + , dual(qua(0, 0, 0, 0)) +# endif + {} + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR tdualquat::tdualquat(tdualquat const& d) + : real(d.real) + , dual(d.dual) + {} +# endif + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR tdualquat::tdualquat(tdualquat const& d) + : real(d.real) + , dual(d.dual) + {} + + // -- Explicit basic constructors -- + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR tdualquat::tdualquat(qua const& r) + : real(r), dual(qua(0, 0, 0, 0)) + {} + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR tdualquat::tdualquat(qua const& q, vec<3, T, Q> const& p) + : real(q), dual( + T(-0.5) * ( p.x*q.x + p.y*q.y + p.z*q.z), + T(+0.5) * ( p.x*q.w + p.y*q.z - p.z*q.y), + T(+0.5) * (-p.x*q.z + p.y*q.w + p.z*q.x), + T(+0.5) * ( p.x*q.y - p.y*q.x + p.z*q.w)) + {} + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR tdualquat::tdualquat(qua const& r, qua const& d) + : real(r), dual(d) + {} + + // -- Conversion constructors -- + + template + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR tdualquat::tdualquat(tdualquat const& q) + : real(q.real) + , dual(q.dual) + {} + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR tdualquat::tdualquat(mat<2, 4, T, Q> const& m) + { + *this = dualquat_cast(m); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR tdualquat::tdualquat(mat<3, 4, T, Q> const& m) + { + *this = dualquat_cast(m); + } + + // -- Unary arithmetic operators -- + +# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE + template + GLM_FUNC_QUALIFIER tdualquat & tdualquat::operator=(tdualquat const& q) + { + this->real = q.real; + this->dual = q.dual; + return *this; + } +# endif + + template + template + GLM_FUNC_QUALIFIER tdualquat & tdualquat::operator=(tdualquat const& q) + { + this->real = q.real; + this->dual = q.dual; + return *this; + } + + template + template + GLM_FUNC_QUALIFIER tdualquat & tdualquat::operator*=(U s) + { + this->real *= static_cast(s); + this->dual *= static_cast(s); + return *this; + } + + template + template + GLM_FUNC_QUALIFIER tdualquat & tdualquat::operator/=(U s) + { + this->real /= static_cast(s); + this->dual /= static_cast(s); + return *this; + } + + // -- Unary bit operators -- + + template + GLM_FUNC_QUALIFIER tdualquat operator+(tdualquat const& q) + { + return q; + } + + template + GLM_FUNC_QUALIFIER tdualquat operator-(tdualquat const& q) + { + return tdualquat(-q.real, -q.dual); + } + + // -- Binary operators -- + + template + GLM_FUNC_QUALIFIER tdualquat operator+(tdualquat const& q, tdualquat const& p) + { + return tdualquat(q.real + p.real,q.dual + p.dual); + } + + template + GLM_FUNC_QUALIFIER tdualquat operator*(tdualquat const& p, tdualquat const& o) + { + return tdualquat(p.real * o.real,p.real * o.dual + p.dual * o.real); + } + + template + GLM_FUNC_QUALIFIER vec<3, T, Q> operator*(tdualquat const& q, vec<3, T, Q> const& v) + { + vec<3, T, Q> const real_v3(q.real.x,q.real.y,q.real.z); + vec<3, T, Q> const dual_v3(q.dual.x,q.dual.y,q.dual.z); + return (cross(real_v3, cross(real_v3,v) + v * q.real.w + dual_v3) + dual_v3 * q.real.w - real_v3 * q.dual.w) * T(2) + v; + } + + template + GLM_FUNC_QUALIFIER vec<3, T, Q> operator*(vec<3, T, Q> const& v, tdualquat const& q) + { + return glm::inverse(q) * v; + } + + template + GLM_FUNC_QUALIFIER vec<4, T, Q> operator*(tdualquat const& q, vec<4, T, Q> const& v) + { + return vec<4, T, Q>(q * vec<3, T, Q>(v), v.w); + } + + template + GLM_FUNC_QUALIFIER vec<4, T, Q> operator*(vec<4, T, Q> const& v, tdualquat const& q) + { + return glm::inverse(q) * v; + } + + template + GLM_FUNC_QUALIFIER tdualquat operator*(tdualquat const& q, T const& s) + { + return tdualquat(q.real * s, q.dual * s); + } + + template + GLM_FUNC_QUALIFIER tdualquat operator*(T const& s, tdualquat const& q) + { + return q * s; + } + + template + GLM_FUNC_QUALIFIER tdualquat operator/(tdualquat const& q, T const& s) + { + return tdualquat(q.real / s, q.dual / s); + } + + // -- Boolean operators -- + + template + GLM_FUNC_QUALIFIER bool operator==(tdualquat const& q1, tdualquat const& q2) + { + return (q1.real == q2.real) && (q1.dual == q2.dual); + } + + template + GLM_FUNC_QUALIFIER bool operator!=(tdualquat const& q1, tdualquat const& q2) + { + return (q1.real != q2.real) || (q1.dual != q2.dual); + } + + // -- Operations -- + + template + GLM_FUNC_QUALIFIER tdualquat dual_quat_identity() + { + return tdualquat( + qua(static_cast(1), static_cast(0), static_cast(0), static_cast(0)), + qua(static_cast(0), static_cast(0), static_cast(0), static_cast(0))); + } + + template + GLM_FUNC_QUALIFIER tdualquat normalize(tdualquat const& q) + { + return q / length(q.real); + } + + template + GLM_FUNC_QUALIFIER tdualquat lerp(tdualquat const& x, tdualquat const& y, T const& a) + { + // Dual Quaternion Linear blend aka DLB: + // Lerp is only defined in [0, 1] + assert(a >= static_cast(0)); + assert(a <= static_cast(1)); + T const k = dot(x.real,y.real) < static_cast(0) ? -a : a; + T const one(1); + return tdualquat(x * (one - a) + y * k); + } + + template + GLM_FUNC_QUALIFIER tdualquat inverse(tdualquat const& q) + { + const glm::qua real = conjugate(q.real); + const glm::qua dual = conjugate(q.dual); + return tdualquat(real, dual + (real * (-2.0f * dot(real,dual)))); + } + + template + GLM_FUNC_QUALIFIER mat<2, 4, T, Q> mat2x4_cast(tdualquat const& x) + { + return mat<2, 4, T, Q>( x[0].x, x[0].y, x[0].z, x[0].w, x[1].x, x[1].y, x[1].z, x[1].w ); + } + + template + GLM_FUNC_QUALIFIER mat<3, 4, T, Q> mat3x4_cast(tdualquat const& x) + { + qua r = x.real / length2(x.real); + + qua const rr(r.w * x.real.w, r.x * x.real.x, r.y * x.real.y, r.z * x.real.z); + r *= static_cast(2); + + T const xy = r.x * x.real.y; + T const xz = r.x * x.real.z; + T const yz = r.y * x.real.z; + T const wx = r.w * x.real.x; + T const wy = r.w * x.real.y; + T const wz = r.w * x.real.z; + + vec<4, T, Q> const a( + rr.w + rr.x - rr.y - rr.z, + xy - wz, + xz + wy, + -(x.dual.w * r.x - x.dual.x * r.w + x.dual.y * r.z - x.dual.z * r.y)); + + vec<4, T, Q> const b( + xy + wz, + rr.w + rr.y - rr.x - rr.z, + yz - wx, + -(x.dual.w * r.y - x.dual.x * r.z - x.dual.y * r.w + x.dual.z * r.x)); + + vec<4, T, Q> const c( + xz - wy, + yz + wx, + rr.w + rr.z - rr.x - rr.y, + -(x.dual.w * r.z + x.dual.x * r.y - x.dual.y * r.x - x.dual.z * r.w)); + + return mat<3, 4, T, Q>(a, b, c); + } + + template + GLM_FUNC_QUALIFIER tdualquat dualquat_cast(mat<2, 4, T, Q> const& x) + { + return tdualquat( + qua( x[0].w, x[0].x, x[0].y, x[0].z ), + qua( x[1].w, x[1].x, x[1].y, x[1].z )); + } + + template + GLM_FUNC_QUALIFIER tdualquat dualquat_cast(mat<3, 4, T, Q> const& x) + { + qua real; + + T const trace = x[0].x + x[1].y + x[2].z; + if(trace > static_cast(0)) + { + T const r = sqrt(T(1) + trace); + T const invr = static_cast(0.5) / r; + real.w = static_cast(0.5) * r; + real.x = (x[2].y - x[1].z) * invr; + real.y = (x[0].z - x[2].x) * invr; + real.z = (x[1].x - x[0].y) * invr; + } + else if(x[0].x > x[1].y && x[0].x > x[2].z) + { + T const r = sqrt(T(1) + x[0].x - x[1].y - x[2].z); + T const invr = static_cast(0.5) / r; + real.x = static_cast(0.5)*r; + real.y = (x[1].x + x[0].y) * invr; + real.z = (x[0].z + x[2].x) * invr; + real.w = (x[2].y - x[1].z) * invr; + } + else if(x[1].y > x[2].z) + { + T const r = sqrt(T(1) + x[1].y - x[0].x - x[2].z); + T const invr = static_cast(0.5) / r; + real.x = (x[1].x + x[0].y) * invr; + real.y = static_cast(0.5) * r; + real.z = (x[2].y + x[1].z) * invr; + real.w = (x[0].z - x[2].x) * invr; + } + else + { + T const r = sqrt(T(1) + x[2].z - x[0].x - x[1].y); + T const invr = static_cast(0.5) / r; + real.x = (x[0].z + x[2].x) * invr; + real.y = (x[2].y + x[1].z) * invr; + real.z = static_cast(0.5) * r; + real.w = (x[1].x - x[0].y) * invr; + } + + qua dual; + dual.x = static_cast(0.5) * ( x[0].w * real.w + x[1].w * real.z - x[2].w * real.y); + dual.y = static_cast(0.5) * (-x[0].w * real.z + x[1].w * real.w + x[2].w * real.x); + dual.z = static_cast(0.5) * ( x[0].w * real.y - x[1].w * real.x + x[2].w * real.w); + dual.w = -static_cast(0.5) * ( x[0].w * real.x + x[1].w * real.y + x[2].w * real.z); + return tdualquat(real, dual); + } +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/easing.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/easing.hpp new file mode 100644 index 0000000000000000000000000000000000000000..27a7fe615e317ae78a335a46fdb5ce3759a6b586 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/easing.hpp @@ -0,0 +1,219 @@ +/// @ref gtx_easing +/// @file glm/gtx/easing.hpp +/// @author Robert Chisholm +/// +/// @see core (dependence) +/// +/// @defgroup gtx_easing GLM_GTX_easing +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Easing functions for animations and transitions +/// All functions take a parameter x in the range [0.0,1.0] +/// +/// Based on the AHEasing project of Warren Moore (https://github.com/warrenm/AHEasing) + +#pragma once + +// Dependency: +#include "../glm.hpp" +#include "../gtc/constants.hpp" +#include "../detail/qualifier.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_easing is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_easing extension included") +# endif +#endif + +namespace glm{ + /// @addtogroup gtx_easing + /// @{ + + /// Modelled after the line y = x + /// @see gtx_easing + template + GLM_FUNC_DECL genType linearInterpolation(genType const & a); + + /// Modelled after the parabola y = x^2 + /// @see gtx_easing + template + GLM_FUNC_DECL genType quadraticEaseIn(genType const & a); + + /// Modelled after the parabola y = -x^2 + 2x + /// @see gtx_easing + template + GLM_FUNC_DECL genType quadraticEaseOut(genType const & a); + + /// Modelled after the piecewise quadratic + /// y = (1/2)((2x)^2) ; [0, 0.5) + /// y = -(1/2)((2x-1)*(2x-3) - 1) ; [0.5, 1] + /// @see gtx_easing + template + GLM_FUNC_DECL genType quadraticEaseInOut(genType const & a); + + /// Modelled after the cubic y = x^3 + template + GLM_FUNC_DECL genType cubicEaseIn(genType const & a); + + /// Modelled after the cubic y = (x - 1)^3 + 1 + /// @see gtx_easing + template + GLM_FUNC_DECL genType cubicEaseOut(genType const & a); + + /// Modelled after the piecewise cubic + /// y = (1/2)((2x)^3) ; [0, 0.5) + /// y = (1/2)((2x-2)^3 + 2) ; [0.5, 1] + /// @see gtx_easing + template + GLM_FUNC_DECL genType cubicEaseInOut(genType const & a); + + /// Modelled after the quartic x^4 + /// @see gtx_easing + template + GLM_FUNC_DECL genType quarticEaseIn(genType const & a); + + /// Modelled after the quartic y = 1 - (x - 1)^4 + /// @see gtx_easing + template + GLM_FUNC_DECL genType quarticEaseOut(genType const & a); + + /// Modelled after the piecewise quartic + /// y = (1/2)((2x)^4) ; [0, 0.5) + /// y = -(1/2)((2x-2)^4 - 2) ; [0.5, 1] + /// @see gtx_easing + template + GLM_FUNC_DECL genType quarticEaseInOut(genType const & a); + + /// Modelled after the quintic y = x^5 + /// @see gtx_easing + template + GLM_FUNC_DECL genType quinticEaseIn(genType const & a); + + /// Modelled after the quintic y = (x - 1)^5 + 1 + /// @see gtx_easing + template + GLM_FUNC_DECL genType quinticEaseOut(genType const & a); + + /// Modelled after the piecewise quintic + /// y = (1/2)((2x)^5) ; [0, 0.5) + /// y = (1/2)((2x-2)^5 + 2) ; [0.5, 1] + /// @see gtx_easing + template + GLM_FUNC_DECL genType quinticEaseInOut(genType const & a); + + /// Modelled after quarter-cycle of sine wave + /// @see gtx_easing + template + GLM_FUNC_DECL genType sineEaseIn(genType const & a); + + /// Modelled after quarter-cycle of sine wave (different phase) + /// @see gtx_easing + template + GLM_FUNC_DECL genType sineEaseOut(genType const & a); + + /// Modelled after half sine wave + /// @see gtx_easing + template + GLM_FUNC_DECL genType sineEaseInOut(genType const & a); + + /// Modelled after shifted quadrant IV of unit circle + /// @see gtx_easing + template + GLM_FUNC_DECL genType circularEaseIn(genType const & a); + + /// Modelled after shifted quadrant II of unit circle + /// @see gtx_easing + template + GLM_FUNC_DECL genType circularEaseOut(genType const & a); + + /// Modelled after the piecewise circular function + /// y = (1/2)(1 - sqrt(1 - 4x^2)) ; [0, 0.5) + /// y = (1/2)(sqrt(-(2x - 3)*(2x - 1)) + 1) ; [0.5, 1] + /// @see gtx_easing + template + GLM_FUNC_DECL genType circularEaseInOut(genType const & a); + + /// Modelled after the exponential function y = 2^(10(x - 1)) + /// @see gtx_easing + template + GLM_FUNC_DECL genType exponentialEaseIn(genType const & a); + + /// Modelled after the exponential function y = -2^(-10x) + 1 + /// @see gtx_easing + template + GLM_FUNC_DECL genType exponentialEaseOut(genType const & a); + + /// Modelled after the piecewise exponential + /// y = (1/2)2^(10(2x - 1)) ; [0,0.5) + /// y = -(1/2)*2^(-10(2x - 1))) + 1 ; [0.5,1] + /// @see gtx_easing + template + GLM_FUNC_DECL genType exponentialEaseInOut(genType const & a); + + /// Modelled after the damped sine wave y = sin(13pi/2*x)*pow(2, 10 * (x - 1)) + /// @see gtx_easing + template + GLM_FUNC_DECL genType elasticEaseIn(genType const & a); + + /// Modelled after the damped sine wave y = sin(-13pi/2*(x + 1))*pow(2, -10x) + 1 + /// @see gtx_easing + template + GLM_FUNC_DECL genType elasticEaseOut(genType const & a); + + /// Modelled after the piecewise exponentially-damped sine wave: + /// y = (1/2)*sin(13pi/2*(2*x))*pow(2, 10 * ((2*x) - 1)) ; [0,0.5) + /// y = (1/2)*(sin(-13pi/2*((2x-1)+1))*pow(2,-10(2*x-1)) + 2) ; [0.5, 1] + /// @see gtx_easing + template + GLM_FUNC_DECL genType elasticEaseInOut(genType const & a); + + /// @see gtx_easing + template + GLM_FUNC_DECL genType backEaseIn(genType const& a); + + /// @see gtx_easing + template + GLM_FUNC_DECL genType backEaseOut(genType const& a); + + /// @see gtx_easing + template + GLM_FUNC_DECL genType backEaseInOut(genType const& a); + + /// @param a parameter + /// @param o Optional overshoot modifier + /// @see gtx_easing + template + GLM_FUNC_DECL genType backEaseIn(genType const& a, genType const& o); + + /// @param a parameter + /// @param o Optional overshoot modifier + /// @see gtx_easing + template + GLM_FUNC_DECL genType backEaseOut(genType const& a, genType const& o); + + /// @param a parameter + /// @param o Optional overshoot modifier + /// @see gtx_easing + template + GLM_FUNC_DECL genType backEaseInOut(genType const& a, genType const& o); + + /// @see gtx_easing + template + GLM_FUNC_DECL genType bounceEaseIn(genType const& a); + + /// @see gtx_easing + template + GLM_FUNC_DECL genType bounceEaseOut(genType const& a); + + /// @see gtx_easing + template + GLM_FUNC_DECL genType bounceEaseInOut(genType const& a); + + /// @} +}//namespace glm + +#include "easing.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/easing.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/easing.inl new file mode 100644 index 0000000000000000000000000000000000000000..7552fa5b8e73d5e871794ede9c009d2212c1ee2e --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/easing.inl @@ -0,0 +1,436 @@ +/// @ref gtx_easing + +#include + +namespace glm{ + + template + GLM_FUNC_QUALIFIER genType linearInterpolation(genType const& a) + { + // Only defined in [0, 1] + assert(a >= zero()); + assert(a <= one()); + + return a; + } + + template + GLM_FUNC_QUALIFIER genType quadraticEaseIn(genType const& a) + { + // Only defined in [0, 1] + assert(a >= zero()); + assert(a <= one()); + + return a * a; + } + + template + GLM_FUNC_QUALIFIER genType quadraticEaseOut(genType const& a) + { + // Only defined in [0, 1] + assert(a >= zero()); + assert(a <= one()); + + return -(a * (a - static_cast(2))); + } + + template + GLM_FUNC_QUALIFIER genType quadraticEaseInOut(genType const& a) + { + // Only defined in [0, 1] + assert(a >= zero()); + assert(a <= one()); + + if(a < static_cast(0.5)) + { + return static_cast(2) * a * a; + } + else + { + return (-static_cast(2) * a * a) + (4 * a) - one(); + } + } + + template + GLM_FUNC_QUALIFIER genType cubicEaseIn(genType const& a) + { + // Only defined in [0, 1] + assert(a >= zero()); + assert(a <= one()); + + return a * a * a; + } + + template + GLM_FUNC_QUALIFIER genType cubicEaseOut(genType const& a) + { + // Only defined in [0, 1] + assert(a >= zero()); + assert(a <= one()); + + genType const f = a - one(); + return f * f * f + one(); + } + + template + GLM_FUNC_QUALIFIER genType cubicEaseInOut(genType const& a) + { + // Only defined in [0, 1] + assert(a >= zero()); + assert(a <= one()); + + if (a < static_cast(0.5)) + { + return static_cast(4) * a * a * a; + } + else + { + genType const f = ((static_cast(2) * a) - static_cast(2)); + return static_cast(0.5) * f * f * f + one(); + } + } + + template + GLM_FUNC_QUALIFIER genType quarticEaseIn(genType const& a) + { + // Only defined in [0, 1] + assert(a >= zero()); + assert(a <= one()); + + return a * a * a * a; + } + + template + GLM_FUNC_QUALIFIER genType quarticEaseOut(genType const& a) + { + // Only defined in [0, 1] + assert(a >= zero()); + assert(a <= one()); + + genType const f = (a - one()); + return f * f * f * (one() - a) + one(); + } + + template + GLM_FUNC_QUALIFIER genType quarticEaseInOut(genType const& a) + { + // Only defined in [0, 1] + assert(a >= zero()); + assert(a <= one()); + + if(a < static_cast(0.5)) + { + return static_cast(8) * a * a * a * a; + } + else + { + genType const f = (a - one()); + return -static_cast(8) * f * f * f * f + one(); + } + } + + template + GLM_FUNC_QUALIFIER genType quinticEaseIn(genType const& a) + { + // Only defined in [0, 1] + assert(a >= zero()); + assert(a <= one()); + + return a * a * a * a * a; + } + + template + GLM_FUNC_QUALIFIER genType quinticEaseOut(genType const& a) + { + // Only defined in [0, 1] + assert(a >= zero()); + assert(a <= one()); + + genType const f = (a - one()); + return f * f * f * f * f + one(); + } + + template + GLM_FUNC_QUALIFIER genType quinticEaseInOut(genType const& a) + { + // Only defined in [0, 1] + assert(a >= zero()); + assert(a <= one()); + + if(a < static_cast(0.5)) + { + return static_cast(16) * a * a * a * a * a; + } + else + { + genType const f = ((static_cast(2) * a) - static_cast(2)); + return static_cast(0.5) * f * f * f * f * f + one(); + } + } + + template + GLM_FUNC_QUALIFIER genType sineEaseIn(genType const& a) + { + // Only defined in [0, 1] + assert(a >= zero()); + assert(a <= one()); + + return sin((a - one()) * half_pi()) + one(); + } + + template + GLM_FUNC_QUALIFIER genType sineEaseOut(genType const& a) + { + // Only defined in [0, 1] + assert(a >= zero()); + assert(a <= one()); + + return sin(a * half_pi()); + } + + template + GLM_FUNC_QUALIFIER genType sineEaseInOut(genType const& a) + { + // Only defined in [0, 1] + assert(a >= zero()); + assert(a <= one()); + + return static_cast(0.5) * (one() - cos(a * pi())); + } + + template + GLM_FUNC_QUALIFIER genType circularEaseIn(genType const& a) + { + // Only defined in [0, 1] + assert(a >= zero()); + assert(a <= one()); + + return one() - sqrt(one() - (a * a)); + } + + template + GLM_FUNC_QUALIFIER genType circularEaseOut(genType const& a) + { + // Only defined in [0, 1] + assert(a >= zero()); + assert(a <= one()); + + return sqrt((static_cast(2) - a) * a); + } + + template + GLM_FUNC_QUALIFIER genType circularEaseInOut(genType const& a) + { + // Only defined in [0, 1] + assert(a >= zero()); + assert(a <= one()); + + if(a < static_cast(0.5)) + { + return static_cast(0.5) * (one() - std::sqrt(one() - static_cast(4) * (a * a))); + } + else + { + return static_cast(0.5) * (std::sqrt(-((static_cast(2) * a) - static_cast(3)) * ((static_cast(2) * a) - one())) + one()); + } + } + + template + GLM_FUNC_QUALIFIER genType exponentialEaseIn(genType const& a) + { + // Only defined in [0, 1] + assert(a >= zero()); + assert(a <= one()); + + if(a <= zero()) + return a; + else + { + genType const Complementary = a - one(); + genType const Two = static_cast(2); + + return glm::pow(Two, Complementary * static_cast(10)); + } + } + + template + GLM_FUNC_QUALIFIER genType exponentialEaseOut(genType const& a) + { + // Only defined in [0, 1] + assert(a >= zero()); + assert(a <= one()); + + if(a >= one()) + return a; + else + { + return one() - glm::pow(static_cast(2), -static_cast(10) * a); + } + } + + template + GLM_FUNC_QUALIFIER genType exponentialEaseInOut(genType const& a) + { + // Only defined in [0, 1] + assert(a >= zero()); + assert(a <= one()); + + if(a < static_cast(0.5)) + return static_cast(0.5) * glm::pow(static_cast(2), (static_cast(20) * a) - static_cast(10)); + else + return -static_cast(0.5) * glm::pow(static_cast(2), (-static_cast(20) * a) + static_cast(10)) + one(); + } + + template + GLM_FUNC_QUALIFIER genType elasticEaseIn(genType const& a) + { + // Only defined in [0, 1] + assert(a >= zero()); + assert(a <= one()); + + return std::sin(static_cast(13) * half_pi() * a) * glm::pow(static_cast(2), static_cast(10) * (a - one())); + } + + template + GLM_FUNC_QUALIFIER genType elasticEaseOut(genType const& a) + { + // Only defined in [0, 1] + assert(a >= zero()); + assert(a <= one()); + + return std::sin(-static_cast(13) * half_pi() * (a + one())) * glm::pow(static_cast(2), -static_cast(10) * a) + one(); + } + + template + GLM_FUNC_QUALIFIER genType elasticEaseInOut(genType const& a) + { + // Only defined in [0, 1] + assert(a >= zero()); + assert(a <= one()); + + if(a < static_cast(0.5)) + return static_cast(0.5) * std::sin(static_cast(13) * half_pi() * (static_cast(2) * a)) * glm::pow(static_cast(2), static_cast(10) * ((static_cast(2) * a) - one())); + else + return static_cast(0.5) * (std::sin(-static_cast(13) * half_pi() * ((static_cast(2) * a - one()) + one())) * glm::pow(static_cast(2), -static_cast(10) * (static_cast(2) * a - one())) + static_cast(2)); + } + + template + GLM_FUNC_QUALIFIER genType backEaseIn(genType const& a, genType const& o) + { + // Only defined in [0, 1] + assert(a >= zero()); + assert(a <= one()); + + genType z = ((o + one()) * a) - o; + return (a * a * z); + } + + template + GLM_FUNC_QUALIFIER genType backEaseOut(genType const& a, genType const& o) + { + // Only defined in [0, 1] + assert(a >= zero()); + assert(a <= one()); + + genType n = a - one(); + genType z = ((o + one()) * n) + o; + return (n * n * z) + one(); + } + + template + GLM_FUNC_QUALIFIER genType backEaseInOut(genType const& a, genType const& o) + { + // Only defined in [0, 1] + assert(a >= zero()); + assert(a <= one()); + + genType s = o * static_cast(1.525); + genType x = static_cast(0.5); + genType n = a / static_cast(0.5); + + if (n < static_cast(1)) + { + genType z = ((s + static_cast(1)) * n) - s; + genType m = n * n * z; + return x * m; + } + else + { + n -= static_cast(2); + genType z = ((s + static_cast(1)) * n) + s; + genType m = (n*n*z) + static_cast(2); + return x * m; + } + } + + template + GLM_FUNC_QUALIFIER genType backEaseIn(genType const& a) + { + return backEaseIn(a, static_cast(1.70158)); + } + + template + GLM_FUNC_QUALIFIER genType backEaseOut(genType const& a) + { + return backEaseOut(a, static_cast(1.70158)); + } + + template + GLM_FUNC_QUALIFIER genType backEaseInOut(genType const& a) + { + return backEaseInOut(a, static_cast(1.70158)); + } + + template + GLM_FUNC_QUALIFIER genType bounceEaseOut(genType const& a) + { + // Only defined in [0, 1] + assert(a >= zero()); + assert(a <= one()); + + if(a < static_cast(4.0 / 11.0)) + { + return (static_cast(121) * a * a) / static_cast(16); + } + else if(a < static_cast(8.0 / 11.0)) + { + return (static_cast(363.0 / 40.0) * a * a) - (static_cast(99.0 / 10.0) * a) + static_cast(17.0 / 5.0); + } + else if(a < static_cast(9.0 / 10.0)) + { + return (static_cast(4356.0 / 361.0) * a * a) - (static_cast(35442.0 / 1805.0) * a) + static_cast(16061.0 / 1805.0); + } + else + { + return (static_cast(54.0 / 5.0) * a * a) - (static_cast(513.0 / 25.0) * a) + static_cast(268.0 / 25.0); + } + } + + template + GLM_FUNC_QUALIFIER genType bounceEaseIn(genType const& a) + { + // Only defined in [0, 1] + assert(a >= zero()); + assert(a <= one()); + + return one() - bounceEaseOut(one() - a); + } + + template + GLM_FUNC_QUALIFIER genType bounceEaseInOut(genType const& a) + { + // Only defined in [0, 1] + assert(a >= zero()); + assert(a <= one()); + + if(a < static_cast(0.5)) + { + return static_cast(0.5) * (one() - bounceEaseOut(one() - a * static_cast(2))); + } + else + { + return static_cast(0.5) * bounceEaseOut(a * static_cast(2) - one()) + static_cast(0.5); + } + } + +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/euler_angles.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/euler_angles.hpp new file mode 100644 index 0000000000000000000000000000000000000000..88639c3436fd4abc9e59f0167d03b204a1f81f93 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/euler_angles.hpp @@ -0,0 +1,335 @@ +/// @ref gtx_euler_angles +/// @file glm/gtx/euler_angles.hpp +/// +/// @see core (dependence) +/// +/// @defgroup gtx_euler_angles GLM_GTX_euler_angles +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Build matrices from Euler angles. +/// +/// Extraction of Euler angles from rotation matrix. +/// Based on the original paper 2014 Mike Day - Extracting Euler Angles from a Rotation Matrix. + +#pragma once + +// Dependency: +#include "../glm.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_euler_angles is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_euler_angles extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_euler_angles + /// @{ + + /// Creates a 3D 4 * 4 homogeneous rotation matrix from an euler angle X. + /// @see gtx_euler_angles + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> eulerAngleX( + T const& angleX); + + /// Creates a 3D 4 * 4 homogeneous rotation matrix from an euler angle Y. + /// @see gtx_euler_angles + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> eulerAngleY( + T const& angleY); + + /// Creates a 3D 4 * 4 homogeneous rotation matrix from an euler angle Z. + /// @see gtx_euler_angles + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> eulerAngleZ( + T const& angleZ); + + /// Creates a 3D 4 * 4 homogeneous derived matrix from the rotation matrix about X-axis. + /// @see gtx_euler_angles + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> derivedEulerAngleX( + T const & angleX, T const & angularVelocityX); + + /// Creates a 3D 4 * 4 homogeneous derived matrix from the rotation matrix about Y-axis. + /// @see gtx_euler_angles + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> derivedEulerAngleY( + T const & angleY, T const & angularVelocityY); + + /// Creates a 3D 4 * 4 homogeneous derived matrix from the rotation matrix about Z-axis. + /// @see gtx_euler_angles + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> derivedEulerAngleZ( + T const & angleZ, T const & angularVelocityZ); + + /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (X * Y). + /// @see gtx_euler_angles + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> eulerAngleXY( + T const& angleX, + T const& angleY); + + /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Y * X). + /// @see gtx_euler_angles + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> eulerAngleYX( + T const& angleY, + T const& angleX); + + /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (X * Z). + /// @see gtx_euler_angles + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> eulerAngleXZ( + T const& angleX, + T const& angleZ); + + /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Z * X). + /// @see gtx_euler_angles + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> eulerAngleZX( + T const& angle, + T const& angleX); + + /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Y * Z). + /// @see gtx_euler_angles + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> eulerAngleYZ( + T const& angleY, + T const& angleZ); + + /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Z * Y). + /// @see gtx_euler_angles + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> eulerAngleZY( + T const& angleZ, + T const& angleY); + + /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (X * Y * Z). + /// @see gtx_euler_angles + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> eulerAngleXYZ( + T const& t1, + T const& t2, + T const& t3); + + /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Y * X * Z). + /// @see gtx_euler_angles + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> eulerAngleYXZ( + T const& yaw, + T const& pitch, + T const& roll); + + /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (X * Z * X). + /// @see gtx_euler_angles + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> eulerAngleXZX( + T const & t1, + T const & t2, + T const & t3); + + /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (X * Y * X). + /// @see gtx_euler_angles + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> eulerAngleXYX( + T const & t1, + T const & t2, + T const & t3); + + /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Y * X * Y). + /// @see gtx_euler_angles + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> eulerAngleYXY( + T const & t1, + T const & t2, + T const & t3); + + /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Y * Z * Y). + /// @see gtx_euler_angles + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> eulerAngleYZY( + T const & t1, + T const & t2, + T const & t3); + + /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Z * Y * Z). + /// @see gtx_euler_angles + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> eulerAngleZYZ( + T const & t1, + T const & t2, + T const & t3); + + /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Z * X * Z). + /// @see gtx_euler_angles + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> eulerAngleZXZ( + T const & t1, + T const & t2, + T const & t3); + + /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (X * Z * Y). + /// @see gtx_euler_angles + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> eulerAngleXZY( + T const & t1, + T const & t2, + T const & t3); + + /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Y * Z * X). + /// @see gtx_euler_angles + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> eulerAngleYZX( + T const & t1, + T const & t2, + T const & t3); + + /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Z * Y * X). + /// @see gtx_euler_angles + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> eulerAngleZYX( + T const & t1, + T const & t2, + T const & t3); + + /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Z * X * Y). + /// @see gtx_euler_angles + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> eulerAngleZXY( + T const & t1, + T const & t2, + T const & t3); + + /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Y * X * Z). + /// @see gtx_euler_angles + template + GLM_FUNC_DECL mat<4, 4, T, defaultp> yawPitchRoll( + T const& yaw, + T const& pitch, + T const& roll); + + /// Creates a 2D 2 * 2 rotation matrix from an euler angle. + /// @see gtx_euler_angles + template + GLM_FUNC_DECL mat<2, 2, T, defaultp> orientate2(T const& angle); + + /// Creates a 2D 4 * 4 homogeneous rotation matrix from an euler angle. + /// @see gtx_euler_angles + template + GLM_FUNC_DECL mat<3, 3, T, defaultp> orientate3(T const& angle); + + /// Creates a 3D 3 * 3 rotation matrix from euler angles (Y * X * Z). + /// @see gtx_euler_angles + template + GLM_FUNC_DECL mat<3, 3, T, Q> orientate3(vec<3, T, Q> const& angles); + + /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Y * X * Z). + /// @see gtx_euler_angles + template + GLM_FUNC_DECL mat<4, 4, T, Q> orientate4(vec<3, T, Q> const& angles); + + /// Extracts the (X * Y * Z) Euler angles from the rotation matrix M + /// @see gtx_euler_angles + template + GLM_FUNC_DECL void extractEulerAngleXYZ(mat<4, 4, T, defaultp> const& M, + T & t1, + T & t2, + T & t3); + + /// Extracts the (Y * X * Z) Euler angles from the rotation matrix M + /// @see gtx_euler_angles + template + GLM_FUNC_DECL void extractEulerAngleYXZ(mat<4, 4, T, defaultp> const & M, + T & t1, + T & t2, + T & t3); + + /// Extracts the (X * Z * X) Euler angles from the rotation matrix M + /// @see gtx_euler_angles + template + GLM_FUNC_DECL void extractEulerAngleXZX(mat<4, 4, T, defaultp> const & M, + T & t1, + T & t2, + T & t3); + + /// Extracts the (X * Y * X) Euler angles from the rotation matrix M + /// @see gtx_euler_angles + template + GLM_FUNC_DECL void extractEulerAngleXYX(mat<4, 4, T, defaultp> const & M, + T & t1, + T & t2, + T & t3); + + /// Extracts the (Y * X * Y) Euler angles from the rotation matrix M + /// @see gtx_euler_angles + template + GLM_FUNC_DECL void extractEulerAngleYXY(mat<4, 4, T, defaultp> const & M, + T & t1, + T & t2, + T & t3); + + /// Extracts the (Y * Z * Y) Euler angles from the rotation matrix M + /// @see gtx_euler_angles + template + GLM_FUNC_DECL void extractEulerAngleYZY(mat<4, 4, T, defaultp> const & M, + T & t1, + T & t2, + T & t3); + + /// Extracts the (Z * Y * Z) Euler angles from the rotation matrix M + /// @see gtx_euler_angles + template + GLM_FUNC_DECL void extractEulerAngleZYZ(mat<4, 4, T, defaultp> const & M, + T & t1, + T & t2, + T & t3); + + /// Extracts the (Z * X * Z) Euler angles from the rotation matrix M + /// @see gtx_euler_angles + template + GLM_FUNC_DECL void extractEulerAngleZXZ(mat<4, 4, T, defaultp> const & M, + T & t1, + T & t2, + T & t3); + + /// Extracts the (X * Z * Y) Euler angles from the rotation matrix M + /// @see gtx_euler_angles + template + GLM_FUNC_DECL void extractEulerAngleXZY(mat<4, 4, T, defaultp> const & M, + T & t1, + T & t2, + T & t3); + + /// Extracts the (Y * Z * X) Euler angles from the rotation matrix M + /// @see gtx_euler_angles + template + GLM_FUNC_DECL void extractEulerAngleYZX(mat<4, 4, T, defaultp> const & M, + T & t1, + T & t2, + T & t3); + + /// Extracts the (Z * Y * X) Euler angles from the rotation matrix M + /// @see gtx_euler_angles + template + GLM_FUNC_DECL void extractEulerAngleZYX(mat<4, 4, T, defaultp> const & M, + T & t1, + T & t2, + T & t3); + + /// Extracts the (Z * X * Y) Euler angles from the rotation matrix M + /// @see gtx_euler_angles + template + GLM_FUNC_DECL void extractEulerAngleZXY(mat<4, 4, T, defaultp> const & M, + T & t1, + T & t2, + T & t3); + + /// @} +}//namespace glm + +#include "euler_angles.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/euler_angles.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/euler_angles.inl new file mode 100644 index 0000000000000000000000000000000000000000..75c4c612759f7b0dadf89cddcf5ff1b45dbdffc3 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/euler_angles.inl @@ -0,0 +1,899 @@ +/// @ref gtx_euler_angles + +#include "compatibility.hpp" // glm::atan2 + +namespace glm +{ + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> eulerAngleX + ( + T const& angleX + ) + { + T cosX = glm::cos(angleX); + T sinX = glm::sin(angleX); + + return mat<4, 4, T, defaultp>( + T(1), T(0), T(0), T(0), + T(0), cosX, sinX, T(0), + T(0),-sinX, cosX, T(0), + T(0), T(0), T(0), T(1)); + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> eulerAngleY + ( + T const& angleY + ) + { + T cosY = glm::cos(angleY); + T sinY = glm::sin(angleY); + + return mat<4, 4, T, defaultp>( + cosY, T(0), -sinY, T(0), + T(0), T(1), T(0), T(0), + sinY, T(0), cosY, T(0), + T(0), T(0), T(0), T(1)); + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> eulerAngleZ + ( + T const& angleZ + ) + { + T cosZ = glm::cos(angleZ); + T sinZ = glm::sin(angleZ); + + return mat<4, 4, T, defaultp>( + cosZ, sinZ, T(0), T(0), + -sinZ, cosZ, T(0), T(0), + T(0), T(0), T(1), T(0), + T(0), T(0), T(0), T(1)); + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> derivedEulerAngleX + ( + T const & angleX, + T const & angularVelocityX + ) + { + T cosX = glm::cos(angleX) * angularVelocityX; + T sinX = glm::sin(angleX) * angularVelocityX; + + return mat<4, 4, T, defaultp>( + T(0), T(0), T(0), T(0), + T(0),-sinX, cosX, T(0), + T(0),-cosX,-sinX, T(0), + T(0), T(0), T(0), T(0)); + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> derivedEulerAngleY + ( + T const & angleY, + T const & angularVelocityY + ) + { + T cosY = glm::cos(angleY) * angularVelocityY; + T sinY = glm::sin(angleY) * angularVelocityY; + + return mat<4, 4, T, defaultp>( + -sinY, T(0), -cosY, T(0), + T(0), T(0), T(0), T(0), + cosY, T(0), -sinY, T(0), + T(0), T(0), T(0), T(0)); + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> derivedEulerAngleZ + ( + T const & angleZ, + T const & angularVelocityZ + ) + { + T cosZ = glm::cos(angleZ) * angularVelocityZ; + T sinZ = glm::sin(angleZ) * angularVelocityZ; + + return mat<4, 4, T, defaultp>( + -sinZ, cosZ, T(0), T(0), + -cosZ, -sinZ, T(0), T(0), + T(0), T(0), T(0), T(0), + T(0), T(0), T(0), T(0)); + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> eulerAngleXY + ( + T const& angleX, + T const& angleY + ) + { + T cosX = glm::cos(angleX); + T sinX = glm::sin(angleX); + T cosY = glm::cos(angleY); + T sinY = glm::sin(angleY); + + return mat<4, 4, T, defaultp>( + cosY, -sinX * -sinY, cosX * -sinY, T(0), + T(0), cosX, sinX, T(0), + sinY, -sinX * cosY, cosX * cosY, T(0), + T(0), T(0), T(0), T(1)); + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> eulerAngleYX + ( + T const& angleY, + T const& angleX + ) + { + T cosX = glm::cos(angleX); + T sinX = glm::sin(angleX); + T cosY = glm::cos(angleY); + T sinY = glm::sin(angleY); + + return mat<4, 4, T, defaultp>( + cosY, 0, -sinY, T(0), + sinY * sinX, cosX, cosY * sinX, T(0), + sinY * cosX, -sinX, cosY * cosX, T(0), + T(0), T(0), T(0), T(1)); + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> eulerAngleXZ + ( + T const& angleX, + T const& angleZ + ) + { + return eulerAngleX(angleX) * eulerAngleZ(angleZ); + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> eulerAngleZX + ( + T const& angleZ, + T const& angleX + ) + { + return eulerAngleZ(angleZ) * eulerAngleX(angleX); + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> eulerAngleYZ + ( + T const& angleY, + T const& angleZ + ) + { + return eulerAngleY(angleY) * eulerAngleZ(angleZ); + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> eulerAngleZY + ( + T const& angleZ, + T const& angleY + ) + { + return eulerAngleZ(angleZ) * eulerAngleY(angleY); + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> eulerAngleXYZ + ( + T const& t1, + T const& t2, + T const& t3 + ) + { + T c1 = glm::cos(-t1); + T c2 = glm::cos(-t2); + T c3 = glm::cos(-t3); + T s1 = glm::sin(-t1); + T s2 = glm::sin(-t2); + T s3 = glm::sin(-t3); + + mat<4, 4, T, defaultp> Result; + Result[0][0] = c2 * c3; + Result[0][1] =-c1 * s3 + s1 * s2 * c3; + Result[0][2] = s1 * s3 + c1 * s2 * c3; + Result[0][3] = static_cast(0); + Result[1][0] = c2 * s3; + Result[1][1] = c1 * c3 + s1 * s2 * s3; + Result[1][2] =-s1 * c3 + c1 * s2 * s3; + Result[1][3] = static_cast(0); + Result[2][0] =-s2; + Result[2][1] = s1 * c2; + Result[2][2] = c1 * c2; + Result[2][3] = static_cast(0); + Result[3][0] = static_cast(0); + Result[3][1] = static_cast(0); + Result[3][2] = static_cast(0); + Result[3][3] = static_cast(1); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> eulerAngleYXZ + ( + T const& yaw, + T const& pitch, + T const& roll + ) + { + T tmp_ch = glm::cos(yaw); + T tmp_sh = glm::sin(yaw); + T tmp_cp = glm::cos(pitch); + T tmp_sp = glm::sin(pitch); + T tmp_cb = glm::cos(roll); + T tmp_sb = glm::sin(roll); + + mat<4, 4, T, defaultp> Result; + Result[0][0] = tmp_ch * tmp_cb + tmp_sh * tmp_sp * tmp_sb; + Result[0][1] = tmp_sb * tmp_cp; + Result[0][2] = -tmp_sh * tmp_cb + tmp_ch * tmp_sp * tmp_sb; + Result[0][3] = static_cast(0); + Result[1][0] = -tmp_ch * tmp_sb + tmp_sh * tmp_sp * tmp_cb; + Result[1][1] = tmp_cb * tmp_cp; + Result[1][2] = tmp_sb * tmp_sh + tmp_ch * tmp_sp * tmp_cb; + Result[1][3] = static_cast(0); + Result[2][0] = tmp_sh * tmp_cp; + Result[2][1] = -tmp_sp; + Result[2][2] = tmp_ch * tmp_cp; + Result[2][3] = static_cast(0); + Result[3][0] = static_cast(0); + Result[3][1] = static_cast(0); + Result[3][2] = static_cast(0); + Result[3][3] = static_cast(1); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> eulerAngleXZX + ( + T const & t1, + T const & t2, + T const & t3 + ) + { + T c1 = glm::cos(t1); + T s1 = glm::sin(t1); + T c2 = glm::cos(t2); + T s2 = glm::sin(t2); + T c3 = glm::cos(t3); + T s3 = glm::sin(t3); + + mat<4, 4, T, defaultp> Result; + Result[0][0] = c2; + Result[0][1] = c1 * s2; + Result[0][2] = s1 * s2; + Result[0][3] = static_cast(0); + Result[1][0] =-c3 * s2; + Result[1][1] = c1 * c2 * c3 - s1 * s3; + Result[1][2] = c1 * s3 + c2 * c3 * s1; + Result[1][3] = static_cast(0); + Result[2][0] = s2 * s3; + Result[2][1] =-c3 * s1 - c1 * c2 * s3; + Result[2][2] = c1 * c3 - c2 * s1 * s3; + Result[2][3] = static_cast(0); + Result[3][0] = static_cast(0); + Result[3][1] = static_cast(0); + Result[3][2] = static_cast(0); + Result[3][3] = static_cast(1); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> eulerAngleXYX + ( + T const & t1, + T const & t2, + T const & t3 + ) + { + T c1 = glm::cos(t1); + T s1 = glm::sin(t1); + T c2 = glm::cos(t2); + T s2 = glm::sin(t2); + T c3 = glm::cos(t3); + T s3 = glm::sin(t3); + + mat<4, 4, T, defaultp> Result; + Result[0][0] = c2; + Result[0][1] = s1 * s2; + Result[0][2] =-c1 * s2; + Result[0][3] = static_cast(0); + Result[1][0] = s2 * s3; + Result[1][1] = c1 * c3 - c2 * s1 * s3; + Result[1][2] = c3 * s1 + c1 * c2 * s3; + Result[1][3] = static_cast(0); + Result[2][0] = c3 * s2; + Result[2][1] =-c1 * s3 - c2 * c3 * s1; + Result[2][2] = c1 * c2 * c3 - s1 * s3; + Result[2][3] = static_cast(0); + Result[3][0] = static_cast(0); + Result[3][1] = static_cast(0); + Result[3][2] = static_cast(0); + Result[3][3] = static_cast(1); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> eulerAngleYXY + ( + T const & t1, + T const & t2, + T const & t3 + ) + { + T c1 = glm::cos(t1); + T s1 = glm::sin(t1); + T c2 = glm::cos(t2); + T s2 = glm::sin(t2); + T c3 = glm::cos(t3); + T s3 = glm::sin(t3); + + mat<4, 4, T, defaultp> Result; + Result[0][0] = c1 * c3 - c2 * s1 * s3; + Result[0][1] = s2* s3; + Result[0][2] =-c3 * s1 - c1 * c2 * s3; + Result[0][3] = static_cast(0); + Result[1][0] = s1 * s2; + Result[1][1] = c2; + Result[1][2] = c1 * s2; + Result[1][3] = static_cast(0); + Result[2][0] = c1 * s3 + c2 * c3 * s1; + Result[2][1] =-c3 * s2; + Result[2][2] = c1 * c2 * c3 - s1 * s3; + Result[2][3] = static_cast(0); + Result[3][0] = static_cast(0); + Result[3][1] = static_cast(0); + Result[3][2] = static_cast(0); + Result[3][3] = static_cast(1); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> eulerAngleYZY + ( + T const & t1, + T const & t2, + T const & t3 + ) + { + T c1 = glm::cos(t1); + T s1 = glm::sin(t1); + T c2 = glm::cos(t2); + T s2 = glm::sin(t2); + T c3 = glm::cos(t3); + T s3 = glm::sin(t3); + + mat<4, 4, T, defaultp> Result; + Result[0][0] = c1 * c2 * c3 - s1 * s3; + Result[0][1] = c3 * s2; + Result[0][2] =-c1 * s3 - c2 * c3 * s1; + Result[0][3] = static_cast(0); + Result[1][0] =-c1 * s2; + Result[1][1] = c2; + Result[1][2] = s1 * s2; + Result[1][3] = static_cast(0); + Result[2][0] = c3 * s1 + c1 * c2 * s3; + Result[2][1] = s2 * s3; + Result[2][2] = c1 * c3 - c2 * s1 * s3; + Result[2][3] = static_cast(0); + Result[3][0] = static_cast(0); + Result[3][1] = static_cast(0); + Result[3][2] = static_cast(0); + Result[3][3] = static_cast(1); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> eulerAngleZYZ + ( + T const & t1, + T const & t2, + T const & t3 + ) + { + T c1 = glm::cos(t1); + T s1 = glm::sin(t1); + T c2 = glm::cos(t2); + T s2 = glm::sin(t2); + T c3 = glm::cos(t3); + T s3 = glm::sin(t3); + + mat<4, 4, T, defaultp> Result; + Result[0][0] = c1 * c2 * c3 - s1 * s3; + Result[0][1] = c1 * s3 + c2 * c3 * s1; + Result[0][2] =-c3 * s2; + Result[0][3] = static_cast(0); + Result[1][0] =-c3 * s1 - c1 * c2 * s3; + Result[1][1] = c1 * c3 - c2 * s1 * s3; + Result[1][2] = s2 * s3; + Result[1][3] = static_cast(0); + Result[2][0] = c1 * s2; + Result[2][1] = s1 * s2; + Result[2][2] = c2; + Result[2][3] = static_cast(0); + Result[3][0] = static_cast(0); + Result[3][1] = static_cast(0); + Result[3][2] = static_cast(0); + Result[3][3] = static_cast(1); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> eulerAngleZXZ + ( + T const & t1, + T const & t2, + T const & t3 + ) + { + T c1 = glm::cos(t1); + T s1 = glm::sin(t1); + T c2 = glm::cos(t2); + T s2 = glm::sin(t2); + T c3 = glm::cos(t3); + T s3 = glm::sin(t3); + + mat<4, 4, T, defaultp> Result; + Result[0][0] = c1 * c3 - c2 * s1 * s3; + Result[0][1] = c3 * s1 + c1 * c2 * s3; + Result[0][2] = s2 *s3; + Result[0][3] = static_cast(0); + Result[1][0] =-c1 * s3 - c2 * c3 * s1; + Result[1][1] = c1 * c2 * c3 - s1 * s3; + Result[1][2] = c3 * s2; + Result[1][3] = static_cast(0); + Result[2][0] = s1 * s2; + Result[2][1] =-c1 * s2; + Result[2][2] = c2; + Result[2][3] = static_cast(0); + Result[3][0] = static_cast(0); + Result[3][1] = static_cast(0); + Result[3][2] = static_cast(0); + Result[3][3] = static_cast(1); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> eulerAngleXZY + ( + T const & t1, + T const & t2, + T const & t3 + ) + { + T c1 = glm::cos(t1); + T s1 = glm::sin(t1); + T c2 = glm::cos(t2); + T s2 = glm::sin(t2); + T c3 = glm::cos(t3); + T s3 = glm::sin(t3); + + mat<4, 4, T, defaultp> Result; + Result[0][0] = c2 * c3; + Result[0][1] = s1 * s3 + c1 * c3 * s2; + Result[0][2] = c3 * s1 * s2 - c1 * s3; + Result[0][3] = static_cast(0); + Result[1][0] =-s2; + Result[1][1] = c1 * c2; + Result[1][2] = c2 * s1; + Result[1][3] = static_cast(0); + Result[2][0] = c2 * s3; + Result[2][1] = c1 * s2 * s3 - c3 * s1; + Result[2][2] = c1 * c3 + s1 * s2 *s3; + Result[2][3] = static_cast(0); + Result[3][0] = static_cast(0); + Result[3][1] = static_cast(0); + Result[3][2] = static_cast(0); + Result[3][3] = static_cast(1); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> eulerAngleYZX + ( + T const & t1, + T const & t2, + T const & t3 + ) + { + T c1 = glm::cos(t1); + T s1 = glm::sin(t1); + T c2 = glm::cos(t2); + T s2 = glm::sin(t2); + T c3 = glm::cos(t3); + T s3 = glm::sin(t3); + + mat<4, 4, T, defaultp> Result; + Result[0][0] = c1 * c2; + Result[0][1] = s2; + Result[0][2] =-c2 * s1; + Result[0][3] = static_cast(0); + Result[1][0] = s1 * s3 - c1 * c3 * s2; + Result[1][1] = c2 * c3; + Result[1][2] = c1 * s3 + c3 * s1 * s2; + Result[1][3] = static_cast(0); + Result[2][0] = c3 * s1 + c1 * s2 * s3; + Result[2][1] =-c2 * s3; + Result[2][2] = c1 * c3 - s1 * s2 * s3; + Result[2][3] = static_cast(0); + Result[3][0] = static_cast(0); + Result[3][1] = static_cast(0); + Result[3][2] = static_cast(0); + Result[3][3] = static_cast(1); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> eulerAngleZYX + ( + T const & t1, + T const & t2, + T const & t3 + ) + { + T c1 = glm::cos(t1); + T s1 = glm::sin(t1); + T c2 = glm::cos(t2); + T s2 = glm::sin(t2); + T c3 = glm::cos(t3); + T s3 = glm::sin(t3); + + mat<4, 4, T, defaultp> Result; + Result[0][0] = c1 * c2; + Result[0][1] = c2 * s1; + Result[0][2] =-s2; + Result[0][3] = static_cast(0); + Result[1][0] = c1 * s2 * s3 - c3 * s1; + Result[1][1] = c1 * c3 + s1 * s2 * s3; + Result[1][2] = c2 * s3; + Result[1][3] = static_cast(0); + Result[2][0] = s1 * s3 + c1 * c3 * s2; + Result[2][1] = c3 * s1 * s2 - c1 * s3; + Result[2][2] = c2 * c3; + Result[2][3] = static_cast(0); + Result[3][0] = static_cast(0); + Result[3][1] = static_cast(0); + Result[3][2] = static_cast(0); + Result[3][3] = static_cast(1); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> eulerAngleZXY + ( + T const & t1, + T const & t2, + T const & t3 + ) + { + T c1 = glm::cos(t1); + T s1 = glm::sin(t1); + T c2 = glm::cos(t2); + T s2 = glm::sin(t2); + T c3 = glm::cos(t3); + T s3 = glm::sin(t3); + + mat<4, 4, T, defaultp> Result; + Result[0][0] = c1 * c3 - s1 * s2 * s3; + Result[0][1] = c3 * s1 + c1 * s2 * s3; + Result[0][2] =-c2 * s3; + Result[0][3] = static_cast(0); + Result[1][0] =-c2 * s1; + Result[1][1] = c1 * c2; + Result[1][2] = s2; + Result[1][3] = static_cast(0); + Result[2][0] = c1 * s3 + c3 * s1 * s2; + Result[2][1] = s1 * s3 - c1 * c3 * s2; + Result[2][2] = c2 * c3; + Result[2][3] = static_cast(0); + Result[3][0] = static_cast(0); + Result[3][1] = static_cast(0); + Result[3][2] = static_cast(0); + Result[3][3] = static_cast(1); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> yawPitchRoll + ( + T const& yaw, + T const& pitch, + T const& roll + ) + { + T tmp_ch = glm::cos(yaw); + T tmp_sh = glm::sin(yaw); + T tmp_cp = glm::cos(pitch); + T tmp_sp = glm::sin(pitch); + T tmp_cb = glm::cos(roll); + T tmp_sb = glm::sin(roll); + + mat<4, 4, T, defaultp> Result; + Result[0][0] = tmp_ch * tmp_cb + tmp_sh * tmp_sp * tmp_sb; + Result[0][1] = tmp_sb * tmp_cp; + Result[0][2] = -tmp_sh * tmp_cb + tmp_ch * tmp_sp * tmp_sb; + Result[0][3] = static_cast(0); + Result[1][0] = -tmp_ch * tmp_sb + tmp_sh * tmp_sp * tmp_cb; + Result[1][1] = tmp_cb * tmp_cp; + Result[1][2] = tmp_sb * tmp_sh + tmp_ch * tmp_sp * tmp_cb; + Result[1][3] = static_cast(0); + Result[2][0] = tmp_sh * tmp_cp; + Result[2][1] = -tmp_sp; + Result[2][2] = tmp_ch * tmp_cp; + Result[2][3] = static_cast(0); + Result[3][0] = static_cast(0); + Result[3][1] = static_cast(0); + Result[3][2] = static_cast(0); + Result[3][3] = static_cast(1); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<2, 2, T, defaultp> orientate2 + ( + T const& angle + ) + { + T c = glm::cos(angle); + T s = glm::sin(angle); + + mat<2, 2, T, defaultp> Result; + Result[0][0] = c; + Result[0][1] = s; + Result[1][0] = -s; + Result[1][1] = c; + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<3, 3, T, defaultp> orientate3 + ( + T const& angle + ) + { + T c = glm::cos(angle); + T s = glm::sin(angle); + + mat<3, 3, T, defaultp> Result; + Result[0][0] = c; + Result[0][1] = s; + Result[0][2] = T(0.0); + Result[1][0] = -s; + Result[1][1] = c; + Result[1][2] = T(0.0); + Result[2][0] = T(0.0); + Result[2][1] = T(0.0); + Result[2][2] = T(1.0); + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> orientate3 + ( + vec<3, T, Q> const& angles + ) + { + return mat<3, 3, T, Q>(yawPitchRoll(angles.z, angles.x, angles.y)); + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> orientate4 + ( + vec<3, T, Q> const& angles + ) + { + return yawPitchRoll(angles.z, angles.x, angles.y); + } + + template + GLM_FUNC_DECL void extractEulerAngleXYZ(mat<4, 4, T, defaultp> const& M, + T & t1, + T & t2, + T & t3) + { + T T1 = glm::atan2(M[2][1], M[2][2]); + T C2 = glm::sqrt(M[0][0]*M[0][0] + M[1][0]*M[1][0]); + T T2 = glm::atan2(-M[2][0], C2); + T S1 = glm::sin(T1); + T C1 = glm::cos(T1); + T T3 = glm::atan2(S1*M[0][2] - C1*M[0][1], C1*M[1][1] - S1*M[1][2 ]); + t1 = -T1; + t2 = -T2; + t3 = -T3; + } + + template + GLM_FUNC_QUALIFIER void extractEulerAngleYXZ(mat<4, 4, T, defaultp> const & M, + T & t1, + T & t2, + T & t3) + { + T T1 = glm::atan2(M[2][0], M[2][2]); + T C2 = glm::sqrt(M[0][1]*M[0][1] + M[1][1]*M[1][1]); + T T2 = glm::atan2(-M[2][1], C2); + T S1 = glm::sin(T1); + T C1 = glm::cos(T1); + T T3 = glm::atan2(S1*M[1][2] - C1*M[1][0], C1*M[0][0] - S1*M[0][2]); + t1 = T1; + t2 = T2; + t3 = T3; + } + + template + GLM_FUNC_QUALIFIER void extractEulerAngleXZX(mat<4, 4, T, defaultp> const & M, + T & t1, + T & t2, + T & t3) + { + T T1 = glm::atan2(M[0][2], M[0][1]); + T S2 = glm::sqrt(M[1][0]*M[1][0] + M[2][0]*M[2][0]); + T T2 = glm::atan2(S2, M[0][0]); + T S1 = glm::sin(T1); + T C1 = glm::cos(T1); + T T3 = glm::atan2(C1*M[1][2] - S1*M[1][1], C1*M[2][2] - S1*M[2][1]); + t1 = T1; + t2 = T2; + t3 = T3; + } + + template + GLM_FUNC_QUALIFIER void extractEulerAngleXYX(mat<4, 4, T, defaultp> const & M, + T & t1, + T & t2, + T & t3) + { + T T1 = glm::atan2(M[0][1], -M[0][2]); + T S2 = glm::sqrt(M[1][0]*M[1][0] + M[2][0]*M[2][0]); + T T2 = glm::atan2(S2, M[0][0]); + T S1 = glm::sin(T1); + T C1 = glm::cos(T1); + T T3 = glm::atan2(-C1*M[2][1] - S1*M[2][2], C1*M[1][1] + S1*M[1][2]); + t1 = T1; + t2 = T2; + t3 = T3; + } + + template + GLM_FUNC_QUALIFIER void extractEulerAngleYXY(mat<4, 4, T, defaultp> const & M, + T & t1, + T & t2, + T & t3) + { + T T1 = glm::atan2(M[1][0], M[1][2]); + T S2 = glm::sqrt(M[0][1]*M[0][1] + M[2][1]*M[2][1]); + T T2 = glm::atan2(S2, M[1][1]); + T S1 = glm::sin(T1); + T C1 = glm::cos(T1); + T T3 = glm::atan2(C1*M[2][0] - S1*M[2][2], C1*M[0][0] - S1*M[0][2]); + t1 = T1; + t2 = T2; + t3 = T3; + } + + template + GLM_FUNC_QUALIFIER void extractEulerAngleYZY(mat<4, 4, T, defaultp> const & M, + T & t1, + T & t2, + T & t3) + { + T T1 = glm::atan2(M[1][2], -M[1][0]); + T S2 = glm::sqrt(M[0][1]*M[0][1] + M[2][1]*M[2][1]); + T T2 = glm::atan2(S2, M[1][1]); + T S1 = glm::sin(T1); + T C1 = glm::cos(T1); + T T3 = glm::atan2(-S1*M[0][0] - C1*M[0][2], S1*M[2][0] + C1*M[2][2]); + t1 = T1; + t2 = T2; + t3 = T3; + } + + template + GLM_FUNC_QUALIFIER void extractEulerAngleZYZ(mat<4, 4, T, defaultp> const & M, + T & t1, + T & t2, + T & t3) + { + T T1 = glm::atan2(M[2][1], M[2][0]); + T S2 = glm::sqrt(M[0][2]*M[0][2] + M[1][2]*M[1][2]); + T T2 = glm::atan2(S2, M[2][2]); + T S1 = glm::sin(T1); + T C1 = glm::cos(T1); + T T3 = glm::atan2(C1*M[0][1] - S1*M[0][0], C1*M[1][1] - S1*M[1][0]); + t1 = T1; + t2 = T2; + t3 = T3; + } + + template + GLM_FUNC_QUALIFIER void extractEulerAngleZXZ(mat<4, 4, T, defaultp> const & M, + T & t1, + T & t2, + T & t3) + { + T T1 = glm::atan2(M[2][0], -M[2][1]); + T S2 = glm::sqrt(M[0][2]*M[0][2] + M[1][2]*M[1][2]); + T T2 = glm::atan2(S2, M[2][2]); + T S1 = glm::sin(T1); + T C1 = glm::cos(T1); + T T3 = glm::atan2(-C1*M[1][0] - S1*M[1][1], C1*M[0][0] + S1*M[0][1]); + t1 = T1; + t2 = T2; + t3 = T3; + } + + template + GLM_FUNC_QUALIFIER void extractEulerAngleXZY(mat<4, 4, T, defaultp> const & M, + T & t1, + T & t2, + T & t3) + { + T T1 = glm::atan2(M[1][2], M[1][1]); + T C2 = glm::sqrt(M[0][0]*M[0][0] + M[2][0]*M[2][0]); + T T2 = glm::atan2(-M[1][0], C2); + T S1 = glm::sin(T1); + T C1 = glm::cos(T1); + T T3 = glm::atan2(S1*M[0][1] - C1*M[0][2], C1*M[2][2] - S1*M[2][1]); + t1 = T1; + t2 = T2; + t3 = T3; + } + + template + GLM_FUNC_QUALIFIER void extractEulerAngleYZX(mat<4, 4, T, defaultp> const & M, + T & t1, + T & t2, + T & t3) + { + T T1 = glm::atan2(-M[0][2], M[0][0]); + T C2 = glm::sqrt(M[1][1]*M[1][1] + M[2][1]*M[2][1]); + T T2 = glm::atan2(M[0][1], C2); + T S1 = glm::sin(T1); + T C1 = glm::cos(T1); + T T3 = glm::atan2(S1*M[1][0] + C1*M[1][2], S1*M[2][0] + C1*M[2][2]); + t1 = T1; + t2 = T2; + t3 = T3; + } + + template + GLM_FUNC_QUALIFIER void extractEulerAngleZYX(mat<4, 4, T, defaultp> const & M, + T & t1, + T & t2, + T & t3) + { + T T1 = glm::atan2(M[0][1], M[0][0]); + T C2 = glm::sqrt(M[1][2]*M[1][2] + M[2][2]*M[2][2]); + T T2 = glm::atan2(-M[0][2], C2); + T S1 = glm::sin(T1); + T C1 = glm::cos(T1); + T T3 = glm::atan2(S1*M[2][0] - C1*M[2][1], C1*M[1][1] - S1*M[1][0]); + t1 = T1; + t2 = T2; + t3 = T3; + } + + template + GLM_FUNC_QUALIFIER void extractEulerAngleZXY(mat<4, 4, T, defaultp> const & M, + T & t1, + T & t2, + T & t3) + { + T T1 = glm::atan2(-M[1][0], M[1][1]); + T C2 = glm::sqrt(M[0][2]*M[0][2] + M[2][2]*M[2][2]); + T T2 = glm::atan2(M[1][2], C2); + T S1 = glm::sin(T1); + T C1 = glm::cos(T1); + T T3 = glm::atan2(C1*M[2][0] + S1*M[2][1], C1*M[0][0] + S1*M[0][1]); + t1 = T1; + t2 = T2; + t3 = T3; + } +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/extend.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/extend.hpp new file mode 100644 index 0000000000000000000000000000000000000000..6352dda779aacf195d423e2283f174b4a08a790e --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/extend.hpp @@ -0,0 +1,42 @@ +/// @ref gtx_extend +/// @file glm/gtx/extend.hpp +/// +/// @see core (dependence) +/// +/// @defgroup gtx_extend GLM_GTX_extend +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Extend a position from a source to a position at a defined length. + +#pragma once + +// Dependency: +#include "../glm.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_extend is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_extend extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_extend + /// @{ + + /// Extends of Length the Origin position using the (Source - Origin) direction. + /// @see gtx_extend + template + GLM_FUNC_DECL genType extend( + genType const& Origin, + genType const& Source, + typename genType::value_type const Length); + + /// @} +}//namespace glm + +#include "extend.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/extend.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/extend.inl new file mode 100644 index 0000000000000000000000000000000000000000..0f7c01ecec1c05b9dd843d7b6e25dcdf9372265a --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/extend.inl @@ -0,0 +1,48 @@ +/// @ref gtx_extend + +namespace glm +{ + template + GLM_FUNC_QUALIFIER genType extend + ( + genType const& Origin, + genType const& Source, + genType const& Distance + ) + { + return Origin + (Source - Origin) * Distance; + } + + template + GLM_FUNC_QUALIFIER vec<2, T, Q> extend + ( + vec<2, T, Q> const& Origin, + vec<2, T, Q> const& Source, + T const& Distance + ) + { + return Origin + (Source - Origin) * Distance; + } + + template + GLM_FUNC_QUALIFIER vec<3, T, Q> extend + ( + vec<3, T, Q> const& Origin, + vec<3, T, Q> const& Source, + T const& Distance + ) + { + return Origin + (Source - Origin) * Distance; + } + + template + GLM_FUNC_QUALIFIER vec<4, T, Q> extend + ( + vec<4, T, Q> const& Origin, + vec<4, T, Q> const& Source, + T const& Distance + ) + { + return Origin + (Source - Origin) * Distance; + } +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/extended_min_max.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/extended_min_max.hpp new file mode 100644 index 0000000000000000000000000000000000000000..a2c8ed1a614491ee3b12a18a9ba1760fca6d4f2b --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/extended_min_max.hpp @@ -0,0 +1,137 @@ +/// @ref gtx_extended_min_max +/// @file glm/gtx/extended_min_max.hpp +/// +/// @see core (dependence) +/// +/// @defgroup gtx_extended_min_max GLM_GTX_extended_min_max +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Min and max functions for 3 to 4 parameters. + +#pragma once + +// Dependency: +#include "../glm.hpp" +#include "../ext/vector_common.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_extended_min_max is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_extended_min_max extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_extended_min_max + /// @{ + + /// Return the minimum component-wise values of 3 inputs + /// @see gtx_extented_min_max + template + GLM_FUNC_DECL T min( + T const& x, + T const& y, + T const& z); + + /// Return the minimum component-wise values of 3 inputs + /// @see gtx_extented_min_max + template class C> + GLM_FUNC_DECL C min( + C const& x, + typename C::T const& y, + typename C::T const& z); + + /// Return the minimum component-wise values of 3 inputs + /// @see gtx_extented_min_max + template class C> + GLM_FUNC_DECL C min( + C const& x, + C const& y, + C const& z); + + /// Return the minimum component-wise values of 4 inputs + /// @see gtx_extented_min_max + template + GLM_FUNC_DECL T min( + T const& x, + T const& y, + T const& z, + T const& w); + + /// Return the minimum component-wise values of 4 inputs + /// @see gtx_extented_min_max + template class C> + GLM_FUNC_DECL C min( + C const& x, + typename C::T const& y, + typename C::T const& z, + typename C::T const& w); + + /// Return the minimum component-wise values of 4 inputs + /// @see gtx_extented_min_max + template class C> + GLM_FUNC_DECL C min( + C const& x, + C const& y, + C const& z, + C const& w); + + /// Return the maximum component-wise values of 3 inputs + /// @see gtx_extented_min_max + template + GLM_FUNC_DECL T max( + T const& x, + T const& y, + T const& z); + + /// Return the maximum component-wise values of 3 inputs + /// @see gtx_extented_min_max + template class C> + GLM_FUNC_DECL C max( + C const& x, + typename C::T const& y, + typename C::T const& z); + + /// Return the maximum component-wise values of 3 inputs + /// @see gtx_extented_min_max + template class C> + GLM_FUNC_DECL C max( + C const& x, + C const& y, + C const& z); + + /// Return the maximum component-wise values of 4 inputs + /// @see gtx_extented_min_max + template + GLM_FUNC_DECL T max( + T const& x, + T const& y, + T const& z, + T const& w); + + /// Return the maximum component-wise values of 4 inputs + /// @see gtx_extented_min_max + template class C> + GLM_FUNC_DECL C max( + C const& x, + typename C::T const& y, + typename C::T const& z, + typename C::T const& w); + + /// Return the maximum component-wise values of 4 inputs + /// @see gtx_extented_min_max + template class C> + GLM_FUNC_DECL C max( + C const& x, + C const& y, + C const& z, + C const& w); + + /// @} +}//namespace glm + +#include "extended_min_max.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/extended_min_max.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/extended_min_max.inl new file mode 100644 index 0000000000000000000000000000000000000000..c663b7df8c78b67e13182fde3682df223d45dfd5 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/extended_min_max.inl @@ -0,0 +1,138 @@ +/// @ref gtx_extended_min_max + +namespace glm +{ + template + GLM_FUNC_QUALIFIER T min( + T const& x, + T const& y, + T const& z) + { + return glm::min(glm::min(x, y), z); + } + + template class C> + GLM_FUNC_QUALIFIER C min + ( + C const& x, + typename C::T const& y, + typename C::T const& z + ) + { + return glm::min(glm::min(x, y), z); + } + + template class C> + GLM_FUNC_QUALIFIER C min + ( + C const& x, + C const& y, + C const& z + ) + { + return glm::min(glm::min(x, y), z); + } + + template + GLM_FUNC_QUALIFIER T min + ( + T const& x, + T const& y, + T const& z, + T const& w + ) + { + return glm::min(glm::min(x, y), glm::min(z, w)); + } + + template class C> + GLM_FUNC_QUALIFIER C min + ( + C const& x, + typename C::T const& y, + typename C::T const& z, + typename C::T const& w + ) + { + return glm::min(glm::min(x, y), glm::min(z, w)); + } + + template class C> + GLM_FUNC_QUALIFIER C min + ( + C const& x, + C const& y, + C const& z, + C const& w + ) + { + return glm::min(glm::min(x, y), glm::min(z, w)); + } + + template + GLM_FUNC_QUALIFIER T max( + T const& x, + T const& y, + T const& z) + { + return glm::max(glm::max(x, y), z); + } + + template class C> + GLM_FUNC_QUALIFIER C max + ( + C const& x, + typename C::T const& y, + typename C::T const& z + ) + { + return glm::max(glm::max(x, y), z); + } + + template class C> + GLM_FUNC_QUALIFIER C max + ( + C const& x, + C const& y, + C const& z + ) + { + return glm::max(glm::max(x, y), z); + } + + template + GLM_FUNC_QUALIFIER T max + ( + T const& x, + T const& y, + T const& z, + T const& w + ) + { + return glm::max(glm::max(x, y), glm::max(z, w)); + } + + template class C> + GLM_FUNC_QUALIFIER C max + ( + C const& x, + typename C::T const& y, + typename C::T const& z, + typename C::T const& w + ) + { + return glm::max(glm::max(x, y), glm::max(z, w)); + } + + template class C> + GLM_FUNC_QUALIFIER C max + ( + C const& x, + C const& y, + C const& z, + C const& w + ) + { + return glm::max(glm::max(x, y), glm::max(z, w)); + } +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/exterior_product.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/exterior_product.hpp new file mode 100644 index 0000000000000000000000000000000000000000..cc41fa899eb5b4c5cac17e0a5a4e2ff9d0c191eb --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/exterior_product.hpp @@ -0,0 +1,45 @@ +/// @ref gtx_exterior_product +/// @file glm/gtx/exterior_product.hpp +/// +/// @see core (dependence) +/// @see gtx_exterior_product (dependence) +/// +/// @defgroup gtx_exterior_product GLM_GTX_exterior_product +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// @brief Allow to perform bit operations on integer values + +#pragma once + +// Dependencies +#include "../detail/setup.hpp" +#include "../detail/qualifier.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_exterior_product is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_exterior_product extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_exterior_product + /// @{ + + /// Returns the cross product of x and y. + /// + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see Exterior product + template + GLM_FUNC_DECL T cross(vec<2, T, Q> const& v, vec<2, T, Q> const& u); + + /// @} +} //namespace glm + +#include "exterior_product.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/exterior_product.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/exterior_product.inl new file mode 100644 index 0000000000000000000000000000000000000000..82dc4aae22e9bcf47618079ef27b0205833bd15e --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/exterior_product.inl @@ -0,0 +1,26 @@ +/// @ref gtx_exterior_product + +#include + +namespace glm { +namespace detail +{ + template + struct compute_cross_vec2 + { + GLM_FUNC_QUALIFIER static T call(vec<2, T, Q> const& v, vec<2, T, Q> const& u) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'cross' accepts only floating-point inputs"); + + return v.x * u.y - u.x * v.y; + } + }; +}//namespace detail + + template + GLM_FUNC_QUALIFIER T cross(vec<2, T, Q> const& x, vec<2, T, Q> const& y) + { + return detail::compute_cross_vec2::value>::call(x, y); + } +}//namespace glm + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/fast_exponential.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/fast_exponential.hpp new file mode 100644 index 0000000000000000000000000000000000000000..32f8b0f7c22a0ef68e8b7aaa71dd9bbbbf9f0aff --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/fast_exponential.hpp @@ -0,0 +1,95 @@ +/// @ref gtx_fast_exponential +/// @file glm/gtx/fast_exponential.hpp +/// +/// @see core (dependence) +/// @see gtx_half_float (dependence) +/// +/// @defgroup gtx_fast_exponential GLM_GTX_fast_exponential +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Fast but less accurate implementations of exponential based functions. + +#pragma once + +// Dependency: +#include "../glm.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_fast_exponential is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_fast_exponential extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_fast_exponential + /// @{ + + /// Faster than the common pow function but less accurate. + /// @see gtx_fast_exponential + template + GLM_FUNC_DECL genType fastPow(genType x, genType y); + + /// Faster than the common pow function but less accurate. + /// @see gtx_fast_exponential + template + GLM_FUNC_DECL vec fastPow(vec const& x, vec const& y); + + /// Faster than the common pow function but less accurate. + /// @see gtx_fast_exponential + template + GLM_FUNC_DECL genTypeT fastPow(genTypeT x, genTypeU y); + + /// Faster than the common pow function but less accurate. + /// @see gtx_fast_exponential + template + GLM_FUNC_DECL vec fastPow(vec const& x); + + /// Faster than the common exp function but less accurate. + /// @see gtx_fast_exponential + template + GLM_FUNC_DECL T fastExp(T x); + + /// Faster than the common exp function but less accurate. + /// @see gtx_fast_exponential + template + GLM_FUNC_DECL vec fastExp(vec const& x); + + /// Faster than the common log function but less accurate. + /// @see gtx_fast_exponential + template + GLM_FUNC_DECL T fastLog(T x); + + /// Faster than the common exp2 function but less accurate. + /// @see gtx_fast_exponential + template + GLM_FUNC_DECL vec fastLog(vec const& x); + + /// Faster than the common exp2 function but less accurate. + /// @see gtx_fast_exponential + template + GLM_FUNC_DECL T fastExp2(T x); + + /// Faster than the common exp2 function but less accurate. + /// @see gtx_fast_exponential + template + GLM_FUNC_DECL vec fastExp2(vec const& x); + + /// Faster than the common log2 function but less accurate. + /// @see gtx_fast_exponential + template + GLM_FUNC_DECL T fastLog2(T x); + + /// Faster than the common log2 function but less accurate. + /// @see gtx_fast_exponential + template + GLM_FUNC_DECL vec fastLog2(vec const& x); + + /// @} +}//namespace glm + +#include "fast_exponential.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/fast_exponential.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/fast_exponential.inl new file mode 100644 index 0000000000000000000000000000000000000000..e860b5341853dd50b16574932ffce6244c50e530 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/fast_exponential.inl @@ -0,0 +1,136 @@ +/// @ref gtx_fast_exponential + +namespace glm +{ + // fastPow: + template + GLM_FUNC_QUALIFIER genType fastPow(genType x, genType y) + { + return exp(y * log(x)); + } + + template + GLM_FUNC_QUALIFIER vec fastPow(vec const& x, vec const& y) + { + return exp(y * log(x)); + } + + template + GLM_FUNC_QUALIFIER T fastPow(T x, int y) + { + T f = static_cast(1); + for(int i = 0; i < y; ++i) + f *= x; + return f; + } + + template + GLM_FUNC_QUALIFIER vec fastPow(vec const& x, vec const& y) + { + vec Result; + for(length_t i = 0, n = x.length(); i < n; ++i) + Result[i] = fastPow(x[i], y[i]); + return Result; + } + + // fastExp + // Note: This function provides accurate results only for value between -1 and 1, else avoid it. + template + GLM_FUNC_QUALIFIER T fastExp(T x) + { + // This has a better looking and same performance in release mode than the following code. However, in debug mode it's slower. + // return 1.0f + x * (1.0f + x * 0.5f * (1.0f + x * 0.3333333333f * (1.0f + x * 0.25 * (1.0f + x * 0.2f)))); + T x2 = x * x; + T x3 = x2 * x; + T x4 = x3 * x; + T x5 = x4 * x; + return T(1) + x + (x2 * T(0.5)) + (x3 * T(0.1666666667)) + (x4 * T(0.041666667)) + (x5 * T(0.008333333333)); + } + /* // Try to handle all values of float... but often shower than std::exp, glm::floor and the loop kill the performance + GLM_FUNC_QUALIFIER float fastExp(float x) + { + const float e = 2.718281828f; + const float IntegerPart = floor(x); + const float FloatPart = x - IntegerPart; + float z = 1.f; + + for(int i = 0; i < int(IntegerPart); ++i) + z *= e; + + const float x2 = FloatPart * FloatPart; + const float x3 = x2 * FloatPart; + const float x4 = x3 * FloatPart; + const float x5 = x4 * FloatPart; + return z * (1.0f + FloatPart + (x2 * 0.5f) + (x3 * 0.1666666667f) + (x4 * 0.041666667f) + (x5 * 0.008333333333f)); + } + + // Increase accuracy on number bigger that 1 and smaller than -1 but it's not enough for high and negative numbers + GLM_FUNC_QUALIFIER float fastExp(float x) + { + // This has a better looking and same performance in release mode than the following code. However, in debug mode it's slower. + // return 1.0f + x * (1.0f + x * 0.5f * (1.0f + x * 0.3333333333f * (1.0f + x * 0.25 * (1.0f + x * 0.2f)))); + float x2 = x * x; + float x3 = x2 * x; + float x4 = x3 * x; + float x5 = x4 * x; + float x6 = x5 * x; + float x7 = x6 * x; + float x8 = x7 * x; + return 1.0f + x + (x2 * 0.5f) + (x3 * 0.1666666667f) + (x4 * 0.041666667f) + (x5 * 0.008333333333f)+ (x6 * 0.00138888888888f) + (x7 * 0.000198412698f) + (x8 * 0.0000248015873f);; + } + */ + + template + GLM_FUNC_QUALIFIER vec fastExp(vec const& x) + { + return detail::functor1::call(fastExp, x); + } + + // fastLog + template + GLM_FUNC_QUALIFIER genType fastLog(genType x) + { + return std::log(x); + } + + /* Slower than the VC7.1 function... + GLM_FUNC_QUALIFIER float fastLog(float x) + { + float y1 = (x - 1.0f) / (x + 1.0f); + float y2 = y1 * y1; + return 2.0f * y1 * (1.0f + y2 * (0.3333333333f + y2 * (0.2f + y2 * 0.1428571429f))); + } + */ + + template + GLM_FUNC_QUALIFIER vec fastLog(vec const& x) + { + return detail::functor1::call(fastLog, x); + } + + //fastExp2, ln2 = 0.69314718055994530941723212145818f + template + GLM_FUNC_QUALIFIER genType fastExp2(genType x) + { + return fastExp(static_cast(0.69314718055994530941723212145818) * x); + } + + template + GLM_FUNC_QUALIFIER vec fastExp2(vec const& x) + { + return detail::functor1::call(fastExp2, x); + } + + // fastLog2, ln2 = 0.69314718055994530941723212145818f + template + GLM_FUNC_QUALIFIER genType fastLog2(genType x) + { + return fastLog(x) / static_cast(0.69314718055994530941723212145818); + } + + template + GLM_FUNC_QUALIFIER vec fastLog2(vec const& x) + { + return detail::functor1::call(fastLog2, x); + } +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/fast_square_root.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/fast_square_root.hpp new file mode 100644 index 0000000000000000000000000000000000000000..85c37181fe9fe78e975b9af7d44d19d723447a62 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/fast_square_root.hpp @@ -0,0 +1,98 @@ +/// @ref gtx_fast_square_root +/// @file glm/gtx/fast_square_root.hpp +/// +/// @see core (dependence) +/// +/// @defgroup gtx_fast_square_root GLM_GTX_fast_square_root +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Fast but less accurate implementations of square root based functions. +/// - Sqrt optimisation based on Newton's method, +/// www.gamedev.net/community/forums/topic.asp?topic id=139956 + +#pragma once + +// Dependency: +#include "../common.hpp" +#include "../exponential.hpp" +#include "../geometric.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_fast_square_root is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_fast_square_root extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_fast_square_root + /// @{ + + /// Faster than the common sqrt function but less accurate. + /// + /// @see gtx_fast_square_root extension. + template + GLM_FUNC_DECL genType fastSqrt(genType x); + + /// Faster than the common sqrt function but less accurate. + /// + /// @see gtx_fast_square_root extension. + template + GLM_FUNC_DECL vec fastSqrt(vec const& x); + + /// Faster than the common inversesqrt function but less accurate. + /// + /// @see gtx_fast_square_root extension. + template + GLM_FUNC_DECL genType fastInverseSqrt(genType x); + + /// Faster than the common inversesqrt function but less accurate. + /// + /// @see gtx_fast_square_root extension. + template + GLM_FUNC_DECL vec fastInverseSqrt(vec const& x); + + /// Faster than the common length function but less accurate. + /// + /// @see gtx_fast_square_root extension. + template + GLM_FUNC_DECL genType fastLength(genType x); + + /// Faster than the common length function but less accurate. + /// + /// @see gtx_fast_square_root extension. + template + GLM_FUNC_DECL T fastLength(vec const& x); + + /// Faster than the common distance function but less accurate. + /// + /// @see gtx_fast_square_root extension. + template + GLM_FUNC_DECL genType fastDistance(genType x, genType y); + + /// Faster than the common distance function but less accurate. + /// + /// @see gtx_fast_square_root extension. + template + GLM_FUNC_DECL T fastDistance(vec const& x, vec const& y); + + /// Faster than the common normalize function but less accurate. + /// + /// @see gtx_fast_square_root extension. + template + GLM_FUNC_DECL genType fastNormalize(genType x); + + /// Faster than the common normalize function but less accurate. + /// + /// @see gtx_fast_square_root extension. + template + GLM_FUNC_DECL vec fastNormalize(vec const& x); + + /// @} +}// namespace glm + +#include "fast_square_root.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/fast_square_root.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/fast_square_root.inl new file mode 100644 index 0000000000000000000000000000000000000000..200d18b2eb99ae6e4b1811621a53a0d8681b1375 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/fast_square_root.inl @@ -0,0 +1,75 @@ +/// @ref gtx_fast_square_root + +namespace glm +{ + // fastSqrt + template + GLM_FUNC_QUALIFIER genType fastSqrt(genType x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'fastSqrt' only accept floating-point input"); + + return genType(1) / fastInverseSqrt(x); + } + + template + GLM_FUNC_QUALIFIER vec fastSqrt(vec const& x) + { + return detail::functor1::call(fastSqrt, x); + } + + // fastInversesqrt + template + GLM_FUNC_QUALIFIER genType fastInverseSqrt(genType x) + { + return detail::compute_inversesqrt<1, genType, lowp, detail::is_aligned::value>::call(vec<1, genType, lowp>(x)).x; + } + + template + GLM_FUNC_QUALIFIER vec fastInverseSqrt(vec const& x) + { + return detail::compute_inversesqrt::value>::call(x); + } + + // fastLength + template + GLM_FUNC_QUALIFIER genType fastLength(genType x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'fastLength' only accept floating-point inputs"); + + return abs(x); + } + + template + GLM_FUNC_QUALIFIER T fastLength(vec const& x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'fastLength' only accept floating-point inputs"); + + return fastSqrt(dot(x, x)); + } + + // fastDistance + template + GLM_FUNC_QUALIFIER genType fastDistance(genType x, genType y) + { + return fastLength(y - x); + } + + template + GLM_FUNC_QUALIFIER T fastDistance(vec const& x, vec const& y) + { + return fastLength(y - x); + } + + // fastNormalize + template + GLM_FUNC_QUALIFIER genType fastNormalize(genType x) + { + return x > genType(0) ? genType(1) : -genType(1); + } + + template + GLM_FUNC_QUALIFIER vec fastNormalize(vec const& x) + { + return x * fastInverseSqrt(dot(x, x)); + } +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/fast_trigonometry.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/fast_trigonometry.hpp new file mode 100644 index 0000000000000000000000000000000000000000..83d62dfce9b06f0b795df5c944d4e51e2380feb0 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/fast_trigonometry.hpp @@ -0,0 +1,79 @@ +/// @ref gtx_fast_trigonometry +/// @file glm/gtx/fast_trigonometry.hpp +/// +/// @see core (dependence) +/// +/// @defgroup gtx_fast_trigonometry GLM_GTX_fast_trigonometry +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Fast but less accurate implementations of trigonometric functions. + +#pragma once + +// Dependency: +#include "../gtc/constants.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_fast_trigonometry is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_fast_trigonometry extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_fast_trigonometry + /// @{ + + /// Wrap an angle to [0 2pi[ + /// From GLM_GTX_fast_trigonometry extension. + template + GLM_FUNC_DECL T wrapAngle(T angle); + + /// Faster than the common sin function but less accurate. + /// From GLM_GTX_fast_trigonometry extension. + template + GLM_FUNC_DECL T fastSin(T angle); + + /// Faster than the common cos function but less accurate. + /// From GLM_GTX_fast_trigonometry extension. + template + GLM_FUNC_DECL T fastCos(T angle); + + /// Faster than the common tan function but less accurate. + /// Defined between -2pi and 2pi. + /// From GLM_GTX_fast_trigonometry extension. + template + GLM_FUNC_DECL T fastTan(T angle); + + /// Faster than the common asin function but less accurate. + /// Defined between -2pi and 2pi. + /// From GLM_GTX_fast_trigonometry extension. + template + GLM_FUNC_DECL T fastAsin(T angle); + + /// Faster than the common acos function but less accurate. + /// Defined between -2pi and 2pi. + /// From GLM_GTX_fast_trigonometry extension. + template + GLM_FUNC_DECL T fastAcos(T angle); + + /// Faster than the common atan function but less accurate. + /// Defined between -2pi and 2pi. + /// From GLM_GTX_fast_trigonometry extension. + template + GLM_FUNC_DECL T fastAtan(T y, T x); + + /// Faster than the common atan function but less accurate. + /// Defined between -2pi and 2pi. + /// From GLM_GTX_fast_trigonometry extension. + template + GLM_FUNC_DECL T fastAtan(T angle); + + /// @} +}//namespace glm + +#include "fast_trigonometry.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/fast_trigonometry.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/fast_trigonometry.inl new file mode 100644 index 0000000000000000000000000000000000000000..6bb9237fa6847c2ffef08362da5beb6502ad3209 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/fast_trigonometry.inl @@ -0,0 +1,142 @@ +/// @ref gtx_fast_trigonometry + +namespace glm{ +namespace detail +{ + template + GLM_FUNC_QUALIFIER vec taylorCos(vec const& x) + { + return static_cast(1) + - (x * x) * (1.f / 2.f) + + ((x * x) * (x * x)) * (1.f / 24.f) + - (((x * x) * (x * x)) * (x * x)) * (1.f / 720.f) + + (((x * x) * (x * x)) * ((x * x) * (x * x))) * (1.f / 40320.f); + } + + template + GLM_FUNC_QUALIFIER T cos_52s(T x) + { + T const xx(x * x); + return (T(0.9999932946) + xx * (T(-0.4999124376) + xx * (T(0.0414877472) + xx * T(-0.0012712095)))); + } + + template + GLM_FUNC_QUALIFIER vec cos_52s(vec const& x) + { + return detail::functor1::call(cos_52s, x); + } +}//namespace detail + + // wrapAngle + template + GLM_FUNC_QUALIFIER T wrapAngle(T angle) + { + return abs(mod(angle, two_pi())); + } + + template + GLM_FUNC_QUALIFIER vec wrapAngle(vec const& x) + { + return detail::functor1::call(wrapAngle, x); + } + + // cos + template + GLM_FUNC_QUALIFIER T fastCos(T x) + { + T const angle(wrapAngle(x)); + + if(angle < half_pi()) + return detail::cos_52s(angle); + if(angle < pi()) + return -detail::cos_52s(pi() - angle); + if(angle < (T(3) * half_pi())) + return -detail::cos_52s(angle - pi()); + + return detail::cos_52s(two_pi() - angle); + } + + template + GLM_FUNC_QUALIFIER vec fastCos(vec const& x) + { + return detail::functor1::call(fastCos, x); + } + + // sin + template + GLM_FUNC_QUALIFIER T fastSin(T x) + { + return fastCos(half_pi() - x); + } + + template + GLM_FUNC_QUALIFIER vec fastSin(vec const& x) + { + return detail::functor1::call(fastSin, x); + } + + // tan + template + GLM_FUNC_QUALIFIER T fastTan(T x) + { + return x + (x * x * x * T(0.3333333333)) + (x * x * x * x * x * T(0.1333333333333)) + (x * x * x * x * x * x * x * T(0.0539682539)); + } + + template + GLM_FUNC_QUALIFIER vec fastTan(vec const& x) + { + return detail::functor1::call(fastTan, x); + } + + // asin + template + GLM_FUNC_QUALIFIER T fastAsin(T x) + { + return x + (x * x * x * T(0.166666667)) + (x * x * x * x * x * T(0.075)) + (x * x * x * x * x * x * x * T(0.0446428571)) + (x * x * x * x * x * x * x * x * x * T(0.0303819444));// + (x * x * x * x * x * x * x * x * x * x * x * T(0.022372159)); + } + + template + GLM_FUNC_QUALIFIER vec fastAsin(vec const& x) + { + return detail::functor1::call(fastAsin, x); + } + + // acos + template + GLM_FUNC_QUALIFIER T fastAcos(T x) + { + return T(1.5707963267948966192313216916398) - fastAsin(x); //(PI / 2) + } + + template + GLM_FUNC_QUALIFIER vec fastAcos(vec const& x) + { + return detail::functor1::call(fastAcos, x); + } + + // atan + template + GLM_FUNC_QUALIFIER T fastAtan(T y, T x) + { + T sgn = sign(y) * sign(x); + return abs(fastAtan(y / x)) * sgn; + } + + template + GLM_FUNC_QUALIFIER vec fastAtan(vec const& y, vec const& x) + { + return detail::functor2::call(fastAtan, y, x); + } + + template + GLM_FUNC_QUALIFIER T fastAtan(T x) + { + return x - (x * x * x * T(0.333333333333)) + (x * x * x * x * x * T(0.2)) - (x * x * x * x * x * x * x * T(0.1428571429)) + (x * x * x * x * x * x * x * x * x * T(0.111111111111)) - (x * x * x * x * x * x * x * x * x * x * x * T(0.0909090909)); + } + + template + GLM_FUNC_QUALIFIER vec fastAtan(vec const& x) + { + return detail::functor1::call(fastAtan, x); + } +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/float_notmalize.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/float_notmalize.inl new file mode 100644 index 0000000000000000000000000000000000000000..bca18aa562f97efbfd87517162d53a283d27f81c --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/float_notmalize.inl @@ -0,0 +1,13 @@ +/// @ref gtx_float_normalize + +#include + +namespace glm +{ + template + GLM_FUNC_QUALIFIER vec floatNormalize(vec const& v) + { + return vec(v) / static_cast(std::numeric_limits::max()); + } + +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/functions.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/functions.hpp new file mode 100644 index 0000000000000000000000000000000000000000..cdf7fa1e093cd8433792fa8bd383917fe477a354 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/functions.hpp @@ -0,0 +1,56 @@ +/// @ref gtx_functions +/// @file glm/gtx/functions.hpp +/// +/// @see core (dependence) +/// @see gtc_quaternion (dependence) +/// +/// @defgroup gtx_functions GLM_GTX_functions +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// List of useful common functions. + +#pragma once + +// Dependencies +#include "../detail/setup.hpp" +#include "../detail/qualifier.hpp" +#include "../detail/type_vec2.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_functions is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_functions extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_functions + /// @{ + + /// 1D gauss function + /// + /// @see gtc_epsilon + template + GLM_FUNC_DECL T gauss( + T x, + T ExpectedValue, + T StandardDeviation); + + /// 2D gauss function + /// + /// @see gtc_epsilon + template + GLM_FUNC_DECL T gauss( + vec<2, T, Q> const& Coord, + vec<2, T, Q> const& ExpectedValue, + vec<2, T, Q> const& StandardDeviation); + + /// @} +}//namespace glm + +#include "functions.inl" + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/functions.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/functions.inl new file mode 100644 index 0000000000000000000000000000000000000000..1c357c01fd87ac57ab6493bb887d7178b1844ad4 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/functions.inl @@ -0,0 +1,30 @@ +/// @ref gtx_functions + +#include "../exponential.hpp" + +namespace glm +{ + template + GLM_FUNC_QUALIFIER T gauss + ( + T x, + T ExpectedValue, + T StandardDeviation + ) + { + return exp(-((x - ExpectedValue) * (x - ExpectedValue)) / (static_cast(2) * StandardDeviation * StandardDeviation)) / (StandardDeviation * sqrt(static_cast(6.28318530717958647692528676655900576))); + } + + template + GLM_FUNC_QUALIFIER T gauss + ( + vec<2, T, Q> const& Coord, + vec<2, T, Q> const& ExpectedValue, + vec<2, T, Q> const& StandardDeviation + ) + { + vec<2, T, Q> const Squared = ((Coord - ExpectedValue) * (Coord - ExpectedValue)) / (static_cast(2) * StandardDeviation * StandardDeviation); + return exp(-(Squared.x + Squared.y)); + } +}//namespace glm + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/gradient_paint.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/gradient_paint.hpp new file mode 100644 index 0000000000000000000000000000000000000000..b1eda03a1c42a6d84b92c23a522c37076620d306 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/gradient_paint.hpp @@ -0,0 +1,53 @@ +/// @ref gtx_gradient_paint +/// @file glm/gtx/gradient_paint.hpp +/// +/// @see core (dependence) +/// @see gtx_optimum_pow (dependence) +/// +/// @defgroup gtx_gradient_paint GLM_GTX_gradient_paint +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Functions that return the color of procedural gradient for specific coordinates. + +#pragma once + +// Dependency: +#include "../glm.hpp" +#include "../gtx/optimum_pow.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_gradient_paint is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_gradient_paint extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_gradient_paint + /// @{ + + /// Return a color from a radial gradient. + /// @see - gtx_gradient_paint + template + GLM_FUNC_DECL T radialGradient( + vec<2, T, Q> const& Center, + T const& Radius, + vec<2, T, Q> const& Focal, + vec<2, T, Q> const& Position); + + /// Return a color from a linear gradient. + /// @see - gtx_gradient_paint + template + GLM_FUNC_DECL T linearGradient( + vec<2, T, Q> const& Point0, + vec<2, T, Q> const& Point1, + vec<2, T, Q> const& Position); + + /// @} +}// namespace glm + +#include "gradient_paint.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/gradient_paint.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/gradient_paint.inl new file mode 100644 index 0000000000000000000000000000000000000000..ef9292bdd1a7f83978ea2284c57d26da060cd61f --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/gradient_paint.inl @@ -0,0 +1,36 @@ +/// @ref gtx_gradient_paint + +namespace glm +{ + template + GLM_FUNC_QUALIFIER T radialGradient + ( + vec<2, T, Q> const& Center, + T const& Radius, + vec<2, T, Q> const& Focal, + vec<2, T, Q> const& Position + ) + { + vec<2, T, Q> F = Focal - Center; + vec<2, T, Q> D = Position - Focal; + T Radius2 = pow2(Radius); + T Fx2 = pow2(F.x); + T Fy2 = pow2(F.y); + + T Numerator = (D.x * F.x + D.y * F.y) + sqrt(Radius2 * (pow2(D.x) + pow2(D.y)) - pow2(D.x * F.y - D.y * F.x)); + T Denominator = Radius2 - (Fx2 + Fy2); + return Numerator / Denominator; + } + + template + GLM_FUNC_QUALIFIER T linearGradient + ( + vec<2, T, Q> const& Point0, + vec<2, T, Q> const& Point1, + vec<2, T, Q> const& Position + ) + { + vec<2, T, Q> Dist = Point1 - Point0; + return (Dist.x * (Position.x - Point0.x) + Dist.y * (Position.y - Point0.y)) / glm::dot(Dist, Dist); + } +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/handed_coordinate_space.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/handed_coordinate_space.hpp new file mode 100644 index 0000000000000000000000000000000000000000..af9f79ec3ee381c3985affd4e2cc4cf9c541781e --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/handed_coordinate_space.hpp @@ -0,0 +1,50 @@ +/// @ref gtx_handed_coordinate_space +/// @file glm/gtx/handed_coordinate_space.hpp +/// +/// @see core (dependence) +/// +/// @defgroup gtx_handed_coordinate_space GLM_GTX_handed_coordinate_space +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// To know if a set of three basis vectors defines a right or left-handed coordinate system. + +#pragma once + +// Dependency: +#include "../glm.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_handed_coordinate_space is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_handed_coordinate_space extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_handed_coordinate_space + /// @{ + + //! Return if a trihedron right handed or not. + //! From GLM_GTX_handed_coordinate_space extension. + template + GLM_FUNC_DECL bool rightHanded( + vec<3, T, Q> const& tangent, + vec<3, T, Q> const& binormal, + vec<3, T, Q> const& normal); + + //! Return if a trihedron left handed or not. + //! From GLM_GTX_handed_coordinate_space extension. + template + GLM_FUNC_DECL bool leftHanded( + vec<3, T, Q> const& tangent, + vec<3, T, Q> const& binormal, + vec<3, T, Q> const& normal); + + /// @} +}// namespace glm + +#include "handed_coordinate_space.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/handed_coordinate_space.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/handed_coordinate_space.inl new file mode 100644 index 0000000000000000000000000000000000000000..7a2c7ac3ff54482100f48d7e5e1639e4cad298a3 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/handed_coordinate_space.inl @@ -0,0 +1,26 @@ +/// @ref gtx_handed_coordinate_space + +namespace glm +{ + template + GLM_FUNC_QUALIFIER bool rightHanded + ( + vec<3, T, Q> const& tangent, + vec<3, T, Q> const& binormal, + vec<3, T, Q> const& normal + ) + { + return dot(cross(normal, tangent), binormal) > T(0); + } + + template + GLM_FUNC_QUALIFIER bool leftHanded + ( + vec<3, T, Q> const& tangent, + vec<3, T, Q> const& binormal, + vec<3, T, Q> const& normal + ) + { + return dot(cross(normal, tangent), binormal) < T(0); + } +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/hash.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/hash.hpp new file mode 100644 index 0000000000000000000000000000000000000000..3f6c7f7424f034b993166f17ec75e5aa4aedd5cd --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/hash.hpp @@ -0,0 +1,142 @@ +/// @ref gtx_hash +/// @file glm/gtx/hash.hpp +/// +/// @see core (dependence) +/// +/// @defgroup gtx_hash GLM_GTX_hash +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Add std::hash support for glm types + +#pragma once + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_hash is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_hash extension included") +# endif +#endif + +#include + +#include "../vec2.hpp" +#include "../vec3.hpp" +#include "../vec4.hpp" +#include "../gtc/vec1.hpp" + +#include "../gtc/quaternion.hpp" +#include "../gtx/dual_quaternion.hpp" + +#include "../mat2x2.hpp" +#include "../mat2x3.hpp" +#include "../mat2x4.hpp" + +#include "../mat3x2.hpp" +#include "../mat3x3.hpp" +#include "../mat3x4.hpp" + +#include "../mat4x2.hpp" +#include "../mat4x3.hpp" +#include "../mat4x4.hpp" + +#if !GLM_HAS_CXX11_STL +# error "GLM_GTX_hash requires C++11 standard library support" +#endif + +namespace std +{ + template + struct hash > + { + GLM_FUNC_DECL size_t operator()(glm::vec<1, T, Q> const& v) const GLM_NOEXCEPT; + }; + + template + struct hash > + { + GLM_FUNC_DECL size_t operator()(glm::vec<2, T, Q> const& v) const GLM_NOEXCEPT; + }; + + template + struct hash > + { + GLM_FUNC_DECL size_t operator()(glm::vec<3, T, Q> const& v) const GLM_NOEXCEPT; + }; + + template + struct hash > + { + GLM_FUNC_DECL size_t operator()(glm::vec<4, T, Q> const& v) const GLM_NOEXCEPT; + }; + + template + struct hash> + { + GLM_FUNC_DECL size_t operator()(glm::qua const& q) const GLM_NOEXCEPT; + }; + + template + struct hash > + { + GLM_FUNC_DECL size_t operator()(glm::tdualquat const& q) const GLM_NOEXCEPT; + }; + + template + struct hash > + { + GLM_FUNC_DECL size_t operator()(glm::mat<2, 2, T,Q> const& m) const GLM_NOEXCEPT; + }; + + template + struct hash > + { + GLM_FUNC_DECL size_t operator()(glm::mat<2, 3, T,Q> const& m) const GLM_NOEXCEPT; + }; + + template + struct hash > + { + GLM_FUNC_DECL size_t operator()(glm::mat<2, 4, T,Q> const& m) const GLM_NOEXCEPT; + }; + + template + struct hash > + { + GLM_FUNC_DECL size_t operator()(glm::mat<3, 2, T,Q> const& m) const GLM_NOEXCEPT; + }; + + template + struct hash > + { + GLM_FUNC_DECL size_t operator()(glm::mat<3, 3, T,Q> const& m) const GLM_NOEXCEPT; + }; + + template + struct hash > + { + GLM_FUNC_DECL size_t operator()(glm::mat<3, 4, T,Q> const& m) const GLM_NOEXCEPT; + }; + + template + struct hash > + { + GLM_FUNC_DECL size_t operator()(glm::mat<4, 2, T,Q> const& m) const GLM_NOEXCEPT; + }; + + template + struct hash > + { + GLM_FUNC_DECL size_t operator()(glm::mat<4, 3, T,Q> const& m) const GLM_NOEXCEPT; + }; + + template + struct hash > + { + GLM_FUNC_DECL size_t operator()(glm::mat<4, 4, T,Q> const& m) const GLM_NOEXCEPT; + }; +} // namespace std + +#include "hash.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/hash.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/hash.inl new file mode 100644 index 0000000000000000000000000000000000000000..2beac879a9b6172f408f8840ef93dbe97346bfe2 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/hash.inl @@ -0,0 +1,175 @@ +/// @ref gtx_hash + +namespace glm { +namespace detail +{ + GLM_INLINE void hash_combine(size_t &seed, size_t hash) + { + hash += 0x9e3779b9 + (seed << 6) + (seed >> 2); + seed ^= hash; + } +}} + +namespace std +{ + template + GLM_FUNC_QUALIFIER size_t hash>::operator()(glm::vec<1, T, Q> const& v) const GLM_NOEXCEPT + { + hash hasher; + return hasher(v.x); + } + + template + GLM_FUNC_QUALIFIER size_t hash>::operator()(glm::vec<2, T, Q> const& v) const GLM_NOEXCEPT + { + size_t seed = 0; + hash hasher; + glm::detail::hash_combine(seed, hasher(v.x)); + glm::detail::hash_combine(seed, hasher(v.y)); + return seed; + } + + template + GLM_FUNC_QUALIFIER size_t hash>::operator()(glm::vec<3, T, Q> const& v) const GLM_NOEXCEPT + { + size_t seed = 0; + hash hasher; + glm::detail::hash_combine(seed, hasher(v.x)); + glm::detail::hash_combine(seed, hasher(v.y)); + glm::detail::hash_combine(seed, hasher(v.z)); + return seed; + } + + template + GLM_FUNC_QUALIFIER size_t hash>::operator()(glm::vec<4, T, Q> const& v) const GLM_NOEXCEPT + { + size_t seed = 0; + hash hasher; + glm::detail::hash_combine(seed, hasher(v.x)); + glm::detail::hash_combine(seed, hasher(v.y)); + glm::detail::hash_combine(seed, hasher(v.z)); + glm::detail::hash_combine(seed, hasher(v.w)); + return seed; + } + + template + GLM_FUNC_QUALIFIER size_t hash>::operator()(glm::qua const& q) const GLM_NOEXCEPT + { + size_t seed = 0; + hash hasher; + glm::detail::hash_combine(seed, hasher(q.x)); + glm::detail::hash_combine(seed, hasher(q.y)); + glm::detail::hash_combine(seed, hasher(q.z)); + glm::detail::hash_combine(seed, hasher(q.w)); + return seed; + } + + template + GLM_FUNC_QUALIFIER size_t hash>::operator()(glm::tdualquat const& q) const GLM_NOEXCEPT + { + size_t seed = 0; + hash> hasher; + glm::detail::hash_combine(seed, hasher(q.real)); + glm::detail::hash_combine(seed, hasher(q.dual)); + return seed; + } + + template + GLM_FUNC_QUALIFIER size_t hash>::operator()(glm::mat<2, 2, T, Q> const& m) const GLM_NOEXCEPT + { + size_t seed = 0; + hash> hasher; + glm::detail::hash_combine(seed, hasher(m[0])); + glm::detail::hash_combine(seed, hasher(m[1])); + return seed; + } + + template + GLM_FUNC_QUALIFIER size_t hash>::operator()(glm::mat<2, 3, T, Q> const& m) const GLM_NOEXCEPT + { + size_t seed = 0; + hash> hasher; + glm::detail::hash_combine(seed, hasher(m[0])); + glm::detail::hash_combine(seed, hasher(m[1])); + return seed; + } + + template + GLM_FUNC_QUALIFIER size_t hash>::operator()(glm::mat<2, 4, T, Q> const& m) const GLM_NOEXCEPT + { + size_t seed = 0; + hash> hasher; + glm::detail::hash_combine(seed, hasher(m[0])); + glm::detail::hash_combine(seed, hasher(m[1])); + return seed; + } + + template + GLM_FUNC_QUALIFIER size_t hash>::operator()(glm::mat<3, 2, T, Q> const& m) const GLM_NOEXCEPT + { + size_t seed = 0; + hash> hasher; + glm::detail::hash_combine(seed, hasher(m[0])); + glm::detail::hash_combine(seed, hasher(m[1])); + glm::detail::hash_combine(seed, hasher(m[2])); + return seed; + } + + template + GLM_FUNC_QUALIFIER size_t hash>::operator()(glm::mat<3, 3, T, Q> const& m) const GLM_NOEXCEPT + { + size_t seed = 0; + hash> hasher; + glm::detail::hash_combine(seed, hasher(m[0])); + glm::detail::hash_combine(seed, hasher(m[1])); + glm::detail::hash_combine(seed, hasher(m[2])); + return seed; + } + + template + GLM_FUNC_QUALIFIER size_t hash>::operator()(glm::mat<3, 4, T, Q> const& m) const GLM_NOEXCEPT + { + size_t seed = 0; + hash> hasher; + glm::detail::hash_combine(seed, hasher(m[0])); + glm::detail::hash_combine(seed, hasher(m[1])); + glm::detail::hash_combine(seed, hasher(m[2])); + return seed; + } + + template + GLM_FUNC_QUALIFIER size_t hash>::operator()(glm::mat<4, 2, T,Q> const& m) const GLM_NOEXCEPT + { + size_t seed = 0; + hash> hasher; + glm::detail::hash_combine(seed, hasher(m[0])); + glm::detail::hash_combine(seed, hasher(m[1])); + glm::detail::hash_combine(seed, hasher(m[2])); + glm::detail::hash_combine(seed, hasher(m[3])); + return seed; + } + + template + GLM_FUNC_QUALIFIER size_t hash>::operator()(glm::mat<4, 3, T,Q> const& m) const GLM_NOEXCEPT + { + size_t seed = 0; + hash> hasher; + glm::detail::hash_combine(seed, hasher(m[0])); + glm::detail::hash_combine(seed, hasher(m[1])); + glm::detail::hash_combine(seed, hasher(m[2])); + glm::detail::hash_combine(seed, hasher(m[3])); + return seed; + } + + template + GLM_FUNC_QUALIFIER size_t hash>::operator()(glm::mat<4, 4, T, Q> const& m) const GLM_NOEXCEPT + { + size_t seed = 0; + hash> hasher; + glm::detail::hash_combine(seed, hasher(m[0])); + glm::detail::hash_combine(seed, hasher(m[1])); + glm::detail::hash_combine(seed, hasher(m[2])); + glm::detail::hash_combine(seed, hasher(m[3])); + return seed; + } +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/integer.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/integer.hpp new file mode 100644 index 0000000000000000000000000000000000000000..2833873865c4b55045092e4096f16c0160af6fbc --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/integer.hpp @@ -0,0 +1,76 @@ +/// @ref gtx_integer +/// @file glm/gtx/integer.hpp +/// +/// @see core (dependence) +/// +/// @defgroup gtx_integer GLM_GTX_integer +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Add support for integer for core functions + +#pragma once + +// Dependency: +#include "../glm.hpp" +#include "../gtc/integer.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_integer is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_integer extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_integer + /// @{ + + //! Returns x raised to the y power. + //! From GLM_GTX_integer extension. + GLM_FUNC_DECL int pow(int x, uint y); + + //! Returns the positive square root of x. + //! From GLM_GTX_integer extension. + GLM_FUNC_DECL int sqrt(int x); + + //! Returns the floor log2 of x. + //! From GLM_GTX_integer extension. + GLM_FUNC_DECL unsigned int floor_log2(unsigned int x); + + //! Modulus. Returns x - y * floor(x / y) for each component in x using the floating point value y. + //! From GLM_GTX_integer extension. + GLM_FUNC_DECL int mod(int x, int y); + + //! Return the factorial value of a number (!12 max, integer only) + //! From GLM_GTX_integer extension. + template + GLM_FUNC_DECL genType factorial(genType const& x); + + //! 32bit signed integer. + //! From GLM_GTX_integer extension. + typedef signed int sint; + + //! Returns x raised to the y power. + //! From GLM_GTX_integer extension. + GLM_FUNC_DECL uint pow(uint x, uint y); + + //! Returns the positive square root of x. + //! From GLM_GTX_integer extension. + GLM_FUNC_DECL uint sqrt(uint x); + + //! Modulus. Returns x - y * floor(x / y) for each component in x using the floating point value y. + //! From GLM_GTX_integer extension. + GLM_FUNC_DECL uint mod(uint x, uint y); + + //! Returns the number of leading zeros. + //! From GLM_GTX_integer extension. + GLM_FUNC_DECL uint nlz(uint x); + + /// @} +}//namespace glm + +#include "integer.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/integer.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/integer.inl new file mode 100644 index 0000000000000000000000000000000000000000..8f40b83765fdeb5be2b8ccbe6ecfe5529c803cc7 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/integer.inl @@ -0,0 +1,185 @@ +/// @ref gtx_integer + +namespace glm +{ + // pow + GLM_FUNC_QUALIFIER int pow(int x, uint y) + { + if(y == 0) + return x >= 0 ? 1 : -1; + + int result = x; + for(uint i = 1; i < y; ++i) + result *= x; + return result; + } + + // sqrt: From Christopher J. Musial, An integer square root, Graphics Gems, 1990, page 387 + GLM_FUNC_QUALIFIER int sqrt(int x) + { + if(x <= 1) return x; + + int NextTrial = x >> 1; + int CurrentAnswer; + + do + { + CurrentAnswer = NextTrial; + NextTrial = (NextTrial + x / NextTrial) >> 1; + } while(NextTrial < CurrentAnswer); + + return CurrentAnswer; + } + +// Henry Gordon Dietz: http://aggregate.org/MAGIC/ +namespace detail +{ + GLM_FUNC_QUALIFIER unsigned int ones32(unsigned int x) + { + /* 32-bit recursive reduction using SWAR... + but first step is mapping 2-bit values + into sum of 2 1-bit values in sneaky way + */ + x -= ((x >> 1) & 0x55555555); + x = (((x >> 2) & 0x33333333) + (x & 0x33333333)); + x = (((x >> 4) + x) & 0x0f0f0f0f); + x += (x >> 8); + x += (x >> 16); + return(x & 0x0000003f); + } +}//namespace detail + + // Henry Gordon Dietz: http://aggregate.org/MAGIC/ +/* + GLM_FUNC_QUALIFIER unsigned int floor_log2(unsigned int x) + { + x |= (x >> 1); + x |= (x >> 2); + x |= (x >> 4); + x |= (x >> 8); + x |= (x >> 16); + + return _detail::ones32(x) >> 1; + } +*/ + // mod + GLM_FUNC_QUALIFIER int mod(int x, int y) + { + return ((x % y) + y) % y; + } + + // factorial (!12 max, integer only) + template + GLM_FUNC_QUALIFIER genType factorial(genType const& x) + { + genType Temp = x; + genType Result; + for(Result = 1; Temp > 1; --Temp) + Result *= Temp; + return Result; + } + + template + GLM_FUNC_QUALIFIER vec<2, T, Q> factorial( + vec<2, T, Q> const& x) + { + return vec<2, T, Q>( + factorial(x.x), + factorial(x.y)); + } + + template + GLM_FUNC_QUALIFIER vec<3, T, Q> factorial( + vec<3, T, Q> const& x) + { + return vec<3, T, Q>( + factorial(x.x), + factorial(x.y), + factorial(x.z)); + } + + template + GLM_FUNC_QUALIFIER vec<4, T, Q> factorial( + vec<4, T, Q> const& x) + { + return vec<4, T, Q>( + factorial(x.x), + factorial(x.y), + factorial(x.z), + factorial(x.w)); + } + + GLM_FUNC_QUALIFIER uint pow(uint x, uint y) + { + if (y == 0) + return 1u; + + uint result = x; + for(uint i = 1; i < y; ++i) + result *= x; + return result; + } + + GLM_FUNC_QUALIFIER uint sqrt(uint x) + { + if(x <= 1) return x; + + uint NextTrial = x >> 1; + uint CurrentAnswer; + + do + { + CurrentAnswer = NextTrial; + NextTrial = (NextTrial + x / NextTrial) >> 1; + } while(NextTrial < CurrentAnswer); + + return CurrentAnswer; + } + + GLM_FUNC_QUALIFIER uint mod(uint x, uint y) + { + return x - y * (x / y); + } + +#if(GLM_COMPILER & (GLM_COMPILER_VC | GLM_COMPILER_GCC)) + + GLM_FUNC_QUALIFIER unsigned int nlz(unsigned int x) + { + return 31u - findMSB(x); + } + +#else + + // Hackers Delight: http://www.hackersdelight.org/HDcode/nlz.c.txt + GLM_FUNC_QUALIFIER unsigned int nlz(unsigned int x) + { + int y, m, n; + + y = -int(x >> 16); // If left half of x is 0, + m = (y >> 16) & 16; // set n = 16. If left half + n = 16 - m; // is nonzero, set n = 0 and + x = x >> m; // shift x right 16. + // Now x is of the form 0000xxxx. + y = x - 0x100; // If positions 8-15 are 0, + m = (y >> 16) & 8; // add 8 to n and shift x left 8. + n = n + m; + x = x << m; + + y = x - 0x1000; // If positions 12-15 are 0, + m = (y >> 16) & 4; // add 4 to n and shift x left 4. + n = n + m; + x = x << m; + + y = x - 0x4000; // If positions 14-15 are 0, + m = (y >> 16) & 2; // add 2 to n and shift x left 2. + n = n + m; + x = x << m; + + y = x >> 14; // Set y = 0, 1, 2, or 3. + m = y & ~(y >> 1); // Set m = 0, 1, 2, or 2 resp. + return unsigned(n + 2 - m); + } + +#endif//(GLM_COMPILER) + +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/intersect.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/intersect.hpp new file mode 100644 index 0000000000000000000000000000000000000000..092cc01d86c0727b26a7b8d262d4f3b8f61f1608 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/intersect.hpp @@ -0,0 +1,92 @@ +/// @ref gtx_intersect +/// @file glm/gtx/intersect.hpp +/// +/// @see core (dependence) +/// @see gtx_closest_point (dependence) +/// +/// @defgroup gtx_intersect GLM_GTX_intersect +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Add intersection functions + +#pragma once + +// Dependency: +#include +#include +#include "../glm.hpp" +#include "../geometric.hpp" +#include "../gtx/closest_point.hpp" +#include "../gtx/vector_query.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_closest_point is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_closest_point extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_intersect + /// @{ + + //! Compute the intersection of a ray and a plane. + //! Ray direction and plane normal must be unit length. + //! From GLM_GTX_intersect extension. + template + GLM_FUNC_DECL bool intersectRayPlane( + genType const& orig, genType const& dir, + genType const& planeOrig, genType const& planeNormal, + typename genType::value_type & intersectionDistance); + + //! Compute the intersection of a ray and a triangle. + /// Based om Tomas Möller implementation http://fileadmin.cs.lth.se/cs/Personal/Tomas_Akenine-Moller/raytri/ + //! From GLM_GTX_intersect extension. + template + GLM_FUNC_DECL bool intersectRayTriangle( + vec<3, T, Q> const& orig, vec<3, T, Q> const& dir, + vec<3, T, Q> const& v0, vec<3, T, Q> const& v1, vec<3, T, Q> const& v2, + vec<2, T, Q>& baryPosition, T& distance); + + //! Compute the intersection of a line and a triangle. + //! From GLM_GTX_intersect extension. + template + GLM_FUNC_DECL bool intersectLineTriangle( + genType const& orig, genType const& dir, + genType const& vert0, genType const& vert1, genType const& vert2, + genType & position); + + //! Compute the intersection distance of a ray and a sphere. + //! The ray direction vector is unit length. + //! From GLM_GTX_intersect extension. + template + GLM_FUNC_DECL bool intersectRaySphere( + genType const& rayStarting, genType const& rayNormalizedDirection, + genType const& sphereCenter, typename genType::value_type const sphereRadiusSquared, + typename genType::value_type & intersectionDistance); + + //! Compute the intersection of a ray and a sphere. + //! From GLM_GTX_intersect extension. + template + GLM_FUNC_DECL bool intersectRaySphere( + genType const& rayStarting, genType const& rayNormalizedDirection, + genType const& sphereCenter, const typename genType::value_type sphereRadius, + genType & intersectionPosition, genType & intersectionNormal); + + //! Compute the intersection of a line and a sphere. + //! From GLM_GTX_intersect extension + template + GLM_FUNC_DECL bool intersectLineSphere( + genType const& point0, genType const& point1, + genType const& sphereCenter, typename genType::value_type sphereRadius, + genType & intersectionPosition1, genType & intersectionNormal1, + genType & intersectionPosition2 = genType(), genType & intersectionNormal2 = genType()); + + /// @} +}//namespace glm + +#include "intersect.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/intersect.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/intersect.inl new file mode 100644 index 0000000000000000000000000000000000000000..8481359c0fd3befb7afeb5afd94e9736b7a8c925 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/intersect.inl @@ -0,0 +1,200 @@ +/// @ref gtx_intersect + +namespace glm +{ + template + GLM_FUNC_QUALIFIER bool intersectRayPlane + ( + genType const& orig, genType const& dir, + genType const& planeOrig, genType const& planeNormal, + typename genType::value_type & intersectionDistance + ) + { + typename genType::value_type d = glm::dot(dir, planeNormal); + typename genType::value_type Epsilon = std::numeric_limits::epsilon(); + + if(glm::abs(d) > Epsilon) // if dir and planeNormal are not perpendicular + { + typename genType::value_type const tmp_intersectionDistance = glm::dot(planeOrig - orig, planeNormal) / d; + if (tmp_intersectionDistance > static_cast(0)) { // allow only intersections + intersectionDistance = tmp_intersectionDistance; + return true; + } + } + + return false; + } + + template + GLM_FUNC_QUALIFIER bool intersectRayTriangle + ( + vec<3, T, Q> const& orig, vec<3, T, Q> const& dir, + vec<3, T, Q> const& vert0, vec<3, T, Q> const& vert1, vec<3, T, Q> const& vert2, + vec<2, T, Q>& baryPosition, T& distance + ) + { + // find vectors for two edges sharing vert0 + vec<3, T, Q> const edge1 = vert1 - vert0; + vec<3, T, Q> const edge2 = vert2 - vert0; + + // begin calculating determinant - also used to calculate U parameter + vec<3, T, Q> const p = glm::cross(dir, edge2); + + // if determinant is near zero, ray lies in plane of triangle + T const det = glm::dot(edge1, p); + + vec<3, T, Q> Perpendicular(0); + + if(det > std::numeric_limits::epsilon()) + { + // calculate distance from vert0 to ray origin + vec<3, T, Q> const dist = orig - vert0; + + // calculate U parameter and test bounds + baryPosition.x = glm::dot(dist, p); + if(baryPosition.x < static_cast(0) || baryPosition.x > det) + return false; + + // prepare to test V parameter + Perpendicular = glm::cross(dist, edge1); + + // calculate V parameter and test bounds + baryPosition.y = glm::dot(dir, Perpendicular); + if((baryPosition.y < static_cast(0)) || ((baryPosition.x + baryPosition.y) > det)) + return false; + } + else if(det < -std::numeric_limits::epsilon()) + { + // calculate distance from vert0 to ray origin + vec<3, T, Q> const dist = orig - vert0; + + // calculate U parameter and test bounds + baryPosition.x = glm::dot(dist, p); + if((baryPosition.x > static_cast(0)) || (baryPosition.x < det)) + return false; + + // prepare to test V parameter + Perpendicular = glm::cross(dist, edge1); + + // calculate V parameter and test bounds + baryPosition.y = glm::dot(dir, Perpendicular); + if((baryPosition.y > static_cast(0)) || (baryPosition.x + baryPosition.y < det)) + return false; + } + else + return false; // ray is parallel to the plane of the triangle + + T inv_det = static_cast(1) / det; + + // calculate distance, ray intersects triangle + distance = glm::dot(edge2, Perpendicular) * inv_det; + baryPosition *= inv_det; + + return true; + } + + template + GLM_FUNC_QUALIFIER bool intersectLineTriangle + ( + genType const& orig, genType const& dir, + genType const& vert0, genType const& vert1, genType const& vert2, + genType & position + ) + { + typename genType::value_type Epsilon = std::numeric_limits::epsilon(); + + genType edge1 = vert1 - vert0; + genType edge2 = vert2 - vert0; + + genType Perpendicular = cross(dir, edge2); + + typename genType::value_type det = dot(edge1, Perpendicular); + + if (det > -Epsilon && det < Epsilon) + return false; + typename genType::value_type inv_det = typename genType::value_type(1) / det; + + genType Tangent = orig - vert0; + + position.y = dot(Tangent, Perpendicular) * inv_det; + if (position.y < typename genType::value_type(0) || position.y > typename genType::value_type(1)) + return false; + + genType Cotangent = cross(Tangent, edge1); + + position.z = dot(dir, Cotangent) * inv_det; + if (position.z < typename genType::value_type(0) || position.y + position.z > typename genType::value_type(1)) + return false; + + position.x = dot(edge2, Cotangent) * inv_det; + + return true; + } + + template + GLM_FUNC_QUALIFIER bool intersectRaySphere + ( + genType const& rayStarting, genType const& rayNormalizedDirection, + genType const& sphereCenter, const typename genType::value_type sphereRadiusSquared, + typename genType::value_type & intersectionDistance + ) + { + typename genType::value_type Epsilon = std::numeric_limits::epsilon(); + genType diff = sphereCenter - rayStarting; + typename genType::value_type t0 = dot(diff, rayNormalizedDirection); + typename genType::value_type dSquared = dot(diff, diff) - t0 * t0; + if( dSquared > sphereRadiusSquared ) + { + return false; + } + typename genType::value_type t1 = sqrt( sphereRadiusSquared - dSquared ); + intersectionDistance = t0 > t1 + Epsilon ? t0 - t1 : t0 + t1; + return intersectionDistance > Epsilon; + } + + template + GLM_FUNC_QUALIFIER bool intersectRaySphere + ( + genType const& rayStarting, genType const& rayNormalizedDirection, + genType const& sphereCenter, const typename genType::value_type sphereRadius, + genType & intersectionPosition, genType & intersectionNormal + ) + { + typename genType::value_type distance; + if( intersectRaySphere( rayStarting, rayNormalizedDirection, sphereCenter, sphereRadius * sphereRadius, distance ) ) + { + intersectionPosition = rayStarting + rayNormalizedDirection * distance; + intersectionNormal = (intersectionPosition - sphereCenter) / sphereRadius; + return true; + } + return false; + } + + template + GLM_FUNC_QUALIFIER bool intersectLineSphere + ( + genType const& point0, genType const& point1, + genType const& sphereCenter, typename genType::value_type sphereRadius, + genType & intersectionPoint1, genType & intersectionNormal1, + genType & intersectionPoint2, genType & intersectionNormal2 + ) + { + typename genType::value_type Epsilon = std::numeric_limits::epsilon(); + genType dir = normalize(point1 - point0); + genType diff = sphereCenter - point0; + typename genType::value_type t0 = dot(diff, dir); + typename genType::value_type dSquared = dot(diff, diff) - t0 * t0; + if( dSquared > sphereRadius * sphereRadius ) + { + return false; + } + typename genType::value_type t1 = sqrt( sphereRadius * sphereRadius - dSquared ); + if( t0 < t1 + Epsilon ) + t1 = -t1; + intersectionPoint1 = point0 + dir * (t0 - t1); + intersectionNormal1 = (intersectionPoint1 - sphereCenter) / sphereRadius; + intersectionPoint2 = point0 + dir * (t0 + t1); + intersectionNormal2 = (intersectionPoint2 - sphereCenter) / sphereRadius; + return true; + } +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/io.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/io.hpp new file mode 100644 index 0000000000000000000000000000000000000000..18d3ccb4b7d3e1d95ae21ce8ec24260a19505e60 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/io.hpp @@ -0,0 +1,201 @@ +/// @ref gtx_io +/// @file glm/gtx/io.hpp +/// @author Jan P Springer (regnirpsj@gmail.com) +/// +/// @see core (dependence) +/// @see gtc_matrix_access (dependence) +/// @see gtc_quaternion (dependence) +/// +/// @defgroup gtx_io GLM_GTX_io +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// std::[w]ostream support for glm types +/// +/// std::[w]ostream support for glm types + qualifier/width/etc. manipulators +/// based on howard hinnant's std::chrono io proposal +/// [http://home.roadrunner.com/~hinnant/bloomington/chrono_io.html] + +#pragma once + +// Dependency: +#include "../glm.hpp" +#include "../gtx/quaternion.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_io is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_io extension included") +# endif +#endif + +#include // std::basic_ostream<> (fwd) +#include // std::locale, std::locale::facet, std::locale::id +#include // std::pair<> + +namespace glm +{ + /// @addtogroup gtx_io + /// @{ + + namespace io + { + enum order_type { column_major, row_major}; + + template + class format_punct : public std::locale::facet + { + typedef CTy char_type; + + public: + + static std::locale::id id; + + bool formatted; + unsigned precision; + unsigned width; + char_type separator; + char_type delim_left; + char_type delim_right; + char_type space; + char_type newline; + order_type order; + + GLM_FUNC_DECL explicit format_punct(size_t a = 0); + GLM_FUNC_DECL explicit format_punct(format_punct const&); + }; + + template > + class basic_state_saver { + + public: + + GLM_FUNC_DECL explicit basic_state_saver(std::basic_ios&); + GLM_FUNC_DECL ~basic_state_saver(); + + private: + + typedef ::std::basic_ios state_type; + typedef typename state_type::char_type char_type; + typedef ::std::ios_base::fmtflags flags_type; + typedef ::std::streamsize streamsize_type; + typedef ::std::locale const locale_type; + + state_type& state_; + flags_type flags_; + streamsize_type precision_; + streamsize_type width_; + char_type fill_; + locale_type locale_; + + GLM_FUNC_DECL basic_state_saver& operator=(basic_state_saver const&); + }; + + typedef basic_state_saver state_saver; + typedef basic_state_saver wstate_saver; + + template > + class basic_format_saver + { + public: + + GLM_FUNC_DECL explicit basic_format_saver(std::basic_ios&); + GLM_FUNC_DECL ~basic_format_saver(); + + private: + + basic_state_saver const bss_; + + GLM_FUNC_DECL basic_format_saver& operator=(basic_format_saver const&); + }; + + typedef basic_format_saver format_saver; + typedef basic_format_saver wformat_saver; + + struct precision + { + unsigned value; + + GLM_FUNC_DECL explicit precision(unsigned); + }; + + struct width + { + unsigned value; + + GLM_FUNC_DECL explicit width(unsigned); + }; + + template + struct delimeter + { + CTy value[3]; + + GLM_FUNC_DECL explicit delimeter(CTy /* left */, CTy /* right */, CTy /* separator */ = ','); + }; + + struct order + { + order_type value; + + GLM_FUNC_DECL explicit order(order_type); + }; + + // functions, inlined (inline) + + template + FTy const& get_facet(std::basic_ios&); + template + std::basic_ios& formatted(std::basic_ios&); + template + std::basic_ios& unformatted(std::basic_ios&); + + template + std::basic_ostream& operator<<(std::basic_ostream&, precision const&); + template + std::basic_ostream& operator<<(std::basic_ostream&, width const&); + template + std::basic_ostream& operator<<(std::basic_ostream&, delimeter const&); + template + std::basic_ostream& operator<<(std::basic_ostream&, order const&); + }//namespace io + + template + GLM_FUNC_DECL std::basic_ostream& operator<<(std::basic_ostream&, qua const&); + template + GLM_FUNC_DECL std::basic_ostream& operator<<(std::basic_ostream&, vec<1, T, Q> const&); + template + GLM_FUNC_DECL std::basic_ostream& operator<<(std::basic_ostream&, vec<2, T, Q> const&); + template + GLM_FUNC_DECL std::basic_ostream& operator<<(std::basic_ostream&, vec<3, T, Q> const&); + template + GLM_FUNC_DECL std::basic_ostream& operator<<(std::basic_ostream&, vec<4, T, Q> const&); + template + GLM_FUNC_DECL std::basic_ostream& operator<<(std::basic_ostream&, mat<2, 2, T, Q> const&); + template + GLM_FUNC_DECL std::basic_ostream& operator<<(std::basic_ostream&, mat<2, 3, T, Q> const&); + template + GLM_FUNC_DECL std::basic_ostream& operator<<(std::basic_ostream&, mat<2, 4, T, Q> const&); + template + GLM_FUNC_DECL std::basic_ostream& operator<<(std::basic_ostream&, mat<3, 2, T, Q> const&); + template + GLM_FUNC_DECL std::basic_ostream& operator<<(std::basic_ostream&, mat<3, 3, T, Q> const&); + template + GLM_FUNC_DECL std::basic_ostream& operator<<(std::basic_ostream&, mat<3, 4, T, Q> const&); + template + GLM_FUNC_DECL std::basic_ostream& operator<<(std::basic_ostream&, mat<4, 2, T, Q> const&); + template + GLM_FUNC_DECL std::basic_ostream& operator<<(std::basic_ostream&, mat<4, 3, T, Q> const&); + template + GLM_FUNC_DECL std::basic_ostream& operator<<(std::basic_ostream&, mat<4, 4, T, Q> const&); + + template + GLM_FUNC_DECL std::basic_ostream & operator<<(std::basic_ostream &, + std::pair const, mat<4, 4, T, Q> const> const&); + + /// @} +}//namespace glm + +#include "io.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/io.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/io.inl new file mode 100644 index 0000000000000000000000000000000000000000..0b374bb8b4787ac544f18b32fa53eb0de6c36370 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/io.inl @@ -0,0 +1,440 @@ +/// @ref gtx_io +/// @author Jan P Springer (regnirpsj@gmail.com) + +#include // std::fixed, std::setfill<>, std::setprecision, std::right, std::setw +#include // std::basic_ostream<> +#include "../gtc/matrix_access.hpp" // glm::col, glm::row +#include "../gtx/type_trait.hpp" // glm::type<> + +namespace glm{ +namespace io +{ + template + GLM_FUNC_QUALIFIER format_punct::format_punct(size_t a) + : std::locale::facet(a) + , formatted(true) + , precision(3) + , width(1 + 4 + 1 + precision) + , separator(',') + , delim_left('[') + , delim_right(']') + , space(' ') + , newline('\n') + , order(column_major) + {} + + template + GLM_FUNC_QUALIFIER format_punct::format_punct(format_punct const& a) + : std::locale::facet(0) + , formatted(a.formatted) + , precision(a.precision) + , width(a.width) + , separator(a.separator) + , delim_left(a.delim_left) + , delim_right(a.delim_right) + , space(a.space) + , newline(a.newline) + , order(a.order) + {} + + template std::locale::id format_punct::id; + + template + GLM_FUNC_QUALIFIER basic_state_saver::basic_state_saver(std::basic_ios& a) + : state_(a) + , flags_(a.flags()) + , precision_(a.precision()) + , width_(a.width()) + , fill_(a.fill()) + , locale_(a.getloc()) + {} + + template + GLM_FUNC_QUALIFIER basic_state_saver::~basic_state_saver() + { + state_.imbue(locale_); + state_.fill(fill_); + state_.width(width_); + state_.precision(precision_); + state_.flags(flags_); + } + + template + GLM_FUNC_QUALIFIER basic_format_saver::basic_format_saver(std::basic_ios& a) + : bss_(a) + { + a.imbue(std::locale(a.getloc(), new format_punct(get_facet >(a)))); + } + + template + GLM_FUNC_QUALIFIER + basic_format_saver::~basic_format_saver() + {} + + GLM_FUNC_QUALIFIER precision::precision(unsigned a) + : value(a) + {} + + GLM_FUNC_QUALIFIER width::width(unsigned a) + : value(a) + {} + + template + GLM_FUNC_QUALIFIER delimeter::delimeter(CTy a, CTy b, CTy c) + : value() + { + value[0] = a; + value[1] = b; + value[2] = c; + } + + GLM_FUNC_QUALIFIER order::order(order_type a) + : value(a) + {} + + template + GLM_FUNC_QUALIFIER FTy const& get_facet(std::basic_ios& ios) + { + if(!std::has_facet(ios.getloc())) + ios.imbue(std::locale(ios.getloc(), new FTy)); + + return std::use_facet(ios.getloc()); + } + + template + GLM_FUNC_QUALIFIER std::basic_ios& formatted(std::basic_ios& ios) + { + const_cast&>(get_facet >(ios)).formatted = true; + return ios; + } + + template + GLM_FUNC_QUALIFIER std::basic_ios& unformatted(std::basic_ios& ios) + { + const_cast&>(get_facet >(ios)).formatted = false; + return ios; + } + + template + GLM_FUNC_QUALIFIER std::basic_ostream& operator<<(std::basic_ostream& os, precision const& a) + { + const_cast&>(get_facet >(os)).precision = a.value; + return os; + } + + template + GLM_FUNC_QUALIFIER std::basic_ostream& operator<<(std::basic_ostream& os, width const& a) + { + const_cast&>(get_facet >(os)).width = a.value; + return os; + } + + template + GLM_FUNC_QUALIFIER std::basic_ostream& operator<<(std::basic_ostream& os, delimeter const& a) + { + format_punct & fmt(const_cast&>(get_facet >(os))); + + fmt.delim_left = a.value[0]; + fmt.delim_right = a.value[1]; + fmt.separator = a.value[2]; + + return os; + } + + template + GLM_FUNC_QUALIFIER std::basic_ostream& operator<<(std::basic_ostream& os, order const& a) + { + const_cast&>(get_facet >(os)).order = a.value; + return os; + } +} // namespace io + +namespace detail +{ + template + GLM_FUNC_QUALIFIER std::basic_ostream& + print_vector_on(std::basic_ostream& os, V const& a) + { + typename std::basic_ostream::sentry const cerberus(os); + + if(cerberus) + { + io::format_punct const& fmt(io::get_facet >(os)); + + length_t const& components(type::components); + + if(fmt.formatted) + { + io::basic_state_saver const bss(os); + + os << std::fixed << std::right << std::setprecision(fmt.precision) << std::setfill(fmt.space) << fmt.delim_left; + + for(length_t i(0); i < components; ++i) + { + os << std::setw(fmt.width) << a[i]; + if(components-1 != i) + os << fmt.separator; + } + + os << fmt.delim_right; + } + else + { + for(length_t i(0); i < components; ++i) + { + os << a[i]; + + if(components-1 != i) + os << fmt.space; + } + } + } + + return os; + } +}//namespace detail + + template + GLM_FUNC_QUALIFIER std::basic_ostream& operator<<(std::basic_ostream& os, qua const& a) + { + return detail::print_vector_on(os, a); + } + + template + GLM_FUNC_QUALIFIER std::basic_ostream& operator<<(std::basic_ostream& os, vec<1, T, Q> const& a) + { + return detail::print_vector_on(os, a); + } + + template + GLM_FUNC_QUALIFIER std::basic_ostream& operator<<(std::basic_ostream& os, vec<2, T, Q> const& a) + { + return detail::print_vector_on(os, a); + } + + template + GLM_FUNC_QUALIFIER std::basic_ostream& operator<<(std::basic_ostream& os, vec<3, T, Q> const& a) + { + return detail::print_vector_on(os, a); + } + + template + GLM_FUNC_QUALIFIER std::basic_ostream& operator<<(std::basic_ostream& os, vec<4, T, Q> const& a) + { + return detail::print_vector_on(os, a); + } + +namespace detail +{ + template class M, length_t C, length_t R, typename T, qualifier Q> + GLM_FUNC_QUALIFIER std::basic_ostream& print_matrix_on(std::basic_ostream& os, M const& a) + { + typename std::basic_ostream::sentry const cerberus(os); + + if(cerberus) + { + io::format_punct const& fmt(io::get_facet >(os)); + + length_t const& cols(type >::cols); + length_t const& rows(type >::rows); + + if(fmt.formatted) + { + os << fmt.newline << fmt.delim_left; + + switch(fmt.order) + { + case io::column_major: + { + for(length_t i(0); i < rows; ++i) + { + if (0 != i) + os << fmt.space; + + os << row(a, i); + + if(rows-1 != i) + os << fmt.newline; + } + } + break; + + case io::row_major: + { + for(length_t i(0); i < cols; ++i) + { + if(0 != i) + os << fmt.space; + + os << column(a, i); + + if(cols-1 != i) + os << fmt.newline; + } + } + break; + } + + os << fmt.delim_right; + } + else + { + switch (fmt.order) + { + case io::column_major: + { + for(length_t i(0); i < cols; ++i) + { + os << column(a, i); + + if(cols - 1 != i) + os << fmt.space; + } + } + break; + + case io::row_major: + { + for (length_t i(0); i < rows; ++i) + { + os << row(a, i); + + if (rows-1 != i) + os << fmt.space; + } + } + break; + } + } + } + + return os; + } +}//namespace detail + + template + GLM_FUNC_QUALIFIER std::basic_ostream& operator<<(std::basic_ostream& os, mat<2, 2, T, Q> const& a) + { + return detail::print_matrix_on(os, a); + } + + template + GLM_FUNC_QUALIFIER std::basic_ostream& operator<<(std::basic_ostream& os, mat<2, 3, T, Q> const& a) + { + return detail::print_matrix_on(os, a); + } + + template + GLM_FUNC_QUALIFIER std::basic_ostream& operator<<(std::basic_ostream& os, mat<2, 4, T, Q> const& a) + { + return detail::print_matrix_on(os, a); + } + + template + GLM_FUNC_QUALIFIER std::basic_ostream& operator<<(std::basic_ostream& os, mat<3, 2, T, Q> const& a) + { + return detail::print_matrix_on(os, a); + } + + template + GLM_FUNC_QUALIFIER std::basic_ostream& operator<<(std::basic_ostream& os, mat<3, 3, T, Q> const& a) + { + return detail::print_matrix_on(os, a); + } + + template + GLM_FUNC_QUALIFIER std::basic_ostream & operator<<(std::basic_ostream& os, mat<3, 4, T, Q> const& a) + { + return detail::print_matrix_on(os, a); + } + + template + GLM_FUNC_QUALIFIER std::basic_ostream & operator<<(std::basic_ostream& os, mat<4, 2, T, Q> const& a) + { + return detail::print_matrix_on(os, a); + } + + template + GLM_FUNC_QUALIFIER std::basic_ostream & operator<<(std::basic_ostream& os, mat<4, 3, T, Q> const& a) + { + return detail::print_matrix_on(os, a); + } + + template + GLM_FUNC_QUALIFIER std::basic_ostream & operator<<(std::basic_ostream& os, mat<4, 4, T, Q> const& a) + { + return detail::print_matrix_on(os, a); + } + +namespace detail +{ + template class M, length_t C, length_t R, typename T, qualifier Q> + GLM_FUNC_QUALIFIER std::basic_ostream& print_matrix_pair_on(std::basic_ostream& os, std::pair const, M const> const& a) + { + typename std::basic_ostream::sentry const cerberus(os); + + if(cerberus) + { + io::format_punct const& fmt(io::get_facet >(os)); + M const& ml(a.first); + M const& mr(a.second); + length_t const& cols(type >::cols); + length_t const& rows(type >::rows); + + if(fmt.formatted) + { + os << fmt.newline << fmt.delim_left; + + switch(fmt.order) + { + case io::column_major: + { + for(length_t i(0); i < rows; ++i) + { + if(0 != i) + os << fmt.space; + + os << row(ml, i) << ((rows-1 != i) ? fmt.space : fmt.delim_right) << fmt.space << ((0 != i) ? fmt.space : fmt.delim_left) << row(mr, i); + + if(rows-1 != i) + os << fmt.newline; + } + } + break; + case io::row_major: + { + for(length_t i(0); i < cols; ++i) + { + if(0 != i) + os << fmt.space; + + os << column(ml, i) << ((cols-1 != i) ? fmt.space : fmt.delim_right) << fmt.space << ((0 != i) ? fmt.space : fmt.delim_left) << column(mr, i); + + if(cols-1 != i) + os << fmt.newline; + } + } + break; + } + + os << fmt.delim_right; + } + else + { + os << ml << fmt.space << mr; + } + } + + return os; + } +}//namespace detail + + template + GLM_FUNC_QUALIFIER std::basic_ostream& operator<<( + std::basic_ostream & os, + std::pair const, + mat<4, 4, T, Q> const> const& a) + { + return detail::print_matrix_pair_on(os, a); + } +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/log_base.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/log_base.hpp new file mode 100644 index 0000000000000000000000000000000000000000..4e3155fc679f90b1dde903fa0d40d0fe1a286774 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/log_base.hpp @@ -0,0 +1,48 @@ +/// @ref gtx_log_base +/// @file glm/gtx/log_base.hpp +/// +/// @see core (dependence) +/// +/// @defgroup gtx_log_base GLM_GTX_log_base +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Logarithm for any base. base can be a vector or a scalar. + +#pragma once + +// Dependency: +#include "../glm.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_log_base is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_log_base extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_log_base + /// @{ + + /// Logarithm for any base. + /// From GLM_GTX_log_base. + template + GLM_FUNC_DECL genType log( + genType const& x, + genType const& base); + + /// Logarithm for any base. + /// From GLM_GTX_log_base. + template + GLM_FUNC_DECL vec sign( + vec const& x, + vec const& base); + + /// @} +}//namespace glm + +#include "log_base.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/log_base.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/log_base.inl new file mode 100644 index 0000000000000000000000000000000000000000..d26b2b19641e0dcf40e5b0d48537c82cc9b51f1b --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/log_base.inl @@ -0,0 +1,16 @@ +/// @ref gtx_log_base + +namespace glm +{ + template + GLM_FUNC_QUALIFIER genType log(genType const& x, genType const& base) + { + return glm::log(x) / glm::log(base); + } + + template + GLM_FUNC_QUALIFIER vec log(vec const& x, vec const& base) + { + return glm::log(x) / glm::log(base); + } +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/matrix_cross_product.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/matrix_cross_product.hpp new file mode 100644 index 0000000000000000000000000000000000000000..14d514c539cb7e3201093d019d1ffe26d010f4ef --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/matrix_cross_product.hpp @@ -0,0 +1,47 @@ +/// @ref gtx_matrix_cross_product +/// @file glm/gtx/matrix_cross_product.hpp +/// +/// @see core (dependence) +/// @see gtx_extented_min_max (dependence) +/// +/// @defgroup gtx_matrix_cross_product GLM_GTX_matrix_cross_product +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Build cross product matrices + +#pragma once + +// Dependency: +#include "../glm.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_matrix_cross_product is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_matrix_cross_product extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_matrix_cross_product + /// @{ + + //! Build a cross product matrix. + //! From GLM_GTX_matrix_cross_product extension. + template + GLM_FUNC_DECL mat<3, 3, T, Q> matrixCross3( + vec<3, T, Q> const& x); + + //! Build a cross product matrix. + //! From GLM_GTX_matrix_cross_product extension. + template + GLM_FUNC_DECL mat<4, 4, T, Q> matrixCross4( + vec<3, T, Q> const& x); + + /// @} +}//namespace glm + +#include "matrix_cross_product.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/matrix_cross_product.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/matrix_cross_product.inl new file mode 100644 index 0000000000000000000000000000000000000000..c2869810678243741d5e58bcbfbe1acc03e78ebc --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/matrix_cross_product.inl @@ -0,0 +1,37 @@ +/// @ref gtx_matrix_cross_product + +namespace glm +{ + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> matrixCross3 + ( + vec<3, T, Q> const& x + ) + { + mat<3, 3, T, Q> Result(T(0)); + Result[0][1] = x.z; + Result[1][0] = -x.z; + Result[0][2] = -x.y; + Result[2][0] = x.y; + Result[1][2] = x.x; + Result[2][1] = -x.x; + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> matrixCross4 + ( + vec<3, T, Q> const& x + ) + { + mat<4, 4, T, Q> Result(T(0)); + Result[0][1] = x.z; + Result[1][0] = -x.z; + Result[0][2] = -x.y; + Result[2][0] = x.y; + Result[1][2] = x.x; + Result[2][1] = -x.x; + return Result; + } + +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/matrix_decompose.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/matrix_decompose.hpp new file mode 100644 index 0000000000000000000000000000000000000000..cc37ab8c66bf7e5fb318c68b24fdbedc98730aca --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/matrix_decompose.hpp @@ -0,0 +1,46 @@ +/// @ref gtx_matrix_decompose +/// @file glm/gtx/matrix_decompose.hpp +/// +/// @see core (dependence) +/// +/// @defgroup gtx_matrix_decompose GLM_GTX_matrix_decompose +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Decomposes a model matrix to translations, rotation and scale components + +#pragma once + +// Dependencies +#include "../mat4x4.hpp" +#include "../vec3.hpp" +#include "../vec4.hpp" +#include "../geometric.hpp" +#include "../gtc/quaternion.hpp" +#include "../gtc/matrix_transform.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_matrix_decompose is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_matrix_decompose extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_matrix_decompose + /// @{ + + /// Decomposes a model matrix to translations, rotation and scale components + /// @see gtx_matrix_decompose + template + GLM_FUNC_DECL bool decompose( + mat<4, 4, T, Q> const& modelMatrix, + vec<3, T, Q> & scale, qua & orientation, vec<3, T, Q> & translation, vec<3, T, Q> & skew, vec<4, T, Q> & perspective); + + /// @} +}//namespace glm + +#include "matrix_decompose.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/matrix_decompose.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/matrix_decompose.inl new file mode 100644 index 0000000000000000000000000000000000000000..3bce93fb287f397be46e523201515d7f7ef74d65 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/matrix_decompose.inl @@ -0,0 +1,192 @@ +/// @ref gtx_matrix_decompose + +#include "../gtc/constants.hpp" +#include "../gtc/epsilon.hpp" + +namespace glm{ +namespace detail +{ + /// Make a linear combination of two vectors and return the result. + // result = (a * ascl) + (b * bscl) + template + GLM_FUNC_QUALIFIER vec<3, T, Q> combine( + vec<3, T, Q> const& a, + vec<3, T, Q> const& b, + T ascl, T bscl) + { + return (a * ascl) + (b * bscl); + } + + template + GLM_FUNC_QUALIFIER vec<3, T, Q> scale(vec<3, T, Q> const& v, T desiredLength) + { + return v * desiredLength / length(v); + } +}//namespace detail + + // Matrix decompose + // http://www.opensource.apple.com/source/WebCore/WebCore-514/platform/graphics/transforms/TransformationMatrix.cpp + // Decomposes the mode matrix to translations,rotation scale components + + template + GLM_FUNC_QUALIFIER bool decompose(mat<4, 4, T, Q> const& ModelMatrix, vec<3, T, Q> & Scale, qua & Orientation, vec<3, T, Q> & Translation, vec<3, T, Q> & Skew, vec<4, T, Q> & Perspective) + { + mat<4, 4, T, Q> LocalMatrix(ModelMatrix); + + // Normalize the matrix. + if(epsilonEqual(LocalMatrix[3][3], static_cast(0), epsilon())) + return false; + + for(length_t i = 0; i < 4; ++i) + for(length_t j = 0; j < 4; ++j) + LocalMatrix[i][j] /= LocalMatrix[3][3]; + + // perspectiveMatrix is used to solve for perspective, but it also provides + // an easy way to test for singularity of the upper 3x3 component. + mat<4, 4, T, Q> PerspectiveMatrix(LocalMatrix); + + for(length_t i = 0; i < 3; i++) + PerspectiveMatrix[i][3] = static_cast(0); + PerspectiveMatrix[3][3] = static_cast(1); + + /// TODO: Fixme! + if(epsilonEqual(determinant(PerspectiveMatrix), static_cast(0), epsilon())) + return false; + + // First, isolate perspective. This is the messiest. + if( + epsilonNotEqual(LocalMatrix[0][3], static_cast(0), epsilon()) || + epsilonNotEqual(LocalMatrix[1][3], static_cast(0), epsilon()) || + epsilonNotEqual(LocalMatrix[2][3], static_cast(0), epsilon())) + { + // rightHandSide is the right hand side of the equation. + vec<4, T, Q> RightHandSide; + RightHandSide[0] = LocalMatrix[0][3]; + RightHandSide[1] = LocalMatrix[1][3]; + RightHandSide[2] = LocalMatrix[2][3]; + RightHandSide[3] = LocalMatrix[3][3]; + + // Solve the equation by inverting PerspectiveMatrix and multiplying + // rightHandSide by the inverse. (This is the easiest way, not + // necessarily the best.) + mat<4, 4, T, Q> InversePerspectiveMatrix = glm::inverse(PerspectiveMatrix);// inverse(PerspectiveMatrix, inversePerspectiveMatrix); + mat<4, 4, T, Q> TransposedInversePerspectiveMatrix = glm::transpose(InversePerspectiveMatrix);// transposeMatrix4(inversePerspectiveMatrix, transposedInversePerspectiveMatrix); + + Perspective = TransposedInversePerspectiveMatrix * RightHandSide; + // v4MulPointByMatrix(rightHandSide, transposedInversePerspectiveMatrix, perspectivePoint); + + // Clear the perspective partition + LocalMatrix[0][3] = LocalMatrix[1][3] = LocalMatrix[2][3] = static_cast(0); + LocalMatrix[3][3] = static_cast(1); + } + else + { + // No perspective. + Perspective = vec<4, T, Q>(0, 0, 0, 1); + } + + // Next take care of translation (easy). + Translation = vec<3, T, Q>(LocalMatrix[3]); + LocalMatrix[3] = vec<4, T, Q>(0, 0, 0, LocalMatrix[3].w); + + vec<3, T, Q> Row[3], Pdum3; + + // Now get scale and shear. + for(length_t i = 0; i < 3; ++i) + for(length_t j = 0; j < 3; ++j) + Row[i][j] = LocalMatrix[i][j]; + + // Compute X scale factor and normalize first row. + Scale.x = length(Row[0]);// v3Length(Row[0]); + + Row[0] = detail::scale(Row[0], static_cast(1)); + + // Compute XY shear factor and make 2nd row orthogonal to 1st. + Skew.z = dot(Row[0], Row[1]); + Row[1] = detail::combine(Row[1], Row[0], static_cast(1), -Skew.z); + + // Now, compute Y scale and normalize 2nd row. + Scale.y = length(Row[1]); + Row[1] = detail::scale(Row[1], static_cast(1)); + Skew.z /= Scale.y; + + // Compute XZ and YZ shears, orthogonalize 3rd row. + Skew.y = glm::dot(Row[0], Row[2]); + Row[2] = detail::combine(Row[2], Row[0], static_cast(1), -Skew.y); + Skew.x = glm::dot(Row[1], Row[2]); + Row[2] = detail::combine(Row[2], Row[1], static_cast(1), -Skew.x); + + // Next, get Z scale and normalize 3rd row. + Scale.z = length(Row[2]); + Row[2] = detail::scale(Row[2], static_cast(1)); + Skew.y /= Scale.z; + Skew.x /= Scale.z; + + // At this point, the matrix (in rows[]) is orthonormal. + // Check for a coordinate system flip. If the determinant + // is -1, then negate the matrix and the scaling factors. + Pdum3 = cross(Row[1], Row[2]); // v3Cross(row[1], row[2], Pdum3); + if(dot(Row[0], Pdum3) < 0) + { + for(length_t i = 0; i < 3; i++) + { + Scale[i] *= static_cast(-1); + Row[i] *= static_cast(-1); + } + } + + // Now, get the rotations out, as described in the gem. + + // FIXME - Add the ability to return either quaternions (which are + // easier to recompose with) or Euler angles (rx, ry, rz), which + // are easier for authors to deal with. The latter will only be useful + // when we fix https://bugs.webkit.org/show_bug.cgi?id=23799, so I + // will leave the Euler angle code here for now. + + // ret.rotateY = asin(-Row[0][2]); + // if (cos(ret.rotateY) != 0) { + // ret.rotateX = atan2(Row[1][2], Row[2][2]); + // ret.rotateZ = atan2(Row[0][1], Row[0][0]); + // } else { + // ret.rotateX = atan2(-Row[2][0], Row[1][1]); + // ret.rotateZ = 0; + // } + + int i, j, k = 0; + T root, trace = Row[0].x + Row[1].y + Row[2].z; + if(trace > static_cast(0)) + { + root = sqrt(trace + static_cast(1.0)); + Orientation.w = static_cast(0.5) * root; + root = static_cast(0.5) / root; + Orientation.x = root * (Row[1].z - Row[2].y); + Orientation.y = root * (Row[2].x - Row[0].z); + Orientation.z = root * (Row[0].y - Row[1].x); + } // End if > 0 + else + { + static int Next[3] = {1, 2, 0}; + i = 0; + if(Row[1].y > Row[0].x) i = 1; + if(Row[2].z > Row[i][i]) i = 2; + j = Next[i]; + k = Next[j]; + +# ifdef GLM_FORCE_QUAT_DATA_XYZW + int off = 0; +# else + int off = 1; +# endif + + root = sqrt(Row[i][i] - Row[j][j] - Row[k][k] + static_cast(1.0)); + + Orientation[i + off] = static_cast(0.5) * root; + root = static_cast(0.5) / root; + Orientation[j + off] = root * (Row[i][j] + Row[j][i]); + Orientation[k + off] = root * (Row[i][k] + Row[k][i]); + Orientation.w = root * (Row[j][k] - Row[k][j]); + } // End if <= 0 + + return true; + } +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/matrix_factorisation.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/matrix_factorisation.hpp new file mode 100644 index 0000000000000000000000000000000000000000..982f093efcdd6261619f47c31bcc83ccb18c0d11 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/matrix_factorisation.hpp @@ -0,0 +1,69 @@ +/// @ref gtx_matrix_factorisation +/// @file glm/gtx/matrix_factorisation.hpp +/// +/// @see core (dependence) +/// +/// @defgroup gtx_matrix_factorisation GLM_GTX_matrix_factorisation +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Functions to factor matrices in various forms + +#pragma once + +// Dependency: +#include "../glm.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_matrix_factorisation is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_matrix_factorisation extension included") +# endif +#endif + +/* +Suggestions: + - Move helper functions flipud and fliplr to another file: They may be helpful in more general circumstances. + - Implement other types of matrix factorisation, such as: QL and LQ, L(D)U, eigendecompositions, etc... +*/ + +namespace glm +{ + /// @addtogroup gtx_matrix_factorisation + /// @{ + + /// Flips the matrix rows up and down. + /// + /// From GLM_GTX_matrix_factorisation extension. + template + GLM_FUNC_DECL mat flipud(mat const& in); + + /// Flips the matrix columns right and left. + /// + /// From GLM_GTX_matrix_factorisation extension. + template + GLM_FUNC_DECL mat fliplr(mat const& in); + + /// Performs QR factorisation of a matrix. + /// Returns 2 matrices, q and r, such that the columns of q are orthonormal and span the same subspace than those of the input matrix, r is an upper triangular matrix, and q*r=in. + /// Given an n-by-m input matrix, q has dimensions min(n,m)-by-m, and r has dimensions n-by-min(n,m). + /// + /// From GLM_GTX_matrix_factorisation extension. + template + GLM_FUNC_DECL void qr_decompose(mat const& in, mat<(C < R ? C : R), R, T, Q>& q, mat& r); + + /// Performs RQ factorisation of a matrix. + /// Returns 2 matrices, r and q, such that r is an upper triangular matrix, the rows of q are orthonormal and span the same subspace than those of the input matrix, and r*q=in. + /// Note that in the context of RQ factorisation, the diagonal is seen as starting in the lower-right corner of the matrix, instead of the usual upper-left. + /// Given an n-by-m input matrix, r has dimensions min(n,m)-by-m, and q has dimensions n-by-min(n,m). + /// + /// From GLM_GTX_matrix_factorisation extension. + template + GLM_FUNC_DECL void rq_decompose(mat const& in, mat<(C < R ? C : R), R, T, Q>& r, mat& q); + + /// @} +} + +#include "matrix_factorisation.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/matrix_factorisation.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/matrix_factorisation.inl new file mode 100644 index 0000000000000000000000000000000000000000..836e34cd6483f96491ca47e96cf6a70dd0fc2804 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/matrix_factorisation.inl @@ -0,0 +1,84 @@ +/// @ref gtx_matrix_factorisation + +namespace glm +{ + template + GLM_FUNC_QUALIFIER mat flipud(mat const& in) + { + mat tin = transpose(in); + tin = fliplr(tin); + mat out = transpose(tin); + + return out; + } + + template + GLM_FUNC_QUALIFIER mat fliplr(mat const& in) + { + mat out; + for (length_t i = 0; i < C; i++) + { + out[i] = in[(C - i) - 1]; + } + + return out; + } + + template + GLM_FUNC_QUALIFIER void qr_decompose(mat const& in, mat<(C < R ? C : R), R, T, Q>& q, mat& r) + { + // Uses modified Gram-Schmidt method + // Source: https://en.wikipedia.org/wiki/GramSchmidt_process + // And https://en.wikipedia.org/wiki/QR_decomposition + + //For all the linearly independs columns of the input... + // (there can be no more linearly independents columns than there are rows.) + for (length_t i = 0; i < (C < R ? C : R); i++) + { + //Copy in Q the input's i-th column. + q[i] = in[i]; + + //j = [0,i[ + // Make that column orthogonal to all the previous ones by substracting to it the non-orthogonal projection of all the previous columns. + // Also: Fill the zero elements of R + for (length_t j = 0; j < i; j++) + { + q[i] -= dot(q[i], q[j])*q[j]; + r[j][i] = 0; + } + + //Now, Q i-th column is orthogonal to all the previous columns. Normalize it. + q[i] = normalize(q[i]); + + //j = [i,C[ + //Finally, compute the corresponding coefficients of R by computing the projection of the resulting column on the other columns of the input. + for (length_t j = i; j < C; j++) + { + r[j][i] = dot(in[j], q[i]); + } + } + } + + template + GLM_FUNC_QUALIFIER void rq_decompose(mat const& in, mat<(C < R ? C : R), R, T, Q>& r, mat& q) + { + // From https://en.wikipedia.org/wiki/QR_decomposition: + // The RQ decomposition transforms a matrix A into the product of an upper triangular matrix R (also known as right-triangular) and an orthogonal matrix Q. The only difference from QR decomposition is the order of these matrices. + // QR decomposition is GramSchmidt orthogonalization of columns of A, started from the first column. + // RQ decomposition is GramSchmidt orthogonalization of rows of A, started from the last row. + + mat tin = transpose(in); + tin = fliplr(tin); + + mat tr; + mat<(C < R ? C : R), C, T, Q> tq; + qr_decompose(tin, tq, tr); + + tr = fliplr(tr); + r = transpose(tr); + r = fliplr(r); + + tq = fliplr(tq); + q = transpose(tq); + } +} //namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/matrix_interpolation.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/matrix_interpolation.hpp new file mode 100644 index 0000000000000000000000000000000000000000..5c37fb3e68cd60d2e7812fb12d206a6facb30710 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/matrix_interpolation.hpp @@ -0,0 +1,60 @@ +/// @ref gtx_matrix_interpolation +/// @file glm/gtx/matrix_interpolation.hpp +/// @author Ghenadii Ursachi (the.asteroth@gmail.com) +/// +/// @see core (dependence) +/// +/// @defgroup gtx_matrix_interpolation GLM_GTX_matrix_interpolation +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Allows to directly interpolate two matrices. + +#pragma once + +// Dependency: +#include "../glm.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_matrix_interpolation is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_matrix_interpolation extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_matrix_interpolation + /// @{ + + /// Get the axis and angle of the rotation from a matrix. + /// From GLM_GTX_matrix_interpolation extension. + template + GLM_FUNC_DECL void axisAngle( + mat<4, 4, T, Q> const& Mat, vec<3, T, Q> & Axis, T & Angle); + + /// Build a matrix from axis and angle. + /// From GLM_GTX_matrix_interpolation extension. + template + GLM_FUNC_DECL mat<4, 4, T, Q> axisAngleMatrix( + vec<3, T, Q> const& Axis, T const Angle); + + /// Extracts the rotation part of a matrix. + /// From GLM_GTX_matrix_interpolation extension. + template + GLM_FUNC_DECL mat<4, 4, T, Q> extractMatrixRotation( + mat<4, 4, T, Q> const& Mat); + + /// Build a interpolation of 4 * 4 matrixes. + /// From GLM_GTX_matrix_interpolation extension. + /// Warning! works only with rotation and/or translation matrixes, scale will generate unexpected results. + template + GLM_FUNC_DECL mat<4, 4, T, Q> interpolate( + mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2, T const Delta); + + /// @} +}//namespace glm + +#include "matrix_interpolation.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/matrix_interpolation.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/matrix_interpolation.inl new file mode 100644 index 0000000000000000000000000000000000000000..85e6fc0542bc3a7f05d10ad4fbca026b8b5cf2c6 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/matrix_interpolation.inl @@ -0,0 +1,146 @@ +/// @ref gtx_matrix_interpolation + +#include "../ext/scalar_constants.hpp" + +#include + +namespace glm +{ + template + GLM_FUNC_QUALIFIER void axisAngle(mat<4, 4, T, Q> const& m, vec<3, T, Q>& axis, T& angle) + { + T const epsilon = + std::numeric_limits::epsilon() * static_cast(1e2); + + bool const nearSymmetrical = + abs(m[1][0] - m[0][1]) < epsilon && + abs(m[2][0] - m[0][2]) < epsilon && + abs(m[2][1] - m[1][2]) < epsilon; + + if(nearSymmetrical) + { + bool const nearIdentity = + abs(m[1][0] + m[0][1]) < epsilon && + abs(m[2][0] + m[0][2]) < epsilon && + abs(m[2][1] + m[1][2]) < epsilon && + abs(m[0][0] + m[1][1] + m[2][2] - T(3.0)) < epsilon; + if (nearIdentity) + { + angle = static_cast(0.0); + axis = vec<3, T, Q>( + static_cast(1.0), static_cast(0.0), static_cast(0.0)); + return; + } + angle = pi(); + T xx = (m[0][0] + static_cast(1.0)) * static_cast(0.5); + T yy = (m[1][1] + static_cast(1.0)) * static_cast(0.5); + T zz = (m[2][2] + static_cast(1.0)) * static_cast(0.5); + T xy = (m[1][0] + m[0][1]) * static_cast(0.25); + T xz = (m[2][0] + m[0][2]) * static_cast(0.25); + T yz = (m[2][1] + m[1][2]) * static_cast(0.25); + if((xx > yy) && (xx > zz)) + { + if(xx < epsilon) + { + axis.x = static_cast(0.0); + axis.y = static_cast(0.7071); + axis.z = static_cast(0.7071); + } + else + { + axis.x = sqrt(xx); + axis.y = xy / axis.x; + axis.z = xz / axis.x; + } + } + else if (yy > zz) + { + if(yy < epsilon) + { + axis.x = static_cast(0.7071); + axis.y = static_cast(0.0); + axis.z = static_cast(0.7071); + } + else + { + axis.y = sqrt(yy); + axis.x = xy / axis.y; + axis.z = yz / axis.y; + } + } + else + { + if (zz < epsilon) + { + axis.x = static_cast(0.7071); + axis.y = static_cast(0.7071); + axis.z = static_cast(0.0); + } + else + { + axis.z = sqrt(zz); + axis.x = xz / axis.z; + axis.y = yz / axis.z; + } + } + return; + } + + T const angleCos = (m[0][0] + m[1][1] + m[2][2] - static_cast(1)) * static_cast(0.5); + if(angleCos >= static_cast(1.0)) + { + angle = static_cast(0.0); + } + else if (angleCos <= static_cast(-1.0)) + { + angle = pi(); + } + else + { + angle = acos(angleCos); + } + + axis = glm::normalize(glm::vec<3, T, Q>( + m[1][2] - m[2][1], m[2][0] - m[0][2], m[0][1] - m[1][0])); + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> axisAngleMatrix(vec<3, T, Q> const& axis, T const angle) + { + T c = cos(angle); + T s = sin(angle); + T t = static_cast(1) - c; + vec<3, T, Q> n = normalize(axis); + + return mat<4, 4, T, Q>( + t * n.x * n.x + c, t * n.x * n.y + n.z * s, t * n.x * n.z - n.y * s, static_cast(0.0), + t * n.x * n.y - n.z * s, t * n.y * n.y + c, t * n.y * n.z + n.x * s, static_cast(0.0), + t * n.x * n.z + n.y * s, t * n.y * n.z - n.x * s, t * n.z * n.z + c, static_cast(0.0), + static_cast(0.0), static_cast(0.0), static_cast(0.0), static_cast(1.0)); + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> extractMatrixRotation(mat<4, 4, T, Q> const& m) + { + return mat<4, 4, T, Q>( + m[0][0], m[0][1], m[0][2], static_cast(0.0), + m[1][0], m[1][1], m[1][2], static_cast(0.0), + m[2][0], m[2][1], m[2][2], static_cast(0.0), + static_cast(0.0), static_cast(0.0), static_cast(0.0), static_cast(1.0)); + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> interpolate(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2, T const delta) + { + mat<4, 4, T, Q> m1rot = extractMatrixRotation(m1); + mat<4, 4, T, Q> dltRotation = m2 * transpose(m1rot); + vec<3, T, Q> dltAxis; + T dltAngle; + axisAngle(dltRotation, dltAxis, dltAngle); + mat<4, 4, T, Q> out = axisAngleMatrix(dltAxis, dltAngle * delta) * m1rot; + out[3][0] = m1[3][0] + delta * (m2[3][0] - m1[3][0]); + out[3][1] = m1[3][1] + delta * (m2[3][1] - m1[3][1]); + out[3][2] = m1[3][2] + delta * (m2[3][2] - m1[3][2]); + return out; + } +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/matrix_major_storage.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/matrix_major_storage.hpp new file mode 100644 index 0000000000000000000000000000000000000000..1ef83e92a5666d025acc44d8969a6f69578f0ce3 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/matrix_major_storage.hpp @@ -0,0 +1,119 @@ +/// @ref gtx_matrix_major_storage +/// @file glm/gtx/matrix_major_storage.hpp +/// +/// @see core (dependence) +/// @see gtx_extented_min_max (dependence) +/// +/// @defgroup gtx_matrix_major_storage GLM_GTX_matrix_major_storage +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Build matrices with specific matrix order, row or column + +#pragma once + +// Dependency: +#include "../glm.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_matrix_major_storage is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_matrix_major_storage extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_matrix_major_storage + /// @{ + + //! Build a row major matrix from row vectors. + //! From GLM_GTX_matrix_major_storage extension. + template + GLM_FUNC_DECL mat<2, 2, T, Q> rowMajor2( + vec<2, T, Q> const& v1, + vec<2, T, Q> const& v2); + + //! Build a row major matrix from other matrix. + //! From GLM_GTX_matrix_major_storage extension. + template + GLM_FUNC_DECL mat<2, 2, T, Q> rowMajor2( + mat<2, 2, T, Q> const& m); + + //! Build a row major matrix from row vectors. + //! From GLM_GTX_matrix_major_storage extension. + template + GLM_FUNC_DECL mat<3, 3, T, Q> rowMajor3( + vec<3, T, Q> const& v1, + vec<3, T, Q> const& v2, + vec<3, T, Q> const& v3); + + //! Build a row major matrix from other matrix. + //! From GLM_GTX_matrix_major_storage extension. + template + GLM_FUNC_DECL mat<3, 3, T, Q> rowMajor3( + mat<3, 3, T, Q> const& m); + + //! Build a row major matrix from row vectors. + //! From GLM_GTX_matrix_major_storage extension. + template + GLM_FUNC_DECL mat<4, 4, T, Q> rowMajor4( + vec<4, T, Q> const& v1, + vec<4, T, Q> const& v2, + vec<4, T, Q> const& v3, + vec<4, T, Q> const& v4); + + //! Build a row major matrix from other matrix. + //! From GLM_GTX_matrix_major_storage extension. + template + GLM_FUNC_DECL mat<4, 4, T, Q> rowMajor4( + mat<4, 4, T, Q> const& m); + + //! Build a column major matrix from column vectors. + //! From GLM_GTX_matrix_major_storage extension. + template + GLM_FUNC_DECL mat<2, 2, T, Q> colMajor2( + vec<2, T, Q> const& v1, + vec<2, T, Q> const& v2); + + //! Build a column major matrix from other matrix. + //! From GLM_GTX_matrix_major_storage extension. + template + GLM_FUNC_DECL mat<2, 2, T, Q> colMajor2( + mat<2, 2, T, Q> const& m); + + //! Build a column major matrix from column vectors. + //! From GLM_GTX_matrix_major_storage extension. + template + GLM_FUNC_DECL mat<3, 3, T, Q> colMajor3( + vec<3, T, Q> const& v1, + vec<3, T, Q> const& v2, + vec<3, T, Q> const& v3); + + //! Build a column major matrix from other matrix. + //! From GLM_GTX_matrix_major_storage extension. + template + GLM_FUNC_DECL mat<3, 3, T, Q> colMajor3( + mat<3, 3, T, Q> const& m); + + //! Build a column major matrix from column vectors. + //! From GLM_GTX_matrix_major_storage extension. + template + GLM_FUNC_DECL mat<4, 4, T, Q> colMajor4( + vec<4, T, Q> const& v1, + vec<4, T, Q> const& v2, + vec<4, T, Q> const& v3, + vec<4, T, Q> const& v4); + + //! Build a column major matrix from other matrix. + //! From GLM_GTX_matrix_major_storage extension. + template + GLM_FUNC_DECL mat<4, 4, T, Q> colMajor4( + mat<4, 4, T, Q> const& m); + + /// @} +}//namespace glm + +#include "matrix_major_storage.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/matrix_major_storage.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/matrix_major_storage.inl new file mode 100644 index 0000000000000000000000000000000000000000..0209723051a41433a8f2b3183e8c6e2348cbe8a1 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/matrix_major_storage.inl @@ -0,0 +1,166 @@ +/// @ref gtx_matrix_major_storage + +namespace glm +{ + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q> rowMajor2 + ( + vec<2, T, Q> const& v1, + vec<2, T, Q> const& v2 + ) + { + mat<2, 2, T, Q> Result; + Result[0][0] = v1.x; + Result[1][0] = v1.y; + Result[0][1] = v2.x; + Result[1][1] = v2.y; + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q> rowMajor2( + const mat<2, 2, T, Q>& m) + { + mat<2, 2, T, Q> Result; + Result[0][0] = m[0][0]; + Result[0][1] = m[1][0]; + Result[1][0] = m[0][1]; + Result[1][1] = m[1][1]; + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> rowMajor3( + const vec<3, T, Q>& v1, + const vec<3, T, Q>& v2, + const vec<3, T, Q>& v3) + { + mat<3, 3, T, Q> Result; + Result[0][0] = v1.x; + Result[1][0] = v1.y; + Result[2][0] = v1.z; + Result[0][1] = v2.x; + Result[1][1] = v2.y; + Result[2][1] = v2.z; + Result[0][2] = v3.x; + Result[1][2] = v3.y; + Result[2][2] = v3.z; + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> rowMajor3( + const mat<3, 3, T, Q>& m) + { + mat<3, 3, T, Q> Result; + Result[0][0] = m[0][0]; + Result[0][1] = m[1][0]; + Result[0][2] = m[2][0]; + Result[1][0] = m[0][1]; + Result[1][1] = m[1][1]; + Result[1][2] = m[2][1]; + Result[2][0] = m[0][2]; + Result[2][1] = m[1][2]; + Result[2][2] = m[2][2]; + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> rowMajor4( + const vec<4, T, Q>& v1, + const vec<4, T, Q>& v2, + const vec<4, T, Q>& v3, + const vec<4, T, Q>& v4) + { + mat<4, 4, T, Q> Result; + Result[0][0] = v1.x; + Result[1][0] = v1.y; + Result[2][0] = v1.z; + Result[3][0] = v1.w; + Result[0][1] = v2.x; + Result[1][1] = v2.y; + Result[2][1] = v2.z; + Result[3][1] = v2.w; + Result[0][2] = v3.x; + Result[1][2] = v3.y; + Result[2][2] = v3.z; + Result[3][2] = v3.w; + Result[0][3] = v4.x; + Result[1][3] = v4.y; + Result[2][3] = v4.z; + Result[3][3] = v4.w; + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> rowMajor4( + const mat<4, 4, T, Q>& m) + { + mat<4, 4, T, Q> Result; + Result[0][0] = m[0][0]; + Result[0][1] = m[1][0]; + Result[0][2] = m[2][0]; + Result[0][3] = m[3][0]; + Result[1][0] = m[0][1]; + Result[1][1] = m[1][1]; + Result[1][2] = m[2][1]; + Result[1][3] = m[3][1]; + Result[2][0] = m[0][2]; + Result[2][1] = m[1][2]; + Result[2][2] = m[2][2]; + Result[2][3] = m[3][2]; + Result[3][0] = m[0][3]; + Result[3][1] = m[1][3]; + Result[3][2] = m[2][3]; + Result[3][3] = m[3][3]; + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q> colMajor2( + const vec<2, T, Q>& v1, + const vec<2, T, Q>& v2) + { + return mat<2, 2, T, Q>(v1, v2); + } + + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q> colMajor2( + const mat<2, 2, T, Q>& m) + { + return mat<2, 2, T, Q>(m); + } + + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> colMajor3( + const vec<3, T, Q>& v1, + const vec<3, T, Q>& v2, + const vec<3, T, Q>& v3) + { + return mat<3, 3, T, Q>(v1, v2, v3); + } + + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> colMajor3( + const mat<3, 3, T, Q>& m) + { + return mat<3, 3, T, Q>(m); + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> colMajor4( + const vec<4, T, Q>& v1, + const vec<4, T, Q>& v2, + const vec<4, T, Q>& v3, + const vec<4, T, Q>& v4) + { + return mat<4, 4, T, Q>(v1, v2, v3, v4); + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> colMajor4( + const mat<4, 4, T, Q>& m) + { + return mat<4, 4, T, Q>(m); + } +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/matrix_operation.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/matrix_operation.hpp new file mode 100644 index 0000000000000000000000000000000000000000..84b023207aaaf2c3d06acc7bd423d5f94af15091 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/matrix_operation.hpp @@ -0,0 +1,103 @@ +/// @ref gtx_matrix_operation +/// @file glm/gtx/matrix_operation.hpp +/// +/// @see core (dependence) +/// +/// @defgroup gtx_matrix_operation GLM_GTX_matrix_operation +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Build diagonal matrices from vectors. + +#pragma once + +// Dependency: +#include "../glm.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_matrix_operation is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_matrix_operation extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_matrix_operation + /// @{ + + //! Build a diagonal matrix. + //! From GLM_GTX_matrix_operation extension. + template + GLM_FUNC_DECL mat<2, 2, T, Q> diagonal2x2( + vec<2, T, Q> const& v); + + //! Build a diagonal matrix. + //! From GLM_GTX_matrix_operation extension. + template + GLM_FUNC_DECL mat<2, 3, T, Q> diagonal2x3( + vec<2, T, Q> const& v); + + //! Build a diagonal matrix. + //! From GLM_GTX_matrix_operation extension. + template + GLM_FUNC_DECL mat<2, 4, T, Q> diagonal2x4( + vec<2, T, Q> const& v); + + //! Build a diagonal matrix. + //! From GLM_GTX_matrix_operation extension. + template + GLM_FUNC_DECL mat<3, 2, T, Q> diagonal3x2( + vec<2, T, Q> const& v); + + //! Build a diagonal matrix. + //! From GLM_GTX_matrix_operation extension. + template + GLM_FUNC_DECL mat<3, 3, T, Q> diagonal3x3( + vec<3, T, Q> const& v); + + //! Build a diagonal matrix. + //! From GLM_GTX_matrix_operation extension. + template + GLM_FUNC_DECL mat<3, 4, T, Q> diagonal3x4( + vec<3, T, Q> const& v); + + //! Build a diagonal matrix. + //! From GLM_GTX_matrix_operation extension. + template + GLM_FUNC_DECL mat<4, 2, T, Q> diagonal4x2( + vec<2, T, Q> const& v); + + //! Build a diagonal matrix. + //! From GLM_GTX_matrix_operation extension. + template + GLM_FUNC_DECL mat<4, 3, T, Q> diagonal4x3( + vec<3, T, Q> const& v); + + //! Build a diagonal matrix. + //! From GLM_GTX_matrix_operation extension. + template + GLM_FUNC_DECL mat<4, 4, T, Q> diagonal4x4( + vec<4, T, Q> const& v); + + /// Build an adjugate matrix. + /// From GLM_GTX_matrix_operation extension. + template + GLM_FUNC_DECL mat<2, 2, T, Q> adjugate(mat<2, 2, T, Q> const& m); + + /// Build an adjugate matrix. + /// From GLM_GTX_matrix_operation extension. + template + GLM_FUNC_DECL mat<3, 3, T, Q> adjugate(mat<3, 3, T, Q> const& m); + + /// Build an adjugate matrix. + /// From GLM_GTX_matrix_operation extension. + template + GLM_FUNC_DECL mat<4, 4, T, Q> adjugate(mat<4, 4, T, Q> const& m); + + /// @} +}//namespace glm + +#include "matrix_operation.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/matrix_operation.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/matrix_operation.inl new file mode 100644 index 0000000000000000000000000000000000000000..9d90c9bccb8437be37511ef6ae440f3ca34053eb --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/matrix_operation.inl @@ -0,0 +1,176 @@ +/// @ref gtx_matrix_operation + +namespace glm +{ + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q> diagonal2x2 + ( + vec<2, T, Q> const& v + ) + { + mat<2, 2, T, Q> Result(static_cast(1)); + Result[0][0] = v[0]; + Result[1][1] = v[1]; + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<2, 3, T, Q> diagonal2x3 + ( + vec<2, T, Q> const& v + ) + { + mat<2, 3, T, Q> Result(static_cast(1)); + Result[0][0] = v[0]; + Result[1][1] = v[1]; + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<2, 4, T, Q> diagonal2x4 + ( + vec<2, T, Q> const& v + ) + { + mat<2, 4, T, Q> Result(static_cast(1)); + Result[0][0] = v[0]; + Result[1][1] = v[1]; + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<3, 2, T, Q> diagonal3x2 + ( + vec<2, T, Q> const& v + ) + { + mat<3, 2, T, Q> Result(static_cast(1)); + Result[0][0] = v[0]; + Result[1][1] = v[1]; + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> diagonal3x3 + ( + vec<3, T, Q> const& v + ) + { + mat<3, 3, T, Q> Result(static_cast(1)); + Result[0][0] = v[0]; + Result[1][1] = v[1]; + Result[2][2] = v[2]; + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<3, 4, T, Q> diagonal3x4 + ( + vec<3, T, Q> const& v + ) + { + mat<3, 4, T, Q> Result(static_cast(1)); + Result[0][0] = v[0]; + Result[1][1] = v[1]; + Result[2][2] = v[2]; + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> diagonal4x4 + ( + vec<4, T, Q> const& v + ) + { + mat<4, 4, T, Q> Result(static_cast(1)); + Result[0][0] = v[0]; + Result[1][1] = v[1]; + Result[2][2] = v[2]; + Result[3][3] = v[3]; + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 3, T, Q> diagonal4x3 + ( + vec<3, T, Q> const& v + ) + { + mat<4, 3, T, Q> Result(static_cast(1)); + Result[0][0] = v[0]; + Result[1][1] = v[1]; + Result[2][2] = v[2]; + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 2, T, Q> diagonal4x2 + ( + vec<2, T, Q> const& v + ) + { + mat<4, 2, T, Q> Result(static_cast(1)); + Result[0][0] = v[0]; + Result[1][1] = v[1]; + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<2, 2, T, Q> adjugate(mat<2, 2, T, Q> const& m) + { + return mat<2, 2, T, Q>( + +m[1][1], -m[0][1], + -m[1][0], +m[0][0]); + } + + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> adjugate(mat<3, 3, T, Q> const& m) + { + T const m00 = determinant(mat<2, 2, T, Q>(m[1][1], m[2][1], m[1][2], m[2][2])); + T const m01 = determinant(mat<2, 2, T, Q>(m[0][1], m[2][1], m[0][2], m[2][2])); + T const m02 = determinant(mat<2, 2, T, Q>(m[0][1], m[1][1], m[0][2], m[1][2])); + + T const m10 = determinant(mat<2, 2, T, Q>(m[1][0], m[2][0], m[1][2], m[2][2])); + T const m11 = determinant(mat<2, 2, T, Q>(m[0][0], m[2][0], m[0][2], m[2][2])); + T const m12 = determinant(mat<2, 2, T, Q>(m[0][0], m[1][0], m[0][2], m[1][2])); + + T const m20 = determinant(mat<2, 2, T, Q>(m[1][0], m[2][0], m[1][1], m[2][1])); + T const m21 = determinant(mat<2, 2, T, Q>(m[0][0], m[2][0], m[0][1], m[2][1])); + T const m22 = determinant(mat<2, 2, T, Q>(m[0][0], m[1][0], m[0][1], m[1][1])); + + return mat<3, 3, T, Q>( + +m00, -m01, +m02, + -m10, +m11, -m12, + +m20, -m21, +m22); + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> adjugate(mat<4, 4, T, Q> const& m) + { + T const m00 = determinant(mat<3, 3, T, Q>(m[1][1], m[1][2], m[1][3], m[2][1], m[2][2], m[2][3], m[3][1], m[3][2], m[3][3])); + T const m01 = determinant(mat<3, 3, T, Q>(m[1][0], m[1][2], m[1][3], m[2][0], m[2][2], m[2][3], m[3][0], m[3][2], m[3][3])); + T const m02 = determinant(mat<3, 3, T, Q>(m[1][0], m[1][1], m[1][3], m[2][0], m[2][1], m[2][3], m[3][0], m[3][1], m[3][3])); + T const m03 = determinant(mat<3, 3, T, Q>(m[1][0], m[1][1], m[1][2], m[2][0], m[2][1], m[2][2], m[3][0], m[3][1], m[3][2])); + + T const m10 = determinant(mat<3, 3, T, Q>(m[0][1], m[0][2], m[0][3], m[2][1], m[2][2], m[2][3], m[3][1], m[3][2], m[3][3])); + T const m11 = determinant(mat<3, 3, T, Q>(m[0][0], m[0][2], m[0][3], m[2][0], m[2][2], m[2][3], m[3][0], m[3][2], m[3][3])); + T const m12 = determinant(mat<3, 3, T, Q>(m[0][0], m[0][1], m[0][3], m[2][0], m[2][1], m[2][3], m[3][0], m[3][1], m[3][3])); + T const m13 = determinant(mat<3, 3, T, Q>(m[0][0], m[0][1], m[0][2], m[2][0], m[2][1], m[2][2], m[3][0], m[3][1], m[3][2])); + + T const m20 = determinant(mat<3, 3, T, Q>(m[0][1], m[0][2], m[0][3], m[1][1], m[1][2], m[1][3], m[3][1], m[3][2], m[3][3])); + T const m21 = determinant(mat<3, 3, T, Q>(m[0][0], m[0][2], m[0][3], m[1][0], m[1][2], m[1][3], m[3][0], m[3][2], m[3][3])); + T const m22 = determinant(mat<3, 3, T, Q>(m[0][0], m[0][1], m[0][3], m[1][0], m[1][1], m[1][3], m[3][0], m[3][1], m[3][3])); + T const m23 = determinant(mat<3, 3, T, Q>(m[0][0], m[0][1], m[0][2], m[1][0], m[1][1], m[1][2], m[3][0], m[3][1], m[3][2])); + + T const m30 = determinant(mat<3, 3, T, Q>(m[0][1], m[0][2], m[0][3], m[1][1], m[1][2], m[1][3], m[2][1], m[2][2], m[2][3])); + T const m31 = determinant(mat<3, 3, T, Q>(m[0][0], m[0][2], m[0][3], m[1][0], m[1][2], m[1][3], m[2][0], m[2][2], m[2][3])); + T const m32 = determinant(mat<3, 3, T, Q>(m[0][0], m[0][1], m[0][3], m[1][0], m[1][1], m[1][3], m[2][0], m[2][1], m[2][3])); + T const m33 = determinant(mat<3, 3, T, Q>(m[0][0], m[0][1], m[0][2], m[1][0], m[1][1], m[1][2], m[2][0], m[2][1], m[2][2])); + + return mat<4, 4, T, Q>( + +m00, -m10, +m20, -m30, + -m01, +m11, -m21, +m31, + +m02, -m12, +m22, -m32, + -m03, +m13, -m23, +m33); + } +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/matrix_query.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/matrix_query.hpp new file mode 100644 index 0000000000000000000000000000000000000000..a1b6116d6febe0fd7b17af744f5274f2b514b560 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/matrix_query.hpp @@ -0,0 +1,77 @@ +/// @ref gtx_matrix_query +/// @file glm/gtx/matrix_query.hpp +/// +/// @see core (dependence) +/// @see gtx_vector_query (dependence) +/// +/// @defgroup gtx_matrix_query GLM_GTX_matrix_query +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Query to evaluate matrix properties + +#pragma once + +// Dependency: +#include "../glm.hpp" +#include "../gtx/vector_query.hpp" +#include + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_matrix_query is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_matrix_query extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_matrix_query + /// @{ + + /// Return whether a matrix a null matrix. + /// From GLM_GTX_matrix_query extension. + template + GLM_FUNC_DECL bool isNull(mat<2, 2, T, Q> const& m, T const& epsilon); + + /// Return whether a matrix a null matrix. + /// From GLM_GTX_matrix_query extension. + template + GLM_FUNC_DECL bool isNull(mat<3, 3, T, Q> const& m, T const& epsilon); + + /// Return whether a matrix is a null matrix. + /// From GLM_GTX_matrix_query extension. + template + GLM_FUNC_DECL bool isNull(mat<4, 4, T, Q> const& m, T const& epsilon); + + /// Return whether a matrix is an identity matrix. + /// From GLM_GTX_matrix_query extension. + template class matType> + GLM_FUNC_DECL bool isIdentity(matType const& m, T const& epsilon); + + /// Return whether a matrix is a normalized matrix. + /// From GLM_GTX_matrix_query extension. + template + GLM_FUNC_DECL bool isNormalized(mat<2, 2, T, Q> const& m, T const& epsilon); + + /// Return whether a matrix is a normalized matrix. + /// From GLM_GTX_matrix_query extension. + template + GLM_FUNC_DECL bool isNormalized(mat<3, 3, T, Q> const& m, T const& epsilon); + + /// Return whether a matrix is a normalized matrix. + /// From GLM_GTX_matrix_query extension. + template + GLM_FUNC_DECL bool isNormalized(mat<4, 4, T, Q> const& m, T const& epsilon); + + /// Return whether a matrix is an orthonormalized matrix. + /// From GLM_GTX_matrix_query extension. + template class matType> + GLM_FUNC_DECL bool isOrthogonal(matType const& m, T const& epsilon); + + /// @} +}//namespace glm + +#include "matrix_query.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/matrix_query.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/matrix_query.inl new file mode 100644 index 0000000000000000000000000000000000000000..ca7ba3a0b855042b04f655fbcf4da08bf747707b --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/matrix_query.inl @@ -0,0 +1,113 @@ +/// @ref gtx_matrix_query + +namespace glm +{ + template + GLM_FUNC_QUALIFIER bool isNull(mat<2, 2, T, Q> const& m, T const& epsilon) + { + bool result = true; + for(length_t i = 0; result && i < m.length() ; ++i) + result = isNull(m[i], epsilon); + return result; + } + + template + GLM_FUNC_QUALIFIER bool isNull(mat<3, 3, T, Q> const& m, T const& epsilon) + { + bool result = true; + for(length_t i = 0; result && i < m.length() ; ++i) + result = isNull(m[i], epsilon); + return result; + } + + template + GLM_FUNC_QUALIFIER bool isNull(mat<4, 4, T, Q> const& m, T const& epsilon) + { + bool result = true; + for(length_t i = 0; result && i < m.length() ; ++i) + result = isNull(m[i], epsilon); + return result; + } + + template + GLM_FUNC_QUALIFIER bool isIdentity(mat const& m, T const& epsilon) + { + bool result = true; + for(length_t i = 0; result && i < m.length(); ++i) + { + for(length_t j = 0; result && j < glm::min(i, m[0].length()); ++j) + result = abs(m[i][j]) <= epsilon; + if(result && i < m[0].length()) + result = abs(m[i][i] - 1) <= epsilon; + for(length_t j = i + 1; result && j < m[0].length(); ++j) + result = abs(m[i][j]) <= epsilon; + } + return result; + } + + template + GLM_FUNC_QUALIFIER bool isNormalized(mat<2, 2, T, Q> const& m, T const& epsilon) + { + bool result(true); + for(length_t i = 0; result && i < m.length(); ++i) + result = isNormalized(m[i], epsilon); + for(length_t i = 0; result && i < m.length(); ++i) + { + typename mat<2, 2, T, Q>::col_type v; + for(length_t j = 0; j < m.length(); ++j) + v[j] = m[j][i]; + result = isNormalized(v, epsilon); + } + return result; + } + + template + GLM_FUNC_QUALIFIER bool isNormalized(mat<3, 3, T, Q> const& m, T const& epsilon) + { + bool result(true); + for(length_t i = 0; result && i < m.length(); ++i) + result = isNormalized(m[i], epsilon); + for(length_t i = 0; result && i < m.length(); ++i) + { + typename mat<3, 3, T, Q>::col_type v; + for(length_t j = 0; j < m.length(); ++j) + v[j] = m[j][i]; + result = isNormalized(v, epsilon); + } + return result; + } + + template + GLM_FUNC_QUALIFIER bool isNormalized(mat<4, 4, T, Q> const& m, T const& epsilon) + { + bool result(true); + for(length_t i = 0; result && i < m.length(); ++i) + result = isNormalized(m[i], epsilon); + for(length_t i = 0; result && i < m.length(); ++i) + { + typename mat<4, 4, T, Q>::col_type v; + for(length_t j = 0; j < m.length(); ++j) + v[j] = m[j][i]; + result = isNormalized(v, epsilon); + } + return result; + } + + template + GLM_FUNC_QUALIFIER bool isOrthogonal(mat const& m, T const& epsilon) + { + bool result = true; + for(length_t i(0); result && i < m.length() - 1; ++i) + for(length_t j(i + 1); result && j < m.length(); ++j) + result = areOrthogonal(m[i], m[j], epsilon); + + if(result) + { + mat tmp = transpose(m); + for(length_t i(0); result && i < m.length() - 1 ; ++i) + for(length_t j(i + 1); result && j < m.length(); ++j) + result = areOrthogonal(tmp[i], tmp[j], epsilon); + } + return result; + } +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/matrix_transform_2d.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/matrix_transform_2d.hpp new file mode 100644 index 0000000000000000000000000000000000000000..a88b268b45b971a1ab6dacd3ca1bc976195531a9 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/matrix_transform_2d.hpp @@ -0,0 +1,81 @@ +/// @ref gtx_matrix_transform_2d +/// @file glm/gtx/matrix_transform_2d.hpp +/// @author Miguel Ángel Pérez Martínez +/// +/// @see core (dependence) +/// +/// @defgroup gtx_matrix_transform_2d GLM_GTX_matrix_transform_2d +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Defines functions that generate common 2d transformation matrices. + +#pragma once + +// Dependency: +#include "../mat3x3.hpp" +#include "../vec2.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_matrix_transform_2d is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_matrix_transform_2d extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_matrix_transform_2d + /// @{ + + /// Builds a translation 3 * 3 matrix created from a vector of 2 components. + /// + /// @param m Input matrix multiplied by this translation matrix. + /// @param v Coordinates of a translation vector. + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> translate( + mat<3, 3, T, Q> const& m, + vec<2, T, Q> const& v); + + /// Builds a rotation 3 * 3 matrix created from an angle. + /// + /// @param m Input matrix multiplied by this translation matrix. + /// @param angle Rotation angle expressed in radians. + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> rotate( + mat<3, 3, T, Q> const& m, + T angle); + + /// Builds a scale 3 * 3 matrix created from a vector of 2 components. + /// + /// @param m Input matrix multiplied by this translation matrix. + /// @param v Coordinates of a scale vector. + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> scale( + mat<3, 3, T, Q> const& m, + vec<2, T, Q> const& v); + + /// Builds an horizontal (parallel to the x axis) shear 3 * 3 matrix. + /// + /// @param m Input matrix multiplied by this translation matrix. + /// @param y Shear factor. + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> shearX( + mat<3, 3, T, Q> const& m, + T y); + + /// Builds a vertical (parallel to the y axis) shear 3 * 3 matrix. + /// + /// @param m Input matrix multiplied by this translation matrix. + /// @param x Shear factor. + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> shearY( + mat<3, 3, T, Q> const& m, + T x); + + /// @} +}//namespace glm + +#include "matrix_transform_2d.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/matrix_transform_2d.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/matrix_transform_2d.inl new file mode 100644 index 0000000000000000000000000000000000000000..755508aee4c8aef5583defd0d2af8a8e628c54d7 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/matrix_transform_2d.inl @@ -0,0 +1,68 @@ +/// @ref gtx_matrix_transform_2d +/// @author Miguel Ángel Pérez Martínez + +#include "../trigonometric.hpp" + +namespace glm +{ + + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> translate( + mat<3, 3, T, Q> const& m, + vec<2, T, Q> const& v) + { + mat<3, 3, T, Q> Result(m); + Result[2] = m[0] * v[0] + m[1] * v[1] + m[2]; + return Result; + } + + + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> rotate( + mat<3, 3, T, Q> const& m, + T angle) + { + T const a = angle; + T const c = cos(a); + T const s = sin(a); + + mat<3, 3, T, Q> Result; + Result[0] = m[0] * c + m[1] * s; + Result[1] = m[0] * -s + m[1] * c; + Result[2] = m[2]; + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> scale( + mat<3, 3, T, Q> const& m, + vec<2, T, Q> const& v) + { + mat<3, 3, T, Q> Result; + Result[0] = m[0] * v[0]; + Result[1] = m[1] * v[1]; + Result[2] = m[2]; + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> shearX( + mat<3, 3, T, Q> const& m, + T y) + { + mat<3, 3, T, Q> Result(1); + Result[0][1] = y; + return m * Result; + } + + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> shearY( + mat<3, 3, T, Q> const& m, + T x) + { + mat<3, 3, T, Q> Result(1); + Result[1][0] = x; + return m * Result; + } + +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/mixed_product.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/mixed_product.hpp new file mode 100644 index 0000000000000000000000000000000000000000..559a69dcfba16323cd7e477bf1dc332ec11183f1 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/mixed_product.hpp @@ -0,0 +1,41 @@ +/// @ref gtx_mixed_product +/// @file glm/gtx/mixed_product.hpp +/// +/// @see core (dependence) +/// +/// @defgroup gtx_mixed_product GLM_GTX_mixed_producte +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Mixed product of 3 vectors. + +#pragma once + +// Dependency: +#include "../glm.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_mixed_product is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_mixed_product extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_mixed_product + /// @{ + + /// @brief Mixed product of 3 vectors (from GLM_GTX_mixed_product extension) + template + GLM_FUNC_DECL T mixedProduct( + vec<3, T, Q> const& v1, + vec<3, T, Q> const& v2, + vec<3, T, Q> const& v3); + + /// @} +}// namespace glm + +#include "mixed_product.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/mixed_product.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/mixed_product.inl new file mode 100644 index 0000000000000000000000000000000000000000..668246d8bdf03659f27d8729d312bcea6628b8b6 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/mixed_product.inl @@ -0,0 +1,15 @@ +/// @ref gtx_mixed_product + +namespace glm +{ + template + GLM_FUNC_QUALIFIER T mixedProduct + ( + vec<3, T, Q> const& v1, + vec<3, T, Q> const& v2, + vec<3, T, Q> const& v3 + ) + { + return dot(cross(v1, v2), v3); + } +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/norm.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/norm.hpp new file mode 100644 index 0000000000000000000000000000000000000000..59ede93bca6e9a0e4dd74461bf2e05e57910ae21 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/norm.hpp @@ -0,0 +1,88 @@ +/// @ref gtx_norm +/// @file glm/gtx/norm.hpp +/// +/// @see core (dependence) +/// @see gtx_quaternion (dependence) +/// @see gtx_component_wise (dependence) +/// +/// @defgroup gtx_norm GLM_GTX_norm +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Various ways to compute vector norms. + +#pragma once + +// Dependency: +#include "../geometric.hpp" +#include "../gtx/quaternion.hpp" +#include "../gtx/component_wise.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_norm is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_norm extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_norm + /// @{ + + /// Returns the squared length of x. + /// From GLM_GTX_norm extension. + template + GLM_FUNC_DECL T length2(vec const& x); + + /// Returns the squared distance between p0 and p1, i.e., length2(p0 - p1). + /// From GLM_GTX_norm extension. + template + GLM_FUNC_DECL T distance2(vec const& p0, vec const& p1); + + //! Returns the L1 norm between x and y. + //! From GLM_GTX_norm extension. + template + GLM_FUNC_DECL T l1Norm(vec<3, T, Q> const& x, vec<3, T, Q> const& y); + + //! Returns the L1 norm of v. + //! From GLM_GTX_norm extension. + template + GLM_FUNC_DECL T l1Norm(vec<3, T, Q> const& v); + + //! Returns the L2 norm between x and y. + //! From GLM_GTX_norm extension. + template + GLM_FUNC_DECL T l2Norm(vec<3, T, Q> const& x, vec<3, T, Q> const& y); + + //! Returns the L2 norm of v. + //! From GLM_GTX_norm extension. + template + GLM_FUNC_DECL T l2Norm(vec<3, T, Q> const& x); + + //! Returns the L norm between x and y. + //! From GLM_GTX_norm extension. + template + GLM_FUNC_DECL T lxNorm(vec<3, T, Q> const& x, vec<3, T, Q> const& y, unsigned int Depth); + + //! Returns the L norm of v. + //! From GLM_GTX_norm extension. + template + GLM_FUNC_DECL T lxNorm(vec<3, T, Q> const& x, unsigned int Depth); + + //! Returns the LMax norm between x and y. + //! From GLM_GTX_norm extension. + template + GLM_FUNC_DECL T lMaxNorm(vec<3, T, Q> const& x, vec<3, T, Q> const& y); + + //! Returns the LMax norm of v. + //! From GLM_GTX_norm extension. + template + GLM_FUNC_DECL T lMaxNorm(vec<3, T, Q> const& x); + + /// @} +}//namespace glm + +#include "norm.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/norm.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/norm.inl new file mode 100644 index 0000000000000000000000000000000000000000..9b9ec0b1c63c416bb6c92542850f1b2c0a4aad88 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/norm.inl @@ -0,0 +1,95 @@ +/// @ref gtx_norm + +#include "../detail/qualifier.hpp" + +namespace glm{ +namespace detail +{ + template + struct compute_length2 + { + GLM_FUNC_QUALIFIER static T call(vec const& v) + { + return dot(v, v); + } + }; +}//namespace detail + + template + GLM_FUNC_QUALIFIER genType length2(genType x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'length2' accepts only floating-point inputs"); + return x * x; + } + + template + GLM_FUNC_QUALIFIER T length2(vec const& v) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'length2' accepts only floating-point inputs"); + return detail::compute_length2::value>::call(v); + } + + template + GLM_FUNC_QUALIFIER T distance2(T p0, T p1) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'distance2' accepts only floating-point inputs"); + return length2(p1 - p0); + } + + template + GLM_FUNC_QUALIFIER T distance2(vec const& p0, vec const& p1) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'distance2' accepts only floating-point inputs"); + return length2(p1 - p0); + } + + template + GLM_FUNC_QUALIFIER T l1Norm(vec<3, T, Q> const& a, vec<3, T, Q> const& b) + { + return abs(b.x - a.x) + abs(b.y - a.y) + abs(b.z - a.z); + } + + template + GLM_FUNC_QUALIFIER T l1Norm(vec<3, T, Q> const& v) + { + return abs(v.x) + abs(v.y) + abs(v.z); + } + + template + GLM_FUNC_QUALIFIER T l2Norm(vec<3, T, Q> const& a, vec<3, T, Q> const& b + ) + { + return length(b - a); + } + + template + GLM_FUNC_QUALIFIER T l2Norm(vec<3, T, Q> const& v) + { + return length(v); + } + + template + GLM_FUNC_QUALIFIER T lxNorm(vec<3, T, Q> const& x, vec<3, T, Q> const& y, unsigned int Depth) + { + return pow(pow(abs(y.x - x.x), T(Depth)) + pow(abs(y.y - x.y), T(Depth)) + pow(abs(y.z - x.z), T(Depth)), T(1) / T(Depth)); + } + + template + GLM_FUNC_QUALIFIER T lxNorm(vec<3, T, Q> const& v, unsigned int Depth) + { + return pow(pow(abs(v.x), T(Depth)) + pow(abs(v.y), T(Depth)) + pow(abs(v.z), T(Depth)), T(1) / T(Depth)); + } + + template + GLM_FUNC_QUALIFIER T lMaxNorm(vec<3, T, Q> const& a, vec<3, T, Q> const& b) + { + return compMax(abs(b - a)); + } + + template + GLM_FUNC_QUALIFIER T lMaxNorm(vec<3, T, Q> const& v) + { + return compMax(abs(v)); + } + +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/normal.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/normal.hpp new file mode 100644 index 0000000000000000000000000000000000000000..e816e824087dd9e5c361fffd3184c78a9e744cf7 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/normal.hpp @@ -0,0 +1,41 @@ +/// @ref gtx_normal +/// @file glm/gtx/normal.hpp +/// +/// @see core (dependence) +/// @see gtx_extented_min_max (dependence) +/// +/// @defgroup gtx_normal GLM_GTX_normal +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Compute the normal of a triangle. + +#pragma once + +// Dependency: +#include "../glm.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_normal is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_normal extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_normal + /// @{ + + /// Computes triangle normal from triangle points. + /// + /// @see gtx_normal + template + GLM_FUNC_DECL vec<3, T, Q> triangleNormal(vec<3, T, Q> const& p1, vec<3, T, Q> const& p2, vec<3, T, Q> const& p3); + + /// @} +}//namespace glm + +#include "normal.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/normal.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/normal.inl new file mode 100644 index 0000000000000000000000000000000000000000..03f566da3c3af436eab0e74fb2da7c2726fca8d9 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/normal.inl @@ -0,0 +1,15 @@ +/// @ref gtx_normal + +namespace glm +{ + template + GLM_FUNC_QUALIFIER vec<3, T, Q> triangleNormal + ( + vec<3, T, Q> const& p1, + vec<3, T, Q> const& p2, + vec<3, T, Q> const& p3 + ) + { + return normalize(cross(p1 - p2, p1 - p3)); + } +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/normalize_dot.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/normalize_dot.hpp new file mode 100644 index 0000000000000000000000000000000000000000..5f029f91e5e5ef9cd8b9bdf52b48381d5c47fdaf --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/normalize_dot.hpp @@ -0,0 +1,49 @@ +/// @ref gtx_normalize_dot +/// @file glm/gtx/normalize_dot.hpp +/// +/// @see core (dependence) +/// @see gtx_fast_square_root (dependence) +/// +/// @defgroup gtx_normalize_dot GLM_GTX_normalize_dot +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Dot product of vectors that need to be normalize with a single square root. + +#pragma once + +// Dependency: +#include "../gtx/fast_square_root.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_normalize_dot is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_normalize_dot extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_normalize_dot + /// @{ + + /// Normalize parameters and returns the dot product of x and y. + /// It's faster that dot(normalize(x), normalize(y)). + /// + /// @see gtx_normalize_dot extension. + template + GLM_FUNC_DECL T normalizeDot(vec const& x, vec const& y); + + /// Normalize parameters and returns the dot product of x and y. + /// Faster that dot(fastNormalize(x), fastNormalize(y)). + /// + /// @see gtx_normalize_dot extension. + template + GLM_FUNC_DECL T fastNormalizeDot(vec const& x, vec const& y); + + /// @} +}//namespace glm + +#include "normalize_dot.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/normalize_dot.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/normalize_dot.inl new file mode 100644 index 0000000000000000000000000000000000000000..9c720b43456f295ab3c128f51e74a691d67a2410 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/normalize_dot.inl @@ -0,0 +1,16 @@ +/// @ref gtx_normalize_dot + +namespace glm +{ + template + GLM_FUNC_QUALIFIER T normalizeDot(vec const& x, vec const& y) + { + return glm::dot(x, y) * glm::inversesqrt(glm::dot(x, x) * glm::dot(y, y)); + } + + template + GLM_FUNC_QUALIFIER T fastNormalizeDot(vec const& x, vec const& y) + { + return glm::dot(x, y) * glm::fastInverseSqrt(glm::dot(x, x) * glm::dot(y, y)); + } +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/number_precision.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/number_precision.hpp new file mode 100644 index 0000000000000000000000000000000000000000..6ac11a23b48ad7211d66ab1c12eb6338bde1d498 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/number_precision.hpp @@ -0,0 +1,61 @@ +/// @ref gtx_number_precision +/// @file glm/gtx/number_precision.hpp +/// +/// @see core (dependence) +/// @see gtc_type_precision (dependence) +/// @see gtc_quaternion (dependence) +/// +/// @defgroup gtx_number_precision GLM_GTX_number_precision +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Defined size types. + +#pragma once + +// Dependency: +#include "../glm.hpp" +#include "../gtc/type_precision.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_number_precision is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_number_precision extension included") +# endif +#endif + +namespace glm{ +namespace gtx +{ + ///////////////////////////// + // Unsigned int vector types + + /// @addtogroup gtx_number_precision + /// @{ + + typedef u8 u8vec1; //!< \brief 8bit unsigned integer scalar. (from GLM_GTX_number_precision extension) + typedef u16 u16vec1; //!< \brief 16bit unsigned integer scalar. (from GLM_GTX_number_precision extension) + typedef u32 u32vec1; //!< \brief 32bit unsigned integer scalar. (from GLM_GTX_number_precision extension) + typedef u64 u64vec1; //!< \brief 64bit unsigned integer scalar. (from GLM_GTX_number_precision extension) + + ////////////////////// + // Float vector types + + typedef f32 f32vec1; //!< \brief Single-qualifier floating-point scalar. (from GLM_GTX_number_precision extension) + typedef f64 f64vec1; //!< \brief Single-qualifier floating-point scalar. (from GLM_GTX_number_precision extension) + + ////////////////////// + // Float matrix types + + typedef f32 f32mat1; //!< \brief Single-qualifier floating-point scalar. (from GLM_GTX_number_precision extension) + typedef f32 f32mat1x1; //!< \brief Single-qualifier floating-point scalar. (from GLM_GTX_number_precision extension) + typedef f64 f64mat1; //!< \brief Double-qualifier floating-point scalar. (from GLM_GTX_number_precision extension) + typedef f64 f64mat1x1; //!< \brief Double-qualifier floating-point scalar. (from GLM_GTX_number_precision extension) + + /// @} +}//namespace gtx +}//namespace glm + +#include "number_precision.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/number_precision.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/number_precision.inl new file mode 100644 index 0000000000000000000000000000000000000000..fd4fee7a7d46b365edfe140f1b696419b160baa6 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/number_precision.inl @@ -0,0 +1,6 @@ +/// @ref gtx_number_precision + +namespace glm +{ + +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/optimum_pow.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/optimum_pow.hpp new file mode 100644 index 0000000000000000000000000000000000000000..0fd49a7d8d6ee5a6f4977132526814b45f55dac5 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/optimum_pow.hpp @@ -0,0 +1,54 @@ +/// @ref gtx_optimum_pow +/// @file glm/gtx/optimum_pow.hpp +/// +/// @see core (dependence) +/// +/// @defgroup gtx_optimum_pow GLM_GTX_optimum_pow +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Integer exponentiation of power functions. + +#pragma once + +// Dependency: +#include "../glm.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_optimum_pow is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_optimum_pow extension included") +# endif +#endif + +namespace glm{ +namespace gtx +{ + /// @addtogroup gtx_optimum_pow + /// @{ + + /// Returns x raised to the power of 2. + /// + /// @see gtx_optimum_pow + template + GLM_FUNC_DECL genType pow2(genType const& x); + + /// Returns x raised to the power of 3. + /// + /// @see gtx_optimum_pow + template + GLM_FUNC_DECL genType pow3(genType const& x); + + /// Returns x raised to the power of 4. + /// + /// @see gtx_optimum_pow + template + GLM_FUNC_DECL genType pow4(genType const& x); + + /// @} +}//namespace gtx +}//namespace glm + +#include "optimum_pow.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/optimum_pow.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/optimum_pow.inl new file mode 100644 index 0000000000000000000000000000000000000000..2f7242bafe0f9b003e6472805be933f3c981eacc --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/optimum_pow.inl @@ -0,0 +1,22 @@ +/// @ref gtx_optimum_pow + +namespace glm +{ + template + GLM_FUNC_QUALIFIER genType pow2(genType const& x) + { + return x * x; + } + + template + GLM_FUNC_QUALIFIER genType pow3(genType const& x) + { + return x * x * x; + } + + template + GLM_FUNC_QUALIFIER genType pow4(genType const& x) + { + return (x * x) * (x * x); + } +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/orthonormalize.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/orthonormalize.hpp new file mode 100644 index 0000000000000000000000000000000000000000..9772c9fcb60eca714418ffb29d425e68da559398 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/orthonormalize.hpp @@ -0,0 +1,49 @@ +/// @ref gtx_orthonormalize +/// @file glm/gtx/orthonormalize.hpp +/// +/// @see core (dependence) +/// @see gtx_extented_min_max (dependence) +/// +/// @defgroup gtx_orthonormalize GLM_GTX_orthonormalize +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Orthonormalize matrices. + +#pragma once + +// Dependency: +#include "../vec3.hpp" +#include "../mat3x3.hpp" +#include "../geometric.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_orthonormalize is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_orthonormalize extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_orthonormalize + /// @{ + + /// Returns the orthonormalized matrix of m. + /// + /// @see gtx_orthonormalize + template + GLM_FUNC_DECL mat<3, 3, T, Q> orthonormalize(mat<3, 3, T, Q> const& m); + + /// Orthonormalizes x according y. + /// + /// @see gtx_orthonormalize + template + GLM_FUNC_DECL vec<3, T, Q> orthonormalize(vec<3, T, Q> const& x, vec<3, T, Q> const& y); + + /// @} +}//namespace glm + +#include "orthonormalize.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/orthonormalize.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/orthonormalize.inl new file mode 100644 index 0000000000000000000000000000000000000000..7ebe0fab5915ae36da6df5518bdb0cd76b3ca8c1 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/orthonormalize.inl @@ -0,0 +1,29 @@ +/// @ref gtx_orthonormalize + +namespace glm +{ + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> orthonormalize(mat<3, 3, T, Q> const& m) + { + mat<3, 3, T, Q> r = m; + + r[0] = normalize(r[0]); + + T d0 = dot(r[0], r[1]); + r[1] -= r[0] * d0; + r[1] = normalize(r[1]); + + T d1 = dot(r[1], r[2]); + d0 = dot(r[0], r[2]); + r[2] -= r[0] * d0 + r[1] * d1; + r[2] = normalize(r[2]); + + return r; + } + + template + GLM_FUNC_QUALIFIER vec<3, T, Q> orthonormalize(vec<3, T, Q> const& x, vec<3, T, Q> const& y) + { + return normalize(x - y * dot(y, x)); + } +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/pca.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/pca.hpp new file mode 100644 index 0000000000000000000000000000000000000000..e71cb4fa0f78d626ec2afa3ae1f399d2b96d1856 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/pca.hpp @@ -0,0 +1,115 @@ +/// @ref gtx_pca +/// @file glm/gtx/pca.hpp +/// +/// @see core (dependence) +/// @see ext_scalar_relational (dependence) +/// +/// @defgroup gtx_pca GLM_GTX_pca +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Implements functions required for fundamental 'princple component analysis' in 2D, 3D, and 4D: +/// 1) Computing a covariance matrics from a list of _relative_ position vectors +/// 2) Compute the eigenvalues and eigenvectors of the covariance matrics +/// This is useful, e.g., to compute an object-aligned bounding box from vertices of an object. +/// https://en.wikipedia.org/wiki/Principal_component_analysis +/// +/// Example: +/// ``` +/// std::vector ptData; +/// // ... fill ptData with some point data, e.g. vertices +/// +/// glm::dvec3 center = computeCenter(ptData); +/// +/// glm::dmat3 covarMat = glm::computeCovarianceMatrix(ptData.data(), ptData.size(), center); +/// +/// glm::dvec3 evals; +/// glm::dmat3 evecs; +/// int evcnt = glm::findEigenvaluesSymReal(covarMat, evals, evecs); +/// +/// if(evcnt != 3) +/// // ... error handling +/// +/// glm::sortEigenvalues(evals, evecs); +/// +/// // ... now evecs[0] points in the direction (symmetric) of the largest spatial distribution within ptData +/// ``` + +#pragma once + +// Dependency: +#include "../glm.hpp" +#include "../ext/scalar_relational.hpp" + + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_pca is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_pca extension included") +# endif +#endif + +namespace glm { + /// @addtogroup gtx_pca + /// @{ + + /// Compute a covariance matrix form an array of relative coordinates `v` (e.g., relative to the center of gravity of the object) + /// @param v Points to a memory holding `n` times vectors + /// @param n Number of points in v + template + GLM_INLINE mat computeCovarianceMatrix(vec const* v, size_t n); + + /// Compute a covariance matrix form an array of absolute coordinates `v` and a precomputed center of gravity `c` + /// @param v Points to a memory holding `n` times vectors + /// @param n Number of points in v + /// @param c Precomputed center of gravity + template + GLM_INLINE mat computeCovarianceMatrix(vec const* v, size_t n, vec const& c); + + /// Compute a covariance matrix form a pair of iterators `b` (begin) and `e` (end) of a container with relative coordinates (e.g., relative to the center of gravity of the object) + /// Dereferencing an iterator of type I must yield a `vec<D, T, Q%gt;` + template + GLM_FUNC_DECL mat computeCovarianceMatrix(I const& b, I const& e); + + /// Compute a covariance matrix form a pair of iterators `b` (begin) and `e` (end) of a container with absolute coordinates and a precomputed center of gravity `c` + /// Dereferencing an iterator of type I must yield a `vec<D, T, Q%gt;` + template + GLM_FUNC_DECL mat computeCovarianceMatrix(I const& b, I const& e, vec const& c); + + /// Assuming the provided covariance matrix `covarMat` is symmetric and real-valued, this function find the `D` Eigenvalues of the matrix, and also provides the corresponding Eigenvectors. + /// Note: the data in `outEigenvalues` and `outEigenvectors` are in matching order, i.e. `outEigenvector[i]` is the Eigenvector of the Eigenvalue `outEigenvalue[i]`. + /// This is a numeric implementation to find the Eigenvalues, using 'QL decomposition` (variant of QR decomposition: https://en.wikipedia.org/wiki/QR_decomposition). + /// + /// @param[in] covarMat A symmetric, real-valued covariance matrix, e.g. computed from computeCovarianceMatrix + /// @param[out] outEigenvalues Vector to receive the found eigenvalues + /// @param[out] outEigenvectors Matrix to receive the found eigenvectors corresponding to the found eigenvalues, as column vectors + /// @return The number of eigenvalues found, usually D if the precondition of the covariance matrix is met. + template + GLM_FUNC_DECL unsigned int findEigenvaluesSymReal + ( + mat const& covarMat, + vec& outEigenvalues, + mat& outEigenvectors + ); + + /// Sorts a group of Eigenvalues&Eigenvectors, for largest Eigenvalue to smallest Eigenvalue. + /// The data in `outEigenvalues` and `outEigenvectors` are assumed to be matching order, i.e. `outEigenvector[i]` is the Eigenvector of the Eigenvalue `outEigenvalue[i]`. + template + GLM_FUNC_DECL void sortEigenvalues(vec<2, T, Q>& eigenvalues, mat<2, 2, T, Q>& eigenvectors); + + /// Sorts a group of Eigenvalues&Eigenvectors, for largest Eigenvalue to smallest Eigenvalue. + /// The data in `outEigenvalues` and `outEigenvectors` are assumed to be matching order, i.e. `outEigenvector[i]` is the Eigenvector of the Eigenvalue `outEigenvalue[i]`. + template + GLM_FUNC_DECL void sortEigenvalues(vec<3, T, Q>& eigenvalues, mat<3, 3, T, Q>& eigenvectors); + + /// Sorts a group of Eigenvalues&Eigenvectors, for largest Eigenvalue to smallest Eigenvalue. + /// The data in `outEigenvalues` and `outEigenvectors` are assumed to be matching order, i.e. `outEigenvector[i]` is the Eigenvector of the Eigenvalue `outEigenvalue[i]`. + template + GLM_FUNC_DECL void sortEigenvalues(vec<4, T, Q>& eigenvalues, mat<4, 4, T, Q>& eigenvectors); + + /// @} +}//namespace glm + +#include "pca.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/pca.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/pca.inl new file mode 100644 index 0000000000000000000000000000000000000000..4dc3a00583297fb136a73edc145a436b74471339 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/pca.inl @@ -0,0 +1,343 @@ +/// @ref gtx_pca + +#ifndef GLM_HAS_CXX11_STL +#include +#else +#include +#endif + +namespace glm { + + + template + GLM_FUNC_QUALIFIER mat computeCovarianceMatrix(vec const* v, size_t n) + { + return computeCovarianceMatrix const*>(v, v + n); + } + + + template + GLM_FUNC_QUALIFIER mat computeCovarianceMatrix(vec const* v, size_t n, vec const& c) + { + return computeCovarianceMatrix const*>(v, v + n, c); + } + + + template + GLM_FUNC_QUALIFIER mat computeCovarianceMatrix(I const& b, I const& e) + { + glm::mat m(0); + + size_t cnt = 0; + for(I i = b; i != e; i++) + { + vec const& v = *i; + for(length_t x = 0; x < D; ++x) + for(length_t y = 0; y < D; ++y) + m[x][y] += static_cast(v[x] * v[y]); + cnt++; + } + if(cnt > 0) + m /= static_cast(cnt); + + return m; + } + + + template + GLM_FUNC_QUALIFIER mat computeCovarianceMatrix(I const& b, I const& e, vec const& c) + { + glm::mat m(0); + glm::vec v; + + size_t cnt = 0; + for(I i = b; i != e; i++) + { + v = *i - c; + for(length_t x = 0; x < D; ++x) + for(length_t y = 0; y < D; ++y) + m[x][y] += static_cast(v[x] * v[y]); + cnt++; + } + if(cnt > 0) + m /= static_cast(cnt); + + return m; + } + + namespace _internal_ + { + + template + GLM_FUNC_QUALIFIER static T transferSign(T const& v, T const& s) + { + return ((s) >= 0 ? glm::abs(v) : -glm::abs(v)); + } + + template + GLM_FUNC_QUALIFIER static T pythag(T const& a, T const& b) { + static const T epsilon = static_cast(0.0000001); + T absa = glm::abs(a); + T absb = glm::abs(b); + if(absa > absb) { + absb /= absa; + absb *= absb; + return absa * glm::sqrt(static_cast(1) + absb); + } + if(glm::equal(absb, 0, epsilon)) return static_cast(0); + absa /= absb; + absa *= absa; + return absb * glm::sqrt(static_cast(1) + absa); + } + + } + + template + GLM_FUNC_QUALIFIER unsigned int findEigenvaluesSymReal + ( + mat const& covarMat, + vec& outEigenvalues, + mat& outEigenvectors + ) + { + using _internal_::transferSign; + using _internal_::pythag; + + T a[D * D]; // matrix -- input and workspace for algorithm (will be changed inplace) + T d[D]; // diagonal elements + T e[D]; // off-diagonal elements + + for(length_t r = 0; r < D; r++) + for(length_t c = 0; c < D; c++) + a[(r) * D + (c)] = covarMat[c][r]; + + // 1. Householder reduction. + length_t l, k, j, i; + T scale, hh, h, g, f; + static const T epsilon = static_cast(0.0000001); + + for(i = D; i >= 2; i--) + { + l = i - 1; + h = scale = 0; + if(l > 1) + { + for(k = 1; k <= l; k++) + { + scale += glm::abs(a[(i - 1) * D + (k - 1)]); + } + if(glm::equal(scale, 0, epsilon)) + { + e[i - 1] = a[(i - 1) * D + (l - 1)]; + } + else + { + for(k = 1; k <= l; k++) + { + a[(i - 1) * D + (k - 1)] /= scale; + h += a[(i - 1) * D + (k - 1)] * a[(i - 1) * D + (k - 1)]; + } + f = a[(i - 1) * D + (l - 1)]; + g = ((f >= 0) ? -glm::sqrt(h) : glm::sqrt(h)); + e[i - 1] = scale * g; + h -= f * g; + a[(i - 1) * D + (l - 1)] = f - g; + f = 0; + for(j = 1; j <= l; j++) + { + a[(j - 1) * D + (i - 1)] = a[(i - 1) * D + (j - 1)] / h; + g = 0; + for(k = 1; k <= j; k++) + { + g += a[(j - 1) * D + (k - 1)] * a[(i - 1) * D + (k - 1)]; + } + for(k = j + 1; k <= l; k++) + { + g += a[(k - 1) * D + (j - 1)] * a[(i - 1) * D + (k - 1)]; + } + e[j - 1] = g / h; + f += e[j - 1] * a[(i - 1) * D + (j - 1)]; + } + hh = f / (h + h); + for(j = 1; j <= l; j++) + { + f = a[(i - 1) * D + (j - 1)]; + e[j - 1] = g = e[j - 1] - hh * f; + for(k = 1; k <= j; k++) + { + a[(j - 1) * D + (k - 1)] -= (f * e[k - 1] + g * a[(i - 1) * D + (k - 1)]); + } + } + } + } + else + { + e[i - 1] = a[(i - 1) * D + (l - 1)]; + } + d[i - 1] = h; + } + d[0] = 0; + e[0] = 0; + for(i = 1; i <= D; i++) + { + l = i - 1; + if(!glm::equal(d[i - 1], 0, epsilon)) + { + for(j = 1; j <= l; j++) + { + g = 0; + for(k = 1; k <= l; k++) + { + g += a[(i - 1) * D + (k - 1)] * a[(k - 1) * D + (j - 1)]; + } + for(k = 1; k <= l; k++) + { + a[(k - 1) * D + (j - 1)] -= g * a[(k - 1) * D + (i - 1)]; + } + } + } + d[i - 1] = a[(i - 1) * D + (i - 1)]; + a[(i - 1) * D + (i - 1)] = 1; + for(j = 1; j <= l; j++) + { + a[(j - 1) * D + (i - 1)] = a[(i - 1) * D + (j - 1)] = 0; + } + } + + // 2. Calculation of eigenvalues and eigenvectors (QL algorithm) + length_t m, iter; + T s, r, p, dd, c, b; + const length_t MAX_ITER = 30; + + for(i = 2; i <= D; i++) + { + e[i - 2] = e[i - 1]; + } + e[D - 1] = 0; + + for(l = 1; l <= D; l++) + { + iter = 0; + do + { + for(m = l; m <= D - 1; m++) + { + dd = glm::abs(d[m - 1]) + glm::abs(d[m - 1 + 1]); + if(glm::equal(glm::abs(e[m - 1]) + dd, dd, epsilon)) + break; + } + if(m != l) + { + if(iter++ == MAX_ITER) + { + return 0; // Too many iterations in FindEigenvalues + } + g = (d[l - 1 + 1] - d[l - 1]) / (2 * e[l - 1]); + r = pythag(g, 1); + g = d[m - 1] - d[l - 1] + e[l - 1] / (g + transferSign(r, g)); + s = c = 1; + p = 0; + for(i = m - 1; i >= l; i--) + { + f = s * e[i - 1]; + b = c * e[i - 1]; + e[i - 1 + 1] = r = pythag(f, g); + if(glm::equal(r, 0, epsilon)) + { + d[i - 1 + 1] -= p; + e[m - 1] = 0; + break; + } + s = f / r; + c = g / r; + g = d[i - 1 + 1] - p; + r = (d[i - 1] - g) * s + 2 * c * b; + d[i - 1 + 1] = g + (p = s * r); + g = c * r - b; + for(k = 1; k <= D; k++) + { + f = a[(k - 1) * D + (i - 1 + 1)]; + a[(k - 1) * D + (i - 1 + 1)] = s * a[(k - 1) * D + (i - 1)] + c * f; + a[(k - 1) * D + (i - 1)] = c * a[(k - 1) * D + (i - 1)] - s * f; + } + } + if(glm::equal(r, 0, epsilon) && (i >= l)) + continue; + d[l - 1] -= p; + e[l - 1] = g; + e[m - 1] = 0; + } + } while(m != l); + } + + // 3. output + for(i = 0; i < D; i++) + outEigenvalues[i] = d[i]; + for(i = 0; i < D; i++) + for(j = 0; j < D; j++) + outEigenvectors[i][j] = a[(j) * D + (i)]; + + return D; + } + + template + GLM_FUNC_QUALIFIER void sortEigenvalues(vec<2, T, Q>& eigenvalues, mat<2, 2, T, Q>& eigenvectors) + { + if (eigenvalues[0] < eigenvalues[1]) + { + std::swap(eigenvalues[0], eigenvalues[1]); + std::swap(eigenvectors[0], eigenvectors[1]); + } + } + + template + GLM_FUNC_QUALIFIER void sortEigenvalues(vec<3, T, Q>& eigenvalues, mat<3, 3, T, Q>& eigenvectors) + { + if (eigenvalues[0] < eigenvalues[1]) + { + std::swap(eigenvalues[0], eigenvalues[1]); + std::swap(eigenvectors[0], eigenvectors[1]); + } + if (eigenvalues[0] < eigenvalues[2]) + { + std::swap(eigenvalues[0], eigenvalues[2]); + std::swap(eigenvectors[0], eigenvectors[2]); + } + if (eigenvalues[1] < eigenvalues[2]) + { + std::swap(eigenvalues[1], eigenvalues[2]); + std::swap(eigenvectors[1], eigenvectors[2]); + } + } + + template + GLM_FUNC_QUALIFIER void sortEigenvalues(vec<4, T, Q>& eigenvalues, mat<4, 4, T, Q>& eigenvectors) + { + if (eigenvalues[0] < eigenvalues[2]) + { + std::swap(eigenvalues[0], eigenvalues[2]); + std::swap(eigenvectors[0], eigenvectors[2]); + } + if (eigenvalues[1] < eigenvalues[3]) + { + std::swap(eigenvalues[1], eigenvalues[3]); + std::swap(eigenvectors[1], eigenvectors[3]); + } + if (eigenvalues[0] < eigenvalues[1]) + { + std::swap(eigenvalues[0], eigenvalues[1]); + std::swap(eigenvectors[0], eigenvectors[1]); + } + if (eigenvalues[2] < eigenvalues[3]) + { + std::swap(eigenvalues[2], eigenvalues[3]); + std::swap(eigenvectors[2], eigenvectors[3]); + } + if (eigenvalues[1] < eigenvalues[2]) + { + std::swap(eigenvalues[1], eigenvalues[2]); + std::swap(eigenvectors[1], eigenvectors[2]); + } + } + +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/perpendicular.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/perpendicular.hpp new file mode 100644 index 0000000000000000000000000000000000000000..3546812ad16aa8cb99a7c7807ba10664d9f001cb --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/perpendicular.hpp @@ -0,0 +1,41 @@ +/// @ref gtx_perpendicular +/// @file glm/gtx/perpendicular.hpp +/// +/// @see core (dependence) +/// @see gtx_projection (dependence) +/// +/// @defgroup gtx_perpendicular GLM_GTX_perpendicular +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Perpendicular of a vector from other one + +#pragma once + +// Dependency: +#include "../glm.hpp" +#include "../gtx/projection.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_perpendicular is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_perpendicular extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_perpendicular + /// @{ + + //! Projects x a perpendicular axis of Normal. + //! From GLM_GTX_perpendicular extension. + template + GLM_FUNC_DECL genType perp(genType const& x, genType const& Normal); + + /// @} +}//namespace glm + +#include "perpendicular.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/perpendicular.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/perpendicular.inl new file mode 100644 index 0000000000000000000000000000000000000000..426064829b8a9173d7abb4da45814a731fdeb19f --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/perpendicular.inl @@ -0,0 +1,10 @@ +/// @ref gtx_perpendicular + +namespace glm +{ + template + GLM_FUNC_QUALIFIER genType perp(genType const& x, genType const& Normal) + { + return x - proj(x, Normal); + } +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/polar_coordinates.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/polar_coordinates.hpp new file mode 100644 index 0000000000000000000000000000000000000000..31d06f1e52164a2b6a78e35db01c1645bceeccfa --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/polar_coordinates.hpp @@ -0,0 +1,48 @@ +/// @ref gtx_polar_coordinates +/// @file glm/gtx/polar_coordinates.hpp +/// +/// @see core (dependence) +/// +/// @defgroup gtx_polar_coordinates GLM_GTX_polar_coordinates +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Conversion from Euclidean space to polar space and revert. + +#pragma once + +// Dependency: +#include "../glm.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_polar_coordinates is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_polar_coordinates extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_polar_coordinates + /// @{ + + /// Convert Euclidean to Polar coordinates, x is the latitude, y the longitude and z the xz distance. + /// + /// @see gtx_polar_coordinates + template + GLM_FUNC_DECL vec<3, T, Q> polar( + vec<3, T, Q> const& euclidean); + + /// Convert Polar to Euclidean coordinates. + /// + /// @see gtx_polar_coordinates + template + GLM_FUNC_DECL vec<3, T, Q> euclidean( + vec<2, T, Q> const& polar); + + /// @} +}//namespace glm + +#include "polar_coordinates.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/polar_coordinates.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/polar_coordinates.inl new file mode 100644 index 0000000000000000000000000000000000000000..2c285dd6adbac9a81869010f1d3f524cbdb8148a --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/polar_coordinates.inl @@ -0,0 +1,36 @@ +/// @ref gtx_polar_coordinates + +namespace glm +{ + template + GLM_FUNC_QUALIFIER vec<3, T, Q> polar + ( + vec<3, T, Q> const& euclidean + ) + { + T const Length(length(euclidean)); + vec<3, T, Q> const tmp(euclidean / Length); + T const xz_dist(sqrt(tmp.x * tmp.x + tmp.z * tmp.z)); + + return vec<3, T, Q>( + asin(tmp.y), // latitude + atan(tmp.x, tmp.z), // longitude + xz_dist); // xz distance + } + + template + GLM_FUNC_QUALIFIER vec<3, T, Q> euclidean + ( + vec<2, T, Q> const& polar + ) + { + T const latitude(polar.x); + T const longitude(polar.y); + + return vec<3, T, Q>( + cos(latitude) * sin(longitude), + sin(latitude), + cos(latitude) * cos(longitude)); + } + +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/projection.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/projection.hpp new file mode 100644 index 0000000000000000000000000000000000000000..06cc800f302667971ebd5112e488ad9d766a747b --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/projection.hpp @@ -0,0 +1,43 @@ +/// @ref gtx_projection +/// @file glm/gtx/projection.hpp +/// +/// @see core (dependence) +/// +/// @defgroup gtx_projection GLM_GTX_projection +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Projection of a vector to other one + +#pragma once + +// Dependency: +#include "../geometric.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_projection is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_projection extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_projection + /// @{ + + /// Projects x on Normal. + /// + /// @param[in] x A vector to project + /// @param[in] Normal A normal that doesn't need to be of unit length. + /// + /// @see gtx_projection + template + GLM_FUNC_DECL genType proj(genType const& x, genType const& Normal); + + /// @} +}//namespace glm + +#include "projection.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/projection.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/projection.inl new file mode 100644 index 0000000000000000000000000000000000000000..afdd2c3d5229e60f3b4a469f00ed9c102de2c106 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/projection.inl @@ -0,0 +1,10 @@ +/// @ref gtx_projection + +namespace glm +{ + template + GLM_FUNC_QUALIFIER genType proj(genType const& x, genType const& Normal) + { + return glm::dot(x, Normal) / glm::dot(Normal, Normal) * Normal; + } +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/quaternion.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/quaternion.hpp new file mode 100644 index 0000000000000000000000000000000000000000..47f9d4c83ca59b420ba41ab7ff72c4c44cc1a455 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/quaternion.hpp @@ -0,0 +1,174 @@ +/// @ref gtx_quaternion +/// @file glm/gtx/quaternion.hpp +/// +/// @see core (dependence) +/// @see gtx_extented_min_max (dependence) +/// +/// @defgroup gtx_quaternion GLM_GTX_quaternion +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Extended quaternion types and functions + +#pragma once + +// Dependency: +#include "../glm.hpp" +#include "../gtc/constants.hpp" +#include "../gtc/quaternion.hpp" +#include "../ext/quaternion_exponential.hpp" +#include "../gtx/norm.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_quaternion is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_quaternion extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_quaternion + /// @{ + + /// Create an identity quaternion. + /// + /// @see gtx_quaternion + template + GLM_FUNC_DECL GLM_CONSTEXPR qua quat_identity(); + + /// Compute a cross product between a quaternion and a vector. + /// + /// @see gtx_quaternion + template + GLM_FUNC_DECL vec<3, T, Q> cross( + qua const& q, + vec<3, T, Q> const& v); + + //! Compute a cross product between a vector and a quaternion. + /// + /// @see gtx_quaternion + template + GLM_FUNC_DECL vec<3, T, Q> cross( + vec<3, T, Q> const& v, + qua const& q); + + //! Compute a point on a path according squad equation. + //! q1 and q2 are control points; s1 and s2 are intermediate control points. + /// + /// @see gtx_quaternion + template + GLM_FUNC_DECL qua squad( + qua const& q1, + qua const& q2, + qua const& s1, + qua const& s2, + T const& h); + + //! Returns an intermediate control point for squad interpolation. + /// + /// @see gtx_quaternion + template + GLM_FUNC_DECL qua intermediate( + qua const& prev, + qua const& curr, + qua const& next); + + //! Returns quarternion square root. + /// + /// @see gtx_quaternion + //template + //qua sqrt( + // qua const& q); + + //! Rotates a 3 components vector by a quaternion. + /// + /// @see gtx_quaternion + template + GLM_FUNC_DECL vec<3, T, Q> rotate( + qua const& q, + vec<3, T, Q> const& v); + + /// Rotates a 4 components vector by a quaternion. + /// + /// @see gtx_quaternion + template + GLM_FUNC_DECL vec<4, T, Q> rotate( + qua const& q, + vec<4, T, Q> const& v); + + /// Extract the real component of a quaternion. + /// + /// @see gtx_quaternion + template + GLM_FUNC_DECL T extractRealComponent( + qua const& q); + + /// Converts a quaternion to a 3 * 3 matrix. + /// + /// @see gtx_quaternion + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> toMat3( + qua const& x){return mat3_cast(x);} + + /// Converts a quaternion to a 4 * 4 matrix. + /// + /// @see gtx_quaternion + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> toMat4( + qua const& x){return mat4_cast(x);} + + /// Converts a 3 * 3 matrix to a quaternion. + /// + /// @see gtx_quaternion + template + GLM_FUNC_QUALIFIER qua toQuat( + mat<3, 3, T, Q> const& x){return quat_cast(x);} + + /// Converts a 4 * 4 matrix to a quaternion. + /// + /// @see gtx_quaternion + template + GLM_FUNC_QUALIFIER qua toQuat( + mat<4, 4, T, Q> const& x){return quat_cast(x);} + + /// Quaternion interpolation using the rotation short path. + /// + /// @see gtx_quaternion + template + GLM_FUNC_DECL qua shortMix( + qua const& x, + qua const& y, + T const& a); + + /// Quaternion normalized linear interpolation. + /// + /// @see gtx_quaternion + template + GLM_FUNC_DECL qua fastMix( + qua const& x, + qua const& y, + T const& a); + + /// Compute the rotation between two vectors. + /// @param orig vector, needs to be normalized + /// @param dest vector, needs to be normalized + /// + /// @see gtx_quaternion + template + GLM_FUNC_DECL qua rotation( + vec<3, T, Q> const& orig, + vec<3, T, Q> const& dest); + + /// Returns the squared length of x. + /// + /// @see gtx_quaternion + template + GLM_FUNC_DECL GLM_CONSTEXPR T length2(qua const& q); + + /// @} +}//namespace glm + +#include "quaternion.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/quaternion.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/quaternion.inl new file mode 100644 index 0000000000000000000000000000000000000000..34aed89760102b85597421a77d940883549fa017 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/quaternion.inl @@ -0,0 +1,159 @@ +/// @ref gtx_quaternion + +#include +#include "../gtc/constants.hpp" + +namespace glm +{ + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua quat_identity() + { + return qua(static_cast(1), static_cast(0), static_cast(0), static_cast(0)); + } + + template + GLM_FUNC_QUALIFIER vec<3, T, Q> cross(vec<3, T, Q> const& v, qua const& q) + { + return inverse(q) * v; + } + + template + GLM_FUNC_QUALIFIER vec<3, T, Q> cross(qua const& q, vec<3, T, Q> const& v) + { + return q * v; + } + + template + GLM_FUNC_QUALIFIER qua squad + ( + qua const& q1, + qua const& q2, + qua const& s1, + qua const& s2, + T const& h) + { + return mix(mix(q1, q2, h), mix(s1, s2, h), static_cast(2) * (static_cast(1) - h) * h); + } + + template + GLM_FUNC_QUALIFIER qua intermediate + ( + qua const& prev, + qua const& curr, + qua const& next + ) + { + qua invQuat = inverse(curr); + return exp((log(next * invQuat) + log(prev * invQuat)) / static_cast(-4)) * curr; + } + + template + GLM_FUNC_QUALIFIER vec<3, T, Q> rotate(qua const& q, vec<3, T, Q> const& v) + { + return q * v; + } + + template + GLM_FUNC_QUALIFIER vec<4, T, Q> rotate(qua const& q, vec<4, T, Q> const& v) + { + return q * v; + } + + template + GLM_FUNC_QUALIFIER T extractRealComponent(qua const& q) + { + T w = static_cast(1) - q.x * q.x - q.y * q.y - q.z * q.z; + if(w < T(0)) + return T(0); + else + return -sqrt(w); + } + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR T length2(qua const& q) + { + return q.x * q.x + q.y * q.y + q.z * q.z + q.w * q.w; + } + + template + GLM_FUNC_QUALIFIER qua shortMix(qua const& x, qua const& y, T const& a) + { + if(a <= static_cast(0)) return x; + if(a >= static_cast(1)) return y; + + T fCos = dot(x, y); + qua y2(y); //BUG!!! qua y2; + if(fCos < static_cast(0)) + { + y2 = -y; + fCos = -fCos; + } + + //if(fCos > 1.0f) // problem + T k0, k1; + if(fCos > (static_cast(1) - epsilon())) + { + k0 = static_cast(1) - a; + k1 = static_cast(0) + a; //BUG!!! 1.0f + a; + } + else + { + T fSin = sqrt(T(1) - fCos * fCos); + T fAngle = atan(fSin, fCos); + T fOneOverSin = static_cast(1) / fSin; + k0 = sin((static_cast(1) - a) * fAngle) * fOneOverSin; + k1 = sin((static_cast(0) + a) * fAngle) * fOneOverSin; + } + + return qua( + k0 * x.w + k1 * y2.w, + k0 * x.x + k1 * y2.x, + k0 * x.y + k1 * y2.y, + k0 * x.z + k1 * y2.z); + } + + template + GLM_FUNC_QUALIFIER qua fastMix(qua const& x, qua const& y, T const& a) + { + return glm::normalize(x * (static_cast(1) - a) + (y * a)); + } + + template + GLM_FUNC_QUALIFIER qua rotation(vec<3, T, Q> const& orig, vec<3, T, Q> const& dest) + { + T cosTheta = dot(orig, dest); + vec<3, T, Q> rotationAxis; + + if(cosTheta >= static_cast(1) - epsilon()) { + // orig and dest point in the same direction + return quat_identity(); + } + + if(cosTheta < static_cast(-1) + epsilon()) + { + // special case when vectors in opposite directions : + // there is no "ideal" rotation axis + // So guess one; any will do as long as it's perpendicular to start + // This implementation favors a rotation around the Up axis (Y), + // since it's often what you want to do. + rotationAxis = cross(vec<3, T, Q>(0, 0, 1), orig); + if(length2(rotationAxis) < epsilon()) // bad luck, they were parallel, try again! + rotationAxis = cross(vec<3, T, Q>(1, 0, 0), orig); + + rotationAxis = normalize(rotationAxis); + return angleAxis(pi(), rotationAxis); + } + + // Implementation from Stan Melax's Game Programming Gems 1 article + rotationAxis = cross(orig, dest); + + T s = sqrt((T(1) + cosTheta) * static_cast(2)); + T invs = static_cast(1) / s; + + return qua( + s * static_cast(0.5f), + rotationAxis.x * invs, + rotationAxis.y * invs, + rotationAxis.z * invs); + } +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/range.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/range.hpp new file mode 100644 index 0000000000000000000000000000000000000000..0f856262125088c109c66c05f54711919069e476 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/range.hpp @@ -0,0 +1,98 @@ +/// @ref gtx_range +/// @file glm/gtx/range.hpp +/// @author Joshua Moerman +/// +/// @defgroup gtx_range GLM_GTX_range +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Defines begin and end for vectors and matrices. Useful for range-based for loop. +/// The range is defined over the elements, not over columns or rows (e.g. mat4 has 16 elements). + +#pragma once + +// Dependencies +#include "../detail/setup.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_range is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_range extension included") +# endif +#endif + +#include "../gtc/type_ptr.hpp" +#include "../gtc/vec1.hpp" + +namespace glm +{ + /// @addtogroup gtx_range + /// @{ + +# if GLM_COMPILER & GLM_COMPILER_VC +# pragma warning(push) +# pragma warning(disable : 4100) // unreferenced formal parameter +# endif + + template + inline length_t components(vec<1, T, Q> const& v) + { + return v.length(); + } + + template + inline length_t components(vec<2, T, Q> const& v) + { + return v.length(); + } + + template + inline length_t components(vec<3, T, Q> const& v) + { + return v.length(); + } + + template + inline length_t components(vec<4, T, Q> const& v) + { + return v.length(); + } + + template + inline length_t components(genType const& m) + { + return m.length() * m[0].length(); + } + + template + inline typename genType::value_type const * begin(genType const& v) + { + return value_ptr(v); + } + + template + inline typename genType::value_type const * end(genType const& v) + { + return begin(v) + components(v); + } + + template + inline typename genType::value_type * begin(genType& v) + { + return value_ptr(v); + } + + template + inline typename genType::value_type * end(genType& v) + { + return begin(v) + components(v); + } + +# if GLM_COMPILER & GLM_COMPILER_VC +# pragma warning(pop) +# endif + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/raw_data.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/raw_data.hpp new file mode 100644 index 0000000000000000000000000000000000000000..140ec5d6423524da2aeea919a32704751a2b17e5 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/raw_data.hpp @@ -0,0 +1,51 @@ +/// @ref gtx_raw_data +/// @file glm/gtx/raw_data.hpp +/// +/// @see core (dependence) +/// +/// @defgroup gtx_raw_data GLM_GTX_raw_data +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Projection of a vector to other one + +#pragma once + +// Dependencies +#include "../ext/scalar_uint_sized.hpp" +#include "../detail/setup.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_raw_data is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_raw_data extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_raw_data + /// @{ + + //! Type for byte numbers. + //! From GLM_GTX_raw_data extension. + typedef detail::uint8 byte; + + //! Type for word numbers. + //! From GLM_GTX_raw_data extension. + typedef detail::uint16 word; + + //! Type for dword numbers. + //! From GLM_GTX_raw_data extension. + typedef detail::uint32 dword; + + //! Type for qword numbers. + //! From GLM_GTX_raw_data extension. + typedef detail::uint64 qword; + + /// @} +}// namespace glm + +#include "raw_data.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/raw_data.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/raw_data.inl new file mode 100644 index 0000000000000000000000000000000000000000..5d0d07138e5b0e9553776c9dedc9d1916b61a0f9 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/raw_data.inl @@ -0,0 +1,2 @@ +/// @ref gtx_raw_data + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/rotate_normalized_axis.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/rotate_normalized_axis.hpp new file mode 100644 index 0000000000000000000000000000000000000000..18181fd58687f0eb0747726b8d71efff7b6e863e --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/rotate_normalized_axis.hpp @@ -0,0 +1,68 @@ +/// @ref gtx_rotate_normalized_axis +/// @file glm/gtx/rotate_normalized_axis.hpp +/// +/// @see core (dependence) +/// @see gtc_matrix_transform +/// @see gtc_quaternion +/// +/// @defgroup gtx_rotate_normalized_axis GLM_GTX_rotate_normalized_axis +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Quaternions and matrices rotations around normalized axis. + +#pragma once + +// Dependency: +#include "../glm.hpp" +#include "../gtc/epsilon.hpp" +#include "../gtc/quaternion.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_rotate_normalized_axis is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_rotate_normalized_axis extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_rotate_normalized_axis + /// @{ + + /// Builds a rotation 4 * 4 matrix created from a normalized axis and an angle. + /// + /// @param m Input matrix multiplied by this rotation matrix. + /// @param angle Rotation angle expressed in radians. + /// @param axis Rotation axis, must be normalized. + /// @tparam T Value type used to build the matrix. Currently supported: half (not recommended), float or double. + /// + /// @see gtx_rotate_normalized_axis + /// @see - rotate(T angle, T x, T y, T z) + /// @see - rotate(mat<4, 4, T, Q> const& m, T angle, T x, T y, T z) + /// @see - rotate(T angle, vec<3, T, Q> const& v) + template + GLM_FUNC_DECL mat<4, 4, T, Q> rotateNormalizedAxis( + mat<4, 4, T, Q> const& m, + T const& angle, + vec<3, T, Q> const& axis); + + /// Rotates a quaternion from a vector of 3 components normalized axis and an angle. + /// + /// @param q Source orientation + /// @param angle Angle expressed in radians. + /// @param axis Normalized axis of the rotation, must be normalized. + /// + /// @see gtx_rotate_normalized_axis + template + GLM_FUNC_DECL qua rotateNormalizedAxis( + qua const& q, + T const& angle, + vec<3, T, Q> const& axis); + + /// @} +}//namespace glm + +#include "rotate_normalized_axis.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/rotate_normalized_axis.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/rotate_normalized_axis.inl new file mode 100644 index 0000000000000000000000000000000000000000..422480a982106df95c3d1ead323294b8d3d761a9 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/rotate_normalized_axis.inl @@ -0,0 +1,58 @@ +/// @ref gtx_rotate_normalized_axis + +namespace glm +{ + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> rotateNormalizedAxis + ( + mat<4, 4, T, Q> const& m, + T const& angle, + vec<3, T, Q> const& v + ) + { + T const a = angle; + T const c = cos(a); + T const s = sin(a); + + vec<3, T, Q> const axis(v); + + vec<3, T, Q> const temp((static_cast(1) - c) * axis); + + mat<4, 4, T, Q> Rotate; + Rotate[0][0] = c + temp[0] * axis[0]; + Rotate[0][1] = 0 + temp[0] * axis[1] + s * axis[2]; + Rotate[0][2] = 0 + temp[0] * axis[2] - s * axis[1]; + + Rotate[1][0] = 0 + temp[1] * axis[0] - s * axis[2]; + Rotate[1][1] = c + temp[1] * axis[1]; + Rotate[1][2] = 0 + temp[1] * axis[2] + s * axis[0]; + + Rotate[2][0] = 0 + temp[2] * axis[0] + s * axis[1]; + Rotate[2][1] = 0 + temp[2] * axis[1] - s * axis[0]; + Rotate[2][2] = c + temp[2] * axis[2]; + + mat<4, 4, T, Q> Result; + Result[0] = m[0] * Rotate[0][0] + m[1] * Rotate[0][1] + m[2] * Rotate[0][2]; + Result[1] = m[0] * Rotate[1][0] + m[1] * Rotate[1][1] + m[2] * Rotate[1][2]; + Result[2] = m[0] * Rotate[2][0] + m[1] * Rotate[2][1] + m[2] * Rotate[2][2]; + Result[3] = m[3]; + return Result; + } + + template + GLM_FUNC_QUALIFIER qua rotateNormalizedAxis + ( + qua const& q, + T const& angle, + vec<3, T, Q> const& v + ) + { + vec<3, T, Q> const Tmp(v); + + T const AngleRad(angle); + T const Sin = sin(AngleRad * T(0.5)); + + return q * qua(cos(AngleRad * static_cast(0.5)), Tmp.x * Sin, Tmp.y * Sin, Tmp.z * Sin); + //return gtc::quaternion::cross(q, tquat(cos(AngleRad * T(0.5)), Tmp.x * fSin, Tmp.y * fSin, Tmp.z * fSin)); + } +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/rotate_vector.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/rotate_vector.hpp new file mode 100644 index 0000000000000000000000000000000000000000..cfb87e5af4a439f8c04cf3b8b64ddf2ef68da2d7 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/rotate_vector.hpp @@ -0,0 +1,123 @@ +/// @ref gtx_rotate_vector +/// @file glm/gtx/rotate_vector.hpp +/// +/// @see core (dependence) +/// @see gtx_transform (dependence) +/// +/// @defgroup gtx_rotate_vector GLM_GTX_rotate_vector +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Function to directly rotate a vector + +#pragma once + +// Dependency: +#include "../gtx/transform.hpp" +#include "../gtc/epsilon.hpp" +#include "../ext/vector_relational.hpp" +#include "../glm.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_rotate_vector is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_rotate_vector extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_rotate_vector + /// @{ + + /// Returns Spherical interpolation between two vectors + /// + /// @param x A first vector + /// @param y A second vector + /// @param a Interpolation factor. The interpolation is defined beyond the range [0, 1]. + /// + /// @see gtx_rotate_vector + template + GLM_FUNC_DECL vec<3, T, Q> slerp( + vec<3, T, Q> const& x, + vec<3, T, Q> const& y, + T const& a); + + //! Rotate a two dimensional vector. + //! From GLM_GTX_rotate_vector extension. + template + GLM_FUNC_DECL vec<2, T, Q> rotate( + vec<2, T, Q> const& v, + T const& angle); + + //! Rotate a three dimensional vector around an axis. + //! From GLM_GTX_rotate_vector extension. + template + GLM_FUNC_DECL vec<3, T, Q> rotate( + vec<3, T, Q> const& v, + T const& angle, + vec<3, T, Q> const& normal); + + //! Rotate a four dimensional vector around an axis. + //! From GLM_GTX_rotate_vector extension. + template + GLM_FUNC_DECL vec<4, T, Q> rotate( + vec<4, T, Q> const& v, + T const& angle, + vec<3, T, Q> const& normal); + + //! Rotate a three dimensional vector around the X axis. + //! From GLM_GTX_rotate_vector extension. + template + GLM_FUNC_DECL vec<3, T, Q> rotateX( + vec<3, T, Q> const& v, + T const& angle); + + //! Rotate a three dimensional vector around the Y axis. + //! From GLM_GTX_rotate_vector extension. + template + GLM_FUNC_DECL vec<3, T, Q> rotateY( + vec<3, T, Q> const& v, + T const& angle); + + //! Rotate a three dimensional vector around the Z axis. + //! From GLM_GTX_rotate_vector extension. + template + GLM_FUNC_DECL vec<3, T, Q> rotateZ( + vec<3, T, Q> const& v, + T const& angle); + + //! Rotate a four dimensional vector around the X axis. + //! From GLM_GTX_rotate_vector extension. + template + GLM_FUNC_DECL vec<4, T, Q> rotateX( + vec<4, T, Q> const& v, + T const& angle); + + //! Rotate a four dimensional vector around the Y axis. + //! From GLM_GTX_rotate_vector extension. + template + GLM_FUNC_DECL vec<4, T, Q> rotateY( + vec<4, T, Q> const& v, + T const& angle); + + //! Rotate a four dimensional vector around the Z axis. + //! From GLM_GTX_rotate_vector extension. + template + GLM_FUNC_DECL vec<4, T, Q> rotateZ( + vec<4, T, Q> const& v, + T const& angle); + + //! Build a rotation matrix from a normal and a up vector. + //! From GLM_GTX_rotate_vector extension. + template + GLM_FUNC_DECL mat<4, 4, T, Q> orientation( + vec<3, T, Q> const& Normal, + vec<3, T, Q> const& Up); + + /// @} +}//namespace glm + +#include "rotate_vector.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/rotate_vector.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/rotate_vector.inl new file mode 100644 index 0000000000000000000000000000000000000000..cecc3b174fc1909b55499c56f82b4d744394bcfb --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/rotate_vector.inl @@ -0,0 +1,187 @@ +/// @ref gtx_rotate_vector + +namespace glm +{ + template + GLM_FUNC_QUALIFIER vec<3, T, Q> slerp + ( + vec<3, T, Q> const& x, + vec<3, T, Q> const& y, + T const& a + ) + { + // get cosine of angle between vectors (-1 -> 1) + T CosAlpha = dot(x, y); + // get angle (0 -> pi) + T Alpha = acos(CosAlpha); + // get sine of angle between vectors (0 -> 1) + T SinAlpha = sin(Alpha); + // this breaks down when SinAlpha = 0, i.e. Alpha = 0 or pi + T t1 = sin((static_cast(1) - a) * Alpha) / SinAlpha; + T t2 = sin(a * Alpha) / SinAlpha; + + // interpolate src vectors + return x * t1 + y * t2; + } + + template + GLM_FUNC_QUALIFIER vec<2, T, Q> rotate + ( + vec<2, T, Q> const& v, + T const& angle + ) + { + vec<2, T, Q> Result; + T const Cos(cos(angle)); + T const Sin(sin(angle)); + + Result.x = v.x * Cos - v.y * Sin; + Result.y = v.x * Sin + v.y * Cos; + return Result; + } + + template + GLM_FUNC_QUALIFIER vec<3, T, Q> rotate + ( + vec<3, T, Q> const& v, + T const& angle, + vec<3, T, Q> const& normal + ) + { + return mat<3, 3, T, Q>(glm::rotate(angle, normal)) * v; + } + /* + template + GLM_FUNC_QUALIFIER vec<3, T, Q> rotateGTX( + const vec<3, T, Q>& x, + T angle, + const vec<3, T, Q>& normal) + { + const T Cos = cos(radians(angle)); + const T Sin = sin(radians(angle)); + return x * Cos + ((x * normal) * (T(1) - Cos)) * normal + cross(x, normal) * Sin; + } + */ + template + GLM_FUNC_QUALIFIER vec<4, T, Q> rotate + ( + vec<4, T, Q> const& v, + T const& angle, + vec<3, T, Q> const& normal + ) + { + return rotate(angle, normal) * v; + } + + template + GLM_FUNC_QUALIFIER vec<3, T, Q> rotateX + ( + vec<3, T, Q> const& v, + T const& angle + ) + { + vec<3, T, Q> Result(v); + T const Cos(cos(angle)); + T const Sin(sin(angle)); + + Result.y = v.y * Cos - v.z * Sin; + Result.z = v.y * Sin + v.z * Cos; + return Result; + } + + template + GLM_FUNC_QUALIFIER vec<3, T, Q> rotateY + ( + vec<3, T, Q> const& v, + T const& angle + ) + { + vec<3, T, Q> Result = v; + T const Cos(cos(angle)); + T const Sin(sin(angle)); + + Result.x = v.x * Cos + v.z * Sin; + Result.z = -v.x * Sin + v.z * Cos; + return Result; + } + + template + GLM_FUNC_QUALIFIER vec<3, T, Q> rotateZ + ( + vec<3, T, Q> const& v, + T const& angle + ) + { + vec<3, T, Q> Result = v; + T const Cos(cos(angle)); + T const Sin(sin(angle)); + + Result.x = v.x * Cos - v.y * Sin; + Result.y = v.x * Sin + v.y * Cos; + return Result; + } + + template + GLM_FUNC_QUALIFIER vec<4, T, Q> rotateX + ( + vec<4, T, Q> const& v, + T const& angle + ) + { + vec<4, T, Q> Result = v; + T const Cos(cos(angle)); + T const Sin(sin(angle)); + + Result.y = v.y * Cos - v.z * Sin; + Result.z = v.y * Sin + v.z * Cos; + return Result; + } + + template + GLM_FUNC_QUALIFIER vec<4, T, Q> rotateY + ( + vec<4, T, Q> const& v, + T const& angle + ) + { + vec<4, T, Q> Result = v; + T const Cos(cos(angle)); + T const Sin(sin(angle)); + + Result.x = v.x * Cos + v.z * Sin; + Result.z = -v.x * Sin + v.z * Cos; + return Result; + } + + template + GLM_FUNC_QUALIFIER vec<4, T, Q> rotateZ + ( + vec<4, T, Q> const& v, + T const& angle + ) + { + vec<4, T, Q> Result = v; + T const Cos(cos(angle)); + T const Sin(sin(angle)); + + Result.x = v.x * Cos - v.y * Sin; + Result.y = v.x * Sin + v.y * Cos; + return Result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> orientation + ( + vec<3, T, Q> const& Normal, + vec<3, T, Q> const& Up + ) + { + if(all(equal(Normal, Up, epsilon()))) + return mat<4, 4, T, Q>(static_cast(1)); + + vec<3, T, Q> RotationAxis = cross(Up, Normal); + T Angle = acos(dot(Normal, Up)); + + return rotate(Angle, RotationAxis); + } +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/scalar_multiplication.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/scalar_multiplication.hpp new file mode 100644 index 0000000000000000000000000000000000000000..0417be5751f6c1eec8bac8fc4ab148e61e847c77 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/scalar_multiplication.hpp @@ -0,0 +1,82 @@ +/// @ref gtx_scalar_multiplication +/// @file glm/gtx/scalar_multiplication.hpp +/// @author Joshua Moerman +/// +/// @defgroup gtx_scalar_multiplication GLM_GTX_scalar_multiplication +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Enables scalar multiplication for all types +/// +/// Since GLSL is very strict about types, the following (often used) combinations do not work: +/// double * vec4 +/// int * vec4 +/// vec4 / int +/// So we'll fix that! Of course "float * vec4" should remain the same (hence the enable_if magic) + +#pragma once + +#include "../detail/setup.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_scalar_multiplication is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_scalar_multiplication extension included") +# endif +#endif + +#include "../vec2.hpp" +#include "../vec3.hpp" +#include "../vec4.hpp" +#include "../mat2x2.hpp" +#include + +namespace glm +{ + /// @addtogroup gtx_scalar_multiplication + /// @{ + + template + using return_type_scalar_multiplication = typename std::enable_if< + !std::is_same::value // T may not be a float + && std::is_arithmetic::value, Vec // But it may be an int or double (no vec3 or mat3, ...) + >::type; + +#define GLM_IMPLEMENT_SCAL_MULT(Vec) \ + template \ + return_type_scalar_multiplication \ + operator*(T const& s, Vec rh){ \ + return rh *= static_cast(s); \ + } \ + \ + template \ + return_type_scalar_multiplication \ + operator*(Vec lh, T const& s){ \ + return lh *= static_cast(s); \ + } \ + \ + template \ + return_type_scalar_multiplication \ + operator/(Vec lh, T const& s){ \ + return lh *= 1.0f / static_cast(s); \ + } + +GLM_IMPLEMENT_SCAL_MULT(vec2) +GLM_IMPLEMENT_SCAL_MULT(vec3) +GLM_IMPLEMENT_SCAL_MULT(vec4) + +GLM_IMPLEMENT_SCAL_MULT(mat2) +GLM_IMPLEMENT_SCAL_MULT(mat2x3) +GLM_IMPLEMENT_SCAL_MULT(mat2x4) +GLM_IMPLEMENT_SCAL_MULT(mat3x2) +GLM_IMPLEMENT_SCAL_MULT(mat3) +GLM_IMPLEMENT_SCAL_MULT(mat3x4) +GLM_IMPLEMENT_SCAL_MULT(mat4x2) +GLM_IMPLEMENT_SCAL_MULT(mat4x3) +GLM_IMPLEMENT_SCAL_MULT(mat4) + +#undef GLM_IMPLEMENT_SCAL_MULT + /// @} +} // namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/scalar_relational.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/scalar_relational.hpp new file mode 100644 index 0000000000000000000000000000000000000000..87d05e3c8a587a9751d9f91b9d49bdd9df406653 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/scalar_relational.hpp @@ -0,0 +1,36 @@ +/// @ref gtx_scalar_relational +/// @file glm/gtx/scalar_relational.hpp +/// +/// @see core (dependence) +/// +/// @defgroup gtx_scalar_relational GLM_GTX_scalar_relational +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Extend a position from a source to a position at a defined length. + +#pragma once + +// Dependency: +#include "../glm.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_extend is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_extend extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_scalar_relational + /// @{ + + + + /// @} +}//namespace glm + +#include "scalar_relational.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/scalar_relational.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/scalar_relational.inl new file mode 100644 index 0000000000000000000000000000000000000000..03c00607f14a1201a41897c4441a12f44cd5dbb7 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/scalar_relational.inl @@ -0,0 +1,88 @@ +/// @ref gtx_scalar_relational + +namespace glm +{ + template + GLM_FUNC_QUALIFIER bool lessThan + ( + T const& x, + T const& y + ) + { + return x < y; + } + + template + GLM_FUNC_QUALIFIER bool lessThanEqual + ( + T const& x, + T const& y + ) + { + return x <= y; + } + + template + GLM_FUNC_QUALIFIER bool greaterThan + ( + T const& x, + T const& y + ) + { + return x > y; + } + + template + GLM_FUNC_QUALIFIER bool greaterThanEqual + ( + T const& x, + T const& y + ) + { + return x >= y; + } + + template + GLM_FUNC_QUALIFIER bool equal + ( + T const& x, + T const& y + ) + { + return detail::compute_equal::is_iec559>::call(x, y); + } + + template + GLM_FUNC_QUALIFIER bool notEqual + ( + T const& x, + T const& y + ) + { + return !detail::compute_equal::is_iec559>::call(x, y); + } + + GLM_FUNC_QUALIFIER bool any + ( + bool const& x + ) + { + return x; + } + + GLM_FUNC_QUALIFIER bool all + ( + bool const& x + ) + { + return x; + } + + GLM_FUNC_QUALIFIER bool not_ + ( + bool const& x + ) + { + return !x; + } +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/spline.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/spline.hpp new file mode 100644 index 0000000000000000000000000000000000000000..e88f72af42b06ac64f86d9d18d5483819b7b047f --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/spline.hpp @@ -0,0 +1,65 @@ +/// @ref gtx_spline +/// @file glm/gtx/spline.hpp +/// +/// @see core (dependence) +/// +/// @defgroup gtx_spline GLM_GTX_spline +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Spline functions + +#pragma once + +// Dependency: +#include "../glm.hpp" +#include "../gtx/optimum_pow.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_spline is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_spline extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_spline + /// @{ + + /// Return a point from a catmull rom curve. + /// @see gtx_spline extension. + template + GLM_FUNC_DECL genType catmullRom( + genType const& v1, + genType const& v2, + genType const& v3, + genType const& v4, + typename genType::value_type const& s); + + /// Return a point from a hermite curve. + /// @see gtx_spline extension. + template + GLM_FUNC_DECL genType hermite( + genType const& v1, + genType const& t1, + genType const& v2, + genType const& t2, + typename genType::value_type const& s); + + /// Return a point from a cubic curve. + /// @see gtx_spline extension. + template + GLM_FUNC_DECL genType cubic( + genType const& v1, + genType const& v2, + genType const& v3, + genType const& v4, + typename genType::value_type const& s); + + /// @} +}//namespace glm + +#include "spline.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/spline.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/spline.inl new file mode 100644 index 0000000000000000000000000000000000000000..30b780882e7c79b3e1e415d00ebf6f26bafd40da --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/spline.inl @@ -0,0 +1,60 @@ +/// @ref gtx_spline + +namespace glm +{ + template + GLM_FUNC_QUALIFIER genType catmullRom + ( + genType const& v1, + genType const& v2, + genType const& v3, + genType const& v4, + typename genType::value_type const& s + ) + { + typename genType::value_type s2 = pow2(s); + typename genType::value_type s3 = pow3(s); + + typename genType::value_type f1 = -s3 + typename genType::value_type(2) * s2 - s; + typename genType::value_type f2 = typename genType::value_type(3) * s3 - typename genType::value_type(5) * s2 + typename genType::value_type(2); + typename genType::value_type f3 = typename genType::value_type(-3) * s3 + typename genType::value_type(4) * s2 + s; + typename genType::value_type f4 = s3 - s2; + + return (f1 * v1 + f2 * v2 + f3 * v3 + f4 * v4) / typename genType::value_type(2); + + } + + template + GLM_FUNC_QUALIFIER genType hermite + ( + genType const& v1, + genType const& t1, + genType const& v2, + genType const& t2, + typename genType::value_type const& s + ) + { + typename genType::value_type s2 = pow2(s); + typename genType::value_type s3 = pow3(s); + + typename genType::value_type f1 = typename genType::value_type(2) * s3 - typename genType::value_type(3) * s2 + typename genType::value_type(1); + typename genType::value_type f2 = typename genType::value_type(-2) * s3 + typename genType::value_type(3) * s2; + typename genType::value_type f3 = s3 - typename genType::value_type(2) * s2 + s; + typename genType::value_type f4 = s3 - s2; + + return f1 * v1 + f2 * v2 + f3 * t1 + f4 * t2; + } + + template + GLM_FUNC_QUALIFIER genType cubic + ( + genType const& v1, + genType const& v2, + genType const& v3, + genType const& v4, + typename genType::value_type const& s + ) + { + return ((v1 * s + v2) * s + v3) * s + v4; + } +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/std_based_type.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/std_based_type.hpp new file mode 100644 index 0000000000000000000000000000000000000000..1c79e264cd2e295720ab44401704e045a96e578b --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/std_based_type.hpp @@ -0,0 +1,68 @@ +/// @ref gtx_std_based_type +/// @file glm/gtx/std_based_type.hpp +/// +/// @see core (dependence) +/// @see gtx_extented_min_max (dependence) +/// +/// @defgroup gtx_std_based_type GLM_GTX_std_based_type +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Adds vector types based on STL value types. + +#pragma once + +// Dependency: +#include "../glm.hpp" +#include + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_std_based_type is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_std_based_type extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_std_based_type + /// @{ + + /// Vector type based of one std::size_t component. + /// @see GLM_GTX_std_based_type + typedef vec<1, std::size_t, defaultp> size1; + + /// Vector type based of two std::size_t components. + /// @see GLM_GTX_std_based_type + typedef vec<2, std::size_t, defaultp> size2; + + /// Vector type based of three std::size_t components. + /// @see GLM_GTX_std_based_type + typedef vec<3, std::size_t, defaultp> size3; + + /// Vector type based of four std::size_t components. + /// @see GLM_GTX_std_based_type + typedef vec<4, std::size_t, defaultp> size4; + + /// Vector type based of one std::size_t component. + /// @see GLM_GTX_std_based_type + typedef vec<1, std::size_t, defaultp> size1_t; + + /// Vector type based of two std::size_t components. + /// @see GLM_GTX_std_based_type + typedef vec<2, std::size_t, defaultp> size2_t; + + /// Vector type based of three std::size_t components. + /// @see GLM_GTX_std_based_type + typedef vec<3, std::size_t, defaultp> size3_t; + + /// Vector type based of four std::size_t components. + /// @see GLM_GTX_std_based_type + typedef vec<4, std::size_t, defaultp> size4_t; + + /// @} +}//namespace glm + +#include "std_based_type.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/std_based_type.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/std_based_type.inl new file mode 100644 index 0000000000000000000000000000000000000000..0dc5695d5686e37b4969faff925c95e227cf5ee2 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/std_based_type.inl @@ -0,0 +1,6 @@ +/// @ref gtx_std_based_type + +namespace glm +{ + +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/string_cast.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/string_cast.hpp new file mode 100644 index 0000000000000000000000000000000000000000..607c477139ac86177be291612392d657811f9ddd --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/string_cast.hpp @@ -0,0 +1,46 @@ +/// @ref gtx_string_cast +/// @file glm/gtx/string_cast.hpp +/// +/// @see core (dependence) +/// @see gtx_integer (dependence) +/// @see gtx_quaternion (dependence) +/// +/// @defgroup gtx_string_cast GLM_GTX_string_cast +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Setup strings for GLM type values + +#pragma once + +// Dependency: +#include "../glm.hpp" +#include "../gtc/type_precision.hpp" +#include "../gtc/quaternion.hpp" +#include "../gtx/dual_quaternion.hpp" +#include +#include + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_string_cast is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_string_cast extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_string_cast + /// @{ + + /// Create a string from a GLM vector or matrix typed variable. + /// @see gtx_string_cast extension. + template + GLM_FUNC_DECL std::string to_string(genType const& x); + + /// @} +}//namespace glm + +#include "string_cast.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/string_cast.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/string_cast.inl new file mode 100644 index 0000000000000000000000000000000000000000..fddfe95282fc9fb808f6a1c4c62605624465c542 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/string_cast.inl @@ -0,0 +1,492 @@ +/// @ref gtx_string_cast + +#include +#include + +namespace glm{ +namespace detail +{ + template + struct cast + { + typedef T value_type; + }; + + template <> + struct cast + { + typedef double value_type; + }; + + GLM_FUNC_QUALIFIER std::string format(const char* msg, ...) + { + std::size_t const STRING_BUFFER(4096); + char text[STRING_BUFFER]; + va_list list; + + if(msg == GLM_NULLPTR) + return std::string(); + + va_start(list, msg); +# if (GLM_COMPILER & GLM_COMPILER_VC) + vsprintf_s(text, STRING_BUFFER, msg, list); +# else// + std::vsprintf(text, msg, list); +# endif// + va_end(list); + + return std::string(text); + } + + static const char* LabelTrue = "true"; + static const char* LabelFalse = "false"; + + template + struct literal + { + GLM_FUNC_QUALIFIER static char const * value() {return "%d";} + }; + + template + struct literal + { + GLM_FUNC_QUALIFIER static char const * value() {return "%f";} + }; + +# if GLM_MODEL == GLM_MODEL_32 && GLM_COMPILER && GLM_COMPILER_VC + template<> + struct literal + { + GLM_FUNC_QUALIFIER static char const * value() {return "%lld";} + }; + + template<> + struct literal + { + GLM_FUNC_QUALIFIER static char const * value() {return "%lld";} + }; +# endif//GLM_MODEL == GLM_MODEL_32 && GLM_COMPILER && GLM_COMPILER_VC + + template + struct prefix{}; + + template<> + struct prefix + { + GLM_FUNC_QUALIFIER static char const * value() {return "";} + }; + + template<> + struct prefix + { + GLM_FUNC_QUALIFIER static char const * value() {return "d";} + }; + + template<> + struct prefix + { + GLM_FUNC_QUALIFIER static char const * value() {return "b";} + }; + + template<> + struct prefix + { + GLM_FUNC_QUALIFIER static char const * value() {return "u8";} + }; + + template<> + struct prefix + { + GLM_FUNC_QUALIFIER static char const * value() {return "i8";} + }; + + template<> + struct prefix + { + GLM_FUNC_QUALIFIER static char const * value() {return "u16";} + }; + + template<> + struct prefix + { + GLM_FUNC_QUALIFIER static char const * value() {return "i16";} + }; + + template<> + struct prefix + { + GLM_FUNC_QUALIFIER static char const * value() {return "u";} + }; + + template<> + struct prefix + { + GLM_FUNC_QUALIFIER static char const * value() {return "i";} + }; + + template<> + struct prefix + { + GLM_FUNC_QUALIFIER static char const * value() {return "u64";} + }; + + template<> + struct prefix + { + GLM_FUNC_QUALIFIER static char const * value() {return "i64";} + }; + + template + struct compute_to_string + {}; + + template + struct compute_to_string > + { + GLM_FUNC_QUALIFIER static std::string call(vec<1, bool, Q> const& x) + { + return detail::format("bvec1(%s)", + x[0] ? detail::LabelTrue : detail::LabelFalse); + } + }; + + template + struct compute_to_string > + { + GLM_FUNC_QUALIFIER static std::string call(vec<2, bool, Q> const& x) + { + return detail::format("bvec2(%s, %s)", + x[0] ? detail::LabelTrue : detail::LabelFalse, + x[1] ? detail::LabelTrue : detail::LabelFalse); + } + }; + + template + struct compute_to_string > + { + GLM_FUNC_QUALIFIER static std::string call(vec<3, bool, Q> const& x) + { + return detail::format("bvec3(%s, %s, %s)", + x[0] ? detail::LabelTrue : detail::LabelFalse, + x[1] ? detail::LabelTrue : detail::LabelFalse, + x[2] ? detail::LabelTrue : detail::LabelFalse); + } + }; + + template + struct compute_to_string > + { + GLM_FUNC_QUALIFIER static std::string call(vec<4, bool, Q> const& x) + { + return detail::format("bvec4(%s, %s, %s, %s)", + x[0] ? detail::LabelTrue : detail::LabelFalse, + x[1] ? detail::LabelTrue : detail::LabelFalse, + x[2] ? detail::LabelTrue : detail::LabelFalse, + x[3] ? detail::LabelTrue : detail::LabelFalse); + } + }; + + template + struct compute_to_string > + { + GLM_FUNC_QUALIFIER static std::string call(vec<1, T, Q> const& x) + { + char const * PrefixStr = prefix::value(); + char const * LiteralStr = literal::is_iec559>::value(); + std::string FormatStr(detail::format("%svec1(%s)", + PrefixStr, + LiteralStr)); + + return detail::format(FormatStr.c_str(), + static_cast::value_type>(x[0])); + } + }; + + template + struct compute_to_string > + { + GLM_FUNC_QUALIFIER static std::string call(vec<2, T, Q> const& x) + { + char const * PrefixStr = prefix::value(); + char const * LiteralStr = literal::is_iec559>::value(); + std::string FormatStr(detail::format("%svec2(%s, %s)", + PrefixStr, + LiteralStr, LiteralStr)); + + return detail::format(FormatStr.c_str(), + static_cast::value_type>(x[0]), + static_cast::value_type>(x[1])); + } + }; + + template + struct compute_to_string > + { + GLM_FUNC_QUALIFIER static std::string call(vec<3, T, Q> const& x) + { + char const * PrefixStr = prefix::value(); + char const * LiteralStr = literal::is_iec559>::value(); + std::string FormatStr(detail::format("%svec3(%s, %s, %s)", + PrefixStr, + LiteralStr, LiteralStr, LiteralStr)); + + return detail::format(FormatStr.c_str(), + static_cast::value_type>(x[0]), + static_cast::value_type>(x[1]), + static_cast::value_type>(x[2])); + } + }; + + template + struct compute_to_string > + { + GLM_FUNC_QUALIFIER static std::string call(vec<4, T, Q> const& x) + { + char const * PrefixStr = prefix::value(); + char const * LiteralStr = literal::is_iec559>::value(); + std::string FormatStr(detail::format("%svec4(%s, %s, %s, %s)", + PrefixStr, + LiteralStr, LiteralStr, LiteralStr, LiteralStr)); + + return detail::format(FormatStr.c_str(), + static_cast::value_type>(x[0]), + static_cast::value_type>(x[1]), + static_cast::value_type>(x[2]), + static_cast::value_type>(x[3])); + } + }; + + + template + struct compute_to_string > + { + GLM_FUNC_QUALIFIER static std::string call(mat<2, 2, T, Q> const& x) + { + char const * PrefixStr = prefix::value(); + char const * LiteralStr = literal::is_iec559>::value(); + std::string FormatStr(detail::format("%smat2x2((%s, %s), (%s, %s))", + PrefixStr, + LiteralStr, LiteralStr, + LiteralStr, LiteralStr)); + + return detail::format(FormatStr.c_str(), + static_cast::value_type>(x[0][0]), static_cast::value_type>(x[0][1]), + static_cast::value_type>(x[1][0]), static_cast::value_type>(x[1][1])); + } + }; + + template + struct compute_to_string > + { + GLM_FUNC_QUALIFIER static std::string call(mat<2, 3, T, Q> const& x) + { + char const * PrefixStr = prefix::value(); + char const * LiteralStr = literal::is_iec559>::value(); + std::string FormatStr(detail::format("%smat2x3((%s, %s, %s), (%s, %s, %s))", + PrefixStr, + LiteralStr, LiteralStr, LiteralStr, + LiteralStr, LiteralStr, LiteralStr)); + + return detail::format(FormatStr.c_str(), + static_cast::value_type>(x[0][0]), static_cast::value_type>(x[0][1]), static_cast::value_type>(x[0][2]), + static_cast::value_type>(x[1][0]), static_cast::value_type>(x[1][1]), static_cast::value_type>(x[1][2])); + } + }; + + template + struct compute_to_string > + { + GLM_FUNC_QUALIFIER static std::string call(mat<2, 4, T, Q> const& x) + { + char const * PrefixStr = prefix::value(); + char const * LiteralStr = literal::is_iec559>::value(); + std::string FormatStr(detail::format("%smat2x4((%s, %s, %s, %s), (%s, %s, %s, %s))", + PrefixStr, + LiteralStr, LiteralStr, LiteralStr, LiteralStr, + LiteralStr, LiteralStr, LiteralStr, LiteralStr)); + + return detail::format(FormatStr.c_str(), + static_cast::value_type>(x[0][0]), static_cast::value_type>(x[0][1]), static_cast::value_type>(x[0][2]), static_cast::value_type>(x[0][3]), + static_cast::value_type>(x[1][0]), static_cast::value_type>(x[1][1]), static_cast::value_type>(x[1][2]), static_cast::value_type>(x[1][3])); + } + }; + + template + struct compute_to_string > + { + GLM_FUNC_QUALIFIER static std::string call(mat<3, 2, T, Q> const& x) + { + char const * PrefixStr = prefix::value(); + char const * LiteralStr = literal::is_iec559>::value(); + std::string FormatStr(detail::format("%smat3x2((%s, %s), (%s, %s), (%s, %s))", + PrefixStr, + LiteralStr, LiteralStr, + LiteralStr, LiteralStr, + LiteralStr, LiteralStr)); + + return detail::format(FormatStr.c_str(), + static_cast::value_type>(x[0][0]), static_cast::value_type>(x[0][1]), + static_cast::value_type>(x[1][0]), static_cast::value_type>(x[1][1]), + static_cast::value_type>(x[2][0]), static_cast::value_type>(x[2][1])); + } + }; + + template + struct compute_to_string > + { + GLM_FUNC_QUALIFIER static std::string call(mat<3, 3, T, Q> const& x) + { + char const * PrefixStr = prefix::value(); + char const * LiteralStr = literal::is_iec559>::value(); + std::string FormatStr(detail::format("%smat3x3((%s, %s, %s), (%s, %s, %s), (%s, %s, %s))", + PrefixStr, + LiteralStr, LiteralStr, LiteralStr, + LiteralStr, LiteralStr, LiteralStr, + LiteralStr, LiteralStr, LiteralStr)); + + return detail::format(FormatStr.c_str(), + static_cast::value_type>(x[0][0]), static_cast::value_type>(x[0][1]), static_cast::value_type>(x[0][2]), + static_cast::value_type>(x[1][0]), static_cast::value_type>(x[1][1]), static_cast::value_type>(x[1][2]), + static_cast::value_type>(x[2][0]), static_cast::value_type>(x[2][1]), static_cast::value_type>(x[2][2])); + } + }; + + template + struct compute_to_string > + { + GLM_FUNC_QUALIFIER static std::string call(mat<3, 4, T, Q> const& x) + { + char const * PrefixStr = prefix::value(); + char const * LiteralStr = literal::is_iec559>::value(); + std::string FormatStr(detail::format("%smat3x4((%s, %s, %s, %s), (%s, %s, %s, %s), (%s, %s, %s, %s))", + PrefixStr, + LiteralStr, LiteralStr, LiteralStr, LiteralStr, + LiteralStr, LiteralStr, LiteralStr, LiteralStr, + LiteralStr, LiteralStr, LiteralStr, LiteralStr)); + + return detail::format(FormatStr.c_str(), + static_cast::value_type>(x[0][0]), static_cast::value_type>(x[0][1]), static_cast::value_type>(x[0][2]), static_cast::value_type>(x[0][3]), + static_cast::value_type>(x[1][0]), static_cast::value_type>(x[1][1]), static_cast::value_type>(x[1][2]), static_cast::value_type>(x[1][3]), + static_cast::value_type>(x[2][0]), static_cast::value_type>(x[2][1]), static_cast::value_type>(x[2][2]), static_cast::value_type>(x[2][3])); + } + }; + + template + struct compute_to_string > + { + GLM_FUNC_QUALIFIER static std::string call(mat<4, 2, T, Q> const& x) + { + char const * PrefixStr = prefix::value(); + char const * LiteralStr = literal::is_iec559>::value(); + std::string FormatStr(detail::format("%smat4x2((%s, %s), (%s, %s), (%s, %s), (%s, %s))", + PrefixStr, + LiteralStr, LiteralStr, + LiteralStr, LiteralStr, + LiteralStr, LiteralStr, + LiteralStr, LiteralStr)); + + return detail::format(FormatStr.c_str(), + static_cast::value_type>(x[0][0]), static_cast::value_type>(x[0][1]), + static_cast::value_type>(x[1][0]), static_cast::value_type>(x[1][1]), + static_cast::value_type>(x[2][0]), static_cast::value_type>(x[2][1]), + static_cast::value_type>(x[3][0]), static_cast::value_type>(x[3][1])); + } + }; + + template + struct compute_to_string > + { + GLM_FUNC_QUALIFIER static std::string call(mat<4, 3, T, Q> const& x) + { + char const * PrefixStr = prefix::value(); + char const * LiteralStr = literal::is_iec559>::value(); + std::string FormatStr(detail::format("%smat4x3((%s, %s, %s), (%s, %s, %s), (%s, %s, %s), (%s, %s, %s))", + PrefixStr, + LiteralStr, LiteralStr, LiteralStr, + LiteralStr, LiteralStr, LiteralStr, + LiteralStr, LiteralStr, LiteralStr, + LiteralStr, LiteralStr, LiteralStr)); + + return detail::format(FormatStr.c_str(), + static_cast::value_type>(x[0][0]), static_cast::value_type>(x[0][1]), static_cast::value_type>(x[0][2]), + static_cast::value_type>(x[1][0]), static_cast::value_type>(x[1][1]), static_cast::value_type>(x[1][2]), + static_cast::value_type>(x[2][0]), static_cast::value_type>(x[2][1]), static_cast::value_type>(x[2][2]), + static_cast::value_type>(x[3][0]), static_cast::value_type>(x[3][1]), static_cast::value_type>(x[3][2])); + } + }; + + template + struct compute_to_string > + { + GLM_FUNC_QUALIFIER static std::string call(mat<4, 4, T, Q> const& x) + { + char const * PrefixStr = prefix::value(); + char const * LiteralStr = literal::is_iec559>::value(); + std::string FormatStr(detail::format("%smat4x4((%s, %s, %s, %s), (%s, %s, %s, %s), (%s, %s, %s, %s), (%s, %s, %s, %s))", + PrefixStr, + LiteralStr, LiteralStr, LiteralStr, LiteralStr, + LiteralStr, LiteralStr, LiteralStr, LiteralStr, + LiteralStr, LiteralStr, LiteralStr, LiteralStr, + LiteralStr, LiteralStr, LiteralStr, LiteralStr)); + + return detail::format(FormatStr.c_str(), + static_cast::value_type>(x[0][0]), static_cast::value_type>(x[0][1]), static_cast::value_type>(x[0][2]), static_cast::value_type>(x[0][3]), + static_cast::value_type>(x[1][0]), static_cast::value_type>(x[1][1]), static_cast::value_type>(x[1][2]), static_cast::value_type>(x[1][3]), + static_cast::value_type>(x[2][0]), static_cast::value_type>(x[2][1]), static_cast::value_type>(x[2][2]), static_cast::value_type>(x[2][3]), + static_cast::value_type>(x[3][0]), static_cast::value_type>(x[3][1]), static_cast::value_type>(x[3][2]), static_cast::value_type>(x[3][3])); + } + }; + + + template + struct compute_to_string > + { + GLM_FUNC_QUALIFIER static std::string call(qua const& q) + { + char const * PrefixStr = prefix::value(); + char const * LiteralStr = literal::is_iec559>::value(); + std::string FormatStr(detail::format("%squat(%s, {%s, %s, %s})", + PrefixStr, + LiteralStr, LiteralStr, LiteralStr, LiteralStr)); + + return detail::format(FormatStr.c_str(), + static_cast::value_type>(q.w), + static_cast::value_type>(q.x), + static_cast::value_type>(q.y), + static_cast::value_type>(q.z)); + } + }; + + template + struct compute_to_string > + { + GLM_FUNC_QUALIFIER static std::string call(tdualquat const& x) + { + char const * PrefixStr = prefix::value(); + char const * LiteralStr = literal::is_iec559>::value(); + std::string FormatStr(detail::format("%sdualquat((%s, {%s, %s, %s}), (%s, {%s, %s, %s}))", + PrefixStr, + LiteralStr, LiteralStr, LiteralStr, LiteralStr, + LiteralStr, LiteralStr, LiteralStr, LiteralStr)); + + return detail::format(FormatStr.c_str(), + static_cast::value_type>(x.real.w), + static_cast::value_type>(x.real.x), + static_cast::value_type>(x.real.y), + static_cast::value_type>(x.real.z), + static_cast::value_type>(x.dual.w), + static_cast::value_type>(x.dual.x), + static_cast::value_type>(x.dual.y), + static_cast::value_type>(x.dual.z)); + } + }; + +}//namespace detail + +template +GLM_FUNC_QUALIFIER std::string to_string(matType const& x) +{ + return detail::compute_to_string::call(x); +} + +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/texture.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/texture.hpp new file mode 100644 index 0000000000000000000000000000000000000000..a9f9ccb164f702d504fbc7d00a44c74c758e797a --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/texture.hpp @@ -0,0 +1,46 @@ +/// @ref gtx_texture +/// @file glm/gtx/texture.hpp +/// +/// @see core (dependence) +/// +/// @defgroup gtx_texture GLM_GTX_texture +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Wrapping mode of texture coordinates. + +#pragma once + +// Dependency: +#include "../glm.hpp" +#include "../gtc/integer.hpp" +#include "../gtx/component_wise.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_texture is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_texture extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_texture + /// @{ + + /// Compute the number of mipmaps levels necessary to create a mipmap complete texture + /// + /// @param Extent Extent of the texture base level mipmap + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point or signed integer scalar types + /// @tparam Q Value from qualifier enum + template + T levels(vec const& Extent); + + /// @} +}// namespace glm + +#include "texture.inl" + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/texture.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/texture.inl new file mode 100644 index 0000000000000000000000000000000000000000..f4992a1691be60ec15178c402f857945ba5f9f1c --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/texture.inl @@ -0,0 +1,17 @@ +/// @ref gtx_texture + +namespace glm +{ + template + inline T levels(vec const& Extent) + { + return glm::log2(compMax(Extent)) + static_cast(1); + } + + template + inline T levels(T Extent) + { + return vec<1, T, defaultp>(Extent).x; + } +}//namespace glm + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/transform.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/transform.hpp new file mode 100644 index 0000000000000000000000000000000000000000..a235a2de097b809e6880f11f127fc4b6c097165f --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/transform.hpp @@ -0,0 +1,60 @@ +/// @ref gtx_transform +/// @file glm/gtx/transform.hpp +/// +/// @see core (dependence) +/// @see gtc_matrix_transform (dependence) +/// @see gtx_transform +/// @see gtx_transform2 +/// +/// @defgroup gtx_transform GLM_GTX_transform +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Add transformation matrices + +#pragma once + +// Dependency: +#include "../glm.hpp" +#include "../gtc/matrix_transform.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_transform is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_transform extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_transform + /// @{ + + /// Transforms a matrix with a translation 4 * 4 matrix created from 3 scalars. + /// @see gtc_matrix_transform + /// @see gtx_transform + template + GLM_FUNC_DECL mat<4, 4, T, Q> translate( + vec<3, T, Q> const& v); + + /// Builds a rotation 4 * 4 matrix created from an axis of 3 scalars and an angle expressed in radians. + /// @see gtc_matrix_transform + /// @see gtx_transform + template + GLM_FUNC_DECL mat<4, 4, T, Q> rotate( + T angle, + vec<3, T, Q> const& v); + + /// Transforms a matrix with a scale 4 * 4 matrix created from a vector of 3 components. + /// @see gtc_matrix_transform + /// @see gtx_transform + template + GLM_FUNC_DECL mat<4, 4, T, Q> scale( + vec<3, T, Q> const& v); + + /// @} +}// namespace glm + +#include "transform.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/transform.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/transform.inl new file mode 100644 index 0000000000000000000000000000000000000000..24361e28d095349d095acd77cf6c3cd61c4e35b8 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/transform.inl @@ -0,0 +1,23 @@ +/// @ref gtx_transform + +namespace glm +{ + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> translate(vec<3, T, Q> const& v) + { + return translate(mat<4, 4, T, Q>(static_cast(1)), v); + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> rotate(T angle, vec<3, T, Q> const& v) + { + return rotate(mat<4, 4, T, Q>(static_cast(1)), angle, v); + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> scale(vec<3, T, Q> const& v) + { + return scale(mat<4, 4, T, Q>(static_cast(1)), v); + } + +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/transform2.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/transform2.hpp new file mode 100644 index 0000000000000000000000000000000000000000..8bbaa2766e41b38a31530851a7334fc8f8c135a5 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/transform2.hpp @@ -0,0 +1,89 @@ +/// @ref gtx_transform2 +/// @file glm/gtx/transform2.hpp +/// +/// @see core (dependence) +/// @see gtx_transform (dependence) +/// +/// @defgroup gtx_transform2 GLM_GTX_transform2 +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Add extra transformation matrices + +#pragma once + +// Dependency: +#include "../glm.hpp" +#include "../gtx/transform.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_transform2 is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_transform2 extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_transform2 + /// @{ + + //! Transforms a matrix with a shearing on X axis. + //! From GLM_GTX_transform2 extension. + template + GLM_FUNC_DECL mat<3, 3, T, Q> shearX2D(mat<3, 3, T, Q> const& m, T y); + + //! Transforms a matrix with a shearing on Y axis. + //! From GLM_GTX_transform2 extension. + template + GLM_FUNC_DECL mat<3, 3, T, Q> shearY2D(mat<3, 3, T, Q> const& m, T x); + + //! Transforms a matrix with a shearing on X axis + //! From GLM_GTX_transform2 extension. + template + GLM_FUNC_DECL mat<4, 4, T, Q> shearX3D(mat<4, 4, T, Q> const& m, T y, T z); + + //! Transforms a matrix with a shearing on Y axis. + //! From GLM_GTX_transform2 extension. + template + GLM_FUNC_DECL mat<4, 4, T, Q> shearY3D(mat<4, 4, T, Q> const& m, T x, T z); + + //! Transforms a matrix with a shearing on Z axis. + //! From GLM_GTX_transform2 extension. + template + GLM_FUNC_DECL mat<4, 4, T, Q> shearZ3D(mat<4, 4, T, Q> const& m, T x, T y); + + //template GLM_FUNC_QUALIFIER mat<4, 4, T, Q> shear(const mat<4, 4, T, Q> & m, shearPlane, planePoint, angle) + // Identity + tan(angle) * cross(Normal, OnPlaneVector) 0 + // - dot(PointOnPlane, normal) * OnPlaneVector 1 + + // Reflect functions seem to don't work + //template mat<3, 3, T, Q> reflect2D(const mat<3, 3, T, Q> & m, const vec<3, T, Q>& normal){return reflect2DGTX(m, normal);} //!< \brief Build a reflection matrix (from GLM_GTX_transform2 extension) + //template mat<4, 4, T, Q> reflect3D(const mat<4, 4, T, Q> & m, const vec<3, T, Q>& normal){return reflect3DGTX(m, normal);} //!< \brief Build a reflection matrix (from GLM_GTX_transform2 extension) + + //! Build planar projection matrix along normal axis. + //! From GLM_GTX_transform2 extension. + template + GLM_FUNC_DECL mat<3, 3, T, Q> proj2D(mat<3, 3, T, Q> const& m, vec<3, T, Q> const& normal); + + //! Build planar projection matrix along normal axis. + //! From GLM_GTX_transform2 extension. + template + GLM_FUNC_DECL mat<4, 4, T, Q> proj3D(mat<4, 4, T, Q> const & m, vec<3, T, Q> const& normal); + + //! Build a scale bias matrix. + //! From GLM_GTX_transform2 extension. + template + GLM_FUNC_DECL mat<4, 4, T, Q> scaleBias(T scale, T bias); + + //! Build a scale bias matrix. + //! From GLM_GTX_transform2 extension. + template + GLM_FUNC_DECL mat<4, 4, T, Q> scaleBias(mat<4, 4, T, Q> const& m, T scale, T bias); + + /// @} +}// namespace glm + +#include "transform2.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/transform2.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/transform2.inl new file mode 100644 index 0000000000000000000000000000000000000000..6523872dc2bf85720bc569b3b90f0c895bea06a8 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/transform2.inl @@ -0,0 +1,125 @@ +/// @ref gtx_transform2 + +namespace glm +{ + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> shearX2D(mat<3, 3, T, Q> const& m, T s) + { + mat<3, 3, T, Q> r(1); + r[1][0] = s; + return m * r; + } + + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> shearY2D(mat<3, 3, T, Q> const& m, T s) + { + mat<3, 3, T, Q> r(1); + r[0][1] = s; + return m * r; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> shearX3D(mat<4, 4, T, Q> const& m, T s, T t) + { + mat<4, 4, T, Q> r(1); + r[0][1] = s; + r[0][2] = t; + return m * r; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> shearY3D(mat<4, 4, T, Q> const& m, T s, T t) + { + mat<4, 4, T, Q> r(1); + r[1][0] = s; + r[1][2] = t; + return m * r; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> shearZ3D(mat<4, 4, T, Q> const& m, T s, T t) + { + mat<4, 4, T, Q> r(1); + r[2][0] = s; + r[2][1] = t; + return m * r; + } + + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> reflect2D(mat<3, 3, T, Q> const& m, vec<3, T, Q> const& normal) + { + mat<3, 3, T, Q> r(static_cast(1)); + r[0][0] = static_cast(1) - static_cast(2) * normal.x * normal.x; + r[0][1] = -static_cast(2) * normal.x * normal.y; + r[1][0] = -static_cast(2) * normal.x * normal.y; + r[1][1] = static_cast(1) - static_cast(2) * normal.y * normal.y; + return m * r; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> reflect3D(mat<4, 4, T, Q> const& m, vec<3, T, Q> const& normal) + { + mat<4, 4, T, Q> r(static_cast(1)); + r[0][0] = static_cast(1) - static_cast(2) * normal.x * normal.x; + r[0][1] = -static_cast(2) * normal.x * normal.y; + r[0][2] = -static_cast(2) * normal.x * normal.z; + + r[1][0] = -static_cast(2) * normal.x * normal.y; + r[1][1] = static_cast(1) - static_cast(2) * normal.y * normal.y; + r[1][2] = -static_cast(2) * normal.y * normal.z; + + r[2][0] = -static_cast(2) * normal.x * normal.z; + r[2][1] = -static_cast(2) * normal.y * normal.z; + r[2][2] = static_cast(1) - static_cast(2) * normal.z * normal.z; + return m * r; + } + + template + GLM_FUNC_QUALIFIER mat<3, 3, T, Q> proj2D( + const mat<3, 3, T, Q>& m, + const vec<3, T, Q>& normal) + { + mat<3, 3, T, Q> r(static_cast(1)); + r[0][0] = static_cast(1) - normal.x * normal.x; + r[0][1] = - normal.x * normal.y; + r[1][0] = - normal.x * normal.y; + r[1][1] = static_cast(1) - normal.y * normal.y; + return m * r; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> proj3D( + const mat<4, 4, T, Q>& m, + const vec<3, T, Q>& normal) + { + mat<4, 4, T, Q> r(static_cast(1)); + r[0][0] = static_cast(1) - normal.x * normal.x; + r[0][1] = - normal.x * normal.y; + r[0][2] = - normal.x * normal.z; + r[1][0] = - normal.x * normal.y; + r[1][1] = static_cast(1) - normal.y * normal.y; + r[1][2] = - normal.y * normal.z; + r[2][0] = - normal.x * normal.z; + r[2][1] = - normal.y * normal.z; + r[2][2] = static_cast(1) - normal.z * normal.z; + return m * r; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> scaleBias(T scale, T bias) + { + mat<4, 4, T, Q> result; + result[3] = vec<4, T, Q>(vec<3, T, Q>(bias), static_cast(1)); + result[0][0] = scale; + result[1][1] = scale; + result[2][2] = scale; + return result; + } + + template + GLM_FUNC_QUALIFIER mat<4, 4, T, Q> scaleBias(mat<4, 4, T, Q> const& m, T scale, T bias) + { + return m * scaleBias(scale, bias); + } +}//namespace glm + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/type_aligned.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/type_aligned.hpp new file mode 100644 index 0000000000000000000000000000000000000000..12ce8cfd240f474785e104e25e9cdcd30b4fb8d9 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/type_aligned.hpp @@ -0,0 +1,982 @@ +/// @ref gtx_type_aligned +/// @file glm/gtx/type_aligned.hpp +/// +/// @see core (dependence) +/// @see gtc_quaternion (dependence) +/// +/// @defgroup gtx_type_aligned GLM_GTX_type_aligned +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Defines aligned types. + +#pragma once + +// Dependency: +#include "../gtc/type_precision.hpp" +#include "../gtc/quaternion.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_type_aligned is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_type_aligned extension included") +# endif +#endif + +namespace glm +{ + /////////////////////////// + // Signed int vector types + + /// @addtogroup gtx_type_aligned + /// @{ + + /// Low qualifier 8 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(lowp_int8, aligned_lowp_int8, 1); + + /// Low qualifier 16 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(lowp_int16, aligned_lowp_int16, 2); + + /// Low qualifier 32 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(lowp_int32, aligned_lowp_int32, 4); + + /// Low qualifier 64 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(lowp_int64, aligned_lowp_int64, 8); + + + /// Low qualifier 8 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(lowp_int8_t, aligned_lowp_int8_t, 1); + + /// Low qualifier 16 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(lowp_int16_t, aligned_lowp_int16_t, 2); + + /// Low qualifier 32 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(lowp_int32_t, aligned_lowp_int32_t, 4); + + /// Low qualifier 64 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(lowp_int64_t, aligned_lowp_int64_t, 8); + + + /// Low qualifier 8 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(lowp_i8, aligned_lowp_i8, 1); + + /// Low qualifier 16 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(lowp_i16, aligned_lowp_i16, 2); + + /// Low qualifier 32 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(lowp_i32, aligned_lowp_i32, 4); + + /// Low qualifier 64 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(lowp_i64, aligned_lowp_i64, 8); + + + /// Medium qualifier 8 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(mediump_int8, aligned_mediump_int8, 1); + + /// Medium qualifier 16 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(mediump_int16, aligned_mediump_int16, 2); + + /// Medium qualifier 32 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(mediump_int32, aligned_mediump_int32, 4); + + /// Medium qualifier 64 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(mediump_int64, aligned_mediump_int64, 8); + + + /// Medium qualifier 8 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(mediump_int8_t, aligned_mediump_int8_t, 1); + + /// Medium qualifier 16 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(mediump_int16_t, aligned_mediump_int16_t, 2); + + /// Medium qualifier 32 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(mediump_int32_t, aligned_mediump_int32_t, 4); + + /// Medium qualifier 64 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(mediump_int64_t, aligned_mediump_int64_t, 8); + + + /// Medium qualifier 8 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(mediump_i8, aligned_mediump_i8, 1); + + /// Medium qualifier 16 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(mediump_i16, aligned_mediump_i16, 2); + + /// Medium qualifier 32 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(mediump_i32, aligned_mediump_i32, 4); + + /// Medium qualifier 64 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(mediump_i64, aligned_mediump_i64, 8); + + + /// High qualifier 8 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(highp_int8, aligned_highp_int8, 1); + + /// High qualifier 16 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(highp_int16, aligned_highp_int16, 2); + + /// High qualifier 32 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(highp_int32, aligned_highp_int32, 4); + + /// High qualifier 64 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(highp_int64, aligned_highp_int64, 8); + + + /// High qualifier 8 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(highp_int8_t, aligned_highp_int8_t, 1); + + /// High qualifier 16 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(highp_int16_t, aligned_highp_int16_t, 2); + + /// High qualifier 32 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(highp_int32_t, aligned_highp_int32_t, 4); + + /// High qualifier 64 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(highp_int64_t, aligned_highp_int64_t, 8); + + + /// High qualifier 8 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(highp_i8, aligned_highp_i8, 1); + + /// High qualifier 16 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(highp_i16, aligned_highp_i16, 2); + + /// High qualifier 32 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(highp_i32, aligned_highp_i32, 4); + + /// High qualifier 64 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(highp_i64, aligned_highp_i64, 8); + + + /// Default qualifier 8 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(int8, aligned_int8, 1); + + /// Default qualifier 16 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(int16, aligned_int16, 2); + + /// Default qualifier 32 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(int32, aligned_int32, 4); + + /// Default qualifier 64 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(int64, aligned_int64, 8); + + + /// Default qualifier 8 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(int8_t, aligned_int8_t, 1); + + /// Default qualifier 16 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(int16_t, aligned_int16_t, 2); + + /// Default qualifier 32 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(int32_t, aligned_int32_t, 4); + + /// Default qualifier 64 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(int64_t, aligned_int64_t, 8); + + + /// Default qualifier 8 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(i8, aligned_i8, 1); + + /// Default qualifier 16 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(i16, aligned_i16, 2); + + /// Default qualifier 32 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(i32, aligned_i32, 4); + + /// Default qualifier 64 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(i64, aligned_i64, 8); + + + /// Default qualifier 32 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(ivec1, aligned_ivec1, 4); + + /// Default qualifier 32 bit signed integer aligned vector of 2 components type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(ivec2, aligned_ivec2, 8); + + /// Default qualifier 32 bit signed integer aligned vector of 3 components type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(ivec3, aligned_ivec3, 16); + + /// Default qualifier 32 bit signed integer aligned vector of 4 components type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(ivec4, aligned_ivec4, 16); + + + /// Default qualifier 8 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(i8vec1, aligned_i8vec1, 1); + + /// Default qualifier 8 bit signed integer aligned vector of 2 components type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(i8vec2, aligned_i8vec2, 2); + + /// Default qualifier 8 bit signed integer aligned vector of 3 components type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(i8vec3, aligned_i8vec3, 4); + + /// Default qualifier 8 bit signed integer aligned vector of 4 components type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(i8vec4, aligned_i8vec4, 4); + + + /// Default qualifier 16 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(i16vec1, aligned_i16vec1, 2); + + /// Default qualifier 16 bit signed integer aligned vector of 2 components type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(i16vec2, aligned_i16vec2, 4); + + /// Default qualifier 16 bit signed integer aligned vector of 3 components type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(i16vec3, aligned_i16vec3, 8); + + /// Default qualifier 16 bit signed integer aligned vector of 4 components type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(i16vec4, aligned_i16vec4, 8); + + + /// Default qualifier 32 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(i32vec1, aligned_i32vec1, 4); + + /// Default qualifier 32 bit signed integer aligned vector of 2 components type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(i32vec2, aligned_i32vec2, 8); + + /// Default qualifier 32 bit signed integer aligned vector of 3 components type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(i32vec3, aligned_i32vec3, 16); + + /// Default qualifier 32 bit signed integer aligned vector of 4 components type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(i32vec4, aligned_i32vec4, 16); + + + /// Default qualifier 64 bit signed integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(i64vec1, aligned_i64vec1, 8); + + /// Default qualifier 64 bit signed integer aligned vector of 2 components type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(i64vec2, aligned_i64vec2, 16); + + /// Default qualifier 64 bit signed integer aligned vector of 3 components type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(i64vec3, aligned_i64vec3, 32); + + /// Default qualifier 64 bit signed integer aligned vector of 4 components type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(i64vec4, aligned_i64vec4, 32); + + + ///////////////////////////// + // Unsigned int vector types + + /// Low qualifier 8 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(lowp_uint8, aligned_lowp_uint8, 1); + + /// Low qualifier 16 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(lowp_uint16, aligned_lowp_uint16, 2); + + /// Low qualifier 32 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(lowp_uint32, aligned_lowp_uint32, 4); + + /// Low qualifier 64 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(lowp_uint64, aligned_lowp_uint64, 8); + + + /// Low qualifier 8 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(lowp_uint8_t, aligned_lowp_uint8_t, 1); + + /// Low qualifier 16 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(lowp_uint16_t, aligned_lowp_uint16_t, 2); + + /// Low qualifier 32 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(lowp_uint32_t, aligned_lowp_uint32_t, 4); + + /// Low qualifier 64 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(lowp_uint64_t, aligned_lowp_uint64_t, 8); + + + /// Low qualifier 8 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(lowp_u8, aligned_lowp_u8, 1); + + /// Low qualifier 16 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(lowp_u16, aligned_lowp_u16, 2); + + /// Low qualifier 32 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(lowp_u32, aligned_lowp_u32, 4); + + /// Low qualifier 64 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(lowp_u64, aligned_lowp_u64, 8); + + + /// Medium qualifier 8 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(mediump_uint8, aligned_mediump_uint8, 1); + + /// Medium qualifier 16 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(mediump_uint16, aligned_mediump_uint16, 2); + + /// Medium qualifier 32 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(mediump_uint32, aligned_mediump_uint32, 4); + + /// Medium qualifier 64 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(mediump_uint64, aligned_mediump_uint64, 8); + + + /// Medium qualifier 8 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(mediump_uint8_t, aligned_mediump_uint8_t, 1); + + /// Medium qualifier 16 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(mediump_uint16_t, aligned_mediump_uint16_t, 2); + + /// Medium qualifier 32 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(mediump_uint32_t, aligned_mediump_uint32_t, 4); + + /// Medium qualifier 64 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(mediump_uint64_t, aligned_mediump_uint64_t, 8); + + + /// Medium qualifier 8 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(mediump_u8, aligned_mediump_u8, 1); + + /// Medium qualifier 16 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(mediump_u16, aligned_mediump_u16, 2); + + /// Medium qualifier 32 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(mediump_u32, aligned_mediump_u32, 4); + + /// Medium qualifier 64 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(mediump_u64, aligned_mediump_u64, 8); + + + /// High qualifier 8 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(highp_uint8, aligned_highp_uint8, 1); + + /// High qualifier 16 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(highp_uint16, aligned_highp_uint16, 2); + + /// High qualifier 32 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(highp_uint32, aligned_highp_uint32, 4); + + /// High qualifier 64 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(highp_uint64, aligned_highp_uint64, 8); + + + /// High qualifier 8 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(highp_uint8_t, aligned_highp_uint8_t, 1); + + /// High qualifier 16 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(highp_uint16_t, aligned_highp_uint16_t, 2); + + /// High qualifier 32 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(highp_uint32_t, aligned_highp_uint32_t, 4); + + /// High qualifier 64 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(highp_uint64_t, aligned_highp_uint64_t, 8); + + + /// High qualifier 8 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(highp_u8, aligned_highp_u8, 1); + + /// High qualifier 16 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(highp_u16, aligned_highp_u16, 2); + + /// High qualifier 32 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(highp_u32, aligned_highp_u32, 4); + + /// High qualifier 64 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(highp_u64, aligned_highp_u64, 8); + + + /// Default qualifier 8 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(uint8, aligned_uint8, 1); + + /// Default qualifier 16 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(uint16, aligned_uint16, 2); + + /// Default qualifier 32 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(uint32, aligned_uint32, 4); + + /// Default qualifier 64 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(uint64, aligned_uint64, 8); + + + /// Default qualifier 8 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(uint8_t, aligned_uint8_t, 1); + + /// Default qualifier 16 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(uint16_t, aligned_uint16_t, 2); + + /// Default qualifier 32 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(uint32_t, aligned_uint32_t, 4); + + /// Default qualifier 64 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(uint64_t, aligned_uint64_t, 8); + + + /// Default qualifier 8 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(u8, aligned_u8, 1); + + /// Default qualifier 16 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(u16, aligned_u16, 2); + + /// Default qualifier 32 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(u32, aligned_u32, 4); + + /// Default qualifier 64 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(u64, aligned_u64, 8); + + + /// Default qualifier 32 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(uvec1, aligned_uvec1, 4); + + /// Default qualifier 32 bit unsigned integer aligned vector of 2 components type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(uvec2, aligned_uvec2, 8); + + /// Default qualifier 32 bit unsigned integer aligned vector of 3 components type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(uvec3, aligned_uvec3, 16); + + /// Default qualifier 32 bit unsigned integer aligned vector of 4 components type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(uvec4, aligned_uvec4, 16); + + + /// Default qualifier 8 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(u8vec1, aligned_u8vec1, 1); + + /// Default qualifier 8 bit unsigned integer aligned vector of 2 components type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(u8vec2, aligned_u8vec2, 2); + + /// Default qualifier 8 bit unsigned integer aligned vector of 3 components type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(u8vec3, aligned_u8vec3, 4); + + /// Default qualifier 8 bit unsigned integer aligned vector of 4 components type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(u8vec4, aligned_u8vec4, 4); + + + /// Default qualifier 16 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(u16vec1, aligned_u16vec1, 2); + + /// Default qualifier 16 bit unsigned integer aligned vector of 2 components type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(u16vec2, aligned_u16vec2, 4); + + /// Default qualifier 16 bit unsigned integer aligned vector of 3 components type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(u16vec3, aligned_u16vec3, 8); + + /// Default qualifier 16 bit unsigned integer aligned vector of 4 components type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(u16vec4, aligned_u16vec4, 8); + + + /// Default qualifier 32 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(u32vec1, aligned_u32vec1, 4); + + /// Default qualifier 32 bit unsigned integer aligned vector of 2 components type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(u32vec2, aligned_u32vec2, 8); + + /// Default qualifier 32 bit unsigned integer aligned vector of 3 components type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(u32vec3, aligned_u32vec3, 16); + + /// Default qualifier 32 bit unsigned integer aligned vector of 4 components type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(u32vec4, aligned_u32vec4, 16); + + + /// Default qualifier 64 bit unsigned integer aligned scalar type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(u64vec1, aligned_u64vec1, 8); + + /// Default qualifier 64 bit unsigned integer aligned vector of 2 components type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(u64vec2, aligned_u64vec2, 16); + + /// Default qualifier 64 bit unsigned integer aligned vector of 3 components type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(u64vec3, aligned_u64vec3, 32); + + /// Default qualifier 64 bit unsigned integer aligned vector of 4 components type. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(u64vec4, aligned_u64vec4, 32); + + + ////////////////////// + // Float vector types + + /// 32 bit single-qualifier floating-point aligned scalar. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(float32, aligned_float32, 4); + + /// 32 bit single-qualifier floating-point aligned scalar. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(float32_t, aligned_float32_t, 4); + + /// 32 bit single-qualifier floating-point aligned scalar. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(float32, aligned_f32, 4); + +# ifndef GLM_FORCE_SINGLE_ONLY + + /// 64 bit double-qualifier floating-point aligned scalar. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(float64, aligned_float64, 8); + + /// 64 bit double-qualifier floating-point aligned scalar. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(float64_t, aligned_float64_t, 8); + + /// 64 bit double-qualifier floating-point aligned scalar. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(float64, aligned_f64, 8); + +# endif//GLM_FORCE_SINGLE_ONLY + + + /// Single-qualifier floating-point aligned vector of 1 component. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(vec1, aligned_vec1, 4); + + /// Single-qualifier floating-point aligned vector of 2 components. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(vec2, aligned_vec2, 8); + + /// Single-qualifier floating-point aligned vector of 3 components. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(vec3, aligned_vec3, 16); + + /// Single-qualifier floating-point aligned vector of 4 components. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(vec4, aligned_vec4, 16); + + + /// Single-qualifier floating-point aligned vector of 1 component. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(fvec1, aligned_fvec1, 4); + + /// Single-qualifier floating-point aligned vector of 2 components. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(fvec2, aligned_fvec2, 8); + + /// Single-qualifier floating-point aligned vector of 3 components. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(fvec3, aligned_fvec3, 16); + + /// Single-qualifier floating-point aligned vector of 4 components. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(fvec4, aligned_fvec4, 16); + + + /// Single-qualifier floating-point aligned vector of 1 component. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(f32vec1, aligned_f32vec1, 4); + + /// Single-qualifier floating-point aligned vector of 2 components. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(f32vec2, aligned_f32vec2, 8); + + /// Single-qualifier floating-point aligned vector of 3 components. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(f32vec3, aligned_f32vec3, 16); + + /// Single-qualifier floating-point aligned vector of 4 components. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(f32vec4, aligned_f32vec4, 16); + + + /// Double-qualifier floating-point aligned vector of 1 component. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(dvec1, aligned_dvec1, 8); + + /// Double-qualifier floating-point aligned vector of 2 components. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(dvec2, aligned_dvec2, 16); + + /// Double-qualifier floating-point aligned vector of 3 components. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(dvec3, aligned_dvec3, 32); + + /// Double-qualifier floating-point aligned vector of 4 components. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(dvec4, aligned_dvec4, 32); + + +# ifndef GLM_FORCE_SINGLE_ONLY + + /// Double-qualifier floating-point aligned vector of 1 component. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(f64vec1, aligned_f64vec1, 8); + + /// Double-qualifier floating-point aligned vector of 2 components. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(f64vec2, aligned_f64vec2, 16); + + /// Double-qualifier floating-point aligned vector of 3 components. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(f64vec3, aligned_f64vec3, 32); + + /// Double-qualifier floating-point aligned vector of 4 components. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(f64vec4, aligned_f64vec4, 32); + +# endif//GLM_FORCE_SINGLE_ONLY + + ////////////////////// + // Float matrix types + + /// Single-qualifier floating-point aligned 1x1 matrix. + /// @see gtx_type_aligned + //typedef detail::tmat1 mat1; + + /// Single-qualifier floating-point aligned 2x2 matrix. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(mat2, aligned_mat2, 16); + + /// Single-qualifier floating-point aligned 3x3 matrix. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(mat3, aligned_mat3, 16); + + /// Single-qualifier floating-point aligned 4x4 matrix. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(mat4, aligned_mat4, 16); + + + /// Single-qualifier floating-point aligned 1x1 matrix. + /// @see gtx_type_aligned + //typedef detail::tmat1x1 mat1; + + /// Single-qualifier floating-point aligned 2x2 matrix. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(mat2x2, aligned_mat2x2, 16); + + /// Single-qualifier floating-point aligned 3x3 matrix. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(mat3x3, aligned_mat3x3, 16); + + /// Single-qualifier floating-point aligned 4x4 matrix. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(mat4x4, aligned_mat4x4, 16); + + + /// Single-qualifier floating-point aligned 1x1 matrix. + /// @see gtx_type_aligned + //typedef detail::tmat1x1 fmat1; + + /// Single-qualifier floating-point aligned 2x2 matrix. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(fmat2x2, aligned_fmat2, 16); + + /// Single-qualifier floating-point aligned 3x3 matrix. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(fmat3x3, aligned_fmat3, 16); + + /// Single-qualifier floating-point aligned 4x4 matrix. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(fmat4x4, aligned_fmat4, 16); + + + /// Single-qualifier floating-point aligned 1x1 matrix. + /// @see gtx_type_aligned + //typedef f32 fmat1x1; + + /// Single-qualifier floating-point aligned 2x2 matrix. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(fmat2x2, aligned_fmat2x2, 16); + + /// Single-qualifier floating-point aligned 2x3 matrix. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(fmat2x3, aligned_fmat2x3, 16); + + /// Single-qualifier floating-point aligned 2x4 matrix. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(fmat2x4, aligned_fmat2x4, 16); + + /// Single-qualifier floating-point aligned 3x2 matrix. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(fmat3x2, aligned_fmat3x2, 16); + + /// Single-qualifier floating-point aligned 3x3 matrix. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(fmat3x3, aligned_fmat3x3, 16); + + /// Single-qualifier floating-point aligned 3x4 matrix. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(fmat3x4, aligned_fmat3x4, 16); + + /// Single-qualifier floating-point aligned 4x2 matrix. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(fmat4x2, aligned_fmat4x2, 16); + + /// Single-qualifier floating-point aligned 4x3 matrix. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(fmat4x3, aligned_fmat4x3, 16); + + /// Single-qualifier floating-point aligned 4x4 matrix. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(fmat4x4, aligned_fmat4x4, 16); + + + /// Single-qualifier floating-point aligned 1x1 matrix. + /// @see gtx_type_aligned + //typedef detail::tmat1x1 f32mat1; + + /// Single-qualifier floating-point aligned 2x2 matrix. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(f32mat2x2, aligned_f32mat2, 16); + + /// Single-qualifier floating-point aligned 3x3 matrix. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(f32mat3x3, aligned_f32mat3, 16); + + /// Single-qualifier floating-point aligned 4x4 matrix. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(f32mat4x4, aligned_f32mat4, 16); + + + /// Single-qualifier floating-point aligned 1x1 matrix. + /// @see gtx_type_aligned + //typedef f32 f32mat1x1; + + /// Single-qualifier floating-point aligned 2x2 matrix. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(f32mat2x2, aligned_f32mat2x2, 16); + + /// Single-qualifier floating-point aligned 2x3 matrix. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(f32mat2x3, aligned_f32mat2x3, 16); + + /// Single-qualifier floating-point aligned 2x4 matrix. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(f32mat2x4, aligned_f32mat2x4, 16); + + /// Single-qualifier floating-point aligned 3x2 matrix. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(f32mat3x2, aligned_f32mat3x2, 16); + + /// Single-qualifier floating-point aligned 3x3 matrix. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(f32mat3x3, aligned_f32mat3x3, 16); + + /// Single-qualifier floating-point aligned 3x4 matrix. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(f32mat3x4, aligned_f32mat3x4, 16); + + /// Single-qualifier floating-point aligned 4x2 matrix. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(f32mat4x2, aligned_f32mat4x2, 16); + + /// Single-qualifier floating-point aligned 4x3 matrix. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(f32mat4x3, aligned_f32mat4x3, 16); + + /// Single-qualifier floating-point aligned 4x4 matrix. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(f32mat4x4, aligned_f32mat4x4, 16); + + +# ifndef GLM_FORCE_SINGLE_ONLY + + /// Double-qualifier floating-point aligned 1x1 matrix. + /// @see gtx_type_aligned + //typedef detail::tmat1x1 f64mat1; + + /// Double-qualifier floating-point aligned 2x2 matrix. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(f64mat2x2, aligned_f64mat2, 32); + + /// Double-qualifier floating-point aligned 3x3 matrix. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(f64mat3x3, aligned_f64mat3, 32); + + /// Double-qualifier floating-point aligned 4x4 matrix. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(f64mat4x4, aligned_f64mat4, 32); + + + /// Double-qualifier floating-point aligned 1x1 matrix. + /// @see gtx_type_aligned + //typedef f64 f64mat1x1; + + /// Double-qualifier floating-point aligned 2x2 matrix. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(f64mat2x2, aligned_f64mat2x2, 32); + + /// Double-qualifier floating-point aligned 2x3 matrix. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(f64mat2x3, aligned_f64mat2x3, 32); + + /// Double-qualifier floating-point aligned 2x4 matrix. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(f64mat2x4, aligned_f64mat2x4, 32); + + /// Double-qualifier floating-point aligned 3x2 matrix. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(f64mat3x2, aligned_f64mat3x2, 32); + + /// Double-qualifier floating-point aligned 3x3 matrix. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(f64mat3x3, aligned_f64mat3x3, 32); + + /// Double-qualifier floating-point aligned 3x4 matrix. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(f64mat3x4, aligned_f64mat3x4, 32); + + /// Double-qualifier floating-point aligned 4x2 matrix. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(f64mat4x2, aligned_f64mat4x2, 32); + + /// Double-qualifier floating-point aligned 4x3 matrix. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(f64mat4x3, aligned_f64mat4x3, 32); + + /// Double-qualifier floating-point aligned 4x4 matrix. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(f64mat4x4, aligned_f64mat4x4, 32); + +# endif//GLM_FORCE_SINGLE_ONLY + + + ////////////////////////// + // Quaternion types + + /// Single-qualifier floating-point aligned quaternion. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(quat, aligned_quat, 16); + + /// Single-qualifier floating-point aligned quaternion. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(quat, aligned_fquat, 16); + + /// Double-qualifier floating-point aligned quaternion. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(dquat, aligned_dquat, 32); + + /// Single-qualifier floating-point aligned quaternion. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(f32quat, aligned_f32quat, 16); + +# ifndef GLM_FORCE_SINGLE_ONLY + + /// Double-qualifier floating-point aligned quaternion. + /// @see gtx_type_aligned + GLM_ALIGNED_TYPEDEF(f64quat, aligned_f64quat, 32); + +# endif//GLM_FORCE_SINGLE_ONLY + + /// @} +}//namespace glm + +#include "type_aligned.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/type_aligned.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/type_aligned.inl new file mode 100644 index 0000000000000000000000000000000000000000..803fcc241dfd637a3180e22ea13e09eedf542875 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/type_aligned.inl @@ -0,0 +1,6 @@ +/// @ref gtc_type_aligned + +namespace glm +{ + +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/type_trait.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/type_trait.hpp new file mode 100644 index 0000000000000000000000000000000000000000..e5361f5a2298e6499c3adf3a87bafbb6f59c2510 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/type_trait.hpp @@ -0,0 +1,85 @@ +/// @ref gtx_type_trait +/// @file glm/gtx/type_trait.hpp +/// +/// @see core (dependence) +/// +/// @defgroup gtx_type_trait GLM_GTX_type_trait +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Defines traits for each type. + +#pragma once + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_type_trait is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_type_trait extension included") +# endif +#endif + +// Dependency: +#include "../detail/qualifier.hpp" +#include "../gtc/quaternion.hpp" +#include "../gtx/dual_quaternion.hpp" + +namespace glm +{ + /// @addtogroup gtx_type_trait + /// @{ + + template + struct type + { + static bool const is_vec = false; + static bool const is_mat = false; + static bool const is_quat = false; + static length_t const components = 0; + static length_t const cols = 0; + static length_t const rows = 0; + }; + + template + struct type > + { + static bool const is_vec = true; + static bool const is_mat = false; + static bool const is_quat = false; + static length_t const components = L; + }; + + template + struct type > + { + static bool const is_vec = false; + static bool const is_mat = true; + static bool const is_quat = false; + static length_t const components = C; + static length_t const cols = C; + static length_t const rows = R; + }; + + template + struct type > + { + static bool const is_vec = false; + static bool const is_mat = false; + static bool const is_quat = true; + static length_t const components = 4; + }; + + template + struct type > + { + static bool const is_vec = false; + static bool const is_mat = false; + static bool const is_quat = true; + static length_t const components = 8; + }; + + /// @} +}//namespace glm + +#include "type_trait.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/type_trait.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/type_trait.inl new file mode 100644 index 0000000000000000000000000000000000000000..74bae4f05777b5f21d94fea1f50d71821c3c122d --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/type_trait.inl @@ -0,0 +1,61 @@ +/// @ref gtx_type_trait + +namespace glm +{ + template + bool const type::is_vec; + template + bool const type::is_mat; + template + bool const type::is_quat; + template + length_t const type::components; + template + length_t const type::cols; + template + length_t const type::rows; + + // vec + template + bool const type >::is_vec; + template + bool const type >::is_mat; + template + bool const type >::is_quat; + template + length_t const type >::components; + + // mat + template + bool const type >::is_vec; + template + bool const type >::is_mat; + template + bool const type >::is_quat; + template + length_t const type >::components; + template + length_t const type >::cols; + template + length_t const type >::rows; + + // tquat + template + bool const type >::is_vec; + template + bool const type >::is_mat; + template + bool const type >::is_quat; + template + length_t const type >::components; + + // tdualquat + template + bool const type >::is_vec; + template + bool const type >::is_mat; + template + bool const type >::is_quat; + template + length_t const type >::components; +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/vec_swizzle.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/vec_swizzle.hpp new file mode 100644 index 0000000000000000000000000000000000000000..90c77f919380af4d153d19cb0f3f19d8fc94183e --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/vec_swizzle.hpp @@ -0,0 +1,2786 @@ +/// @ref gtx_vec_swizzle +/// @file glm/gtx/vec_swizzle.hpp +/// +/// @see core (dependence) +/// +/// @defgroup gtx_vec_swizzle GLM_GTX_vec_swizzle +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Functions to perform swizzle operation. + +#pragma once + +#include "../glm.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_vec_swizzle is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_vec_swizzle extension included") +# endif +#endif + +namespace glm { + /// @addtogroup gtx_vec_swizzle + /// @{ + + // xx + template + GLM_INLINE glm::vec<2, T, Q> xx(const glm::vec<1, T, Q> &v) { + return glm::vec<2, T, Q>(v.x, v.x); + } + + template + GLM_INLINE glm::vec<2, T, Q> xx(const glm::vec<2, T, Q> &v) { + return glm::vec<2, T, Q>(v.x, v.x); + } + + template + GLM_INLINE glm::vec<2, T, Q> xx(const glm::vec<3, T, Q> &v) { + return glm::vec<2, T, Q>(v.x, v.x); + } + + template + GLM_INLINE glm::vec<2, T, Q> xx(const glm::vec<4, T, Q> &v) { + return glm::vec<2, T, Q>(v.x, v.x); + } + + // xy + template + GLM_INLINE glm::vec<2, T, Q> xy(const glm::vec<2, T, Q> &v) { + return glm::vec<2, T, Q>(v.x, v.y); + } + + template + GLM_INLINE glm::vec<2, T, Q> xy(const glm::vec<3, T, Q> &v) { + return glm::vec<2, T, Q>(v.x, v.y); + } + + template + GLM_INLINE glm::vec<2, T, Q> xy(const glm::vec<4, T, Q> &v) { + return glm::vec<2, T, Q>(v.x, v.y); + } + + // xz + template + GLM_INLINE glm::vec<2, T, Q> xz(const glm::vec<3, T, Q> &v) { + return glm::vec<2, T, Q>(v.x, v.z); + } + + template + GLM_INLINE glm::vec<2, T, Q> xz(const glm::vec<4, T, Q> &v) { + return glm::vec<2, T, Q>(v.x, v.z); + } + + // xw + template + GLM_INLINE glm::vec<2, T, Q> xw(const glm::vec<4, T, Q> &v) { + return glm::vec<2, T, Q>(v.x, v.w); + } + + // yx + template + GLM_INLINE glm::vec<2, T, Q> yx(const glm::vec<2, T, Q> &v) { + return glm::vec<2, T, Q>(v.y, v.x); + } + + template + GLM_INLINE glm::vec<2, T, Q> yx(const glm::vec<3, T, Q> &v) { + return glm::vec<2, T, Q>(v.y, v.x); + } + + template + GLM_INLINE glm::vec<2, T, Q> yx(const glm::vec<4, T, Q> &v) { + return glm::vec<2, T, Q>(v.y, v.x); + } + + // yy + template + GLM_INLINE glm::vec<2, T, Q> yy(const glm::vec<2, T, Q> &v) { + return glm::vec<2, T, Q>(v.y, v.y); + } + + template + GLM_INLINE glm::vec<2, T, Q> yy(const glm::vec<3, T, Q> &v) { + return glm::vec<2, T, Q>(v.y, v.y); + } + + template + GLM_INLINE glm::vec<2, T, Q> yy(const glm::vec<4, T, Q> &v) { + return glm::vec<2, T, Q>(v.y, v.y); + } + + // yz + template + GLM_INLINE glm::vec<2, T, Q> yz(const glm::vec<3, T, Q> &v) { + return glm::vec<2, T, Q>(v.y, v.z); + } + + template + GLM_INLINE glm::vec<2, T, Q> yz(const glm::vec<4, T, Q> &v) { + return glm::vec<2, T, Q>(v.y, v.z); + } + + // yw + template + GLM_INLINE glm::vec<2, T, Q> yw(const glm::vec<4, T, Q> &v) { + return glm::vec<2, T, Q>(v.y, v.w); + } + + // zx + template + GLM_INLINE glm::vec<2, T, Q> zx(const glm::vec<3, T, Q> &v) { + return glm::vec<2, T, Q>(v.z, v.x); + } + + template + GLM_INLINE glm::vec<2, T, Q> zx(const glm::vec<4, T, Q> &v) { + return glm::vec<2, T, Q>(v.z, v.x); + } + + // zy + template + GLM_INLINE glm::vec<2, T, Q> zy(const glm::vec<3, T, Q> &v) { + return glm::vec<2, T, Q>(v.z, v.y); + } + + template + GLM_INLINE glm::vec<2, T, Q> zy(const glm::vec<4, T, Q> &v) { + return glm::vec<2, T, Q>(v.z, v.y); + } + + // zz + template + GLM_INLINE glm::vec<2, T, Q> zz(const glm::vec<3, T, Q> &v) { + return glm::vec<2, T, Q>(v.z, v.z); + } + + template + GLM_INLINE glm::vec<2, T, Q> zz(const glm::vec<4, T, Q> &v) { + return glm::vec<2, T, Q>(v.z, v.z); + } + + // zw + template + GLM_INLINE glm::vec<2, T, Q> zw(const glm::vec<4, T, Q> &v) { + return glm::vec<2, T, Q>(v.z, v.w); + } + + // wx + template + GLM_INLINE glm::vec<2, T, Q> wx(const glm::vec<4, T, Q> &v) { + return glm::vec<2, T, Q>(v.w, v.x); + } + + // wy + template + GLM_INLINE glm::vec<2, T, Q> wy(const glm::vec<4, T, Q> &v) { + return glm::vec<2, T, Q>(v.w, v.y); + } + + // wz + template + GLM_INLINE glm::vec<2, T, Q> wz(const glm::vec<4, T, Q> &v) { + return glm::vec<2, T, Q>(v.w, v.z); + } + + // ww + template + GLM_INLINE glm::vec<2, T, Q> ww(const glm::vec<4, T, Q> &v) { + return glm::vec<2, T, Q>(v.w, v.w); + } + + // xxx + template + GLM_INLINE glm::vec<3, T, Q> xxx(const glm::vec<1, T, Q> &v) { + return glm::vec<3, T, Q>(v.x, v.x, v.x); + } + + template + GLM_INLINE glm::vec<3, T, Q> xxx(const glm::vec<2, T, Q> &v) { + return glm::vec<3, T, Q>(v.x, v.x, v.x); + } + + template + GLM_INLINE glm::vec<3, T, Q> xxx(const glm::vec<3, T, Q> &v) { + return glm::vec<3, T, Q>(v.x, v.x, v.x); + } + + template + GLM_INLINE glm::vec<3, T, Q> xxx(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.x, v.x, v.x); + } + + // xxy + template + GLM_INLINE glm::vec<3, T, Q> xxy(const glm::vec<2, T, Q> &v) { + return glm::vec<3, T, Q>(v.x, v.x, v.y); + } + + template + GLM_INLINE glm::vec<3, T, Q> xxy(const glm::vec<3, T, Q> &v) { + return glm::vec<3, T, Q>(v.x, v.x, v.y); + } + + template + GLM_INLINE glm::vec<3, T, Q> xxy(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.x, v.x, v.y); + } + + // xxz + template + GLM_INLINE glm::vec<3, T, Q> xxz(const glm::vec<3, T, Q> &v) { + return glm::vec<3, T, Q>(v.x, v.x, v.z); + } + + template + GLM_INLINE glm::vec<3, T, Q> xxz(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.x, v.x, v.z); + } + + // xxw + template + GLM_INLINE glm::vec<3, T, Q> xxw(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.x, v.x, v.w); + } + + // xyx + template + GLM_INLINE glm::vec<3, T, Q> xyx(const glm::vec<2, T, Q> &v) { + return glm::vec<3, T, Q>(v.x, v.y, v.x); + } + + template + GLM_INLINE glm::vec<3, T, Q> xyx(const glm::vec<3, T, Q> &v) { + return glm::vec<3, T, Q>(v.x, v.y, v.x); + } + + template + GLM_INLINE glm::vec<3, T, Q> xyx(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.x, v.y, v.x); + } + + // xyy + template + GLM_INLINE glm::vec<3, T, Q> xyy(const glm::vec<2, T, Q> &v) { + return glm::vec<3, T, Q>(v.x, v.y, v.y); + } + + template + GLM_INLINE glm::vec<3, T, Q> xyy(const glm::vec<3, T, Q> &v) { + return glm::vec<3, T, Q>(v.x, v.y, v.y); + } + + template + GLM_INLINE glm::vec<3, T, Q> xyy(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.x, v.y, v.y); + } + + // xyz + template + GLM_INLINE glm::vec<3, T, Q> xyz(const glm::vec<3, T, Q> &v) { + return glm::vec<3, T, Q>(v.x, v.y, v.z); + } + + template + GLM_INLINE glm::vec<3, T, Q> xyz(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.x, v.y, v.z); + } + + // xyw + template + GLM_INLINE glm::vec<3, T, Q> xyw(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.x, v.y, v.w); + } + + // xzx + template + GLM_INLINE glm::vec<3, T, Q> xzx(const glm::vec<3, T, Q> &v) { + return glm::vec<3, T, Q>(v.x, v.z, v.x); + } + + template + GLM_INLINE glm::vec<3, T, Q> xzx(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.x, v.z, v.x); + } + + // xzy + template + GLM_INLINE glm::vec<3, T, Q> xzy(const glm::vec<3, T, Q> &v) { + return glm::vec<3, T, Q>(v.x, v.z, v.y); + } + + template + GLM_INLINE glm::vec<3, T, Q> xzy(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.x, v.z, v.y); + } + + // xzz + template + GLM_INLINE glm::vec<3, T, Q> xzz(const glm::vec<3, T, Q> &v) { + return glm::vec<3, T, Q>(v.x, v.z, v.z); + } + + template + GLM_INLINE glm::vec<3, T, Q> xzz(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.x, v.z, v.z); + } + + // xzw + template + GLM_INLINE glm::vec<3, T, Q> xzw(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.x, v.z, v.w); + } + + // xwx + template + GLM_INLINE glm::vec<3, T, Q> xwx(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.x, v.w, v.x); + } + + // xwy + template + GLM_INLINE glm::vec<3, T, Q> xwy(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.x, v.w, v.y); + } + + // xwz + template + GLM_INLINE glm::vec<3, T, Q> xwz(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.x, v.w, v.z); + } + + // xww + template + GLM_INLINE glm::vec<3, T, Q> xww(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.x, v.w, v.w); + } + + // yxx + template + GLM_INLINE glm::vec<3, T, Q> yxx(const glm::vec<2, T, Q> &v) { + return glm::vec<3, T, Q>(v.y, v.x, v.x); + } + + template + GLM_INLINE glm::vec<3, T, Q> yxx(const glm::vec<3, T, Q> &v) { + return glm::vec<3, T, Q>(v.y, v.x, v.x); + } + + template + GLM_INLINE glm::vec<3, T, Q> yxx(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.y, v.x, v.x); + } + + // yxy + template + GLM_INLINE glm::vec<3, T, Q> yxy(const glm::vec<2, T, Q> &v) { + return glm::vec<3, T, Q>(v.y, v.x, v.y); + } + + template + GLM_INLINE glm::vec<3, T, Q> yxy(const glm::vec<3, T, Q> &v) { + return glm::vec<3, T, Q>(v.y, v.x, v.y); + } + + template + GLM_INLINE glm::vec<3, T, Q> yxy(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.y, v.x, v.y); + } + + // yxz + template + GLM_INLINE glm::vec<3, T, Q> yxz(const glm::vec<3, T, Q> &v) { + return glm::vec<3, T, Q>(v.y, v.x, v.z); + } + + template + GLM_INLINE glm::vec<3, T, Q> yxz(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.y, v.x, v.z); + } + + // yxw + template + GLM_INLINE glm::vec<3, T, Q> yxw(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.y, v.x, v.w); + } + + // yyx + template + GLM_INLINE glm::vec<3, T, Q> yyx(const glm::vec<2, T, Q> &v) { + return glm::vec<3, T, Q>(v.y, v.y, v.x); + } + + template + GLM_INLINE glm::vec<3, T, Q> yyx(const glm::vec<3, T, Q> &v) { + return glm::vec<3, T, Q>(v.y, v.y, v.x); + } + + template + GLM_INLINE glm::vec<3, T, Q> yyx(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.y, v.y, v.x); + } + + // yyy + template + GLM_INLINE glm::vec<3, T, Q> yyy(const glm::vec<2, T, Q> &v) { + return glm::vec<3, T, Q>(v.y, v.y, v.y); + } + + template + GLM_INLINE glm::vec<3, T, Q> yyy(const glm::vec<3, T, Q> &v) { + return glm::vec<3, T, Q>(v.y, v.y, v.y); + } + + template + GLM_INLINE glm::vec<3, T, Q> yyy(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.y, v.y, v.y); + } + + // yyz + template + GLM_INLINE glm::vec<3, T, Q> yyz(const glm::vec<3, T, Q> &v) { + return glm::vec<3, T, Q>(v.y, v.y, v.z); + } + + template + GLM_INLINE glm::vec<3, T, Q> yyz(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.y, v.y, v.z); + } + + // yyw + template + GLM_INLINE glm::vec<3, T, Q> yyw(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.y, v.y, v.w); + } + + // yzx + template + GLM_INLINE glm::vec<3, T, Q> yzx(const glm::vec<3, T, Q> &v) { + return glm::vec<3, T, Q>(v.y, v.z, v.x); + } + + template + GLM_INLINE glm::vec<3, T, Q> yzx(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.y, v.z, v.x); + } + + // yzy + template + GLM_INLINE glm::vec<3, T, Q> yzy(const glm::vec<3, T, Q> &v) { + return glm::vec<3, T, Q>(v.y, v.z, v.y); + } + + template + GLM_INLINE glm::vec<3, T, Q> yzy(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.y, v.z, v.y); + } + + // yzz + template + GLM_INLINE glm::vec<3, T, Q> yzz(const glm::vec<3, T, Q> &v) { + return glm::vec<3, T, Q>(v.y, v.z, v.z); + } + + template + GLM_INLINE glm::vec<3, T, Q> yzz(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.y, v.z, v.z); + } + + // yzw + template + GLM_INLINE glm::vec<3, T, Q> yzw(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.y, v.z, v.w); + } + + // ywx + template + GLM_INLINE glm::vec<3, T, Q> ywx(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.y, v.w, v.x); + } + + // ywy + template + GLM_INLINE glm::vec<3, T, Q> ywy(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.y, v.w, v.y); + } + + // ywz + template + GLM_INLINE glm::vec<3, T, Q> ywz(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.y, v.w, v.z); + } + + // yww + template + GLM_INLINE glm::vec<3, T, Q> yww(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.y, v.w, v.w); + } + + // zxx + template + GLM_INLINE glm::vec<3, T, Q> zxx(const glm::vec<3, T, Q> &v) { + return glm::vec<3, T, Q>(v.z, v.x, v.x); + } + + template + GLM_INLINE glm::vec<3, T, Q> zxx(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.z, v.x, v.x); + } + + // zxy + template + GLM_INLINE glm::vec<3, T, Q> zxy(const glm::vec<3, T, Q> &v) { + return glm::vec<3, T, Q>(v.z, v.x, v.y); + } + + template + GLM_INLINE glm::vec<3, T, Q> zxy(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.z, v.x, v.y); + } + + // zxz + template + GLM_INLINE glm::vec<3, T, Q> zxz(const glm::vec<3, T, Q> &v) { + return glm::vec<3, T, Q>(v.z, v.x, v.z); + } + + template + GLM_INLINE glm::vec<3, T, Q> zxz(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.z, v.x, v.z); + } + + // zxw + template + GLM_INLINE glm::vec<3, T, Q> zxw(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.z, v.x, v.w); + } + + // zyx + template + GLM_INLINE glm::vec<3, T, Q> zyx(const glm::vec<3, T, Q> &v) { + return glm::vec<3, T, Q>(v.z, v.y, v.x); + } + + template + GLM_INLINE glm::vec<3, T, Q> zyx(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.z, v.y, v.x); + } + + // zyy + template + GLM_INLINE glm::vec<3, T, Q> zyy(const glm::vec<3, T, Q> &v) { + return glm::vec<3, T, Q>(v.z, v.y, v.y); + } + + template + GLM_INLINE glm::vec<3, T, Q> zyy(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.z, v.y, v.y); + } + + // zyz + template + GLM_INLINE glm::vec<3, T, Q> zyz(const glm::vec<3, T, Q> &v) { + return glm::vec<3, T, Q>(v.z, v.y, v.z); + } + + template + GLM_INLINE glm::vec<3, T, Q> zyz(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.z, v.y, v.z); + } + + // zyw + template + GLM_INLINE glm::vec<3, T, Q> zyw(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.z, v.y, v.w); + } + + // zzx + template + GLM_INLINE glm::vec<3, T, Q> zzx(const glm::vec<3, T, Q> &v) { + return glm::vec<3, T, Q>(v.z, v.z, v.x); + } + + template + GLM_INLINE glm::vec<3, T, Q> zzx(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.z, v.z, v.x); + } + + // zzy + template + GLM_INLINE glm::vec<3, T, Q> zzy(const glm::vec<3, T, Q> &v) { + return glm::vec<3, T, Q>(v.z, v.z, v.y); + } + + template + GLM_INLINE glm::vec<3, T, Q> zzy(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.z, v.z, v.y); + } + + // zzz + template + GLM_INLINE glm::vec<3, T, Q> zzz(const glm::vec<3, T, Q> &v) { + return glm::vec<3, T, Q>(v.z, v.z, v.z); + } + + template + GLM_INLINE glm::vec<3, T, Q> zzz(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.z, v.z, v.z); + } + + // zzw + template + GLM_INLINE glm::vec<3, T, Q> zzw(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.z, v.z, v.w); + } + + // zwx + template + GLM_INLINE glm::vec<3, T, Q> zwx(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.z, v.w, v.x); + } + + // zwy + template + GLM_INLINE glm::vec<3, T, Q> zwy(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.z, v.w, v.y); + } + + // zwz + template + GLM_INLINE glm::vec<3, T, Q> zwz(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.z, v.w, v.z); + } + + // zww + template + GLM_INLINE glm::vec<3, T, Q> zww(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.z, v.w, v.w); + } + + // wxx + template + GLM_INLINE glm::vec<3, T, Q> wxx(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.w, v.x, v.x); + } + + // wxy + template + GLM_INLINE glm::vec<3, T, Q> wxy(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.w, v.x, v.y); + } + + // wxz + template + GLM_INLINE glm::vec<3, T, Q> wxz(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.w, v.x, v.z); + } + + // wxw + template + GLM_INLINE glm::vec<3, T, Q> wxw(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.w, v.x, v.w); + } + + // wyx + template + GLM_INLINE glm::vec<3, T, Q> wyx(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.w, v.y, v.x); + } + + // wyy + template + GLM_INLINE glm::vec<3, T, Q> wyy(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.w, v.y, v.y); + } + + // wyz + template + GLM_INLINE glm::vec<3, T, Q> wyz(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.w, v.y, v.z); + } + + // wyw + template + GLM_INLINE glm::vec<3, T, Q> wyw(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.w, v.y, v.w); + } + + // wzx + template + GLM_INLINE glm::vec<3, T, Q> wzx(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.w, v.z, v.x); + } + + // wzy + template + GLM_INLINE glm::vec<3, T, Q> wzy(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.w, v.z, v.y); + } + + // wzz + template + GLM_INLINE glm::vec<3, T, Q> wzz(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.w, v.z, v.z); + } + + // wzw + template + GLM_INLINE glm::vec<3, T, Q> wzw(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.w, v.z, v.w); + } + + // wwx + template + GLM_INLINE glm::vec<3, T, Q> wwx(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.w, v.w, v.x); + } + + // wwy + template + GLM_INLINE glm::vec<3, T, Q> wwy(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.w, v.w, v.y); + } + + // wwz + template + GLM_INLINE glm::vec<3, T, Q> wwz(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.w, v.w, v.z); + } + + // www + template + GLM_INLINE glm::vec<3, T, Q> www(const glm::vec<4, T, Q> &v) { + return glm::vec<3, T, Q>(v.w, v.w, v.w); + } + + // xxxx + template + GLM_INLINE glm::vec<4, T, Q> xxxx(const glm::vec<1, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.x, v.x, v.x); + } + + template + GLM_INLINE glm::vec<4, T, Q> xxxx(const glm::vec<2, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.x, v.x, v.x); + } + + template + GLM_INLINE glm::vec<4, T, Q> xxxx(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.x, v.x, v.x); + } + + template + GLM_INLINE glm::vec<4, T, Q> xxxx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.x, v.x, v.x); + } + + // xxxy + template + GLM_INLINE glm::vec<4, T, Q> xxxy(const glm::vec<2, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.x, v.x, v.y); + } + + template + GLM_INLINE glm::vec<4, T, Q> xxxy(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.x, v.x, v.y); + } + + template + GLM_INLINE glm::vec<4, T, Q> xxxy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.x, v.x, v.y); + } + + // xxxz + template + GLM_INLINE glm::vec<4, T, Q> xxxz(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.x, v.x, v.z); + } + + template + GLM_INLINE glm::vec<4, T, Q> xxxz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.x, v.x, v.z); + } + + // xxxw + template + GLM_INLINE glm::vec<4, T, Q> xxxw(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.x, v.x, v.w); + } + + // xxyx + template + GLM_INLINE glm::vec<4, T, Q> xxyx(const glm::vec<2, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.x, v.y, v.x); + } + + template + GLM_INLINE glm::vec<4, T, Q> xxyx(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.x, v.y, v.x); + } + + template + GLM_INLINE glm::vec<4, T, Q> xxyx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.x, v.y, v.x); + } + + // xxyy + template + GLM_INLINE glm::vec<4, T, Q> xxyy(const glm::vec<2, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.x, v.y, v.y); + } + + template + GLM_INLINE glm::vec<4, T, Q> xxyy(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.x, v.y, v.y); + } + + template + GLM_INLINE glm::vec<4, T, Q> xxyy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.x, v.y, v.y); + } + + // xxyz + template + GLM_INLINE glm::vec<4, T, Q> xxyz(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.x, v.y, v.z); + } + + template + GLM_INLINE glm::vec<4, T, Q> xxyz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.x, v.y, v.z); + } + + // xxyw + template + GLM_INLINE glm::vec<4, T, Q> xxyw(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.x, v.y, v.w); + } + + // xxzx + template + GLM_INLINE glm::vec<4, T, Q> xxzx(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.x, v.z, v.x); + } + + template + GLM_INLINE glm::vec<4, T, Q> xxzx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.x, v.z, v.x); + } + + // xxzy + template + GLM_INLINE glm::vec<4, T, Q> xxzy(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.x, v.z, v.y); + } + + template + GLM_INLINE glm::vec<4, T, Q> xxzy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.x, v.z, v.y); + } + + // xxzz + template + GLM_INLINE glm::vec<4, T, Q> xxzz(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.x, v.z, v.z); + } + + template + GLM_INLINE glm::vec<4, T, Q> xxzz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.x, v.z, v.z); + } + + // xxzw + template + GLM_INLINE glm::vec<4, T, Q> xxzw(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.x, v.z, v.w); + } + + // xxwx + template + GLM_INLINE glm::vec<4, T, Q> xxwx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.x, v.w, v.x); + } + + // xxwy + template + GLM_INLINE glm::vec<4, T, Q> xxwy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.x, v.w, v.y); + } + + // xxwz + template + GLM_INLINE glm::vec<4, T, Q> xxwz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.x, v.w, v.z); + } + + // xxww + template + GLM_INLINE glm::vec<4, T, Q> xxww(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.x, v.w, v.w); + } + + // xyxx + template + GLM_INLINE glm::vec<4, T, Q> xyxx(const glm::vec<2, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.y, v.x, v.x); + } + + template + GLM_INLINE glm::vec<4, T, Q> xyxx(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.y, v.x, v.x); + } + + template + GLM_INLINE glm::vec<4, T, Q> xyxx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.y, v.x, v.x); + } + + // xyxy + template + GLM_INLINE glm::vec<4, T, Q> xyxy(const glm::vec<2, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.y, v.x, v.y); + } + + template + GLM_INLINE glm::vec<4, T, Q> xyxy(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.y, v.x, v.y); + } + + template + GLM_INLINE glm::vec<4, T, Q> xyxy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.y, v.x, v.y); + } + + // xyxz + template + GLM_INLINE glm::vec<4, T, Q> xyxz(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.y, v.x, v.z); + } + + template + GLM_INLINE glm::vec<4, T, Q> xyxz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.y, v.x, v.z); + } + + // xyxw + template + GLM_INLINE glm::vec<4, T, Q> xyxw(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.y, v.x, v.w); + } + + // xyyx + template + GLM_INLINE glm::vec<4, T, Q> xyyx(const glm::vec<2, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.y, v.y, v.x); + } + + template + GLM_INLINE glm::vec<4, T, Q> xyyx(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.y, v.y, v.x); + } + + template + GLM_INLINE glm::vec<4, T, Q> xyyx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.y, v.y, v.x); + } + + // xyyy + template + GLM_INLINE glm::vec<4, T, Q> xyyy(const glm::vec<2, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.y, v.y, v.y); + } + + template + GLM_INLINE glm::vec<4, T, Q> xyyy(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.y, v.y, v.y); + } + + template + GLM_INLINE glm::vec<4, T, Q> xyyy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.y, v.y, v.y); + } + + // xyyz + template + GLM_INLINE glm::vec<4, T, Q> xyyz(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.y, v.y, v.z); + } + + template + GLM_INLINE glm::vec<4, T, Q> xyyz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.y, v.y, v.z); + } + + // xyyw + template + GLM_INLINE glm::vec<4, T, Q> xyyw(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.y, v.y, v.w); + } + + // xyzx + template + GLM_INLINE glm::vec<4, T, Q> xyzx(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.y, v.z, v.x); + } + + template + GLM_INLINE glm::vec<4, T, Q> xyzx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.y, v.z, v.x); + } + + // xyzy + template + GLM_INLINE glm::vec<4, T, Q> xyzy(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.y, v.z, v.y); + } + + template + GLM_INLINE glm::vec<4, T, Q> xyzy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.y, v.z, v.y); + } + + // xyzz + template + GLM_INLINE glm::vec<4, T, Q> xyzz(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.y, v.z, v.z); + } + + template + GLM_INLINE glm::vec<4, T, Q> xyzz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.y, v.z, v.z); + } + + // xyzw + template + GLM_INLINE glm::vec<4, T, Q> xyzw(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.y, v.z, v.w); + } + + // xywx + template + GLM_INLINE glm::vec<4, T, Q> xywx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.y, v.w, v.x); + } + + // xywy + template + GLM_INLINE glm::vec<4, T, Q> xywy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.y, v.w, v.y); + } + + // xywz + template + GLM_INLINE glm::vec<4, T, Q> xywz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.y, v.w, v.z); + } + + // xyww + template + GLM_INLINE glm::vec<4, T, Q> xyww(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.y, v.w, v.w); + } + + // xzxx + template + GLM_INLINE glm::vec<4, T, Q> xzxx(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.z, v.x, v.x); + } + + template + GLM_INLINE glm::vec<4, T, Q> xzxx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.z, v.x, v.x); + } + + // xzxy + template + GLM_INLINE glm::vec<4, T, Q> xzxy(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.z, v.x, v.y); + } + + template + GLM_INLINE glm::vec<4, T, Q> xzxy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.z, v.x, v.y); + } + + // xzxz + template + GLM_INLINE glm::vec<4, T, Q> xzxz(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.z, v.x, v.z); + } + + template + GLM_INLINE glm::vec<4, T, Q> xzxz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.z, v.x, v.z); + } + + // xzxw + template + GLM_INLINE glm::vec<4, T, Q> xzxw(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.z, v.x, v.w); + } + + // xzyx + template + GLM_INLINE glm::vec<4, T, Q> xzyx(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.z, v.y, v.x); + } + + template + GLM_INLINE glm::vec<4, T, Q> xzyx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.z, v.y, v.x); + } + + // xzyy + template + GLM_INLINE glm::vec<4, T, Q> xzyy(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.z, v.y, v.y); + } + + template + GLM_INLINE glm::vec<4, T, Q> xzyy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.z, v.y, v.y); + } + + // xzyz + template + GLM_INLINE glm::vec<4, T, Q> xzyz(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.z, v.y, v.z); + } + + template + GLM_INLINE glm::vec<4, T, Q> xzyz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.z, v.y, v.z); + } + + // xzyw + template + GLM_INLINE glm::vec<4, T, Q> xzyw(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.z, v.y, v.w); + } + + // xzzx + template + GLM_INLINE glm::vec<4, T, Q> xzzx(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.z, v.z, v.x); + } + + template + GLM_INLINE glm::vec<4, T, Q> xzzx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.z, v.z, v.x); + } + + // xzzy + template + GLM_INLINE glm::vec<4, T, Q> xzzy(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.z, v.z, v.y); + } + + template + GLM_INLINE glm::vec<4, T, Q> xzzy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.z, v.z, v.y); + } + + // xzzz + template + GLM_INLINE glm::vec<4, T, Q> xzzz(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.z, v.z, v.z); + } + + template + GLM_INLINE glm::vec<4, T, Q> xzzz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.z, v.z, v.z); + } + + // xzzw + template + GLM_INLINE glm::vec<4, T, Q> xzzw(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.z, v.z, v.w); + } + + // xzwx + template + GLM_INLINE glm::vec<4, T, Q> xzwx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.z, v.w, v.x); + } + + // xzwy + template + GLM_INLINE glm::vec<4, T, Q> xzwy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.z, v.w, v.y); + } + + // xzwz + template + GLM_INLINE glm::vec<4, T, Q> xzwz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.z, v.w, v.z); + } + + // xzww + template + GLM_INLINE glm::vec<4, T, Q> xzww(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.z, v.w, v.w); + } + + // xwxx + template + GLM_INLINE glm::vec<4, T, Q> xwxx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.w, v.x, v.x); + } + + // xwxy + template + GLM_INLINE glm::vec<4, T, Q> xwxy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.w, v.x, v.y); + } + + // xwxz + template + GLM_INLINE glm::vec<4, T, Q> xwxz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.w, v.x, v.z); + } + + // xwxw + template + GLM_INLINE glm::vec<4, T, Q> xwxw(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.w, v.x, v.w); + } + + // xwyx + template + GLM_INLINE glm::vec<4, T, Q> xwyx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.w, v.y, v.x); + } + + // xwyy + template + GLM_INLINE glm::vec<4, T, Q> xwyy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.w, v.y, v.y); + } + + // xwyz + template + GLM_INLINE glm::vec<4, T, Q> xwyz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.w, v.y, v.z); + } + + // xwyw + template + GLM_INLINE glm::vec<4, T, Q> xwyw(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.w, v.y, v.w); + } + + // xwzx + template + GLM_INLINE glm::vec<4, T, Q> xwzx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.w, v.z, v.x); + } + + // xwzy + template + GLM_INLINE glm::vec<4, T, Q> xwzy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.w, v.z, v.y); + } + + // xwzz + template + GLM_INLINE glm::vec<4, T, Q> xwzz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.w, v.z, v.z); + } + + // xwzw + template + GLM_INLINE glm::vec<4, T, Q> xwzw(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.w, v.z, v.w); + } + + // xwwx + template + GLM_INLINE glm::vec<4, T, Q> xwwx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.w, v.w, v.x); + } + + // xwwy + template + GLM_INLINE glm::vec<4, T, Q> xwwy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.w, v.w, v.y); + } + + // xwwz + template + GLM_INLINE glm::vec<4, T, Q> xwwz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.w, v.w, v.z); + } + + // xwww + template + GLM_INLINE glm::vec<4, T, Q> xwww(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.x, v.w, v.w, v.w); + } + + // yxxx + template + GLM_INLINE glm::vec<4, T, Q> yxxx(const glm::vec<2, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.x, v.x, v.x); + } + + template + GLM_INLINE glm::vec<4, T, Q> yxxx(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.x, v.x, v.x); + } + + template + GLM_INLINE glm::vec<4, T, Q> yxxx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.x, v.x, v.x); + } + + // yxxy + template + GLM_INLINE glm::vec<4, T, Q> yxxy(const glm::vec<2, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.x, v.x, v.y); + } + + template + GLM_INLINE glm::vec<4, T, Q> yxxy(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.x, v.x, v.y); + } + + template + GLM_INLINE glm::vec<4, T, Q> yxxy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.x, v.x, v.y); + } + + // yxxz + template + GLM_INLINE glm::vec<4, T, Q> yxxz(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.x, v.x, v.z); + } + + template + GLM_INLINE glm::vec<4, T, Q> yxxz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.x, v.x, v.z); + } + + // yxxw + template + GLM_INLINE glm::vec<4, T, Q> yxxw(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.x, v.x, v.w); + } + + // yxyx + template + GLM_INLINE glm::vec<4, T, Q> yxyx(const glm::vec<2, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.x, v.y, v.x); + } + + template + GLM_INLINE glm::vec<4, T, Q> yxyx(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.x, v.y, v.x); + } + + template + GLM_INLINE glm::vec<4, T, Q> yxyx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.x, v.y, v.x); + } + + // yxyy + template + GLM_INLINE glm::vec<4, T, Q> yxyy(const glm::vec<2, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.x, v.y, v.y); + } + + template + GLM_INLINE glm::vec<4, T, Q> yxyy(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.x, v.y, v.y); + } + + template + GLM_INLINE glm::vec<4, T, Q> yxyy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.x, v.y, v.y); + } + + // yxyz + template + GLM_INLINE glm::vec<4, T, Q> yxyz(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.x, v.y, v.z); + } + + template + GLM_INLINE glm::vec<4, T, Q> yxyz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.x, v.y, v.z); + } + + // yxyw + template + GLM_INLINE glm::vec<4, T, Q> yxyw(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.x, v.y, v.w); + } + + // yxzx + template + GLM_INLINE glm::vec<4, T, Q> yxzx(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.x, v.z, v.x); + } + + template + GLM_INLINE glm::vec<4, T, Q> yxzx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.x, v.z, v.x); + } + + // yxzy + template + GLM_INLINE glm::vec<4, T, Q> yxzy(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.x, v.z, v.y); + } + + template + GLM_INLINE glm::vec<4, T, Q> yxzy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.x, v.z, v.y); + } + + // yxzz + template + GLM_INLINE glm::vec<4, T, Q> yxzz(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.x, v.z, v.z); + } + + template + GLM_INLINE glm::vec<4, T, Q> yxzz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.x, v.z, v.z); + } + + // yxzw + template + GLM_INLINE glm::vec<4, T, Q> yxzw(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.x, v.z, v.w); + } + + // yxwx + template + GLM_INLINE glm::vec<4, T, Q> yxwx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.x, v.w, v.x); + } + + // yxwy + template + GLM_INLINE glm::vec<4, T, Q> yxwy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.x, v.w, v.y); + } + + // yxwz + template + GLM_INLINE glm::vec<4, T, Q> yxwz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.x, v.w, v.z); + } + + // yxww + template + GLM_INLINE glm::vec<4, T, Q> yxww(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.x, v.w, v.w); + } + + // yyxx + template + GLM_INLINE glm::vec<4, T, Q> yyxx(const glm::vec<2, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.y, v.x, v.x); + } + + template + GLM_INLINE glm::vec<4, T, Q> yyxx(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.y, v.x, v.x); + } + + template + GLM_INLINE glm::vec<4, T, Q> yyxx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.y, v.x, v.x); + } + + // yyxy + template + GLM_INLINE glm::vec<4, T, Q> yyxy(const glm::vec<2, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.y, v.x, v.y); + } + + template + GLM_INLINE glm::vec<4, T, Q> yyxy(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.y, v.x, v.y); + } + + template + GLM_INLINE glm::vec<4, T, Q> yyxy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.y, v.x, v.y); + } + + // yyxz + template + GLM_INLINE glm::vec<4, T, Q> yyxz(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.y, v.x, v.z); + } + + template + GLM_INLINE glm::vec<4, T, Q> yyxz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.y, v.x, v.z); + } + + // yyxw + template + GLM_INLINE glm::vec<4, T, Q> yyxw(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.y, v.x, v.w); + } + + // yyyx + template + GLM_INLINE glm::vec<4, T, Q> yyyx(const glm::vec<2, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.y, v.y, v.x); + } + + template + GLM_INLINE glm::vec<4, T, Q> yyyx(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.y, v.y, v.x); + } + + template + GLM_INLINE glm::vec<4, T, Q> yyyx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.y, v.y, v.x); + } + + // yyyy + template + GLM_INLINE glm::vec<4, T, Q> yyyy(const glm::vec<2, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.y, v.y, v.y); + } + + template + GLM_INLINE glm::vec<4, T, Q> yyyy(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.y, v.y, v.y); + } + + template + GLM_INLINE glm::vec<4, T, Q> yyyy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.y, v.y, v.y); + } + + // yyyz + template + GLM_INLINE glm::vec<4, T, Q> yyyz(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.y, v.y, v.z); + } + + template + GLM_INLINE glm::vec<4, T, Q> yyyz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.y, v.y, v.z); + } + + // yyyw + template + GLM_INLINE glm::vec<4, T, Q> yyyw(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.y, v.y, v.w); + } + + // yyzx + template + GLM_INLINE glm::vec<4, T, Q> yyzx(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.y, v.z, v.x); + } + + template + GLM_INLINE glm::vec<4, T, Q> yyzx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.y, v.z, v.x); + } + + // yyzy + template + GLM_INLINE glm::vec<4, T, Q> yyzy(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.y, v.z, v.y); + } + + template + GLM_INLINE glm::vec<4, T, Q> yyzy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.y, v.z, v.y); + } + + // yyzz + template + GLM_INLINE glm::vec<4, T, Q> yyzz(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.y, v.z, v.z); + } + + template + GLM_INLINE glm::vec<4, T, Q> yyzz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.y, v.z, v.z); + } + + // yyzw + template + GLM_INLINE glm::vec<4, T, Q> yyzw(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.y, v.z, v.w); + } + + // yywx + template + GLM_INLINE glm::vec<4, T, Q> yywx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.y, v.w, v.x); + } + + // yywy + template + GLM_INLINE glm::vec<4, T, Q> yywy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.y, v.w, v.y); + } + + // yywz + template + GLM_INLINE glm::vec<4, T, Q> yywz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.y, v.w, v.z); + } + + // yyww + template + GLM_INLINE glm::vec<4, T, Q> yyww(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.y, v.w, v.w); + } + + // yzxx + template + GLM_INLINE glm::vec<4, T, Q> yzxx(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.z, v.x, v.x); + } + + template + GLM_INLINE glm::vec<4, T, Q> yzxx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.z, v.x, v.x); + } + + // yzxy + template + GLM_INLINE glm::vec<4, T, Q> yzxy(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.z, v.x, v.y); + } + + template + GLM_INLINE glm::vec<4, T, Q> yzxy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.z, v.x, v.y); + } + + // yzxz + template + GLM_INLINE glm::vec<4, T, Q> yzxz(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.z, v.x, v.z); + } + + template + GLM_INLINE glm::vec<4, T, Q> yzxz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.z, v.x, v.z); + } + + // yzxw + template + GLM_INLINE glm::vec<4, T, Q> yzxw(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.z, v.x, v.w); + } + + // yzyx + template + GLM_INLINE glm::vec<4, T, Q> yzyx(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.z, v.y, v.x); + } + + template + GLM_INLINE glm::vec<4, T, Q> yzyx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.z, v.y, v.x); + } + + // yzyy + template + GLM_INLINE glm::vec<4, T, Q> yzyy(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.z, v.y, v.y); + } + + template + GLM_INLINE glm::vec<4, T, Q> yzyy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.z, v.y, v.y); + } + + // yzyz + template + GLM_INLINE glm::vec<4, T, Q> yzyz(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.z, v.y, v.z); + } + + template + GLM_INLINE glm::vec<4, T, Q> yzyz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.z, v.y, v.z); + } + + // yzyw + template + GLM_INLINE glm::vec<4, T, Q> yzyw(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.z, v.y, v.w); + } + + // yzzx + template + GLM_INLINE glm::vec<4, T, Q> yzzx(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.z, v.z, v.x); + } + + template + GLM_INLINE glm::vec<4, T, Q> yzzx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.z, v.z, v.x); + } + + // yzzy + template + GLM_INLINE glm::vec<4, T, Q> yzzy(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.z, v.z, v.y); + } + + template + GLM_INLINE glm::vec<4, T, Q> yzzy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.z, v.z, v.y); + } + + // yzzz + template + GLM_INLINE glm::vec<4, T, Q> yzzz(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.z, v.z, v.z); + } + + template + GLM_INLINE glm::vec<4, T, Q> yzzz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.z, v.z, v.z); + } + + // yzzw + template + GLM_INLINE glm::vec<4, T, Q> yzzw(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.z, v.z, v.w); + } + + // yzwx + template + GLM_INLINE glm::vec<4, T, Q> yzwx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.z, v.w, v.x); + } + + // yzwy + template + GLM_INLINE glm::vec<4, T, Q> yzwy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.z, v.w, v.y); + } + + // yzwz + template + GLM_INLINE glm::vec<4, T, Q> yzwz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.z, v.w, v.z); + } + + // yzww + template + GLM_INLINE glm::vec<4, T, Q> yzww(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.z, v.w, v.w); + } + + // ywxx + template + GLM_INLINE glm::vec<4, T, Q> ywxx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.w, v.x, v.x); + } + + // ywxy + template + GLM_INLINE glm::vec<4, T, Q> ywxy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.w, v.x, v.y); + } + + // ywxz + template + GLM_INLINE glm::vec<4, T, Q> ywxz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.w, v.x, v.z); + } + + // ywxw + template + GLM_INLINE glm::vec<4, T, Q> ywxw(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.w, v.x, v.w); + } + + // ywyx + template + GLM_INLINE glm::vec<4, T, Q> ywyx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.w, v.y, v.x); + } + + // ywyy + template + GLM_INLINE glm::vec<4, T, Q> ywyy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.w, v.y, v.y); + } + + // ywyz + template + GLM_INLINE glm::vec<4, T, Q> ywyz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.w, v.y, v.z); + } + + // ywyw + template + GLM_INLINE glm::vec<4, T, Q> ywyw(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.w, v.y, v.w); + } + + // ywzx + template + GLM_INLINE glm::vec<4, T, Q> ywzx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.w, v.z, v.x); + } + + // ywzy + template + GLM_INLINE glm::vec<4, T, Q> ywzy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.w, v.z, v.y); + } + + // ywzz + template + GLM_INLINE glm::vec<4, T, Q> ywzz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.w, v.z, v.z); + } + + // ywzw + template + GLM_INLINE glm::vec<4, T, Q> ywzw(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.w, v.z, v.w); + } + + // ywwx + template + GLM_INLINE glm::vec<4, T, Q> ywwx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.w, v.w, v.x); + } + + // ywwy + template + GLM_INLINE glm::vec<4, T, Q> ywwy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.w, v.w, v.y); + } + + // ywwz + template + GLM_INLINE glm::vec<4, T, Q> ywwz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.w, v.w, v.z); + } + + // ywww + template + GLM_INLINE glm::vec<4, T, Q> ywww(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.y, v.w, v.w, v.w); + } + + // zxxx + template + GLM_INLINE glm::vec<4, T, Q> zxxx(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.x, v.x, v.x); + } + + template + GLM_INLINE glm::vec<4, T, Q> zxxx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.x, v.x, v.x); + } + + // zxxy + template + GLM_INLINE glm::vec<4, T, Q> zxxy(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.x, v.x, v.y); + } + + template + GLM_INLINE glm::vec<4, T, Q> zxxy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.x, v.x, v.y); + } + + // zxxz + template + GLM_INLINE glm::vec<4, T, Q> zxxz(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.x, v.x, v.z); + } + + template + GLM_INLINE glm::vec<4, T, Q> zxxz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.x, v.x, v.z); + } + + // zxxw + template + GLM_INLINE glm::vec<4, T, Q> zxxw(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.x, v.x, v.w); + } + + // zxyx + template + GLM_INLINE glm::vec<4, T, Q> zxyx(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.x, v.y, v.x); + } + + template + GLM_INLINE glm::vec<4, T, Q> zxyx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.x, v.y, v.x); + } + + // zxyy + template + GLM_INLINE glm::vec<4, T, Q> zxyy(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.x, v.y, v.y); + } + + template + GLM_INLINE glm::vec<4, T, Q> zxyy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.x, v.y, v.y); + } + + // zxyz + template + GLM_INLINE glm::vec<4, T, Q> zxyz(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.x, v.y, v.z); + } + + template + GLM_INLINE glm::vec<4, T, Q> zxyz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.x, v.y, v.z); + } + + // zxyw + template + GLM_INLINE glm::vec<4, T, Q> zxyw(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.x, v.y, v.w); + } + + // zxzx + template + GLM_INLINE glm::vec<4, T, Q> zxzx(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.x, v.z, v.x); + } + + template + GLM_INLINE glm::vec<4, T, Q> zxzx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.x, v.z, v.x); + } + + // zxzy + template + GLM_INLINE glm::vec<4, T, Q> zxzy(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.x, v.z, v.y); + } + + template + GLM_INLINE glm::vec<4, T, Q> zxzy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.x, v.z, v.y); + } + + // zxzz + template + GLM_INLINE glm::vec<4, T, Q> zxzz(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.x, v.z, v.z); + } + + template + GLM_INLINE glm::vec<4, T, Q> zxzz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.x, v.z, v.z); + } + + // zxzw + template + GLM_INLINE glm::vec<4, T, Q> zxzw(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.x, v.z, v.w); + } + + // zxwx + template + GLM_INLINE glm::vec<4, T, Q> zxwx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.x, v.w, v.x); + } + + // zxwy + template + GLM_INLINE glm::vec<4, T, Q> zxwy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.x, v.w, v.y); + } + + // zxwz + template + GLM_INLINE glm::vec<4, T, Q> zxwz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.x, v.w, v.z); + } + + // zxww + template + GLM_INLINE glm::vec<4, T, Q> zxww(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.x, v.w, v.w); + } + + // zyxx + template + GLM_INLINE glm::vec<4, T, Q> zyxx(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.y, v.x, v.x); + } + + template + GLM_INLINE glm::vec<4, T, Q> zyxx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.y, v.x, v.x); + } + + // zyxy + template + GLM_INLINE glm::vec<4, T, Q> zyxy(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.y, v.x, v.y); + } + + template + GLM_INLINE glm::vec<4, T, Q> zyxy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.y, v.x, v.y); + } + + // zyxz + template + GLM_INLINE glm::vec<4, T, Q> zyxz(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.y, v.x, v.z); + } + + template + GLM_INLINE glm::vec<4, T, Q> zyxz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.y, v.x, v.z); + } + + // zyxw + template + GLM_INLINE glm::vec<4, T, Q> zyxw(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.y, v.x, v.w); + } + + // zyyx + template + GLM_INLINE glm::vec<4, T, Q> zyyx(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.y, v.y, v.x); + } + + template + GLM_INLINE glm::vec<4, T, Q> zyyx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.y, v.y, v.x); + } + + // zyyy + template + GLM_INLINE glm::vec<4, T, Q> zyyy(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.y, v.y, v.y); + } + + template + GLM_INLINE glm::vec<4, T, Q> zyyy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.y, v.y, v.y); + } + + // zyyz + template + GLM_INLINE glm::vec<4, T, Q> zyyz(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.y, v.y, v.z); + } + + template + GLM_INLINE glm::vec<4, T, Q> zyyz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.y, v.y, v.z); + } + + // zyyw + template + GLM_INLINE glm::vec<4, T, Q> zyyw(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.y, v.y, v.w); + } + + // zyzx + template + GLM_INLINE glm::vec<4, T, Q> zyzx(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.y, v.z, v.x); + } + + template + GLM_INLINE glm::vec<4, T, Q> zyzx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.y, v.z, v.x); + } + + // zyzy + template + GLM_INLINE glm::vec<4, T, Q> zyzy(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.y, v.z, v.y); + } + + template + GLM_INLINE glm::vec<4, T, Q> zyzy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.y, v.z, v.y); + } + + // zyzz + template + GLM_INLINE glm::vec<4, T, Q> zyzz(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.y, v.z, v.z); + } + + template + GLM_INLINE glm::vec<4, T, Q> zyzz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.y, v.z, v.z); + } + + // zyzw + template + GLM_INLINE glm::vec<4, T, Q> zyzw(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.y, v.z, v.w); + } + + // zywx + template + GLM_INLINE glm::vec<4, T, Q> zywx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.y, v.w, v.x); + } + + // zywy + template + GLM_INLINE glm::vec<4, T, Q> zywy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.y, v.w, v.y); + } + + // zywz + template + GLM_INLINE glm::vec<4, T, Q> zywz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.y, v.w, v.z); + } + + // zyww + template + GLM_INLINE glm::vec<4, T, Q> zyww(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.y, v.w, v.w); + } + + // zzxx + template + GLM_INLINE glm::vec<4, T, Q> zzxx(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.z, v.x, v.x); + } + + template + GLM_INLINE glm::vec<4, T, Q> zzxx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.z, v.x, v.x); + } + + // zzxy + template + GLM_INLINE glm::vec<4, T, Q> zzxy(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.z, v.x, v.y); + } + + template + GLM_INLINE glm::vec<4, T, Q> zzxy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.z, v.x, v.y); + } + + // zzxz + template + GLM_INLINE glm::vec<4, T, Q> zzxz(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.z, v.x, v.z); + } + + template + GLM_INLINE glm::vec<4, T, Q> zzxz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.z, v.x, v.z); + } + + // zzxw + template + GLM_INLINE glm::vec<4, T, Q> zzxw(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.z, v.x, v.w); + } + + // zzyx + template + GLM_INLINE glm::vec<4, T, Q> zzyx(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.z, v.y, v.x); + } + + template + GLM_INLINE glm::vec<4, T, Q> zzyx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.z, v.y, v.x); + } + + // zzyy + template + GLM_INLINE glm::vec<4, T, Q> zzyy(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.z, v.y, v.y); + } + + template + GLM_INLINE glm::vec<4, T, Q> zzyy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.z, v.y, v.y); + } + + // zzyz + template + GLM_INLINE glm::vec<4, T, Q> zzyz(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.z, v.y, v.z); + } + + template + GLM_INLINE glm::vec<4, T, Q> zzyz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.z, v.y, v.z); + } + + // zzyw + template + GLM_INLINE glm::vec<4, T, Q> zzyw(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.z, v.y, v.w); + } + + // zzzx + template + GLM_INLINE glm::vec<4, T, Q> zzzx(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.z, v.z, v.x); + } + + template + GLM_INLINE glm::vec<4, T, Q> zzzx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.z, v.z, v.x); + } + + // zzzy + template + GLM_INLINE glm::vec<4, T, Q> zzzy(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.z, v.z, v.y); + } + + template + GLM_INLINE glm::vec<4, T, Q> zzzy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.z, v.z, v.y); + } + + // zzzz + template + GLM_INLINE glm::vec<4, T, Q> zzzz(const glm::vec<3, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.z, v.z, v.z); + } + + template + GLM_INLINE glm::vec<4, T, Q> zzzz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.z, v.z, v.z); + } + + // zzzw + template + GLM_INLINE glm::vec<4, T, Q> zzzw(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.z, v.z, v.w); + } + + // zzwx + template + GLM_INLINE glm::vec<4, T, Q> zzwx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.z, v.w, v.x); + } + + // zzwy + template + GLM_INLINE glm::vec<4, T, Q> zzwy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.z, v.w, v.y); + } + + // zzwz + template + GLM_INLINE glm::vec<4, T, Q> zzwz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.z, v.w, v.z); + } + + // zzww + template + GLM_INLINE glm::vec<4, T, Q> zzww(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.z, v.w, v.w); + } + + // zwxx + template + GLM_INLINE glm::vec<4, T, Q> zwxx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.w, v.x, v.x); + } + + // zwxy + template + GLM_INLINE glm::vec<4, T, Q> zwxy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.w, v.x, v.y); + } + + // zwxz + template + GLM_INLINE glm::vec<4, T, Q> zwxz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.w, v.x, v.z); + } + + // zwxw + template + GLM_INLINE glm::vec<4, T, Q> zwxw(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.w, v.x, v.w); + } + + // zwyx + template + GLM_INLINE glm::vec<4, T, Q> zwyx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.w, v.y, v.x); + } + + // zwyy + template + GLM_INLINE glm::vec<4, T, Q> zwyy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.w, v.y, v.y); + } + + // zwyz + template + GLM_INLINE glm::vec<4, T, Q> zwyz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.w, v.y, v.z); + } + + // zwyw + template + GLM_INLINE glm::vec<4, T, Q> zwyw(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.w, v.y, v.w); + } + + // zwzx + template + GLM_INLINE glm::vec<4, T, Q> zwzx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.w, v.z, v.x); + } + + // zwzy + template + GLM_INLINE glm::vec<4, T, Q> zwzy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.w, v.z, v.y); + } + + // zwzz + template + GLM_INLINE glm::vec<4, T, Q> zwzz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.w, v.z, v.z); + } + + // zwzw + template + GLM_INLINE glm::vec<4, T, Q> zwzw(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.w, v.z, v.w); + } + + // zwwx + template + GLM_INLINE glm::vec<4, T, Q> zwwx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.w, v.w, v.x); + } + + // zwwy + template + GLM_INLINE glm::vec<4, T, Q> zwwy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.w, v.w, v.y); + } + + // zwwz + template + GLM_INLINE glm::vec<4, T, Q> zwwz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.w, v.w, v.z); + } + + // zwww + template + GLM_INLINE glm::vec<4, T, Q> zwww(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.z, v.w, v.w, v.w); + } + + // wxxx + template + GLM_INLINE glm::vec<4, T, Q> wxxx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.x, v.x, v.x); + } + + // wxxy + template + GLM_INLINE glm::vec<4, T, Q> wxxy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.x, v.x, v.y); + } + + // wxxz + template + GLM_INLINE glm::vec<4, T, Q> wxxz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.x, v.x, v.z); + } + + // wxxw + template + GLM_INLINE glm::vec<4, T, Q> wxxw(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.x, v.x, v.w); + } + + // wxyx + template + GLM_INLINE glm::vec<4, T, Q> wxyx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.x, v.y, v.x); + } + + // wxyy + template + GLM_INLINE glm::vec<4, T, Q> wxyy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.x, v.y, v.y); + } + + // wxyz + template + GLM_INLINE glm::vec<4, T, Q> wxyz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.x, v.y, v.z); + } + + // wxyw + template + GLM_INLINE glm::vec<4, T, Q> wxyw(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.x, v.y, v.w); + } + + // wxzx + template + GLM_INLINE glm::vec<4, T, Q> wxzx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.x, v.z, v.x); + } + + // wxzy + template + GLM_INLINE glm::vec<4, T, Q> wxzy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.x, v.z, v.y); + } + + // wxzz + template + GLM_INLINE glm::vec<4, T, Q> wxzz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.x, v.z, v.z); + } + + // wxzw + template + GLM_INLINE glm::vec<4, T, Q> wxzw(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.x, v.z, v.w); + } + + // wxwx + template + GLM_INLINE glm::vec<4, T, Q> wxwx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.x, v.w, v.x); + } + + // wxwy + template + GLM_INLINE glm::vec<4, T, Q> wxwy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.x, v.w, v.y); + } + + // wxwz + template + GLM_INLINE glm::vec<4, T, Q> wxwz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.x, v.w, v.z); + } + + // wxww + template + GLM_INLINE glm::vec<4, T, Q> wxww(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.x, v.w, v.w); + } + + // wyxx + template + GLM_INLINE glm::vec<4, T, Q> wyxx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.y, v.x, v.x); + } + + // wyxy + template + GLM_INLINE glm::vec<4, T, Q> wyxy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.y, v.x, v.y); + } + + // wyxz + template + GLM_INLINE glm::vec<4, T, Q> wyxz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.y, v.x, v.z); + } + + // wyxw + template + GLM_INLINE glm::vec<4, T, Q> wyxw(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.y, v.x, v.w); + } + + // wyyx + template + GLM_INLINE glm::vec<4, T, Q> wyyx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.y, v.y, v.x); + } + + // wyyy + template + GLM_INLINE glm::vec<4, T, Q> wyyy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.y, v.y, v.y); + } + + // wyyz + template + GLM_INLINE glm::vec<4, T, Q> wyyz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.y, v.y, v.z); + } + + // wyyw + template + GLM_INLINE glm::vec<4, T, Q> wyyw(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.y, v.y, v.w); + } + + // wyzx + template + GLM_INLINE glm::vec<4, T, Q> wyzx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.y, v.z, v.x); + } + + // wyzy + template + GLM_INLINE glm::vec<4, T, Q> wyzy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.y, v.z, v.y); + } + + // wyzz + template + GLM_INLINE glm::vec<4, T, Q> wyzz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.y, v.z, v.z); + } + + // wyzw + template + GLM_INLINE glm::vec<4, T, Q> wyzw(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.y, v.z, v.w); + } + + // wywx + template + GLM_INLINE glm::vec<4, T, Q> wywx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.y, v.w, v.x); + } + + // wywy + template + GLM_INLINE glm::vec<4, T, Q> wywy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.y, v.w, v.y); + } + + // wywz + template + GLM_INLINE glm::vec<4, T, Q> wywz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.y, v.w, v.z); + } + + // wyww + template + GLM_INLINE glm::vec<4, T, Q> wyww(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.y, v.w, v.w); + } + + // wzxx + template + GLM_INLINE glm::vec<4, T, Q> wzxx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.z, v.x, v.x); + } + + // wzxy + template + GLM_INLINE glm::vec<4, T, Q> wzxy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.z, v.x, v.y); + } + + // wzxz + template + GLM_INLINE glm::vec<4, T, Q> wzxz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.z, v.x, v.z); + } + + // wzxw + template + GLM_INLINE glm::vec<4, T, Q> wzxw(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.z, v.x, v.w); + } + + // wzyx + template + GLM_INLINE glm::vec<4, T, Q> wzyx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.z, v.y, v.x); + } + + // wzyy + template + GLM_INLINE glm::vec<4, T, Q> wzyy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.z, v.y, v.y); + } + + // wzyz + template + GLM_INLINE glm::vec<4, T, Q> wzyz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.z, v.y, v.z); + } + + // wzyw + template + GLM_INLINE glm::vec<4, T, Q> wzyw(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.z, v.y, v.w); + } + + // wzzx + template + GLM_INLINE glm::vec<4, T, Q> wzzx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.z, v.z, v.x); + } + + // wzzy + template + GLM_INLINE glm::vec<4, T, Q> wzzy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.z, v.z, v.y); + } + + // wzzz + template + GLM_INLINE glm::vec<4, T, Q> wzzz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.z, v.z, v.z); + } + + // wzzw + template + GLM_INLINE glm::vec<4, T, Q> wzzw(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.z, v.z, v.w); + } + + // wzwx + template + GLM_INLINE glm::vec<4, T, Q> wzwx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.z, v.w, v.x); + } + + // wzwy + template + GLM_INLINE glm::vec<4, T, Q> wzwy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.z, v.w, v.y); + } + + // wzwz + template + GLM_INLINE glm::vec<4, T, Q> wzwz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.z, v.w, v.z); + } + + // wzww + template + GLM_INLINE glm::vec<4, T, Q> wzww(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.z, v.w, v.w); + } + + // wwxx + template + GLM_INLINE glm::vec<4, T, Q> wwxx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.w, v.x, v.x); + } + + // wwxy + template + GLM_INLINE glm::vec<4, T, Q> wwxy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.w, v.x, v.y); + } + + // wwxz + template + GLM_INLINE glm::vec<4, T, Q> wwxz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.w, v.x, v.z); + } + + // wwxw + template + GLM_INLINE glm::vec<4, T, Q> wwxw(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.w, v.x, v.w); + } + + // wwyx + template + GLM_INLINE glm::vec<4, T, Q> wwyx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.w, v.y, v.x); + } + + // wwyy + template + GLM_INLINE glm::vec<4, T, Q> wwyy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.w, v.y, v.y); + } + + // wwyz + template + GLM_INLINE glm::vec<4, T, Q> wwyz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.w, v.y, v.z); + } + + // wwyw + template + GLM_INLINE glm::vec<4, T, Q> wwyw(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.w, v.y, v.w); + } + + // wwzx + template + GLM_INLINE glm::vec<4, T, Q> wwzx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.w, v.z, v.x); + } + + // wwzy + template + GLM_INLINE glm::vec<4, T, Q> wwzy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.w, v.z, v.y); + } + + // wwzz + template + GLM_INLINE glm::vec<4, T, Q> wwzz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.w, v.z, v.z); + } + + // wwzw + template + GLM_INLINE glm::vec<4, T, Q> wwzw(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.w, v.z, v.w); + } + + // wwwx + template + GLM_INLINE glm::vec<4, T, Q> wwwx(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.w, v.w, v.x); + } + + // wwwy + template + GLM_INLINE glm::vec<4, T, Q> wwwy(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.w, v.w, v.y); + } + + // wwwz + template + GLM_INLINE glm::vec<4, T, Q> wwwz(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.w, v.w, v.z); + } + + // wwww + template + GLM_INLINE glm::vec<4, T, Q> wwww(const glm::vec<4, T, Q> &v) { + return glm::vec<4, T, Q>(v.w, v.w, v.w, v.w); + } + + /// @} +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/vector_angle.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/vector_angle.hpp new file mode 100644 index 0000000000000000000000000000000000000000..ae179169543e823df1417d8a23d265074de435f1 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/vector_angle.hpp @@ -0,0 +1,57 @@ +/// @ref gtx_vector_angle +/// @file glm/gtx/vector_angle.hpp +/// +/// @see core (dependence) +/// @see gtx_quaternion (dependence) +/// @see gtx_epsilon (dependence) +/// +/// @defgroup gtx_vector_angle GLM_GTX_vector_angle +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Compute angle between vectors + +#pragma once + +// Dependency: +#include "../glm.hpp" +#include "../gtc/epsilon.hpp" +#include "../gtx/quaternion.hpp" +#include "../gtx/rotate_vector.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_vector_angle is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_vector_angle extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_vector_angle + /// @{ + + //! Returns the absolute angle between two vectors. + //! Parameters need to be normalized. + /// @see gtx_vector_angle extension. + template + GLM_FUNC_DECL T angle(vec const& x, vec const& y); + + //! Returns the oriented angle between two 2d vectors. + //! Parameters need to be normalized. + /// @see gtx_vector_angle extension. + template + GLM_FUNC_DECL T orientedAngle(vec<2, T, Q> const& x, vec<2, T, Q> const& y); + + //! Returns the oriented angle between two 3d vectors based from a reference axis. + //! Parameters need to be normalized. + /// @see gtx_vector_angle extension. + template + GLM_FUNC_DECL T orientedAngle(vec<3, T, Q> const& x, vec<3, T, Q> const& y, vec<3, T, Q> const& ref); + + /// @} +}// namespace glm + +#include "vector_angle.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/vector_angle.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/vector_angle.inl new file mode 100644 index 0000000000000000000000000000000000000000..faf0395fab152e1cb6441e8af2af7db263097f62 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/vector_angle.inl @@ -0,0 +1,45 @@ +/// @ref gtx_vector_angle + +namespace glm +{ + template + GLM_FUNC_QUALIFIER genType angle + ( + genType const& x, + genType const& y + ) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'angle' only accept floating-point inputs"); + return acos(clamp(dot(x, y), genType(-1), genType(1))); + } + + template + GLM_FUNC_QUALIFIER T angle(vec const& x, vec const& y) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'angle' only accept floating-point inputs"); + return acos(clamp(dot(x, y), T(-1), T(1))); + } + + template + GLM_FUNC_QUALIFIER T orientedAngle(vec<2, T, Q> const& x, vec<2, T, Q> const& y) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'orientedAngle' only accept floating-point inputs"); + T const Angle(acos(clamp(dot(x, y), T(-1), T(1)))); + + T const partialCross = x.x * y.y - y.x * x.y; + + if (partialCross > T(0)) + return Angle; + else + return -Angle; + } + + template + GLM_FUNC_QUALIFIER T orientedAngle(vec<3, T, Q> const& x, vec<3, T, Q> const& y, vec<3, T, Q> const& ref) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'orientedAngle' only accept floating-point inputs"); + + T const Angle(acos(clamp(dot(x, y), T(-1), T(1)))); + return mix(Angle, -Angle, dot(ref, cross(x, y)) < T(0)); + } +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/vector_query.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/vector_query.hpp new file mode 100644 index 0000000000000000000000000000000000000000..869552a899ab9cee010888046ffaeff6f5872ab9 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/vector_query.hpp @@ -0,0 +1,66 @@ +/// @ref gtx_vector_query +/// @file glm/gtx/vector_query.hpp +/// +/// @see core (dependence) +/// +/// @defgroup gtx_vector_query GLM_GTX_vector_query +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Query information of vector types + +#pragma once + +// Dependency: +#include "../glm.hpp" +#include +#include + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_vector_query is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_vector_query extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_vector_query + /// @{ + + //! Check whether two vectors are collinears. + /// @see gtx_vector_query extensions. + template + GLM_FUNC_DECL bool areCollinear(vec const& v0, vec const& v1, T const& epsilon); + + //! Check whether two vectors are orthogonals. + /// @see gtx_vector_query extensions. + template + GLM_FUNC_DECL bool areOrthogonal(vec const& v0, vec const& v1, T const& epsilon); + + //! Check whether a vector is normalized. + /// @see gtx_vector_query extensions. + template + GLM_FUNC_DECL bool isNormalized(vec const& v, T const& epsilon); + + //! Check whether a vector is null. + /// @see gtx_vector_query extensions. + template + GLM_FUNC_DECL bool isNull(vec const& v, T const& epsilon); + + //! Check whether a each component of a vector is null. + /// @see gtx_vector_query extensions. + template + GLM_FUNC_DECL vec isCompNull(vec const& v, T const& epsilon); + + //! Check whether two vectors are orthonormal. + /// @see gtx_vector_query extensions. + template + GLM_FUNC_DECL bool areOrthonormal(vec const& v0, vec const& v1, T const& epsilon); + + /// @} +}// namespace glm + +#include "vector_query.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/vector_query.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/vector_query.inl new file mode 100644 index 0000000000000000000000000000000000000000..8e1b62b107f83739ff5b523b8389b67cdd3d2f8a --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/vector_query.inl @@ -0,0 +1,154 @@ +/// @ref gtx_vector_query + +#include + +namespace glm{ +namespace detail +{ + template + struct compute_areCollinear{}; + + template + struct compute_areCollinear<2, T, Q> + { + GLM_FUNC_QUALIFIER static bool call(vec<2, T, Q> const& v0, vec<2, T, Q> const& v1, T const& epsilon) + { + return length(cross(vec<3, T, Q>(v0, static_cast(0)), vec<3, T, Q>(v1, static_cast(0)))) < epsilon; + } + }; + + template + struct compute_areCollinear<3, T, Q> + { + GLM_FUNC_QUALIFIER static bool call(vec<3, T, Q> const& v0, vec<3, T, Q> const& v1, T const& epsilon) + { + return length(cross(v0, v1)) < epsilon; + } + }; + + template + struct compute_areCollinear<4, T, Q> + { + GLM_FUNC_QUALIFIER static bool call(vec<4, T, Q> const& v0, vec<4, T, Q> const& v1, T const& epsilon) + { + return length(cross(vec<3, T, Q>(v0), vec<3, T, Q>(v1))) < epsilon; + } + }; + + template + struct compute_isCompNull{}; + + template + struct compute_isCompNull<2, T, Q> + { + GLM_FUNC_QUALIFIER static vec<2, bool, Q> call(vec<2, T, Q> const& v, T const& epsilon) + { + return vec<2, bool, Q>( + (abs(v.x) < epsilon), + (abs(v.y) < epsilon)); + } + }; + + template + struct compute_isCompNull<3, T, Q> + { + GLM_FUNC_QUALIFIER static vec<3, bool, Q> call(vec<3, T, Q> const& v, T const& epsilon) + { + return vec<3, bool, Q>( + (abs(v.x) < epsilon), + (abs(v.y) < epsilon), + (abs(v.z) < epsilon)); + } + }; + + template + struct compute_isCompNull<4, T, Q> + { + GLM_FUNC_QUALIFIER static vec<4, bool, Q> call(vec<4, T, Q> const& v, T const& epsilon) + { + return vec<4, bool, Q>( + (abs(v.x) < epsilon), + (abs(v.y) < epsilon), + (abs(v.z) < epsilon), + (abs(v.w) < epsilon)); + } + }; + +}//namespace detail + + template + GLM_FUNC_QUALIFIER bool areCollinear(vec const& v0, vec const& v1, T const& epsilon) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'areCollinear' only accept floating-point inputs"); + + return detail::compute_areCollinear::call(v0, v1, epsilon); + } + + template + GLM_FUNC_QUALIFIER bool areOrthogonal(vec const& v0, vec const& v1, T const& epsilon) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'areOrthogonal' only accept floating-point inputs"); + + return abs(dot(v0, v1)) <= max( + static_cast(1), + length(v0)) * max(static_cast(1), length(v1)) * epsilon; + } + + template + GLM_FUNC_QUALIFIER bool isNormalized(vec const& v, T const& epsilon) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'isNormalized' only accept floating-point inputs"); + + return abs(length(v) - static_cast(1)) <= static_cast(2) * epsilon; + } + + template + GLM_FUNC_QUALIFIER bool isNull(vec const& v, T const& epsilon) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'isNull' only accept floating-point inputs"); + + return length(v) <= epsilon; + } + + template + GLM_FUNC_QUALIFIER vec isCompNull(vec const& v, T const& epsilon) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'isCompNull' only accept floating-point inputs"); + + return detail::compute_isCompNull::call(v, epsilon); + } + + template + GLM_FUNC_QUALIFIER vec<2, bool, Q> isCompNull(vec<2, T, Q> const& v, T const& epsilon) + { + return vec<2, bool, Q>( + abs(v.x) < epsilon, + abs(v.y) < epsilon); + } + + template + GLM_FUNC_QUALIFIER vec<3, bool, Q> isCompNull(vec<3, T, Q> const& v, T const& epsilon) + { + return vec<3, bool, Q>( + abs(v.x) < epsilon, + abs(v.y) < epsilon, + abs(v.z) < epsilon); + } + + template + GLM_FUNC_QUALIFIER vec<4, bool, Q> isCompNull(vec<4, T, Q> const& v, T const& epsilon) + { + return vec<4, bool, Q>( + abs(v.x) < epsilon, + abs(v.y) < epsilon, + abs(v.z) < epsilon, + abs(v.w) < epsilon); + } + + template + GLM_FUNC_QUALIFIER bool areOrthonormal(vec const& v0, vec const& v1, T const& epsilon) + { + return isNormalized(v0, epsilon) && isNormalized(v1, epsilon) && (abs(dot(v0, v1)) <= epsilon); + } + +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/wrap.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/wrap.hpp new file mode 100644 index 0000000000000000000000000000000000000000..97a30d5cb0f47d4ca08f21c4ed2da465c372590a --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/wrap.hpp @@ -0,0 +1,37 @@ +/// @ref gtx_wrap +/// @file glm/gtx/wrap.hpp +/// +/// @see core (dependence) +/// +/// @defgroup gtx_wrap GLM_GTX_wrap +/// @ingroup gtx +/// +/// Include to use the features of this extension. +/// +/// Wrapping mode of texture coordinates. + +#pragma once + +// Dependency: +#include "../glm.hpp" +#include "../ext/scalar_common.hpp" +#include "../ext/vector_common.hpp" +#include "../gtc/vec1.hpp" + +#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) +# ifndef GLM_ENABLE_EXPERIMENTAL +# pragma message("GLM: GLM_GTX_wrap is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") +# else +# pragma message("GLM: GLM_GTX_wrap extension included") +# endif +#endif + +namespace glm +{ + /// @addtogroup gtx_wrap + /// @{ + + /// @} +}// namespace glm + +#include "wrap.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/wrap.inl b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/wrap.inl new file mode 100644 index 0000000000000000000000000000000000000000..aa407f5565f7c873e5c698a075af91f05cdda2e7 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/gtx/wrap.inl @@ -0,0 +1,6 @@ +/// @ref gtx_wrap + +namespace glm +{ + +}//namespace glm diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/integer.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/integer.hpp new file mode 100644 index 0000000000000000000000000000000000000000..1c822738af685a0df5335e5b480dafb05130ba4b --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/integer.hpp @@ -0,0 +1,212 @@ +/// @ref core +/// @file glm/integer.hpp +/// +/// @see GLSL 4.20.8 specification, section 8.8 Integer Functions +/// +/// @defgroup core_func_integer Integer functions +/// @ingroup core +/// +/// Provides GLSL functions on integer types +/// +/// These all operate component-wise. The description is per component. +/// The notation [a, b] means the set of bits from bit-number a through bit-number +/// b, inclusive. The lowest-order bit is bit 0. +/// +/// Include to use these core features. + +#pragma once + +#include "detail/qualifier.hpp" +#include "common.hpp" +#include "vector_relational.hpp" + +namespace glm +{ + /// @addtogroup core_func_integer + /// @{ + + /// Adds 32-bit unsigned integer x and y, returning the sum + /// modulo pow(2, 32). The value carry is set to 0 if the sum was + /// less than pow(2, 32), or to 1 otherwise. + /// + /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. + /// + /// @see GLSL uaddCarry man page + /// @see GLSL 4.20.8 specification, section 8.8 Integer Functions + template + GLM_FUNC_DECL vec uaddCarry( + vec const& x, + vec const& y, + vec & carry); + + /// Subtracts the 32-bit unsigned integer y from x, returning + /// the difference if non-negative, or pow(2, 32) plus the difference + /// otherwise. The value borrow is set to 0 if x >= y, or to 1 otherwise. + /// + /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. + /// + /// @see GLSL usubBorrow man page + /// @see GLSL 4.20.8 specification, section 8.8 Integer Functions + template + GLM_FUNC_DECL vec usubBorrow( + vec const& x, + vec const& y, + vec & borrow); + + /// Multiplies 32-bit integers x and y, producing a 64-bit + /// result. The 32 least-significant bits are returned in lsb. + /// The 32 most-significant bits are returned in msb. + /// + /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. + /// + /// @see GLSL umulExtended man page + /// @see GLSL 4.20.8 specification, section 8.8 Integer Functions + template + GLM_FUNC_DECL void umulExtended( + vec const& x, + vec const& y, + vec & msb, + vec & lsb); + + /// Multiplies 32-bit integers x and y, producing a 64-bit + /// result. The 32 least-significant bits are returned in lsb. + /// The 32 most-significant bits are returned in msb. + /// + /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. + /// + /// @see GLSL imulExtended man page + /// @see GLSL 4.20.8 specification, section 8.8 Integer Functions + template + GLM_FUNC_DECL void imulExtended( + vec const& x, + vec const& y, + vec & msb, + vec & lsb); + + /// Extracts bits [offset, offset + bits - 1] from value, + /// returning them in the least significant bits of the result. + /// For unsigned data types, the most significant bits of the + /// result will be set to zero. For signed data types, the + /// most significant bits will be set to the value of bit offset + base - 1. + /// + /// If bits is zero, the result will be zero. The result will be + /// undefined if offset or bits is negative, or if the sum of + /// offset and bits is greater than the number of bits used + /// to store the operand. + /// + /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. + /// @tparam T Signed or unsigned integer scalar types. + /// + /// @see GLSL bitfieldExtract man page + /// @see GLSL 4.20.8 specification, section 8.8 Integer Functions + template + GLM_FUNC_DECL vec bitfieldExtract( + vec const& Value, + int Offset, + int Bits); + + /// Returns the insertion the bits least-significant bits of insert into base. + /// + /// The result will have bits [offset, offset + bits - 1] taken + /// from bits [0, bits - 1] of insert, and all other bits taken + /// directly from the corresponding bits of base. If bits is + /// zero, the result will simply be base. The result will be + /// undefined if offset or bits is negative, or if the sum of + /// offset and bits is greater than the number of bits used to + /// store the operand. + /// + /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. + /// @tparam T Signed or unsigned integer scalar or vector types. + /// + /// @see GLSL bitfieldInsert man page + /// @see GLSL 4.20.8 specification, section 8.8 Integer Functions + template + GLM_FUNC_DECL vec bitfieldInsert( + vec const& Base, + vec const& Insert, + int Offset, + int Bits); + + /// Returns the reversal of the bits of value. + /// The bit numbered n of the result will be taken from bit (bits - 1) - n of value, + /// where bits is the total number of bits used to represent value. + /// + /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. + /// @tparam T Signed or unsigned integer scalar or vector types. + /// + /// @see GLSL bitfieldReverse man page + /// @see GLSL 4.20.8 specification, section 8.8 Integer Functions + template + GLM_FUNC_DECL vec bitfieldReverse(vec const& v); + + /// Returns the number of bits set to 1 in the binary representation of value. + /// + /// @tparam genType Signed or unsigned integer scalar or vector types. + /// + /// @see GLSL bitCount man page + /// @see GLSL 4.20.8 specification, section 8.8 Integer Functions + template + GLM_FUNC_DECL int bitCount(genType v); + + /// Returns the number of bits set to 1 in the binary representation of value. + /// + /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. + /// @tparam T Signed or unsigned integer scalar or vector types. + /// + /// @see GLSL bitCount man page + /// @see GLSL 4.20.8 specification, section 8.8 Integer Functions + template + GLM_FUNC_DECL vec bitCount(vec const& v); + + /// Returns the bit number of the least significant bit set to + /// 1 in the binary representation of value. + /// If value is zero, -1 will be returned. + /// + /// @tparam genIUType Signed or unsigned integer scalar types. + /// + /// @see GLSL findLSB man page + /// @see GLSL 4.20.8 specification, section 8.8 Integer Functions + template + GLM_FUNC_DECL int findLSB(genIUType x); + + /// Returns the bit number of the least significant bit set to + /// 1 in the binary representation of value. + /// If value is zero, -1 will be returned. + /// + /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. + /// @tparam T Signed or unsigned integer scalar types. + /// + /// @see GLSL findLSB man page + /// @see GLSL 4.20.8 specification, section 8.8 Integer Functions + template + GLM_FUNC_DECL vec findLSB(vec const& v); + + /// Returns the bit number of the most significant bit in the binary representation of value. + /// For positive integers, the result will be the bit number of the most significant bit set to 1. + /// For negative integers, the result will be the bit number of the most significant + /// bit set to 0. For a value of zero or negative one, -1 will be returned. + /// + /// @tparam genIUType Signed or unsigned integer scalar types. + /// + /// @see GLSL findMSB man page + /// @see GLSL 4.20.8 specification, section 8.8 Integer Functions + template + GLM_FUNC_DECL int findMSB(genIUType x); + + /// Returns the bit number of the most significant bit in the binary representation of value. + /// For positive integers, the result will be the bit number of the most significant bit set to 1. + /// For negative integers, the result will be the bit number of the most significant + /// bit set to 0. For a value of zero or negative one, -1 will be returned. + /// + /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. + /// @tparam T Signed or unsigned integer scalar types. + /// + /// @see GLSL findMSB man page + /// @see GLSL 4.20.8 specification, section 8.8 Integer Functions + template + GLM_FUNC_DECL vec findMSB(vec const& v); + + /// @} +}//namespace glm + +#include "detail/func_integer.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/mat2x2.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/mat2x2.hpp new file mode 100644 index 0000000000000000000000000000000000000000..542c1ff6be2ba6d5b95beb13871d2337a8f7dac1 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/mat2x2.hpp @@ -0,0 +1,9 @@ +/// @ref core +/// @file glm/mat2x2.hpp + +#pragma once +#include "./ext/matrix_double2x2.hpp" +#include "./ext/matrix_double2x2_precision.hpp" +#include "./ext/matrix_float2x2.hpp" +#include "./ext/matrix_float2x2_precision.hpp" + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/mat2x3.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/mat2x3.hpp new file mode 100644 index 0000000000000000000000000000000000000000..d4d29a723b5fc70bebe435669b5158f618db1114 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/mat2x3.hpp @@ -0,0 +1,9 @@ +/// @ref core +/// @file glm/mat2x3.hpp + +#pragma once +#include "./ext/matrix_double2x3.hpp" +#include "./ext/matrix_double2x3_precision.hpp" +#include "./ext/matrix_float2x3.hpp" +#include "./ext/matrix_float2x3_precision.hpp" + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/mat2x4.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/mat2x4.hpp new file mode 100644 index 0000000000000000000000000000000000000000..f16cad39469756fd6dfdbb743be5789331319381 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/mat2x4.hpp @@ -0,0 +1,9 @@ +/// @ref core +/// @file glm/mat2x4.hpp + +#pragma once +#include "./ext/matrix_double2x4.hpp" +#include "./ext/matrix_double2x4_precision.hpp" +#include "./ext/matrix_float2x4.hpp" +#include "./ext/matrix_float2x4_precision.hpp" + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/mat3x2.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/mat3x2.hpp new file mode 100644 index 0000000000000000000000000000000000000000..6374ecd292e9d1b5fc79641b302c7035221d12bf --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/mat3x2.hpp @@ -0,0 +1,9 @@ +/// @ref core +/// @file glm/mat3x2.hpp + +#pragma once +#include "./ext/matrix_double3x2.hpp" +#include "./ext/matrix_double3x2_precision.hpp" +#include "./ext/matrix_float3x2.hpp" +#include "./ext/matrix_float3x2_precision.hpp" + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/mat3x3.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/mat3x3.hpp new file mode 100644 index 0000000000000000000000000000000000000000..4cb5e3b396f91ee0d373bdaa6c68249686749df7 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/mat3x3.hpp @@ -0,0 +1,8 @@ +/// @ref core +/// @file glm/mat3x3.hpp + +#pragma once +#include "./ext/matrix_double3x3.hpp" +#include "./ext/matrix_double3x3_precision.hpp" +#include "./ext/matrix_float3x3.hpp" +#include "./ext/matrix_float3x3_precision.hpp" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/mat3x4.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/mat3x4.hpp new file mode 100644 index 0000000000000000000000000000000000000000..981ec11d40d4a7479789aa9d18a17d61a003b8a8 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/mat3x4.hpp @@ -0,0 +1,8 @@ +/// @ref core +/// @file glm/mat3x4.hpp + +#pragma once +#include "./ext/matrix_double3x4.hpp" +#include "./ext/matrix_double3x4_precision.hpp" +#include "./ext/matrix_float3x4.hpp" +#include "./ext/matrix_float3x4_precision.hpp" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/mat4x2.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/mat4x2.hpp new file mode 100644 index 0000000000000000000000000000000000000000..7bb11c43cc1968fd890a58c0a429f485184b4625 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/mat4x2.hpp @@ -0,0 +1,9 @@ +/// @ref core +/// @file glm/mat4x2.hpp + +#pragma once +#include "./ext/matrix_double4x2.hpp" +#include "./ext/matrix_double4x2_precision.hpp" +#include "./ext/matrix_float4x2.hpp" +#include "./ext/matrix_float4x2_precision.hpp" + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/mat4x3.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/mat4x3.hpp new file mode 100644 index 0000000000000000000000000000000000000000..57bf42e0f5587ea3c0c0c03cfbee5a3dc9808df0 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/mat4x3.hpp @@ -0,0 +1,8 @@ +/// @ref core +/// @file glm/mat4x3.hpp + +#pragma once +#include "./ext/matrix_double4x3.hpp" +#include "./ext/matrix_double4x3_precision.hpp" +#include "./ext/matrix_float4x3.hpp" +#include "./ext/matrix_float4x3_precision.hpp" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/mat4x4.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/mat4x4.hpp new file mode 100644 index 0000000000000000000000000000000000000000..a625ad3cb13d5f4f1bbfc059add51210b5eb3760 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/mat4x4.hpp @@ -0,0 +1,9 @@ +/// @ref core +/// @file glm/mat4x4.hpp + +#pragma once +#include "./ext/matrix_double4x4.hpp" +#include "./ext/matrix_double4x4_precision.hpp" +#include "./ext/matrix_float4x4.hpp" +#include "./ext/matrix_float4x4_precision.hpp" + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/matrix.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/matrix.hpp new file mode 100644 index 0000000000000000000000000000000000000000..5c6034bd57a8d4b4a4f65ea2e48a392c7fb86757 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/matrix.hpp @@ -0,0 +1,161 @@ +/// @ref core +/// @file glm/matrix.hpp +/// +/// @see GLSL 4.20.8 specification, section 8.6 Matrix Functions +/// +/// @defgroup core_func_matrix Matrix functions +/// @ingroup core +/// +/// Provides GLSL matrix functions. +/// +/// Include to use these core features. + +#pragma once + +// Dependencies +#include "detail/qualifier.hpp" +#include "detail/setup.hpp" +#include "vec2.hpp" +#include "vec3.hpp" +#include "vec4.hpp" +#include "mat2x2.hpp" +#include "mat2x3.hpp" +#include "mat2x4.hpp" +#include "mat3x2.hpp" +#include "mat3x3.hpp" +#include "mat3x4.hpp" +#include "mat4x2.hpp" +#include "mat4x3.hpp" +#include "mat4x4.hpp" + +namespace glm { +namespace detail +{ + template + struct outerProduct_trait{}; + + template + struct outerProduct_trait<2, 2, T, Q> + { + typedef mat<2, 2, T, Q> type; + }; + + template + struct outerProduct_trait<2, 3, T, Q> + { + typedef mat<3, 2, T, Q> type; + }; + + template + struct outerProduct_trait<2, 4, T, Q> + { + typedef mat<4, 2, T, Q> type; + }; + + template + struct outerProduct_trait<3, 2, T, Q> + { + typedef mat<2, 3, T, Q> type; + }; + + template + struct outerProduct_trait<3, 3, T, Q> + { + typedef mat<3, 3, T, Q> type; + }; + + template + struct outerProduct_trait<3, 4, T, Q> + { + typedef mat<4, 3, T, Q> type; + }; + + template + struct outerProduct_trait<4, 2, T, Q> + { + typedef mat<2, 4, T, Q> type; + }; + + template + struct outerProduct_trait<4, 3, T, Q> + { + typedef mat<3, 4, T, Q> type; + }; + + template + struct outerProduct_trait<4, 4, T, Q> + { + typedef mat<4, 4, T, Q> type; + }; +}//namespace detail + + /// @addtogroup core_func_matrix + /// @{ + + /// Multiply matrix x by matrix y component-wise, i.e., + /// result[i][j] is the scalar product of x[i][j] and y[i][j]. + /// + /// @tparam C Integer between 1 and 4 included that qualify the number a column + /// @tparam R Integer between 1 and 4 included that qualify the number a row + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see GLSL matrixCompMult man page + /// @see GLSL 4.20.8 specification, section 8.6 Matrix Functions + template + GLM_FUNC_DECL mat matrixCompMult(mat const& x, mat const& y); + + /// Treats the first parameter c as a column vector + /// and the second parameter r as a row vector + /// and does a linear algebraic matrix multiply c * r. + /// + /// @tparam C Integer between 1 and 4 included that qualify the number a column + /// @tparam R Integer between 1 and 4 included that qualify the number a row + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see GLSL outerProduct man page + /// @see GLSL 4.20.8 specification, section 8.6 Matrix Functions + template + GLM_FUNC_DECL typename detail::outerProduct_trait::type outerProduct(vec const& c, vec const& r); + + /// Returns the transposed matrix of x + /// + /// @tparam C Integer between 1 and 4 included that qualify the number a column + /// @tparam R Integer between 1 and 4 included that qualify the number a row + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see GLSL transpose man page + /// @see GLSL 4.20.8 specification, section 8.6 Matrix Functions + template + GLM_FUNC_DECL typename mat::transpose_type transpose(mat const& x); + + /// Return the determinant of a squared matrix. + /// + /// @tparam C Integer between 1 and 4 included that qualify the number a column + /// @tparam R Integer between 1 and 4 included that qualify the number a row + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see GLSL determinant man page + /// @see GLSL 4.20.8 specification, section 8.6 Matrix Functions + template + GLM_FUNC_DECL T determinant(mat const& m); + + /// Return the inverse of a squared matrix. + /// + /// @tparam C Integer between 1 and 4 included that qualify the number a column + /// @tparam R Integer between 1 and 4 included that qualify the number a row + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see GLSL inverse man page + /// @see GLSL 4.20.8 specification, section 8.6 Matrix Functions + template + GLM_FUNC_DECL mat inverse(mat const& m); + + /// @} +}//namespace glm + +#include "detail/func_matrix.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/packing.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/packing.hpp new file mode 100644 index 0000000000000000000000000000000000000000..66fc910b082311d2f3350b3ec55a5b53dd208a88 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/packing.hpp @@ -0,0 +1,173 @@ +/// @ref core +/// @file glm/packing.hpp +/// +/// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions +/// @see gtc_packing +/// +/// @defgroup core_func_packing Floating-Point Pack and Unpack Functions +/// @ingroup core +/// +/// Provides GLSL functions to pack and unpack half, single and double-precision floating point values into more compact integer types. +/// +/// These functions do not operate component-wise, rather as described in each case. +/// +/// Include to use these core features. + +#pragma once + +#include "./ext/vector_uint2.hpp" +#include "./ext/vector_float2.hpp" +#include "./ext/vector_float4.hpp" + +namespace glm +{ + /// @addtogroup core_func_packing + /// @{ + + /// First, converts each component of the normalized floating-point value v into 8- or 16-bit integer values. + /// Then, the results are packed into the returned 32-bit unsigned integer. + /// + /// The conversion for component c of v to fixed point is done as follows: + /// packUnorm2x16: round(clamp(c, 0, +1) * 65535.0) + /// + /// The first component of the vector will be written to the least significant bits of the output; + /// the last component will be written to the most significant bits. + /// + /// @see GLSL packUnorm2x16 man page + /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions + GLM_FUNC_DECL uint packUnorm2x16(vec2 const& v); + + /// First, converts each component of the normalized floating-point value v into 8- or 16-bit integer values. + /// Then, the results are packed into the returned 32-bit unsigned integer. + /// + /// The conversion for component c of v to fixed point is done as follows: + /// packSnorm2x16: round(clamp(v, -1, +1) * 32767.0) + /// + /// The first component of the vector will be written to the least significant bits of the output; + /// the last component will be written to the most significant bits. + /// + /// @see GLSL packSnorm2x16 man page + /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions + GLM_FUNC_DECL uint packSnorm2x16(vec2 const& v); + + /// First, converts each component of the normalized floating-point value v into 8- or 16-bit integer values. + /// Then, the results are packed into the returned 32-bit unsigned integer. + /// + /// The conversion for component c of v to fixed point is done as follows: + /// packUnorm4x8: round(clamp(c, 0, +1) * 255.0) + /// + /// The first component of the vector will be written to the least significant bits of the output; + /// the last component will be written to the most significant bits. + /// + /// @see GLSL packUnorm4x8 man page + /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions + GLM_FUNC_DECL uint packUnorm4x8(vec4 const& v); + + /// First, converts each component of the normalized floating-point value v into 8- or 16-bit integer values. + /// Then, the results are packed into the returned 32-bit unsigned integer. + /// + /// The conversion for component c of v to fixed point is done as follows: + /// packSnorm4x8: round(clamp(c, -1, +1) * 127.0) + /// + /// The first component of the vector will be written to the least significant bits of the output; + /// the last component will be written to the most significant bits. + /// + /// @see GLSL packSnorm4x8 man page + /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions + GLM_FUNC_DECL uint packSnorm4x8(vec4 const& v); + + /// First, unpacks a single 32-bit unsigned integer p into a pair of 16-bit unsigned integers, four 8-bit unsigned integers, or four 8-bit signed integers. + /// Then, each component is converted to a normalized floating-point value to generate the returned two- or four-component vector. + /// + /// The conversion for unpacked fixed-point value f to floating point is done as follows: + /// unpackUnorm2x16: f / 65535.0 + /// + /// The first component of the returned vector will be extracted from the least significant bits of the input; + /// the last component will be extracted from the most significant bits. + /// + /// @see GLSL unpackUnorm2x16 man page + /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions + GLM_FUNC_DECL vec2 unpackUnorm2x16(uint p); + + /// First, unpacks a single 32-bit unsigned integer p into a pair of 16-bit unsigned integers, four 8-bit unsigned integers, or four 8-bit signed integers. + /// Then, each component is converted to a normalized floating-point value to generate the returned two- or four-component vector. + /// + /// The conversion for unpacked fixed-point value f to floating point is done as follows: + /// unpackSnorm2x16: clamp(f / 32767.0, -1, +1) + /// + /// The first component of the returned vector will be extracted from the least significant bits of the input; + /// the last component will be extracted from the most significant bits. + /// + /// @see GLSL unpackSnorm2x16 man page + /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions + GLM_FUNC_DECL vec2 unpackSnorm2x16(uint p); + + /// First, unpacks a single 32-bit unsigned integer p into a pair of 16-bit unsigned integers, four 8-bit unsigned integers, or four 8-bit signed integers. + /// Then, each component is converted to a normalized floating-point value to generate the returned two- or four-component vector. + /// + /// The conversion for unpacked fixed-point value f to floating point is done as follows: + /// unpackUnorm4x8: f / 255.0 + /// + /// The first component of the returned vector will be extracted from the least significant bits of the input; + /// the last component will be extracted from the most significant bits. + /// + /// @see GLSL unpackUnorm4x8 man page + /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions + GLM_FUNC_DECL vec4 unpackUnorm4x8(uint p); + + /// First, unpacks a single 32-bit unsigned integer p into a pair of 16-bit unsigned integers, four 8-bit unsigned integers, or four 8-bit signed integers. + /// Then, each component is converted to a normalized floating-point value to generate the returned two- or four-component vector. + /// + /// The conversion for unpacked fixed-point value f to floating point is done as follows: + /// unpackSnorm4x8: clamp(f / 127.0, -1, +1) + /// + /// The first component of the returned vector will be extracted from the least significant bits of the input; + /// the last component will be extracted from the most significant bits. + /// + /// @see GLSL unpackSnorm4x8 man page + /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions + GLM_FUNC_DECL vec4 unpackSnorm4x8(uint p); + + /// Returns a double-qualifier value obtained by packing the components of v into a 64-bit value. + /// If an IEEE 754 Inf or NaN is created, it will not signal, and the resulting floating point value is unspecified. + /// Otherwise, the bit- level representation of v is preserved. + /// The first vector component specifies the 32 least significant bits; + /// the second component specifies the 32 most significant bits. + /// + /// @see GLSL packDouble2x32 man page + /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions + GLM_FUNC_DECL double packDouble2x32(uvec2 const& v); + + /// Returns a two-component unsigned integer vector representation of v. + /// The bit-level representation of v is preserved. + /// The first component of the vector contains the 32 least significant bits of the double; + /// the second component consists the 32 most significant bits. + /// + /// @see GLSL unpackDouble2x32 man page + /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions + GLM_FUNC_DECL uvec2 unpackDouble2x32(double v); + + /// Returns an unsigned integer obtained by converting the components of a two-component floating-point vector + /// to the 16-bit floating-point representation found in the OpenGL Specification, + /// and then packing these two 16- bit integers into a 32-bit unsigned integer. + /// The first vector component specifies the 16 least-significant bits of the result; + /// the second component specifies the 16 most-significant bits. + /// + /// @see GLSL packHalf2x16 man page + /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions + GLM_FUNC_DECL uint packHalf2x16(vec2 const& v); + + /// Returns a two-component floating-point vector with components obtained by unpacking a 32-bit unsigned integer into a pair of 16-bit values, + /// interpreting those values as 16-bit floating-point numbers according to the OpenGL Specification, + /// and converting them to 32-bit floating-point values. + /// The first component of the vector is obtained from the 16 least-significant bits of v; + /// the second component is obtained from the 16 most-significant bits of v. + /// + /// @see GLSL unpackHalf2x16 man page + /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions + GLM_FUNC_DECL vec2 unpackHalf2x16(uint v); + + /// @} +}//namespace glm + +#include "detail/func_packing.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/simd/common.h b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/simd/common.h new file mode 100644 index 0000000000000000000000000000000000000000..9352dc6b72de12de48543fdf5876c33a551f8dab --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/simd/common.h @@ -0,0 +1,240 @@ +/// @ref simd +/// @file glm/simd/common.h + +#pragma once + +#include "platform.h" + +#if GLM_ARCH & GLM_ARCH_SSE2_BIT + +GLM_FUNC_QUALIFIER glm_f32vec4 glm_vec4_add(glm_f32vec4 a, glm_f32vec4 b) +{ + return _mm_add_ps(a, b); +} + +GLM_FUNC_QUALIFIER glm_f32vec4 glm_vec1_add(glm_f32vec4 a, glm_f32vec4 b) +{ + return _mm_add_ss(a, b); +} + +GLM_FUNC_QUALIFIER glm_f32vec4 glm_vec4_sub(glm_f32vec4 a, glm_f32vec4 b) +{ + return _mm_sub_ps(a, b); +} + +GLM_FUNC_QUALIFIER glm_f32vec4 glm_vec1_sub(glm_f32vec4 a, glm_f32vec4 b) +{ + return _mm_sub_ss(a, b); +} + +GLM_FUNC_QUALIFIER glm_f32vec4 glm_vec4_mul(glm_f32vec4 a, glm_f32vec4 b) +{ + return _mm_mul_ps(a, b); +} + +GLM_FUNC_QUALIFIER glm_f32vec4 glm_vec1_mul(glm_f32vec4 a, glm_f32vec4 b) +{ + return _mm_mul_ss(a, b); +} + +GLM_FUNC_QUALIFIER glm_f32vec4 glm_vec4_div(glm_f32vec4 a, glm_f32vec4 b) +{ + return _mm_div_ps(a, b); +} + +GLM_FUNC_QUALIFIER glm_f32vec4 glm_vec1_div(glm_f32vec4 a, glm_f32vec4 b) +{ + return _mm_div_ss(a, b); +} + +GLM_FUNC_QUALIFIER glm_f32vec4 glm_vec4_div_lowp(glm_f32vec4 a, glm_f32vec4 b) +{ + return glm_vec4_mul(a, _mm_rcp_ps(b)); +} + +GLM_FUNC_QUALIFIER glm_f32vec4 glm_vec4_swizzle_xyzw(glm_f32vec4 a) +{ +# if GLM_ARCH & GLM_ARCH_AVX2_BIT + return _mm_permute_ps(a, _MM_SHUFFLE(3, 2, 1, 0)); +# else + return _mm_shuffle_ps(a, a, _MM_SHUFFLE(3, 2, 1, 0)); +# endif +} + +GLM_FUNC_QUALIFIER glm_f32vec4 glm_vec1_fma(glm_f32vec4 a, glm_f32vec4 b, glm_f32vec4 c) +{ +# if (GLM_ARCH & GLM_ARCH_AVX2_BIT) && !(GLM_COMPILER & GLM_COMPILER_CLANG) + return _mm_fmadd_ss(a, b, c); +# else + return _mm_add_ss(_mm_mul_ss(a, b), c); +# endif +} + +GLM_FUNC_QUALIFIER glm_f32vec4 glm_vec4_fma(glm_f32vec4 a, glm_f32vec4 b, glm_f32vec4 c) +{ +# if (GLM_ARCH & GLM_ARCH_AVX2_BIT) && !(GLM_COMPILER & GLM_COMPILER_CLANG) + return _mm_fmadd_ps(a, b, c); +# else + return glm_vec4_add(glm_vec4_mul(a, b), c); +# endif +} + +GLM_FUNC_QUALIFIER glm_f32vec4 glm_vec4_abs(glm_f32vec4 x) +{ + return _mm_and_ps(x, _mm_castsi128_ps(_mm_set1_epi32(0x7FFFFFFF))); +} + +GLM_FUNC_QUALIFIER glm_ivec4 glm_ivec4_abs(glm_ivec4 x) +{ +# if GLM_ARCH & GLM_ARCH_SSSE3_BIT + return _mm_sign_epi32(x, x); +# else + glm_ivec4 const sgn0 = _mm_srai_epi32(x, 31); + glm_ivec4 const inv0 = _mm_xor_si128(x, sgn0); + glm_ivec4 const sub0 = _mm_sub_epi32(inv0, sgn0); + return sub0; +# endif +} + +GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_sign(glm_vec4 x) +{ + glm_vec4 const zro0 = _mm_setzero_ps(); + glm_vec4 const cmp0 = _mm_cmplt_ps(x, zro0); + glm_vec4 const cmp1 = _mm_cmpgt_ps(x, zro0); + glm_vec4 const and0 = _mm_and_ps(cmp0, _mm_set1_ps(-1.0f)); + glm_vec4 const and1 = _mm_and_ps(cmp1, _mm_set1_ps(1.0f)); + glm_vec4 const or0 = _mm_or_ps(and0, and1); + return or0; +} + +GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_round(glm_vec4 x) +{ +# if GLM_ARCH & GLM_ARCH_SSE41_BIT + return _mm_round_ps(x, _MM_FROUND_TO_NEAREST_INT); +# else + glm_vec4 const sgn0 = _mm_castsi128_ps(_mm_set1_epi32(int(0x80000000))); + glm_vec4 const and0 = _mm_and_ps(sgn0, x); + glm_vec4 const or0 = _mm_or_ps(and0, _mm_set_ps1(8388608.0f)); + glm_vec4 const add0 = glm_vec4_add(x, or0); + glm_vec4 const sub0 = glm_vec4_sub(add0, or0); + return sub0; +# endif +} + +GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_floor(glm_vec4 x) +{ +# if GLM_ARCH & GLM_ARCH_SSE41_BIT + return _mm_floor_ps(x); +# else + glm_vec4 const rnd0 = glm_vec4_round(x); + glm_vec4 const cmp0 = _mm_cmplt_ps(x, rnd0); + glm_vec4 const and0 = _mm_and_ps(cmp0, _mm_set1_ps(1.0f)); + glm_vec4 const sub0 = glm_vec4_sub(rnd0, and0); + return sub0; +# endif +} + +/* trunc TODO +GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_trunc(glm_vec4 x) +{ + return glm_vec4(); +} +*/ + +//roundEven +GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_roundEven(glm_vec4 x) +{ + glm_vec4 const sgn0 = _mm_castsi128_ps(_mm_set1_epi32(int(0x80000000))); + glm_vec4 const and0 = _mm_and_ps(sgn0, x); + glm_vec4 const or0 = _mm_or_ps(and0, _mm_set_ps1(8388608.0f)); + glm_vec4 const add0 = glm_vec4_add(x, or0); + glm_vec4 const sub0 = glm_vec4_sub(add0, or0); + return sub0; +} + +GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_ceil(glm_vec4 x) +{ +# if GLM_ARCH & GLM_ARCH_SSE41_BIT + return _mm_ceil_ps(x); +# else + glm_vec4 const rnd0 = glm_vec4_round(x); + glm_vec4 const cmp0 = _mm_cmpgt_ps(x, rnd0); + glm_vec4 const and0 = _mm_and_ps(cmp0, _mm_set1_ps(1.0f)); + glm_vec4 const add0 = glm_vec4_add(rnd0, and0); + return add0; +# endif +} + +GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_fract(glm_vec4 x) +{ + glm_vec4 const flr0 = glm_vec4_floor(x); + glm_vec4 const sub0 = glm_vec4_sub(x, flr0); + return sub0; +} + +GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_mod(glm_vec4 x, glm_vec4 y) +{ + glm_vec4 const div0 = glm_vec4_div(x, y); + glm_vec4 const flr0 = glm_vec4_floor(div0); + glm_vec4 const mul0 = glm_vec4_mul(y, flr0); + glm_vec4 const sub0 = glm_vec4_sub(x, mul0); + return sub0; +} + +GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_clamp(glm_vec4 v, glm_vec4 minVal, glm_vec4 maxVal) +{ + glm_vec4 const min0 = _mm_min_ps(v, maxVal); + glm_vec4 const max0 = _mm_max_ps(min0, minVal); + return max0; +} + +GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_mix(glm_vec4 v1, glm_vec4 v2, glm_vec4 a) +{ + glm_vec4 const sub0 = glm_vec4_sub(_mm_set1_ps(1.0f), a); + glm_vec4 const mul0 = glm_vec4_mul(v1, sub0); + glm_vec4 const mad0 = glm_vec4_fma(v2, a, mul0); + return mad0; +} + +GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_step(glm_vec4 edge, glm_vec4 x) +{ + glm_vec4 const cmp = _mm_cmple_ps(x, edge); + return _mm_movemask_ps(cmp) == 0 ? _mm_set1_ps(1.0f) : _mm_setzero_ps(); +} + +GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_smoothstep(glm_vec4 edge0, glm_vec4 edge1, glm_vec4 x) +{ + glm_vec4 const sub0 = glm_vec4_sub(x, edge0); + glm_vec4 const sub1 = glm_vec4_sub(edge1, edge0); + glm_vec4 const div0 = glm_vec4_sub(sub0, sub1); + glm_vec4 const clp0 = glm_vec4_clamp(div0, _mm_setzero_ps(), _mm_set1_ps(1.0f)); + glm_vec4 const mul0 = glm_vec4_mul(_mm_set1_ps(2.0f), clp0); + glm_vec4 const sub2 = glm_vec4_sub(_mm_set1_ps(3.0f), mul0); + glm_vec4 const mul1 = glm_vec4_mul(clp0, clp0); + glm_vec4 const mul2 = glm_vec4_mul(mul1, sub2); + return mul2; +} + +// Agner Fog method +GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_nan(glm_vec4 x) +{ + glm_ivec4 const t1 = _mm_castps_si128(x); // reinterpret as 32-bit integer + glm_ivec4 const t2 = _mm_sll_epi32(t1, _mm_cvtsi32_si128(1)); // shift out sign bit + glm_ivec4 const t3 = _mm_set1_epi32(int(0xFF000000)); // exponent mask + glm_ivec4 const t4 = _mm_and_si128(t2, t3); // exponent + glm_ivec4 const t5 = _mm_andnot_si128(t3, t2); // fraction + glm_ivec4 const Equal = _mm_cmpeq_epi32(t3, t4); + glm_ivec4 const Nequal = _mm_cmpeq_epi32(t5, _mm_setzero_si128()); + glm_ivec4 const And = _mm_and_si128(Equal, Nequal); + return _mm_castsi128_ps(And); // exponent = all 1s and fraction != 0 +} + +// Agner Fog method +GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_inf(glm_vec4 x) +{ + glm_ivec4 const t1 = _mm_castps_si128(x); // reinterpret as 32-bit integer + glm_ivec4 const t2 = _mm_sll_epi32(t1, _mm_cvtsi32_si128(1)); // shift out sign bit + return _mm_castsi128_ps(_mm_cmpeq_epi32(t2, _mm_set1_epi32(int(0xFF000000)))); // exponent is all 1s, fraction is 0 +} + +#endif//GLM_ARCH & GLM_ARCH_SSE2_BIT diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/simd/exponential.h b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/simd/exponential.h new file mode 100644 index 0000000000000000000000000000000000000000..006db1e9e85b1fb3d56735274bb71d7f948845f1 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/simd/exponential.h @@ -0,0 +1,20 @@ +/// @ref simd +/// @file glm/simd/experimental.h + +#pragma once + +#include "platform.h" + +#if GLM_ARCH & GLM_ARCH_SSE2_BIT + +GLM_FUNC_QUALIFIER glm_f32vec4 glm_vec1_sqrt_lowp(glm_f32vec4 x) +{ + return _mm_mul_ss(_mm_rsqrt_ss(x), x); +} + +GLM_FUNC_QUALIFIER glm_f32vec4 glm_vec4_sqrt_lowp(glm_f32vec4 x) +{ + return _mm_mul_ps(_mm_rsqrt_ps(x), x); +} + +#endif//GLM_ARCH & GLM_ARCH_SSE2_BIT diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/simd/geometric.h b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/simd/geometric.h new file mode 100644 index 0000000000000000000000000000000000000000..fde57e91b42eb1713cae2d77bc4cb8500067c9cc --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/simd/geometric.h @@ -0,0 +1,124 @@ +/// @ref simd +/// @file glm/simd/geometric.h + +#pragma once + +#include "common.h" + +#if GLM_ARCH & GLM_ARCH_SSE2_BIT + +GLM_FUNC_DECL glm_vec4 glm_vec4_dot(glm_vec4 v1, glm_vec4 v2); +GLM_FUNC_DECL glm_vec4 glm_vec1_dot(glm_vec4 v1, glm_vec4 v2); + +GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_length(glm_vec4 x) +{ + glm_vec4 const dot0 = glm_vec4_dot(x, x); + glm_vec4 const sqt0 = _mm_sqrt_ps(dot0); + return sqt0; +} + +GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_distance(glm_vec4 p0, glm_vec4 p1) +{ + glm_vec4 const sub0 = _mm_sub_ps(p0, p1); + glm_vec4 const len0 = glm_vec4_length(sub0); + return len0; +} + +GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_dot(glm_vec4 v1, glm_vec4 v2) +{ +# if GLM_ARCH & GLM_ARCH_AVX_BIT + return _mm_dp_ps(v1, v2, 0xff); +# elif GLM_ARCH & GLM_ARCH_SSE3_BIT + glm_vec4 const mul0 = _mm_mul_ps(v1, v2); + glm_vec4 const hadd0 = _mm_hadd_ps(mul0, mul0); + glm_vec4 const hadd1 = _mm_hadd_ps(hadd0, hadd0); + return hadd1; +# else + glm_vec4 const mul0 = _mm_mul_ps(v1, v2); + glm_vec4 const swp0 = _mm_shuffle_ps(mul0, mul0, _MM_SHUFFLE(2, 3, 0, 1)); + glm_vec4 const add0 = _mm_add_ps(mul0, swp0); + glm_vec4 const swp1 = _mm_shuffle_ps(add0, add0, _MM_SHUFFLE(0, 1, 2, 3)); + glm_vec4 const add1 = _mm_add_ps(add0, swp1); + return add1; +# endif +} + +GLM_FUNC_QUALIFIER glm_vec4 glm_vec1_dot(glm_vec4 v1, glm_vec4 v2) +{ +# if GLM_ARCH & GLM_ARCH_AVX_BIT + return _mm_dp_ps(v1, v2, 0xff); +# elif GLM_ARCH & GLM_ARCH_SSE3_BIT + glm_vec4 const mul0 = _mm_mul_ps(v1, v2); + glm_vec4 const had0 = _mm_hadd_ps(mul0, mul0); + glm_vec4 const had1 = _mm_hadd_ps(had0, had0); + return had1; +# else + glm_vec4 const mul0 = _mm_mul_ps(v1, v2); + glm_vec4 const mov0 = _mm_movehl_ps(mul0, mul0); + glm_vec4 const add0 = _mm_add_ps(mov0, mul0); + glm_vec4 const swp1 = _mm_shuffle_ps(add0, add0, 1); + glm_vec4 const add1 = _mm_add_ss(add0, swp1); + return add1; +# endif +} + +GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_cross(glm_vec4 v1, glm_vec4 v2) +{ + glm_vec4 const swp0 = _mm_shuffle_ps(v1, v1, _MM_SHUFFLE(3, 0, 2, 1)); + glm_vec4 const swp1 = _mm_shuffle_ps(v1, v1, _MM_SHUFFLE(3, 1, 0, 2)); + glm_vec4 const swp2 = _mm_shuffle_ps(v2, v2, _MM_SHUFFLE(3, 0, 2, 1)); + glm_vec4 const swp3 = _mm_shuffle_ps(v2, v2, _MM_SHUFFLE(3, 1, 0, 2)); + glm_vec4 const mul0 = _mm_mul_ps(swp0, swp3); + glm_vec4 const mul1 = _mm_mul_ps(swp1, swp2); + glm_vec4 const sub0 = _mm_sub_ps(mul0, mul1); + return sub0; +} + +GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_normalize(glm_vec4 v) +{ + glm_vec4 const dot0 = glm_vec4_dot(v, v); + glm_vec4 const isr0 = _mm_rsqrt_ps(dot0); + glm_vec4 const mul0 = _mm_mul_ps(v, isr0); + return mul0; +} + +GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_faceforward(glm_vec4 N, glm_vec4 I, glm_vec4 Nref) +{ + glm_vec4 const dot0 = glm_vec4_dot(Nref, I); + glm_vec4 const sgn0 = glm_vec4_sign(dot0); + glm_vec4 const mul0 = _mm_mul_ps(sgn0, _mm_set1_ps(-1.0f)); + glm_vec4 const mul1 = _mm_mul_ps(N, mul0); + return mul1; +} + +GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_reflect(glm_vec4 I, glm_vec4 N) +{ + glm_vec4 const dot0 = glm_vec4_dot(N, I); + glm_vec4 const mul0 = _mm_mul_ps(N, dot0); + glm_vec4 const mul1 = _mm_mul_ps(mul0, _mm_set1_ps(2.0f)); + glm_vec4 const sub0 = _mm_sub_ps(I, mul1); + return sub0; +} + +GLM_FUNC_QUALIFIER __m128 glm_vec4_refract(glm_vec4 I, glm_vec4 N, glm_vec4 eta) +{ + glm_vec4 const dot0 = glm_vec4_dot(N, I); + glm_vec4 const mul0 = _mm_mul_ps(eta, eta); + glm_vec4 const mul1 = _mm_mul_ps(dot0, dot0); + glm_vec4 const sub0 = _mm_sub_ps(_mm_set1_ps(1.0f), mul0); + glm_vec4 const sub1 = _mm_sub_ps(_mm_set1_ps(1.0f), mul1); + glm_vec4 const mul2 = _mm_mul_ps(sub0, sub1); + + if(_mm_movemask_ps(_mm_cmplt_ss(mul2, _mm_set1_ps(0.0f))) == 0) + return _mm_set1_ps(0.0f); + + glm_vec4 const sqt0 = _mm_sqrt_ps(mul2); + glm_vec4 const mad0 = glm_vec4_fma(eta, dot0, sqt0); + glm_vec4 const mul4 = _mm_mul_ps(mad0, N); + glm_vec4 const mul5 = _mm_mul_ps(eta, I); + glm_vec4 const sub2 = _mm_sub_ps(mul5, mul4); + + return sub2; +} + +#endif//GLM_ARCH & GLM_ARCH_SSE2_BIT diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/simd/integer.h b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/simd/integer.h new file mode 100644 index 0000000000000000000000000000000000000000..8bb410e7591ce47ad2f741f9f5710a8700fc9d06 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/simd/integer.h @@ -0,0 +1,115 @@ +/// @ref simd +/// @file glm/simd/integer.h + +#pragma once + +#if GLM_ARCH & GLM_ARCH_SSE2_BIT + +GLM_FUNC_QUALIFIER glm_uvec4 glm_i128_interleave(glm_uvec4 x) +{ + glm_uvec4 const Mask4 = _mm_set1_epi32(0x0000FFFF); + glm_uvec4 const Mask3 = _mm_set1_epi32(0x00FF00FF); + glm_uvec4 const Mask2 = _mm_set1_epi32(0x0F0F0F0F); + glm_uvec4 const Mask1 = _mm_set1_epi32(0x33333333); + glm_uvec4 const Mask0 = _mm_set1_epi32(0x55555555); + + glm_uvec4 Reg1; + glm_uvec4 Reg2; + + // REG1 = x; + // REG2 = y; + //Reg1 = _mm_unpacklo_epi64(x, y); + Reg1 = x; + + //REG1 = ((REG1 << 16) | REG1) & glm::uint64(0x0000FFFF0000FFFF); + //REG2 = ((REG2 << 16) | REG2) & glm::uint64(0x0000FFFF0000FFFF); + Reg2 = _mm_slli_si128(Reg1, 2); + Reg1 = _mm_or_si128(Reg2, Reg1); + Reg1 = _mm_and_si128(Reg1, Mask4); + + //REG1 = ((REG1 << 8) | REG1) & glm::uint64(0x00FF00FF00FF00FF); + //REG2 = ((REG2 << 8) | REG2) & glm::uint64(0x00FF00FF00FF00FF); + Reg2 = _mm_slli_si128(Reg1, 1); + Reg1 = _mm_or_si128(Reg2, Reg1); + Reg1 = _mm_and_si128(Reg1, Mask3); + + //REG1 = ((REG1 << 4) | REG1) & glm::uint64(0x0F0F0F0F0F0F0F0F); + //REG2 = ((REG2 << 4) | REG2) & glm::uint64(0x0F0F0F0F0F0F0F0F); + Reg2 = _mm_slli_epi32(Reg1, 4); + Reg1 = _mm_or_si128(Reg2, Reg1); + Reg1 = _mm_and_si128(Reg1, Mask2); + + //REG1 = ((REG1 << 2) | REG1) & glm::uint64(0x3333333333333333); + //REG2 = ((REG2 << 2) | REG2) & glm::uint64(0x3333333333333333); + Reg2 = _mm_slli_epi32(Reg1, 2); + Reg1 = _mm_or_si128(Reg2, Reg1); + Reg1 = _mm_and_si128(Reg1, Mask1); + + //REG1 = ((REG1 << 1) | REG1) & glm::uint64(0x5555555555555555); + //REG2 = ((REG2 << 1) | REG2) & glm::uint64(0x5555555555555555); + Reg2 = _mm_slli_epi32(Reg1, 1); + Reg1 = _mm_or_si128(Reg2, Reg1); + Reg1 = _mm_and_si128(Reg1, Mask0); + + //return REG1 | (REG2 << 1); + Reg2 = _mm_slli_epi32(Reg1, 1); + Reg2 = _mm_srli_si128(Reg2, 8); + Reg1 = _mm_or_si128(Reg1, Reg2); + + return Reg1; +} + +GLM_FUNC_QUALIFIER glm_uvec4 glm_i128_interleave2(glm_uvec4 x, glm_uvec4 y) +{ + glm_uvec4 const Mask4 = _mm_set1_epi32(0x0000FFFF); + glm_uvec4 const Mask3 = _mm_set1_epi32(0x00FF00FF); + glm_uvec4 const Mask2 = _mm_set1_epi32(0x0F0F0F0F); + glm_uvec4 const Mask1 = _mm_set1_epi32(0x33333333); + glm_uvec4 const Mask0 = _mm_set1_epi32(0x55555555); + + glm_uvec4 Reg1; + glm_uvec4 Reg2; + + // REG1 = x; + // REG2 = y; + Reg1 = _mm_unpacklo_epi64(x, y); + + //REG1 = ((REG1 << 16) | REG1) & glm::uint64(0x0000FFFF0000FFFF); + //REG2 = ((REG2 << 16) | REG2) & glm::uint64(0x0000FFFF0000FFFF); + Reg2 = _mm_slli_si128(Reg1, 2); + Reg1 = _mm_or_si128(Reg2, Reg1); + Reg1 = _mm_and_si128(Reg1, Mask4); + + //REG1 = ((REG1 << 8) | REG1) & glm::uint64(0x00FF00FF00FF00FF); + //REG2 = ((REG2 << 8) | REG2) & glm::uint64(0x00FF00FF00FF00FF); + Reg2 = _mm_slli_si128(Reg1, 1); + Reg1 = _mm_or_si128(Reg2, Reg1); + Reg1 = _mm_and_si128(Reg1, Mask3); + + //REG1 = ((REG1 << 4) | REG1) & glm::uint64(0x0F0F0F0F0F0F0F0F); + //REG2 = ((REG2 << 4) | REG2) & glm::uint64(0x0F0F0F0F0F0F0F0F); + Reg2 = _mm_slli_epi32(Reg1, 4); + Reg1 = _mm_or_si128(Reg2, Reg1); + Reg1 = _mm_and_si128(Reg1, Mask2); + + //REG1 = ((REG1 << 2) | REG1) & glm::uint64(0x3333333333333333); + //REG2 = ((REG2 << 2) | REG2) & glm::uint64(0x3333333333333333); + Reg2 = _mm_slli_epi32(Reg1, 2); + Reg1 = _mm_or_si128(Reg2, Reg1); + Reg1 = _mm_and_si128(Reg1, Mask1); + + //REG1 = ((REG1 << 1) | REG1) & glm::uint64(0x5555555555555555); + //REG2 = ((REG2 << 1) | REG2) & glm::uint64(0x5555555555555555); + Reg2 = _mm_slli_epi32(Reg1, 1); + Reg1 = _mm_or_si128(Reg2, Reg1); + Reg1 = _mm_and_si128(Reg1, Mask0); + + //return REG1 | (REG2 << 1); + Reg2 = _mm_slli_epi32(Reg1, 1); + Reg2 = _mm_srli_si128(Reg2, 8); + Reg1 = _mm_or_si128(Reg1, Reg2); + + return Reg1; +} + +#endif//GLM_ARCH & GLM_ARCH_SSE2_BIT diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/simd/matrix.h b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/simd/matrix.h new file mode 100644 index 0000000000000000000000000000000000000000..9cc629bbd9e17334cbed4c1f3ebb2d72d7969083 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/simd/matrix.h @@ -0,0 +1,1028 @@ +/// @ref simd +/// @file glm/simd/matrix.h + +#pragma once + +#include "geometric.h" + +#if GLM_ARCH & GLM_ARCH_SSE2_BIT + +GLM_FUNC_QUALIFIER void glm_mat4_matrixCompMult(glm_vec4 const in1[4], glm_vec4 const in2[4], glm_vec4 out[4]) +{ + out[0] = _mm_mul_ps(in1[0], in2[0]); + out[1] = _mm_mul_ps(in1[1], in2[1]); + out[2] = _mm_mul_ps(in1[2], in2[2]); + out[3] = _mm_mul_ps(in1[3], in2[3]); +} + +GLM_FUNC_QUALIFIER void glm_mat4_add(glm_vec4 const in1[4], glm_vec4 const in2[4], glm_vec4 out[4]) +{ + out[0] = _mm_add_ps(in1[0], in2[0]); + out[1] = _mm_add_ps(in1[1], in2[1]); + out[2] = _mm_add_ps(in1[2], in2[2]); + out[3] = _mm_add_ps(in1[3], in2[3]); +} + +GLM_FUNC_QUALIFIER void glm_mat4_sub(glm_vec4 const in1[4], glm_vec4 const in2[4], glm_vec4 out[4]) +{ + out[0] = _mm_sub_ps(in1[0], in2[0]); + out[1] = _mm_sub_ps(in1[1], in2[1]); + out[2] = _mm_sub_ps(in1[2], in2[2]); + out[3] = _mm_sub_ps(in1[3], in2[3]); +} + +GLM_FUNC_QUALIFIER glm_vec4 glm_mat4_mul_vec4(glm_vec4 const m[4], glm_vec4 v) +{ + __m128 v0 = _mm_shuffle_ps(v, v, _MM_SHUFFLE(0, 0, 0, 0)); + __m128 v1 = _mm_shuffle_ps(v, v, _MM_SHUFFLE(1, 1, 1, 1)); + __m128 v2 = _mm_shuffle_ps(v, v, _MM_SHUFFLE(2, 2, 2, 2)); + __m128 v3 = _mm_shuffle_ps(v, v, _MM_SHUFFLE(3, 3, 3, 3)); + + __m128 m0 = _mm_mul_ps(m[0], v0); + __m128 m1 = _mm_mul_ps(m[1], v1); + __m128 m2 = _mm_mul_ps(m[2], v2); + __m128 m3 = _mm_mul_ps(m[3], v3); + + __m128 a0 = _mm_add_ps(m0, m1); + __m128 a1 = _mm_add_ps(m2, m3); + __m128 a2 = _mm_add_ps(a0, a1); + + return a2; +} + +GLM_FUNC_QUALIFIER __m128 glm_vec4_mul_mat4(glm_vec4 v, glm_vec4 const m[4]) +{ + __m128 i0 = m[0]; + __m128 i1 = m[1]; + __m128 i2 = m[2]; + __m128 i3 = m[3]; + + __m128 m0 = _mm_mul_ps(v, i0); + __m128 m1 = _mm_mul_ps(v, i1); + __m128 m2 = _mm_mul_ps(v, i2); + __m128 m3 = _mm_mul_ps(v, i3); + + __m128 u0 = _mm_unpacklo_ps(m0, m1); + __m128 u1 = _mm_unpackhi_ps(m0, m1); + __m128 a0 = _mm_add_ps(u0, u1); + + __m128 u2 = _mm_unpacklo_ps(m2, m3); + __m128 u3 = _mm_unpackhi_ps(m2, m3); + __m128 a1 = _mm_add_ps(u2, u3); + + __m128 f0 = _mm_movelh_ps(a0, a1); + __m128 f1 = _mm_movehl_ps(a1, a0); + __m128 f2 = _mm_add_ps(f0, f1); + + return f2; +} + +GLM_FUNC_QUALIFIER void glm_mat4_mul(glm_vec4 const in1[4], glm_vec4 const in2[4], glm_vec4 out[4]) +{ + { + __m128 e0 = _mm_shuffle_ps(in2[0], in2[0], _MM_SHUFFLE(0, 0, 0, 0)); + __m128 e1 = _mm_shuffle_ps(in2[0], in2[0], _MM_SHUFFLE(1, 1, 1, 1)); + __m128 e2 = _mm_shuffle_ps(in2[0], in2[0], _MM_SHUFFLE(2, 2, 2, 2)); + __m128 e3 = _mm_shuffle_ps(in2[0], in2[0], _MM_SHUFFLE(3, 3, 3, 3)); + + __m128 m0 = _mm_mul_ps(in1[0], e0); + __m128 m1 = _mm_mul_ps(in1[1], e1); + __m128 m2 = _mm_mul_ps(in1[2], e2); + __m128 m3 = _mm_mul_ps(in1[3], e3); + + __m128 a0 = _mm_add_ps(m0, m1); + __m128 a1 = _mm_add_ps(m2, m3); + __m128 a2 = _mm_add_ps(a0, a1); + + out[0] = a2; + } + + { + __m128 e0 = _mm_shuffle_ps(in2[1], in2[1], _MM_SHUFFLE(0, 0, 0, 0)); + __m128 e1 = _mm_shuffle_ps(in2[1], in2[1], _MM_SHUFFLE(1, 1, 1, 1)); + __m128 e2 = _mm_shuffle_ps(in2[1], in2[1], _MM_SHUFFLE(2, 2, 2, 2)); + __m128 e3 = _mm_shuffle_ps(in2[1], in2[1], _MM_SHUFFLE(3, 3, 3, 3)); + + __m128 m0 = _mm_mul_ps(in1[0], e0); + __m128 m1 = _mm_mul_ps(in1[1], e1); + __m128 m2 = _mm_mul_ps(in1[2], e2); + __m128 m3 = _mm_mul_ps(in1[3], e3); + + __m128 a0 = _mm_add_ps(m0, m1); + __m128 a1 = _mm_add_ps(m2, m3); + __m128 a2 = _mm_add_ps(a0, a1); + + out[1] = a2; + } + + { + __m128 e0 = _mm_shuffle_ps(in2[2], in2[2], _MM_SHUFFLE(0, 0, 0, 0)); + __m128 e1 = _mm_shuffle_ps(in2[2], in2[2], _MM_SHUFFLE(1, 1, 1, 1)); + __m128 e2 = _mm_shuffle_ps(in2[2], in2[2], _MM_SHUFFLE(2, 2, 2, 2)); + __m128 e3 = _mm_shuffle_ps(in2[2], in2[2], _MM_SHUFFLE(3, 3, 3, 3)); + + __m128 m0 = _mm_mul_ps(in1[0], e0); + __m128 m1 = _mm_mul_ps(in1[1], e1); + __m128 m2 = _mm_mul_ps(in1[2], e2); + __m128 m3 = _mm_mul_ps(in1[3], e3); + + __m128 a0 = _mm_add_ps(m0, m1); + __m128 a1 = _mm_add_ps(m2, m3); + __m128 a2 = _mm_add_ps(a0, a1); + + out[2] = a2; + } + + { + //(__m128&)_mm_shuffle_epi32(__m128i&)in2[0], _MM_SHUFFLE(3, 3, 3, 3)) + __m128 e0 = _mm_shuffle_ps(in2[3], in2[3], _MM_SHUFFLE(0, 0, 0, 0)); + __m128 e1 = _mm_shuffle_ps(in2[3], in2[3], _MM_SHUFFLE(1, 1, 1, 1)); + __m128 e2 = _mm_shuffle_ps(in2[3], in2[3], _MM_SHUFFLE(2, 2, 2, 2)); + __m128 e3 = _mm_shuffle_ps(in2[3], in2[3], _MM_SHUFFLE(3, 3, 3, 3)); + + __m128 m0 = _mm_mul_ps(in1[0], e0); + __m128 m1 = _mm_mul_ps(in1[1], e1); + __m128 m2 = _mm_mul_ps(in1[2], e2); + __m128 m3 = _mm_mul_ps(in1[3], e3); + + __m128 a0 = _mm_add_ps(m0, m1); + __m128 a1 = _mm_add_ps(m2, m3); + __m128 a2 = _mm_add_ps(a0, a1); + + out[3] = a2; + } +} + +GLM_FUNC_QUALIFIER void glm_mat4_transpose(glm_vec4 const in[4], glm_vec4 out[4]) +{ + __m128 tmp0 = _mm_shuffle_ps(in[0], in[1], 0x44); + __m128 tmp2 = _mm_shuffle_ps(in[0], in[1], 0xEE); + __m128 tmp1 = _mm_shuffle_ps(in[2], in[3], 0x44); + __m128 tmp3 = _mm_shuffle_ps(in[2], in[3], 0xEE); + + out[0] = _mm_shuffle_ps(tmp0, tmp1, 0x88); + out[1] = _mm_shuffle_ps(tmp0, tmp1, 0xDD); + out[2] = _mm_shuffle_ps(tmp2, tmp3, 0x88); + out[3] = _mm_shuffle_ps(tmp2, tmp3, 0xDD); +} + +GLM_FUNC_QUALIFIER glm_vec4 glm_mat4_determinant_highp(glm_vec4 const in[4]) +{ + __m128 Fac0; + { + // valType SubFactor00 = m[2][2] * m[3][3] - m[3][2] * m[2][3]; + // valType SubFactor00 = m[2][2] * m[3][3] - m[3][2] * m[2][3]; + // valType SubFactor06 = m[1][2] * m[3][3] - m[3][2] * m[1][3]; + // valType SubFactor13 = m[1][2] * m[2][3] - m[2][2] * m[1][3]; + + __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(3, 3, 3, 3)); + __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(2, 2, 2, 2)); + + __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(2, 2, 2, 2)); + __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0)); + __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0)); + __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(3, 3, 3, 3)); + + __m128 Mul00 = _mm_mul_ps(Swp00, Swp01); + __m128 Mul01 = _mm_mul_ps(Swp02, Swp03); + Fac0 = _mm_sub_ps(Mul00, Mul01); + } + + __m128 Fac1; + { + // valType SubFactor01 = m[2][1] * m[3][3] - m[3][1] * m[2][3]; + // valType SubFactor01 = m[2][1] * m[3][3] - m[3][1] * m[2][3]; + // valType SubFactor07 = m[1][1] * m[3][3] - m[3][1] * m[1][3]; + // valType SubFactor14 = m[1][1] * m[2][3] - m[2][1] * m[1][3]; + + __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(3, 3, 3, 3)); + __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(1, 1, 1, 1)); + + __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(1, 1, 1, 1)); + __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0)); + __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0)); + __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(3, 3, 3, 3)); + + __m128 Mul00 = _mm_mul_ps(Swp00, Swp01); + __m128 Mul01 = _mm_mul_ps(Swp02, Swp03); + Fac1 = _mm_sub_ps(Mul00, Mul01); + } + + + __m128 Fac2; + { + // valType SubFactor02 = m[2][1] * m[3][2] - m[3][1] * m[2][2]; + // valType SubFactor02 = m[2][1] * m[3][2] - m[3][1] * m[2][2]; + // valType SubFactor08 = m[1][1] * m[3][2] - m[3][1] * m[1][2]; + // valType SubFactor15 = m[1][1] * m[2][2] - m[2][1] * m[1][2]; + + __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(2, 2, 2, 2)); + __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(1, 1, 1, 1)); + + __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(1, 1, 1, 1)); + __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0)); + __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0)); + __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(2, 2, 2, 2)); + + __m128 Mul00 = _mm_mul_ps(Swp00, Swp01); + __m128 Mul01 = _mm_mul_ps(Swp02, Swp03); + Fac2 = _mm_sub_ps(Mul00, Mul01); + } + + __m128 Fac3; + { + // valType SubFactor03 = m[2][0] * m[3][3] - m[3][0] * m[2][3]; + // valType SubFactor03 = m[2][0] * m[3][3] - m[3][0] * m[2][3]; + // valType SubFactor09 = m[1][0] * m[3][3] - m[3][0] * m[1][3]; + // valType SubFactor16 = m[1][0] * m[2][3] - m[2][0] * m[1][3]; + + __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(3, 3, 3, 3)); + __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(0, 0, 0, 0)); + + __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(0, 0, 0, 0)); + __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0)); + __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0)); + __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(3, 3, 3, 3)); + + __m128 Mul00 = _mm_mul_ps(Swp00, Swp01); + __m128 Mul01 = _mm_mul_ps(Swp02, Swp03); + Fac3 = _mm_sub_ps(Mul00, Mul01); + } + + __m128 Fac4; + { + // valType SubFactor04 = m[2][0] * m[3][2] - m[3][0] * m[2][2]; + // valType SubFactor04 = m[2][0] * m[3][2] - m[3][0] * m[2][2]; + // valType SubFactor10 = m[1][0] * m[3][2] - m[3][0] * m[1][2]; + // valType SubFactor17 = m[1][0] * m[2][2] - m[2][0] * m[1][2]; + + __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(2, 2, 2, 2)); + __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(0, 0, 0, 0)); + + __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(0, 0, 0, 0)); + __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0)); + __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0)); + __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(2, 2, 2, 2)); + + __m128 Mul00 = _mm_mul_ps(Swp00, Swp01); + __m128 Mul01 = _mm_mul_ps(Swp02, Swp03); + Fac4 = _mm_sub_ps(Mul00, Mul01); + } + + __m128 Fac5; + { + // valType SubFactor05 = m[2][0] * m[3][1] - m[3][0] * m[2][1]; + // valType SubFactor05 = m[2][0] * m[3][1] - m[3][0] * m[2][1]; + // valType SubFactor12 = m[1][0] * m[3][1] - m[3][0] * m[1][1]; + // valType SubFactor18 = m[1][0] * m[2][1] - m[2][0] * m[1][1]; + + __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(1, 1, 1, 1)); + __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(0, 0, 0, 0)); + + __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(0, 0, 0, 0)); + __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0)); + __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0)); + __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(1, 1, 1, 1)); + + __m128 Mul00 = _mm_mul_ps(Swp00, Swp01); + __m128 Mul01 = _mm_mul_ps(Swp02, Swp03); + Fac5 = _mm_sub_ps(Mul00, Mul01); + } + + __m128 SignA = _mm_set_ps( 1.0f,-1.0f, 1.0f,-1.0f); + __m128 SignB = _mm_set_ps(-1.0f, 1.0f,-1.0f, 1.0f); + + // m[1][0] + // m[0][0] + // m[0][0] + // m[0][0] + __m128 Temp0 = _mm_shuffle_ps(in[1], in[0], _MM_SHUFFLE(0, 0, 0, 0)); + __m128 Vec0 = _mm_shuffle_ps(Temp0, Temp0, _MM_SHUFFLE(2, 2, 2, 0)); + + // m[1][1] + // m[0][1] + // m[0][1] + // m[0][1] + __m128 Temp1 = _mm_shuffle_ps(in[1], in[0], _MM_SHUFFLE(1, 1, 1, 1)); + __m128 Vec1 = _mm_shuffle_ps(Temp1, Temp1, _MM_SHUFFLE(2, 2, 2, 0)); + + // m[1][2] + // m[0][2] + // m[0][2] + // m[0][2] + __m128 Temp2 = _mm_shuffle_ps(in[1], in[0], _MM_SHUFFLE(2, 2, 2, 2)); + __m128 Vec2 = _mm_shuffle_ps(Temp2, Temp2, _MM_SHUFFLE(2, 2, 2, 0)); + + // m[1][3] + // m[0][3] + // m[0][3] + // m[0][3] + __m128 Temp3 = _mm_shuffle_ps(in[1], in[0], _MM_SHUFFLE(3, 3, 3, 3)); + __m128 Vec3 = _mm_shuffle_ps(Temp3, Temp3, _MM_SHUFFLE(2, 2, 2, 0)); + + // col0 + // + (Vec1[0] * Fac0[0] - Vec2[0] * Fac1[0] + Vec3[0] * Fac2[0]), + // - (Vec1[1] * Fac0[1] - Vec2[1] * Fac1[1] + Vec3[1] * Fac2[1]), + // + (Vec1[2] * Fac0[2] - Vec2[2] * Fac1[2] + Vec3[2] * Fac2[2]), + // - (Vec1[3] * Fac0[3] - Vec2[3] * Fac1[3] + Vec3[3] * Fac2[3]), + __m128 Mul00 = _mm_mul_ps(Vec1, Fac0); + __m128 Mul01 = _mm_mul_ps(Vec2, Fac1); + __m128 Mul02 = _mm_mul_ps(Vec3, Fac2); + __m128 Sub00 = _mm_sub_ps(Mul00, Mul01); + __m128 Add00 = _mm_add_ps(Sub00, Mul02); + __m128 Inv0 = _mm_mul_ps(SignB, Add00); + + // col1 + // - (Vec0[0] * Fac0[0] - Vec2[0] * Fac3[0] + Vec3[0] * Fac4[0]), + // + (Vec0[0] * Fac0[1] - Vec2[1] * Fac3[1] + Vec3[1] * Fac4[1]), + // - (Vec0[0] * Fac0[2] - Vec2[2] * Fac3[2] + Vec3[2] * Fac4[2]), + // + (Vec0[0] * Fac0[3] - Vec2[3] * Fac3[3] + Vec3[3] * Fac4[3]), + __m128 Mul03 = _mm_mul_ps(Vec0, Fac0); + __m128 Mul04 = _mm_mul_ps(Vec2, Fac3); + __m128 Mul05 = _mm_mul_ps(Vec3, Fac4); + __m128 Sub01 = _mm_sub_ps(Mul03, Mul04); + __m128 Add01 = _mm_add_ps(Sub01, Mul05); + __m128 Inv1 = _mm_mul_ps(SignA, Add01); + + // col2 + // + (Vec0[0] * Fac1[0] - Vec1[0] * Fac3[0] + Vec3[0] * Fac5[0]), + // - (Vec0[0] * Fac1[1] - Vec1[1] * Fac3[1] + Vec3[1] * Fac5[1]), + // + (Vec0[0] * Fac1[2] - Vec1[2] * Fac3[2] + Vec3[2] * Fac5[2]), + // - (Vec0[0] * Fac1[3] - Vec1[3] * Fac3[3] + Vec3[3] * Fac5[3]), + __m128 Mul06 = _mm_mul_ps(Vec0, Fac1); + __m128 Mul07 = _mm_mul_ps(Vec1, Fac3); + __m128 Mul08 = _mm_mul_ps(Vec3, Fac5); + __m128 Sub02 = _mm_sub_ps(Mul06, Mul07); + __m128 Add02 = _mm_add_ps(Sub02, Mul08); + __m128 Inv2 = _mm_mul_ps(SignB, Add02); + + // col3 + // - (Vec1[0] * Fac2[0] - Vec1[0] * Fac4[0] + Vec2[0] * Fac5[0]), + // + (Vec1[0] * Fac2[1] - Vec1[1] * Fac4[1] + Vec2[1] * Fac5[1]), + // - (Vec1[0] * Fac2[2] - Vec1[2] * Fac4[2] + Vec2[2] * Fac5[2]), + // + (Vec1[0] * Fac2[3] - Vec1[3] * Fac4[3] + Vec2[3] * Fac5[3])); + __m128 Mul09 = _mm_mul_ps(Vec0, Fac2); + __m128 Mul10 = _mm_mul_ps(Vec1, Fac4); + __m128 Mul11 = _mm_mul_ps(Vec2, Fac5); + __m128 Sub03 = _mm_sub_ps(Mul09, Mul10); + __m128 Add03 = _mm_add_ps(Sub03, Mul11); + __m128 Inv3 = _mm_mul_ps(SignA, Add03); + + __m128 Row0 = _mm_shuffle_ps(Inv0, Inv1, _MM_SHUFFLE(0, 0, 0, 0)); + __m128 Row1 = _mm_shuffle_ps(Inv2, Inv3, _MM_SHUFFLE(0, 0, 0, 0)); + __m128 Row2 = _mm_shuffle_ps(Row0, Row1, _MM_SHUFFLE(2, 0, 2, 0)); + + // valType Determinant = m[0][0] * Inverse[0][0] + // + m[0][1] * Inverse[1][0] + // + m[0][2] * Inverse[2][0] + // + m[0][3] * Inverse[3][0]; + __m128 Det0 = glm_vec4_dot(in[0], Row2); + return Det0; +} + +GLM_FUNC_QUALIFIER glm_vec4 glm_mat4_determinant_lowp(glm_vec4 const m[4]) +{ + // _mm_castsi128_ps(_mm_shuffle_epi32(_mm_castps_si128( + + //T SubFactor00 = m[2][2] * m[3][3] - m[3][2] * m[2][3]; + //T SubFactor01 = m[2][1] * m[3][3] - m[3][1] * m[2][3]; + //T SubFactor02 = m[2][1] * m[3][2] - m[3][1] * m[2][2]; + //T SubFactor03 = m[2][0] * m[3][3] - m[3][0] * m[2][3]; + //T SubFactor04 = m[2][0] * m[3][2] - m[3][0] * m[2][2]; + //T SubFactor05 = m[2][0] * m[3][1] - m[3][0] * m[2][1]; + + // First 2 columns + __m128 Swp2A = _mm_castsi128_ps(_mm_shuffle_epi32(_mm_castps_si128(m[2]), _MM_SHUFFLE(0, 1, 1, 2))); + __m128 Swp3A = _mm_castsi128_ps(_mm_shuffle_epi32(_mm_castps_si128(m[3]), _MM_SHUFFLE(3, 2, 3, 3))); + __m128 MulA = _mm_mul_ps(Swp2A, Swp3A); + + // Second 2 columns + __m128 Swp2B = _mm_castsi128_ps(_mm_shuffle_epi32(_mm_castps_si128(m[2]), _MM_SHUFFLE(3, 2, 3, 3))); + __m128 Swp3B = _mm_castsi128_ps(_mm_shuffle_epi32(_mm_castps_si128(m[3]), _MM_SHUFFLE(0, 1, 1, 2))); + __m128 MulB = _mm_mul_ps(Swp2B, Swp3B); + + // Columns subtraction + __m128 SubE = _mm_sub_ps(MulA, MulB); + + // Last 2 rows + __m128 Swp2C = _mm_castsi128_ps(_mm_shuffle_epi32(_mm_castps_si128(m[2]), _MM_SHUFFLE(0, 0, 1, 2))); + __m128 Swp3C = _mm_castsi128_ps(_mm_shuffle_epi32(_mm_castps_si128(m[3]), _MM_SHUFFLE(1, 2, 0, 0))); + __m128 MulC = _mm_mul_ps(Swp2C, Swp3C); + __m128 SubF = _mm_sub_ps(_mm_movehl_ps(MulC, MulC), MulC); + + //vec<4, T, Q> DetCof( + // + (m[1][1] * SubFactor00 - m[1][2] * SubFactor01 + m[1][3] * SubFactor02), + // - (m[1][0] * SubFactor00 - m[1][2] * SubFactor03 + m[1][3] * SubFactor04), + // + (m[1][0] * SubFactor01 - m[1][1] * SubFactor03 + m[1][3] * SubFactor05), + // - (m[1][0] * SubFactor02 - m[1][1] * SubFactor04 + m[1][2] * SubFactor05)); + + __m128 SubFacA = _mm_castsi128_ps(_mm_shuffle_epi32(_mm_castps_si128(SubE), _MM_SHUFFLE(2, 1, 0, 0))); + __m128 SwpFacA = _mm_castsi128_ps(_mm_shuffle_epi32(_mm_castps_si128(m[1]), _MM_SHUFFLE(0, 0, 0, 1))); + __m128 MulFacA = _mm_mul_ps(SwpFacA, SubFacA); + + __m128 SubTmpB = _mm_shuffle_ps(SubE, SubF, _MM_SHUFFLE(0, 0, 3, 1)); + __m128 SubFacB = _mm_castsi128_ps(_mm_shuffle_epi32(_mm_castps_si128(SubTmpB), _MM_SHUFFLE(3, 1, 1, 0)));//SubF[0], SubE[3], SubE[3], SubE[1]; + __m128 SwpFacB = _mm_castsi128_ps(_mm_shuffle_epi32(_mm_castps_si128(m[1]), _MM_SHUFFLE(1, 1, 2, 2))); + __m128 MulFacB = _mm_mul_ps(SwpFacB, SubFacB); + + __m128 SubRes = _mm_sub_ps(MulFacA, MulFacB); + + __m128 SubTmpC = _mm_shuffle_ps(SubE, SubF, _MM_SHUFFLE(1, 0, 2, 2)); + __m128 SubFacC = _mm_castsi128_ps(_mm_shuffle_epi32(_mm_castps_si128(SubTmpC), _MM_SHUFFLE(3, 3, 2, 0))); + __m128 SwpFacC = _mm_castsi128_ps(_mm_shuffle_epi32(_mm_castps_si128(m[1]), _MM_SHUFFLE(2, 3, 3, 3))); + __m128 MulFacC = _mm_mul_ps(SwpFacC, SubFacC); + + __m128 AddRes = _mm_add_ps(SubRes, MulFacC); + __m128 DetCof = _mm_mul_ps(AddRes, _mm_setr_ps( 1.0f,-1.0f, 1.0f,-1.0f)); + + //return m[0][0] * DetCof[0] + // + m[0][1] * DetCof[1] + // + m[0][2] * DetCof[2] + // + m[0][3] * DetCof[3]; + + return glm_vec4_dot(m[0], DetCof); +} + +GLM_FUNC_QUALIFIER glm_vec4 glm_mat4_determinant(glm_vec4 const m[4]) +{ + // _mm_castsi128_ps(_mm_shuffle_epi32(_mm_castps_si128(add) + + //T SubFactor00 = m[2][2] * m[3][3] - m[3][2] * m[2][3]; + //T SubFactor01 = m[2][1] * m[3][3] - m[3][1] * m[2][3]; + //T SubFactor02 = m[2][1] * m[3][2] - m[3][1] * m[2][2]; + //T SubFactor03 = m[2][0] * m[3][3] - m[3][0] * m[2][3]; + //T SubFactor04 = m[2][0] * m[3][2] - m[3][0] * m[2][2]; + //T SubFactor05 = m[2][0] * m[3][1] - m[3][0] * m[2][1]; + + // First 2 columns + __m128 Swp2A = _mm_shuffle_ps(m[2], m[2], _MM_SHUFFLE(0, 1, 1, 2)); + __m128 Swp3A = _mm_shuffle_ps(m[3], m[3], _MM_SHUFFLE(3, 2, 3, 3)); + __m128 MulA = _mm_mul_ps(Swp2A, Swp3A); + + // Second 2 columns + __m128 Swp2B = _mm_shuffle_ps(m[2], m[2], _MM_SHUFFLE(3, 2, 3, 3)); + __m128 Swp3B = _mm_shuffle_ps(m[3], m[3], _MM_SHUFFLE(0, 1, 1, 2)); + __m128 MulB = _mm_mul_ps(Swp2B, Swp3B); + + // Columns subtraction + __m128 SubE = _mm_sub_ps(MulA, MulB); + + // Last 2 rows + __m128 Swp2C = _mm_shuffle_ps(m[2], m[2], _MM_SHUFFLE(0, 0, 1, 2)); + __m128 Swp3C = _mm_shuffle_ps(m[3], m[3], _MM_SHUFFLE(1, 2, 0, 0)); + __m128 MulC = _mm_mul_ps(Swp2C, Swp3C); + __m128 SubF = _mm_sub_ps(_mm_movehl_ps(MulC, MulC), MulC); + + //vec<4, T, Q> DetCof( + // + (m[1][1] * SubFactor00 - m[1][2] * SubFactor01 + m[1][3] * SubFactor02), + // - (m[1][0] * SubFactor00 - m[1][2] * SubFactor03 + m[1][3] * SubFactor04), + // + (m[1][0] * SubFactor01 - m[1][1] * SubFactor03 + m[1][3] * SubFactor05), + // - (m[1][0] * SubFactor02 - m[1][1] * SubFactor04 + m[1][2] * SubFactor05)); + + __m128 SubFacA = _mm_shuffle_ps(SubE, SubE, _MM_SHUFFLE(2, 1, 0, 0)); + __m128 SwpFacA = _mm_shuffle_ps(m[1], m[1], _MM_SHUFFLE(0, 0, 0, 1)); + __m128 MulFacA = _mm_mul_ps(SwpFacA, SubFacA); + + __m128 SubTmpB = _mm_shuffle_ps(SubE, SubF, _MM_SHUFFLE(0, 0, 3, 1)); + __m128 SubFacB = _mm_shuffle_ps(SubTmpB, SubTmpB, _MM_SHUFFLE(3, 1, 1, 0));//SubF[0], SubE[3], SubE[3], SubE[1]; + __m128 SwpFacB = _mm_shuffle_ps(m[1], m[1], _MM_SHUFFLE(1, 1, 2, 2)); + __m128 MulFacB = _mm_mul_ps(SwpFacB, SubFacB); + + __m128 SubRes = _mm_sub_ps(MulFacA, MulFacB); + + __m128 SubTmpC = _mm_shuffle_ps(SubE, SubF, _MM_SHUFFLE(1, 0, 2, 2)); + __m128 SubFacC = _mm_shuffle_ps(SubTmpC, SubTmpC, _MM_SHUFFLE(3, 3, 2, 0)); + __m128 SwpFacC = _mm_shuffle_ps(m[1], m[1], _MM_SHUFFLE(2, 3, 3, 3)); + __m128 MulFacC = _mm_mul_ps(SwpFacC, SubFacC); + + __m128 AddRes = _mm_add_ps(SubRes, MulFacC); + __m128 DetCof = _mm_mul_ps(AddRes, _mm_setr_ps( 1.0f,-1.0f, 1.0f,-1.0f)); + + //return m[0][0] * DetCof[0] + // + m[0][1] * DetCof[1] + // + m[0][2] * DetCof[2] + // + m[0][3] * DetCof[3]; + + return glm_vec4_dot(m[0], DetCof); +} + +GLM_FUNC_QUALIFIER void glm_mat4_inverse(glm_vec4 const in[4], glm_vec4 out[4]) +{ + __m128 Fac0; + { + // valType SubFactor00 = m[2][2] * m[3][3] - m[3][2] * m[2][3]; + // valType SubFactor00 = m[2][2] * m[3][3] - m[3][2] * m[2][3]; + // valType SubFactor06 = m[1][2] * m[3][3] - m[3][2] * m[1][3]; + // valType SubFactor13 = m[1][2] * m[2][3] - m[2][2] * m[1][3]; + + __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(3, 3, 3, 3)); + __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(2, 2, 2, 2)); + + __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(2, 2, 2, 2)); + __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0)); + __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0)); + __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(3, 3, 3, 3)); + + __m128 Mul00 = _mm_mul_ps(Swp00, Swp01); + __m128 Mul01 = _mm_mul_ps(Swp02, Swp03); + Fac0 = _mm_sub_ps(Mul00, Mul01); + } + + __m128 Fac1; + { + // valType SubFactor01 = m[2][1] * m[3][3] - m[3][1] * m[2][3]; + // valType SubFactor01 = m[2][1] * m[3][3] - m[3][1] * m[2][3]; + // valType SubFactor07 = m[1][1] * m[3][3] - m[3][1] * m[1][3]; + // valType SubFactor14 = m[1][1] * m[2][3] - m[2][1] * m[1][3]; + + __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(3, 3, 3, 3)); + __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(1, 1, 1, 1)); + + __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(1, 1, 1, 1)); + __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0)); + __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0)); + __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(3, 3, 3, 3)); + + __m128 Mul00 = _mm_mul_ps(Swp00, Swp01); + __m128 Mul01 = _mm_mul_ps(Swp02, Swp03); + Fac1 = _mm_sub_ps(Mul00, Mul01); + } + + + __m128 Fac2; + { + // valType SubFactor02 = m[2][1] * m[3][2] - m[3][1] * m[2][2]; + // valType SubFactor02 = m[2][1] * m[3][2] - m[3][1] * m[2][2]; + // valType SubFactor08 = m[1][1] * m[3][2] - m[3][1] * m[1][2]; + // valType SubFactor15 = m[1][1] * m[2][2] - m[2][1] * m[1][2]; + + __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(2, 2, 2, 2)); + __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(1, 1, 1, 1)); + + __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(1, 1, 1, 1)); + __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0)); + __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0)); + __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(2, 2, 2, 2)); + + __m128 Mul00 = _mm_mul_ps(Swp00, Swp01); + __m128 Mul01 = _mm_mul_ps(Swp02, Swp03); + Fac2 = _mm_sub_ps(Mul00, Mul01); + } + + __m128 Fac3; + { + // valType SubFactor03 = m[2][0] * m[3][3] - m[3][0] * m[2][3]; + // valType SubFactor03 = m[2][0] * m[3][3] - m[3][0] * m[2][3]; + // valType SubFactor09 = m[1][0] * m[3][3] - m[3][0] * m[1][3]; + // valType SubFactor16 = m[1][0] * m[2][3] - m[2][0] * m[1][3]; + + __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(3, 3, 3, 3)); + __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(0, 0, 0, 0)); + + __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(0, 0, 0, 0)); + __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0)); + __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0)); + __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(3, 3, 3, 3)); + + __m128 Mul00 = _mm_mul_ps(Swp00, Swp01); + __m128 Mul01 = _mm_mul_ps(Swp02, Swp03); + Fac3 = _mm_sub_ps(Mul00, Mul01); + } + + __m128 Fac4; + { + // valType SubFactor04 = m[2][0] * m[3][2] - m[3][0] * m[2][2]; + // valType SubFactor04 = m[2][0] * m[3][2] - m[3][0] * m[2][2]; + // valType SubFactor10 = m[1][0] * m[3][2] - m[3][0] * m[1][2]; + // valType SubFactor17 = m[1][0] * m[2][2] - m[2][0] * m[1][2]; + + __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(2, 2, 2, 2)); + __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(0, 0, 0, 0)); + + __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(0, 0, 0, 0)); + __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0)); + __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0)); + __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(2, 2, 2, 2)); + + __m128 Mul00 = _mm_mul_ps(Swp00, Swp01); + __m128 Mul01 = _mm_mul_ps(Swp02, Swp03); + Fac4 = _mm_sub_ps(Mul00, Mul01); + } + + __m128 Fac5; + { + // valType SubFactor05 = m[2][0] * m[3][1] - m[3][0] * m[2][1]; + // valType SubFactor05 = m[2][0] * m[3][1] - m[3][0] * m[2][1]; + // valType SubFactor12 = m[1][0] * m[3][1] - m[3][0] * m[1][1]; + // valType SubFactor18 = m[1][0] * m[2][1] - m[2][0] * m[1][1]; + + __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(1, 1, 1, 1)); + __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(0, 0, 0, 0)); + + __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(0, 0, 0, 0)); + __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0)); + __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0)); + __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(1, 1, 1, 1)); + + __m128 Mul00 = _mm_mul_ps(Swp00, Swp01); + __m128 Mul01 = _mm_mul_ps(Swp02, Swp03); + Fac5 = _mm_sub_ps(Mul00, Mul01); + } + + __m128 SignA = _mm_set_ps( 1.0f,-1.0f, 1.0f,-1.0f); + __m128 SignB = _mm_set_ps(-1.0f, 1.0f,-1.0f, 1.0f); + + // m[1][0] + // m[0][0] + // m[0][0] + // m[0][0] + __m128 Temp0 = _mm_shuffle_ps(in[1], in[0], _MM_SHUFFLE(0, 0, 0, 0)); + __m128 Vec0 = _mm_shuffle_ps(Temp0, Temp0, _MM_SHUFFLE(2, 2, 2, 0)); + + // m[1][1] + // m[0][1] + // m[0][1] + // m[0][1] + __m128 Temp1 = _mm_shuffle_ps(in[1], in[0], _MM_SHUFFLE(1, 1, 1, 1)); + __m128 Vec1 = _mm_shuffle_ps(Temp1, Temp1, _MM_SHUFFLE(2, 2, 2, 0)); + + // m[1][2] + // m[0][2] + // m[0][2] + // m[0][2] + __m128 Temp2 = _mm_shuffle_ps(in[1], in[0], _MM_SHUFFLE(2, 2, 2, 2)); + __m128 Vec2 = _mm_shuffle_ps(Temp2, Temp2, _MM_SHUFFLE(2, 2, 2, 0)); + + // m[1][3] + // m[0][3] + // m[0][3] + // m[0][3] + __m128 Temp3 = _mm_shuffle_ps(in[1], in[0], _MM_SHUFFLE(3, 3, 3, 3)); + __m128 Vec3 = _mm_shuffle_ps(Temp3, Temp3, _MM_SHUFFLE(2, 2, 2, 0)); + + // col0 + // + (Vec1[0] * Fac0[0] - Vec2[0] * Fac1[0] + Vec3[0] * Fac2[0]), + // - (Vec1[1] * Fac0[1] - Vec2[1] * Fac1[1] + Vec3[1] * Fac2[1]), + // + (Vec1[2] * Fac0[2] - Vec2[2] * Fac1[2] + Vec3[2] * Fac2[2]), + // - (Vec1[3] * Fac0[3] - Vec2[3] * Fac1[3] + Vec3[3] * Fac2[3]), + __m128 Mul00 = _mm_mul_ps(Vec1, Fac0); + __m128 Mul01 = _mm_mul_ps(Vec2, Fac1); + __m128 Mul02 = _mm_mul_ps(Vec3, Fac2); + __m128 Sub00 = _mm_sub_ps(Mul00, Mul01); + __m128 Add00 = _mm_add_ps(Sub00, Mul02); + __m128 Inv0 = _mm_mul_ps(SignB, Add00); + + // col1 + // - (Vec0[0] * Fac0[0] - Vec2[0] * Fac3[0] + Vec3[0] * Fac4[0]), + // + (Vec0[0] * Fac0[1] - Vec2[1] * Fac3[1] + Vec3[1] * Fac4[1]), + // - (Vec0[0] * Fac0[2] - Vec2[2] * Fac3[2] + Vec3[2] * Fac4[2]), + // + (Vec0[0] * Fac0[3] - Vec2[3] * Fac3[3] + Vec3[3] * Fac4[3]), + __m128 Mul03 = _mm_mul_ps(Vec0, Fac0); + __m128 Mul04 = _mm_mul_ps(Vec2, Fac3); + __m128 Mul05 = _mm_mul_ps(Vec3, Fac4); + __m128 Sub01 = _mm_sub_ps(Mul03, Mul04); + __m128 Add01 = _mm_add_ps(Sub01, Mul05); + __m128 Inv1 = _mm_mul_ps(SignA, Add01); + + // col2 + // + (Vec0[0] * Fac1[0] - Vec1[0] * Fac3[0] + Vec3[0] * Fac5[0]), + // - (Vec0[0] * Fac1[1] - Vec1[1] * Fac3[1] + Vec3[1] * Fac5[1]), + // + (Vec0[0] * Fac1[2] - Vec1[2] * Fac3[2] + Vec3[2] * Fac5[2]), + // - (Vec0[0] * Fac1[3] - Vec1[3] * Fac3[3] + Vec3[3] * Fac5[3]), + __m128 Mul06 = _mm_mul_ps(Vec0, Fac1); + __m128 Mul07 = _mm_mul_ps(Vec1, Fac3); + __m128 Mul08 = _mm_mul_ps(Vec3, Fac5); + __m128 Sub02 = _mm_sub_ps(Mul06, Mul07); + __m128 Add02 = _mm_add_ps(Sub02, Mul08); + __m128 Inv2 = _mm_mul_ps(SignB, Add02); + + // col3 + // - (Vec1[0] * Fac2[0] - Vec1[0] * Fac4[0] + Vec2[0] * Fac5[0]), + // + (Vec1[0] * Fac2[1] - Vec1[1] * Fac4[1] + Vec2[1] * Fac5[1]), + // - (Vec1[0] * Fac2[2] - Vec1[2] * Fac4[2] + Vec2[2] * Fac5[2]), + // + (Vec1[0] * Fac2[3] - Vec1[3] * Fac4[3] + Vec2[3] * Fac5[3])); + __m128 Mul09 = _mm_mul_ps(Vec0, Fac2); + __m128 Mul10 = _mm_mul_ps(Vec1, Fac4); + __m128 Mul11 = _mm_mul_ps(Vec2, Fac5); + __m128 Sub03 = _mm_sub_ps(Mul09, Mul10); + __m128 Add03 = _mm_add_ps(Sub03, Mul11); + __m128 Inv3 = _mm_mul_ps(SignA, Add03); + + __m128 Row0 = _mm_shuffle_ps(Inv0, Inv1, _MM_SHUFFLE(0, 0, 0, 0)); + __m128 Row1 = _mm_shuffle_ps(Inv2, Inv3, _MM_SHUFFLE(0, 0, 0, 0)); + __m128 Row2 = _mm_shuffle_ps(Row0, Row1, _MM_SHUFFLE(2, 0, 2, 0)); + + // valType Determinant = m[0][0] * Inverse[0][0] + // + m[0][1] * Inverse[1][0] + // + m[0][2] * Inverse[2][0] + // + m[0][3] * Inverse[3][0]; + __m128 Det0 = glm_vec4_dot(in[0], Row2); + __m128 Rcp0 = _mm_div_ps(_mm_set1_ps(1.0f), Det0); + //__m128 Rcp0 = _mm_rcp_ps(Det0); + + // Inverse /= Determinant; + out[0] = _mm_mul_ps(Inv0, Rcp0); + out[1] = _mm_mul_ps(Inv1, Rcp0); + out[2] = _mm_mul_ps(Inv2, Rcp0); + out[3] = _mm_mul_ps(Inv3, Rcp0); +} + +GLM_FUNC_QUALIFIER void glm_mat4_inverse_lowp(glm_vec4 const in[4], glm_vec4 out[4]) +{ + __m128 Fac0; + { + // valType SubFactor00 = m[2][2] * m[3][3] - m[3][2] * m[2][3]; + // valType SubFactor00 = m[2][2] * m[3][3] - m[3][2] * m[2][3]; + // valType SubFactor06 = m[1][2] * m[3][3] - m[3][2] * m[1][3]; + // valType SubFactor13 = m[1][2] * m[2][3] - m[2][2] * m[1][3]; + + __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(3, 3, 3, 3)); + __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(2, 2, 2, 2)); + + __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(2, 2, 2, 2)); + __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0)); + __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0)); + __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(3, 3, 3, 3)); + + __m128 Mul00 = _mm_mul_ps(Swp00, Swp01); + __m128 Mul01 = _mm_mul_ps(Swp02, Swp03); + Fac0 = _mm_sub_ps(Mul00, Mul01); + } + + __m128 Fac1; + { + // valType SubFactor01 = m[2][1] * m[3][3] - m[3][1] * m[2][3]; + // valType SubFactor01 = m[2][1] * m[3][3] - m[3][1] * m[2][3]; + // valType SubFactor07 = m[1][1] * m[3][3] - m[3][1] * m[1][3]; + // valType SubFactor14 = m[1][1] * m[2][3] - m[2][1] * m[1][3]; + + __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(3, 3, 3, 3)); + __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(1, 1, 1, 1)); + + __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(1, 1, 1, 1)); + __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0)); + __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0)); + __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(3, 3, 3, 3)); + + __m128 Mul00 = _mm_mul_ps(Swp00, Swp01); + __m128 Mul01 = _mm_mul_ps(Swp02, Swp03); + Fac1 = _mm_sub_ps(Mul00, Mul01); + } + + + __m128 Fac2; + { + // valType SubFactor02 = m[2][1] * m[3][2] - m[3][1] * m[2][2]; + // valType SubFactor02 = m[2][1] * m[3][2] - m[3][1] * m[2][2]; + // valType SubFactor08 = m[1][1] * m[3][2] - m[3][1] * m[1][2]; + // valType SubFactor15 = m[1][1] * m[2][2] - m[2][1] * m[1][2]; + + __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(2, 2, 2, 2)); + __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(1, 1, 1, 1)); + + __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(1, 1, 1, 1)); + __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0)); + __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0)); + __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(2, 2, 2, 2)); + + __m128 Mul00 = _mm_mul_ps(Swp00, Swp01); + __m128 Mul01 = _mm_mul_ps(Swp02, Swp03); + Fac2 = _mm_sub_ps(Mul00, Mul01); + } + + __m128 Fac3; + { + // valType SubFactor03 = m[2][0] * m[3][3] - m[3][0] * m[2][3]; + // valType SubFactor03 = m[2][0] * m[3][3] - m[3][0] * m[2][3]; + // valType SubFactor09 = m[1][0] * m[3][3] - m[3][0] * m[1][3]; + // valType SubFactor16 = m[1][0] * m[2][3] - m[2][0] * m[1][3]; + + __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(3, 3, 3, 3)); + __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(0, 0, 0, 0)); + + __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(0, 0, 0, 0)); + __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0)); + __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0)); + __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(3, 3, 3, 3)); + + __m128 Mul00 = _mm_mul_ps(Swp00, Swp01); + __m128 Mul01 = _mm_mul_ps(Swp02, Swp03); + Fac3 = _mm_sub_ps(Mul00, Mul01); + } + + __m128 Fac4; + { + // valType SubFactor04 = m[2][0] * m[3][2] - m[3][0] * m[2][2]; + // valType SubFactor04 = m[2][0] * m[3][2] - m[3][0] * m[2][2]; + // valType SubFactor10 = m[1][0] * m[3][2] - m[3][0] * m[1][2]; + // valType SubFactor17 = m[1][0] * m[2][2] - m[2][0] * m[1][2]; + + __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(2, 2, 2, 2)); + __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(0, 0, 0, 0)); + + __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(0, 0, 0, 0)); + __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0)); + __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0)); + __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(2, 2, 2, 2)); + + __m128 Mul00 = _mm_mul_ps(Swp00, Swp01); + __m128 Mul01 = _mm_mul_ps(Swp02, Swp03); + Fac4 = _mm_sub_ps(Mul00, Mul01); + } + + __m128 Fac5; + { + // valType SubFactor05 = m[2][0] * m[3][1] - m[3][0] * m[2][1]; + // valType SubFactor05 = m[2][0] * m[3][1] - m[3][0] * m[2][1]; + // valType SubFactor12 = m[1][0] * m[3][1] - m[3][0] * m[1][1]; + // valType SubFactor18 = m[1][0] * m[2][1] - m[2][0] * m[1][1]; + + __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(1, 1, 1, 1)); + __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(0, 0, 0, 0)); + + __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(0, 0, 0, 0)); + __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0)); + __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0)); + __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(1, 1, 1, 1)); + + __m128 Mul00 = _mm_mul_ps(Swp00, Swp01); + __m128 Mul01 = _mm_mul_ps(Swp02, Swp03); + Fac5 = _mm_sub_ps(Mul00, Mul01); + } + + __m128 SignA = _mm_set_ps( 1.0f,-1.0f, 1.0f,-1.0f); + __m128 SignB = _mm_set_ps(-1.0f, 1.0f,-1.0f, 1.0f); + + // m[1][0] + // m[0][0] + // m[0][0] + // m[0][0] + __m128 Temp0 = _mm_shuffle_ps(in[1], in[0], _MM_SHUFFLE(0, 0, 0, 0)); + __m128 Vec0 = _mm_shuffle_ps(Temp0, Temp0, _MM_SHUFFLE(2, 2, 2, 0)); + + // m[1][1] + // m[0][1] + // m[0][1] + // m[0][1] + __m128 Temp1 = _mm_shuffle_ps(in[1], in[0], _MM_SHUFFLE(1, 1, 1, 1)); + __m128 Vec1 = _mm_shuffle_ps(Temp1, Temp1, _MM_SHUFFLE(2, 2, 2, 0)); + + // m[1][2] + // m[0][2] + // m[0][2] + // m[0][2] + __m128 Temp2 = _mm_shuffle_ps(in[1], in[0], _MM_SHUFFLE(2, 2, 2, 2)); + __m128 Vec2 = _mm_shuffle_ps(Temp2, Temp2, _MM_SHUFFLE(2, 2, 2, 0)); + + // m[1][3] + // m[0][3] + // m[0][3] + // m[0][3] + __m128 Temp3 = _mm_shuffle_ps(in[1], in[0], _MM_SHUFFLE(3, 3, 3, 3)); + __m128 Vec3 = _mm_shuffle_ps(Temp3, Temp3, _MM_SHUFFLE(2, 2, 2, 0)); + + // col0 + // + (Vec1[0] * Fac0[0] - Vec2[0] * Fac1[0] + Vec3[0] * Fac2[0]), + // - (Vec1[1] * Fac0[1] - Vec2[1] * Fac1[1] + Vec3[1] * Fac2[1]), + // + (Vec1[2] * Fac0[2] - Vec2[2] * Fac1[2] + Vec3[2] * Fac2[2]), + // - (Vec1[3] * Fac0[3] - Vec2[3] * Fac1[3] + Vec3[3] * Fac2[3]), + __m128 Mul00 = _mm_mul_ps(Vec1, Fac0); + __m128 Mul01 = _mm_mul_ps(Vec2, Fac1); + __m128 Mul02 = _mm_mul_ps(Vec3, Fac2); + __m128 Sub00 = _mm_sub_ps(Mul00, Mul01); + __m128 Add00 = _mm_add_ps(Sub00, Mul02); + __m128 Inv0 = _mm_mul_ps(SignB, Add00); + + // col1 + // - (Vec0[0] * Fac0[0] - Vec2[0] * Fac3[0] + Vec3[0] * Fac4[0]), + // + (Vec0[0] * Fac0[1] - Vec2[1] * Fac3[1] + Vec3[1] * Fac4[1]), + // - (Vec0[0] * Fac0[2] - Vec2[2] * Fac3[2] + Vec3[2] * Fac4[2]), + // + (Vec0[0] * Fac0[3] - Vec2[3] * Fac3[3] + Vec3[3] * Fac4[3]), + __m128 Mul03 = _mm_mul_ps(Vec0, Fac0); + __m128 Mul04 = _mm_mul_ps(Vec2, Fac3); + __m128 Mul05 = _mm_mul_ps(Vec3, Fac4); + __m128 Sub01 = _mm_sub_ps(Mul03, Mul04); + __m128 Add01 = _mm_add_ps(Sub01, Mul05); + __m128 Inv1 = _mm_mul_ps(SignA, Add01); + + // col2 + // + (Vec0[0] * Fac1[0] - Vec1[0] * Fac3[0] + Vec3[0] * Fac5[0]), + // - (Vec0[0] * Fac1[1] - Vec1[1] * Fac3[1] + Vec3[1] * Fac5[1]), + // + (Vec0[0] * Fac1[2] - Vec1[2] * Fac3[2] + Vec3[2] * Fac5[2]), + // - (Vec0[0] * Fac1[3] - Vec1[3] * Fac3[3] + Vec3[3] * Fac5[3]), + __m128 Mul06 = _mm_mul_ps(Vec0, Fac1); + __m128 Mul07 = _mm_mul_ps(Vec1, Fac3); + __m128 Mul08 = _mm_mul_ps(Vec3, Fac5); + __m128 Sub02 = _mm_sub_ps(Mul06, Mul07); + __m128 Add02 = _mm_add_ps(Sub02, Mul08); + __m128 Inv2 = _mm_mul_ps(SignB, Add02); + + // col3 + // - (Vec1[0] * Fac2[0] - Vec1[0] * Fac4[0] + Vec2[0] * Fac5[0]), + // + (Vec1[0] * Fac2[1] - Vec1[1] * Fac4[1] + Vec2[1] * Fac5[1]), + // - (Vec1[0] * Fac2[2] - Vec1[2] * Fac4[2] + Vec2[2] * Fac5[2]), + // + (Vec1[0] * Fac2[3] - Vec1[3] * Fac4[3] + Vec2[3] * Fac5[3])); + __m128 Mul09 = _mm_mul_ps(Vec0, Fac2); + __m128 Mul10 = _mm_mul_ps(Vec1, Fac4); + __m128 Mul11 = _mm_mul_ps(Vec2, Fac5); + __m128 Sub03 = _mm_sub_ps(Mul09, Mul10); + __m128 Add03 = _mm_add_ps(Sub03, Mul11); + __m128 Inv3 = _mm_mul_ps(SignA, Add03); + + __m128 Row0 = _mm_shuffle_ps(Inv0, Inv1, _MM_SHUFFLE(0, 0, 0, 0)); + __m128 Row1 = _mm_shuffle_ps(Inv2, Inv3, _MM_SHUFFLE(0, 0, 0, 0)); + __m128 Row2 = _mm_shuffle_ps(Row0, Row1, _MM_SHUFFLE(2, 0, 2, 0)); + + // valType Determinant = m[0][0] * Inverse[0][0] + // + m[0][1] * Inverse[1][0] + // + m[0][2] * Inverse[2][0] + // + m[0][3] * Inverse[3][0]; + __m128 Det0 = glm_vec4_dot(in[0], Row2); + __m128 Rcp0 = _mm_rcp_ps(Det0); + //__m128 Rcp0 = _mm_div_ps(one, Det0); + // Inverse /= Determinant; + out[0] = _mm_mul_ps(Inv0, Rcp0); + out[1] = _mm_mul_ps(Inv1, Rcp0); + out[2] = _mm_mul_ps(Inv2, Rcp0); + out[3] = _mm_mul_ps(Inv3, Rcp0); +} +/* +GLM_FUNC_QUALIFIER void glm_mat4_rotate(__m128 const in[4], float Angle, float const v[3], __m128 out[4]) +{ + float a = glm::radians(Angle); + float c = cos(a); + float s = sin(a); + + glm::vec4 AxisA(v[0], v[1], v[2], float(0)); + __m128 AxisB = _mm_set_ps(AxisA.w, AxisA.z, AxisA.y, AxisA.x); + __m128 AxisC = detail::sse_nrm_ps(AxisB); + + __m128 Cos0 = _mm_set_ss(c); + __m128 CosA = _mm_shuffle_ps(Cos0, Cos0, _MM_SHUFFLE(0, 0, 0, 0)); + __m128 Sin0 = _mm_set_ss(s); + __m128 SinA = _mm_shuffle_ps(Sin0, Sin0, _MM_SHUFFLE(0, 0, 0, 0)); + + // vec<3, T, Q> temp = (valType(1) - c) * axis; + __m128 Temp0 = _mm_sub_ps(one, CosA); + __m128 Temp1 = _mm_mul_ps(Temp0, AxisC); + + //Rotate[0][0] = c + temp[0] * axis[0]; + //Rotate[0][1] = 0 + temp[0] * axis[1] + s * axis[2]; + //Rotate[0][2] = 0 + temp[0] * axis[2] - s * axis[1]; + __m128 Axis0 = _mm_shuffle_ps(AxisC, AxisC, _MM_SHUFFLE(0, 0, 0, 0)); + __m128 TmpA0 = _mm_mul_ps(Axis0, AxisC); + __m128 CosA0 = _mm_shuffle_ps(Cos0, Cos0, _MM_SHUFFLE(1, 1, 1, 0)); + __m128 TmpA1 = _mm_add_ps(CosA0, TmpA0); + __m128 SinA0 = SinA;//_mm_set_ps(0.0f, s, -s, 0.0f); + __m128 TmpA2 = _mm_shuffle_ps(AxisC, AxisC, _MM_SHUFFLE(3, 1, 2, 3)); + __m128 TmpA3 = _mm_mul_ps(SinA0, TmpA2); + __m128 TmpA4 = _mm_add_ps(TmpA1, TmpA3); + + //Rotate[1][0] = 0 + temp[1] * axis[0] - s * axis[2]; + //Rotate[1][1] = c + temp[1] * axis[1]; + //Rotate[1][2] = 0 + temp[1] * axis[2] + s * axis[0]; + __m128 Axis1 = _mm_shuffle_ps(AxisC, AxisC, _MM_SHUFFLE(1, 1, 1, 1)); + __m128 TmpB0 = _mm_mul_ps(Axis1, AxisC); + __m128 CosA1 = _mm_shuffle_ps(Cos0, Cos0, _MM_SHUFFLE(1, 1, 0, 1)); + __m128 TmpB1 = _mm_add_ps(CosA1, TmpB0); + __m128 SinB0 = SinA;//_mm_set_ps(-s, 0.0f, s, 0.0f); + __m128 TmpB2 = _mm_shuffle_ps(AxisC, AxisC, _MM_SHUFFLE(3, 0, 3, 2)); + __m128 TmpB3 = _mm_mul_ps(SinA0, TmpB2); + __m128 TmpB4 = _mm_add_ps(TmpB1, TmpB3); + + //Rotate[2][0] = 0 + temp[2] * axis[0] + s * axis[1]; + //Rotate[2][1] = 0 + temp[2] * axis[1] - s * axis[0]; + //Rotate[2][2] = c + temp[2] * axis[2]; + __m128 Axis2 = _mm_shuffle_ps(AxisC, AxisC, _MM_SHUFFLE(2, 2, 2, 2)); + __m128 TmpC0 = _mm_mul_ps(Axis2, AxisC); + __m128 CosA2 = _mm_shuffle_ps(Cos0, Cos0, _MM_SHUFFLE(1, 0, 1, 1)); + __m128 TmpC1 = _mm_add_ps(CosA2, TmpC0); + __m128 SinC0 = SinA;//_mm_set_ps(s, -s, 0.0f, 0.0f); + __m128 TmpC2 = _mm_shuffle_ps(AxisC, AxisC, _MM_SHUFFLE(3, 3, 0, 1)); + __m128 TmpC3 = _mm_mul_ps(SinA0, TmpC2); + __m128 TmpC4 = _mm_add_ps(TmpC1, TmpC3); + + __m128 Result[4]; + Result[0] = TmpA4; + Result[1] = TmpB4; + Result[2] = TmpC4; + Result[3] = _mm_set_ps(1, 0, 0, 0); + + //mat<4, 4, valType> Result; + //Result[0] = m[0] * Rotate[0][0] + m[1] * Rotate[0][1] + m[2] * Rotate[0][2]; + //Result[1] = m[0] * Rotate[1][0] + m[1] * Rotate[1][1] + m[2] * Rotate[1][2]; + //Result[2] = m[0] * Rotate[2][0] + m[1] * Rotate[2][1] + m[2] * Rotate[2][2]; + //Result[3] = m[3]; + //return Result; + sse_mul_ps(in, Result, out); +} +*/ +GLM_FUNC_QUALIFIER void glm_mat4_outerProduct(__m128 const& c, __m128 const& r, __m128 out[4]) +{ + out[0] = _mm_mul_ps(c, _mm_shuffle_ps(r, r, _MM_SHUFFLE(0, 0, 0, 0))); + out[1] = _mm_mul_ps(c, _mm_shuffle_ps(r, r, _MM_SHUFFLE(1, 1, 1, 1))); + out[2] = _mm_mul_ps(c, _mm_shuffle_ps(r, r, _MM_SHUFFLE(2, 2, 2, 2))); + out[3] = _mm_mul_ps(c, _mm_shuffle_ps(r, r, _MM_SHUFFLE(3, 3, 3, 3))); +} + +#endif//GLM_ARCH & GLM_ARCH_SSE2_BIT diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/simd/neon.h b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/simd/neon.h new file mode 100644 index 0000000000000000000000000000000000000000..447a46a63d4e50c9f642e425bee4ea3318007db5 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/simd/neon.h @@ -0,0 +1,155 @@ +/// @ref simd_neon +/// @file glm/simd/neon.h + +#pragma once + +#if GLM_ARCH & GLM_ARCH_NEON_BIT +#include + +namespace glm { + namespace neon { + static inline float32x4_t dupq_lane(float32x4_t vsrc, int lane) { + switch(lane) { +#if GLM_ARCH & GLM_ARCH_ARMV8_BIT + case 0: return vdupq_laneq_f32(vsrc, 0); + case 1: return vdupq_laneq_f32(vsrc, 1); + case 2: return vdupq_laneq_f32(vsrc, 2); + case 3: return vdupq_laneq_f32(vsrc, 3); +#else + case 0: return vdupq_n_f32(vgetq_lane_f32(vsrc, 0)); + case 1: return vdupq_n_f32(vgetq_lane_f32(vsrc, 1)); + case 2: return vdupq_n_f32(vgetq_lane_f32(vsrc, 2)); + case 3: return vdupq_n_f32(vgetq_lane_f32(vsrc, 3)); +#endif + } + assert(!"Unreachable code executed!"); + return vdupq_n_f32(0.0f); + } + + static inline float32x2_t dup_lane(float32x4_t vsrc, int lane) { + switch(lane) { +#if GLM_ARCH & GLM_ARCH_ARMV8_BIT + case 0: return vdup_laneq_f32(vsrc, 0); + case 1: return vdup_laneq_f32(vsrc, 1); + case 2: return vdup_laneq_f32(vsrc, 2); + case 3: return vdup_laneq_f32(vsrc, 3); +#else + case 0: return vdup_n_f32(vgetq_lane_f32(vsrc, 0)); + case 1: return vdup_n_f32(vgetq_lane_f32(vsrc, 1)); + case 2: return vdup_n_f32(vgetq_lane_f32(vsrc, 2)); + case 3: return vdup_n_f32(vgetq_lane_f32(vsrc, 3)); +#endif + } + assert(!"Unreachable code executed!"); + return vdup_n_f32(0.0f); + } + + static inline float32x4_t copy_lane(float32x4_t vdst, int dlane, float32x4_t vsrc, int slane) { +#if GLM_ARCH & GLM_ARCH_ARMV8_BIT + switch(dlane) { + case 0: + switch(slane) { + case 0: return vcopyq_laneq_f32(vdst, 0, vsrc, 0); + case 1: return vcopyq_laneq_f32(vdst, 0, vsrc, 1); + case 2: return vcopyq_laneq_f32(vdst, 0, vsrc, 2); + case 3: return vcopyq_laneq_f32(vdst, 0, vsrc, 3); + } + assert(!"Unreachable code executed!"); + case 1: + switch(slane) { + case 0: return vcopyq_laneq_f32(vdst, 1, vsrc, 0); + case 1: return vcopyq_laneq_f32(vdst, 1, vsrc, 1); + case 2: return vcopyq_laneq_f32(vdst, 1, vsrc, 2); + case 3: return vcopyq_laneq_f32(vdst, 1, vsrc, 3); + } + assert(!"Unreachable code executed!"); + case 2: + switch(slane) { + case 0: return vcopyq_laneq_f32(vdst, 2, vsrc, 0); + case 1: return vcopyq_laneq_f32(vdst, 2, vsrc, 1); + case 2: return vcopyq_laneq_f32(vdst, 2, vsrc, 2); + case 3: return vcopyq_laneq_f32(vdst, 2, vsrc, 3); + } + assert(!"Unreachable code executed!"); + case 3: + switch(slane) { + case 0: return vcopyq_laneq_f32(vdst, 3, vsrc, 0); + case 1: return vcopyq_laneq_f32(vdst, 3, vsrc, 1); + case 2: return vcopyq_laneq_f32(vdst, 3, vsrc, 2); + case 3: return vcopyq_laneq_f32(vdst, 3, vsrc, 3); + } + assert(!"Unreachable code executed!"); + } +#else + + float l; + switch(slane) { + case 0: l = vgetq_lane_f32(vsrc, 0); break; + case 1: l = vgetq_lane_f32(vsrc, 1); break; + case 2: l = vgetq_lane_f32(vsrc, 2); break; + case 3: l = vgetq_lane_f32(vsrc, 3); break; + default: + assert(!"Unreachable code executed!"); + } + switch(dlane) { + case 0: return vsetq_lane_f32(l, vdst, 0); + case 1: return vsetq_lane_f32(l, vdst, 1); + case 2: return vsetq_lane_f32(l, vdst, 2); + case 3: return vsetq_lane_f32(l, vdst, 3); + } +#endif + assert(!"Unreachable code executed!"); + return vdupq_n_f32(0.0f); + } + + static inline float32x4_t mul_lane(float32x4_t v, float32x4_t vlane, int lane) { +#if GLM_ARCH & GLM_ARCH_ARMV8_BIT + switch(lane) { + case 0: return vmulq_laneq_f32(v, vlane, 0); break; + case 1: return vmulq_laneq_f32(v, vlane, 1); break; + case 2: return vmulq_laneq_f32(v, vlane, 2); break; + case 3: return vmulq_laneq_f32(v, vlane, 3); break; + default: + assert(!"Unreachable code executed!"); + } + assert(!"Unreachable code executed!"); + return vdupq_n_f32(0.0f); +#else + return vmulq_f32(v, dupq_lane(vlane, lane)); +#endif + } + + static inline float32x4_t madd_lane(float32x4_t acc, float32x4_t v, float32x4_t vlane, int lane) { +#if GLM_ARCH & GLM_ARCH_ARMV8_BIT +#ifdef GLM_CONFIG_FORCE_FMA +# define FMADD_LANE(acc, x, y, L) do { asm volatile ("fmla %0.4s, %1.4s, %2.4s" : "+w"(acc) : "w"(x), "w"(dup_lane(y, L))); } while(0) +#else +# define FMADD_LANE(acc, x, y, L) do { acc = vmlaq_laneq_f32(acc, x, y, L); } while(0) +#endif + + switch(lane) { + case 0: + FMADD_LANE(acc, v, vlane, 0); + return acc; + case 1: + FMADD_LANE(acc, v, vlane, 1); + return acc; + case 2: + FMADD_LANE(acc, v, vlane, 2); + return acc; + case 3: + FMADD_LANE(acc, v, vlane, 3); + return acc; + default: + assert(!"Unreachable code executed!"); + } + assert(!"Unreachable code executed!"); + return vdupq_n_f32(0.0f); +# undef FMADD_LANE +#else + return vaddq_f32(acc, vmulq_f32(v, dupq_lane(vlane, lane))); +#endif + } + } //namespace neon +} // namespace glm +#endif // GLM_ARCH & GLM_ARCH_NEON_BIT diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/simd/packing.h b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/simd/packing.h new file mode 100644 index 0000000000000000000000000000000000000000..aca43612b59037902c385d21134bdd164e69d309 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/simd/packing.h @@ -0,0 +1,8 @@ +/// @ref simd +/// @file glm/simd/packing.h + +#pragma once + +#if GLM_ARCH & GLM_ARCH_SSE2_BIT + +#endif//GLM_ARCH & GLM_ARCH_SSE2_BIT diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/simd/platform.h b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/simd/platform.h new file mode 100644 index 0000000000000000000000000000000000000000..ad04404419db59966d3395d2fe53aec3a4d3111c --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/simd/platform.h @@ -0,0 +1,409 @@ +#pragma once + +/////////////////////////////////////////////////////////////////////////////////// +// Platform + +#define GLM_PLATFORM_UNKNOWN 0x00000000 +#define GLM_PLATFORM_WINDOWS 0x00010000 +#define GLM_PLATFORM_LINUX 0x00020000 +#define GLM_PLATFORM_APPLE 0x00040000 +//#define GLM_PLATFORM_IOS 0x00080000 +#define GLM_PLATFORM_ANDROID 0x00100000 +#define GLM_PLATFORM_CHROME_NACL 0x00200000 +#define GLM_PLATFORM_UNIX 0x00400000 +#define GLM_PLATFORM_QNXNTO 0x00800000 +#define GLM_PLATFORM_WINCE 0x01000000 +#define GLM_PLATFORM_CYGWIN 0x02000000 + +#ifdef GLM_FORCE_PLATFORM_UNKNOWN +# define GLM_PLATFORM GLM_PLATFORM_UNKNOWN +#elif defined(__CYGWIN__) +# define GLM_PLATFORM GLM_PLATFORM_CYGWIN +#elif defined(__QNXNTO__) +# define GLM_PLATFORM GLM_PLATFORM_QNXNTO +#elif defined(__APPLE__) +# define GLM_PLATFORM GLM_PLATFORM_APPLE +#elif defined(WINCE) +# define GLM_PLATFORM GLM_PLATFORM_WINCE +#elif defined(_WIN32) +# define GLM_PLATFORM GLM_PLATFORM_WINDOWS +#elif defined(__native_client__) +# define GLM_PLATFORM GLM_PLATFORM_CHROME_NACL +#elif defined(__ANDROID__) +# define GLM_PLATFORM GLM_PLATFORM_ANDROID +#elif defined(__linux) +# define GLM_PLATFORM GLM_PLATFORM_LINUX +#elif defined(__unix) +# define GLM_PLATFORM GLM_PLATFORM_UNIX +#else +# define GLM_PLATFORM GLM_PLATFORM_UNKNOWN +#endif// + +/////////////////////////////////////////////////////////////////////////////////// +// Compiler + +#define GLM_COMPILER_UNKNOWN 0x00000000 + +// Intel +#define GLM_COMPILER_INTEL 0x00100000 +#define GLM_COMPILER_INTEL14 0x00100040 +#define GLM_COMPILER_INTEL15 0x00100050 +#define GLM_COMPILER_INTEL16 0x00100060 +#define GLM_COMPILER_INTEL17 0x00100070 + +// Visual C++ defines +#define GLM_COMPILER_VC 0x01000000 +#define GLM_COMPILER_VC12 0x01000001 +#define GLM_COMPILER_VC14 0x01000002 +#define GLM_COMPILER_VC15 0x01000003 +#define GLM_COMPILER_VC15_3 0x01000004 +#define GLM_COMPILER_VC15_5 0x01000005 +#define GLM_COMPILER_VC15_6 0x01000006 +#define GLM_COMPILER_VC15_7 0x01000007 +#define GLM_COMPILER_VC15_8 0x01000008 +#define GLM_COMPILER_VC15_9 0x01000009 +#define GLM_COMPILER_VC16 0x0100000A + +// GCC defines +#define GLM_COMPILER_GCC 0x02000000 +#define GLM_COMPILER_GCC46 0x020000D0 +#define GLM_COMPILER_GCC47 0x020000E0 +#define GLM_COMPILER_GCC48 0x020000F0 +#define GLM_COMPILER_GCC49 0x02000100 +#define GLM_COMPILER_GCC5 0x02000200 +#define GLM_COMPILER_GCC6 0x02000300 +#define GLM_COMPILER_GCC61 0x02000800 +#define GLM_COMPILER_GCC7 0x02000400 +#define GLM_COMPILER_GCC8 0x02000500 + +// CUDA +#define GLM_COMPILER_CUDA 0x10000000 +#define GLM_COMPILER_CUDA75 0x10000001 +#define GLM_COMPILER_CUDA80 0x10000002 +#define GLM_COMPILER_CUDA90 0x10000004 +#define GLM_COMPILER_CUDA_RTC 0x10000100 + +// SYCL +#define GLM_COMPILER_SYCL 0x00300000 + +// Clang +#define GLM_COMPILER_CLANG 0x20000000 +#define GLM_COMPILER_CLANG34 0x20000050 +#define GLM_COMPILER_CLANG35 0x20000060 +#define GLM_COMPILER_CLANG36 0x20000070 +#define GLM_COMPILER_CLANG37 0x20000080 +#define GLM_COMPILER_CLANG38 0x20000090 +#define GLM_COMPILER_CLANG39 0x200000A0 +#define GLM_COMPILER_CLANG40 0x200000B0 +#define GLM_COMPILER_CLANG41 0x200000C0 +#define GLM_COMPILER_CLANG42 0x200000D0 + +// HIP +#define GLM_COMPILER_HIP 0x40000000 + +// Build model +#define GLM_MODEL_32 0x00000010 +#define GLM_MODEL_64 0x00000020 + +// Force generic C++ compiler +#ifdef GLM_FORCE_COMPILER_UNKNOWN +# define GLM_COMPILER GLM_COMPILER_UNKNOWN + +#elif defined(__INTEL_COMPILER) +# if __INTEL_COMPILER >= 1700 +# define GLM_COMPILER GLM_COMPILER_INTEL17 +# elif __INTEL_COMPILER >= 1600 +# define GLM_COMPILER GLM_COMPILER_INTEL16 +# elif __INTEL_COMPILER >= 1500 +# define GLM_COMPILER GLM_COMPILER_INTEL15 +# elif __INTEL_COMPILER >= 1400 +# define GLM_COMPILER GLM_COMPILER_INTEL14 +# elif __INTEL_COMPILER < 1400 +# error "GLM requires ICC 2013 SP1 or newer" +# endif + +// CUDA +#elif defined(__CUDACC__) +# if !defined(CUDA_VERSION) && !defined(GLM_FORCE_CUDA) +# include // make sure version is defined since nvcc does not define it itself! +# endif +# if defined(__CUDACC_RTC__) +# define GLM_COMPILER GLM_COMPILER_CUDA_RTC +# elif CUDA_VERSION >= 8000 +# define GLM_COMPILER GLM_COMPILER_CUDA80 +# elif CUDA_VERSION >= 7500 +# define GLM_COMPILER GLM_COMPILER_CUDA75 +# elif CUDA_VERSION >= 7000 +# define GLM_COMPILER GLM_COMPILER_CUDA70 +# elif CUDA_VERSION < 7000 +# error "GLM requires CUDA 7.0 or higher" +# endif + +// HIP +#elif defined(__HIP__) +# define GLM_COMPILER GLM_COMPILER_HIP + +// SYCL +#elif defined(__SYCL_DEVICE_ONLY__) +# define GLM_COMPILER GLM_COMPILER_SYCL + +// Clang +#elif defined(__clang__) +# if defined(__apple_build_version__) +# if (__clang_major__ < 6) +# error "GLM requires Clang 3.4 / Apple Clang 6.0 or higher" +# elif __clang_major__ == 6 && __clang_minor__ == 0 +# define GLM_COMPILER GLM_COMPILER_CLANG35 +# elif __clang_major__ == 6 && __clang_minor__ >= 1 +# define GLM_COMPILER GLM_COMPILER_CLANG36 +# elif __clang_major__ >= 7 +# define GLM_COMPILER GLM_COMPILER_CLANG37 +# endif +# else +# if ((__clang_major__ == 3) && (__clang_minor__ < 4)) || (__clang_major__ < 3) +# error "GLM requires Clang 3.4 or higher" +# elif __clang_major__ == 3 && __clang_minor__ == 4 +# define GLM_COMPILER GLM_COMPILER_CLANG34 +# elif __clang_major__ == 3 && __clang_minor__ == 5 +# define GLM_COMPILER GLM_COMPILER_CLANG35 +# elif __clang_major__ == 3 && __clang_minor__ == 6 +# define GLM_COMPILER GLM_COMPILER_CLANG36 +# elif __clang_major__ == 3 && __clang_minor__ == 7 +# define GLM_COMPILER GLM_COMPILER_CLANG37 +# elif __clang_major__ == 3 && __clang_minor__ == 8 +# define GLM_COMPILER GLM_COMPILER_CLANG38 +# elif __clang_major__ == 3 && __clang_minor__ >= 9 +# define GLM_COMPILER GLM_COMPILER_CLANG39 +# elif __clang_major__ == 4 && __clang_minor__ == 0 +# define GLM_COMPILER GLM_COMPILER_CLANG40 +# elif __clang_major__ == 4 && __clang_minor__ == 1 +# define GLM_COMPILER GLM_COMPILER_CLANG41 +# elif __clang_major__ == 4 && __clang_minor__ >= 2 +# define GLM_COMPILER GLM_COMPILER_CLANG42 +# elif __clang_major__ >= 4 +# define GLM_COMPILER GLM_COMPILER_CLANG42 +# endif +# endif + +// Visual C++ +#elif defined(_MSC_VER) +# if _MSC_VER >= 1920 +# define GLM_COMPILER GLM_COMPILER_VC16 +# elif _MSC_VER >= 1916 +# define GLM_COMPILER GLM_COMPILER_VC15_9 +# elif _MSC_VER >= 1915 +# define GLM_COMPILER GLM_COMPILER_VC15_8 +# elif _MSC_VER >= 1914 +# define GLM_COMPILER GLM_COMPILER_VC15_7 +# elif _MSC_VER >= 1913 +# define GLM_COMPILER GLM_COMPILER_VC15_6 +# elif _MSC_VER >= 1912 +# define GLM_COMPILER GLM_COMPILER_VC15_5 +# elif _MSC_VER >= 1911 +# define GLM_COMPILER GLM_COMPILER_VC15_3 +# elif _MSC_VER >= 1910 +# define GLM_COMPILER GLM_COMPILER_VC15 +# elif _MSC_VER >= 1900 +# define GLM_COMPILER GLM_COMPILER_VC14 +# elif _MSC_VER >= 1800 +# define GLM_COMPILER GLM_COMPILER_VC12 +# elif _MSC_VER < 1800 +# error "GLM requires Visual C++ 12 - 2013 or higher" +# endif//_MSC_VER + +// G++ +#elif defined(__GNUC__) || defined(__MINGW32__) +# if __GNUC__ >= 8 +# define GLM_COMPILER GLM_COMPILER_GCC8 +# elif __GNUC__ >= 7 +# define GLM_COMPILER GLM_COMPILER_GCC7 +# elif __GNUC__ >= 6 +# define GLM_COMPILER GLM_COMPILER_GCC6 +# elif __GNUC__ >= 5 +# define GLM_COMPILER GLM_COMPILER_GCC5 +# elif __GNUC__ == 4 && __GNUC_MINOR__ >= 9 +# define GLM_COMPILER GLM_COMPILER_GCC49 +# elif __GNUC__ == 4 && __GNUC_MINOR__ >= 8 +# define GLM_COMPILER GLM_COMPILER_GCC48 +# elif __GNUC__ == 4 && __GNUC_MINOR__ >= 7 +# define GLM_COMPILER GLM_COMPILER_GCC47 +# elif __GNUC__ == 4 && __GNUC_MINOR__ >= 6 +# define GLM_COMPILER GLM_COMPILER_GCC46 +# elif ((__GNUC__ == 4) && (__GNUC_MINOR__ < 6)) || (__GNUC__ < 4) +# error "GLM requires GCC 4.6 or higher" +# endif + +#else +# define GLM_COMPILER GLM_COMPILER_UNKNOWN +#endif + +#ifndef GLM_COMPILER +# error "GLM_COMPILER undefined, your compiler may not be supported by GLM. Add #define GLM_COMPILER 0 to ignore this message." +#endif//GLM_COMPILER + +/////////////////////////////////////////////////////////////////////////////////// +// Instruction sets + +// User defines: GLM_FORCE_PURE GLM_FORCE_INTRINSICS GLM_FORCE_SSE2 GLM_FORCE_SSE3 GLM_FORCE_AVX GLM_FORCE_AVX2 GLM_FORCE_AVX2 + +#define GLM_ARCH_MIPS_BIT (0x10000000) +#define GLM_ARCH_PPC_BIT (0x20000000) +#define GLM_ARCH_ARM_BIT (0x40000000) +#define GLM_ARCH_ARMV8_BIT (0x01000000) +#define GLM_ARCH_X86_BIT (0x80000000) + +#define GLM_ARCH_SIMD_BIT (0x00001000) + +#define GLM_ARCH_NEON_BIT (0x00000001) +#define GLM_ARCH_SSE_BIT (0x00000002) +#define GLM_ARCH_SSE2_BIT (0x00000004) +#define GLM_ARCH_SSE3_BIT (0x00000008) +#define GLM_ARCH_SSSE3_BIT (0x00000010) +#define GLM_ARCH_SSE41_BIT (0x00000020) +#define GLM_ARCH_SSE42_BIT (0x00000040) +#define GLM_ARCH_AVX_BIT (0x00000080) +#define GLM_ARCH_AVX2_BIT (0x00000100) + +#define GLM_ARCH_UNKNOWN (0) +#define GLM_ARCH_X86 (GLM_ARCH_X86_BIT) +#define GLM_ARCH_SSE (GLM_ARCH_SSE_BIT | GLM_ARCH_SIMD_BIT | GLM_ARCH_X86) +#define GLM_ARCH_SSE2 (GLM_ARCH_SSE2_BIT | GLM_ARCH_SSE) +#define GLM_ARCH_SSE3 (GLM_ARCH_SSE3_BIT | GLM_ARCH_SSE2) +#define GLM_ARCH_SSSE3 (GLM_ARCH_SSSE3_BIT | GLM_ARCH_SSE3) +#define GLM_ARCH_SSE41 (GLM_ARCH_SSE41_BIT | GLM_ARCH_SSSE3) +#define GLM_ARCH_SSE42 (GLM_ARCH_SSE42_BIT | GLM_ARCH_SSE41) +#define GLM_ARCH_AVX (GLM_ARCH_AVX_BIT | GLM_ARCH_SSE42) +#define GLM_ARCH_AVX2 (GLM_ARCH_AVX2_BIT | GLM_ARCH_AVX) +#define GLM_ARCH_ARM (GLM_ARCH_ARM_BIT) +#define GLM_ARCH_ARMV8 (GLM_ARCH_NEON_BIT | GLM_ARCH_SIMD_BIT | GLM_ARCH_ARM | GLM_ARCH_ARMV8_BIT) +#define GLM_ARCH_NEON (GLM_ARCH_NEON_BIT | GLM_ARCH_SIMD_BIT | GLM_ARCH_ARM) +#define GLM_ARCH_MIPS (GLM_ARCH_MIPS_BIT) +#define GLM_ARCH_PPC (GLM_ARCH_PPC_BIT) + +#if defined(GLM_FORCE_ARCH_UNKNOWN) || defined(GLM_FORCE_PURE) +# define GLM_ARCH GLM_ARCH_UNKNOWN +#elif defined(GLM_FORCE_NEON) +# if __ARM_ARCH >= 8 +# define GLM_ARCH (GLM_ARCH_ARMV8) +# else +# define GLM_ARCH (GLM_ARCH_NEON) +# endif +# define GLM_FORCE_INTRINSICS +#elif defined(GLM_FORCE_AVX2) +# define GLM_ARCH (GLM_ARCH_AVX2) +# define GLM_FORCE_INTRINSICS +#elif defined(GLM_FORCE_AVX) +# define GLM_ARCH (GLM_ARCH_AVX) +# define GLM_FORCE_INTRINSICS +#elif defined(GLM_FORCE_SSE42) +# define GLM_ARCH (GLM_ARCH_SSE42) +# define GLM_FORCE_INTRINSICS +#elif defined(GLM_FORCE_SSE41) +# define GLM_ARCH (GLM_ARCH_SSE41) +# define GLM_FORCE_INTRINSICS +#elif defined(GLM_FORCE_SSSE3) +# define GLM_ARCH (GLM_ARCH_SSSE3) +# define GLM_FORCE_INTRINSICS +#elif defined(GLM_FORCE_SSE3) +# define GLM_ARCH (GLM_ARCH_SSE3) +# define GLM_FORCE_INTRINSICS +#elif defined(GLM_FORCE_SSE2) +# define GLM_ARCH (GLM_ARCH_SSE2) +# define GLM_FORCE_INTRINSICS +#elif defined(GLM_FORCE_SSE) +# define GLM_ARCH (GLM_ARCH_SSE) +# define GLM_FORCE_INTRINSICS +#elif defined(GLM_FORCE_INTRINSICS) && !defined(GLM_FORCE_XYZW_ONLY) +# if defined(__AVX2__) +# define GLM_ARCH (GLM_ARCH_AVX2) +# elif defined(__AVX__) +# define GLM_ARCH (GLM_ARCH_AVX) +# elif defined(__SSE4_2__) +# define GLM_ARCH (GLM_ARCH_SSE42) +# elif defined(__SSE4_1__) +# define GLM_ARCH (GLM_ARCH_SSE41) +# elif defined(__SSSE3__) +# define GLM_ARCH (GLM_ARCH_SSSE3) +# elif defined(__SSE3__) +# define GLM_ARCH (GLM_ARCH_SSE3) +# elif defined(__SSE2__) || defined(__x86_64__) || defined(_M_X64) || defined(_M_IX86_FP) +# define GLM_ARCH (GLM_ARCH_SSE2) +# elif defined(__i386__) +# define GLM_ARCH (GLM_ARCH_X86) +# elif defined(__ARM_ARCH) && (__ARM_ARCH >= 8) +# define GLM_ARCH (GLM_ARCH_ARMV8) +# elif defined(__ARM_NEON) +# define GLM_ARCH (GLM_ARCH_ARM | GLM_ARCH_NEON) +# elif defined(__arm__ ) || defined(_M_ARM) +# define GLM_ARCH (GLM_ARCH_ARM) +# elif defined(__mips__ ) +# define GLM_ARCH (GLM_ARCH_MIPS) +# elif defined(__powerpc__ ) || defined(_M_PPC) +# define GLM_ARCH (GLM_ARCH_PPC) +# else +# define GLM_ARCH (GLM_ARCH_UNKNOWN) +# endif +#else +# if defined(__x86_64__) || defined(_M_X64) || defined(_M_IX86) || defined(__i386__) +# define GLM_ARCH (GLM_ARCH_X86) +# elif defined(__arm__) || defined(_M_ARM) +# define GLM_ARCH (GLM_ARCH_ARM) +# elif defined(__powerpc__) || defined(_M_PPC) +# define GLM_ARCH (GLM_ARCH_PPC) +# elif defined(__mips__) +# define GLM_ARCH (GLM_ARCH_MIPS) +# else +# define GLM_ARCH (GLM_ARCH_UNKNOWN) +# endif +#endif + +#if GLM_ARCH & GLM_ARCH_AVX2_BIT +# include +#elif GLM_ARCH & GLM_ARCH_AVX_BIT +# include +#elif GLM_ARCH & GLM_ARCH_SSE42_BIT +# if GLM_COMPILER & GLM_COMPILER_CLANG +# include +# endif +# include +#elif GLM_ARCH & GLM_ARCH_SSE41_BIT +# include +#elif GLM_ARCH & GLM_ARCH_SSSE3_BIT +# include +#elif GLM_ARCH & GLM_ARCH_SSE3_BIT +# include +#elif GLM_ARCH & GLM_ARCH_SSE2_BIT +# include +#elif GLM_ARCH & GLM_ARCH_NEON_BIT +# include "neon.h" +#endif//GLM_ARCH + +#if GLM_ARCH & GLM_ARCH_SSE2_BIT + typedef __m128 glm_f32vec4; + typedef __m128i glm_i32vec4; + typedef __m128i glm_u32vec4; + typedef __m128d glm_f64vec2; + typedef __m128i glm_i64vec2; + typedef __m128i glm_u64vec2; + + typedef glm_f32vec4 glm_vec4; + typedef glm_i32vec4 glm_ivec4; + typedef glm_u32vec4 glm_uvec4; + typedef glm_f64vec2 glm_dvec2; +#endif + +#if GLM_ARCH & GLM_ARCH_AVX_BIT + typedef __m256d glm_f64vec4; + typedef glm_f64vec4 glm_dvec4; +#endif + +#if GLM_ARCH & GLM_ARCH_AVX2_BIT + typedef __m256i glm_i64vec4; + typedef __m256i glm_u64vec4; +#endif + +#if GLM_ARCH & GLM_ARCH_NEON_BIT + typedef float32x4_t glm_f32vec4; + typedef int32x4_t glm_i32vec4; + typedef uint32x4_t glm_u32vec4; +#endif diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/simd/trigonometric.h b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/simd/trigonometric.h new file mode 100644 index 0000000000000000000000000000000000000000..c1c9f9ffc91e201ba9212ebfb0e5355f6f098bc1 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/simd/trigonometric.h @@ -0,0 +1,9 @@ +/// @ref simd +/// @file glm/simd/trigonometric.h + +#pragma once + +#if GLM_ARCH & GLM_ARCH_SSE2_BIT + +#endif//GLM_ARCH & GLM_ARCH_SSE2_BIT + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/simd/vector_relational.h b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/simd/vector_relational.h new file mode 100644 index 0000000000000000000000000000000000000000..cb903f4ce4338fb72ad16fb3f449644730ea1cbf --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/simd/vector_relational.h @@ -0,0 +1,8 @@ +/// @ref simd +/// @file glm/simd/vector_relational.h + +#pragma once + +#if GLM_ARCH & GLM_ARCH_SSE2_BIT + +#endif//GLM_ARCH & GLM_ARCH_SSE2_BIT diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/trigonometric.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/trigonometric.hpp new file mode 100644 index 0000000000000000000000000000000000000000..7a6e0ab6041904c6d4ce376b3bc79fb1144bc911 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/trigonometric.hpp @@ -0,0 +1,210 @@ +/// @ref core +/// @file glm/trigonometric.hpp +/// +/// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions +/// +/// @defgroup core_func_trigonometric Angle and Trigonometry Functions +/// @ingroup core +/// +/// Function parameters specified as angle are assumed to be in units of radians. +/// In no case will any of these functions result in a divide by zero error. If +/// the divisor of a ratio is 0, then results will be undefined. +/// +/// These all operate component-wise. The description is per component. +/// +/// Include to use these core features. +/// +/// @see ext_vector_trigonometric + +#pragma once + +#include "detail/setup.hpp" +#include "detail/qualifier.hpp" + +namespace glm +{ + /// @addtogroup core_func_trigonometric + /// @{ + + /// Converts degrees to radians and returns the result. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see GLSL radians man page + /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions + template + GLM_FUNC_DECL GLM_CONSTEXPR vec radians(vec const& degrees); + + /// Converts radians to degrees and returns the result. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see GLSL degrees man page + /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions + template + GLM_FUNC_DECL GLM_CONSTEXPR vec degrees(vec const& radians); + + /// The standard trigonometric sine function. + /// The values returned by this function will range from [-1, 1]. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see GLSL sin man page + /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions + template + GLM_FUNC_DECL vec sin(vec const& angle); + + /// The standard trigonometric cosine function. + /// The values returned by this function will range from [-1, 1]. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see GLSL cos man page + /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions + template + GLM_FUNC_DECL vec cos(vec const& angle); + + /// The standard trigonometric tangent function. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see GLSL tan man page + /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions + template + GLM_FUNC_DECL vec tan(vec const& angle); + + /// Arc sine. Returns an angle whose sine is x. + /// The range of values returned by this function is [-PI/2, PI/2]. + /// Results are undefined if |x| > 1. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see GLSL asin man page + /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions + template + GLM_FUNC_DECL vec asin(vec const& x); + + /// Arc cosine. Returns an angle whose cosine is x. + /// The range of values returned by this function is [0, PI]. + /// Results are undefined if |x| > 1. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see GLSL acos man page + /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions + template + GLM_FUNC_DECL vec acos(vec const& x); + + /// Arc tangent. Returns an angle whose tangent is y/x. + /// The signs of x and y are used to determine what + /// quadrant the angle is in. The range of values returned + /// by this function is [-PI, PI]. Results are undefined + /// if x and y are both 0. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see GLSL atan man page + /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions + template + GLM_FUNC_DECL vec atan(vec const& y, vec const& x); + + /// Arc tangent. Returns an angle whose tangent is y_over_x. + /// The range of values returned by this function is [-PI/2, PI/2]. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see GLSL atan man page + /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions + template + GLM_FUNC_DECL vec atan(vec const& y_over_x); + + /// Returns the hyperbolic sine function, (exp(x) - exp(-x)) / 2 + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see GLSL sinh man page + /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions + template + GLM_FUNC_DECL vec sinh(vec const& angle); + + /// Returns the hyperbolic cosine function, (exp(x) + exp(-x)) / 2 + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see GLSL cosh man page + /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions + template + GLM_FUNC_DECL vec cosh(vec const& angle); + + /// Returns the hyperbolic tangent function, sinh(angle) / cosh(angle) + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see GLSL tanh man page + /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions + template + GLM_FUNC_DECL vec tanh(vec const& angle); + + /// Arc hyperbolic sine; returns the inverse of sinh. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see GLSL asinh man page + /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions + template + GLM_FUNC_DECL vec asinh(vec const& x); + + /// Arc hyperbolic cosine; returns the non-negative inverse + /// of cosh. Results are undefined if x < 1. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see GLSL acosh man page + /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions + template + GLM_FUNC_DECL vec acosh(vec const& x); + + /// Arc hyperbolic tangent; returns the inverse of tanh. + /// Results are undefined if abs(x) >= 1. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam Q Value from qualifier enum + /// + /// @see GLSL atanh man page + /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions + template + GLM_FUNC_DECL vec atanh(vec const& x); + + /// @} +}//namespace glm + +#include "detail/func_trigonometric.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/vec2.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/vec2.hpp new file mode 100644 index 0000000000000000000000000000000000000000..ca852fc64c1fa02e8ccc24871bec4759fba613d0 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/vec2.hpp @@ -0,0 +1,14 @@ +/// @ref core +/// @file glm/vec2.hpp + +#pragma once +#include "./ext/vector_bool2.hpp" +#include "./ext/vector_bool2_precision.hpp" +#include "./ext/vector_float2.hpp" +#include "./ext/vector_float2_precision.hpp" +#include "./ext/vector_double2.hpp" +#include "./ext/vector_double2_precision.hpp" +#include "./ext/vector_int2.hpp" +#include "./ext/vector_int2_sized.hpp" +#include "./ext/vector_uint2.hpp" +#include "./ext/vector_uint2_sized.hpp" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/vec3.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/vec3.hpp new file mode 100644 index 0000000000000000000000000000000000000000..820e629c787f0c131b5d4a2cd4474dd9877e7c3d --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/vec3.hpp @@ -0,0 +1,14 @@ +/// @ref core +/// @file glm/vec3.hpp + +#pragma once +#include "./ext/vector_bool3.hpp" +#include "./ext/vector_bool3_precision.hpp" +#include "./ext/vector_float3.hpp" +#include "./ext/vector_float3_precision.hpp" +#include "./ext/vector_double3.hpp" +#include "./ext/vector_double3_precision.hpp" +#include "./ext/vector_int3.hpp" +#include "./ext/vector_int3_sized.hpp" +#include "./ext/vector_uint3.hpp" +#include "./ext/vector_uint3_sized.hpp" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/vec4.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/vec4.hpp new file mode 100644 index 0000000000000000000000000000000000000000..ec5625d8b252ee09de61b9a03a591d3081d2343f --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/vec4.hpp @@ -0,0 +1,15 @@ +/// @ref core +/// @file glm/vec4.hpp + +#pragma once +#include "./ext/vector_bool4.hpp" +#include "./ext/vector_bool4_precision.hpp" +#include "./ext/vector_float4.hpp" +#include "./ext/vector_float4_precision.hpp" +#include "./ext/vector_double4.hpp" +#include "./ext/vector_double4_precision.hpp" +#include "./ext/vector_int4.hpp" +#include "./ext/vector_int4_sized.hpp" +#include "./ext/vector_uint4.hpp" +#include "./ext/vector_uint4_sized.hpp" + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/vector_relational.hpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/vector_relational.hpp new file mode 100644 index 0000000000000000000000000000000000000000..199d176d045742683a16ada4ea96ac6562c6394c --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/glm/vector_relational.hpp @@ -0,0 +1,121 @@ +/// @ref core +/// @file glm/vector_relational.hpp +/// +/// @see GLSL 4.20.8 specification, section 8.7 Vector Relational Functions +/// +/// @defgroup core_func_vector_relational Vector Relational Functions +/// @ingroup core +/// +/// Relational and equality operators (<, <=, >, >=, ==, !=) are defined to +/// operate on scalars and produce scalar Boolean results. For vector results, +/// use the following built-in functions. +/// +/// In all cases, the sizes of all the input and return vectors for any particular +/// call must match. +/// +/// Include to use these core features. +/// +/// @see ext_vector_relational + +#pragma once + +#include "detail/qualifier.hpp" +#include "detail/setup.hpp" + +namespace glm +{ + /// @addtogroup core_func_vector_relational + /// @{ + + /// Returns the component-wise comparison result of x < y. + /// + /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. + /// @tparam T A floating-point or integer scalar type. + /// + /// @see GLSL lessThan man page + /// @see GLSL 4.20.8 specification, section 8.7 Vector Relational Functions + template + GLM_FUNC_DECL GLM_CONSTEXPR vec lessThan(vec const& x, vec const& y); + + /// Returns the component-wise comparison of result x <= y. + /// + /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. + /// @tparam T A floating-point or integer scalar type. + /// + /// @see GLSL lessThanEqual man page + /// @see GLSL 4.20.8 specification, section 8.7 Vector Relational Functions + template + GLM_FUNC_DECL GLM_CONSTEXPR vec lessThanEqual(vec const& x, vec const& y); + + /// Returns the component-wise comparison of result x > y. + /// + /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. + /// @tparam T A floating-point or integer scalar type. + /// + /// @see GLSL greaterThan man page + /// @see GLSL 4.20.8 specification, section 8.7 Vector Relational Functions + template + GLM_FUNC_DECL GLM_CONSTEXPR vec greaterThan(vec const& x, vec const& y); + + /// Returns the component-wise comparison of result x >= y. + /// + /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. + /// @tparam T A floating-point or integer scalar type. + /// + /// @see GLSL greaterThanEqual man page + /// @see GLSL 4.20.8 specification, section 8.7 Vector Relational Functions + template + GLM_FUNC_DECL GLM_CONSTEXPR vec greaterThanEqual(vec const& x, vec const& y); + + /// Returns the component-wise comparison of result x == y. + /// + /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. + /// @tparam T A floating-point, integer or bool scalar type. + /// + /// @see GLSL equal man page + /// @see GLSL 4.20.8 specification, section 8.7 Vector Relational Functions + template + GLM_FUNC_DECL GLM_CONSTEXPR vec equal(vec const& x, vec const& y); + + /// Returns the component-wise comparison of result x != y. + /// + /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. + /// @tparam T A floating-point, integer or bool scalar type. + /// + /// @see GLSL notEqual man page + /// @see GLSL 4.20.8 specification, section 8.7 Vector Relational Functions + template + GLM_FUNC_DECL GLM_CONSTEXPR vec notEqual(vec const& x, vec const& y); + + /// Returns true if any component of x is true. + /// + /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. + /// + /// @see GLSL any man page + /// @see GLSL 4.20.8 specification, section 8.7 Vector Relational Functions + template + GLM_FUNC_DECL GLM_CONSTEXPR bool any(vec const& v); + + /// Returns true if all components of x are true. + /// + /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. + /// + /// @see GLSL all man page + /// @see GLSL 4.20.8 specification, section 8.7 Vector Relational Functions + template + GLM_FUNC_DECL GLM_CONSTEXPR bool all(vec const& v); + + /// Returns the component-wise logical complement of x. + /// /!\ Because of language incompatibilities between C++ and GLSL, GLM defines the function not but not_ instead. + /// + /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. + /// + /// @see GLSL not man page + /// @see GLSL 4.20.8 specification, section 8.7 Vector Relational Functions + template + GLM_FUNC_DECL GLM_CONSTEXPR vec not_(vec const& v); + + /// @} +}//namespace glm + +#include "detail/func_vector_relational.inl" diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/manual.md b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/manual.md new file mode 100644 index 0000000000000000000000000000000000000000..f13dedc48175c5dac2d1586e5d696b7c8f2e499f --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/manual.md @@ -0,0 +1,2448 @@ +![Alt](./doc/manual/logo-mini.png "GLM Logo") + +# GLM 0.9.9 Manual + +![Alt](./doc/manual/g-truc.png "G-Truc Logo") + +--- +
+ +## Table of Contents + ++ [0. Licenses](#section0) ++ [1. Getting started](#section1) ++ [1.1. Using global headers](#section1_1) ++ [1.2. Using separated headers](#section1_2) ++ [1.3. Using extension headers](#section1_3) ++ [1.4. Dependencies](#section1_4) ++ [1.5. Finding GLM with CMake](#section1_5) ++ [2. Preprocessor configurations](#section2) ++ [2.1. GLM\_FORCE\_MESSAGES: Platform auto detection and default configuration](#section2_1) ++ [2.2. GLM\_FORCE\_PLATFORM\_UNKNOWN: Force GLM to no detect the build platform](#section2_2) ++ [2.3. GLM\_FORCE\_COMPILER\_UNKNOWN: Force GLM to no detect the C++ compiler](#section2_3) ++ [2.4. GLM\_FORCE\_ARCH\_UNKNOWN: Force GLM to no detect the build architecture](#section2_4) ++ [2.5. GLM\_FORCE\_CXX\_UNKNOWN: Force GLM to no detect the C++ standard](#section2_5) ++ [2.6. GLM\_FORCE\_CXX**: C++ language detection](#section2_6) ++ [2.7. GLM\_FORCE\_EXPLICIT\_CTOR: Requiring explicit conversions](#section2_7) ++ [2.8. GLM\_FORCE\_INLINE: Force inline](#section2_8) ++ [2.9. GLM\_FORCE\_ALIGNED\_GENTYPES: Force GLM to enable aligned types](#section2_9) ++ [2.10. GLM\_FORCE\_DEFAULT\_ALIGNED\_GENTYPES: Force GLM to use aligned types by default](#section2_10) ++ [2.11. GLM\_FORCE\_INTRINSICS: Using SIMD optimizations](#section2_11) ++ [2.12. GLM\_FORCE\_PRECISION\_**: Default precision](#section2_12) ++ [2.13. GLM\_FORCE\_SINGLE\_ONLY: Removed explicit 64-bits floating point types](#section2_13) ++ [2.14. GLM\_FORCE\_SWIZZLE: Enable swizzle operators](#section2_14) ++ [2.15. GLM\_FORCE\_XYZW\_ONLY: Only exposes x, y, z and w components](#section2_15) ++ [2.16. GLM\_FORCE\_LEFT\_HANDED: Force left handed coordinate system](#section2_16) ++ [2.17. GLM\_FORCE\_DEPTH\_ZERO\_TO\_ONE: Force the use of a clip space between 0 to 1](#section2_17) ++ [2.18. GLM\_FORCE\_SIZE\_T\_LENGTH: Vector and matrix static size type](#section2_18) ++ [2.19. GLM\_FORCE\_UNRESTRICTED\_GENTYPE: Removing genType restriction](#section2_19) ++ [2.20. GLM\_FORCE\_SILENT\_WARNINGS: Silent C++ warnings from language extensions](#section2_20) ++ [2.21. GLM\_FORCE\_QUAT\_DATA\_WXYZ: Force GLM to store quat data as w,x,y,z instead of x,y,z,w](#section2_21) ++ [3. Stable extensions](#section3) ++ [3.1. Scalar types](#section3_1) ++ [3.2. Scalar functions](#section3_2) ++ [3.3. Vector types](#section3_3) ++ [3.4. Vector types with precision qualifiers](#section3_4) ++ [3.5. Vector functions](#section3_5) ++ [3.6. Matrix types](#section3_6) ++ [3.7. Matrix types with precision qualifiers](#section3_7) ++ [3.8. Matrix functions](#section3_8) ++ [3.9. Quaternion types](#section3_9) ++ [3.10. Quaternion types with precision qualifiers](#section3_10) ++ [3.11. Quaternion functions](#section3_11) ++ [4. Recommended extensions](#section4) ++ [4.1. GLM_GTC_bitfield](#section4_1) ++ [4.2. GLM_GTC_color_space](#section4_2) ++ [4.3. GLM_GTC_constants](#section4_3) ++ [4.4. GLM_GTC_epsilon](#section4_4) ++ [4.5. GLM_GTC_integer](#section4_5) ++ [4.6. GLM_GTC_matrix_access](#section4_6) ++ [4.7. GLM_GTC_matrix_integer](#section4_7) ++ [4.8. GLM_GTC_matrix_inverse](#section4_8) ++ [4.9. GLM_GTC_matrix_transform](#section4_9) ++ [4.10. GLM_GTC_noise](#section4_10) ++ [4.11. GLM_GTC_packing](#section4_11) ++ [4.12. GLM_GTC_quaternion](#section4_12) ++ [4.13. GLM_GTC_random](#section4_13) ++ [4.14. GLM_GTC_reciprocal](#section4_14) ++ [4.15. GLM_GTC_round](#section4_15) ++ [4.16. GLM_GTC_type_alignment](#section4_16) ++ [4.17. GLM_GTC_type_precision](#section4_17) ++ [4.18. GLM_GTC_type_ptr](#section4_18) ++ [4.19. GLM_GTC_ulp](#section4_19) ++ [4.20. GLM_GTC_vec1](#section4_20) ++ [5. OpenGL interoperability](#section5) ++ [5.1. GLM Replacements for deprecated OpenGL functions](#section5_1) ++ [5.2. GLM Replacements for GLU functions](#section5_2) ++ [6. Known issues](#section6) ++ [6.1. Not function](#section6_1) ++ [6.2. Precision qualifiers support](#section6_2) ++ [7. FAQ](#section7) ++ [7.1 Why GLM follows GLSL specification and conventions?](#section7_1) ++ [7.2. Does GLM run GLSL programs?](#section7_2) ++ [7.3. Does a GLSL compiler build GLM codes?](#section7_3) ++ [7.4. Should I use ‘GTX’ extensions?](#section7_4) ++ [7.5. Where can I ask my questions?](#section7_5) ++ [7.6. Where can I find the documentation of extensions?](#section7_6) ++ [7.7. Should I use 'using namespace glm;'?](#section7_7) ++ [7.8. Is GLM fast?](#section7_8) ++ [7.9. When I build with Visual C++ with /w4 warning level, I have warnings...](#section7_9) ++ [7.10. Why some GLM functions can crash because of division by zero?](#section7_10) ++ [7.11. What unit for angles us used in GLM?](#section7_11) ++ [7.12. Windows headers cause build errors...](#section7_12) ++ [7.13. Constant expressions support](#section7_13) ++ [8. Code samples](#section8) ++ [8.1. Compute a triangle normal](#section8_1) ++ [8.2. Matrix transform](#section8_2) ++ [8.3. Vector types](#section8_3) ++ [8.4. Lighting](#section8_4) ++ [9. Contributing to GLM](#section9) ++ [9.1. Submitting bug reports](#section9_1) ++ [9.2. Contributing to GLM with pull request](#section9_2) ++ [9.3. Coding style](#section9_3) ++ [10. References](#section10) ++ [10.1. OpenGL specifications](#section10_1) ++ [10.2. External links](#section10_2) ++ [10.3. Projects using GLM](#section10_3) ++ [10.4. Tutorials using GLM](#section10_4) ++ [10.5. Equivalent for other languages](#section10_5) ++ [10.6. Alternatives to GLM](#section10_6) ++ [10.7. Acknowledgements](#section10_7) + +--- +
+ +## Licenses + +### The Happy Bunny License (Modified MIT License) + +Copyright (c) 2005 - G-Truc Creation + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +Restrictions: By making use of the Software for military purposes, you +choose to make a Bunny unhappy. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +![](./doc/manual/frontpage1.png) + +### The MIT License + +Copyright (c) 2005 - G-Truc Creation + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +![](./doc/manual/frontpage2.png) + +--- +
+ +## 1. Getting started + +### 1.1. Using global headers + +GLM is a header-only library, and thus does not need to be compiled. We can use GLM's implementation of GLSL's mathematics functionality by including the `` header: + +```cpp +#include +``` + +To extend the feature set supported by GLM and keeping the library as close to GLSL as possible, new features are implemented as extensions that can be included thought a separated header: + +```cpp +// Include all GLM core / GLSL features +#include // vec2, vec3, mat4, radians + +// Include all GLM extensions +#include // perspective, translate, rotate + +glm::mat4 transform(glm::vec2 const& Orientation, glm::vec3 const& Translate, glm::vec3 const& Up) +{ + glm::mat4 Proj = glm::perspective(glm::radians(45.f), 1.33f, 0.1f, 10.f); + glm::mat4 ViewTranslate = glm::translate(glm::mat4(1.f), Translate); + glm::mat4 ViewRotateX = glm::rotate(ViewTranslate, Orientation.y, Up); + glm::mat4 View = glm::rotate(ViewRotateX, Orientation.x, Up); + glm::mat4 Model = glm::mat4(1.0f); + return Proj * View * Model; +} +``` + +*Note: Including `` and `` is convenient but pull a lot of code which will significantly increase build time, particularly if these files are included in all source files. We may prefer to use the approaches describe in the two following sections to keep the project build fast.* + +### 1.2. Using separated headers + +GLM relies on C++ templates heavily, and may significantly increase compilation times for projects that use it. Hence, user projects could only include the features they actually use. Following is the list of all the core features, based on GLSL specification, headers: + +```cpp +#include // vec2, bvec2, dvec2, ivec2 and uvec2 +#include // vec3, bvec3, dvec3, ivec3 and uvec3 +#include // vec4, bvec4, dvec4, ivec4 and uvec4 +#include // mat2, dmat2 +#include // mat2x3, dmat2x3 +#include // mat2x4, dmat2x4 +#include // mat3x2, dmat3x2 +#include // mat3, dmat3 +#include // mat3x4, dmat2 +#include // mat4x2, dmat4x2 +#include // mat4x3, dmat4x3 +#include // mat4, dmat4 +#include // all the GLSL common functions: abs, min, mix, isnan, fma, etc. +#include // all the GLSL exponential functions: pow, log, exp2, sqrt, etc. +#include // all the GLSL geometry functions: dot, cross, reflect, etc. +#include // all the GLSL integer functions: findMSB, bitfieldExtract, etc. +#include // all the GLSL matrix functions: transpose, inverse, etc. +#include // all the GLSL packing functions: packUnorm4x8, unpackHalf2x16, etc. +#include // all the GLSL trigonometric functions: radians, cos, asin, etc. +#include // all the GLSL vector relational functions: equal, less, etc. +``` + +The following is a code sample using separated core headers and an extension: + +```cpp +// Include GLM core features +#include // vec2 +#include // vec3 +#include // mat4 +#include //radians + +// Include GLM extension +#include // perspective, translate, rotate + +glm::mat4 transform(glm::vec2 const& Orientation, glm::vec3 const& Translate, glm::vec3 const& Up) +{ + glm::mat4 Proj = glm::perspective(glm::radians(45.f), 1.33f, 0.1f, 10.f); + glm::mat4 ViewTranslate = glm::translate(glm::mat4(1.f), Translate); + glm::mat4 ViewRotateX = glm::rotate(ViewTranslate, Orientation.y, Up); + glm::mat4 View = glm::rotate(ViewRotateX, Orientation.x, Up); + glm::mat4 Model = glm::mat4(1.0f); + return Proj * View * Model; +} +``` + +### 1.3. Using extension headers + +Using GLM through split headers to minimize the project build time: + +```cpp +// Include GLM vector extensions: +#include // vec2 +#include // vec3 +#include // radians + +// Include GLM matrix extensions: +#include // mat4 +#include // perspective, translate, rotate + +glm::mat4 transform(glm::vec2 const& Orientation, glm::vec3 const& Translate, glm::vec3 const& Up) +{ + glm::mat4 Proj = glm::perspective(glm::radians(45.f), 1.33f, 0.1f, 10.f); + glm::mat4 ViewTranslate = glm::translate(glm::mat4(1.f), Translate); + glm::mat4 ViewRotateX = glm::rotate(ViewTranslate, Orientation.y, Up); + glm::mat4 View = glm::rotate(ViewRotateX, Orientation.x, Up); + glm::mat4 Model = glm::mat4(1.0f); + return Proj * View * Model; +} +``` + +### 1.4. Dependencies + +GLM does not depend on external libraries or headers such as ``, [``](http://www.opengl.org/registry/api/GL/glcorearb.h), ``, ``, or ``. + +### 1.5. Finding GLM with CMake + +When installed, GLM provides the CMake package configuration files `glmConfig.cmake` and `glmConfigVersion.cmake`. + +To use these configurations files, you may need to set the `glm_DIR` variable to the directory containing the configuration files `/lib/cmake/glm/`. + +Use the `find_package` CMake command to load the configurations into your project. Lastly, either link your executable against the `glm::glm` target or add `${GLM_INCLUDE_DIRS}` to your target's include directories: + +```cmake +set(glm_DIR /lib/cmake/glm) # if necessary +find_package(glm REQUIRED) +target_link_libraries( glm::glm) +``` + +To use GLM as a submodule in a project instead, use `add_subdirectory` to expose the same target, or add the directory to your target's + +```cmake +add_subdirectory(glm) +target_link_libraries( glm::glm) +# or +target_include_directories( glm) +``` + +--- +
+ +## 2. Preprocessor configurations + +### 2.1. GLM\_FORCE\_MESSAGES: Platform auto detection and default configuration + +When included, GLM will first automatically detect the compiler used, the C++ standard supported, the compiler arguments used to configure itself matching the build environment. + +For example, if the compiler arguments request AVX code generation, GLM will rely on its code path providing AVX optimizations when available. + +We can change GLM configuration using specific C++ preprocessor defines that must be declared before including any GLM headers. + +Using `GLM_FORCE_MESSAGES`, GLM will report the configuration as part of the build log. + +```cpp +#define GLM_FORCE_MESSAGES // Or defined when building (e.g. -DGLM_FORCE_SWIZZLE) +#include +``` + +Example of configuration log generated by `GLM_FORCE_MESSAGES`: + +```plaintext +GLM: version 0.9.9.1 +GLM: C++ 17 with extensions +GLM: Clang compiler detected +GLM: x86 64 bits with AVX instruction set build target +GLM: Linux platform detected +GLM: GLM_FORCE_SWIZZLE is undefined. swizzling functions or operators are disabled. +GLM: GLM_FORCE_SIZE_T_LENGTH is undefined. .length() returns a glm::length_t, a typedef of int following GLSL. +GLM: GLM_FORCE_UNRESTRICTED_GENTYPE is undefined. Follows strictly GLSL on valid function genTypes. +GLM: GLM_FORCE_DEPTH_ZERO_TO_ONE is undefined. Using negative one to one depth clip space. +GLM: GLM_FORCE_LEFT_HANDED is undefined. Using right handed coordinate system. +``` + +The following subsections describe each configurations and defines. + +### 2.2. GLM\_FORCE\_PLATFORM\_UNKNOWN: Force GLM to no detect the build platform + +`GLM_FORCE_PLATFORM_UNKNOWN` prevents GLM from detecting the build platform. + +### 2.3. GLM\_FORCE\_COMPILER\_UNKNOWN: Force GLM to no detect the C++ compiler + +`GLM_FORCE_COMPILER_UNKNOWN` prevents GLM from detecting the C++ compiler. + +### 2.4. GLM\_FORCE\_ARCH\_UNKNOWN: Force GLM to no detect the build architecture + +`GLM_FORCE_ARCH_UNKNOWN` prevents GLM from detecting the build target architecture. + +### 2.5. GLM\_FORCE\_CXX\_UNKNOWN: Force GLM to no detect the C++ standard + +`GLM_FORCE_CSS_UNKNOWN` prevents GLM from detecting the C++ compiler standard support. + +### 2.6. GLM\_FORCE\_CXX**: C++ language detection + +GLM will automatically take advantage of compilers’ language extensions when enabled. To increase cross platform compatibility and to avoid compiler extensions, a programmer can define `GLM_FORCE_CXX98` before +any inclusion of `` to restrict the language feature set C++98: + +```cpp +#define GLM_FORCE_CXX98 +#include +``` + +For C++11, C++14, and C++17 equivalent defines are available: + +* `GLM_FORCE_CXX11` +* `GLM_FORCE_CXX14` +* `GLM_FORCE_CXX17` + +```cpp +#define GLM_FORCE_CXX11 +#include + +// If the compiler doesn’t support C++11, compiler errors will happen. +``` + +`GLM_FORCE_CXX17` overrides `GLM_FORCE_CXX14`; `GLM_FORCE_CXX14` overrides `GLM_FORCE_CXX11`; and `GLM_FORCE_CXX11` overrides `GLM_FORCE_CXX98` defines. + +### 2.7. GLM\_FORCE\_EXPLICIT\_CTOR: Requiring explicit conversions + +GLSL supports implicit conversions of vector and matrix types. For example, an ivec4 can be implicitly converted into `vec4`. + +Often, this behaviour is not desirable but following the spirit of the library, this is the default behavior in GLM. However, GLM 0.9.6 introduced the define `GLM_FORCE_EXPLICIT_CTOR` to require explicit conversion for GLM types. + +```cpp +#include + +void foo() +{ + glm::ivec4 a; + ... + + glm::vec4 b(a); // Explicit conversion, OK + glm::vec4 c = a; // Implicit conversion, OK + ... +} +``` + +With `GLM_FORCE_EXPLICIT_CTOR` define, implicit conversions are not allowed: + +```cpp +#define GLM_FORCE_EXPLICIT_CTOR +#include + +void foo() +{ + glm::ivec4 a; + { + glm::vec4 b(a); // Explicit conversion, OK + glm::vec4 c = a; // Implicit conversion, ERROR + ... +} +``` + +### 2.8. GLM\_FORCE\_INLINE: Force inline + +To push further the software performance, a programmer can define `GLM_FORCE_INLINE` before any inclusion of `` to force the compiler to inline GLM code. + +```cpp +#define GLM_FORCE_INLINE +#include +``` + +### 2.9. GLM\_FORCE\_ALIGNED\_GENTYPES: Force GLM to enable aligned types + +Every object type has the property called alignment requirement, which is an integer value (of type `std::size_t`, always a power of 2) representing the number of bytes between successive addresses at which objects of this type can be allocated. The alignment requirement of a type can be queried with alignof or `std::alignment_of`. The pointer alignment function `std::align` can be used to obtain a suitably-aligned pointer within some buffer, and `std::aligned_storage` can be used to obtain suitably-aligned storage. + +Each object type imposes its alignment requirement on every object of that type; stricter alignment (with larger alignment requirement) can be requested using C++11 `alignas`. + +In order to satisfy alignment requirements of all non-static members of a class, padding may be inserted after some of its members. + +GLM supports both packed and aligned types. Packed types allow filling data structure without inserting extra padding. Aligned GLM types align addresses based on the size of the value type of a GLM type. + +```cpp +#define GLM_FORCE_ALIGNED_GENTYPES +#include +#include + +typedef glm::aligned_vec4 vec4a; +typedef glm::packed_vec4 vec4p; +``` + +### 2.10. GLM\_FORCE\_DEFAULT\_ALIGNED\_GENTYPES: Force GLM to use aligned types by default + +GLM allows using aligned types by default for vector types using `GLM_FORCE_DEFAULT_ALIGNED_GENTYPES`: + +```cpp +#define GLM_FORCE_DEFAULT_ALIGNED_GENTYPES +#include + +struct MyStruct +{ + glm::vec4 a; + float b; + glm::vec3 c; +}; + +void foo() +{ + printf("MyStruct requires memory padding: %d bytes\n", sizeof(MyStruct)); +} + +>>> MyStruct requires memory padding: 48 bytes +``` + +```cpp +#include + +struct MyStruct +{ + glm::vec4 a; + float b; + glm::vec3 c; +}; + +void foo() +{ + printf("MyStruct is tightly packed: %d bytes\n", sizeof(MyStruct)); +} + +>>> MyStruct is tightly packed: 32 bytes +``` + +*Note: GLM SIMD optimizations require the use of aligned types* + +### 2.11. GLM\_FORCE\_INTRINSICS: Using SIMD optimizations + +GLM provides some SIMD optimizations based on [compiler intrinsics](https://msdn.microsoft.com/en-us/library/26td21ds.aspx). +These optimizations will be automatically thanks to compiler arguments when `GLM_FORCE_INTRINSICS` is defined before including GLM files. +For example, if a program is compiled with Visual Studio using `/arch:AVX`, GLM will detect this argument and generate code using AVX instructions automatically when available. + +It’s possible to avoid the instruction set detection by forcing the use of a specific instruction set with one of the fallowing define: +`GLM_FORCE_SSE2`, `GLM_FORCE_SSE3`, `GLM_FORCE_SSSE3`, `GLM_FORCE_SSE41`, `GLM_FORCE_SSE42`, `GLM_FORCE_AVX`, `GLM_FORCE_AVX2` or `GLM_FORCE_AVX512`. + +The use of intrinsic functions by GLM implementation can be avoided using the define `GLM_FORCE_PURE` before any inclusion of GLM headers. This can be particularly useful if we want to rely on C++14 `constexpr`. + +```cpp +#define GLM_FORCE_PURE +#include + +static_assert(glm::vec4::length() == 4, "Using GLM C++ 14 constexpr support for compile time tests"); + +// GLM code will be compiled using pure C++ code without any intrinsics +``` + +```cpp +#define GLM_FORCE_SIMD_AVX2 +#include + +// If the compiler doesn’t support AVX2 instrinsics, compiler errors will happen. +``` + +Additionally, GLM provides a low level SIMD API in glm/simd directory for users who are really interested in writing fast algorithms. + +### 2.12. GLM\_FORCE\_PRECISION\_**: Default precision + +C++ does not provide a way to implement GLSL default precision selection (as defined in GLSL 4.10 specification section 4.5.3) with GLSL-like syntax. + +```glsl +precision mediump int; +precision highp float; +``` + +To use the default precision functionality, GLM provides some defines that need to added before any include of `glm.hpp`: + +```cpp +#define GLM_FORCE_PRECISION_MEDIUMP_INT +#define GLM_FORCE_PRECISION_HIGHP_FLOAT +#include +``` + +Available defines for floating point types (`glm::vec\*`, `glm::mat\*`): + +* `GLM_FORCE_PRECISION_LOWP_FLOAT`: Low precision +* `GLM_FORCE_PRECISION_MEDIUMP_FLOAT`: Medium precision +* `GLM_FORCE_PRECISION_HIGHP_FLOAT`: High precision (default) + +Available defines for floating point types (`glm::dvec\*`, `glm::dmat\*`): + +* `GLM_FORCE_PRECISION_LOWP_DOUBLE`: Low precision +* `GLM_FORCE_PRECISION_MEDIUMP_DOUBLE`: Medium precision +* `GLM_FORCE_PRECISION_HIGHP_DOUBLE`: High precision (default) + +Available defines for signed integer types (`glm::ivec\*`): + +* `GLM_FORCE_PRECISION_LOWP_INT`: Low precision +* `GLM_FORCE_PRECISION_MEDIUMP_INT`: Medium precision +* `GLM_FORCE_PRECISION_HIGHP_INT`: High precision (default) + +Available defines for unsigned integer types (`glm::uvec\*`): + +* `GLM_FORCE_PRECISION_LOWP_UINT`: Low precision +* `GLM_FORCE_PRECISION_MEDIUMP_UINT`: Medium precision +* `GLM_FORCE_PRECISION_HIGHP_UINT`: High precision (default) + +### 2.13. GLM\_FORCE\_SINGLE\_ONLY: Removed explicit 64-bits floating point types + +Some platforms (Dreamcast) doesn't support double precision floating point values. To compile on such platforms, GCC has the `--m4-single-only` build argument. When defining `GLM_FORCE_SINGLE_ONLY` before including GLM headers, GLM releases the requirement of double precision floating point values support. Effectivement, all the float64 types are no longer defined and double behaves like float. + +### 2.14. GLM\_FORCE\_SWIZZLE: Enable swizzle operators + +Shader languages like GLSL often feature so-called swizzle expressions, which may be used to freely select and arrange a vector's components. For example, `variable.x`, `variable.xzy` and `variable.zxyy` respectively form a scalar, a 3D vector and a 4D vector. The result of a swizzle expression in GLSL can be either an R-value or an L-value. Swizzle expressions can be written with characters from exactly one of `xyzw` (usually for positions), `rgba` (usually for colors), and `stpq` (usually for texture coordinates). + +```glsl +vec4 A; +vec2 B; + +B.yx = A.wy; +B = A.xx; +vec3 C = A.bgr; +vec3 D = B.rsz; // Invalid, won't compile +``` + +GLM supports some of this functionality. Swizzling can be enabled by defining `GLM_FORCE_SWIZZLE`. + +*Note: Enabling swizzle expressions will massively increase the size of your binaries and the time it takes to compile them!* + +GLM has two levels of swizzling support described in the following subsections. + +#### 2.14.1. Swizzle functions for standard C++ 98 + +When compiling GLM as C++98, R-value swizzle expressions are simulated through member functions of each vector type. + +```cpp +#define GLM_FORCE_SWIZZLE // Or defined when building (e.g. -DGLM_FORCE_SWIZZLE) +#include + +void foo() +{ + glm::vec4 const ColorRGBA = glm::vec4(1.0f, 0.5f, 0.0f, 1.0f); + glm::vec3 const ColorBGR = ColorRGBA.bgr(); + + glm::vec3 const PositionA = glm::vec3(1.0f, 0.5f, 0.0f); + glm::vec3 const PositionB = PositionXYZ.xyz() * 2.0f; + + glm::vec2 const TexcoordST = glm::vec2(1.0f, 0.5f); + glm::vec4 const TexcoordSTPQ = TexcoordST.stst(); +} +``` + +Swizzle operators return a **copy** of the component values, and thus *can't* be used as L-values to change a vector's values. + +```cpp +#define GLM_FORCE_SWIZZLE +#include + +void foo() +{ + glm::vec3 const A = glm::vec3(1.0f, 0.5f, 0.0f); + + // No compiler error, but A is not modified. + // An anonymous copy is being modified (and then discarded). + A.bgr() = glm::vec3(2.0f, 1.5f, 1.0f); // A is not modified! +} +``` + +#### 2.14.2. Swizzle operations for C++ 98 with language extensions + +Visual C++, GCC and Clang support, as a _non-standard language extension_, anonymous `struct`s as `union` members. This permits a powerful swizzling implementation that both allows L-value swizzle expressions and GLSL-like syntax. To use this feature, the language extension must be enabled by a supporting compiler and `GLM_FORCE_SWIZZLE` must be `#define`d. + +```cpp +#define GLM_FORCE_SWIZZLE +#include + +// Only guaranteed to work with Visual C++! +// Some compilers that support Microsoft extensions may compile this. +void foo() +{ + glm::vec4 ColorRGBA = glm::vec4(1.0f, 0.5f, 0.0f, 1.0f); + + // l-value: + glm::vec4 ColorBGRA = ColorRGBA.bgra; + + // r-value: + ColorRGBA.bgra = ColorRGBA; + + // Both l-value and r-value + ColorRGBA.bgra = ColorRGBA.rgba; +} +``` + +This version returns implementation-specific objects that _implicitly convert_ to their respective vector types. As a consequence of this design, these extra types **can't be directly used** as C++ function arguments; they must be converted through constructors or `operator()`. + +```cpp +#define GLM_FORCE_SWIZZLE +#include + +using namespace glm; + +void foo() +{ + vec4 Color = vec4(1.0f, 0.5f, 0.0f, 1.0f); + + // Generates compiler errors. Color.rgba is not a vector type. + vec4 ClampedA = clamp(Color.rgba, 0.f, 1.f); // ERROR + + // Explicit conversion through a constructor + vec4 ClampedB = clamp(vec4(Color.rgba), 0.f, 1.f); // OK + + // Explicit conversion through operator() + vec4 ClampedC = clamp(Color.rgba(), 0.f, 1.f); // OK +} +``` + +*Note: The implementation has a caveat: Swizzle operator types must be different on both size of the equal operator or the operation will fail. There is no known fix for this issue to date* + +### 2.15. GLM\_FORCE\_XYZW\_ONLY: Only exposes x, y, z and w components + +Following GLSL specifications, GLM supports three sets of components to access vector types member: x, y, z, w; r, g, b, a; and s, t, p, q. +Also, this is making vector component very expressive in the code, it may make debugging vector types a little cubersom as the debuggers will typically display three time the values for each compoenents due to the existence of the three sets. + +To simplify vector types, GLM allows exposing only x, y, z and w components thanks to `GLM_FORCE_XYZW_ONLY` define. + +### 2.16. GLM\_FORCE\_LEFT\_HANDED: Force left handed coordinate system + +By default, OpenGL is using a right handed coordinate system. However, others APIs such as Direct3D have done different choice and relies on the left handed coordinate system. + +GLM allows switching the coordinate system to left handed by defining `GLM_FORCE_LEFT_HANDED`. + +### 2.17. GLM\_FORCE\_DEPTH\_ZERO\_TO\_ONE: Force the use of a clip space between 0 to 1 + +By default, OpenGL is using a -1 to 1 clip space in Z-axis. However, others APIs such as Direct3D relies on a clip space between 0 to 1 in Z-axis. + +GLM allows switching the clip space in Z-axis to 0 to 1 by defining `GLM_FORCE_DEPTH_ZERO_TO_ONE`. + +### 2.18. GLM\_FORCE\_SIZE\_T\_LENGTH: Vector and matrix static size + +GLSL supports the member function .length() for all vector and matrix types. + +```cpp +#include + +void foo(vec4 const& v) +{ + int Length = v.length(); + ... +} +``` + +This function returns an `int` however this function typically interacts with STL `size_t` based code. GLM provides `GLM_FORCE_SIZE_T_LENGTH` pre-processor configuration so that member functions `length()` return a `size_t`. + +Additionally, GLM defines the type `glm::length_t` to identify `length()` returned type, independently from `GLM_FORCE_SIZE_T_LENGTH`. + +```cpp +#define GLM_FORCE_SIZE_T_LENGTH +#include + +void foo(vec4 const& v) +{ + glm::length_t Length = v.length(); + ... +} +``` + +### 2.19. GLM\_FORCE\_UNRESTRICTED\_GENTYPE: Removing genType restriction + +GLSL has restrictions on types supported by certain functions that may appear excessive. +By default, GLM follows the GLSL specification as accurately as possible however it's possible to relax these rules using `GLM_FORCE_UNRESTRICTED_GENTYPE` define. + +```cpp +#include + +float average(float const A, float const B) +{ + return glm::mix(A, B, 0.5f); // By default glm::mix only supports floating-point types +} +``` + +By defining GLM\_FORCE\_UNRESTRICTED\_GENTYPE, we allow using integer types: + +```cpp +#define GLM_FORCE_UNRESTRICTED_GENTYPE +#include + +int average(int const A, int const B) +{ + return glm::mix(A, B, 0.5f); // integers are ok thanks to GLM_FORCE_UNRESTRICTED_GENTYPE +} +``` + +### 2.20. GLM\_FORCE\_SILENT\_WARNINGS: Silent C++ warnings from language extensions + +When using /W4 on Visual C++ or -Wpedantic on GCC, for example, the compilers will generate warnings for using C++ language extensions (/Za with Visual C++) such as anonymous struct. +GLM relies on anonymous structs for swizzle operators and aligned vector types. To silent those warnings define `GLM_FORCE_SILENT_WARNINGS` before including GLM headers. + +### 2.21. GLM\_FORCE\_QUAT\_DATA\_WXYZ: Force GLM to store quat data as w,x,y,z instead of x,y,z,w + +By default GLM store quaternion components with the x, y, z, w order. `GLM_FORCE_QUAT_DATA_WXYZ` allows switching the quaternion data storage to the w, x, y, z order. + +--- +
+ +## 3. Stable extensions + +### 3.1. Scalar types + +#### 3.1.1. GLM_EXT_scalar_int_sized + +This extension exposes sized and signed integer types. + +Include `` to use these features. + +#### 3.1.2. GLM_EXT_scalar_uint_sized + +This extension exposes sized and unsigned integer types. + +```cpp +#include + +glm::uint64 pack(glm::uint32 A, glm::uint16 B, glm::uint8 C, glm::uint8 D) +{ + glm::uint64 ShiftA = 0; + glm::uint64 ShiftB = sizeof(glm::uint32) * 8; + glm::uint64 ShiftC = (sizeof(glm::uint32) + sizeof(glm::uint16)) * 8; + glm::uint64 ShiftD = (sizeof(glm::uint32) + sizeof(glm::uint16) + sizeof(glm::uint8)) * 8; + return (glm::uint64(A) << ShiftA) | (glm::uint64(B) << ShiftB) | (glm::uint64(C) << ShiftC) | (glm::uint64(D) << ShiftD); +} +``` + +Include `` to use these features. + +### 3.2. Scalar functions + +#### 3.2.1. GLM_EXT_scalar_common + +This extension exposes support for `min` and `max` functions taking more than two scalar arguments. Also, it adds `fmin` and `fmax` variants which prevents `NaN` propagation. + +```cpp +#include + +float positiveMax(float const a, float const b) +{ + return glm::fmax(a, b, 0.0f); +} +``` + +Include `` to use these features. + +#### 3.2.2. GLM_EXT_scalar_relational + +This extension exposes `equal` and `notEqual` scalar variants which takes an epsilon argument. + +```cpp +#include + +bool epsilonEqual(float const a, float const b) +{ + float const CustomEpsilon = 0.0001f; + return glm::equal(a, b, CustomEpsilon); +} +``` + +Include `` to use these features. + +#### 3.2.3. GLM_EXT_scalar_constants + +This extension exposes useful constants such as `epsilon` and `pi`. + +```cpp +#include + +float circumference(float const Diameter) +{ + return glm::pi() * Diameter; +} +``` + +```cpp +#include // abs +#include // epsilon + +bool equalULP1(float const a, float const b) +{ + return glm::abs(a - b) <= glm::epsilon(); +} +``` + +Include `` to use these features. + +#### 3.2.4. GLM_EXT_scalar_ulp + +This extension exposes function that measure of accuracy in numeric calculations. + +```cpp +#include + +bool test_ulp(float x) +{ + float const a = glm::next_float(x); // return a float a ULP away from the float argument. + return float_distance(a, x) == 1; // check both float are a single ULP away. +} +``` + +Include `` to use these features. + +### 3.3. Vector types + +#### 3.3.1. GLM_EXT_vector_float1 + +This extension exposes single-precision floating point vector with 1 component: `vec1`. + +Include `` to use these features. + +#### 3.3.2. GLM_EXT_vector_float2 + +This extension exposes single-precision floating point vector with 2 components: `vec2`. + +Include `` to use these features. + +#### 3.3.3. GLM_EXT_vector_float3 + +This extension exposes single-precision floating point vector with 3 components: `vec3`. + +Include `` to use these features. + +#### 3.3.4. GLM_EXT_vector_float4 + +This extension exposes single-precision floating point vector with 4 components: `vec4`. + +Include `` to use these features. + +#### 3.3.5. GLM_EXT_vector_double1 + +This extension exposes double-precision floating point vector with 1 component: `dvec1`. + +Include `` to use these features. + +#### 3.3.6. GLM_EXT_vector_double2 + +This extension exposes double-precision floating point vector with 2 components: `dvec2`. + +Include `` to use these features. + +#### 3.3.7. GLM_EXT_vector_double3 + +This extension exposes double-precision floating point vector with 3 components: `dvec3`. + +Include `` to use these features. + +#### 3.3.8. GLM_EXT_vector_double4 + +This extension exposes double-precision floating point vector with 4 components: `dvec4`. + +Include `` to use these features. + +#### 3.3.9. GLM_EXT_vector_int1 + +This extension exposes signed integer vector with 1 component: `ivec1`. + +Include `` to use these features. + +#### 3.3.10. GLM_EXT_vector_int2 + +This extension exposes signed integer vector with 2 components: `ivec2`. + +Include `` to use these features. + +#### 3.3.11. GLM_EXT_vector_int3 + +This extension exposes signed integer vector with 3 components: `ivec3`. + +Include `` to use these features. + +#### 3.3.12. GLM_EXT_vector_int4 + +This extension exposes signed integer vector with 4 components: `ivec4`. + +Include `` to use these features. + +#### 3.3.13. GLM_EXT_vector_int1 + +This extension exposes unsigned integer vector with 1 component: `uvec1`. + +Include `` to use these features. + +#### 3.3.14. GLM_EXT_vector_uint2 + +This extension exposes unsigned integer vector with 2 components: `uvec2`. + +Include `` to use these features. + +#### 3.3.15. GLM_EXT_vector_uint3 + +This extension exposes unsigned integer vector with 3 components: `uvec3`. + +Include `` to use these features. + +#### 3.3.16. GLM_EXT_vector_uint4 + +This extension exposes unsigned integer vector with 4 components: `uvec4`. + +Include `` to use these features. + +#### 3.3.17. GLM_EXT_vector_bool1 + +This extension exposes boolean vector with 1 component: `bvec1`. + +Include `` to use these features. + +#### 3.3.18. GLM_EXT_vector_bool2 + +This extension exposes boolean vector with 2 components: `bvec2`. + +Include `` to use these features. + +#### 3.3.19. GLM_EXT_vector_bool3 + +This extension exposes boolean vector with 3 components: `bvec3`. + +Include `` to use these features. + +#### 3.3.20. GLM_EXT_vector_bool4 + +This extension exposes boolean vector with 4 components: `bvec4`. + +Include `` to use these features. + +### 3.4. Vector types with precision qualifiers + +#### 3.4.1. GLM_EXT_vector_float1_precision + +This extension exposes single-precision floating point vector with 1 component using various precision in term of ULPs: `lowp_vec1`, `mediump_vec1` and `highp_vec1`. + +Include `` to use these features. + +#### 3.4.2. GLM_EXT_vector_float2_precision + +This extension exposes single-precision floating point vector with 2 components using various precision in term of ULPs: `lowp_vec2`, `mediump_vec2` and `highp_vec2`. + +Include `` to use these features. + +#### 3.4.3. GLM_EXT_vector_float3_precision + +This extension exposes single-precision floating point vector with 3 components using various precision in term of ULPs: `lowp_vec3`, `mediump_vec3` and `highp_vec3`. + +Include `` to use these features. + +#### 3.4.4. GLM_EXT_vector_float4_precision + +This extension exposes single-precision floating point vector with 4 components using various precision in term of ULPs: `lowp_vec4`, `mediump_vec4` and `highp_vec4`. + +Include `` to use these features. + +#### 3.4.5. GLM_EXT_vector_double1_precision + +This extension exposes double-precision floating point vector with 1 component using various precision in term of ULPs: `lowp_dvec1`, `mediump_dvec1` and `highp_dvec1`. + +Include `` to use these features. + +#### 3.4.6. GLM_EXT_vector_double2_precision + +This extension exposes double-precision floating point vector with 2 components using various precision in term of ULPs: `lowp_dvec2`, `mediump_dvec2` and `highp_dvec2`. + +Include `` to use these features. + +#### 3.4.7. GLM_EXT_vector_double3_precision + +This extension exposes double-precision floating point vector with 3 components using various precision in term of ULPs: `lowp_dvec3`, `mediump_dvec3` and `highp_dvec3`. + +Include `` to use these features. + +#### 3.4.8. GLM_EXT_vector_double4_precision + +This extension exposes double-precision floating point vector with 4 components using various precision in term of ULPs: `lowp_dvec4`, `mediump_dvec4` and `highp_dvec4`. + +Include `` to use these features. + +### 3.5. Vector functions + +#### 3.5.1. GLM_EXT_vector_common + +This extension exposes support for `min` and `max` functions taking more than two vector arguments. Also, it adds `fmin` and `fmax` variants which prevents `NaN` propagation. + +```cpp +#include // vec2 +#include // fmax + +float positiveMax(float const a, float const b) +{ + return glm::fmax(a, b, 0.0f); +} +``` + +Include `` to use these features. + +#### 3.5.2. GLM_EXT_vector_relational + +This extension exposes `equal` and `notEqual` vector variants which takes an epsilon argument. + +```cpp +#include // vec2 +#include // equal, all + +bool epsilonEqual(glm::vec2 const& A, glm::vec2 const& B) +{ + float const CustomEpsilon = 0.0001f; + return glm::all(glm::equal(A, B, CustomEpsilon)); +} +``` + +Include `` to use these features. + +#### 3.5.3. GLM_EXT_vector_ulp + +This extension exposes function that measure of accuracy in numeric calculations. + +```cpp +#include +#include +#include + +bool test_ulp(glm::vec4 const& x) +{ + glm::vec4 const a = glm::next_float(x); // return a float a ULP away from the float argument. + return glm::all(float_distance(a, x) == glm::ivec4(1)); // check both float are a single ULP away. +} +``` + +Include `` to use these features. + +### 3.6. Matrix types + +#### 3.6.1. GLM_EXT_matrix_float2x2 + +This extension exposes single-precision floating point vector with 2 columns by 2 rows: `mat2x2`. + +Include `` to use these features. + +#### 3.6.2. GLM_EXT_matrix_float2x3 + +This extension exposes single-precision floating point vector with 2 columns by 3 rows: `mat2x3`. + +Include `` to use these features. + +#### 3.6.3. GLM_EXT_matrix_float2x4 + +This extension exposes single-precision floating point vector with 2 columns by 4 rows: `mat2x4`. + +Include `` to use these features. + +#### 3.6.4. GLM_EXT_matrix_float3x2 + +This extension exposes single-precision floating point vector with 3 columns by 2 rows: `mat3x2`. + +Include `` to use these features. + +#### 3.6.5. GLM_EXT_matrix_float3x3 + +This extension exposes single-precision floating point vector with 3 columns by 3 rows: `mat3x3`. + +Include `` to use these features. + +#### 3.6.6. GLM_EXT_matrix_float3x4 + +This extension exposes single-precision floating point vector with 3 columns by 4 rows: `mat3x4`. + +Include `` to use these features. + +#### 3.6.7. GLM_EXT_matrix_float4x2 + +This extension exposes single-precision floating point vector with 4 columns by 2 rows: `mat4x2`. + +Include `` to use these features. + +#### 3.6.8. GLM_EXT_matrix_float4x3 + +This extension exposes single-precision floating point vector with 4 columns by 3 rows: `mat4x3`. + +Include `` to use these features. + +#### 3.6.9. GLM_EXT_matrix_float4x4 + +This extension exposes single-precision floating point vector with 4 columns by 4 rows: `mat4x4`. + +Include `` to use these features. + +#### 3.6.10. GLM_EXT_matrix_double2x2 + +This extension exposes double-precision floating point vector with 2 columns by 2 rows: `dmat2x2`. + +Include `` to use these features. + +#### 3.6.11. GLM_EXT_matrix_double2x3 + +This extension exposes double-precision floating point vector with 2 columns by 3 rows: `dmat2x3`. + +Include `` to use these features. + +#### 3.6.12. GLM_EXT_matrix_double2x4 + +This extension exposes double-precision floating point vector with 2 columns by 4 rows: `dmat2x4`. + +Include `` to use these features. + +#### 3.6.13. GLM_EXT_matrix_double3x2 + +This extension exposes double-precision floating point vector with 3 columns by 2 rows: `dmat3x2`. + +Include `` to use these features. + +#### 3.6.14. GLM_EXT_matrix_double3x3 + +This extension exposes double-precision floating point vector with 3 columns by 3 rows: `dmat3x3`. + +Include `` to use these features. + +#### 3.6.15. GLM_EXT_matrix_double3x4 + +This extension exposes double-precision floating point vector with 3 columns by 4 rows: `dmat3x4`. + +Include `` to use these features. + +#### 3.6.16. GLM_EXT_matrix_double4x2 + +This extension exposes double-precision floating point vector with 4 columns by 2 rows: `dmat4x2`. + +Include `` to use these features. + +#### 3.6.17. GLM_EXT_matrix_double4x3 + +This extension exposes double-precision floating point vector with 4 columns by 3 rows: `dmat4x3`. + +Include `` to use these features. + +#### 3.6.18. GLM_EXT_matrix_double4x4 + +This extension exposes double-precision floating point vector with 4 columns by 4 rows: `dmat4x4`. + +Include `` to use these features. + +### 3.7. Matrix types with precision qualifiers + +#### 3.7.1. GLM_EXT_matrix_float2x2_precision + +This extension exposes single-precision floating point vector with 2 columns by 2 rows using various precision in term of ULPs: `lowp_mat2x2`, `mediump_mat2x2` and `highp_mat2x2`. + +Include `` to use these features. + +#### 3.7.2. GLM_EXT_matrix_float2x3_precision + +This extension exposes single-precision floating point vector with 2 columns by 3 rows using various precision in term of ULPs: `lowp_mat2x3`, `mediump_mat2x3` and `highp_mat2x3`. + +Include `` to use these features. + +#### 3.7.3. GLM_EXT_matrix_float2x4_precision + +This extension exposes single-precision floating point vector with 2 columns by 4 rows using various precision in term of ULPs: `lowp_mat2x4`, `mediump_mat2x4` and `highp_mat2x4`. + +Include `` to use these features. + +#### 3.7.4. GLM_EXT_matrix_float3x2_precision + +This extension exposes single-precision floating point vector with 3 columns by 2 rows using various precision in term of ULPs: `lowp_mat3x2`, `mediump_mat3x2` and `highp_mat3x2`. + +Include `` to use these features. + +#### 3.7.5. GLM_EXT_matrix_float3x3_precision + +This extension exposes single-precision floating point vector with 3 columns by 3 rows using various precision in term of ULPs: `lowp_mat3x3`, `mediump_mat3x3` and `highp_mat3x3`. + +Include `` to use these features. + +#### 3.7.6. GLM_EXT_matrix_float3x4_precision + +This extension exposes single-precision floating point vector with 3 columns by 4 rows using various precision in term of ULPs: `lowp_mat3x4`, `mediump_mat3x4` and `highp_mat3x4`. + +Include `` to use these features. + +#### 3.7.7. GLM_EXT_matrix_float4x2_precision + +This extension exposes single-precision floating point vector with 4 columns by 2 rows using various precision in term of ULPs: `lowp_mat4x2`, `mediump_mat4x2` and `highp_mat4x2`. + +Include `` to use these features. + +#### 3.7.8. GLM_EXT_matrix_float4x3_precision + +This extension exposes single-precision floating point vector with 4 columns by 3 rows using various precision in term of ULPs: `lowp_mat4x3`, `mediump_mat4x3` and `highp_mat4x3`. + +Include `` to use these features. + +#### 3.7.9. GLM_EXT_matrix_float4x4_precision + +This extension exposes single-precision floating point vector with 4 columns by 4 rows using various precision in term of ULPs: `lowp_mat4x4`, `mediump_mat4x4` and `highp_mat4x4`. + +Include `` to use these features. + +#### 3.7.10. GLM_EXT_matrix_double2x2_precision + +This extension exposes double-precision floating point vector with 2 columns by 2 rows using various precision in term of ULPs: `lowp_dmat2x2`, `mediump_dmat2x2` and `highp_dmat2x2`. + +Include `` to use these features. + +#### 3.7.11. GLM_EXT_matrix_double2x3_precision + +This extension exposes double-precision floating point vector with 2 columns by 3 rows using various precision in term of ULPs: `lowp_dmat2x3`, `mediump_dmat2x3` and `highp_dmat2x3`. + +Include `` to use these features. + +#### 3.7.12. GLM_EXT_matrix_double2x4_precision + +This extension exposes double-precision floating point vector with 2 columns by 4 rows using various precision in term of ULPs: `lowp_dmat2x4`, `mediump_dmat2x4` and `highp_dmat2x4`. + +Include `` to use these features. + +#### 3.7.13. GLM_EXT_matrix_double3x2_precision + +This extension exposes double-precision floating point vector with 3 columns by 2 rows using various precision in term of ULPs: `lowp_dmat3x2`, `mediump_dmat3x2` and `highp_dmat3x2`. + +Include `` to use these features. + +#### 3.7.14. GLM_EXT_matrix_double3x3_precision + +This extension exposes double-precision floating point vector with 3 columns by 3 rows using various precision in term of ULPs: `lowp_dmat3x3`, `mediump_dmat3x3` and `highp_dmat3x3`. + +Include `` to use these features. + +#### 3.7.15. GLM_EXT_matrix_double3x4_precision + +This extension exposes double-precision floating point vector with 3 columns by 4 rows using various precision in term of ULPs: `lowp_dmat3x4`, `mediump_dmat3x4` and `highp_dmat3x4`. + +Include `` to use these features. + +#### 3.7.16. GLM_EXT_matrix_double4x2_precision + +This extension exposes double-precision floating point vector with 4 columns by 2 rows using various precision in term of ULPs: `lowp_dmat4x2`, `mediump_dmat4x2` and `highp_dmat4x2`. + +Include `` to use these features. + +#### 3.7.17. GLM_EXT_matrix_double4x3_precision + +This extension exposes double-precision floating point vector with 4 columns by 3 rows using various precision in term of ULPs: `lowp_dmat4x3`, `mediump_dmat4x3` and `highp_dmat4x3`. + +Include `` to use these features. + +#### 3.7.18. GLM_EXT_matrix_double4x4_precision + +This extension exposes double-precision floating point vector with 4 columns by 4 rows using various precision in term of ULPs: `lowp_dmat4x4`, `mediump_dmat4x4` and `highp_dmat4x4`. + +Include `` to use these features. + +### 3.8. Matrix functions + +#### 3.8.1. GLM_EXT_matrix_relational + +This extension exposes `equal` and `notEqual` matrix variants which takes an optional epsilon argument. + +```cpp +#include // bvec4 +#include // mat4 +#include // equal, all + +bool epsilonEqual(glm::mat4 const& A, glm::mat4 const& B) +{ + float const CustomEpsilon = 0.0001f; + glm::bvec4 const ColumnEqual = glm::equal(A, B, CustomEpsilon); // Evaluation per column + return glm::all(ColumnEqual); +} +``` + +Include `` to use these features. + +#### 3.8.2. GLM_EXT_matrix_transform + +This extension exposes matrix transformation functions: `translate`, `rotate` and `scale`. + +```cpp +#include // vec2 +#include // vec3 +#include // mat4x4 +#include // translate, rotate, scale, identity + +glm::mat4 computeModelViewMatrix(float Translate, glm::vec2 const & Rotate) +{ + glm::mat4 View = glm::translate(glm::identity(), glm::vec3(0.0f, 0.0f, -Translate)); + View = glm::rotate(View, Rotate.y, glm::vec3(-1.0f, 0.0f, 0.0f)); + View = glm::rotate(View, Rotate.x, glm::vec3(0.0f, 1.0f, 0.0f)); + glm::mat4 Model = glm::scale(glm::identity(), glm::vec3(0.5f)); + return View * Model; +} +``` + +Include `` to use these features. + +#### 3.8.3. GLM_EXT_matrix_clip_space + +This extension exposes functions to transform scenes into the clip space. + +```cpp +#include // mat4x4 +#include // perspective +#include // radians + +glm::mat4 computeProjection(float Width, float Height) +{ + return glm::perspective(glm::radians(45.0f), Width / Height, 0.1f, 100.f); +} +``` + +Include `` to use these features. + +#### 3.8.4. GLM_EXT_matrix_projection + +This extension exposes functions to map object coordinates into window coordinates and reverse + +Include `` to use these features. + +### 3.9. Quaternion types + +#### 3.9.1. GLM_EXT_quaternion_float + +This extension exposes single-precision floating point quaternion: `quat`. + +Include `` to use these features. + +#### 3.9.2. GLM_EXT_quaternion_double + +This extension exposes double-precision floating point quaternion: `dquat`. + +Include `` to use these features. + +### 3.10. Quaternion types with precision qualifiers + +#### 3.10.1. GLM_EXT_quaternion_float_precision + +This extension exposes single-precision floating point quaternion using various precision in term of ULPs: `lowp_quat`, `mediump_quat` and `highp_quat`. + +Include `` to use these features. + +#### 3.10.2. GLM_EXT_quaternion_double_precision + +This extension exposes double-precision floating point quaternion using various precision in term of ULPs: `lowp_dquat`, `mediump_dquat` and `highp_dquat`. + +Include `` to use these features. + +### 3.11. Quaternion functions + +#### 3.11.1. GLM_EXT_quaternion_common + +This extension exposes common quaternion functions such as `slerp`, `conjugate` and `inverse`. + +Include `` to use these features. + +#### 3.11.2. GLM_EXT_quaternion_geometric + +This extension exposes geometric quaternion functions such as `length`, `normalize`, `dot` and `cross`. + +Include `` to use these features. + +#### 3.11.3. GLM_EXT_quaternion_trigonometric + +This extension exposes trigonometric quaternion functions such as `angle` and `axis`. + +Include `` to use these features. + +#### 3.11.4. GLM_EXT_quaternion_exponential + +This extensions expose exponential functions for quaternions such as `exp`, `log`, `pow` and `sqrt`. + +Include `` to use these features. + +#### 3.11.5. GLM_EXT_quaternion_relational + +This extension exposes relational functions to compare quaternions. + +Include `` to use these features. + +#### 3.11.6. GLM_EXT_quaternion_transform + +This extension exposes functions to transform objects. + +Include `` to use these features. + +--- +
+ +## 4. Recommended extensions + +GLM extends the core GLSL feature set with extensions. These extensions include: quaternion, transformation, spline, matrix inverse, color spaces, etc. + +To include an extension, we only need to include the dedicated header file. Once included, the features are added to the GLM namespace. + +```cpp +#include +#include + +int foo() +{ + glm::vec4 Position = glm::vec4(glm:: vec3(0.0f), 1.0f); + glm::mat4 Model = glm::translate(glm::mat4(1.0f), glm::vec3(1.0f)); + + glm::vec4 Transformed = Model * Position; + ... + + return 0; +} +``` + +When an extension is included, all the dependent core functionalities and extensions will be included as well. + +### 4.1. GLM_GTC_bitfield + +Fast bitfield operations on scalar and vector variables. + +`` need to be included to use these features. + +### 4.2. GLM_GTC_color_space + +Conversion between linear RGB and sRGB color spaces. + +`` need to be included to use these features. + +### 4.3. GLM_GTC_constants + +Provide a list of built-in constants. + +`` need to be included to use these features. + +### 4.4. GLM\_GTC\_epsilon + +Approximate equality comparisons for floating-point numbers, possibly with a user-defined epsilon. + +`` need to be included to use these features. + +### 4.5. GLM\_GTC\_integer + +Integer variants of core GLM functions. + +`` need to be included to use these features. + +### 4.6. GLM\_GTC\_matrix\_access + +Functions to conveniently access the individual rows or columns of a matrix. + +`` need to be included to use these features. + +### 4.7. GLM\_GTC\_matrix\_integer + +Integer matrix types similar to the core floating-point matrices. Some operations (such as inverse and determinant) are not supported. + +`` need to be included to use these features. + +### 4.8. GLM\_GTC\_matrix\_inverse + +Additional matrix inverse functions. + +`` need to be included to use these features. + +### 4.9. GLM\_GTC\_matrix\_transform + +Matrix transformation functions that follow the OpenGL fixed-function conventions. + +For example, the `lookAt` function generates a transformation matrix that projects world coordinates into eye coordinates suitable for projection matrices (e.g. `perspective`, `ortho`). See the OpenGL compatibility specifications for more information about the layout of these generated matrices. + +The matrices generated by this extension use standard OpenGL fixed-function conventions. For example, the `lookAt` function generates a transform from world space into the specific eye space that the +projective matrix functions (`perspective`, `ortho`, etc) are designed to expect. The OpenGL compatibility specifications define the particular layout of this eye space. + +`` need to be included to use these features. + +### 4.10. GLM\_GTC\_noise + +Define 2D, 3D and 4D procedural noise functions. + +`` need to be included to use these features. + +![](./doc/manual/noise-simplex1.jpg) + +Figure 4.10.1: glm::simplex(glm::vec2(x / 16.f, y / 16.f)); + +![](./doc/manual/noise-simplex2.jpg) + +Figure 4.10.2: glm::simplex(glm::vec3(x / 16.f, y / 16.f, 0.5f)); + +![](./doc/manual/noise-simplex3.jpg) + +Figure 4.10.3: glm::simplex(glm::vec4(x / 16.f, y / 16.f, 0.5f, 0.5f)); + +![](./doc/manual/noise-perlin1.jpg) + +Figure 4.10.4: glm::perlin(glm::vec2(x / 16.f, y / 16.f)); + +![](./doc/manual/noise-perlin2.jpg) + +Figure 4.10.5: glm::perlin(glm::vec3(x / 16.f, y / 16.f, 0.5f)); + +![](./doc/manual/noise-perlin3.jpg) + +Figure 4.10.6: glm::perlin(glm::vec4(x / 16.f, y / 16.f, 0.5f, 0.5f))); + +![](./doc/manual/noise-perlin4.png) + +Figure 4.10.7: glm::perlin(glm::vec2(x / 16.f, y / 16.f), glm::vec2(2.0f)); + +![](./doc/manual/noise-perlin5.png) + +Figure 4.10.8: glm::perlin(glm::vec3(x / 16.f, y / 16.f, 0.5f), glm::vec3(2.0f)); + +![](./doc/manual/noise-perlin6.png) + +Figure 4.10.9: glm::perlin(glm::vec4(x / 16.f, y / 16.f, glm::vec2(0.5f)), glm::vec4(2.0f)); + +### 4.11. GLM\_GTC\_packing + +Convert scalar and vector types to and from packed formats, saving space at the cost of precision. However, packing a value into a format that it was previously unpacked from is guaranteed to be lossless. + +`` need to be included to use these features. + +### 4.12. GLM\_GTC\_quaternion + +Quaternions and operations upon thereof. + +`` need to be included to use these features. + +### 4.13. GLM\_GTC\_random + +Probability distributions in up to four dimensions. + +`` need to be included to use these features. + +![](./doc/manual/random-linearrand.png) + +Figure 4.13.1: glm::vec4(glm::linearRand(glm::vec2(-1), glm::vec2(1)), 0, 1); + +![](./doc/manual/random-circularrand.png) + +Figure 4.13.2: glm::vec4(glm::circularRand(1.0f), 0, 1); + +![](./doc/manual/random-sphericalrand.png) + +Figure 4.13.3: glm::vec4(glm::sphericalRand(1.0f), 1); + +![](./doc/manual/random-diskrand.png) + +Figure 4.13.4: glm::vec4(glm::diskRand(1.0f), 0, 1); + +![](./doc/manual/random-ballrand.png) + +Figure 4.13.5: glm::vec4(glm::ballRand(1.0f), 1); + +![](./doc/manual/random-gaussrand.png) + +Figure 4.13.6: glm::vec4(glm::gaussRand(glm::vec3(0), glm::vec3(1)), 1); + +### 4.14. GLM\_GTC\_reciprocal + +Reciprocal trigonometric functions (e.g. secant, cosecant, tangent). + +`` need to be included to use the features of this extension. + +### 4.15. GLM\_GTC\_round + +Various rounding operations and common special cases thereof. + +`` need to be included to use the features of this extension. + +### 4.16. GLM\_GTC\_type\_aligned + +Aligned vector types. + +`` need to be included to use the features of this extension. + +### 4.17. GLM\_GTC\_type\_precision + +Vector and matrix types with defined precisions, e.g. `i8vec4`, which is a 4D vector of signed 8-bit integers. + +`` need to be included to use the features of this extension. + +### 4.18. GLM\_GTC\_type\_ptr + +Facilitate interactions between pointers to basic types (e.g. `float*`) and GLM types (e.g. `mat4`). + +This extension defines an overloaded function, `glm::value_ptr`, which returns a pointer to the memory layout of any GLM vector or matrix (`vec3`, `mat4`, etc.). Matrix types store their values in column-major order. This is useful for uploading data to matrices or for copying data to buffer objects. + +```cpp +// GLM_GTC_type_ptr provides a safe solution: +#include +#include + +void foo() +{ + glm::vec4 v(0.0f); + glm::mat4 m(1.0f); + ... + glVertex3fv(glm::value_ptr(v)) + glLoadMatrixfv(glm::value_ptr(m)); +} + +// Another solution, this one inspired by the STL: +#include + +void foo() +{ + glm::vec4 v(0.0f); + glm::mat4 m(1.0f); + ... + glVertex3fv(&v[0]); + glLoadMatrixfv(&m[0][0]); +} +``` + +*Note: It would be possible to implement [`glVertex3fv`](http://www.opengl.org/sdk/docs/man2/xhtml/glVertex.xml)(glm::vec3(0)) in C++ with the appropriate cast operator that would result as an +implicit cast in this example. However cast operators may produce programs running with unexpected behaviours without build error or any form of notification.* + +`` need to be included to use these features. + +### 4.19. GLM\_GTC\_ulp + +Measure a function's accuracy given a reference implementation of it. This extension works on floating-point data and provides results in [ULP](http://ljk.imag.fr/membres/Carine.Lucas/TPScilab/JMMuller/ulp-toms.pdf). + +`` need to be included to use these features. + +### 4.20. GLM\_GTC\_vec1 + +Add \*vec1 types. + +`` need to be included to use these features. + +--- +
+ +## 5. OpenGL interoperability + +### 5.1. GLM replacements for deprecated OpenGL functions + +OpenGL 3.1 specification has deprecated some features that have been removed from OpenGL 3.2 core profile specification. GLM provides some replacement functions. + +[***glRotate{f, d}:***](https://www.opengl.org/sdk/docs/man2/xhtml/glRotate.xml) + +```cpp +glm::mat4 glm::rotate(glm::mat4 const& m, float angle, glm::vec3 const& axis); +glm::dmat4 glm::rotate(glm::dmat4 const& m, double angle, glm::dvec3 const& axis); +``` + +From `GLM_GTC_matrix_transform` extension: <glm/gtc/matrix\_transform.hpp> + +[***glScale{f, d}:***](http://www.opengl.org/sdk/docs/man2/xhtml/glScale.xml) + +```cpp +glm::mat4 glm::scale(glm::mat4 const& m, glm::vec3 const& factors); +glm::dmat4 glm::scale(glm::dmat4 const& m, glm::dvec3 const& factors); +``` + +From `GLM_GTC_matrix_transform` extension: <glm/gtc/matrix\_transform.hpp> + +[***glTranslate{f, d}:***](https://www.opengl.org/sdk/docs/man2/xhtml/glTranslate.xml) + +```cpp +glm::mat4 glm::translate(glm::mat4 const& m, glm::vec3 const& translation); +glm::dmat4 glm::translate(glm::dmat4 const& m, glm::dvec3 const& translation); +``` + +From `GLM_GTC_matrix_transform` extension: <glm/gtc/matrix\_transform.hpp> + +[***glLoadIdentity:***](https://www.opengl.org/sdk/docs/man2/xhtml/glLoadIdentity.xml) + +```cpp +glm::mat4(1.0) or glm::mat4(); +glm::dmat4(1.0) or glm::dmat4(); +``` + +From GLM core library: `` + +[***glMultMatrix{f, d}:***](https://www.opengl.org/sdk/docs/man2/xhtml/glMultMatrix.xml) + +```cpp +glm::mat4() * glm::mat4(); +glm::dmat4() * glm::dmat4(); +``` + +From GLM core library: `` + +[***glLoadTransposeMatrix{f, d}:***](https://www.opengl.org/sdk/docs/man2/xhtml/glLoadTransposeMatrix.xml) + +```cpp +glm::transpose(glm::mat4()); +glm::transpose(glm::dmat4()); +``` + +From GLM core library: `` + +[***glMultTransposeMatrix{f, d}:***](https://www.opengl.org/sdk/docs/man2/xhtml/glMultTransposeMatrix.xml) + +```cpp +glm::mat4() * glm::transpose(glm::mat4()); +glm::dmat4() * glm::transpose(glm::dmat4()); +``` + +From GLM core library: `` + +[***glFrustum:***](http://www.opengl.org/sdk/docs/man2/xhtml/glFrustum.xml) + +```cpp +glm::mat4 glm::frustum(float left, float right, float bottom, float top, float zNear, float zFar); +glm::dmat4 glm::frustum(double left, double right, double bottom, double top, double zNear, double zFar); +``` + +From `GLM_GTC_matrix_transform` extension: `` + +[***glOrtho:***](https://www.opengl.org/sdk/docs/man2/xhtml/glOrtho.xml) + +```cpp +glm::mat4 glm::ortho(float left, float right, float bottom, float top, float zNear, float zFar); +glm::dmat4 glm::ortho(double left, double right, double bottom, double top, double zNear, double zFar); +``` + +From `GLM_GTC_matrix_transform` extension: `` + +### 5.2. GLM replacements for GLU functions + +[***gluLookAt:***](https://www.opengl.org/sdk/docs/man2/xhtml/gluLookAt.xml) + +```cpp +glm::mat4 glm::lookAt(glm::vec3 const& eye, glm::vec3 const& center, glm::vec3 const& up); +glm::dmat4 glm::lookAt(glm::dvec3 const& eye, glm::dvec3 const& center, glm::dvec3 const& up); +``` + +From `GLM_GTC_matrix_transform` extension: `` + +[***gluOrtho2D:***](https://www.opengl.org/sdk/docs/man2/xhtml/gluOrtho2D.xml) + +```cpp +glm::mat4 glm::ortho(float left, float right, float bottom, float top); +glm::dmat4 glm::ortho(double left, double right, double bottom, double top); +``` + +From `GLM_GTC_matrix_transform` extension: `` + +[***gluPerspective:***](https://www.opengl.org/sdk/docs/man2/xhtml/gluPerspective.xml) + +```cpp +glm::mat4 perspective(float fovy, float aspect, float zNear, float zFar); +glm::dmat4 perspective(double fovy, double aspect, double zNear, double zFar); +``` + +Note that in GLM, fovy is expressed in radians, not degrees. + +From `GLM_GTC_matrix_transform` extension: `` + +[***gluPickMatrix:***](https://www.opengl.org/sdk/docs/man2/xhtml/gluPickMatrix.xml) + +```cpp +glm::mat4 pickMatrix(glm::vec2 const& center, glm::vec2 const& delta, glm::ivec4 const& viewport); +glm::dmat4 pickMatrix(glm::dvec2 const& center, glm::dvec2 const& delta, glm::ivec4 const& viewport); +``` + +From `GLM_GTC_matrix_transform` extension: `` + +[***gluProject:***](http://www.opengl.org/sdk/docs/man2/xhtml/gluProject.xml) + +```cpp +glm::vec3 project(glm::vec3 const& obj, glm::mat4 const& model, glm::mat4 const& proj, glm::ivec4 const& viewport); +glm::dvec3 project(glm::dvec3 const& obj, glm::dmat4 const& model, glm::dmat4 const& proj, glm::ivec4 const& viewport); +``` + +From `GLM_GTC_matrix_transform` extension: `` + +[***gluUnProject:***](https://www.opengl.org/sdk/docs/man2/xhtml/gluUnProject.xml) + +```cpp +glm::vec3 unProject(glm::vec3 const& win, glm::mat4 const& model, glm::mat4 const& proj, glm::ivec4 const& viewport); +glm::dvec3 unProject(glm::dvec3 const& win, glm::dmat4 const& model, glm::dmat4 const& proj, glm::ivec4 const& viewport); +``` + +From `GLM_GTC_matrix_transform` extension: `` + +--- +
+ +## 6. Known issues + +This section reports GLSL features that GLM can't accurately emulate due to language restrictions. + +### 6.1. not function + +The GLSL function 'not' is a keyword in C++. To prevent name collisions and ensure a consistent API, the name `not\_` (note the underscore) is used instead. + +### 6.2. Precision qualifiers support + +GLM supports GLSL precision qualifiers through prefixes instead of qualifiers. For example, GLM exposes \verb|lowp_vec4|, \verb|mediump_vec4| and \verb|highp_vec4| as variations of \verb|vec4|. + +Similarly to GLSL, GLM precision qualifiers are used to trade precision of operations in term of [ULPs](http://en.wikipedia.org/wiki/Unit_in_the_last_place) for better performance. By default, all the types use high precision. + +```cpp +// Using precision qualifier in GLSL: + +ivec3 foo(in vec4 v) +{ + highp vec4 a = v; + mediump vec4 b = a; + lowp ivec3 c = ivec3(b); + return c; +} + +// Using precision qualifier in GLM: + +#include + +ivec3 foo(const vec4 & v) +{ + highp_vec4 a = v; + medium_vec4 b = a; + lowp_ivec3 c = glm::ivec3(b); + return c; +} +``` + +--- +
+ +## 7. FAQ + +### 7.1 Why GLM follows GLSL specification and conventions? + +Following GLSL conventions is a really strict policy of GLM. It has been designed following the idea that everyone does its own math library with his own conventions. The idea is that brilliant developers (the OpenGL ARB) worked together and agreed to make GLSL. Following GLSL conventions +is a way to find consensus. Moreover, basically when a developer knows GLSL, he knows GLM. + +### 7.2. Does GLM run GLSL program? + +No, GLM is a C++ implementation of a subset of GLSL. + +### 7.3. Does a GLSL compiler build GLM codes? + +No, this is not what GLM attends to do. + +### 7.4. Should I use ‘GTX’ extensions? + +GTX extensions are qualified to be experimental extensions. In GLM this means that these extensions might change from version to version without any restriction. In practice, it doesn’t really change except time to +time. GTC extensions are stabled, tested and perfectly reliable in time. Many GTX extensions extend GTC extensions and provide a way to explore features and implementations and APIs and then are promoted to GTC +extensions. This is fairly the way OpenGL features are developed; through extensions. + +Stating with GLM 0.9.9, to use experimental extensions, an application must define GLM_ENABLE_EXPERIMENTAL. + +### 7.5. Where can I ask my questions? + +A good place is [stackoverflow](http://stackoverflow.com/search?q=GLM) using the GLM tag. + +### 7.6. Where can I find the documentation of extensions? + +The Doxygen generated documentation includes a complete list of all extensions available. Explore this [*API documentation*](http://glm.g-truc.net/html/index.html) to get a complete +view of all GLM capabilities! + +### 7.7. Should I use ‘using namespace glm;’? + +NO! Chances are that if using namespace glm; is called, especially in a header file, name collisions will happen as GLM is based on GLSL which uses common tokens for types and functions. Avoiding using namespace +glm; will a higher compatibility with third party library and SDKs. + +### 7.8. Is GLM fast? + +GLM is mainly designed to be convenient and that's why it is written against the GLSL specification. + +Following the Pareto principle where 20% of the code consumes 80% of the execution time, GLM operates perfectly on the 80% of the code that consumes 20% of the performances. Furthermore, thanks to the lowp, +mediump and highp qualifiers, GLM provides approximations which trade precision for performance. Finally, GLM can automatically produce SIMD optimized code for functions of its implementation. + +However, on performance critical code paths, we should expect that dedicated algorithms should be written to reach peak performance. + +### 7.9. When I build with Visual C++ with /W4 warning level, I have warnings... + +You should not have any warnings even in `/W4` mode. However, if you expect such level for your code, then you should ask for the same level to the compiler by at least disabling the Visual C++ language extensions +(`/Za`) which generates warnings when used. If these extensions are enabled, then GLM will take advantage of them and the compiler will generate warnings. + +### 7.10. Why some GLM functions can crash because of division by zero? + +GLM functions crashing is the result of a domain error. Such behavior follows the precedent set by C and C++'s standard library. For example, it’s a domain error to pass a null vector (all zeroes) to glm::normalize function, or to pass a negative number into std::sqrt. + +### 7.11. What unit for angles is used in GLM? + +GLSL is using radians but GLU is using degrees to express angles. This has caused GLM to use inconsistent units for angles. Starting with GLM 0.9.6, all GLM functions are using radians. For more information, follow +the [link](http://www.g-truc.net/post-0693.html#menu). + +### 7.12. Windows headers cause build errors... + +Some Windows headers define min and max as macros which may cause compatibility with third party libraries such as GLM. +It is highly recommended to [`define NOMINMAX`](http://stackoverflow.com/questions/4913922/possible-problems-with-nominmax-on-visual-c) before including Windows headers to workaround this issue. +To workaround the incompatibility with these macros, GLM will systematically undef these macros if they are defined. + +### 7.13. Constant expressions support + +GLM has some C++ [constant expressions](http://en.cppreference.com/w/cpp/language/constexpr) support. However, GLM automatically detects the use of SIMD instruction sets through compiler arguments to populate its implementation with SIMD intrinsics. +Unfortunately, GCC and Clang doesn't support SIMD instrinsics as constant expressions. To allow constant expressions on all vectors and matrices types, define `GLM_FORCE_PURE` before including GLM headers. + +--- +
+ +## 8. Code samples + +This series of samples only shows various GLM features without consideration of any sort. + +### 8.1. Compute a triangle normal + +```cpp +#include // vec3 normalize cross + +glm::vec3 computeNormal(glm::vec3 const& a, glm::vec3 const& b, glm::vec3 const& c) +{ + return glm::normalize(glm::cross(c - a, b - a)); +} + +// A much faster but less accurate alternative: +#include // vec3 cross +#include // fastNormalize + +glm::vec3 computeNormal(glm::vec3 const& a, glm::vec3 const& b, glm::vec3 const& c) +{ + return glm::fastNormalize(glm::cross(c - a, b - a)); +} +``` + +### 8.2. Matrix transform + +```cpp +#include // vec3, vec4, ivec4, mat4 +#include // translate, rotate, scale, perspective +#include // value_ptr + +void setUniformMVP(GLuint Location, glm::vec3 const& Translate, glm::vec3 const& Rotate) +{ + glm::mat4 Projection = glm::perspective(45.0f, 4.0f / 3.0f, 0.1f, 100.f); + glm::mat4 ViewTranslate = glm::translate( + glm::mat4(1.0f), Translate); + glm::mat4 ViewRotateX = glm::rotate( + ViewTranslate, Rotate.y, glm::vec3(-1.0f, 0.0f, 0.0f)); + glm::mat4 View = glm::rotate(ViewRotateX, + Rotate.x, glm::vec3(0.0f, 1.0f, 0.0f)); + glm::mat4 Model = glm::scale( + glm::mat4(1.0f), glm::vec3(0.5f)); + glm::mat4 MVP = Projection * View * Model; + glUniformMatrix4fv(Location, 1, GL_FALSE, glm::value_ptr(MVP)); +} +``` + +### 8.3. Vector types + +```cpp +#include // vec2 +#include // hvec2, i8vec2, i32vec2 + +std::size_t const VertexCount = 4; + +// Float quad geometry +std::size_t const PositionSizeF32 = VertexCount * sizeof(glm::vec2); +glm::vec2 const PositionDataF32[VertexCount] = +{ + glm::vec2(-1.0f,-1.0f), + glm::vec2( 1.0f,-1.0f), + glm::vec2( 1.0f, 1.0f), + glm::vec2(-1.0f, 1.0f) +}; + +// Half-float quad geometry +std::size_t const PositionSizeF16 = VertexCount * sizeof(glm::hvec2); +glm::hvec2 const PositionDataF16[VertexCount] = +{ + glm::hvec2(-1.0f, -1.0f), + glm::hvec2( 1.0f, -1.0f), + glm::hvec2( 1.0f, 1.0f), + glm::hvec2(-1.0f, 1.0f) +}; + +// 8 bits signed integer quad geometry +std::size_t const PositionSizeI8 = VertexCount * sizeof(glm::i8vec2); +glm::i8vec2 const PositionDataI8[VertexCount] = +{ + glm::i8vec2(-1,-1), + glm::i8vec2( 1,-1), + glm::i8vec2( 1, 1), + glm::i8vec2(-1, 1) +}; + +// 32 bits signed integer quad geometry +std::size_t const PositionSizeI32 = VertexCount * sizeof(glm::i32vec2); +glm::i32vec2 const PositionDataI32[VertexCount] = +{ + glm::i32vec2(-1,-1), + glm::i32vec2( 1,-1), + glm::i32vec2( 1, 1), + glm::i32vec2(-1, 1) +}; +``` + +### 8.4. Lighting + +```cpp +#include // vec3 normalize reflect dot pow +#include // ballRand + +// vecRand3, generate a random and equiprobable normalized vec3 +glm::vec3 lighting(intersection const& Intersection, material const& Material, light const& Light, glm::vec3 const& View) +{ + glm::vec3 Color = glm::vec3(0.0f); + glm::vec3 LightVertor = glm::normalize( + Light.position() - Intersection.globalPosition() + + glm::ballRand(0.0f, Light.inaccuracy()); + + if(!shadow(Intersection.globalPosition(), Light.position(), LightVertor)) + { + float Diffuse = glm::dot(Intersection.normal(), LightVector); + if(Diffuse <= 0.0f) + return Color; + + if(Material.isDiffuse()) + Color += Light.color() * Material.diffuse() * Diffuse; + + if(Material.isSpecular()) + { + glm::vec3 Reflect = glm::reflect(-LightVector, Intersection.normal()); + float Dot = glm::dot(Reflect, View); + float Base = Dot > 0.0f ? Dot : 0.0f; + float Specular = glm::pow(Base, Material.exponent()); + Color += Material.specular() \* Specular; + } + } + + return Color; +} +``` + +--- +
+ +## 9. Contributing to GLM + +### 9.1. Submitting bug reports + +Bug should be reported on Github using the [issue page](https://github.com/g-truc/glm/issues). + +A minimal code to reproduce the issue will help. + +Additional, bugs can be configuration specific. We can report the configuration by defining `GLM_FORCE_MESSAGES` before including GLM headers then build and copy paste the build messages GLM will output. + +```cpp +#define GLM_FORCE_MESSAGES +#include +``` + +An example of build messages generated by GLM: + +```plaintext +GLM: 0.9.9.1 +GLM: C++ 17 with extensions +GLM: GCC compiler detected" +GLM: x86 64 bits with AVX instruction set build target +GLM: Linux platform detected +GLM: GLM_FORCE_SWIZZLE is undefined. swizzling functions or operators are disabled. +GLM: GLM_FORCE_SIZE_T_LENGTH is undefined. .length() returns a glm::length_t, a typedef of int following GLSL. +GLM: GLM_FORCE_UNRESTRICTED_GENTYPE is undefined. Follows strictly GLSL on valid function genTypes. +GLM: GLM_FORCE_DEPTH_ZERO_TO_ONE is undefined. Using negative one to one depth clip space. +GLM: GLM_FORCE_LEFT_HANDED is undefined. Using right handed coordinate system. +``` + +### 9.2. Contributing to GLM with pull request + +This tutorial will show us how to successfully contribute a bug-fix to GLM using GitHub's Pull Request workflow. + +We will be typing git commands in the Terminal. Mac and Linux users may have git pre-installed. You can download git from [here](http://git-scm.com/downloads). + +The tutorial assumes you have some basic understanding of git concepts - repositories, branches, commits, etc. Explaining it all from scratch is beyond the scope of this tutorial. Some good links to learn git basics are: [Link 1](http://git-scm.com/book/en/Getting-Started-Git-Basics), [Link 2](https://www.atlassian.com/git/tutorial/git-basics) + +#### Step 1: Setup our GLM Fork + +We will make our changes in our own copy of the GLM sitory. On the GLM GitHub repo and we press the Fork button. +We need to download a copy of our fork to our local machine. In the terminal, type: + +```plaintext +>>> git clone +``` + +This will clone our fork repository into the current folder. + +We can find our repository git url on the Github reposotory page. The url looks like this: `https://github.com//.git` + +#### Step 2: Synchronizing our fork + +We can use the following command to add `upstream` (original project repository) as a remote repository so that we can fetch the latest GLM commits into our branch and keep our forked copy is synchronized. + +```plaintext +>>> git remote add upstream https://github.com/processing/processing.git +``` + +To synchronize our fork to the latest commit in the GLM repository, we can use the following command: + +```plaintext +>>> git fetch upstream +``` + +Then, we can merge the remote master branch to our current branch: + +```plaintext +>>> git merge upstream/master +``` + +Now our local copy of our fork has been synchronized. However, the fork's copy is not updated on GitHub's servers yet. To do that, use: + +```plaintext +>>> git push origin master +``` + +#### Step 3: Modifying our GLM Fork + +Our fork is now setup and we are ready to modify GLM to fix a bug. + +It's a good practice to make changes in our fork in a separate branch than the master branch because we can submit only one pull request per branch. + +Before creating a new branch, it's best to synchronize our fork and then create a new branch from the latest master branch. + +If we are not on the master branch, we should switch to it using: + +```plaintext +>>> git checkout master +``` + +To create a new branch called `bugifx`, we use: + +```plaintext +git branch bugfix +``` + +Once the code changes for the fix is done, we need to commit the changes: + +```plaintext +>>> git commit -m "Resolve the issue that caused problem with a specific fix #432" +``` + +The commit message should be as specific as possible and finished by the bug number in the [GLM GitHub issue page](https://github.com/g-truc/glm/issues) + +Finally, we need to push our changes in our branch to our GitHub fork using: + +```plaintext +>>> git push origin bugfix +``` + +Some things to keep in mind for a pull request: + +* Keep it minimal: Try to make the minimum required changes to fix the issue. If we have added any debugging code, we should remove it. +* A fix at a time: The pull request should deal with one issue at a time only, unless two issue are so interlinked they must be fixed together. +* Write a test: GLM is largely unit tests. Unit tests are in `glm/test` directory. We should also add tests for the fixes we provide to ensure future regression doesn't happen. +* No whitespace changes: Avoid unnecessary formatting or whitespace changes in other parts of the code. Be careful with auto-format options in the code editor which can cause wide scale formatting changes. +* Follow [GLM Code Style](#section9_3) for consistency. +* Tests passes: Make sure GLM build and tests don't fail because of the changes. + +#### Step 4: Submitting a Pull Request + +We need to submit a pull request from the `bugfix` branch to GLM's master branch. + +On the fork github page, we can click on the *Pull Request* button. Then we can describe our pull request. Finally we press *Send Pull Request*. + +Please be patient and give them some time to go through it. + +The pull request review may suggest additional changes. So we can make those changes in our branch, and push those changes to our fork repository. Our pull request will always include the latest changes in our branch on GitHub, so we don't need to resubmit the pull request. + +Once your changes have been accepted, a project maintainer will merge our pull request. + +We are grateful to the users for their time and effort in contributing fixes. + +### 9.3. Coding style + +#### Indentation + +Always tabs. Never spaces. + +#### Spacing + +No space after if. Use if(blah) not if (blah). Example if/else block: + +```cpp +if(blah) +{ + // yes like this +} +else +{ + // something besides +} +``` + +Single line if blocks: + +```cpp +if(blah) + // yes like this +else + // something besides +``` + +No spaces inside parens: + +```cpp +if (blah) // No +if( blah ) // No +if ( blah ) // No +if(blah) // Yes +``` + +Use spaces before/after commas: + +```cpp +someFunction(apple,bear,cat); // No +someFunction(apple, bear, cat); // Yes +``` + +Use spaces before/after use of `+, -, *, /, %, >>, <<, |, &, ^, ||, &&` operators: + +```cpp +vec4 v = a + b; +``` + +#### Blank lines + +One blank line after the function blocks. + +#### Comments + +Always one space after the // in single line comments + +One space before // at the end of a line (that has code as well) + +Try to use // comments inside functions, to make it easier to remove a whole block via /\* \*/ + +#### Cases + +```cpp +#define GLM_MY_DEFINE 76 + +class myClass +{}; + +myClass const MyClass; + +namespace glm{ // glm namespace is for public code +namespace detail // glm::detail namespace is for implementation detail +{ + float myFunction(vec2 const& V) + { + return V.x + V.y; + } + + float myFunction(vec2 const* const V) + { + return V->x + V->y; + } +}//namespace detail +}//namespace glm +``` + +--- +
+ +## 10. References + +### 10.1. OpenGL specifications + +* OpenGL 4.3 core specification +* [GLSL 4.30 specification](http://www.opengl.org/registry/doc/GLSLangSpec.4.30.7.diff.pdf) +![](media/image21.png){width="2.859722222222222in" height="1.6083333333333334in"}- [*GLU 1.3 specification*](http://www.opengl.org/documentation/specs/glu/glu1_3.pdf) + +### 10.2. External links + +* [GLM on stackoverflow](http://stackoverflow.com/search?q=GLM) + +### 10.3. Projects using GLM + +***[Leo’s Fortune](http://www.leosfortune.com/)*** + +Leo’s Fortune is a platform adventure game where you hunt down the cunning and mysterious thief that stole your gold. Available on PS4, Xbox One, PC, Mac, iOS and Android. + +Beautifully hand-crafted levels bring the story of Leo to life in this epic adventure. + +“I just returned home to find all my gold has been stolen! For some devious purpose, the thief has dropped pieces of my gold like breadcrumbs through the woods.” + +“Despite this pickle of a trap, I am left with no choice but to follow the trail.” + +“Whatever lies ahead, I must recover my fortune.” -Leopold + +![](./doc/manual/references-leosfortune.jpeg) + +![](./doc/manual/references-leosfortune2.jpg) + +[***OpenGL 4.0 Shading Language Cookbook***](http://www.packtpub.com/opengl-4-0-shading-language-cookbook/book?tag=rk/opengl4-abr1/0811) + +A set of recipes that demonstrates a wide of techniques for producing high-quality, real-time 3D graphics with GLSL 4.0, such as: + +* Using GLSL 4.0 to implement lighting and shading techniques. +* Using the new features of GLSL 4.0 including tessellation and geometry shaders. +* Using textures in GLSL as part of a wide variety of techniques from basic texture mapping to deferred shading. + +Simple, easy-to-follow examples with GLSL source code are provided, as well as a basic description of the theory behind each technique. + +![](./doc/manual/references-glsl4book.jpg) + +[***Outerra***](http://outerra.com/) + +A 3D planetary engine for seamless planet rendering from space down to the surface. Can use arbitrary resolution of elevation data, refining it to centimetre resolution using fractal algorithms. + +![](./doc/manual/references-outerra1.jpg) + +![](./doc/manual/references-outerra2.jpg) + +![](./doc/manual/references-outerra3.jpg) + +![](./doc/manual/references-outerra4.jpg) + +[***Falcor***](https://github.com/NVIDIA/Falcor) + +Real-time rendering research framework by NVIDIA. + +[***Cinder***](https://libcinder.org/) + +Cinder is a free and open source library for professional-quality creative coding in C++. + +Cinder is a C++ library for programming with aesthetic intent - the sort of development often called creative coding. This includes domains like graphics, audio, video, and computational geometry. Cinder is cross-platform, with official support for OS X, Windows, iOS, and WinRT. + +Cinder is production-proven, powerful enough to be the primary tool for professionals, but still suitable for learning and experimentation. Cinder is released under the [2-Clause BSD License](http://opensource.org/licenses/BSD-2-Clause). + +![](./doc/manual/references-cinder.png) + +[***opencloth***](https://github.com/mmmovania/opencloth/) + +A collection of source codes implementing cloth simulation algorithms in OpenGL. + +Simple, easy-to-follow examples with GLSL source code, as well as a basic description of the theory behind each technique. + +![](./doc/manual/references-opencloth1.png) + +![](./doc/manual/references-opencloth3.png) + +[***LibreOffice***](https://www.libreoffice.org/) + +LibreOffice includes several applications that make it the most powerful Free and Open Source office suite on the market. + +[***Are you using GLM in a project?***](mailto:glm@g-truc.net) + +### 10.4. Tutorials using GLM + +* [Sascha Willems' Vulkan examples](https://github.com/SaschaWillems/Vulkan), Examples and demos for the new Vulkan API +* [VKTS](https://github.com/McNopper/Vulkan) Vulkan examples using VulKan ToolS (VKTS) +* [*The OpenGL Samples Pack*](http://www.g-truc.net/project-0026.html#menu), samples that show how to set up all the different new features +* [*Learning Modern 3D Graphics programming*](http://www.arcsynthesis.org/gltut/), a great OpenGL tutorial using GLM by Jason L. McKesson +* [*Morten Nobel-Jørgensen’s*](http://blog.nobel-joergensen.com/2011/04/02/glm-brilliant-math-library-for-opengl/) review and use an [*OpenGL renderer*](https://github.com/mortennobel/RenderE) +* [*Swiftless’ OpenGL tutorial*](http://www.swiftless.com/opengltuts.html) using GLM by Donald Urquhart +* [*Rastergrid*](http://rastergrid.com/blog/), many technical articles with companion programs using GLM by Daniel Rákos\ +* [*OpenGL Tutorial*](http://www.opengl-tutorial.org), tutorials for OpenGL 3.1 and later +* [*OpenGL Programming on Wikibooks*](http://en.wikibooks.org/wiki/OpenGL_Programming): For beginners who are discovering OpenGL. +* [*3D Game Engine Programming*](http://3dgep.com/): Learning the latest 3D Game Engine Programming techniques. +* [Game Tutorials](http://www.gametutorials.com/opengl-4-matrices-and-glm/), graphics and game programming. +* [open.gl](https://open.gl/), OpenGL tutorial +* [c-jump](http://www.c-jump.com/bcc/common/Talk3/Math/GLM/GLM.html), GLM tutorial +* [Learn OpenGL](http://learnopengl.com/), OpenGL tutorial +* [***Are you using GLM in a tutorial?***](mailto:glm@g-truc.net) + +### 10.5. Equivalent for other languages + +* [*cglm*](https://github.com/recp/cglm): OpenGL Mathematics (glm) for C. +* [*GlmSharp*](https://github.com/Philip-Trettner/GlmSharp): Open-source semi-generated GLM-flavored math library for .NET/C\#. +* [glm-js](https://github.com/humbletim/glm-js): JavaScript adaptation of the OpenGL Mathematics (GLM) C++ library interfaces +* [JVM OpenGL Mathematics (GLM)](https://github.com/kotlin-graphics/glm): written in Kotlin, Java compatible +* [JGLM](https://github.com/jroyalty/jglm) - Java OpenGL Mathematics Library +* [SwiftGL Math Library](https://github.com/SwiftGL/Math/blob/master/Sources/glm.swift) GLM for Swift +* [glm-go](https://github.com/jbowtie/glm-go): Simple linear algebra library similar in spirit to GLM +* [openll](https://github.com/Polkm/openll): Lua bindings for OpenGL, GLM, GLFW, OpenAL, SOIL and PhysicsFS +* [glm-rs](https://github.com/dche/glm-rs): GLSL mathematics for Rust programming language +* [glmpython](https://github.com/Queatz/glmpython): GLM math library for Python + +### 10.6. Alternatives to GLM + +* [*CML*](http://cmldev.net/): The CML (Configurable Math Library) is a free C++ math library for games and graphics. +* [*Eigen*](http://eigen.tuxfamily.org/): A more heavy weight math library for general linear algebra in C++. +* [*glhlib*](http://glhlib.sourceforge.net/): A much more than glu C library. +* Are you using or developing an alternative library to GLM? + +### 10.7. Acknowledgements + +GLM is developed and maintained by [*Christophe Riccio*](http://www.g-truc.net) but many contributors have made this project what it is. + +Special thanks to: + +* Ashima Arts and Stefan Gustavson for their work on [*webgl-noise*](https://github.com/ashima/webgl-noise) which has been used for GLM noises implementation. +* [*Arthur Winters*](http://athile.net/library/wiki/index.php?title=Athile_Technologies) for the C++11 and Visual C++ swizzle operators implementation and tests. +* Joshua Smith and Christoph Schied for the discussions and the experiments around the swizzle operators implementation issues. +* Guillaume Chevallereau for providing and maintaining the [*nightlight build system*](http://my.cdash.org/index.php?project=GLM). +* Ghenadii Ursachi for GLM\_GTX\_matrix\_interpolation implementation. +* Mathieu Roumillac for providing some implementation ideas. +* [*Grant James*](http://www.zeuscmd.com/) for the implementation of all combination of none-squared matrix products. +* Jesse Talavera-Greenberg for his work on the manual amount other things. +* All the GLM users that have report bugs and hence help GLM to become a great library! diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/readme.md b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/readme.md new file mode 100644 index 0000000000000000000000000000000000000000..e09e267c47952178fe1e42e73cbcb1aa4955e3b2 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/readme.md @@ -0,0 +1,1231 @@ +![glm](/doc/manual/logo-mini.png) + +[OpenGL Mathematics](http://glm.g-truc.net/) (*GLM*) is a header only C++ mathematics library for graphics software based on the [OpenGL Shading Language (GLSL) specifications](https://www.opengl.org/registry/doc/GLSLangSpec.4.50.diff.pdf). + +*GLM* provides classes and functions designed and implemented with the same naming conventions and functionality than *GLSL* so that anyone who knows *GLSL*, can use *GLM* as well in C++. + +This project isn't limited to *GLSL* features. An extension system, based on the *GLSL* extension conventions, provides extended capabilities: matrix transformations, quaternions, data packing, random numbers, noise, etc... + +This library works perfectly with *[OpenGL](https://www.opengl.org)* but it also ensures interoperability with other third party libraries and SDK. It is a good candidate for software rendering (raytracing / rasterisation), image processing, physics simulations and any development context that requires a simple and convenient mathematics library. + +*GLM* is written in C++98 but can take advantage of C++11 when supported by the compiler. It is a platform independent library with no dependence and it officially supports the following compilers: +- [*GCC*](http://gcc.gnu.org/) 4.7 and higher +- [*Intel C++ Compose*](https://software.intel.com/en-us/intel-compilers) XE 2013 and higher +- [*Clang*](http://llvm.org/) 3.4 and higher +- [*Apple Clang 6.0*](https://developer.apple.com/library/mac/documentation/CompilerTools/Conceptual/LLVMCompilerOverview/index.html) and higher +- [*Visual C++*](http://www.visualstudio.com/) 2013 and higher +- [*CUDA*](https://developer.nvidia.com/about-cuda) 9.0 and higher (experimental) +- [*SYCL*](https://www.khronos.org/sycl/) (experimental: only [ComputeCpp](https://codeplay.com/products/computesuite/computecpp) implementation has been tested). +- Any C++11 compiler + +For more information about *GLM*, please have a look at the [manual](manual.md) and the [API reference documentation](http://glm.g-truc.net/0.9.8/api/index.html). +The source code and the documentation are licensed under either the [Happy Bunny License (Modified MIT) or the MIT License](manual.md#section0). + +Thanks for contributing to the project by [submitting pull requests](https://github.com/g-truc/glm/pulls). + +```cpp +#include // glm::vec3 +#include // glm::vec4 +#include // glm::mat4 +#include // glm::translate, glm::rotate, glm::scale +#include // glm::perspective +#include // glm::pi + +glm::mat4 camera(float Translate, glm::vec2 const& Rotate) +{ + glm::mat4 Projection = glm::perspective(glm::pi() * 0.25f, 4.0f / 3.0f, 0.1f, 100.f); + glm::mat4 View = glm::translate(glm::mat4(1.0f), glm::vec3(0.0f, 0.0f, -Translate)); + View = glm::rotate(View, Rotate.y, glm::vec3(-1.0f, 0.0f, 0.0f)); + View = glm::rotate(View, Rotate.x, glm::vec3(0.0f, 1.0f, 0.0f)); + glm::mat4 Model = glm::scale(glm::mat4(1.0f), glm::vec3(0.5f)); + return Projection * View * Model; +} +``` + +## [Lastest release](https://github.com/g-truc/glm/releases/latest) + +## Project Health + +| Service | System | Compiler | Status | +| ------- | ------ | -------- | ------ | +| [Travis CI](https://travis-ci.org/g-truc/glm)| MacOSX, Linux 64 bits | Clang 3.6, Clang 5.0, GCC 4.9, GCC 7.3 | [![Travis CI](https://travis-ci.org/g-truc/glm.svg?branch=master)](https://travis-ci.org/g-truc/glm) +| [AppVeyor](https://ci.appveyor.com/project/Groovounet/glm)| Windows 32 and 64 | Visual Studio 2013, Visual Studio 2015, Visual Studio 2017 | [![AppVeyor](https://ci.appveyor.com/api/projects/status/32r7s2skrgm9ubva?svg=true)](https://ci.appveyor.com/project/Groovounet/glm) + +## Release notes + +### [GLM 0.9.9.9](https://github.com/g-truc/glm/releases/tag/0.9.9.9) - 2020-XX-XX +#### Features: +- Added *GLM_EXT_scalar_reciprocal* with tests +- Added *GLM_EXT_vector_reciprocal* with tests +- Added `glm::iround` and `glm::uround` to *GLM_EXT_scalar_common* and *GLM_EXT_vector_common* +- Added *GLM_EXT_matrix_integer* with tests + +#### Improvements: +- Added `constexpr` qualifier for `cross` product #1040 +- Added `constexpr` qualifier for `dot` product #1040 + +#### Fixes: +- Fixed incorrect assertion for `glm::min` and `glm::max` #1009 +- Fixed quaternion orientation in `glm::decompose` #1012 +- Fixed singularity in quaternion to euler angle roll conversion #1019 +- Fixed `quat` `glm::pow` handling of small magnitude quaternions #1022 +- Fixed `glm::fastNormalize` build error #1033 +- Fixed `glm::isMultiple` build error #1034 +- Fixed `glm::adjugate` calculation #1035 +- Fixed `glm::angle` discards the sign of result for angles in range (2*pi-1, 2*pi) #1038 +- Removed ban on using `glm::string_cast` with *CUDA* host code #1041 + +### [GLM 0.9.9.8](https://github.com/g-truc/glm/releases/tag/0.9.9.8) - 2020-04-13 +#### Features: +- Added *GLM_EXT_vector_intX* and *GLM_EXT_vector_uintX* extensions +- Added *GLM_EXT_matrix_intX* and *GLM_EXT_matrix_uintX* extensions + +#### Improvements: +- Added `glm::clamp`, `glm::repeat`, `glm::mirrorClamp` and `glm::mirrorRepeat` function to `GLM_EXT_scalar_commond` and `GLM_EXT_vector_commond` extensions with tests + +#### Fixes: +- Fixed unnecessary warnings from `matrix_projection.inl` #995 +- Fixed quaternion `glm::slerp` overload which interpolates with extra spins #996 +- Fixed for `glm::length` using arch64 #992 +- Fixed singularity check for `glm::quatLookAt` #770 + +### [GLM 0.9.9.7](https://github.com/g-truc/glm/releases/tag/0.9.9.7) - 2020-01-05 +#### Improvements: +- Improved *Neon* support with more functions optimized #950 +- Added *CMake* *GLM* interface #963 +- Added `glm::fma` implementation based on `std::fma` #969 +- Added missing quat constexpr #955 +- Added `GLM_FORCE_QUAT_DATA_WXYZ` to store quat data as w,x,y,z instead of x,y,z,w #983 + +#### Fixes: +- Fixed equal *ULP* variation when using negative sign #965 +- Fixed for intersection ray/plane and added related tests #953 +- Fixed ARM 64bit detection #949 +- Fixed *GLM_EXT_matrix_clip_space* warnings #980 +- Fixed Wimplicit-int-float-conversion warnings with clang 10+ #986 +- Fixed *GLM_EXT_matrix_clip_space* `perspectiveFov` + +### [GLM 0.9.9.6](https://github.com/g-truc/glm/releases/tag/0.9.9.6) - 2019-09-08 +#### Features: +- Added *Neon* support #945 +- Added *SYCL* support #914 +- Added *GLM_EXT_scalar_integer* extension with power of two and multiple scalar functions +- Added *GLM_EXT_vector_integer* extension with power of two and multiple vector functions + +#### Improvements: +- Added *Visual C++ 2019* detection +- Added *Visual C++ 2017* 15.8 and 15.9 detection +- Added missing genType check for `glm::bitCount` and `glm::bitfieldReverse` #893 + +#### Fixes: +- Fixed for g++6 where -std=c++1z sets __cplusplus to 201500 instead of 201402 #921 +- Fixed hash hashes qua instead of tquat #919 +- Fixed `.natvis` as structs renamed #915 +- Fixed `glm::ldexp` and `glm::frexp` declaration #895 +- Fixed missing const to quaternion conversion operators #890 +- Fixed *GLM_EXT_scalar_ulp* and *GLM_EXT_vector_ulp* API coding style +- Fixed quaternion componant order: `w, {x, y, z}` #916 +- Fixed `GLM_HAS_CXX11_STL` broken on Clang with Linux #926 +- Fixed *Clang* or *GCC* build due to wrong `GLM_HAS_IF_CONSTEXPR` definition #907 +- Fixed *CUDA* 9 build #910 + +#### Deprecation: + - Removed CMake install and uninstall scripts + +### [GLM 0.9.9.5](https://github.com/g-truc/glm/releases/tag/0.9.9.5) - 2019-04-01 +#### Fixes: +- Fixed build errors when defining `GLM_ENABLE_EXPERIMENTAL` #884 #883 +- Fixed `if constexpr` warning #887 +- Fixed missing declarations for `glm::frexp` and `glm::ldexp` #886 + +### [GLM 0.9.9.4](https://github.com/g-truc/glm/releases/tag/0.9.9.4) - 2019-03-19 +#### Features: +- Added `glm::mix` implementation for matrices in *GLM_EXT_matrix_common/ #842 +- Added *CMake* `BUILD_SHARED_LIBS` and `BUILD_STATIC_LIBS` build options #871 + +#### Improvements: +- Added GLM_FORCE_INTRINSICS to enable SIMD instruction code path. By default, it's disabled allowing constexpr support by default. #865 +- Optimized inverseTransform #867 + +#### Fixes: +- Fixed in `glm::mat4x3` conversion #829 +- Fixed `constexpr` issue on GCC #832 #865 +- Fixed `glm::mix` implementation to improve GLSL conformance #866 +- Fixed `glm::int8` being defined as unsigned char with some compiler #839 +- Fixed `glm::vec1` include #856 +- Ignore `.vscode` #848 + +### [GLM 0.9.9.3](https://github.com/g-truc/glm/releases/tag/0.9.9.3) - 2018-10-31 +#### Features: +- Added `glm::equal` and `glm::notEqual` overload with max ULPs parameters for scalar numbers #121 +- Added `GLM_FORCE_SILENT_WARNINGS` to silent *GLM* warnings when using language extensions but using W4 or Wpedantic warnings #814 #775 +- Added adjugate functions to `GLM_GTX_matrix_operation` #151 +- Added `GLM_FORCE_ALIGNED_GENTYPES` to enable aligned types and SIMD instruction are not enabled. This disable `constexpr` #816 + +#### Improvements: +- Added constant time ULP distance between float #121 +- Added `GLM_FORCE_SILENT_WARNINGS` to suppress *GLM* warnings #822 + +#### Fixes: +- Fixed `glm::simplex` noise build with double #734 +- Fixed `glm::bitfieldInsert` according to GLSL spec #818 +- Fixed `glm::refract` for negative 'k' #808 + +### [GLM 0.9.9.2](https://github.com/g-truc/glm/releases/tag/0.9.9.2) - 2018-09-14 +#### Fixes: +- Fixed `GLM_FORCE_CXX**` section in the manual +- Fixed default initialization with vector and quaternion types using `GLM_FORCE_CTOR_INIT` #812 + +### [GLM 0.9.9.1](https://github.com/g-truc/glm/releases/tag/0.9.9.1) - 2018-09-03 +#### Features: +- Added `bitfieldDeinterleave` to *GLM_GTC_bitfield* +- Added missing `glm::equal` and `glm::notEqual` with epsilon for quaternion types to *GLM_GTC_quaternion* +- Added *GLM_EXT_matrix_relational*: `glm::equal` and `glm::notEqual` with epsilon for matrix types +- Added missing aligned matrix types to *GLM_GTC_type_aligned* +- Added C++17 detection +- Added *Visual C++* language standard version detection +- Added PDF manual build from markdown + +#### Improvements: +- Added a section to the manual for contributing to *GLM* +- Refactor manual, lists all configuration defines +- Added missing `glm::vec1` based constructors +- Redesigned constexpr support which excludes both SIMD and `constexpr` #783 +- Added detection of *Visual C++ 2017* toolsets +- Added identity functions #765 +- Splitted headers into EXT extensions to improve compilation time #670 +- Added separated performance tests +- Clarified refract valid range of the indices of refraction, between -1 and 1 inclusively #806 + +#### Fixes: +- Fixed SIMD detection on *Clang* and *GCC* +- Fixed build problems due to `std::printf` and `std::clock_t` #778 +- Fixed int mod +- Anonymous unions require C++ language extensions +- Fixed `glm::ortho` #790 +- Fixed *Visual C++* 2013 warnings in vector relational code #782 +- Fixed *ICC* build errors with constexpr #704 +- Fixed defaulted operator= and constructors #791 +- Fixed invalid conversion from int scalar with vec4 constructor when using SSE instruction +- Fixed infinite loop in random functions when using negative radius values using an assert #739 + +### [GLM 0.9.9.0](https://github.com/g-truc/glm/releases/tag/0.9.9.0) - 2018-05-22 +#### Features: +- Added *RGBM* encoding in *GLM_GTC_packing* #420 +- Added *GLM_GTX_color_encoding* extension +- Added *GLM_GTX_vec_swizzle*, faster compile time swizzling then swizzle operator #558 +- Added *GLM_GTX_exterior_product* with a `vec2` `glm::cross` implementation #621 +- Added *GLM_GTX_matrix_factorisation* to factor matrices in various forms #654 +- Added [`GLM_ENABLE_EXPERIMENTAL`](manual.md#section7_4) to enable experimental features. +- Added packing functions for integer vectors #639 +- Added conan packaging configuration #643 #641 +- Added `glm::quatLookAt` to *GLM_GTX_quaternion* #659 +- Added `glm::fmin`, `glm::fmax` and `glm::fclamp` to *GLM_GTX_extended_min_max* #372 +- Added *GLM_EXT_vector_relational*: extend `glm::equal` and `glm::notEqual` to take an epsilon argument +- Added *GLM_EXT_vector_relational*: `glm::openBounded` and `glm::closeBounded` +- Added *GLM_EXT_vec1*: `*vec1` types +- Added *GLM_GTX_texture*: `levels` function +- Added spearate functions to use both nagative one and zero near clip plans #680 +- Added `GLM_FORCE_SINGLE_ONLY` to use *GLM* on platforms that don't support double #627 +- Added *GLM_GTX_easing* for interpolation functions #761 + +#### Improvements: +- No more default initialization of vector, matrix and quaternion types +- Added lowp variant of GTC_color_space convertLinearToSRGB #419 +- Replaced the manual by a markdown version #458 +- Improved API documentation #668 +- Optimized GTC_packing implementation +- Optimized GTC_noise functions +- Optimized GTC_color_space HSV to RGB conversions +- Optimised GTX_color_space_YCoCg YCoCgR conversions +- Optimized GTX_matrix_interpolation axisAngle function +- Added FAQ 12: Windows headers cause build errors... #557 +- Removed GCC shadow warnings #595 +- Added error for including of different versions of GLM #619 +- Added GLM_FORCE_IGNORE_VERSION to ignore error caused by including different version of GLM #619 +- Reduced warnings when using very strict compilation flags #646 +- length() member functions are constexpr #657 +- Added support of -Weverything with Clang #646 +- Improved exponential function test coverage +- Enabled warnings as error with Clang unit tests +- Conan package is an external repository: https://github.com/bincrafters/conan-glm +- Clarify quat_cast documentation, applying on pure rotation matrices #759 + +#### Fixes: +- Removed doxygen references to *GLM_GTC_half_float* which was removed in 0.9.4 +- Fixed `glm::decompose` #448 +- Fixed `glm::intersectRayTriangle` #6 +- Fixed dual quaternion != operator #629 +- Fixed usused variable warning in *GLM_GTX_spline* #618 +- Fixed references to `GLM_FORCE_RADIANS` which was removed #642 +- Fixed `glm::fastInverseSqrt` to use fast inverse square #640 +- Fixed `glm::axisAngle` NaN #638 +- Fixed integer pow from *GLM_GTX_integer* with null exponent #658 +- Fixed `quat` `normalize` build error #656 +- Fixed *Visual C++ 2017.2* warning regarding `__has_feature` definision #655 +- Fixed documentation warnings +- Fixed `GLM_HAS_OPENMP` when *OpenMP* is not enabled +- Fixed Better follow GLSL `min` and `max` specification #372 +- Fixed quaternion constructor from two vectors special cases #469 +- Fixed `glm::to_string` on quaternions wrong components order #681 +- Fixed `glm::acsch` #698 +- Fixed `glm::isnan` on *CUDA* #727 + +#### Deprecation: +- Requires *Visual Studio 2013*, *GCC 4.7*, *Clang 3.4*, *Cuda 7*, *ICC 2013* or a C++11 compiler +- Removed *GLM_GTX_simd_vec4* extension +- Removed *GLM_GTX_simd_mat4* extension +- Removed *GLM_GTX_simd_quat* extension +- Removed `GLM_SWIZZLE`, use `GLM_FORCE_SWIZZLE` instead +- Removed `GLM_MESSAGES`, use `GLM_FORCE_MESSAGES` instead +- Removed `GLM_DEPTH_ZERO_TO_ONE`, use `GLM_FORCE_DEPTH_ZERO_TO_ONE` instead +- Removed `GLM_LEFT_HANDED`, use `GLM_FORCE_LEFT_HANDED` instead +- Removed `GLM_FORCE_NO_CTOR_INIT` +- Removed `glm::uninitialize` + +--- +### [GLM 0.9.8.5](https://github.com/g-truc/glm/releases/tag/0.9.8.5) - 2017-08-16 +#### Features: +- Added *Conan* package support #647 + +#### Fixes: +- Fixed *Clang* version detection from source #608 +- Fixed `glm::packF3x9_E1x5` exponent packing #614 +- Fixed build error `min` and `max` specializations with integer #616 +- Fixed `simd_mat4` build error #652 + +--- +### [GLM 0.9.8.4](https://github.com/g-truc/glm/releases/tag/0.9.8.4) - 2017-01-22 +#### Fixes: +- Fixed *GLM_GTC_packing* test failing on *GCC* x86 due to denorms #212 #577 +- Fixed `POPCNT` optimization build in *Clang* #512 +- Fixed `glm::intersectRayPlane` returns true in parallel case #578 +- Fixed *GCC* 6.2 compiler warnings #580 +- Fixed *GLM_GTX_matrix_decompose* `glm::decompose` #582 #448 +- Fixed *GCC* 4.5 and older build #566 +- Fixed *Visual C++* internal error when declaring a global vec type with siwzzle expression enabled #594 +- Fixed `GLM_FORCE_CXX11` with Clang and libstlc++ which wasn't using C++11 STL features. #604 + +--- +### [GLM 0.9.8.3](https://github.com/g-truc/glm/releases/tag/0.9.8.3) - 2016-11-12 +#### Improvements: +- Broader support of `GLM_FORCE_UNRESTRICTED_GENTYPE` #378 + +#### Fixes: +- Fixed Android build error with C++11 compiler but C++98 STL #284 #564 +- Fixed *GLM_GTX_transform2* shear* functions #403 +- Fixed interaction between `GLM_FORCE_UNRESTRICTED_GENTYPE` and `glm::ortho` function #568 +- Fixed `glm::bitCount` with AVX on 32 bit builds #567 +- Fixed *CMake* `find_package` with version specification #572 #573 + +--- +### [GLM 0.9.8.2](https://github.com/g-truc/glm/releases/tag/0.9.8.2) - 2016-11-01 +#### Improvements: +- Added *Visual C++* 15 detection +- Added *Clang* 4.0 detection +- Added warning messages when using `GLM_FORCE_CXX**` but the compiler + is known to not fully support the requested C++ version #555 +- Refactored `GLM_COMPILER_VC` values +- Made quat, vec, mat type component `length()` static #565 + +#### Fixes: +- Fixed *Visual C++* `constexpr` build error #555, #556 + +--- +### [GLM 0.9.8.1](https://github.com/g-truc/glm/releases/tag/0.9.8.1) - 2016-09-25 +#### Improvements: +- Optimized quaternion `glm::log` function #554 + +#### Fixes: +- Fixed *GCC* warning filtering, replaced -pedantic by -Wpedantic +- Fixed SIMD faceforward bug. #549 +- Fixed *GCC* 4.8 with C++11 compilation option #550 +- Fixed *Visual Studio* aligned type W4 warning #548 +- Fixed packing/unpacking function fixed for 5_6_5 and 5_5_5_1 #552 + +--- +### [GLM 0.9.8.0](https://github.com/g-truc/glm/releases/tag/0.9.8.0) - 2016-09-11 +#### Features: +- Added right and left handed projection and clip control support #447 #415 #119 +- Added `glm::compNormalize` and `glm::compScale` functions to *GLM_GTX_component_wise* +- Added `glm::packF3x9_E1x5` and `glm::unpackF3x9_E1x5` to *GLM_GTC_packing* for RGB9E5 #416 +- Added `(un)packHalf` to *GLM_GTC_packing* +- Added `(un)packUnorm` and `(un)packSnorm` to *GLM_GTC_packing* +- Added 16bit pack and unpack to *GLM_GTC_packing* +- Added 8bit pack and unpack to *GLM_GTC_packing* +- Added missing `bvec*` && and || operators +- Added `glm::iround` and `glm::uround` to *GLM_GTC_integer*, fast round on positive values +- Added raw SIMD API +- Added 'aligned' qualifiers +- Added *GLM_GTC_type_aligned* with aligned *vec* types +- Added *GLM_GTC_functions* extension +- Added quaternion version of `glm::isnan` and `glm::isinf` #521 +- Added `glm::lowestBitValue` to *GLM_GTX_bit* #536 +- Added `GLM_FORCE_UNRESTRICTED_GENTYPE` allowing non basic `genType` #543 + +#### Improvements: +- Improved SIMD and swizzle operators interactions with *GCC* and *Clang* #474 +- Improved *GLM_GTC_random* `linearRand` documentation +- Improved *GLM_GTC_reciprocal* documentation +- Improved `GLM_FORCE_EXPLICIT_CTOR` coverage #481 +- Improved *OpenMP* support detection for *Clang*, *GCC*, *ICC* and *VC* +- Improved *GLM_GTX_wrap* for SIMD friendliness +- Added `constexpr` for `*vec*`, `*mat*`, `*quat*` and `*dual_quat*` types #493 +- Added *NEON* instruction set detection +- Added *MIPS* CPUs detection +- Added *PowerPC* CPUs detection +- Use *Cuda* built-in function for abs function implementation with Cuda compiler +- Factorized `GLM_COMPILER_LLVM` and `GLM_COMPILER_APPLE_CLANG` into `GLM_COMPILER_CLANG` +- No more warnings for use of long long +- Added more information to build messages + +#### Fixes: +- Fixed *GLM_GTX_extended_min_max* filename typo #386 +- Fixed `glm::intersectRayTriangle` to not do any unintentional backface culling +- Fixed long long warnings when using C++98 on *GCC* and *Clang* #482 +- Fixed sign with signed integer function on non-x86 architecture +- Fixed strict aliasing warnings #473 +- Fixed missing `glm::vec1` overload to `glm::length2` and `glm::distance2` functions #431 +- Fixed *GLM* test '/fp:fast' and '/Za' command-line options are incompatible +- Fixed quaterion to mat3 cast function `glm::mat3_cast` from *GLM_GTC_quaternion* #542 +- Fixed *GLM_GTX_io* for *Cuda* #547 #546 + +#### Deprecation: +- Removed `GLM_FORCE_SIZE_FUNC` define +- Deprecated *GLM_GTX_simd_vec4* extension +- Deprecated *GLM_GTX_simd_mat4* extension +- Deprecated *GLM_GTX_simd_quat* extension +- Deprecated `GLM_SWIZZLE`, use `GLM_FORCE_SWIZZLE` instead +- Deprecated `GLM_MESSAGES`, use `GLM_FORCE_MESSAGES` instead + +--- +### [GLM 0.9.7.6](https://github.com/g-truc/glm/releases/tag/0.9.7.6) - 2016-07-16 +#### Improvements: +- Added pkg-config file #509 +- Updated list of compiler versions detected +- Improved C++ 11 STL detection #523 + +#### Fixes: +- Fixed STL for C++11 detection on ICC #510 +- Fixed missing vec1 overload to length2 and distance2 functions #431 +- Fixed long long warnings when using C++98 on GCC and Clang #482 +- Fixed scalar reciprocal functions (GTC_reciprocal) #520 + +--- +### [GLM 0.9.7.5](https://github.com/g-truc/glm/releases/tag/0.9.7.5) - 2016-05-24 +#### Improvements: +- Added Visual C++ Clang toolset detection + +#### Fixes: +- Fixed uaddCarry warning #497 +- Fixed roundPowerOfTwo and floorPowerOfTwo #503 +- Fixed Visual C++ SIMD instruction set automatic detection in 64 bits +- Fixed to_string when used with GLM_FORCE_INLINE #506 +- Fixed GLM_FORCE_INLINE with binary vec4 operators +- Fixed GTX_extended_min_max filename typo #386 +- Fixed intersectRayTriangle to not do any unintentional backface culling + +--- +### [GLM 0.9.7.4](https://github.com/g-truc/glm/releases/tag/0.9.7.4) - 2016-03-19 +#### Fixes: +- Fixed asinh and atanh warning with C++98 STL #484 +- Fixed polar coordinates function latitude #485 +- Fixed outerProduct defintions and operator signatures for mat2x4 and vec4 #475 +- Fixed eulerAngles precision error, returns NaN #451 +- Fixed undefined reference errors #489 +- Fixed missing GLM_PLATFORM_CYGWIN declaration #495 +- Fixed various undefined reference errors #490 + +--- +### [GLM 0.9.7.3](https://github.com/g-truc/glm/releases/tag/0.9.7.3) - 2016-02-21 +#### Improvements: +- Added AVX512 detection + +#### Fixes: +- Fixed CMake policy warning +- Fixed GCC 6.0 detection #477 +- Fixed Clang build on Windows #479 +- Fixed 64 bits constants warnings on GCC #463 + +--- +### [GLM 0.9.7.2](https://github.com/g-truc/glm/releases/tag/0.9.7.2) - 2016-01-03 +#### Fixes: +- Fixed GTC_round floorMultiple/ceilMultiple #412 +- Fixed GTC_packing unpackUnorm3x10_1x2 #414 +- Fixed GTC_matrix_inverse affineInverse #192 +- Fixed ICC on Linux build errors #449 +- Fixed ldexp and frexp compilation errors +- Fixed "Declaration shadows a field" warning #468 +- Fixed 'GLM_COMPILER_VC2005 is not defined' warning #468 +- Fixed various 'X is not defined' warnings #468 +- Fixed missing unary + operator #435 +- Fixed Cygwin build errors when using C++11 #405 + +--- +### [GLM 0.9.7.1](https://github.com/g-truc/glm/releases/tag/0.9.7.1) - 2015-09-07 +#### Improvements: +- Improved constexpr for constant functions coverage #198 +- Added to_string for quat and dual_quat in GTX_string_cast #375 +- Improved overall execution time of unit tests #396 + +#### Fixes: +- Fixed strict alignment warnings #235 #370 +- Fixed link errors on compilers not supported default function #377 +- Fixed compilation warnings in vec4 +- Fixed non-identity quaternions for equal vectors #234 +- Fixed excessive GTX_fast_trigonometry execution time #396 +- Fixed Visual Studio 2015 'hides class member' warnings #394 +- Fixed builtin bitscan never being used #392 +- Removed unused func_noise.* files #398 + +--- +### [GLM 0.9.7.0](https://github.com/g-truc/glm/releases/tag/0.9.7.0) - 2015-08-02 +#### Features: +- Added GTC_color_space: convertLinearToSRGB and convertSRGBToLinear functions +- Added 'fmod' overload to GTX_common with tests #308 +- Left handed perspective and lookAt functions #314 +- Added functions eulerAngleXYZ and extractEulerAngleXYZ #311 +- Added to perform std::hash on GLM types #320 #367 +- Added for texcoord wrapping +- Added static components and precision members to all vector and quat types #350 +- Added .gitignore #349 +- Added support of defaulted functions to GLM types, to use them in unions #366 + +#### Improvements: +- Changed usage of __has_include to support Intel compiler #307 +- Specialized integer implementation of YCoCg-R #310 +- Don't show status message in 'FindGLM' if 'QUIET' option is set. #317 +- Added master branch continuous integration service on Linux 64 #332 +- Clarified manual regarding angle unit in GLM, added FAQ 11 #326 +- Updated list of compiler versions + +#### Fixes: +- Fixed default precision for quat and dual_quat type #312 +- Fixed (u)int64 MSB/LSB handling on BE archs #306 +- Fixed multi-line comment warning in g++. #315 +- Fixed specifier removal by 'std::make_pair<>' #333 +- Fixed perspective fovy argument documentation #327 +- Removed -m64 causing build issues on Linux 32 #331 +- Fixed isfinite with C++98 compilers #343 +- Fixed Intel compiler build error on Linux #354 +- Fixed use of libstdc++ with Clang #351 +- Fixed quaternion pow #346 +- Fixed decompose warnings #373 +- Fixed matrix conversions #371 + +#### Deprecation: +- Removed integer specification for 'mod' in GTC_integer #308 +- Removed GTX_multiple, replaced by GTC_round + +--- +### [GLM 0.9.6.3](https://github.com/g-truc/glm/releases/tag/0.9.6.3) - 2015-02-15 +- Fixed Android doesn't have C++ 11 STL #284 + +--- +### [GLM 0.9.6.2](https://github.com/g-truc/glm/releases/tag/0.9.6.2) - 2015-02-15 +#### Features: +- Added display of GLM version with other GLM_MESSAGES +- Added ARM instruction set detection + +#### Improvements: +- Removed assert for perspective with zFar < zNear #298 +- Added Visual Studio natvis support for vec1, quat and dualqual types +- Cleaned up C++11 feature detections +- Clarify GLM licensing + +#### Fixes: +- Fixed faceforward build #289 +- Fixed conflict with Xlib #define True 1 #293 +- Fixed decompose function VS2010 templating issues #294 +- Fixed mat4x3 = mat2x3 * mat4x2 operator #297 +- Fixed warnings in F2x11_1x10 packing function in GTC_packing #295 +- Fixed Visual Studio natvis support for vec4 #288 +- Fixed GTC_packing *pack*norm*x* build and added tests #292 +- Disabled GTX_scalar_multiplication for GCC, failing to build tests #242 +- Fixed Visual C++ 2015 constexpr errors: Disabled only partial support +- Fixed functions not inlined with Clang #302 +- Fixed memory corruption (undefined behaviour) #303 + +--- +### [GLM 0.9.6.1](https://github.com/g-truc/glm/releases/tag/0.9.6.1) - 2014-12-10 +#### Features: +- Added GLM_LANG_CXX14_FLAG and GLM_LANG_CXX1Z_FLAG language feature flags +- Added C++14 detection + +#### Improvements: +- Clean up GLM_MESSAGES compilation log to report only detected capabilities + +#### Fixes: +- Fixed scalar uaddCarry build error with Cuda #276 +- Fixed C++11 explicit conversion operators detection #282 +- Fixed missing explicit conversion when using integer log2 with *vec1 types +- Fixed 64 bits integer GTX_string_cast to_string on VC 32 bit compiler +- Fixed Android build issue, STL C++11 is not supported by the NDK #284 +- Fixed unsupported _BitScanForward64 and _BitScanReverse64 in VC10 +- Fixed Visual C++ 32 bit build #283 +- Fixed GLM_FORCE_SIZE_FUNC pragma message +- Fixed C++98 only build +- Fixed conflict between GTX_compatibility and GTC_quaternion #286 +- Fixed C++ language restriction using GLM_FORCE_CXX** + +--- +### [GLM 0.9.6.0](https://github.com/g-truc/glm/releases/tag/0.9.6.0) - 2014-11-30 +#### Features: +- Exposed template vector and matrix types in 'glm' namespace #239, #244 +- Added GTX_scalar_multiplication for C++ 11 compiler only #242 +- Added GTX_range for C++ 11 compiler only #240 +- Added closestPointOnLine function for tvec2 to GTX_closest_point #238 +- Added GTC_vec1 extension, *vec1 support to *vec* types +- Updated GTX_associated_min_max with vec1 support +- Added support of precision and integers to linearRand #230 +- Added Integer types support to GTX_string_cast #249 +- Added vec3 slerp #237 +- Added GTX_common with isdenomal #223 +- Added GLM_FORCE_SIZE_FUNC to replace .length() by .size() #245 +- Added GLM_FORCE_NO_CTOR_INIT +- Added 'uninitialize' to explicitly not initialize a GLM type +- Added GTC_bitfield extension, promoted GTX_bit +- Added GTC_integer extension, promoted GTX_bit and GTX_integer +- Added GTC_round extension, promoted GTX_bit +- Added GLM_FORCE_EXPLICIT_CTOR to require explicit type conversions #269 +- Added GTX_type_aligned for aligned vector, matrix and quaternion types + +#### Improvements: +- Rely on C++11 to implement isinf and isnan +- Removed GLM_FORCE_CUDA, Cuda is implicitly detected +- Separated Apple Clang and LLVM compiler detection +- Used pragma once +- Undetected C++ compiler automatically compile with GLM_FORCE_CXX98 and + GLM_FORCE_PURE +- Added not function (from GLSL specification) on VC12 +- Optimized bitfieldReverse and bitCount functions +- Optimized findLSB and findMSB functions. +- Optimized matrix-vector multiple performance with Cuda #257, #258 +- Reduced integer type redifinitions #233 +- Rewrited of GTX_fast_trigonometry #264 #265 +- Made types trivially copyable #263 +- Removed in GLM tests +- Used std features within GLM without redeclaring +- Optimized cot function #272 +- Optimized sign function #272 +- Added explicit cast from quat to mat3 and mat4 #275 + +#### Fixes: +- Fixed std::nextafter not supported with C++11 on Android #217 +- Fixed missing value_type for dual quaternion +- Fixed return type of dual quaternion length +- Fixed infinite loop in isfinite function with GCC #221 +- Fixed Visual Studio 14 compiler warnings +- Fixed implicit conversion from another tvec2 type to another tvec2 #241 +- Fixed lack of consistency of quat and dualquat constructors +- Fixed uaddCarray #253 +- Fixed float comparison warnings #270 + +#### Deprecation: +- Requires Visual Studio 2010, GCC 4.2, Apple Clang 4.0, LLVM 3.0, Cuda 4, ICC 2013 or a C++98 compiler +- Removed degrees for function parameters +- Removed GLM_FORCE_RADIANS, active by default +- Removed VC 2005 / 8 and 2008 / 9 support +- Removed GCC 3.4 to 4.3 support +- Removed LLVM GCC support +- Removed LLVM 2.6 to 3.1 support +- Removed CUDA 3.0 to 3.2 support + +--- +### [GLM 0.9.5.4 - 2014-06-21](https://github.com/g-truc/glm/releases/tag/0.9.5.4) +- Fixed non-utf8 character #196 +- Added FindGLM install for CMake #189 +- Fixed GTX_color_space - saturation #195 +- Fixed glm::isinf and glm::isnan for with Android NDK 9d #191 +- Fixed builtin GLM_ARCH_SSE4 #204 +- Optimized Quaternion vector rotation #205 +- Fixed missing doxygen @endcond tag #211 +- Fixed instruction set detection with Clang #158 +- Fixed orientate3 function #207 +- Fixed lerp when cosTheta is close to 1 in quaternion slerp #210 +- Added GTX_io for io with #144 +- Fixed fastDistance ambiguity #215 +- Fixed tweakedInfinitePerspective #208 and added user-defined epsilon to + tweakedInfinitePerspective +- Fixed std::copy and std::vector with GLM types #214 +- Fixed strict aliasing issues #212, #152 +- Fixed std::nextafter not supported with C++11 on Android #213 +- Fixed corner cases in exp and log functions for quaternions #199 + +--- +### GLM 0.9.5.3 - 2014-04-02 +- Added instruction set auto detection with Visual C++ using _M_IX86_FP - /arch + compiler argument +- Fixed GTX_raw_data code dependency +- Fixed GCC instruction set detection +- Added GLM_GTX_matrix_transform_2d extension (#178, #176) +- Fixed CUDA issues (#169, #168, #183, #182) +- Added support for all extensions but GTX_string_cast to CUDA +- Fixed strict aliasing warnings in GCC 4.8.1 / Android NDK 9c (#152) +- Fixed missing bitfieldInterleave definisions +- Fixed usubBorrow (#171) +- Fixed eulerAngle*** not consistent for right-handed coordinate system (#173) +- Added full tests for eulerAngle*** functions (#173) +- Added workaround for a CUDA compiler bug (#186, #185) + +--- +### GLM 0.9.5.2 - 2014-02-08 +- Fixed initializer list ambiguity (#159, #160) +- Fixed warnings with the Android NDK 9c +- Fixed non power of two matrix products +- Fixed mix function link error +- Fixed SSE code included in GLM tests on "pure" platforms +- Fixed undefined reference to fastInverseSqrt (#161) +- Fixed GLM_FORCE_RADIANS with build error (#165) +- Fix dot product clamp range for vector angle functions. (#163) +- Tentative fix for strict aliasing warning in GCC 4.8.1 / Android NDK 9c (#152) +- Fixed GLM_GTC_constants description brief (#162) + +--- +### GLM 0.9.5.1 - 2014-01-11 +- Fixed angle and orientedAngle that sometimes return NaN values (#145) +- Deprecated degrees for function parameters and display a message +- Added possible static_cast conversion of GLM types (#72) +- Fixed error 'inverse' is not a member of 'glm' from glm::unProject (#146) +- Fixed mismatch between some declarations and definitions +- Fixed inverse link error when using namespace glm; (#147) +- Optimized matrix inverse and division code (#149) +- Added intersectRayPlane function (#153) +- Fixed outerProduct return type (#155) + +--- +### GLM 0.9.5.0 - 2013-12-25 +- Added forward declarations (glm/fwd.hpp) for faster compilations +- Added per feature headers +- Minimized GLM internal dependencies +- Improved Intel Compiler detection +- Added bitfieldInterleave and _mm_bit_interleave_si128 functions +- Added GTX_scalar_relational +- Added GTX_dual_quaternion +- Added rotation function to GTX_quaternion (#22) +- Added precision variation of each type +- Added quaternion comparison functions +- Fixed GTX_multiple for negative value +- Removed GTX_ocl_type extension +- Fixed post increment and decrement operators +- Fixed perspective with zNear == 0 (#71) +- Removed l-value swizzle operators +- Cleaned up compiler detection code for unsupported compilers +- Replaced C cast by C++ casts +- Fixed .length() that should return a int and not a size_t +- Added GLM_FORCE_SIZE_T_LENGTH and glm::length_t +- Removed unnecessary conversions +- Optimized packing and unpacking functions +- Removed the normalization of the up argument of lookAt function (#114) +- Added low precision specializations of inversesqrt +- Fixed ldexp and frexp implementations +- Increased assert coverage +- Increased static_assert coverage +- Replaced GLM traits by STL traits when possible +- Allowed including individual core feature +- Increased unit tests completeness +- Added creating of a quaternion from two vectors +- Added C++11 initializer lists +- Fixed umulExtended and imulExtended implementations for vector types (#76) +- Fixed CUDA coverage for GTC extensions +- Added GTX_io extension +- Improved GLM messages enabled when defining GLM_MESSAGES +- Hidden matrix_inverse function implementation detail into private section + +--- +### [GLM 0.9.4.6](https://github.com/g-truc/glm/releases/tag/0.9.4.6) - 2013-09-20 +- Fixed detection to select the last known compiler if newer version #106 +- Fixed is_int and is_uint code duplication with GCC and C++11 #107 +- Fixed test suite build while using Clang in C++11 mode +- Added c++1y mode support in CMake test suite +- Removed ms extension mode to CMake when no using Visual C++ +- Added pedantic mode to CMake test suite for Clang and GCC +- Added use of GCC frontend on Unix for ICC and Visual C++ fronted on Windows + for ICC +- Added compilation errors for unsupported compiler versions +- Fixed glm::orientation with GLM_FORCE_RADIANS defined #112 +- Fixed const ref issue on assignment operator taking a scalar parameter #116 +- Fixed glm::eulerAngleY implementation #117 + +--- +### GLM 0.9.4.5 - 2013-08-12 +- Fixed CUDA support +- Fixed inclusion of intrinsics in "pure" mode #92 +- Fixed language detection on GCC when the C++0x mode isn't enabled #95 +- Fixed issue #97: register is deprecated in C++11 +- Fixed issue #96: CUDA issues +- Added Windows CE detection #92 +- Added missing value_ptr for quaternions #99 + +--- +### GLM 0.9.4.4 - 2013-05-29 +- Fixed slerp when costheta is close to 1 #65 +- Fixed mat4x2 value_type constructor #70 +- Fixed glm.natvis for Visual C++ 12 #82 +- Added assert in inversesqrt to detect division by zero #61 +- Fixed missing swizzle operators #86 +- Fixed CUDA warnings #86 +- Fixed GLM natvis for VC11 #82 +- Fixed GLM_GTX_multiple with negative values #79 +- Fixed glm::perspective when zNear is zero #71 + +--- +### GLM 0.9.4.3 - 2013-03-20 +- Detected qualifier for Clang +- Fixed C++11 mode for GCC, couldn't be enabled without MS extensions +- Fixed squad, intermediate and exp quaternion functions +- Fixed GTX_polar_coordinates euclidean function, takes a vec2 instead of a vec3 +- Clarify the license applying on the manual +- Added a docx copy of the manual +- Fixed GLM_GTX_matrix_interpolation +- Fixed isnan and isinf on Android with Clang +- Autodetected C++ version using __cplusplus value +- Fixed mix for bool and bvec* third parameter + +--- +### GLM 0.9.4.2 - 2013-02-14 +- Fixed compAdd from GTX_component_wise +- Fixed SIMD support for Intel compiler on Windows +- Fixed isnan and isinf for CUDA compiler +- Fixed GLM_FORCE_RADIANS on glm::perspective +- Fixed GCC warnings +- Fixed packDouble2x32 on Xcode +- Fixed mix for vec4 SSE implementation +- Fixed 0x2013 dash character in comments that cause issue in Windows + Japanese mode +- Fixed documentation warnings +- Fixed CUDA warnings + +--- +### GLM 0.9.4.1 - 2012-12-22 +- Improved half support: -0.0 case and implicit conversions +- Fixed Intel Composer Compiler support on Linux +- Fixed interaction between quaternion and euler angles +- Fixed GTC_constants build +- Fixed GTX_multiple +- Fixed quat slerp using mix function when cosTheta close to 1 +- Improved fvec4SIMD and fmat4x4SIMD implementations +- Fixed assert messages +- Added slerp and lerp quaternion functions and tests + +--- +### GLM 0.9.4.0 - 2012-11-18 +- Added Intel Composer Compiler support +- Promoted GTC_espilon extension +- Promoted GTC_ulp extension +- Removed GLM website from the source repository +- Added GLM_FORCE_RADIANS so that all functions takes radians for arguments +- Fixed detection of Clang and LLVM GCC on MacOS X +- Added debugger visualizers for Visual C++ 2012 +- Requires Visual Studio 2005, GCC 4.2, Clang 2.6, Cuda 3, ICC 2013 or a C++98 compiler + +--- +### [GLM 0.9.3.4](https://github.com/g-truc/glm/releases/tag/0.9.3.4) - 2012-06-30 +- Added SSE4 and AVX2 detection. +- Removed VIRTREV_xstream and the incompatibility generated with GCC +- Fixed C++11 compiler option for GCC +- Removed MS language extension option for GCC (not fonctionnal) +- Fixed bitfieldExtract for vector types +- Fixed warnings +- Fixed SSE includes + +--- +### GLM 0.9.3.3 - 2012-05-10 +- Fixed isinf and isnan +- Improved compatibility with Intel compiler +- Added CMake test build options: SIMD, C++11, fast math and MS land ext +- Fixed SIMD mat4 test on GCC +- Fixed perspectiveFov implementation +- Fixed matrixCompMult for none-square matrices +- Fixed namespace issue on stream operators +- Fixed various warnings +- Added VC11 support + +--- +### GLM 0.9.3.2 - 2012-03-15 +- Fixed doxygen documentation +- Fixed Clang version detection +- Fixed simd mat4 /= operator + +--- +### GLM 0.9.3.1 - 2012-01-25 +- Fixed platform detection +- Fixed warnings +- Removed detail code from Doxygen doc + +--- +### GLM 0.9.3.0 - 2012-01-09 +- Added CPP Check project +- Fixed conflict with Windows headers +- Fixed isinf implementation +- Fixed Boost conflict +- Fixed warnings + +--- +### GLM 0.9.3.B - 2011-12-12 +- Added support for Chrone Native Client +- Added epsilon constant +- Removed value_size function from vector types +- Fixed roundEven on GCC +- Improved API documentation +- Fixed modf implementation +- Fixed step function accuracy +- Fixed outerProduct + +--- +### GLM 0.9.3.A - 2011-11-11 +- Improved doxygen documentation +- Added new swizzle operators for C++11 compilers +- Added new swizzle operators declared as functions +- Added GLSL 4.20 length for vector and matrix types +- Promoted GLM_GTC_noise extension: simplex, perlin, periodic noise functions +- Promoted GLM_GTC_random extension: linear, gaussian and various random number +generation distribution +- Added GLM_GTX_constants: provides useful constants +- Added extension versioning +- Removed many unused namespaces +- Fixed half based type contructors +- Added GLSL core noise functions + +--- +### [GLM 0.9.2.7](https://github.com/g-truc/glm/releases/tag/0.9.2.7) - 2011-10-24 +- Added more swizzling constructors +- Added missing non-squared matrix products + +--- +### [GLM 0.9.2.6](https://github.com/g-truc/glm/releases/tag/0.9.2.6) - 2011-10-01 +- Fixed half based type build on old GCC +- Fixed /W4 warnings on Visual C++ +- Fixed some missing l-value swizzle operators + +--- +### GLM 0.9.2.5 - 2011-09-20 +- Fixed floatBitToXint functions +- Fixed pack and unpack functions +- Fixed round functions + +--- +### GLM 0.9.2.4 - 2011-09-03 +- Fixed extensions bugs + +--- +### GLM 0.9.2.3 - 2011-06-08 +- Fixed build issues + +--- +### GLM 0.9.2.2 - 2011-06-02 +- Expend matrix constructors flexibility +- Improved quaternion implementation +- Fixed many warnings across platforms and compilers + +--- +### GLM 0.9.2.1 - 2011-05-24 +- Automatically detect CUDA support +- Improved compiler detection +- Fixed errors and warnings in VC with C++ extensions disabled +- Fixed and tested GLM_GTX_vector_angle +- Fixed and tested GLM_GTX_rotate_vector + +--- +### GLM 0.9.2.0 - 2011-05-09 +- Added CUDA support +- Added CTest test suite +- Added GLM_GTX_ulp extension +- Added GLM_GTX_noise extension +- Added GLM_GTX_matrix_interpolation extension +- Updated quaternion slerp interpolation + +--- +### [GLM 0.9.1.3](https://github.com/g-truc/glm/releases/tag/0.9.1.3) - 2011-05-07 +- Fixed bugs + +--- +### GLM 0.9.1.2 - 2011-04-15 +- Fixed bugs + +--- +### GLM 0.9.1.1 - 2011-03-17 +- Fixed bugs + +--- +### GLM 0.9.1.0 - 2011-03-03 +- Fixed bugs + +--- +### GLM 0.9.1.B - 2011-02-13 +- Updated API documentation +- Improved SIMD implementation +- Fixed Linux build + +--- +### [GLM 0.9.0.8](https://github.com/g-truc/glm/releases/tag/0.9.0.8) - 2011-02-13 +- Added quaternion product operator. +- Clarify that GLM is a header only library. + +--- +### GLM 0.9.1.A - 2011-01-31 +- Added SIMD support +- Added new swizzle functions +- Improved static assert error message with C++0x static_assert +- New setup system +- Reduced branching +- Fixed trunc implementation + +--- +### [GLM 0.9.0.7](https://github.com/g-truc/glm/releases/tag/0.9.0.7) - 2011-01-30 +- Added GLSL 4.10 packing functions +- Added == and != operators for every types. + +--- +### GLM 0.9.0.6 - 2010-12-21 +- Many matrices bugs fixed + +--- +### GLM 0.9.0.5 - 2010-11-01 +- Improved Clang support +- Fixed bugs + +--- +### GLM 0.9.0.4 - 2010-10-04 +- Added autoexp for GLM +- Fixed bugs + +--- +### GLM 0.9.0.3 - 2010-08-26 +- Fixed non-squared matrix operators + +--- +### GLM 0.9.0.2 - 2010-07-08 +- Added GLM_GTX_int_10_10_10_2 +- Fixed bugs + +--- +### GLM 0.9.0.1 - 2010-06-21 +- Fixed extensions errors + +--- +### GLM 0.9.0.0 - 2010-05-25 +- Objective-C support +- Fixed warnings +- Updated documentation + +--- +### GLM 0.9.B.2 - 2010-04-30 +- Git transition +- Removed experimental code from releases +- Fixed bugs + +--- +### GLM 0.9.B.1 - 2010-04-03 +- Based on GLSL 4.00 specification +- Added the new core functions +- Added some implicit conversion support + +--- +### GLM 0.9.A.2 - 2010-02-20 +- Improved some possible errors messages +- Improved declarations and definitions match + +--- +### GLM 0.9.A.1 - 2010-02-09 +- Removed deprecated features +- Internal redesign + +--- +### GLM 0.8.4.4 final - 2010-01-25 +- Fixed warnings + +--- +### GLM 0.8.4.3 final - 2009-11-16 +- Fixed Half float arithmetic +- Fixed setup defines + +--- +### GLM 0.8.4.2 final - 2009-10-19 +- Fixed Half float adds + +--- +### GLM 0.8.4.1 final - 2009-10-05 +- Updated documentation +- Fixed MacOS X build + +--- +### GLM 0.8.4.0 final - 2009-09-16 +- Added GCC 4.4 and VC2010 support +- Added matrix optimizations + +--- +### GLM 0.8.3.5 final - 2009-08-11 +- Fixed bugs + +--- +### GLM 0.8.3.4 final - 2009-08-10 +- Updated GLM according GLSL 1.5 spec +- Fixed bugs + +--- +### GLM 0.8.3.3 final - 2009-06-25 +- Fixed bugs + +--- +### GLM 0.8.3.2 final - 2009-06-04 +- Added GLM_GTC_quaternion +- Added GLM_GTC_type_precision + +--- +### GLM 0.8.3.1 final - 2009-05-21 +- Fixed old extension system. + +--- +### GLM 0.8.3.0 final - 2009-05-06 +- Added stable extensions. +- Added new extension system. + +--- +### GLM 0.8.2.3 final - 2009-04-01 +- Fixed bugs. + +--- +### GLM 0.8.2.2 final - 2009-02-24 +- Fixed bugs. + +--- +### GLM 0.8.2.1 final - 2009-02-13 +- Fixed bugs. + +--- +### GLM 0.8.2 final - 2009-01-21 +- Fixed bugs. + +--- +### GLM 0.8.1 final - 2008-10-30 +- Fixed bugs. + +--- +### GLM 0.8.0 final - 2008-10-23 +- New method to use extension. + +--- +### GLM 0.8.0 beta3 - 2008-10-10 +- Added CMake support for GLM tests. + +--- +### GLM 0.8.0 beta2 - 2008-10-04 +- Improved half scalars and vectors support. + +--- +### GLM 0.8.0 beta1 - 2008-09-26 +- Improved GLSL conformance +- Added GLSL 1.30 support +- Improved API documentation + +--- +### GLM 0.7.6 final - 2008-08-08 +- Improved C++ standard comformance +- Added Static assert for types checking + +--- +### GLM 0.7.5 final - 2008-07-05 +- Added build message system with Visual Studio +- Pedantic build with GCC + +--- +### GLM 0.7.4 final - 2008-06-01 +- Added external dependencies system. + +--- +### GLM 0.7.3 final - 2008-05-24 +- Fixed bugs +- Added new extension group + +--- +### GLM 0.7.2 final - 2008-04-27 +- Updated documentation +- Added preprocessor options + +--- +### GLM 0.7.1 final - 2008-03-24 +- Disabled half on GCC +- Fixed extensions + +--- +### GLM 0.7.0 final - 2008-03-22 +- Changed to MIT license +- Added new documentation + +--- +### GLM 0.6.4 - 2007-12-10 +- Fixed swizzle operators + +--- +### GLM 0.6.3 - 2007-11-05 +- Fixed type data accesses +- Fixed 3DSMax sdk conflict + +--- +### GLM 0.6.2 - 2007-10-08 +- Fixed extension + +--- +### GLM 0.6.1 - 2007-10-07 +- Fixed a namespace error +- Added extensions + +--- +### GLM 0.6.0 : 2007-09-16 +- Added new extension namespace mecanium +- Added Automatic compiler detection + +--- +### GLM 0.5.1 - 2007-02-19 +- Fixed swizzle operators + +--- +### GLM 0.5.0 - 2007-01-06 +- Upgrated to GLSL 1.2 +- Added swizzle operators +- Added setup settings + +--- +### GLM 0.4.1 - 2006-05-22 +- Added OpenGL examples + +--- +### GLM 0.4.0 - 2006-05-17 +- Added missing operators to vec* and mat* +- Added first GLSL 1.2 features +- Fixed windows.h before glm.h when windows.h required + +--- +### GLM 0.3.2 - 2006-04-21 +- Fixed texcoord components access. +- Fixed mat4 and imat4 division operators. + +--- +### GLM 0.3.1 - 2006-03-28 +- Added GCC 4.0 support under MacOS X. +- Added GCC 4.0 and 4.1 support under Linux. +- Added code optimisations. + +--- +### GLM 0.3 - 2006-02-19 +- Improved GLSL type conversion and construction compliance. +- Added experimental extensions. +- Added Doxygen Documentation. +- Added code optimisations. +- Fixed bugs. + +--- +### GLM 0.2 - 2005-05-05 +- Improve adaptative from GLSL. +- Add experimental extensions based on OpenGL extension process. +- Fixed bugs. + +--- +### GLM 0.1 - 2005-02-21 +- Add vec2, vec3, vec4 GLSL types +- Add ivec2, ivec3, ivec4 GLSL types +- Add bvec2, bvec3, bvec4 GLSL types +- Add mat2, mat3, mat4 GLSL types +- Add almost all functions + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/CMakeLists.txt b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..f239f93db3bafdae76296c3301df73eee8f27af2 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/CMakeLists.txt @@ -0,0 +1,246 @@ +option(GLM_QUIET "No CMake Message" OFF) +option(BUILD_SHARED_LIBS "Build shared library" ON) +option(BUILD_STATIC_LIBS "Build static library" ON) +option(GLM_TEST_ENABLE_CXX_98 "Enable C++ 98" OFF) +option(GLM_TEST_ENABLE_CXX_11 "Enable C++ 11" OFF) +option(GLM_TEST_ENABLE_CXX_14 "Enable C++ 14" OFF) +option(GLM_TEST_ENABLE_CXX_17 "Enable C++ 17" OFF) +option(GLM_TEST_ENABLE_CXX_20 "Enable C++ 20" OFF) + +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +if(GLM_TEST_ENABLE_CXX_20) + set(CMAKE_CXX_STANDARD 20) + add_definitions(-DGLM_FORCE_CXX2A) + if(NOT GLM_QUIET) + message(STATUS "GLM: Build with C++20 features") + endif() + +elseif(GLM_TEST_ENABLE_CXX_17) + set(CMAKE_CXX_STANDARD 17) + add_definitions(-DGLM_FORCE_CXX17) + if(NOT GLM_QUIET) + message(STATUS "GLM: Build with C++17 features") + endif() + +elseif(GLM_TEST_ENABLE_CXX_14) + set(CMAKE_CXX_STANDARD 14) + add_definitions(-DGLM_FORCE_CXX14) + if(NOT GLM_QUIET) + message(STATUS "GLM: Build with C++14 features") + endif() + +elseif(GLM_TEST_ENABLE_CXX_11) + set(CMAKE_CXX_STANDARD 11) + add_definitions(-DGLM_FORCE_CXX11) + if(NOT GLM_QUIET) + message(STATUS "GLM: Build with C++11 features") + endif() + +elseif(GLM_TEST_ENABLE_CXX_98) + set(CMAKE_CXX_STANDARD 98) + add_definitions(-DGLM_FORCE_CXX98) + if(NOT GLM_QUIET) + message(STATUS "GLM: Build with C++98 features") + endif() +endif() + +option(GLM_TEST_ENABLE_LANG_EXTENSIONS "Enable language extensions" OFF) + +option(GLM_DISABLE_AUTO_DETECTION "Enable language extensions" OFF) + +if(GLM_DISABLE_AUTO_DETECTION) + add_definitions(-DGLM_FORCE_PLATFORM_UNKNOWN -DGLM_FORCE_COMPILER_UNKNOWN -DGLM_FORCE_ARCH_UNKNOWN -DGLM_FORCE_CXX_UNKNOWN) +endif() + +if(GLM_TEST_ENABLE_LANG_EXTENSIONS) + set(CMAKE_CXX_EXTENSIONS ON) + if((CMAKE_CXX_COMPILER_ID MATCHES "Clang") OR (CMAKE_CXX_COMPILER_ID MATCHES "GNU")) + add_compile_options(-fms-extensions) + endif() + message(STATUS "GLM: Build with C++ language extensions") +else() + set(CMAKE_CXX_EXTENSIONS OFF) + if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC") + add_compile_options(/Za) + if(MSVC15) + add_compile_options(/permissive-) + endif() + endif() +endif() + +option(GLM_TEST_ENABLE_FAST_MATH "Enable fast math optimizations" OFF) +if(GLM_TEST_ENABLE_FAST_MATH) + if(NOT GLM_QUIET) + message(STATUS "GLM: Build with fast math optimizations") + endif() + + if((CMAKE_CXX_COMPILER_ID MATCHES "Clang") OR (CMAKE_CXX_COMPILER_ID MATCHES "GNU")) + add_compile_options(-ffast-math) + + elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC") + add_compile_options(/fp:fast) + endif() +else() + if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC") + add_compile_options(/fp:precise) + endif() +endif() + +option(GLM_TEST_ENABLE "Build unit tests" ON) +option(GLM_TEST_ENABLE_SIMD_SSE2 "Enable SSE2 optimizations" OFF) +option(GLM_TEST_ENABLE_SIMD_SSE3 "Enable SSE3 optimizations" OFF) +option(GLM_TEST_ENABLE_SIMD_SSSE3 "Enable SSSE3 optimizations" OFF) +option(GLM_TEST_ENABLE_SIMD_SSE4_1 "Enable SSE 4.1 optimizations" OFF) +option(GLM_TEST_ENABLE_SIMD_SSE4_2 "Enable SSE 4.2 optimizations" OFF) +option(GLM_TEST_ENABLE_SIMD_AVX "Enable AVX optimizations" OFF) +option(GLM_TEST_ENABLE_SIMD_AVX2 "Enable AVX2 optimizations" OFF) +option(GLM_TEST_FORCE_PURE "Force 'pure' instructions" OFF) + +if(GLM_TEST_FORCE_PURE) + add_definitions(-DGLM_FORCE_PURE) + + if(CMAKE_CXX_COMPILER_ID MATCHES "GNU") + add_compile_options(-mfpmath=387) + endif() + message(STATUS "GLM: No SIMD instruction set") + +elseif(GLM_TEST_ENABLE_SIMD_AVX2) + add_definitions(-DGLM_FORCE_INTRINSICS) + + if((CMAKE_CXX_COMPILER_ID MATCHES "GNU") OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang")) + add_compile_options(-mavx2) + elseif(CMAKE_CXX_COMPILER_ID MATCHES "Intel") + add_compile_options(/QxAVX2) + elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC") + add_compile_options(/arch:AVX2) + endif() + message(STATUS "GLM: AVX2 instruction set") + +elseif(GLM_TEST_ENABLE_SIMD_AVX) + add_definitions(-DGLM_FORCE_INTRINSICS) + + if((CMAKE_CXX_COMPILER_ID MATCHES "GNU") OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang")) + add_compile_options(-mavx) + elseif(CMAKE_CXX_COMPILER_ID MATCHES "Intel") + add_compile_options(/QxAVX) + elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC") + add_compile_options(/arch:AVX) + endif() + message(STATUS "GLM: AVX instruction set") + +elseif(GLM_TEST_ENABLE_SIMD_SSE4_2) + add_definitions(-DGLM_FORCE_INTRINSICS) + + if((CMAKE_CXX_COMPILER_ID MATCHES "GNU") OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang")) + add_compile_options(-msse4.2) + elseif(CMAKE_CXX_COMPILER_ID MATCHES "Intel") + add_compile_options(/QxSSE4.2) + elseif((CMAKE_CXX_COMPILER_ID MATCHES "MSVC") AND NOT CMAKE_CL_64) + add_compile_options(/arch:SSE2) # VC doesn't support SSE4.2 + endif() + message(STATUS "GLM: SSE4.2 instruction set") + +elseif(GLM_TEST_ENABLE_SIMD_SSE4_1) + add_definitions(-DGLM_FORCE_INTRINSICS) + + if((CMAKE_CXX_COMPILER_ID MATCHES "GNU") OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang")) + add_compile_options(-msse4.1) + elseif(CMAKE_CXX_COMPILER_ID MATCHES "Intel") + add_compile_options(/QxSSE4.1) + elseif((CMAKE_CXX_COMPILER_ID MATCHES "MSVC") AND NOT CMAKE_CL_64) + add_compile_options(/arch:SSE2) # VC doesn't support SSE4.1 + endif() + message(STATUS "GLM: SSE4.1 instruction set") + +elseif(GLM_TEST_ENABLE_SIMD_SSSE3) + add_definitions(-DGLM_FORCE_INTRINSICS) + + if((CMAKE_CXX_COMPILER_ID MATCHES "GNU") OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang")) + add_compile_options(-mssse3) + elseif(CMAKE_CXX_COMPILER_ID MATCHES "Intel") + add_compile_options(/QxSSSE3) + elseif((CMAKE_CXX_COMPILER_ID MATCHES "MSVC") AND NOT CMAKE_CL_64) + add_compile_options(/arch:SSE2) # VC doesn't support SSSE3 + endif() + message(STATUS "GLM: SSSE3 instruction set") + +elseif(GLM_TEST_ENABLE_SIMD_SSE3) + add_definitions(-DGLM_FORCE_INTRINSICS) + + if((CMAKE_CXX_COMPILER_ID MATCHES "GNU") OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang")) + add_compile_options(-msse3) + elseif(CMAKE_CXX_COMPILER_ID MATCHES "Intel") + add_compile_options(/QxSSE3) + elseif((CMAKE_CXX_COMPILER_ID MATCHES "MSVC") AND NOT CMAKE_CL_64) + add_compile_options(/arch:SSE2) # VC doesn't support SSE3 + endif() + message(STATUS "GLM: SSE3 instruction set") + +elseif(GLM_TEST_ENABLE_SIMD_SSE2) + add_definitions(-DGLM_FORCE_INTRINSICS) + + if((CMAKE_CXX_COMPILER_ID MATCHES "GNU") OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang")) + add_compile_options(-msse2) + elseif(CMAKE_CXX_COMPILER_ID MATCHES "Intel") + add_compile_options(/QxSSE2) + elseif((CMAKE_CXX_COMPILER_ID MATCHES "MSVC") AND NOT CMAKE_CL_64) + add_compile_options(/arch:SSE2) + endif() + message(STATUS "GLM: SSE2 instruction set") +endif() + +# Compiler and default options + +if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") + if(NOT GLM_QUIET) + message("GLM: Clang - ${CMAKE_CXX_COMPILER_ID} compiler") + endif() + + add_compile_options(-Werror -Weverything) + add_compile_options(-Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-c++11-long-long -Wno-padded -Wno-gnu-anonymous-struct -Wno-nested-anon-types) + add_compile_options(-Wno-undefined-reinterpret-cast -Wno-sign-conversion -Wno-unused-variable -Wno-missing-prototypes -Wno-unreachable-code -Wno-missing-variable-declarations -Wno-sign-compare -Wno-global-constructors -Wno-unused-macros -Wno-format-nonliteral) + +elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU") + if(NOT GLM_QUIET) + message("GLM: GCC - ${CMAKE_CXX_COMPILER_ID} compiler") + endif() + + add_compile_options(-O2) + add_compile_options(-Wno-long-long) + +elseif(CMAKE_CXX_COMPILER_ID MATCHES "Intel") + if(NOT GLM_QUIET) + message("GLM: Intel - ${CMAKE_CXX_COMPILER_ID} compiler") + endif() + +elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC") + if(NOT GLM_QUIET) + message("GLM: Visual C++ - ${CMAKE_CXX_COMPILER_ID} compiler") + endif() + + add_compile_options(/W4 /WX) + add_compile_options(/wd4309 /wd4324 /wd4389 /wd4127 /wd4267 /wd4146 /wd4201 /wd4464 /wd4514 /wd4701 /wd4820 /wd4365) + add_definitions(-D_CRT_SECURE_NO_WARNINGS) +endif() + +function(glmCreateTestGTC NAME) + set(SAMPLE_NAME test-${NAME}) + add_executable(${SAMPLE_NAME} ${NAME}.cpp) + + add_test( + NAME ${SAMPLE_NAME} + COMMAND $ ) + target_link_libraries(${SAMPLE_NAME} PRIVATE glm::glm) +endfunction() + +if(GLM_TEST_ENABLE) + add_subdirectory(bug) + add_subdirectory(core) + add_subdirectory(ext) + add_subdirectory(gtc) + add_subdirectory(gtx) + add_subdirectory(perf) +endif() + + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/bug/CMakeLists.txt b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/bug/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..7aa0d4b28c064e0dac32525f6aee8f475e81f53d --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/bug/CMakeLists.txt @@ -0,0 +1 @@ +glmCreateTestGTC(bug_ms_vec_static) diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/bug/bug_ms_vec_static.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/bug/bug_ms_vec_static.cpp new file mode 100644 index 0000000000000000000000000000000000000000..81d87bd6f358d546b327c115c2a04482365eefe4 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/bug/bug_ms_vec_static.cpp @@ -0,0 +1,31 @@ +#include + +#if GLM_CONFIG_ANONYMOUS_STRUCT == GLM_ENABLE +struct vec2; + +struct _swizzle +{ + char _buffer[1]; +}; + +struct vec2 +{ + GLM_CONSTEXPR vec2() : + x(0), y(0) + {} + + union + { + struct { float x, y; }; + struct { _swizzle xx; }; + }; +}; +#endif + +// Visual C++ has a bug generating the error: fatal error C1001: An internal error has occurred in the compiler. +// vec2 Bar; + +int main() +{ + return 0; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/cmake/CMakeLists.txt b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/cmake/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..de7bbd3c1273a293a9c22fda94e502fe2807fcad --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/cmake/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.2 FATAL_ERROR) +project(test_find_glm) + +find_package(glm REQUIRED) + +add_executable(test_find_glm test_find_glm.cpp) +target_link_libraries(test_find_glm glm::glm) + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/cmake/test_find_glm.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/cmake/test_find_glm.cpp new file mode 100644 index 0000000000000000000000000000000000000000..32aceed675423b416e6307e4406478d8b992b89e --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/cmake/test_find_glm.cpp @@ -0,0 +1,22 @@ +#include +#include +#include + +glm::mat4 camera(float Translate, glm::vec2 const& Rotate) +{ + glm::mat4 Projection = glm::perspective(glm::pi() * 0.25f, 4.0f / 3.0f, 0.1f, 100.f); + glm::mat4 View = glm::translate(glm::mat4(1.0f), glm::vec3(0.0f, 0.0f, -Translate)); + View = glm::rotate(View, Rotate.y, glm::vec3(-1.0f, 0.0f, 0.0f)); + View = glm::rotate(View, Rotate.x, glm::vec3(0.0f, 1.0f, 0.0f)); + glm::mat4 Model = glm::scale(glm::mat4(1.0f), glm::vec3(0.5f)); + return Projection * View * Model; +} + +int main() +{ + const glm::mat4 m = camera(1.f, glm::vec2(1.f, 0.5f)); + std::cout << "matrix diagonal: " << m[0][0] << ", " + << m[1][1] << ", " << m[2][2] << ", " << m[3][3] << "\n"; + return 0; +} + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/CMakeLists.txt b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..5043a8418a1c523b3da16dc67ee9dd341b92491c --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/CMakeLists.txt @@ -0,0 +1,52 @@ +glmCreateTestGTC(core_cpp_constexpr) +glmCreateTestGTC(core_cpp_defaulted_ctor) +glmCreateTestGTC(core_force_aligned_gentypes) +glmCreateTestGTC(core_force_ctor_init) +glmCreateTestGTC(core_force_cxx03) +glmCreateTestGTC(core_force_cxx98) +glmCreateTestGTC(core_force_arch_unknown) +glmCreateTestGTC(core_force_compiler_unknown) +glmCreateTestGTC(core_force_cxx_unknown) +glmCreateTestGTC(core_force_explicit_ctor) +glmCreateTestGTC(core_force_inline) +glmCreateTestGTC(core_force_platform_unknown) +glmCreateTestGTC(core_force_pure) +glmCreateTestGTC(core_force_unrestricted_gentype) +glmCreateTestGTC(core_force_xyzw_only) +glmCreateTestGTC(core_force_quat_xyzw) +glmCreateTestGTC(core_type_aligned) +glmCreateTestGTC(core_type_cast) +glmCreateTestGTC(core_type_ctor) +glmCreateTestGTC(core_type_int) +glmCreateTestGTC(core_type_length) +glmCreateTestGTC(core_type_mat2x2) +glmCreateTestGTC(core_type_mat2x3) +glmCreateTestGTC(core_type_mat2x4) +glmCreateTestGTC(core_type_mat3x2) +glmCreateTestGTC(core_type_mat3x3) +glmCreateTestGTC(core_type_mat3x4) +glmCreateTestGTC(core_type_mat4x2) +glmCreateTestGTC(core_type_mat4x3) +glmCreateTestGTC(core_type_mat4x4) +glmCreateTestGTC(core_type_vec1) +glmCreateTestGTC(core_type_vec2) +glmCreateTestGTC(core_type_vec3) +glmCreateTestGTC(core_type_vec4) +glmCreateTestGTC(core_func_common) +glmCreateTestGTC(core_func_exponential) +glmCreateTestGTC(core_func_geometric) +glmCreateTestGTC(core_func_integer) +glmCreateTestGTC(core_func_integer_bit_count) +glmCreateTestGTC(core_func_integer_find_lsb) +glmCreateTestGTC(core_func_integer_find_msb) +glmCreateTestGTC(core_func_matrix) +glmCreateTestGTC(core_func_noise) +glmCreateTestGTC(core_func_packing) +glmCreateTestGTC(core_func_trigonometric) +glmCreateTestGTC(core_func_vector_relational) +glmCreateTestGTC(core_func_swizzle) +glmCreateTestGTC(core_setup_force_cxx98) +glmCreateTestGTC(core_setup_force_size_t_length) +glmCreateTestGTC(core_setup_message) +glmCreateTestGTC(core_setup_platform_unknown) +glmCreateTestGTC(core_setup_precision) diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_cpp_constexpr.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_cpp_constexpr.cpp new file mode 100644 index 0000000000000000000000000000000000000000..3b056641187db7ada5624bff45ce45bdcacc11b7 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_cpp_constexpr.cpp @@ -0,0 +1,750 @@ +#include + +#if GLM_CONFIG_CONSTEXP == GLM_ENABLE + +#include +#include +#include +#include +#include +#include +#include +#include + +static int test_vec1() +{ + int Error = 0; + + { + constexpr glm::bvec1 B(true); + constexpr bool A = glm::all(B); + static_assert(A, "GLM: Failed constexpr"); + + constexpr glm::bvec1 D(true); + constexpr bool C = glm::any(D); + static_assert(C, "GLM: Failed constexpr"); + } + + { + constexpr glm::bvec2 C(true); + constexpr glm::bvec2 B(true); + static_assert(glm::any(glm::equal(C, B)), "GLM: Failed constexpr"); + } + + { + constexpr glm::ivec1 O(glm::ivec1(1)); + static_assert(glm::ivec1(1) == O, "GLM: Failed constexpr"); + + constexpr glm::ivec1 P(1); + static_assert(glm::ivec1(1) == P, "GLM: Failed constexpr"); + } + + { + constexpr glm::ivec1 L(glm::ivec2(1, 2)); + static_assert(glm::ivec1(1) == L, "GLM: Failed constexpr"); + + constexpr glm::ivec1 M(glm::ivec3(1, 2, 3)); + static_assert(glm::ivec1(1) == M, "GLM: Failed constexpr"); + + constexpr glm::ivec1 N(glm::ivec4(1, 2, 3, 4)); + static_assert(glm::ivec1(1) == N, "GLM: Failed constexpr"); + } + + { + constexpr glm::ivec1 A(1); + static_assert(A[0] == 1, "GLM: Failed constexpr"); + static_assert(glm::vec1(1.0f).x > 0.0f, "GLM: Failed constexpr"); + static_assert(glm::vec1::length() == 1, "GLM: Failed constexpr"); + } + + { + constexpr glm::bvec1 A1(true); + constexpr glm::bvec1 A2(true); + constexpr glm::bvec1 B1(false); + constexpr glm::bvec1 B2(false); + static_assert(A1 == A2 && B1 == B2, "GLM: Failed constexpr"); + static_assert(A1 == A2 || B1 == B2, "GLM: Failed constexpr"); + } + + { + constexpr glm::ivec1 A(1); + constexpr glm::ivec1 B = A + 1; + constexpr glm::ivec1 C(3); + static_assert(A + B == C, "GLM: Failed constexpr"); + + constexpr glm::ivec1 D = +A; + static_assert(D == A, "GLM: Failed constexpr"); + } + + { + constexpr glm::ivec1 A(3); + constexpr glm::ivec1 B = A - 1; + constexpr glm::ivec1 C(1); + static_assert(A - B == C, "GLM: Failed constexpr"); + + constexpr glm::ivec1 D = -A; + static_assert(-D == A, "GLM: Failed constexpr"); + } + + { + constexpr glm::ivec1 A(3); + constexpr glm::ivec1 B = A * 1; + static_assert(A == B, "GLM: Failed constexpr"); + + constexpr glm::ivec1 C(1); + static_assert(B * C == A, "GLM: Failed constexpr"); + } + + { + constexpr glm::ivec1 A(3); + constexpr glm::ivec1 B = A / 1; + static_assert(A == B, "GLM: Failed constexpr"); + + constexpr glm::ivec1 C(1); + static_assert(B / C == A, "GLM: Failed constexpr"); + } + + { + constexpr glm::ivec1 A(3); + constexpr glm::ivec1 B = A % 2; + constexpr glm::ivec1 C(1); + static_assert(B == C, "GLM: Failed constexpr"); + + constexpr glm::ivec1 D(2); + static_assert(A % D == C, "GLM: Failed constexpr"); + } + + { + constexpr glm::ivec1 A(1); + constexpr glm::ivec1 B = A & 1; + static_assert(A == B, "GLM: Failed constexpr"); + + constexpr glm::ivec1 C(1); + static_assert(A == (A & C), "GLM: Failed constexpr"); + } + + { + constexpr glm::ivec1 A(1); + constexpr glm::ivec1 B = A | 1; + static_assert(A == B, "GLM: Failed constexpr"); + + constexpr glm::ivec1 C(1); + static_assert(A == (A | C), "GLM: Failed constexpr"); + } + + { + constexpr glm::ivec1 A(1); + constexpr glm::ivec1 B = A ^ 0; + static_assert(A == B, "GLM: Failed constexpr"); + + constexpr glm::ivec1 C(0); + static_assert(A == (A ^ C), "GLM: Failed constexpr"); + } + + { + constexpr glm::ivec1 A(1); + constexpr glm::ivec1 B = A << 1; + static_assert(B == glm::ivec1(2), "GLM: Failed constexpr"); + + constexpr glm::ivec1 C(1); + static_assert(B == (A << C), "GLM: Failed constexpr"); + } + + { + constexpr glm::ivec1 A(2); + constexpr glm::ivec1 B = A >> 1; + static_assert(B == glm::ivec1(1), "GLM: Failed constexpr"); + + constexpr glm::ivec1 C(1); + static_assert(B == A >> C, "GLM: Failed constexpr"); + } + + { + constexpr glm::ivec1 A(~0); + constexpr glm::ivec1 B = ~A; + static_assert(A == ~B, "GLM: Failed constexpr"); + } + + return Error; +} + +static int test_vec2() +{ + int Error = 0; + + { + constexpr glm::bvec2 B(true); + constexpr bool A = glm::all(B); + static_assert(A, "GLM: Failed constexpr"); + + constexpr glm::bvec2 D(true, false); + constexpr bool C = glm::any(D); + static_assert(C, "GLM: Failed constexpr"); + } + + { + constexpr glm::bvec2 C(true); + constexpr glm::bvec2 B(true, false); + static_assert(glm::any(glm::equal(C, B)), "GLM: Failed constexpr"); + } + + { + constexpr glm::ivec2 O(glm::ivec1(1)); + static_assert(glm::ivec2(1) == O, "GLM: Failed constexpr"); + + constexpr glm::ivec2 A(1); + static_assert(glm::ivec2(1) == A, "GLM: Failed constexpr"); + } + + { + constexpr glm::ivec2 F(glm::ivec1(1), glm::ivec1(2)); + static_assert(glm::ivec2(1, 2) == F, "GLM: Failed constexpr"); + + constexpr glm::ivec2 G(1, glm::ivec1(2)); + static_assert(glm::ivec2(1, 2) == G, "GLM: Failed constexpr"); + + constexpr glm::ivec2 H(glm::ivec1(1), 2); + static_assert(glm::ivec2(1, 2) == H, "GLM: Failed constexpr"); + + constexpr glm::ivec2 I(1, 2); + static_assert(glm::ivec2(1, 2) == I, "GLM: Failed constexpr"); + } + + { + constexpr glm::ivec2 L(glm::ivec2(1, 2)); + static_assert(glm::ivec2(1, 2) == L, "GLM: Failed constexpr"); + + constexpr glm::ivec2 M(glm::ivec3(1, 2, 3)); + static_assert(glm::ivec2(1, 2) == M, "GLM: Failed constexpr"); + + constexpr glm::ivec2 N(glm::ivec4(1, 2, 3, 4)); + static_assert(glm::ivec2(1, 2) == N, "GLM: Failed constexpr"); + } + + { + constexpr glm::ivec2 A(1); + static_assert(A[0] == 1, "GLM: Failed constexpr"); + static_assert(glm::vec2(1.0f).x > 0.0f, "GLM: Failed constexpr"); + static_assert(glm::vec2(1.0f, -1.0f).x > 0.0f, "GLM: Failed constexpr"); + static_assert(glm::vec2(1.0f, -1.0f).y < 0.0f, "GLM: Failed constexpr"); + static_assert(glm::vec2::length() == 2, "GLM: Failed constexpr"); + } + + { + constexpr glm::bvec2 A1(true); + constexpr glm::bvec2 A2(true); + constexpr glm::bvec2 B1(false); + constexpr glm::bvec2 B2(false); + static_assert(A1 == A2 && B1 == B2, "GLM: Failed constexpr"); + static_assert(A1 == A2 || B1 == B2, "GLM: Failed constexpr"); + } + + { + constexpr glm::ivec2 A(1); + constexpr glm::ivec2 B = A + 1; + constexpr glm::ivec2 C(3); + static_assert(A + B == C, "GLM: Failed constexpr"); + + constexpr glm::ivec2 D = +A; + static_assert(D == A, "GLM: Failed constexpr"); + } + + { + constexpr glm::ivec2 A(3); + constexpr glm::ivec2 B = A - 1; + constexpr glm::ivec2 C(1); + static_assert(A - B == C, "GLM: Failed constexpr"); + + constexpr glm::ivec2 D = -A; + static_assert(-D == A, "GLM: Failed constexpr"); + } + + { + constexpr glm::ivec2 A(3); + constexpr glm::ivec2 B = A * 1; + static_assert(A == B, "GLM: Failed constexpr"); + + constexpr glm::ivec2 C(1); + static_assert(B * C == A, "GLM: Failed constexpr"); + } + + { + constexpr glm::ivec2 A(3); + constexpr glm::ivec2 B = A / 1; + static_assert(A == B, "GLM: Failed constexpr"); + + constexpr glm::ivec2 C(1); + static_assert(B / C == A, "GLM: Failed constexpr"); + } + + { + constexpr glm::ivec2 A(3); + constexpr glm::ivec2 B = A % 2; + constexpr glm::ivec2 C(1); + static_assert(B == C, "GLM: Failed constexpr"); + + constexpr glm::ivec1 D(2); + static_assert(A % D == C, "GLM: Failed constexpr"); + } + + { + constexpr glm::ivec2 A(1); + constexpr glm::ivec2 B = A & 1; + static_assert(A == B, "GLM: Failed constexpr"); + + constexpr glm::ivec1 C(1); + static_assert(A == (A & C), "GLM: Failed constexpr"); + } + + { + constexpr glm::ivec2 A(1); + constexpr glm::ivec2 B = A | 1; + static_assert(A == B, "GLM: Failed constexpr"); + + constexpr glm::ivec1 C(1); + static_assert(A == (A | C), "GLM: Failed constexpr"); + } + + { + constexpr glm::ivec2 A(1); + constexpr glm::ivec2 B = A ^ 0; + static_assert(A == B, "GLM: Failed constexpr"); + + constexpr glm::ivec1 C(0); + static_assert(A == (A ^ C), "GLM: Failed constexpr"); + } + + { + constexpr glm::ivec2 A(1); + constexpr glm::ivec2 B = A << 1; + static_assert(B == glm::ivec2(2), "GLM: Failed constexpr"); + + constexpr glm::ivec1 C(1); + static_assert(B == (A << C), "GLM: Failed constexpr"); + } + + { + constexpr glm::ivec2 A(2); + constexpr glm::ivec2 B = A >> 1; + static_assert(B == glm::ivec2(1), "GLM: Failed constexpr"); + + constexpr glm::ivec1 C(1); + static_assert(B == A >> C, "GLM: Failed constexpr"); + } + + { + constexpr glm::ivec2 A(~0); + constexpr glm::ivec2 B = ~A; + static_assert(A == ~B, "GLM: Failed constexpr"); + } + + return Error; +} + +static int test_vec3() +{ + int Error = 0; + + { + constexpr glm::bvec3 B(true); + constexpr bool A = glm::all(B); + static_assert(A, "GLM: Failed constexpr"); + + constexpr glm::bvec3 D(true, false, true); + constexpr bool C = glm::any(D); + static_assert(C, "GLM: Failed constexpr"); + } + + { + constexpr glm::bvec3 C(true); + constexpr glm::bvec3 B(true, false, true); + static_assert(glm::any(glm::equal(C, B)), "GLM: Failed constexpr"); + } + + { + constexpr glm::ivec3 O(glm::ivec1(1)); + static_assert(glm::ivec3(1) == O, "GLM: Failed constexpr"); + + constexpr glm::ivec3 A(1); + static_assert(glm::ivec3(1) == A, "GLM: Failed constexpr"); + } + + { + constexpr glm::ivec3 B(glm::ivec2(1, 2), 3); + static_assert(glm::ivec3(1, 2, 3) == B, "GLM: Failed constexpr"); + + constexpr glm::ivec3 C(1, glm::ivec2(2, 3)); + static_assert(glm::ivec3(1, 2, 3) == C, "GLM: Failed constexpr"); + + constexpr glm::ivec3 D(glm::ivec1(1), glm::ivec2(2, 3)); + static_assert(glm::ivec3(1, 2, 3) == D, "GLM: Failed constexpr"); + + constexpr glm::ivec3 E(glm::ivec2(1, 2), glm::ivec1(3)); + static_assert(glm::ivec3(1, 2, 3) == E, "GLM: Failed constexpr"); + } + + { + constexpr glm::ivec3 F(glm::ivec1(1), glm::ivec1(2), glm::ivec1(3)); + static_assert(glm::ivec3(1, 2, 3) == F, "GLM: Failed constexpr"); + + constexpr glm::ivec3 G(1, glm::ivec1(2), glm::ivec1(3)); + static_assert(glm::ivec3(1, 2, 3) == G, "GLM: Failed constexpr"); + + constexpr glm::ivec3 H(glm::ivec1(1), 2, glm::ivec1(3)); + static_assert(glm::ivec3(1, 2, 3) == H, "GLM: Failed constexpr"); + + constexpr glm::ivec3 I(1, 2, glm::ivec1(3)); + static_assert(glm::ivec3(1, 2, 3) == I, "GLM: Failed constexpr"); + + constexpr glm::ivec3 J(glm::ivec1(1), glm::ivec1(2), 3); + static_assert(glm::ivec3(1, 2, 3) == J, "GLM: Failed constexpr"); + + constexpr glm::ivec3 K(1, glm::ivec1(2), 3); + static_assert(glm::ivec3(1, 2, 3) == K, "GLM: Failed constexpr"); + + constexpr glm::ivec3 L(glm::ivec1(1), 2, 3); + static_assert(glm::ivec3(1, 2, 3) == L, "GLM: Failed constexpr"); + + constexpr glm::ivec3 M(1, 2, 3); + static_assert(glm::ivec3(1, 2, 3) == M, "GLM: Failed constexpr"); + } + + { + constexpr glm::ivec3 N(glm::ivec4(1, 2, 3, 4)); + static_assert(glm::ivec3(1, 2, 3) == N, "GLM: Failed constexpr"); + } + + { + constexpr glm::ivec3 const A(1); + static_assert(A[0] == 1, "GLM: Failed constexpr"); + static_assert(glm::vec3(1.0f).x > 0.0f, "GLM: Failed constexpr"); + static_assert(glm::vec3(1.0f, -1.0f, -1.0f).x > 0.0f, "GLM: Failed constexpr"); + static_assert(glm::vec3(1.0f, -1.0f, -1.0f).y < 0.0f, "GLM: Failed constexpr"); + static_assert(glm::vec3::length() == 3, "GLM: Failed constexpr"); + } + + { + constexpr glm::bvec3 A1(true); + constexpr glm::bvec3 A2(true); + constexpr glm::bvec3 B1(false); + constexpr glm::bvec3 B2(false); + static_assert(A1 == A2 && B1 == B2, "GLM: Failed constexpr"); + static_assert(A1 == A2 || B1 == B2, "GLM: Failed constexpr"); + } + + { + constexpr glm::ivec3 A(1); + constexpr glm::ivec3 B = A + 1; + constexpr glm::ivec3 C(3); + static_assert(A + B == C, "GLM: Failed constexpr"); + + constexpr glm::ivec3 D = +A; + static_assert(D == A, "GLM: Failed constexpr"); + } + + { + constexpr glm::ivec3 A(3); + constexpr glm::ivec3 B = A - 1; + constexpr glm::ivec3 C(1); + static_assert(A - B == C, "GLM: Failed constexpr"); + + constexpr glm::ivec3 D = -A; + static_assert(-D == A, "GLM: Failed constexpr"); + } + + { + constexpr glm::ivec3 A(3); + constexpr glm::ivec3 B = A * 1; + static_assert(A == B, "GLM: Failed constexpr"); + + constexpr glm::ivec3 C(1); + static_assert(B * C == A, "GLM: Failed constexpr"); + } + + { + constexpr glm::ivec3 A(3); + constexpr glm::ivec3 B = A / 1; + static_assert(A == B, "GLM: Failed constexpr"); + + constexpr glm::ivec3 C(1); + static_assert(B / C == A, "GLM: Failed constexpr"); + } + + { + constexpr glm::ivec3 A(3); + constexpr glm::ivec3 B = A % 2; + constexpr glm::ivec3 C(1); + static_assert(B == C, "GLM: Failed constexpr"); + + constexpr glm::ivec1 D(2); + static_assert(A % D == C, "GLM: Failed constexpr"); + } + + { + constexpr glm::ivec3 A(1); + constexpr glm::ivec3 B = A & 1; + static_assert(A == B, "GLM: Failed constexpr"); + + constexpr glm::ivec1 C(1); + static_assert(A == (A & C), "GLM: Failed constexpr"); + } + + { + constexpr glm::ivec3 A(1); + constexpr glm::ivec3 B = A | 1; + static_assert(A == B, "GLM: Failed constexpr"); + + constexpr glm::ivec1 C(1); + static_assert(A == (A | C), "GLM: Failed constexpr"); + } + + { + constexpr glm::ivec3 A(1); + constexpr glm::ivec3 B = A ^ 0; + static_assert(A == B, "GLM: Failed constexpr"); + + constexpr glm::ivec1 C(0); + static_assert(A == (A ^ C), "GLM: Failed constexpr"); + } + + { + constexpr glm::ivec3 A(1); + constexpr glm::ivec3 B = A << 1; + static_assert(B == glm::ivec3(2), "GLM: Failed constexpr"); + + constexpr glm::ivec1 C(1); + static_assert(B == (A << C), "GLM: Failed constexpr"); + } + + { + constexpr glm::ivec3 A(2); + constexpr glm::ivec3 B = A >> 1; + static_assert(B == glm::ivec3(1), "GLM: Failed constexpr"); + + constexpr glm::ivec1 C(1); + static_assert(B == A >> C, "GLM: Failed constexpr"); + } + + { + constexpr glm::ivec3 A(~0); + constexpr glm::ivec3 B = ~A; + static_assert(A == ~B, "GLM: Failed constexpr"); + } + + return Error; +} + +static int test_vec4() +{ + int Error = 0; + + { + constexpr glm::bvec4 B(true); + constexpr bool A = glm::all(B); + static_assert(A, "GLM: Failed constexpr"); + + constexpr glm::bvec4 D(true, false, true, false); + constexpr bool C = glm::any(D); + static_assert(C, "GLM: Failed constexpr"); + } + + { + constexpr glm::bvec4 C(true); + constexpr glm::bvec4 B(true, false, true, false); + static_assert(glm::any(glm::equal(C, B)), "GLM: Failed constexpr"); + } + + { + constexpr glm::ivec4 O(glm::ivec4(1)); + static_assert(glm::ivec4(1) == O, "GLM: Failed constexpr"); + + constexpr glm::ivec4 A(1); + static_assert(glm::ivec4(1) == A, "GLM: Failed constexpr"); + + constexpr glm::ivec4 N(glm::ivec4(1, 2, 3, 4)); + static_assert(glm::ivec4(1, 2, 3, 4) == N, "GLM: Failed constexpr"); + } + + { + constexpr glm::ivec4 A(glm::ivec3(1, 2, 3), 4); + static_assert(glm::ivec4(1, 2, 3, 4) == A, "GLM: Failed constexpr"); + + constexpr glm::ivec4 B(glm::ivec2(1, 2), glm::ivec2(3, 4)); + static_assert(glm::ivec4(1, 2, 3, 4) == B, "GLM: Failed constexpr"); + + constexpr glm::ivec4 C(1, glm::ivec3(2, 3, 4)); + static_assert(glm::ivec4(1, 2, 3, 4) == C, "GLM: Failed constexpr"); + + constexpr glm::ivec4 D(glm::ivec1(1), glm::ivec2(2, 3), glm::ivec1(4)); + static_assert(glm::ivec4(1, 2, 3, 4) == D, "GLM: Failed constexpr"); + + constexpr glm::ivec4 E(glm::ivec2(1, 2), glm::ivec1(3), glm::ivec1(4)); + static_assert(glm::ivec4(1, 2, 3, 4) == E, "GLM: Failed constexpr"); + + constexpr glm::ivec4 F(glm::ivec1(1), glm::ivec1(2), glm::ivec2(3, 4)); + static_assert(glm::ivec4(1, 2, 3, 4) == F, "GLM: Failed constexpr"); + } + + { + constexpr glm::ivec4 A(1); + static_assert(A[0] == 1, "GLM: Failed constexpr"); + static_assert(glm::ivec4(1).x > 0, "GLM: Failed constexpr"); + static_assert(glm::ivec4(1.0f, -1.0f, -1.0f, 1.0f).x > 0, "GLM: Failed constexpr"); + static_assert(glm::ivec4(1.0f, -1.0f, -1.0f, 1.0f).y < 0, "GLM: Failed constexpr"); + static_assert(glm::ivec4::length() == 4, "GLM: Failed constexpr"); + } + + { + constexpr glm::bvec4 A1(true); + constexpr glm::bvec4 A2(true); + constexpr glm::bvec4 B1(false); + constexpr glm::bvec4 B2(false); + static_assert(A1 == A2 && B1 == B2, "GLM: Failed constexpr"); + static_assert(A1 == A2 || B1 == B2, "GLM: Failed constexpr"); + } + + { + constexpr glm::ivec4 A(1); + constexpr glm::ivec4 B = A + 1; + constexpr glm::ivec4 C(3); + static_assert(A + B == C, "GLM: Failed constexpr"); + + constexpr glm::ivec4 D = +A; + static_assert(D == A, "GLM: Failed constexpr"); + } + + { + constexpr glm::ivec4 A(3); + constexpr glm::ivec4 B = A - 1; + constexpr glm::ivec4 C(1); + static_assert(A - B == C, "GLM: Failed constexpr"); + + constexpr glm::ivec4 D = -A; + static_assert(-D == A, "GLM: Failed constexpr"); + } + + { + constexpr glm::ivec4 A(3); + constexpr glm::ivec4 B = A * 1; + static_assert(A == B, "GLM: Failed constexpr"); + + constexpr glm::ivec4 C(1); + static_assert(B * C == A, "GLM: Failed constexpr"); + } + + { + constexpr glm::ivec4 A(3); + constexpr glm::ivec4 B = A / 1; + static_assert(A == B, "GLM: Failed constexpr"); + + constexpr glm::ivec4 C(1); + static_assert(B / C == A, "GLM: Failed constexpr"); + } + + { + constexpr glm::ivec4 A(3); + constexpr glm::ivec4 B = A % 2; + constexpr glm::ivec4 C(1); + static_assert(B == C, "GLM: Failed constexpr"); + + constexpr glm::ivec1 D(2); + static_assert(A % D == C, "GLM: Failed constexpr"); + } + + { + constexpr glm::ivec4 A(1); + constexpr glm::ivec4 B = A & 1; + static_assert(A == B, "GLM: Failed constexpr"); + + constexpr glm::ivec1 C(1); + static_assert(A == (A & C), "GLM: Failed constexpr"); + } + + { + constexpr glm::ivec4 A(1); + constexpr glm::ivec4 B = A | 1; + static_assert(A == B, "GLM: Failed constexpr"); + + constexpr glm::ivec1 C(1); + static_assert(A == (A | C), "GLM: Failed constexpr"); + } + + { + constexpr glm::ivec4 A(1); + constexpr glm::ivec4 B = A ^ 0; + static_assert(A == B, "GLM: Failed constexpr"); + + constexpr glm::ivec1 C(0); + static_assert(A == (A ^ C), "GLM: Failed constexpr"); + } + + { + constexpr glm::ivec4 A(1); + constexpr glm::ivec4 B = A << 1; + static_assert(B == glm::ivec4(2), "GLM: Failed constexpr"); + + constexpr glm::ivec1 C(1); + static_assert(B == (A << C), "GLM: Failed constexpr"); + } + + { + constexpr glm::ivec4 A(2); + constexpr glm::ivec4 B = A >> 1; + static_assert(B == glm::ivec4(1), "GLM: Failed constexpr"); + + constexpr glm::ivec1 C(1); + static_assert(B == A >> C, "GLM: Failed constexpr"); + } + + { + constexpr glm::ivec4 A(~0); + constexpr glm::ivec4 B = ~A; + static_assert(A == ~B, "GLM: Failed constexpr"); + } + + return Error; +} + +static int test_quat() +{ + int Error = 0; + + { + static_assert(glm::quat::length() == 4, "GLM: Failed constexpr"); + static_assert(glm::quat(1.0f, glm::vec3(0.0f)).w > 0.0f, "GLM: Failed constexpr"); + static_assert(glm::quat(1.0f, 0.0f, 0.0f, 0.0f).w > 0.0f, "GLM: Failed constexpr"); + + glm::quat constexpr Q = glm::identity(); + static_assert(Q.x - glm::quat(1.0f, glm::vec3(0.0f)).x <= glm::epsilon(), "GLM: Failed constexpr"); + } + + return Error; +} + +static int test_mat2x2() +{ + int Error = 0; + + static_assert(glm::mat2x2::length() == 2, "GLM: Failed constexpr"); + + return Error; +} + +#endif//GLM_CONFIG_CONSTEXP == GLM_ENABLE + +int main() +{ + int Error = 0; + +# if GLM_CONFIG_CONSTEXP == GLM_ENABLE + Error += test_vec1(); + Error += test_vec2(); + Error += test_vec3(); + Error += test_vec4(); + Error += test_quat(); + Error += test_mat2x2(); +# endif//GLM_CONFIG_CONSTEXP == GLM_ENABLE + + return Error; +} + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_cpp_defaulted_ctor.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_cpp_defaulted_ctor.cpp new file mode 100644 index 0000000000000000000000000000000000000000..2a2504a633f367b41e5e1b77125acbbfbe684eda --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_cpp_defaulted_ctor.cpp @@ -0,0 +1,145 @@ +#include + +#if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_ENABLE + +#include +#include +#include +#include +#include +#include + +static int test_vec_memcpy() +{ + int Error = 0; + + { + glm::ivec1 const A = glm::ivec1(76); + glm::ivec1 B; + std::memcpy(&B, &A, sizeof(glm::ivec1)); + Error += B == A ? 0 : 1; + } + + { + glm::ivec2 const A = glm::ivec2(76); + glm::ivec2 B; + std::memcpy(&B, &A, sizeof(glm::ivec2)); + Error += B == A ? 0 : 1; + } + + { + glm::ivec3 const A = glm::ivec3(76); + glm::ivec3 B; + std::memcpy(&B, &A, sizeof(glm::ivec3)); + Error += B == A ? 0 : 1; + } + + { + glm::ivec4 const A = glm::ivec4(76); + glm::ivec4 B; + std::memcpy(&B, &A, sizeof(glm::ivec4)); + Error += B == A ? 0 : 1; + } + + return Error; +} + +static int test_mat_memcpy() +{ + int Error = 0; + + { + glm::mat2x2 const A = glm::mat2x2(76); + glm::mat2x2 B; + std::memcpy(&B, &A, sizeof(glm::mat2x2)); + Error += glm::all(glm::equal(B, A, glm::epsilon())) ? 0 : 1; + } + + { + glm::mat2x3 const A = glm::mat2x3(76); + glm::mat2x3 B; + std::memcpy(&B, &A, sizeof(glm::mat2x3)); + Error += glm::all(glm::equal(B, A, glm::epsilon())) ? 0 : 1; + } + + { + glm::mat2x4 const A = glm::mat2x4(76); + glm::mat2x4 B; + std::memcpy(&B, &A, sizeof(glm::mat2x4)); + Error += glm::all(glm::equal(B, A, glm::epsilon())) ? 0 : 1; + } + + { + glm::mat3x2 const A = glm::mat3x2(76); + glm::mat3x2 B; + std::memcpy(&B, &A, sizeof(glm::mat3x2)); + Error += glm::all(glm::equal(B, A, glm::epsilon())) ? 0 : 1; + } + + { + glm::mat3x3 const A = glm::mat3x3(76); + glm::mat3x3 B; + std::memcpy(&B, &A, sizeof(glm::mat3x3)); + Error += glm::all(glm::equal(B, A, glm::epsilon())) ? 0 : 1; + } + + { + glm::mat3x4 const A = glm::mat3x4(76); + glm::mat3x4 B; + std::memcpy(&B, &A, sizeof(glm::mat3x4)); + Error += glm::all(glm::equal(B, A, glm::epsilon())) ? 0 : 1; + } + + { + glm::mat4x2 const A = glm::mat4x2(76); + glm::mat4x2 B; + std::memcpy(&B, &A, sizeof(glm::mat4x2)); + Error += glm::all(glm::equal(B, A, glm::epsilon())) ? 0 : 1; + } + + { + glm::mat4x3 const A = glm::mat4x3(76); + glm::mat4x3 B; + std::memcpy(&B, &A, sizeof(glm::mat4x3)); + Error += glm::all(glm::equal(B, A, glm::epsilon())) ? 0 : 1; + } + + { + glm::mat4x4 const A = glm::mat4x4(76); + glm::mat4x4 B; + std::memcpy(&B, &A, sizeof(glm::mat4x4)); + Error += glm::all(glm::equal(B, A, glm::epsilon())) ? 0 : 1; + } + + return Error; +} + +static int test_quat_memcpy() +{ + int Error = 0; + + { + glm::quat const A = glm::quat(1, 0, 0, 0); + glm::quat B; + std::memcpy(&B, &A, sizeof(glm::quat)); + Error += glm::all(glm::equal(B, A, glm::epsilon())) ? 0 : 1; + } + + return Error; +} + +#endif//GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_ENABLE + +int main() +{ + int Error = 0; + +# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_ENABLE + Error += test_vec_memcpy(); + Error += test_mat_memcpy(); + Error += test_quat_memcpy(); +# endif//GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_ENABLE + + return Error; +} + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_force_aligned_gentypes.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_force_aligned_gentypes.cpp new file mode 100644 index 0000000000000000000000000000000000000000..31650e83710c7a619cc3ed69d24b514aedadbb77 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_force_aligned_gentypes.cpp @@ -0,0 +1,10 @@ +#include +#include + +int main() +{ + int Error = 0; + + return Error; +} + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_force_arch_unknown.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_force_arch_unknown.cpp new file mode 100644 index 0000000000000000000000000000000000000000..f0cb03a096d8a3f9c73a5f13f7b5066c93f4830f --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_force_arch_unknown.cpp @@ -0,0 +1,14 @@ +#ifndef GLM_FORCE_ARCH_UNKNOWN +# define GLM_FORCE_ARCH_UNKNOWN +#endif + +#include +#include + +int main() +{ + int Error = 0; + + return Error; +} + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_force_compiler_unknown.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_force_compiler_unknown.cpp new file mode 100644 index 0000000000000000000000000000000000000000..df58e4f1f1ecc1f32cdb73b5ea4278a6745d27a6 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_force_compiler_unknown.cpp @@ -0,0 +1,14 @@ +#ifndef GLM_FORCE_COMPILER_UNKNOWN +# define GLM_FORCE_COMPILER_UNKNOWN +#endif + +#include +#include + +int main() +{ + int Error = 0; + + return Error; +} + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_force_ctor_init.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_force_ctor_init.cpp new file mode 100644 index 0000000000000000000000000000000000000000..b2916be5244ca662e40a88efab403ca687378d4e --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_force_ctor_init.cpp @@ -0,0 +1,139 @@ +#define GLM_FORCE_CTOR_INIT + +#include +#include + +static int test_vec() +{ + int Error = 0; + + glm::vec1 V1; + Error += glm::all(glm::equal(V1, glm::vec1(0), glm::epsilon())) ? 0 : 1; + + glm::dvec1 U1; + Error += glm::all(glm::equal(U1, glm::dvec1(0), glm::epsilon())) ? 0 : 1; + + glm::vec2 V2; + Error += glm::all(glm::equal(V2, glm::vec2(0, 0), glm::epsilon())) ? 0 : 1; + + glm::dvec2 U2; + Error += glm::all(glm::equal(U2, glm::dvec2(0, 0), glm::epsilon())) ? 0 : 1; + + glm::vec3 V3; + Error += glm::all(glm::equal(V3, glm::vec3(0, 0, 0), glm::epsilon())) ? 0 : 1; + + glm::dvec3 U3; + Error += glm::all(glm::equal(U3, glm::dvec3(0, 0, 0), glm::epsilon())) ? 0 : 1; + + glm::vec4 V4; + Error += glm::all(glm::equal(V4, glm::vec4(0, 0, 0, 0), glm::epsilon())) ? 0 : 1; + + glm::dvec4 U4; + Error += glm::all(glm::equal(U4, glm::dvec4(0, 0, 0, 0), glm::epsilon())) ? 0 : 1; + + return Error; +} + +static int test_mat() +{ + int Error = 0; + + { + glm::mat2x2 F; + Error += glm::all(glm::equal(F, glm::mat2x2(1), glm::epsilon())) ? 0 : 1; + + glm::dmat2x2 D; + Error += glm::all(glm::equal(D, glm::dmat2x2(1), glm::epsilon())) ? 0 : 1; + } + + { + glm::mat2x3 F; + Error += glm::all(glm::equal(F, glm::mat2x3(1), glm::epsilon())) ? 0 : 1; + + glm::dmat2x3 D; + Error += glm::all(glm::equal(D, glm::dmat2x3(1), glm::epsilon())) ? 0 : 1; + } + + { + glm::mat2x4 F; + Error += glm::all(glm::equal(F, glm::mat2x4(1), glm::epsilon())) ? 0 : 1; + + glm::dmat2x4 D; + Error += glm::all(glm::equal(D, glm::dmat2x4(1), glm::epsilon())) ? 0 : 1; + } + + { + glm::mat3x2 F; + Error += glm::all(glm::equal(F, glm::mat3x2(1), glm::epsilon())) ? 0 : 1; + + glm::dmat3x2 D; + Error += glm::all(glm::equal(D, glm::dmat3x2(1), glm::epsilon())) ? 0 : 1; + } + + { + glm::mat3x3 F; + Error += glm::all(glm::equal(F, glm::mat3x3(1), glm::epsilon())) ? 0 : 1; + + glm::dmat3x3 D; + Error += glm::all(glm::equal(D, glm::dmat3x3(1), glm::epsilon())) ? 0 : 1; + } + + { + glm::mat3x4 F; + Error += glm::all(glm::equal(F, glm::mat3x4(1), glm::epsilon())) ? 0 : 1; + + glm::dmat3x4 D; + Error += glm::all(glm::equal(D, glm::dmat3x4(1), glm::epsilon())) ? 0 : 1; + } + + { + glm::mat4x2 F; + Error += glm::all(glm::equal(F, glm::mat4x2(1), glm::epsilon())) ? 0 : 1; + + glm::dmat4x2 D; + Error += glm::all(glm::equal(D, glm::dmat4x2(1), glm::epsilon())) ? 0 : 1; + } + + { + glm::mat4x3 F; + Error += glm::all(glm::equal(F, glm::mat4x3(1), glm::epsilon())) ? 0 : 1; + + glm::dmat4x3 D; + Error += glm::all(glm::equal(D, glm::dmat4x3(1), glm::epsilon())) ? 0 : 1; + } + + { + glm::mat4x4 F; + Error += glm::all(glm::equal(F, glm::mat4x4(1), glm::epsilon())) ? 0 : 1; + + glm::dmat4x4 D; + Error += glm::all(glm::equal(D, glm::dmat4x4(1), glm::epsilon())) ? 0 : 1; + } + + return Error; +} + +static int test_qua() +{ + int Error = 0; + + glm::quat F; + Error += glm::all(glm::equal(F, glm::quat(1, 0, 0, 0), glm::epsilon())) ? 0 : 1; + + glm::dquat D; + Error += glm::all(glm::equal(D, glm::dquat(1, 0, 0, 0), glm::epsilon())) ? 0 : 1; + + return Error; +} + +int main() +{ + int Error = 0; + + Error += test_vec(); + Error += test_mat(); + Error += test_qua(); + + return Error; +} + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_force_cxx03.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_force_cxx03.cpp new file mode 100644 index 0000000000000000000000000000000000000000..7c4dfe2cc251b16bafc56da81fc1cb4411bfa0c5 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_force_cxx03.cpp @@ -0,0 +1,14 @@ +#ifndef GLM_FORCE_CXX03 +# define GLM_FORCE_CXX03 +#endif + +#include +#include + +int main() +{ + int Error = 0; + + return Error; +} + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_force_cxx98.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_force_cxx98.cpp new file mode 100644 index 0000000000000000000000000000000000000000..31e1b37fbd4722446616987402f541bf305b100d --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_force_cxx98.cpp @@ -0,0 +1,14 @@ +#ifndef GLM_FORCE_CXX98 +# define GLM_FORCE_CXX98 +#endif + +#include +#include + +int main() +{ + int Error = 0; + + return Error; +} + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_force_cxx_unknown.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_force_cxx_unknown.cpp new file mode 100644 index 0000000000000000000000000000000000000000..c81678666af6089ab714cbdc1af76feeb7047186 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_force_cxx_unknown.cpp @@ -0,0 +1,14 @@ +#ifndef GLM_FORCE_CXX_UNKNOWN +# define GLM_FORCE_CXX_UNKNOWN +#endif + +#include +#include + +int main() +{ + int Error = 0; + + return Error; +} + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_force_depth_zero_to_one.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_force_depth_zero_to_one.cpp new file mode 100644 index 0000000000000000000000000000000000000000..cc0b4b0408f8fe52e56b8ae2a779019d647d7748 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_force_depth_zero_to_one.cpp @@ -0,0 +1,12 @@ +#define GLM_FORCE_DEPTH_ZERO_TO_ONE + +#include +#include + +int main() +{ + int Error = 0; + + return Error; +} + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_force_explicit_ctor.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_force_explicit_ctor.cpp new file mode 100644 index 0000000000000000000000000000000000000000..c1207d1222d8242acd2b1d1353d50c98a7248f3b --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_force_explicit_ctor.cpp @@ -0,0 +1,17 @@ +#define GLM_FORCE_EXPLICIT_CTOR + +#include +#include + +int main() +{ + int Error = 0; + + glm::ivec4 B(1); + Error += B == glm::ivec4(1) ? 0 : 1; + + //glm::vec4 A = B; + + return Error; +} + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_force_inline.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_force_inline.cpp new file mode 100644 index 0000000000000000000000000000000000000000..515b9920a5634a9a9bd9e21febb0547d10462f9c --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_force_inline.cpp @@ -0,0 +1,12 @@ +#define GLM_FORCE_INLINE + +#include +#include + +int main() +{ + int Error = 0; + + return Error; +} + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_force_left_handed.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_force_left_handed.cpp new file mode 100644 index 0000000000000000000000000000000000000000..43161eb2fbbe7b1baac4dd2dc756a50ddfe45f4a --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_force_left_handed.cpp @@ -0,0 +1,12 @@ +#define GLM_FORCE_LEFT_HANDED + +#include +#include + +int main() +{ + int Error = 0; + + return Error; +} + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_force_platform_unknown.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_force_platform_unknown.cpp new file mode 100644 index 0000000000000000000000000000000000000000..876106ef30ffff58a8a910fdd2b5dfc32df730a7 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_force_platform_unknown.cpp @@ -0,0 +1,14 @@ +#ifndef GLM_FORCE_PLATFORM_UNKNOWN +# define GLM_FORCE_PLATFORM_UNKNOWN +#endif + +#include +#include + +int main() +{ + int Error = 0; + + return Error; +} + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_force_pure.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_force_pure.cpp new file mode 100644 index 0000000000000000000000000000000000000000..1ae4296e029cda430945f7f75f9848e750807e8a --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_force_pure.cpp @@ -0,0 +1,434 @@ +#ifndef GLM_FORCE_PURE +# define GLM_FORCE_PURE +#endif//GLM_FORCE_PURE +#define GLM_FORCE_DEFAULT_ALIGNED_GENTYPES +#define GLM_FORCE_SWIZZLE +#include +#include +#include +#include +#include +#include +#include + +static int test_vec4_ctor() +{ + int Error = 0; + + { + glm::ivec4 A(1, 2, 3, 4); + glm::ivec4 B(A); + Error += glm::all(glm::equal(A, B)) ? 0 : 1; + } + +# if GLM_HAS_TRIVIAL_QUERIES + // Error += std::is_trivially_default_constructible::value ? 0 : 1; + // Error += std::is_trivially_copy_assignable::value ? 0 : 1; + Error += std::is_trivially_copyable::value ? 0 : 1; + Error += std::is_trivially_copyable::value ? 0 : 1; + Error += std::is_trivially_copyable::value ? 0 : 1; + Error += std::is_trivially_copyable::value ? 0 : 1; + + Error += std::is_copy_constructible::value ? 0 : 1; +# endif + +#if GLM_HAS_INITIALIZER_LISTS + { + glm::vec4 a{ 0, 1, 2, 3 }; + std::vector v = { + {0, 1, 2, 3}, + {4, 5, 6, 7}, + {8, 9, 0, 1}}; + } + + { + glm::dvec4 a{ 0, 1, 2, 3 }; + std::vector v = { + {0, 1, 2, 3}, + {4, 5, 6, 7}, + {8, 9, 0, 1}}; + } +#endif + +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR + { + glm::ivec4 A = glm::vec4(1.0f, 2.0f, 3.0f, 4.0f); + glm::ivec4 B = A.xyzw; + glm::ivec4 C(A.xyzw); + glm::ivec4 D(A.xyzw()); + glm::ivec4 E(A.x, A.yzw); + glm::ivec4 F(A.x, A.yzw()); + glm::ivec4 G(A.xyz, A.w); + glm::ivec4 H(A.xyz(), A.w); + glm::ivec4 I(A.xy, A.zw); + glm::ivec4 J(A.xy(), A.zw()); + glm::ivec4 K(A.x, A.y, A.zw); + glm::ivec4 L(A.x, A.yz, A.w); + glm::ivec4 M(A.xy, A.z, A.w); + + Error += glm::all(glm::equal(A, B)) ? 0 : 1; + Error += glm::all(glm::equal(A, C)) ? 0 : 1; + Error += glm::all(glm::equal(A, D)) ? 0 : 1; + Error += glm::all(glm::equal(A, E)) ? 0 : 1; + Error += glm::all(glm::equal(A, F)) ? 0 : 1; + Error += glm::all(glm::equal(A, G)) ? 0 : 1; + Error += glm::all(glm::equal(A, H)) ? 0 : 1; + Error += glm::all(glm::equal(A, I)) ? 0 : 1; + Error += glm::all(glm::equal(A, J)) ? 0 : 1; + Error += glm::all(glm::equal(A, K)) ? 0 : 1; + Error += glm::all(glm::equal(A, L)) ? 0 : 1; + Error += glm::all(glm::equal(A, M)) ? 0 : 1; + } +# endif + +# if GLM_CONFIG_SWIZZLE + { + glm::ivec4 A = glm::vec4(1.0f, 2.0f, 3.0f, 4.0f); + glm::ivec4 B = A.xyzw(); + glm::ivec4 C(A.xyzw()); + glm::ivec4 D(A.xyzw()); + glm::ivec4 E(A.x, A.yzw()); + glm::ivec4 F(A.x, A.yzw()); + glm::ivec4 G(A.xyz(), A.w); + glm::ivec4 H(A.xyz(), A.w); + glm::ivec4 I(A.xy(), A.zw()); + glm::ivec4 J(A.xy(), A.zw()); + glm::ivec4 K(A.x, A.y, A.zw()); + glm::ivec4 L(A.x, A.yz(), A.w); + glm::ivec4 M(A.xy(), A.z, A.w); + + Error += glm::all(glm::equal(A, B)) ? 0 : 1; + Error += glm::all(glm::equal(A, C)) ? 0 : 1; + Error += glm::all(glm::equal(A, D)) ? 0 : 1; + Error += glm::all(glm::equal(A, E)) ? 0 : 1; + Error += glm::all(glm::equal(A, F)) ? 0 : 1; + Error += glm::all(glm::equal(A, G)) ? 0 : 1; + Error += glm::all(glm::equal(A, H)) ? 0 : 1; + Error += glm::all(glm::equal(A, I)) ? 0 : 1; + Error += glm::all(glm::equal(A, J)) ? 0 : 1; + Error += glm::all(glm::equal(A, K)) ? 0 : 1; + Error += glm::all(glm::equal(A, L)) ? 0 : 1; + Error += glm::all(glm::equal(A, M)) ? 0 : 1; + } +# endif//GLM_CONFIG_SWIZZLE + + { + glm::ivec4 A(1); + glm::ivec4 B(1, 1, 1, 1); + + Error += A == B ? 0 : 1; + } + + { + std::vector Tests; + Tests.push_back(glm::ivec4(glm::ivec2(1, 2), 3, 4)); + Tests.push_back(glm::ivec4(1, glm::ivec2(2, 3), 4)); + Tests.push_back(glm::ivec4(1, 2, glm::ivec2(3, 4))); + Tests.push_back(glm::ivec4(glm::ivec3(1, 2, 3), 4)); + Tests.push_back(glm::ivec4(1, glm::ivec3(2, 3, 4))); + Tests.push_back(glm::ivec4(glm::ivec2(1, 2), glm::ivec2(3, 4))); + Tests.push_back(glm::ivec4(1, 2, 3, 4)); + Tests.push_back(glm::ivec4(glm::ivec4(1, 2, 3, 4))); + + for(std::size_t i = 0; i < Tests.size(); ++i) + Error += Tests[i] == glm::ivec4(1, 2, 3, 4) ? 0 : 1; + } + + return Error; +} + +static int test_bvec4_ctor() +{ + int Error = 0; + + glm::bvec4 const A(true); + glm::bvec4 const B(true); + glm::bvec4 const C(false); + glm::bvec4 const D = A && B; + glm::bvec4 const E = A && C; + glm::bvec4 const F = A || C; + + Error += D == glm::bvec4(true) ? 0 : 1; + Error += E == glm::bvec4(false) ? 0 : 1; + Error += F == glm::bvec4(true) ? 0 : 1; + + bool const G = A == C; + bool const H = A != C; + + Error += !G ? 0 : 1; + Error += H ? 0 : 1; + + return Error; +} + +static int test_vec4_operators() +{ + int Error = 0; + + { + glm::ivec4 A(1); + glm::ivec4 B(1); + bool R = A != B; + bool S = A == B; + + Error += (S && !R) ? 0 : 1; + } + + { + glm::vec4 const A(1.0f, 2.0f, 3.0f, 4.0f); + glm::vec4 const B(4.0f, 5.0f, 6.0f, 7.0f); + + glm::vec4 const C = A + B; + Error += glm::all(glm::equal(C, glm::vec4(5, 7, 9, 11), 0.001f)) ? 0 : 1; + + glm::vec4 D = B - A; + Error += glm::all(glm::equal(D, glm::vec4(3, 3, 3, 3), 0.001f)) ? 0 : 1; + + glm::vec4 E = A * B; + Error += glm::all(glm::equal(E, glm::vec4(4, 10, 18, 28), 0.001f)) ? 0 : 1; + + glm::vec4 F = B / A; + Error += glm::all(glm::equal(F, glm::vec4(4, 2.5, 2, 7.0f / 4.0f), 0.001f)) ? 0 : 1; + + glm::vec4 G = A + 1.0f; + Error += glm::all(glm::equal(G, glm::vec4(2, 3, 4, 5), 0.001f)) ? 0 : 1; + + glm::vec4 H = B - 1.0f; + Error += glm::all(glm::equal(H, glm::vec4(3, 4, 5, 6), 0.001f)) ? 0 : 1; + + glm::vec4 I = A * 2.0f; + Error += glm::all(glm::equal(I, glm::vec4(2, 4, 6, 8), 0.001f)) ? 0 : 1; + + glm::vec4 J = B / 2.0f; + Error += glm::all(glm::equal(J, glm::vec4(2, 2.5, 3, 3.5), 0.001f)) ? 0 : 1; + + glm::vec4 K = 1.0f + A; + Error += glm::all(glm::equal(K, glm::vec4(2, 3, 4, 5), 0.001f)) ? 0 : 1; + + glm::vec4 L = 1.0f - B; + Error += glm::all(glm::equal(L, glm::vec4(-3, -4, -5, -6), 0.001f)) ? 0 : 1; + + glm::vec4 M = 2.0f * A; + Error += glm::all(glm::equal(M, glm::vec4(2, 4, 6, 8), 0.001f)) ? 0 : 1; + + glm::vec4 const N = 2.0f / B; + Error += glm::all(glm::equal(N, glm::vec4(0.5, 2.0 / 5.0, 2.0 / 6.0, 2.0 / 7.0), 0.0001f)) ? 0 : 1; + } + + { + glm::ivec4 A(1.0f, 2.0f, 3.0f, 4.0f); + glm::ivec4 B(4.0f, 5.0f, 6.0f, 7.0f); + + A += B; + Error += A == glm::ivec4(5, 7, 9, 11) ? 0 : 1; + + A += 1; + Error += A == glm::ivec4(6, 8, 10, 12) ? 0 : 1; + } + { + glm::ivec4 A(1.0f, 2.0f, 3.0f, 4.0f); + glm::ivec4 B(4.0f, 5.0f, 6.0f, 7.0f); + + B -= A; + Error += B == glm::ivec4(3, 3, 3, 3) ? 0 : 1; + + B -= 1; + Error += B == glm::ivec4(2, 2, 2, 2) ? 0 : 1; + } + { + glm::ivec4 A(1.0f, 2.0f, 3.0f, 4.0f); + glm::ivec4 B(4.0f, 5.0f, 6.0f, 7.0f); + + A *= B; + Error += A == glm::ivec4(4, 10, 18, 28) ? 0 : 1; + + A *= 2; + Error += A == glm::ivec4(8, 20, 36, 56) ? 0 : 1; + } + { + glm::ivec4 A(1.0f, 2.0f, 3.0f, 4.0f); + glm::ivec4 B(4.0f, 4.0f, 6.0f, 8.0f); + + B /= A; + Error += B == glm::ivec4(4, 2, 2, 2) ? 0 : 1; + + B /= 2; + Error += B == glm::ivec4(2, 1, 1, 1) ? 0 : 1; + } + { + glm::ivec4 B(2); + + B /= B.y; + Error += B == glm::ivec4(1) ? 0 : 1; + } + + { + glm::ivec4 A(1.0f, 2.0f, 3.0f, 4.0f); + glm::ivec4 B = -A; + Error += B == glm::ivec4(-1.0f, -2.0f, -3.0f, -4.0f) ? 0 : 1; + } + + { + glm::ivec4 A(1.0f, 2.0f, 3.0f, 4.0f); + glm::ivec4 B = --A; + Error += B == glm::ivec4(0.0f, 1.0f, 2.0f, 3.0f) ? 0 : 1; + } + + { + glm::ivec4 A(1.0f, 2.0f, 3.0f, 4.0f); + glm::ivec4 B = A--; + Error += B == glm::ivec4(1.0f, 2.0f, 3.0f, 4.0f) ? 0 : 1; + Error += A == glm::ivec4(0.0f, 1.0f, 2.0f, 3.0f) ? 0 : 1; + } + + { + glm::ivec4 A(1.0f, 2.0f, 3.0f, 4.0f); + glm::ivec4 B = ++A; + Error += B == glm::ivec4(2.0f, 3.0f, 4.0f, 5.0f) ? 0 : 1; + } + + { + glm::ivec4 A(1.0f, 2.0f, 3.0f, 4.0f); + glm::ivec4 B = A++; + Error += B == glm::ivec4(1.0f, 2.0f, 3.0f, 4.0f) ? 0 : 1; + Error += A == glm::ivec4(2.0f, 3.0f, 4.0f, 5.0f) ? 0 : 1; + } + + return Error; +} + +static int test_vec4_equal() +{ + int Error = 0; + + { + glm::uvec4 const A(1, 2, 3, 4); + glm::uvec4 const B(1, 2, 3, 4); + Error += A == B ? 0 : 1; + Error += A != B ? 1 : 0; + } + + { + glm::ivec4 const A(1, 2, 3, 4); + glm::ivec4 const B(1, 2, 3, 4); + Error += A == B ? 0 : 1; + Error += A != B ? 1 : 0; + } + + return Error; +} + +static int test_vec4_size() +{ + int Error = 0; + + Error += sizeof(glm::vec4) == sizeof(glm::lowp_vec4) ? 0 : 1; + Error += sizeof(glm::vec4) == sizeof(glm::mediump_vec4) ? 0 : 1; + Error += sizeof(glm::vec4) == sizeof(glm::highp_vec4) ? 0 : 1; + Error += 16 == sizeof(glm::mediump_vec4) ? 0 : 1; + Error += sizeof(glm::dvec4) == sizeof(glm::lowp_dvec4) ? 0 : 1; + Error += sizeof(glm::dvec4) == sizeof(glm::mediump_dvec4) ? 0 : 1; + Error += sizeof(glm::dvec4) == sizeof(glm::highp_dvec4) ? 0 : 1; + Error += 32 == sizeof(glm::highp_dvec4) ? 0 : 1; + Error += glm::vec4().length() == 4 ? 0 : 1; + Error += glm::dvec4().length() == 4 ? 0 : 1; + + return Error; +} + +static int test_vec4_swizzle_partial() +{ + int Error = 0; + +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR + + glm::ivec4 A(1, 2, 3, 4); + + { + glm::ivec4 B(A.xy, A.zw); + Error += A == B ? 0 : 1; + } + { + glm::ivec4 B(A.xy, 3, 4); + Error += A == B ? 0 : 1; + } + { + glm::ivec4 B(1, A.yz, 4); + Error += A == B ? 0 : 1; + } + { + glm::ivec4 B(1, 2, A.zw); + Error += A == B ? 0 : 1; + } + + { + glm::ivec4 B(A.xyz, 4); + Error += A == B ? 0 : 1; + } + { + glm::ivec4 B(1, A.yzw); + Error += A == B ? 0 : 1; + } +# endif + + return Error; +} + +static int test_operator_increment() +{ + int Error(0); + + glm::ivec4 v0(1); + glm::ivec4 v1(v0); + glm::ivec4 v2(v0); + glm::ivec4 v3 = ++v1; + glm::ivec4 v4 = v2++; + + Error += glm::all(glm::equal(v0, v4)) ? 0 : 1; + Error += glm::all(glm::equal(v1, v2)) ? 0 : 1; + Error += glm::all(glm::equal(v1, v3)) ? 0 : 1; + + int i0(1); + int i1(i0); + int i2(i0); + int i3 = ++i1; + int i4 = i2++; + + Error += i0 == i4 ? 0 : 1; + Error += i1 == i2 ? 0 : 1; + Error += i1 == i3 ? 0 : 1; + + return Error; +} + +static int test_vec4_simd() +{ + int Error = 0; + + glm::vec4 const a(std::clock(), std::clock(), std::clock(), std::clock()); + glm::vec4 const b(std::clock(), std::clock(), std::clock(), std::clock()); + + glm::vec4 const c(b * a); + glm::vec4 const d(a + c); + + Error += glm::all(glm::greaterThanEqual(d, glm::vec4(0))) ? 0 : 1; + + return Error; +} + +int main() +{ + int Error = 0; + + Error += test_vec4_ctor(); + Error += test_bvec4_ctor(); + Error += test_vec4_size(); + Error += test_vec4_operators(); + Error += test_vec4_equal(); + Error += test_vec4_swizzle_partial(); + Error += test_vec4_simd(); + Error += test_operator_increment(); + + return Error; +} + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_force_quat_xyzw.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_force_quat_xyzw.cpp new file mode 100644 index 0000000000000000000000000000000000000000..c150924927071753ab71bdba5b8e4c154aa85d43 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_force_quat_xyzw.cpp @@ -0,0 +1,13 @@ +#define GLM_FORCE_QUAT_DATA_XYZW +#define GLM_FORCE_INLINE + +#include +#include + +int main() +{ + int Error = 0; + + return Error; +} + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_force_size_t_length.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_force_size_t_length.cpp new file mode 100644 index 0000000000000000000000000000000000000000..b6a02cb3265deac52df90ae83b026f0ea8ea3223 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_force_size_t_length.cpp @@ -0,0 +1,12 @@ +#define GLM_FORCE_SIZE_T_LENGTH + +#include +#include + +int main() +{ + int Error = 0; + + return Error; +} + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_force_unrestricted_gentype.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_force_unrestricted_gentype.cpp new file mode 100644 index 0000000000000000000000000000000000000000..2c3d8aa9b49eea8b2742caa488ebbc2b317951f7 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_force_unrestricted_gentype.cpp @@ -0,0 +1,12 @@ +#define GLM_FORCE_UNRESTRICTED_GENTYPE + +#include +#include + +int main() +{ + int Error = 0; + + return Error; +} + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_force_xyzw_only.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_force_xyzw_only.cpp new file mode 100644 index 0000000000000000000000000000000000000000..6b2571fc97b69f5c5f2b4faf9af67dcb80796b91 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_force_xyzw_only.cpp @@ -0,0 +1,58 @@ +#define GLM_FORCE_XYZW_ONLY + +#include +#include +#include +#include +#include +#include + +static int test_comp() +{ + int Error = 0; + + { + glm::ivec1 const A(1); + Error += A.x == 1 ? 0 : 1; + } + + { + glm::ivec2 const A(1, 2); + Error += A.x == 1 ? 0 : 1; + Error += A.y == 2 ? 0 : 1; + } + + { + glm::ivec3 const A(1, 2, 3); + Error += A.x == 1 ? 0 : 1; + Error += A.y == 2 ? 0 : 1; + Error += A.z == 3 ? 0 : 1; + } + + { + glm::ivec4 const A(1, 2, 3, 4); + Error += A.x == 1 ? 0 : 1; + Error += A.y == 2 ? 0 : 1; + Error += A.z == 3 ? 0 : 1; + Error += A.w == 4 ? 0 : 1; + } + + return Error; +} + +static int test_constexpr() +{ + int Error = 0; + + return Error; +} + +int main() +{ + int Error = 0; + + Error += test_comp(); + Error += test_constexpr(); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_func_common.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_func_common.cpp new file mode 100644 index 0000000000000000000000000000000000000000..3aef0f42412ea58d41490860df5710bd28682833 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_func_common.cpp @@ -0,0 +1,1349 @@ +#define GLM_FORCE_EXPLICIT_CTOR +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// This file has divisions by zero to test isnan +#if GLM_COMPILER & GLM_COMPILER_VC +# pragma warning(disable : 4723) +#endif + +namespace floor_ +{ + static int test() + { + int Error = 0; + + { + float A = 1.1f; + float B = glm::floor(A); + Error += glm::equal(B, 1.f, 0.0001f) ? 0 : 1; + } + + { + double A = 1.1; + double B = glm::floor(A); + Error += glm::equal(B, 1.0, 0.0001) ? 0 : 1; + } + + { + glm::vec1 A(1.1f); + glm::vec1 B = glm::floor(A); + + Error += glm::all(glm::equal(B, glm::vec1(1.0), 0.0001f)) ? 0 : 1; + } + + { + glm::dvec1 A(1.1); + glm::dvec1 B = glm::floor(A); + + Error += glm::all(glm::equal(B, glm::dvec1(1.0), 0.0001)) ? 0 : 1; + } + + { + glm::vec2 A(1.1f); + glm::vec2 B = glm::floor(A); + + Error += glm::all(glm::equal(B, glm::vec2(1.0), 0.0001f)) ? 0 : 1; + } + + { + glm::dvec2 A(1.1); + glm::dvec2 B = glm::floor(A); + + Error += glm::all(glm::equal(B, glm::dvec2(1.0), 0.0001)) ? 0 : 1; + } + + { + glm::vec3 A(1.1f); + glm::vec3 B = glm::floor(A); + + Error += glm::all(glm::equal(B, glm::vec3(1.0), 0.0001f)) ? 0 : 1; + } + + { + glm::dvec3 A(1.1); + glm::dvec3 B = glm::floor(A); + + Error += glm::all(glm::equal(B, glm::dvec3(1.0), 0.0001)) ? 0 : 1; + } + + { + glm::vec4 A(1.1f); + glm::vec4 B = glm::floor(A); + + Error += glm::all(glm::equal(B, glm::vec4(1.0), 0.0001f)) ? 0 : 1; + } + + { + glm::dvec4 A(1.1); + glm::dvec4 B = glm::floor(A); + + Error += glm::all(glm::equal(B, glm::dvec4(1.0), 0.0001)) ? 0 : 1; + } + + return Error; + } +}//namespace floor + +namespace modf_ +{ + static int test() + { + int Error(0); + + { + float X(1.5f); + float I(0.0f); + float A = glm::modf(X, I); + + Error += glm::equal(I, 1.0f, 0.0001f) ? 0 : 1; + Error += glm::equal(A, 0.5f, 0.0001f) ? 0 : 1; + } + + { + glm::vec4 X(1.1f, 1.2f, 1.5f, 1.7f); + glm::vec4 I(0.0f); + glm::vec4 A = glm::modf(X, I); + + Error += glm::ivec4(I) == glm::ivec4(1) ? 0 : 1; + Error += glm::all(glm::equal(A, glm::vec4(0.1f, 0.2f, 0.5f, 0.7f), 0.00001f)) ? 0 : 1; + } + + { + glm::dvec4 X(1.1, 1.2, 1.5, 1.7); + glm::dvec4 I(0.0); + glm::dvec4 A = glm::modf(X, I); + + Error += glm::ivec4(I) == glm::ivec4(1) ? 0 : 1; + Error += glm::all(glm::equal(A, glm::dvec4(0.1, 0.2, 0.5, 0.7), 0.000000001)) ? 0 : 1; + } + + { + double X(1.5); + double I(0.0); + double A = glm::modf(X, I); + + Error += glm::equal(I, 1.0, 0.0001) ? 0 : 1; + Error += glm::equal(A, 0.5, 0.0001) ? 0 : 1; + } + + return Error; + } +}//namespace modf + +namespace mod_ +{ + static int test() + { + int Error(0); + + { + float A(1.5f); + float B(1.0f); + float C = glm::mod(A, B); + + Error += glm::equal(C, 0.5f, 0.00001f) ? 0 : 1; + } + + { + float A(-0.2f); + float B(1.0f); + float C = glm::mod(A, B); + + Error += glm::equal(C, 0.8f, 0.00001f) ? 0 : 1; + } + + { + float A(3.0); + float B(2.0f); + float C = glm::mod(A, B); + + Error += glm::equal(C, 1.0f, 0.00001f) ? 0 : 1; + } + + { + glm::vec4 A(3.0); + float B(2.0f); + glm::vec4 C = glm::mod(A, B); + + Error += glm::all(glm::equal(C, glm::vec4(1.0f), 0.00001f)) ? 0 : 1; + } + + { + glm::vec4 A(3.0); + glm::vec4 B(2.0f); + glm::vec4 C = glm::mod(A, B); + + Error += glm::all(glm::equal(C, glm::vec4(1.0f), 0.00001f)) ? 0 : 1; + } + + return Error; + } +}//namespace mod_ + +namespace floatBitsToInt +{ + static int test() + { + int Error = 0; + + { + float A = 1.0f; + int B = glm::floatBitsToInt(A); + float C = glm::intBitsToFloat(B); + Error += glm::equal(A, C, 0.0001f) ? 0 : 1; + } + + { + glm::vec2 A(1.0f, 2.0f); + glm::ivec2 B = glm::floatBitsToInt(A); + glm::vec2 C = glm::intBitsToFloat(B); + Error += glm::all(glm::equal(A, C, 0.0001f)) ? 0 : 1; + } + + { + glm::vec3 A(1.0f, 2.0f, 3.0f); + glm::ivec3 B = glm::floatBitsToInt(A); + glm::vec3 C = glm::intBitsToFloat(B); + Error += glm::all(glm::equal(A, C, 0.0001f)) ? 0 : 1; + } + + { + glm::vec4 A(1.0f, 2.0f, 3.0f, 4.0f); + glm::ivec4 B = glm::floatBitsToInt(A); + glm::vec4 C = glm::intBitsToFloat(B); + Error += glm::all(glm::equal(A, C, 0.0001f)) ? 0 : 1; + } + + return Error; + } +}//namespace floatBitsToInt + +namespace floatBitsToUint +{ + static int test() + { + int Error = 0; + + { + float A = 1.0f; + glm::uint B = glm::floatBitsToUint(A); + float C = glm::uintBitsToFloat(B); + Error += glm::equal(A, C, 0.0001f) ? 0 : 1; + } + + { + glm::vec2 A(1.0f, 2.0f); + glm::uvec2 B = glm::floatBitsToUint(A); + glm::vec2 C = glm::uintBitsToFloat(B); + Error += glm::all(glm::equal(A, C, 0.0001f)) ? 0 : 1; + } + + { + glm::vec3 A(1.0f, 2.0f, 3.0f); + glm::uvec3 B = glm::floatBitsToUint(A); + glm::vec3 C = glm::uintBitsToFloat(B); + Error += glm::all(glm::equal(A, C, 0.0001f)) ? 0 : 1; + } + + { + glm::vec4 A(1.0f, 2.0f, 3.0f, 4.0f); + glm::uvec4 B = glm::floatBitsToUint(A); + glm::vec4 C = glm::uintBitsToFloat(B); + Error += glm::all(glm::equal(A, C, 0.0001f)) ? 0 : 1; + } + + return Error; + } +}//namespace floatBitsToUint + +namespace min_ +{ + static int test() + { + int Error = 0; + + glm::vec1 A0 = glm::min(glm::vec1(1), glm::vec1(1)); + bool A1 = glm::all(glm::equal(A0, glm::vec1(1), glm::epsilon())); + Error += A1 ? 0 : 1; + + glm::vec2 B0 = glm::min(glm::vec2(1), glm::vec2(1)); + glm::vec2 B1 = glm::min(glm::vec2(1), 1.0f); + bool B2 = glm::all(glm::equal(B0, B1, glm::epsilon())); + Error += B2 ? 0 : 1; + + glm::vec3 C0 = glm::min(glm::vec3(1), glm::vec3(1)); + glm::vec3 C1 = glm::min(glm::vec3(1), 1.0f); + bool C2 = glm::all(glm::equal(C0, C1, glm::epsilon())); + Error += C2 ? 0 : 1; + + glm::vec4 D0 = glm::min(glm::vec4(1), glm::vec4(1)); + glm::vec4 D1 = glm::min(glm::vec4(1), 1.0f); + bool D2 = glm::all(glm::equal(D0, D1, glm::epsilon())); + Error += D2 ? 0 : 1; + + return Error; + } + + int min_tern(int a, int b) + { + return a < b ? a : b; + } + + int min_int(int x, int y) + { + return y ^ ((x ^ y) & -(x < y)); + } + + static int perf(std::size_t Count) + { + std::vector A(Count); + std::vector B(Count); + + std::size_t const InternalCount = 200000; + + for(std::size_t i = 0; i < Count; ++i) + { + A[i] = glm::linearRand(-1000, 1000); + B[i] = glm::linearRand(-1000, 1000); + } + + int Error = 0; + + glm::int32 SumA = 0; + { + std::clock_t Timestamp0 = std::clock(); + + for (std::size_t j = 0; j < InternalCount; ++j) + for (std::size_t i = 0; i < Count; ++i) + SumA += min_tern(A[i], B[i]); + + std::clock_t Timestamp1 = std::clock(); + + std::printf("min_tern Time %d clocks\n", static_cast(Timestamp1 - Timestamp0)); + } + + glm::int32 SumB = 0; + { + std::clock_t Timestamp0 = std::clock(); + + for (std::size_t j = 0; j < InternalCount; ++j) + for (std::size_t i = 0; i < Count; ++i) + SumB += min_int(A[i], B[i]); + + std::clock_t Timestamp1 = std::clock(); + + std::printf("min_int Time %d clocks\n", static_cast(Timestamp1 - Timestamp0)); + } + + Error += SumA == SumB ? 0 : 1; + + return Error; + } +}//namespace min_ + +namespace max_ +{ + static int test() + { + int Error = 0; + + glm::vec1 A0 = glm::max(glm::vec1(1), glm::vec1(1)); + bool A1 = glm::all(glm::equal(A0, glm::vec1(1), glm::epsilon())); + Error += A1 ? 0 : 1; + + + glm::vec2 B0 = glm::max(glm::vec2(1), glm::vec2(1)); + glm::vec2 B1 = glm::max(glm::vec2(1), 1.0f); + bool B2 = glm::all(glm::equal(B0, B1, glm::epsilon())); + Error += B2 ? 0 : 1; + + glm::vec3 C0 = glm::max(glm::vec3(1), glm::vec3(1)); + glm::vec3 C1 = glm::max(glm::vec3(1), 1.0f); + bool C2 = glm::all(glm::equal(C0, C1, glm::epsilon())); + Error += C2 ? 0 : 1; + + glm::vec4 D0 = glm::max(glm::vec4(1), glm::vec4(1)); + glm::vec4 D1 = glm::max(glm::vec4(1), 1.0f); + bool D2 = glm::all(glm::equal(D0, D1, glm::epsilon())); + Error += D2 ? 0 : 1; + + return Error; + } +}//namespace max_ + +namespace clamp_ +{ + static int test() + { + int Error = 0; + + return Error; + } +}//namespace clamp_ + +namespace mix_ +{ + template + struct entry + { + T x; + T y; + B a; + T Result; + }; + + entry const TestBool[] = + { + {0.0f, 1.0f, false, 0.0f}, + {0.0f, 1.0f, true, 1.0f}, + {-1.0f, 1.0f, false, -1.0f}, + {-1.0f, 1.0f, true, 1.0f} + }; + + entry const TestFloat[] = + { + {0.0f, 1.0f, 0.0f, 0.0f}, + {0.0f, 1.0f, 1.0f, 1.0f}, + {-1.0f, 1.0f, 0.0f, -1.0f}, + {-1.0f, 1.0f, 1.0f, 1.0f} + }; + + entry const TestVec2Bool[] = + { + {glm::vec2(0.0f), glm::vec2(1.0f), false, glm::vec2(0.0f)}, + {glm::vec2(0.0f), glm::vec2(1.0f), true, glm::vec2(1.0f)}, + {glm::vec2(-1.0f), glm::vec2(1.0f), false, glm::vec2(-1.0f)}, + {glm::vec2(-1.0f), glm::vec2(1.0f), true, glm::vec2(1.0f)} + }; + + entry const TestBVec2[] = + { + {glm::vec2(0.0f), glm::vec2(1.0f), glm::bvec2(false), glm::vec2(0.0f)}, + {glm::vec2(0.0f), glm::vec2(1.0f), glm::bvec2(true), glm::vec2(1.0f)}, + {glm::vec2(-1.0f), glm::vec2(1.0f), glm::bvec2(false), glm::vec2(-1.0f)}, + {glm::vec2(-1.0f), glm::vec2(1.0f), glm::bvec2(true), glm::vec2(1.0f)}, + {glm::vec2(-1.0f), glm::vec2(1.0f), glm::bvec2(true, false), glm::vec2(1.0f, -1.0f)} + }; + + entry const TestVec3Bool[] = + { + {glm::vec3(0.0f), glm::vec3(1.0f), false, glm::vec3(0.0f)}, + {glm::vec3(0.0f), glm::vec3(1.0f), true, glm::vec3(1.0f)}, + {glm::vec3(-1.0f), glm::vec3(1.0f), false, glm::vec3(-1.0f)}, + {glm::vec3(-1.0f), glm::vec3(1.0f), true, glm::vec3(1.0f)} + }; + + entry const TestBVec3[] = + { + {glm::vec3(0.0f), glm::vec3(1.0f), glm::bvec3(false), glm::vec3(0.0f)}, + {glm::vec3(0.0f), glm::vec3(1.0f), glm::bvec3(true), glm::vec3(1.0f)}, + {glm::vec3(-1.0f), glm::vec3(1.0f), glm::bvec3(false), glm::vec3(-1.0f)}, + {glm::vec3(-1.0f), glm::vec3(1.0f), glm::bvec3(true), glm::vec3(1.0f)}, + {glm::vec3(1.0f, 2.0f, 3.0f), glm::vec3(4.0f, 5.0f, 6.0f), glm::bvec3(true, false, true), glm::vec3(4.0f, 2.0f, 6.0f)} + }; + + entry const TestVec4Bool[] = + { + {glm::vec4(0.0f), glm::vec4(1.0f), false, glm::vec4(0.0f)}, + {glm::vec4(0.0f), glm::vec4(1.0f), true, glm::vec4(1.0f)}, + {glm::vec4(-1.0f), glm::vec4(1.0f), false, glm::vec4(-1.0f)}, + {glm::vec4(-1.0f), glm::vec4(1.0f), true, glm::vec4(1.0f)} + }; + + entry const TestBVec4[] = + { + {glm::vec4(0.0f, 0.0f, 1.0f, 1.0f), glm::vec4(2.0f, 2.0f, 3.0f, 3.0f), glm::bvec4(false, true, false, true), glm::vec4(0.0f, 2.0f, 1.0f, 3.0f)}, + {glm::vec4(0.0f), glm::vec4(1.0f), glm::bvec4(true), glm::vec4(1.0f)}, + {glm::vec4(-1.0f), glm::vec4(1.0f), glm::bvec4(false), glm::vec4(-1.0f)}, + {glm::vec4(-1.0f), glm::vec4(1.0f), glm::bvec4(true), glm::vec4(1.0f)}, + {glm::vec4(1.0f, 2.0f, 3.0f, 4.0f), glm::vec4(5.0f, 6.0f, 7.0f, 8.0f), glm::bvec4(true, false, true, false), glm::vec4(5.0f, 2.0f, 7.0f, 4.0f)} + }; + + static int test() + { + int Error = 0; + + // Float with bool + { + for(std::size_t i = 0; i < sizeof(TestBool) / sizeof(entry); ++i) + { + float Result = glm::mix(TestBool[i].x, TestBool[i].y, TestBool[i].a); + Error += glm::equal(Result, TestBool[i].Result, glm::epsilon()) ? 0 : 1; + } + } + + // Float with float + { + for(std::size_t i = 0; i < sizeof(TestFloat) / sizeof(entry); ++i) + { + float Result = glm::mix(TestFloat[i].x, TestFloat[i].y, TestFloat[i].a); + Error += glm::equal(Result, TestFloat[i].Result, glm::epsilon()) ? 0 : 1; + } + } + + // vec2 with bool + { + for(std::size_t i = 0; i < sizeof(TestVec2Bool) / sizeof(entry); ++i) + { + glm::vec2 Result = glm::mix(TestVec2Bool[i].x, TestVec2Bool[i].y, TestVec2Bool[i].a); + Error += glm::equal(Result.x, TestVec2Bool[i].Result.x, glm::epsilon()) ? 0 : 1; + Error += glm::equal(Result.y, TestVec2Bool[i].Result.y, glm::epsilon()) ? 0 : 1; + } + } + + // vec2 with bvec2 + { + for(std::size_t i = 0; i < sizeof(TestBVec2) / sizeof(entry); ++i) + { + glm::vec2 Result = glm::mix(TestBVec2[i].x, TestBVec2[i].y, TestBVec2[i].a); + Error += glm::equal(Result.x, TestBVec2[i].Result.x, glm::epsilon()) ? 0 : 1; + Error += glm::equal(Result.y, TestBVec2[i].Result.y, glm::epsilon()) ? 0 : 1; + } + } + + // vec3 with bool + { + for(std::size_t i = 0; i < sizeof(TestVec3Bool) / sizeof(entry); ++i) + { + glm::vec3 Result = glm::mix(TestVec3Bool[i].x, TestVec3Bool[i].y, TestVec3Bool[i].a); + Error += glm::equal(Result.x, TestVec3Bool[i].Result.x, glm::epsilon()) ? 0 : 1; + Error += glm::equal(Result.y, TestVec3Bool[i].Result.y, glm::epsilon()) ? 0 : 1; + Error += glm::equal(Result.z, TestVec3Bool[i].Result.z, glm::epsilon()) ? 0 : 1; + } + } + + // vec3 with bvec3 + { + for(std::size_t i = 0; i < sizeof(TestBVec3) / sizeof(entry); ++i) + { + glm::vec3 Result = glm::mix(TestBVec3[i].x, TestBVec3[i].y, TestBVec3[i].a); + Error += glm::equal(Result.x, TestBVec3[i].Result.x, glm::epsilon()) ? 0 : 1; + Error += glm::equal(Result.y, TestBVec3[i].Result.y, glm::epsilon()) ? 0 : 1; + Error += glm::equal(Result.z, TestBVec3[i].Result.z, glm::epsilon()) ? 0 : 1; + } + } + + // vec4 with bool + { + for(std::size_t i = 0; i < sizeof(TestVec4Bool) / sizeof(entry); ++i) + { + glm::vec4 Result = glm::mix(TestVec4Bool[i].x, TestVec4Bool[i].y, TestVec4Bool[i].a); + Error += glm::equal(Result.x, TestVec4Bool[i].Result.x, glm::epsilon()) ? 0 : 1; + Error += glm::equal(Result.y, TestVec4Bool[i].Result.y, glm::epsilon()) ? 0 : 1; + Error += glm::equal(Result.z, TestVec4Bool[i].Result.z, glm::epsilon()) ? 0 : 1; + Error += glm::equal(Result.w, TestVec4Bool[i].Result.w, glm::epsilon()) ? 0 : 1; + } + } + + // vec4 with bvec4 + { + for(std::size_t i = 0; i < sizeof(TestBVec4) / sizeof(entry); ++i) + { + glm::vec4 Result = glm::mix(TestBVec4[i].x, TestBVec4[i].y, TestBVec4[i].a); + Error += glm::equal(Result.x, TestBVec4[i].Result.x, glm::epsilon()) ? 0 : 1; + Error += glm::equal(Result.y, TestBVec4[i].Result.y, glm::epsilon()) ? 0 : 1; + Error += glm::equal(Result.z, TestBVec4[i].Result.z, glm::epsilon()) ? 0 : 1; + Error += glm::equal(Result.w, TestBVec4[i].Result.w, glm::epsilon()) ? 0 : 1; + } + } + + return Error; + } +}//namespace mix_ + +namespace step_ +{ + template + struct entry + { + EDGE edge; + VEC x; + VEC result; + }; + + entry TestVec4Scalar [] = + { + { 1.0f, glm::vec4(1.0f, 2.0f, 3.0f, 4.0f), glm::vec4(1.0f) }, + { 0.0f, glm::vec4(1.0f, 2.0f, 3.0f, 4.0f), glm::vec4(1.0f) }, + { 0.0f, glm::vec4(-1.0f, -2.0f, -3.0f, -4.0f), glm::vec4(0.0f) } + }; + + entry TestVec4Vector [] = + { + { glm::vec4(-1.0f, -2.0f, -3.0f, -4.0f), glm::vec4(-2.0f, -3.0f, -4.0f, -5.0f), glm::vec4(0.0f) }, + { glm::vec4( 0.0f, 1.0f, 2.0f, 3.0f), glm::vec4( 1.0f, 2.0f, 3.0f, 4.0f), glm::vec4(1.0f) }, + { glm::vec4( 2.0f, 3.0f, 4.0f, 5.0f), glm::vec4( 1.0f, 2.0f, 3.0f, 4.0f), glm::vec4(0.0f) }, + { glm::vec4( 0.0f, 1.0f, 2.0f, 3.0f), glm::vec4(-1.0f,-2.0f,-3.0f,-4.0f), glm::vec4(0.0f) } + }; + + static int test() + { + int Error = 0; + + // scalar + { + float const Edge = 2.0f; + + float const A = glm::step(Edge, 1.0f); + Error += glm::equal(A, 0.0f, glm::epsilon()) ? 0 : 1; + + float const B = glm::step(Edge, 3.0f); + Error += glm::equal(B, 1.0f, glm::epsilon()) ? 0 : 1; + + float const C = glm::step(Edge, 2.0f); + Error += glm::equal(C, 1.0f, glm::epsilon()) ? 0 : 1; + } + + // vec4 and float + { + for (std::size_t i = 0; i < sizeof(TestVec4Scalar) / sizeof(entry); ++i) + { + glm::vec4 Result = glm::step(TestVec4Scalar[i].edge, TestVec4Scalar[i].x); + Error += glm::all(glm::equal(Result, TestVec4Scalar[i].result, glm::epsilon())) ? 0 : 1; + } + } + + // vec4 and vec4 + { + for (std::size_t i = 0; i < sizeof(TestVec4Vector) / sizeof(entry); ++i) + { + glm::vec4 Result = glm::step(TestVec4Vector[i].edge, TestVec4Vector[i].x); + Error += glm::all(glm::equal(Result, TestVec4Vector[i].result, glm::epsilon())) ? 0 : 1; + } + } + + return Error; + } +}//namespace step_ + +namespace round_ +{ + static int test() + { + int Error = 0; + + { + float A = glm::round(0.0f); + Error += glm::equal(A, 0.0f, glm::epsilon()) ? 0 : 1; + float B = glm::round(0.5f); + Error += (glm::equal(B, 1.0f, glm::epsilon()) || glm::equal(B, 0.0f, glm::epsilon())) ? 0 : 1; + float C = glm::round(1.0f); + Error += glm::equal(C, 1.0f, glm::epsilon()) ? 0 : 1; + float D = glm::round(0.1f); + Error += glm::equal(D, 0.0f, glm::epsilon()) ? 0 : 1; + float E = glm::round(0.9f); + Error += glm::equal(E, 1.0f, glm::epsilon()) ? 0 : 1; + float F = glm::round(1.5f); + Error += glm::equal(F, 2.0f, glm::epsilon()) ? 0 : 1; + float G = glm::round(1.9f); + Error += glm::equal(G, 2.0f, glm::epsilon()) ? 0 : 1; + } + + { + float A = glm::round(-0.0f); + Error += glm::equal(A, 0.0f, glm::epsilon()) ? 0 : 1; + float B = glm::round(-0.5f); + Error += (glm::equal(B, -1.0f, glm::epsilon()) || glm::equal(B, 0.0f, glm::epsilon())) ? 0 : 1; + float C = glm::round(-1.0f); + Error += glm::equal(C, -1.0f, glm::epsilon()) ? 0 : 1; + float D = glm::round(-0.1f); + Error += glm::equal(D, 0.0f, glm::epsilon()) ? 0 : 1; + float E = glm::round(-0.9f); + Error += glm::equal(E, -1.0f, glm::epsilon()) ? 0 : 1; + float F = glm::round(-1.5f); + Error += glm::equal(F, -2.0f, glm::epsilon()) ? 0 : 1; + float G = glm::round(-1.9f); + Error += glm::equal(G, -2.0f, glm::epsilon()) ? 0 : 1; + } + + return Error; + } +}//namespace round_ + +namespace roundEven +{ + static int test() + { + int Error = 0; + + { + float A1 = glm::roundEven(-1.5f); + Error += glm::equal(A1, -2.0f, 0.0001f) ? 0 : 1; + + float A2 = glm::roundEven(1.5f); + Error += glm::equal(A2, 2.0f, 0.0001f) ? 0 : 1; + + float A5 = glm::roundEven(-2.5f); + Error += glm::equal(A5, -2.0f, 0.0001f) ? 0 : 1; + + float A6 = glm::roundEven(2.5f); + Error += glm::equal(A6, 2.0f, 0.0001f) ? 0 : 1; + + float A3 = glm::roundEven(-3.5f); + Error += glm::equal(A3, -4.0f, 0.0001f) ? 0 : 1; + + float A4 = glm::roundEven(3.5f); + Error += glm::equal(A4, 4.0f, 0.0001f) ? 0 : 1; + + float C7 = glm::roundEven(-4.5f); + Error += glm::equal(C7, -4.0f, 0.0001f) ? 0 : 1; + + float C8 = glm::roundEven(4.5f); + Error += glm::equal(C8, 4.0f, 0.0001f) ? 0 : 1; + + float C1 = glm::roundEven(-5.5f); + Error += glm::equal(C1, -6.0f, 0.0001f) ? 0 : 1; + + float C2 = glm::roundEven(5.5f); + Error += glm::equal(C2, 6.0f, 0.0001f) ? 0 : 1; + + float C3 = glm::roundEven(-6.5f); + Error += glm::equal(C3, -6.0f, 0.0001f) ? 0 : 1; + + float C4 = glm::roundEven(6.5f); + Error += glm::equal(C4, 6.0f, 0.0001f) ? 0 : 1; + + float C5 = glm::roundEven(-7.5f); + Error += glm::equal(C5, -8.0f, 0.0001f) ? 0 : 1; + + float C6 = glm::roundEven(7.5f); + Error += glm::equal(C6, 8.0f, 0.0001f) ? 0 : 1; + + Error += 0; + } + + { + float A7 = glm::roundEven(-2.4f); + Error += glm::equal(A7, -2.0f, 0.0001f) ? 0 : 1; + + float A8 = glm::roundEven(2.4f); + Error += glm::equal(A8, 2.0f, 0.0001f) ? 0 : 1; + + float B1 = glm::roundEven(-2.6f); + Error += glm::equal(B1, -3.0f, 0.0001f) ? 0 : 1; + + float B2 = glm::roundEven(2.6f); + Error += glm::equal(B2, 3.0f, 0.0001f) ? 0 : 1; + + float B3 = glm::roundEven(-2.0f); + Error += glm::equal(B3, -2.0f, 0.0001f) ? 0 : 1; + + float B4 = glm::roundEven(2.0f); + Error += glm::equal(B4, 2.0f, 0.0001f) ? 0 : 1; + + Error += 0; + } + + { + float A = glm::roundEven(0.0f); + Error += glm::equal(A, 0.0f, glm::epsilon()) ? 0 : 1; + float B = glm::roundEven(0.5f); + Error += glm::equal(B, 0.0f, glm::epsilon()) ? 0 : 1; + float C = glm::roundEven(1.0f); + Error += glm::equal(C, 1.0f, glm::epsilon()) ? 0 : 1; + float D = glm::roundEven(0.1f); + Error += glm::equal(D, 0.0f, glm::epsilon()) ? 0 : 1; + float E = glm::roundEven(0.9f); + Error += glm::equal(E, 1.0f, glm::epsilon()) ? 0 : 1; + float F = glm::roundEven(1.5f); + Error += glm::equal(F, 2.0f, glm::epsilon()) ? 0 : 1; + float G = glm::roundEven(1.9f); + Error += glm::equal(G, 2.0f, glm::epsilon()) ? 0 : 1; + } + + { + float A = glm::roundEven(-0.0f); + Error += glm::equal(A, 0.0f, glm::epsilon()) ? 0 : 1; + float B = glm::roundEven(-0.5f); + Error += glm::equal(B, -0.0f, glm::epsilon()) ? 0 : 1; + float C = glm::roundEven(-1.0f); + Error += glm::equal(C, -1.0f, glm::epsilon()) ? 0 : 1; + float D = glm::roundEven(-0.1f); + Error += glm::equal(D, 0.0f, glm::epsilon()) ? 0 : 1; + float E = glm::roundEven(-0.9f); + Error += glm::equal(E, -1.0f, glm::epsilon()) ? 0 : 1; + float F = glm::roundEven(-1.5f); + Error += glm::equal(F, -2.0f, glm::epsilon()) ? 0 : 1; + float G = glm::roundEven(-1.9f); + Error += glm::equal(G, -2.0f, glm::epsilon()) ? 0 : 1; + } + + { + float A = glm::roundEven(1.5f); + Error += glm::equal(A, 2.0f, glm::epsilon()) ? 0 : 1; + float B = glm::roundEven(2.5f); + Error += glm::equal(B, 2.0f, glm::epsilon()) ? 0 : 1; + float C = glm::roundEven(3.5f); + Error += glm::equal(C, 4.0f, glm::epsilon()) ? 0 : 1; + float D = glm::roundEven(4.5f); + Error += glm::equal(D, 4.0f, glm::epsilon()) ? 0 : 1; + float E = glm::roundEven(5.5f); + Error += glm::equal(E, 6.0f, glm::epsilon()) ? 0 : 1; + float F = glm::roundEven(6.5f); + Error += glm::equal(F, 6.0f, glm::epsilon()) ? 0 : 1; + float G = glm::roundEven(7.5f); + Error += glm::equal(G, 8.0f, glm::epsilon()) ? 0 : 1; + } + + { + float A = glm::roundEven(-1.5f); + Error += glm::equal(A, -2.0f, glm::epsilon()) ? 0 : 1; + float B = glm::roundEven(-2.5f); + Error += glm::equal(B, -2.0f, glm::epsilon()) ? 0 : 1; + float C = glm::roundEven(-3.5f); + Error += glm::equal(C, -4.0f, glm::epsilon()) ? 0 : 1; + float D = glm::roundEven(-4.5f); + Error += glm::equal(D, -4.0f, glm::epsilon()) ? 0 : 1; + float E = glm::roundEven(-5.5f); + Error += glm::equal(E, -6.0f, glm::epsilon()) ? 0 : 1; + float F = glm::roundEven(-6.5f); + Error += glm::equal(F, -6.0f, glm::epsilon()) ? 0 : 1; + float G = glm::roundEven(-7.5f); + Error += glm::equal(G, -8.0f, glm::epsilon()) ? 0 : 1; + } + + return Error; + } +}//namespace roundEven + +namespace isnan_ +{ + static int test() + { + int Error = 0; + + float Zero_f = 0.0; + double Zero_d = 0.0; + + { + Error += true == glm::isnan(0.0/Zero_d) ? 0 : 1; + Error += true == glm::any(glm::isnan(glm::dvec2(0.0 / Zero_d))) ? 0 : 1; + Error += true == glm::any(glm::isnan(glm::dvec3(0.0 / Zero_d))) ? 0 : 1; + Error += true == glm::any(glm::isnan(glm::dvec4(0.0 / Zero_d))) ? 0 : 1; + } + + { + Error += true == glm::isnan(0.0f/Zero_f) ? 0 : 1; + Error += true == glm::any(glm::isnan(glm::vec2(0.0f/Zero_f))) ? 0 : 1; + Error += true == glm::any(glm::isnan(glm::vec3(0.0f/Zero_f))) ? 0 : 1; + Error += true == glm::any(glm::isnan(glm::vec4(0.0f/Zero_f))) ? 0 : 1; + } + + return Error; + } +}//namespace isnan_ + +namespace isinf_ +{ + static int test() + { + int Error = 0; + + float Zero_f = 0.0; + double Zero_d = 0.0; + + { + Error += true == glm::isinf( 1.0/Zero_d) ? 0 : 1; + Error += true == glm::isinf(-1.0/Zero_d) ? 0 : 1; + Error += true == glm::any(glm::isinf(glm::dvec2( 1.0/Zero_d))) ? 0 : 1; + Error += true == glm::any(glm::isinf(glm::dvec2(-1.0/Zero_d))) ? 0 : 1; + Error += true == glm::any(glm::isinf(glm::dvec3( 1.0/Zero_d))) ? 0 : 1; + Error += true == glm::any(glm::isinf(glm::dvec3(-1.0/Zero_d))) ? 0 : 1; + Error += true == glm::any(glm::isinf(glm::dvec4( 1.0/Zero_d))) ? 0 : 1; + Error += true == glm::any(glm::isinf(glm::dvec4(-1.0/Zero_d))) ? 0 : 1; + } + + { + Error += true == glm::isinf( 1.0f/Zero_f) ? 0 : 1; + Error += true == glm::isinf(-1.0f/Zero_f) ? 0 : 1; + Error += true == glm::any(glm::isinf(glm::vec2( 1.0f/Zero_f))) ? 0 : 1; + Error += true == glm::any(glm::isinf(glm::vec2(-1.0f/Zero_f))) ? 0 : 1; + Error += true == glm::any(glm::isinf(glm::vec3( 1.0f/Zero_f))) ? 0 : 1; + Error += true == glm::any(glm::isinf(glm::vec3(-1.0f/Zero_f))) ? 0 : 1; + Error += true == glm::any(glm::isinf(glm::vec4( 1.0f/Zero_f))) ? 0 : 1; + Error += true == glm::any(glm::isinf(glm::vec4(-1.0f/Zero_f))) ? 0 : 1; + } + + return Error; + } +}//namespace isinf_ + +namespace sign +{ + template + GLM_FUNC_QUALIFIER genFIType sign_if(genFIType x) + { + GLM_STATIC_ASSERT( + std::numeric_limits::is_iec559 || + (std::numeric_limits::is_signed && std::numeric_limits::is_integer), "'sign' only accept signed inputs"); + + genFIType result; + if(x > genFIType(0)) + result = genFIType(1); + else if(x < genFIType(0)) + result = genFIType(-1); + else + result = genFIType(0); + return result; + } + + template + GLM_FUNC_QUALIFIER genFIType sign_alu1(genFIType x) + { + GLM_STATIC_ASSERT( + std::numeric_limits::is_signed && std::numeric_limits::is_integer, + "'sign' only accept integer inputs"); + + return (x >> 31) | (static_cast(-x) >> 31); + } + + GLM_FUNC_QUALIFIER int sign_alu2(int x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_signed && std::numeric_limits::is_integer, "'sign' only accept integer inputs"); + +# if GLM_COMPILER & GLM_COMPILER_VC +# pragma warning(push) +# pragma warning(disable : 4146) //cast truncates constant value +# endif + + return -(static_cast(x) >> 31) | (-static_cast(x) >> 31); + +# if GLM_COMPILER & GLM_COMPILER_VC +# pragma warning(pop) +# endif + } + + template + GLM_FUNC_QUALIFIER genFIType sign_sub(genFIType x) + { + GLM_STATIC_ASSERT( + std::numeric_limits::is_signed && std::numeric_limits::is_integer, + "'sign' only accept integer inputs"); + + return (static_cast(-x) >> 31) - (static_cast(x) >> 31); + } + + template + GLM_FUNC_QUALIFIER genFIType sign_cmp(genFIType x) + { + GLM_STATIC_ASSERT( + std::numeric_limits::is_signed && std::numeric_limits::is_integer, + "'sign' only accept integer inputs"); + + return (x > 0) - (x < 0); + } + + template + struct type + { + genType Value; + genType Return; + }; + + int test_int32() + { + type const Data[] = + { + { std::numeric_limits::max(), 1}, + { std::numeric_limits::min(), -1}, + { 0, 0}, + { 1, 1}, + { 2, 1}, + { 3, 1}, + {-1,-1}, + {-2,-1}, + {-3,-1} + }; + + int Error = 0; + + for(std::size_t i = 0; i < sizeof(Data) / sizeof(type); ++i) + { + glm::int32 Result = glm::sign(Data[i].Value); + Error += Data[i].Return == Result ? 0 : 1; + } + + for(std::size_t i = 0; i < sizeof(Data) / sizeof(type); ++i) + { + glm::int32 Result = sign_cmp(Data[i].Value); + Error += Data[i].Return == Result ? 0 : 1; + } + + for(std::size_t i = 0; i < sizeof(Data) / sizeof(type); ++i) + { + glm::int32 Result = sign_if(Data[i].Value); + Error += Data[i].Return == Result ? 0 : 1; + } + + for(std::size_t i = 0; i < sizeof(Data) / sizeof(type); ++i) + { + glm::int32 Result = sign_alu1(Data[i].Value); + Error += Data[i].Return == Result ? 0 : 1; + } + + for(std::size_t i = 0; i < sizeof(Data) / sizeof(type); ++i) + { + glm::int32 Result = sign_alu2(Data[i].Value); + Error += Data[i].Return == Result ? 0 : 1; + } + + return Error; + } + + int test_i32vec4() + { + type const Data[] = + { + {glm::ivec4( 1), glm::ivec4( 1)}, + {glm::ivec4( 0), glm::ivec4( 0)}, + {glm::ivec4( 2), glm::ivec4( 1)}, + {glm::ivec4( 3), glm::ivec4( 1)}, + {glm::ivec4(-1), glm::ivec4(-1)}, + {glm::ivec4(-2), glm::ivec4(-1)}, + {glm::ivec4(-3), glm::ivec4(-1)} + }; + + int Error = 0; + + for(std::size_t i = 0; i < sizeof(Data) / sizeof(type); ++i) + { + glm::ivec4 Result = glm::sign(Data[i].Value); + Error += glm::all(glm::equal(Data[i].Return, Result)) ? 0 : 1; + } + + return Error; + } + + int test_f32vec4() + { + type const Data[] = + { + {glm::vec4( 1), glm::vec4( 1)}, + {glm::vec4( 0), glm::vec4( 0)}, + {glm::vec4( 2), glm::vec4( 1)}, + {glm::vec4( 3), glm::vec4( 1)}, + {glm::vec4(-1), glm::vec4(-1)}, + {glm::vec4(-2), glm::vec4(-1)}, + {glm::vec4(-3), glm::vec4(-1)} + }; + + int Error = 0; + + for(std::size_t i = 0; i < sizeof(Data) / sizeof(type); ++i) + { + glm::vec4 Result = glm::sign(Data[i].Value); + Error += glm::all(glm::equal(Data[i].Return, Result, glm::epsilon())) ? 0 : 1; + } + + return Error; + } + + static int test() + { + int Error = 0; + + Error += test_int32(); + Error += test_i32vec4(); + Error += test_f32vec4(); + + return Error; + } + + int perf_rand(std::size_t Samples) + { + int Error = 0; + + std::size_t const Count = Samples; + std::vector Input, Output; + Input.resize(Count); + Output.resize(Count); + for(std::size_t i = 0; i < Count; ++i) + Input[i] = static_cast(glm::linearRand(-65536.f, 65536.f)); + + std::clock_t Timestamp0 = std::clock(); + + for(std::size_t i = 0; i < Count; ++i) + Output[i] = sign_cmp(Input[i]); + + std::clock_t Timestamp1 = std::clock(); + + for(std::size_t i = 0; i < Count; ++i) + Output[i] = sign_if(Input[i]); + + std::clock_t Timestamp2 = std::clock(); + + for(std::size_t i = 0; i < Count; ++i) + Output[i] = sign_alu1(Input[i]); + + std::clock_t Timestamp3 = std::clock(); + + for(std::size_t i = 0; i < Count; ++i) + Output[i] = sign_alu2(Input[i]); + + std::clock_t Timestamp4 = std::clock(); + + for(std::size_t i = 0; i < Count; ++i) + Output[i] = sign_sub(Input[i]); + + std::clock_t Timestamp5 = std::clock(); + + for(std::size_t i = 0; i < Count; ++i) + Output[i] = glm::sign(Input[i]); + + std::clock_t Timestamp6 = std::clock(); + + std::printf("sign_cmp(rand) Time %d clocks\n", static_cast(Timestamp1 - Timestamp0)); + std::printf("sign_if(rand) Time %d clocks\n", static_cast(Timestamp2 - Timestamp1)); + std::printf("sign_alu1(rand) Time %d clocks\n", static_cast(Timestamp3 - Timestamp2)); + std::printf("sign_alu2(rand) Time %d clocks\n", static_cast(Timestamp4 - Timestamp3)); + std::printf("sign_sub(rand) Time %d clocks\n", static_cast(Timestamp5 - Timestamp4)); + std::printf("glm::sign(rand) Time %d clocks\n", static_cast(Timestamp6 - Timestamp5)); + + return Error; + } + + int perf_linear(std::size_t Samples) + { + int Error = 0; + + std::size_t const Count = Samples; + std::vector Input, Output; + Input.resize(Count); + Output.resize(Count); + for(std::size_t i = 0; i < Count; ++i) + Input[i] = static_cast(i); + + std::clock_t Timestamp0 = std::clock(); + + for(std::size_t i = 0; i < Count; ++i) + Output[i] = sign_cmp(Input[i]); + + std::clock_t Timestamp1 = std::clock(); + + for(std::size_t i = 0; i < Count; ++i) + Output[i] = sign_if(Input[i]); + + std::clock_t Timestamp2 = std::clock(); + + for(std::size_t i = 0; i < Count; ++i) + Output[i] = sign_alu1(Input[i]); + + std::clock_t Timestamp3 = std::clock(); + + for(std::size_t i = 0; i < Count; ++i) + Output[i] = sign_alu2(Input[i]); + + std::clock_t Timestamp4 = std::clock(); + + for(std::size_t i = 0; i < Count; ++i) + Output[i] = sign_sub(Input[i]); + + std::clock_t Timestamp5 = std::clock(); + + std::printf("sign_cmp(linear) Time %d clocks\n", static_cast(Timestamp1 - Timestamp0)); + std::printf("sign_if(linear) Time %d clocks\n", static_cast(Timestamp2 - Timestamp1)); + std::printf("sign_alu1(linear) Time %d clocks\n", static_cast(Timestamp3 - Timestamp2)); + std::printf("sign_alu2(linear) Time %d clocks\n", static_cast(Timestamp4 - Timestamp3)); + std::printf("sign_sub(linear) Time %d clocks\n", static_cast(Timestamp5 - Timestamp4)); + + return Error; + } + + int perf_linear_cal(std::size_t Samples) + { + int Error = 0; + + glm::int32 const Count = static_cast(Samples); + + std::clock_t Timestamp0 = std::clock(); + glm::int32 Sum = 0; + + for(glm::int32 i = 1; i < Count; ++i) + Sum += sign_cmp(i); + + std::clock_t Timestamp1 = std::clock(); + + for(glm::int32 i = 1; i < Count; ++i) + Sum += sign_if(i); + + std::clock_t Timestamp2 = std::clock(); + + for(glm::int32 i = 1; i < Count; ++i) + Sum += sign_alu1(i); + + std::clock_t Timestamp3 = std::clock(); + + for(glm::int32 i = 1; i < Count; ++i) + Sum += sign_alu2(i); + + std::clock_t Timestamp4 = std::clock(); + + for(glm::int32 i = 1; i < Count; ++i) + Sum += sign_sub(i); + + std::clock_t Timestamp5 = std::clock(); + + std::printf("Sum %d\n", static_cast(Sum)); + + std::printf("sign_cmp(linear_cal) Time %d clocks\n", static_cast(Timestamp1 - Timestamp0)); + std::printf("sign_if(linear_cal) Time %d clocks\n", static_cast(Timestamp2 - Timestamp1)); + std::printf("sign_alu1(linear_cal) Time %d clocks\n", static_cast(Timestamp3 - Timestamp2)); + std::printf("sign_alu2(linear_cal) Time %d clocks\n", static_cast(Timestamp4 - Timestamp3)); + std::printf("sign_sub(linear_cal) Time %d clocks\n", static_cast(Timestamp5 - Timestamp4)); + + return Error; + } + + static int perf(std::size_t Samples) + { + int Error(0); + + Error += perf_linear_cal(Samples); + Error += perf_linear(Samples); + Error += perf_rand(Samples); + + return Error; + } +}//namespace sign + +namespace frexp_ +{ + static int test() + { + int Error = 0; + + { + glm::vec1 const x(1024); + glm::ivec1 exp; + glm::vec1 A = glm::frexp(x, exp); + Error += glm::all(glm::equal(A, glm::vec1(0.5), glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(exp, glm::ivec1(11))) ? 0 : 1; + } + + { + glm::vec2 const x(1024, 0.24); + glm::ivec2 exp; + glm::vec2 A = glm::frexp(x, exp); + Error += glm::all(glm::equal(A, glm::vec2(0.5, 0.96), glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(exp, glm::ivec2(11, -2))) ? 0 : 1; + } + + { + glm::vec3 const x(1024, 0.24, 0); + glm::ivec3 exp; + glm::vec3 A = glm::frexp(x, exp); + Error += glm::all(glm::equal(A, glm::vec3(0.5, 0.96, 0.0), glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(exp, glm::ivec3(11, -2, 0))) ? 0 : 1; + } + + { + glm::vec4 const x(1024, 0.24, 0, -1.33); + glm::ivec4 exp; + glm::vec4 A = glm::frexp(x, exp); + Error += glm::all(glm::equal(A, glm::vec4(0.5, 0.96, 0.0, -0.665), glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(exp, glm::ivec4(11, -2, 0, 1))) ? 0 : 1; + } + + return Error; + } +}//namespace frexp_ + +namespace ldexp_ +{ + static int test() + { + int Error(0); + + { + glm::vec1 A = glm::vec1(0.5); + glm::ivec1 exp = glm::ivec1(11); + glm::vec1 x = glm::ldexp(A, exp); + Error += glm::all(glm::equal(x, glm::vec1(1024),0.00001f)) ? 0 : 1; + } + + { + glm::vec2 A = glm::vec2(0.5, 0.96); + glm::ivec2 exp = glm::ivec2(11, -2); + glm::vec2 x = glm::ldexp(A, exp); + Error += glm::all(glm::equal(x, glm::vec2(1024, .24),0.00001f)) ? 0 : 1; + } + + { + glm::vec3 A = glm::vec3(0.5, 0.96, 0.0); + glm::ivec3 exp = glm::ivec3(11, -2, 0); + glm::vec3 x = glm::ldexp(A, exp); + Error += glm::all(glm::equal(x, glm::vec3(1024, .24, 0),0.00001f)) ? 0 : 1; + } + + { + glm::vec4 A = glm::vec4(0.5, 0.96, 0.0, -0.665); + glm::ivec4 exp = glm::ivec4(11, -2, 0, 1); + glm::vec4 x = glm::ldexp(A, exp); + Error += glm::all(glm::equal(x, glm::vec4(1024, .24, 0, -1.33),0.00001f)) ? 0 : 1; + } + + return Error; + } +}//namespace ldexp_ + +static int test_constexpr() +{ +#if GLM_HAS_CONSTEXPR + static_assert(glm::abs(1.0f) > 0.0f, "GLM: Failed constexpr"); + constexpr glm::vec1 const A = glm::abs(glm::vec1(1.0f)); + constexpr glm::vec2 const B = glm::abs(glm::vec2(1.0f)); + constexpr glm::vec3 const C = glm::abs(glm::vec3(1.0f)); + constexpr glm::vec4 const D = glm::abs(glm::vec4(1.0f)); +#endif // GLM_HAS_CONSTEXPR + + return 0; +} + +int main() +{ + int Error = 0; + + Error += test_constexpr(); + Error += sign::test(); + Error += floor_::test(); + Error += mod_::test(); + Error += modf_::test(); + Error += floatBitsToInt::test(); + Error += floatBitsToUint::test(); + Error += mix_::test(); + Error += step_::test(); + Error += max_::test(); + Error += min_::test(); + Error += clamp_::test(); + Error += round_::test(); + Error += roundEven::test(); + Error += isnan_::test(); + Error += isinf_::test(); + Error += frexp_::test(); + Error += ldexp_::test(); + +# ifdef NDEBUG + std::size_t Samples = 1000; +# else + std::size_t Samples = 1; +# endif + Error += sign::perf(Samples); + + Error += min_::perf(Samples); + + return Error; +} + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_func_exponential.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_func_exponential.cpp new file mode 100644 index 0000000000000000000000000000000000000000..11410118e1f60523782564d410a9769c15799d3c --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_func_exponential.cpp @@ -0,0 +1,185 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static int test_pow() +{ + int Error(0); + + float A = glm::pow(2.f, 2.f); + Error += glm::equal(A, 4.f, 0.01f) ? 0 : 1; + + glm::vec1 B = glm::pow(glm::vec1(2.f), glm::vec1(2.f)); + Error += glm::all(glm::equal(B, glm::vec1(4.f), 0.01f)) ? 0 : 1; + + glm::vec2 C = glm::pow(glm::vec2(2.f), glm::vec2(2.f)); + Error += glm::all(glm::equal(C, glm::vec2(4.f), 0.01f)) ? 0 : 1; + + glm::vec3 D = glm::pow(glm::vec3(2.f), glm::vec3(2.f)); + Error += glm::all(glm::equal(D, glm::vec3(4.f), 0.01f)) ? 0 : 1; + + glm::vec4 E = glm::pow(glm::vec4(2.f), glm::vec4(2.f)); + Error += glm::all(glm::equal(E, glm::vec4(4.f), 0.01f)) ? 0 : 1; + + return Error; +} + +static int test_sqrt() +{ + int Error = 0; + + float A = glm::sqrt(4.f); + Error += glm::equal(A, 2.f, 0.01f) ? 0 : 1; + + glm::vec1 B = glm::sqrt(glm::vec1(4.f)); + Error += glm::all(glm::equal(B, glm::vec1(2.f), 0.01f)) ? 0 : 1; + + glm::vec2 C = glm::sqrt(glm::vec2(4.f)); + Error += glm::all(glm::equal(C, glm::vec2(2.f), 0.01f)) ? 0 : 1; + + glm::vec3 D = glm::sqrt(glm::vec3(4.f)); + Error += glm::all(glm::equal(D, glm::vec3(2.f), 0.01f)) ? 0 : 1; + + glm::vec4 E = glm::sqrt(glm::vec4(4.f)); + Error += glm::all(glm::equal(E, glm::vec4(2.f), 0.01f)) ? 0 : 1; + + return Error; +} + +static int test_exp() +{ + int Error = 0; + + float A = glm::exp(1.f); + Error += glm::equal(A, glm::e(), 0.01f) ? 0 : 1; + + glm::vec1 B = glm::exp(glm::vec1(1.f)); + Error += glm::all(glm::equal(B, glm::vec1(glm::e()), 0.01f)) ? 0 : 1; + + glm::vec2 C = glm::exp(glm::vec2(1.f)); + Error += glm::all(glm::equal(C, glm::vec2(glm::e()), 0.01f)) ? 0 : 1; + + glm::vec3 D = glm::exp(glm::vec3(1.f)); + Error += glm::all(glm::equal(D, glm::vec3(glm::e()), 0.01f)) ? 0 : 1; + + glm::vec4 E = glm::exp(glm::vec4(1.f)); + Error += glm::all(glm::equal(E, glm::vec4(glm::e()), 0.01f)) ? 0 : 1; + + return Error; +} + +static int test_log() +{ + int Error = 0; + + float const A = glm::log(glm::e()); + Error += glm::equal(A, 1.f, 0.01f) ? 0 : 1; + + glm::vec1 const B = glm::log(glm::vec1(glm::e())); + Error += glm::all(glm::equal(B, glm::vec1(1.f), 0.01f)) ? 0 : 1; + + glm::vec2 const C = glm::log(glm::vec2(glm::e())); + Error += glm::all(glm::equal(C, glm::vec2(1.f), 0.01f)) ? 0 : 1; + + glm::vec3 const D = glm::log(glm::vec3(glm::e())); + Error += glm::all(glm::equal(D, glm::vec3(1.f), 0.01f)) ? 0 : 1; + + glm::vec4 const E = glm::log(glm::vec4(glm::e())); + Error += glm::all(glm::equal(E, glm::vec4(1.f), 0.01f)) ? 0 : 1; + + return Error; +} + +static int test_exp2() +{ + int Error = 0; + + float A = glm::exp2(4.f); + Error += glm::equal(A, 16.f, 0.01f) ? 0 : 1; + + glm::vec1 B = glm::exp2(glm::vec1(4.f)); + Error += glm::all(glm::equal(B, glm::vec1(16.f), 0.01f)) ? 0 : 1; + + glm::vec2 C = glm::exp2(glm::vec2(4.f, 3.f)); + Error += glm::all(glm::equal(C, glm::vec2(16.f, 8.f), 0.01f)) ? 0 : 1; + + glm::vec3 D = glm::exp2(glm::vec3(4.f, 3.f, 2.f)); + Error += glm::all(glm::equal(D, glm::vec3(16.f, 8.f, 4.f), 0.01f)) ? 0 : 1; + + glm::vec4 E = glm::exp2(glm::vec4(4.f, 3.f, 2.f, 1.f)); + Error += glm::all(glm::equal(E, glm::vec4(16.f, 8.f, 4.f, 2.f), 0.01f)) ? 0 : 1; + +# if GLM_HAS_CXX11_STL + //large exponent + float F = glm::exp2(23.f); + Error += glm::equal(F, 8388608.f, 0.01f) ? 0 : 1; +# endif + + return Error; +} + +static int test_log2() +{ + int Error = 0; + + float A = glm::log2(16.f); + Error += glm::equal(A, 4.f, 0.01f) ? 0 : 1; + + glm::vec1 B = glm::log2(glm::vec1(16.f)); + Error += glm::all(glm::equal(B, glm::vec1(4.f), 0.01f)) ? 0 : 1; + + glm::vec2 C = glm::log2(glm::vec2(16.f, 8.f)); + Error += glm::all(glm::equal(C, glm::vec2(4.f, 3.f), 0.01f)) ? 0 : 1; + + glm::vec3 D = glm::log2(glm::vec3(16.f, 8.f, 4.f)); + Error += glm::all(glm::equal(D, glm::vec3(4.f, 3.f, 2.f), 0.01f)) ? 0 : 1; + + glm::vec4 E = glm::log2(glm::vec4(16.f, 8.f, 4.f, 2.f)); + Error += glm::all(glm::equal(E, glm::vec4(4.f, 3.f, 2.f, 1.f), 0.01f)) ? 0 : 1; + + return Error; +} + +static int test_inversesqrt() +{ + int Error = 0; + + float A = glm::inversesqrt(16.f) * glm::sqrt(16.f); + Error += glm::equal(A, 1.f, 0.01f) ? 0 : 1; + + glm::vec1 B = glm::inversesqrt(glm::vec1(16.f)) * glm::sqrt(16.f); + Error += glm::all(glm::equal(B, glm::vec1(1.f), 0.01f)) ? 0 : 1; + + glm::vec2 C = glm::inversesqrt(glm::vec2(16.f)) * glm::sqrt(16.f); + Error += glm::all(glm::equal(C, glm::vec2(1.f), 0.01f)) ? 0 : 1; + + glm::vec3 D = glm::inversesqrt(glm::vec3(16.f)) * glm::sqrt(16.f); + Error += glm::all(glm::equal(D, glm::vec3(1.f), 0.01f)) ? 0 : 1; + + glm::vec4 E = glm::inversesqrt(glm::vec4(16.f)) * glm::sqrt(16.f); + Error += glm::all(glm::equal(E, glm::vec4(1.f), 0.01f)) ? 0 : 1; + + return Error; +} + +int main() +{ + int Error = 0; + + Error += test_pow(); + Error += test_sqrt(); + Error += test_exp(); + Error += test_log(); + Error += test_exp2(); + Error += test_log2(); + Error += test_inversesqrt(); + + return Error; +} + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_func_geometric.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_func_geometric.cpp new file mode 100644 index 0000000000000000000000000000000000000000..9b9a5ae6ada782b8515e1fc06426c05340f06e69 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_func_geometric.cpp @@ -0,0 +1,200 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace length +{ + int test() + { + float Length1 = glm::length(glm::vec1(1)); + float Length2 = glm::length(glm::vec2(1, 0)); + float Length3 = glm::length(glm::vec3(1, 0, 0)); + float Length4 = glm::length(glm::vec4(1, 0, 0, 0)); + + int Error = 0; + + Error += glm::abs(Length1 - 1.0f) < std::numeric_limits::epsilon() ? 0 : 1; + Error += glm::abs(Length2 - 1.0f) < std::numeric_limits::epsilon() ? 0 : 1; + Error += glm::abs(Length3 - 1.0f) < std::numeric_limits::epsilon() ? 0 : 1; + Error += glm::abs(Length4 - 1.0f) < std::numeric_limits::epsilon() ? 0 : 1; + + return Error; + } +}//namespace length + +namespace distance +{ + int test() + { + float Distance1 = glm::distance(glm::vec1(1), glm::vec1(1)); + float Distance2 = glm::distance(glm::vec2(1, 0), glm::vec2(1, 0)); + float Distance3 = glm::distance(glm::vec3(1, 0, 0), glm::vec3(1, 0, 0)); + float Distance4 = glm::distance(glm::vec4(1, 0, 0, 0), glm::vec4(1, 0, 0, 0)); + + int Error = 0; + + Error += glm::abs(Distance1) < std::numeric_limits::epsilon() ? 0 : 1; + Error += glm::abs(Distance2) < std::numeric_limits::epsilon() ? 0 : 1; + Error += glm::abs(Distance3) < std::numeric_limits::epsilon() ? 0 : 1; + Error += glm::abs(Distance4) < std::numeric_limits::epsilon() ? 0 : 1; + + return Error; + } +}//namespace distance + +namespace dot +{ + int test() + { + float Dot1 = glm::dot(glm::vec1(1), glm::vec1(1)); + float Dot2 = glm::dot(glm::vec2(1), glm::vec2(1)); + float Dot3 = glm::dot(glm::vec3(1), glm::vec3(1)); + float Dot4 = glm::dot(glm::vec4(1), glm::vec4(1)); + + int Error = 0; + + Error += glm::abs(Dot1 - 1.0f) < std::numeric_limits::epsilon() ? 0 : 1; + Error += glm::abs(Dot2 - 2.0f) < std::numeric_limits::epsilon() ? 0 : 1; + Error += glm::abs(Dot3 - 3.0f) < std::numeric_limits::epsilon() ? 0 : 1; + Error += glm::abs(Dot4 - 4.0f) < std::numeric_limits::epsilon() ? 0 : 1; + + return Error; + } +}//namespace dot + +namespace cross +{ + int test() + { + glm::vec3 Cross1 = glm::cross(glm::vec3(1, 0, 0), glm::vec3(0, 1, 0)); + glm::vec3 Cross2 = glm::cross(glm::vec3(0, 1, 0), glm::vec3(1, 0, 0)); + + int Error = 0; + + Error += glm::all(glm::lessThan(glm::abs(Cross1 - glm::vec3(0, 0, 1)), glm::vec3(std::numeric_limits::epsilon()))) ? 0 : 1; + Error += glm::all(glm::lessThan(glm::abs(Cross2 - glm::vec3(0, 0,-1)), glm::vec3(std::numeric_limits::epsilon()))) ? 0 : 1; + + return Error; + } +}//namespace cross + +namespace normalize +{ + int test() + { + glm::vec3 Normalize1 = glm::normalize(glm::vec3(1, 0, 0)); + glm::vec3 Normalize2 = glm::normalize(glm::vec3(2, 0, 0)); + + glm::vec3 Normalize3 = glm::normalize(glm::vec3(-0.6, 0.7, -0.5)); + + glm::vec3 ro = glm::vec3(glm::cos(5.f) * 3.f, 2.f, glm::sin(5.f) * 3.f); + glm::vec3 w = glm::normalize(glm::vec3(0, -0.2f, 0) - ro); + glm::vec3 u = glm::normalize(glm::cross(w, glm::vec3(0, 1, 0))); + glm::vec3 v = glm::cross(u, w); + + int Error = 0; + + Error += glm::all(glm::lessThan(glm::abs(Normalize1 - glm::vec3(1, 0, 0)), glm::vec3(std::numeric_limits::epsilon()))) ? 0 : 1; + Error += glm::all(glm::lessThan(glm::abs(Normalize2 - glm::vec3(1, 0, 0)), glm::vec3(std::numeric_limits::epsilon()))) ? 0 : 1; + + return Error; + } +}//namespace normalize + +namespace faceforward +{ + int test() + { + int Error = 0; + + { + glm::vec3 N(0.0f, 0.0f, 1.0f); + glm::vec3 I(1.0f, 0.0f, 1.0f); + glm::vec3 Nref(0.0f, 0.0f, 1.0f); + glm::vec3 F = glm::faceforward(N, I, Nref); + } + + return Error; + } +}//namespace faceforward + +namespace reflect +{ + int test() + { + int Error = 0; + + { + glm::vec2 A(1.0f,-1.0f); + glm::vec2 B(0.0f, 1.0f); + glm::vec2 C = glm::reflect(A, B); + Error += glm::all(glm::equal(C, glm::vec2(1.0, 1.0), 0.0001f)) ? 0 : 1; + } + + { + glm::dvec2 A(1.0f,-1.0f); + glm::dvec2 B(0.0f, 1.0f); + glm::dvec2 C = glm::reflect(A, B); + Error += glm::all(glm::equal(C, glm::dvec2(1.0, 1.0), 0.0001)) ? 0 : 1; + } + + return Error; + } +}//namespace reflect + +namespace refract +{ + int test() + { + int Error = 0; + + { + float A(-1.0f); + float B(1.0f); + float C = glm::refract(A, B, 0.5f); + Error += glm::equal(C, -1.0f, 0.0001f) ? 0 : 1; + } + + { + glm::vec2 A(0.0f,-1.0f); + glm::vec2 B(0.0f, 1.0f); + glm::vec2 C = glm::refract(A, B, 0.5f); + Error += glm::all(glm::equal(C, glm::vec2(0.0, -1.0), 0.0001f)) ? 0 : 1; + } + + { + glm::dvec2 A(0.0f,-1.0f); + glm::dvec2 B(0.0f, 1.0f); + glm::dvec2 C = glm::refract(A, B, 0.5); + Error += glm::all(glm::equal(C, glm::dvec2(0.0, -1.0), 0.0001)) ? 0 : 1; + } + + return Error; + } +}//namespace refract + +int main() +{ + int Error(0); + + Error += length::test(); + Error += distance::test(); + Error += dot::test(); + Error += cross::test(); + Error += normalize::test(); + Error += faceforward::test(); + Error += reflect::test(); + Error += refract::test(); + + return Error; +} + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_func_integer.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_func_integer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..2d47e7d37de0fbb87f6757aec881a0268681d595 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_func_integer.cpp @@ -0,0 +1,1556 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +enum result +{ + SUCCESS, + FAIL, + ASSERT, + STATIC_ASSERT +}; + +namespace bitfieldInsert +{ + template + struct type + { + genType Base; + genType Insert; + int Offset; + int Bits; + genType Return; + }; + + typedef type typeU32; + + typeU32 const Data32[] = + { + {0x00000000, 0xffffffff, 0, 32, 0xffffffff}, + {0x00000000, 0xffffffff, 0, 31, 0x7fffffff}, + {0x00000000, 0xffffffff, 0, 0, 0x00000000}, + {0xff000000, 0x000000ff, 8, 8, 0xff00ff00}, + {0xffff0000, 0xffff0000, 16, 16, 0x00000000}, + {0x0000ffff, 0x0000ffff, 16, 16, 0xffffffff} + }; + + static int test() + { + int Error = 0; + glm::uint count = sizeof(Data32) / sizeof(typeU32); + + for(glm::uint i = 0; i < count; ++i) + { + glm::uint Return = glm::bitfieldInsert( + Data32[i].Base, + Data32[i].Insert, + Data32[i].Offset, + Data32[i].Bits); + + Error += Data32[i].Return == Return ? 0 : 1; + } + + return Error; + } +}//bitfieldInsert + +namespace bitfieldExtract +{ + template + struct type + { + genType Value; + int Offset; + int Bits; + genType Return; + result Result; + }; + + typedef type typeU32; + + typeU32 const Data32[] = + { + {0xffffffff, 0,32, 0xffffffff, SUCCESS}, + {0xffffffff, 8, 0, 0x00000000, SUCCESS}, + {0x00000000, 0,32, 0x00000000, SUCCESS}, + {0x0f0f0f0f, 0,32, 0x0f0f0f0f, SUCCESS}, + {0x00000000, 8, 0, 0x00000000, SUCCESS}, + {0x80000000,31, 1, 0x00000001, SUCCESS}, + {0x7fffffff,31, 1, 0x00000000, SUCCESS}, + {0x00000300, 8, 8, 0x00000003, SUCCESS}, + {0x0000ff00, 8, 8, 0x000000ff, SUCCESS}, + {0xfffffff0, 0, 5, 0x00000010, SUCCESS}, + {0x000000ff, 1, 3, 0x00000007, SUCCESS}, + {0x000000ff, 0, 3, 0x00000007, SUCCESS}, + {0x00000000, 0, 2, 0x00000000, SUCCESS}, + {0xffffffff, 0, 8, 0x000000ff, SUCCESS}, + {0xffff0000,16,16, 0x0000ffff, SUCCESS}, + {0xfffffff0, 0, 8, 0x00000000, FAIL}, + {0xffffffff,16,16, 0x00000000, FAIL}, + //{0xffffffff,32, 1, 0x00000000, ASSERT}, // Throw an assert + //{0xffffffff, 0,33, 0x00000000, ASSERT}, // Throw an assert + //{0xffffffff,16,16, 0x00000000, ASSERT}, // Throw an assert + }; + + static int test() + { + int Error = 0; + + glm::uint count = sizeof(Data32) / sizeof(typeU32); + + for(glm::uint i = 0; i < count; ++i) + { + glm::uint Return = glm::bitfieldExtract( + Data32[i].Value, + Data32[i].Offset, + Data32[i].Bits); + + bool Compare = Data32[i].Return == Return; + + if(Data32[i].Result == SUCCESS && Compare) + continue; + else if(Data32[i].Result == FAIL && !Compare) + continue; + + Error += 1; + } + + return Error; + } +}//extractField + +namespace bitfieldReverse +{ +/* + GLM_FUNC_QUALIFIER unsigned int bitfieldReverseLoop(unsigned int v) + { + unsigned int Result(0); + unsigned int const BitSize = static_cast(sizeof(unsigned int) * 8); + for(unsigned int i = 0; i < BitSize; ++i) + { + unsigned int const BitSet(v & (static_cast(1) << i)); + unsigned int const BitFirst(BitSet >> i); + Result |= BitFirst << (BitSize - 1 - i); + } + return Result; + } + + GLM_FUNC_QUALIFIER glm::uint64_t bitfieldReverseLoop(glm::uint64_t v) + { + glm::uint64_t Result(0); + glm::uint64_t const BitSize = static_cast(sizeof(unsigned int) * 8); + for(glm::uint64_t i = 0; i < BitSize; ++i) + { + glm::uint64_t const BitSet(v & (static_cast(1) << i)); + glm::uint64_t const BitFirst(BitSet >> i); + Result |= BitFirst << (BitSize - 1 - i); + } + return Result; + } +*/ + template + GLM_FUNC_QUALIFIER glm::vec bitfieldReverseLoop(glm::vec const& v) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'bitfieldReverse' only accept integer values"); + + glm::vec Result(0); + T const BitSize = static_cast(sizeof(T) * 8); + for(T i = 0; i < BitSize; ++i) + { + glm::vec const BitSet(v & (static_cast(1) << i)); + glm::vec const BitFirst(BitSet >> i); + Result |= BitFirst << (BitSize - 1 - i); + } + return Result; + } + + template + GLM_FUNC_QUALIFIER T bitfieldReverseLoop(T v) + { + return bitfieldReverseLoop(glm::vec<1, T>(v)).x; + } + + GLM_FUNC_QUALIFIER glm::uint32 bitfieldReverseUint32(glm::uint32 x) + { + x = (x & 0x55555555) << 1 | (x & 0xAAAAAAAA) >> 1; + x = (x & 0x33333333) << 2 | (x & 0xCCCCCCCC) >> 2; + x = (x & 0x0F0F0F0F) << 4 | (x & 0xF0F0F0F0) >> 4; + x = (x & 0x00FF00FF) << 8 | (x & 0xFF00FF00) >> 8; + x = (x & 0x0000FFFF) << 16 | (x & 0xFFFF0000) >> 16; + return x; + } + + GLM_FUNC_QUALIFIER glm::uint64 bitfieldReverseUint64(glm::uint64 x) + { + x = (x & 0x5555555555555555) << 1 | (x & 0xAAAAAAAAAAAAAAAA) >> 1; + x = (x & 0x3333333333333333) << 2 | (x & 0xCCCCCCCCCCCCCCCC) >> 2; + x = (x & 0x0F0F0F0F0F0F0F0F) << 4 | (x & 0xF0F0F0F0F0F0F0F0) >> 4; + x = (x & 0x00FF00FF00FF00FF) << 8 | (x & 0xFF00FF00FF00FF00) >> 8; + x = (x & 0x0000FFFF0000FFFF) << 16 | (x & 0xFFFF0000FFFF0000) >> 16; + x = (x & 0x00000000FFFFFFFF) << 32 | (x & 0xFFFFFFFF00000000) >> 32; + return x; + } + + template + struct compute_bitfieldReverseStep + { + template + GLM_FUNC_QUALIFIER static glm::vec call(glm::vec const& v, T, T) + { + return v; + } + }; + + template<> + struct compute_bitfieldReverseStep + { + template + GLM_FUNC_QUALIFIER static glm::vec call(glm::vec const& v, T Mask, T Shift) + { + return (v & Mask) << Shift | (v & (~Mask)) >> Shift; + } + }; + + template + GLM_FUNC_QUALIFIER glm::vec bitfieldReverseOps(glm::vec const& v) + { + glm::vec x(v); + x = compute_bitfieldReverseStep= 2>::call(x, static_cast(0x5555555555555555ull), static_cast( 1)); + x = compute_bitfieldReverseStep= 4>::call(x, static_cast(0x3333333333333333ull), static_cast( 2)); + x = compute_bitfieldReverseStep= 8>::call(x, static_cast(0x0F0F0F0F0F0F0F0Full), static_cast( 4)); + x = compute_bitfieldReverseStep= 16>::call(x, static_cast(0x00FF00FF00FF00FFull), static_cast( 8)); + x = compute_bitfieldReverseStep= 32>::call(x, static_cast(0x0000FFFF0000FFFFull), static_cast(16)); + x = compute_bitfieldReverseStep= 64>::call(x, static_cast(0x00000000FFFFFFFFull), static_cast(32)); + return x; + } + + template + GLM_FUNC_QUALIFIER genType bitfieldReverseOps(genType x) + { + return bitfieldReverseOps(glm::vec<1, genType, glm::defaultp>(x)).x; + } + + template + struct type + { + genType Value; + genType Return; + result Result; + }; + + typedef type typeU32; + + typeU32 const Data32[] = + { + {0x00000001, 0x80000000, SUCCESS}, + {0x0000000f, 0xf0000000, SUCCESS}, + {0x000000ff, 0xff000000, SUCCESS}, + {0xf0000000, 0x0000000f, SUCCESS}, + {0xff000000, 0x000000ff, SUCCESS}, + {0xffffffff, 0xffffffff, SUCCESS}, + {0x00000000, 0x00000000, SUCCESS} + }; + + typedef type typeU64; + + typeU64 const Data64[] = + { + {0x00000000000000ff, 0xff00000000000000, SUCCESS}, + {0x000000000000000f, 0xf000000000000000, SUCCESS}, + {0xf000000000000000, 0x000000000000000f, SUCCESS}, + {0xffffffffffffffff, 0xffffffffffffffff, SUCCESS}, + {0x0000000000000000, 0x0000000000000000, SUCCESS} + }; + + static int test32_bitfieldReverse() + { + int Error = 0; + std::size_t const Count = sizeof(Data32) / sizeof(typeU32); + + for(std::size_t i = 0; i < Count; ++i) + { + glm::uint Return = glm::bitfieldReverse(Data32[i].Value); + + bool Compare = Data32[i].Return == Return; + + if(Data32[i].Result == SUCCESS) + Error += Compare ? 0 : 1; + else + Error += Compare ? 1 : 0; + } + + return Error; + } + + static int test32_bitfieldReverseLoop() + { + int Error = 0; + std::size_t const Count = sizeof(Data32) / sizeof(typeU32); + + for(std::size_t i = 0; i < Count; ++i) + { + glm::uint Return = bitfieldReverseLoop(Data32[i].Value); + + bool Compare = Data32[i].Return == Return; + + if(Data32[i].Result == SUCCESS) + Error += Compare ? 0 : 1; + else + Error += Compare ? 1 : 0; + } + + return Error; + } + + static int test32_bitfieldReverseUint32() + { + int Error = 0; + std::size_t const Count = sizeof(Data32) / sizeof(typeU32); + + for(std::size_t i = 0; i < Count; ++i) + { + glm::uint Return = bitfieldReverseUint32(Data32[i].Value); + + bool Compare = Data32[i].Return == Return; + + if(Data32[i].Result == SUCCESS) + Error += Compare ? 0 : 1; + else + Error += Compare ? 1 : 0; + } + + return Error; + } + + static int test32_bitfieldReverseOps() + { + int Error = 0; + std::size_t const Count = sizeof(Data32) / sizeof(typeU32); + + for(std::size_t i = 0; i < Count; ++i) + { + glm::uint Return = bitfieldReverseOps(Data32[i].Value); + + bool Compare = Data32[i].Return == Return; + + if(Data32[i].Result == SUCCESS) + Error += Compare ? 0 : 1; + else + Error += Compare ? 1 : 0; + } + + return Error; + } + + static int test64_bitfieldReverse() + { + int Error = 0; + std::size_t const Count = sizeof(Data64) / sizeof(typeU64); + + for(std::size_t i = 0; i < Count; ++i) + { + glm::uint64 Return = glm::bitfieldReverse(Data64[i].Value); + + bool Compare = Data64[i].Return == Return; + + if(Data64[i].Result == SUCCESS) + Error += Compare ? 0 : 1; + else + Error += Compare ? 1 : 0; + } + + return Error; + } + + static int test64_bitfieldReverseLoop() + { + int Error = 0; + std::size_t const Count = sizeof(Data64) / sizeof(typeU64); + + for(std::size_t i = 0; i < Count; ++i) + { + glm::uint64 Return = bitfieldReverseLoop(Data64[i].Value); + + bool Compare = Data64[i].Return == Return; + + if(Data32[i].Result == SUCCESS) + Error += Compare ? 0 : 1; + else + Error += Compare ? 1 : 0; + } + + return Error; + } + + static int test64_bitfieldReverseUint64() + { + int Error = 0; + std::size_t const Count = sizeof(Data64) / sizeof(typeU64); + + for(std::size_t i = 0; i < Count; ++i) + { + glm::uint64 Return = bitfieldReverseUint64(Data64[i].Value); + + bool Compare = Data64[i].Return == Return; + + if(Data64[i].Result == SUCCESS) + Error += Compare ? 0 : 1; + else + Error += Compare ? 1 : 0; + } + + return Error; + } + + static int test64_bitfieldReverseOps() + { + int Error = 0; + std::size_t const Count = sizeof(Data64) / sizeof(typeU64); + + for(std::size_t i = 0; i < Count; ++i) + { + glm::uint64 Return = bitfieldReverseOps(Data64[i].Value); + + bool Compare = Data64[i].Return == Return; + + if(Data64[i].Result == SUCCESS) + Error += Compare ? 0 : 1; + else + Error += Compare ? 1 : 0; + } + + return Error; + } + + static int test() + { + int Error = 0; + + Error += test32_bitfieldReverse(); + Error += test32_bitfieldReverseLoop(); + Error += test32_bitfieldReverseUint32(); + Error += test32_bitfieldReverseOps(); + + Error += test64_bitfieldReverse(); + Error += test64_bitfieldReverseLoop(); + Error += test64_bitfieldReverseUint64(); + Error += test64_bitfieldReverseOps(); + + return Error; + } + + static int perf32(glm::uint32 Count) + { + int Error = 0; + + std::vector Data; + Data.resize(static_cast(Count)); + + std::clock_t Timestamps0 = std::clock(); + + for(glm::uint32 k = 0; k < Count; ++k) + Data[k] = glm::bitfieldReverse(k); + + std::clock_t Timestamps1 = std::clock(); + + for(glm::uint32 k = 0; k < Count; ++k) + Data[k] = bitfieldReverseLoop(k); + + std::clock_t Timestamps2 = std::clock(); + + for(glm::uint32 k = 0; k < Count; ++k) + Data[k] = bitfieldReverseUint32(k); + + std::clock_t Timestamps3 = std::clock(); + + for(glm::uint32 k = 0; k < Count; ++k) + Data[k] = bitfieldReverseOps(k); + + std::clock_t Timestamps4 = std::clock(); + + std::printf("glm::bitfieldReverse: %d clocks\n", static_cast(Timestamps1 - Timestamps0)); + std::printf("bitfieldReverseLoop: %d clocks\n", static_cast(Timestamps2 - Timestamps1)); + std::printf("bitfieldReverseUint32: %d clocks\n", static_cast(Timestamps3 - Timestamps2)); + std::printf("bitfieldReverseOps: %d clocks\n", static_cast(Timestamps4 - Timestamps3)); + + return Error; + } + + static int perf64(glm::uint64 Count) + { + int Error = 0; + + std::vector Data; + Data.resize(static_cast(Count)); + + std::clock_t Timestamps0 = std::clock(); + + for(glm::uint64 k = 0; k < Count; ++k) + Data[static_cast(k)] = glm::bitfieldReverse(k); + + std::clock_t Timestamps1 = std::clock(); + + for(glm::uint64 k = 0; k < Count; ++k) + Data[static_cast(k)] = bitfieldReverseLoop(k); + + std::clock_t Timestamps2 = std::clock(); + + for(glm::uint64 k = 0; k < Count; ++k) + Data[static_cast(k)] = bitfieldReverseUint64(k); + + std::clock_t Timestamps3 = std::clock(); + + for(glm::uint64 k = 0; k < Count; ++k) + Data[static_cast(k)] = bitfieldReverseOps(k); + + std::clock_t Timestamps4 = std::clock(); + + std::printf("glm::bitfieldReverse - 64: %d clocks\n", static_cast(Timestamps1 - Timestamps0)); + std::printf("bitfieldReverseLoop - 64: %d clocks\n", static_cast(Timestamps2 - Timestamps1)); + std::printf("bitfieldReverseUint - 64: %d clocks\n", static_cast(Timestamps3 - Timestamps2)); + std::printf("bitfieldReverseOps - 64: %d clocks\n", static_cast(Timestamps4 - Timestamps3)); + + return Error; + } + + static int perf(std::size_t Samples) + { + int Error = 0; + + Error += perf32(static_cast(Samples)); + Error += perf64(static_cast(Samples)); + + return Error; + } +}//bitfieldReverse + +namespace findMSB +{ + template + struct type + { + genType Value; + retType Return; + }; + +# if GLM_HAS_BITSCAN_WINDOWS + template + static int findMSB_intrinsic(genIUType Value) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'findMSB' only accept integer values"); + + if(Value == 0) + return -1; + + unsigned long Result(0); + _BitScanReverse(&Result, Value); + return int(Result); + } +# endif//GLM_HAS_BITSCAN_WINDOWS + +# if GLM_ARCH & GLM_ARCH_AVX && GLM_COMPILER & GLM_COMPILER_VC + template + static int findMSB_avx(genIUType Value) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'findMSB' only accept integer values"); + + if(Value == 0) + return -1; + + return int(_tzcnt_u32(Value)); + } +# endif//GLM_ARCH & GLM_ARCH_AVX && GLM_PLATFORM & GLM_PLATFORM_WINDOWS + + template + static int findMSB_095(genIUType Value) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'findMSB' only accept integer values"); + + if(Value == genIUType(0) || Value == genIUType(-1)) + return -1; + else if(Value > 0) + { + genIUType Bit = genIUType(-1); + for(genIUType tmp = Value; tmp > 0; tmp >>= 1, ++Bit){} + return static_cast(Bit); + } + else //if(Value < 0) + { + int const BitCount(sizeof(genIUType) * 8); + int MostSignificantBit(-1); + for(int BitIndex(0); BitIndex < BitCount; ++BitIndex) + MostSignificantBit = (Value & (1 << BitIndex)) ? MostSignificantBit : BitIndex; + assert(MostSignificantBit >= 0); + return MostSignificantBit; + } + } + + template + static int findMSB_nlz1(genIUType x) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'findMSB' only accept integer values"); + + if (x == 0) + return -1; + + int n = 0; + if (x <= 0x0000FFFF) {n = n +16; x = x <<16;} + if (x <= 0x00FFFFFF) {n = n + 8; x = x << 8;} + if (x <= 0x0FFFFFFF) {n = n + 4; x = x << 4;} + if (x <= 0x3FFFFFFF) {n = n + 2; x = x << 2;} + if (x <= 0x7FFFFFFF) {n = n + 1;} + return 31 - n; + } + + static int findMSB_nlz2(unsigned int x) + { + unsigned int y; + int n = 32; + + y = x >>16; if (y != 0) {n = n -16; x = y;} + y = x >> 8; if (y != 0) {n = n - 8; x = y;} + y = x >> 4; if (y != 0) {n = n - 4; x = y;} + y = x >> 2; if (y != 0) {n = n - 2; x = y;} + y = x >> 1; if (y != 0) return n - 2; + return 32 - (n - static_cast(x)); + } + + static int findMSB_pop(unsigned int x) + { + x = x | (x >> 1); + x = x | (x >> 2); + x = x | (x >> 4); + x = x | (x >> 8); + x = x | (x >>16); + return 31 - glm::bitCount(~x); + } + + static int perf_int(std::size_t Count) + { + type const Data[] = + { + {0x00000000, -1}, + {0x00000001, 0}, + {0x00000002, 1}, + {0x00000003, 1}, + {0x00000004, 2}, + {0x00000005, 2}, + {0x00000007, 2}, + {0x00000008, 3}, + {0x00000010, 4}, + {0x00000020, 5}, + {0x00000040, 6}, + {0x00000080, 7}, + {0x00000100, 8}, + {0x00000200, 9}, + {0x00000400, 10}, + {0x00000800, 11}, + {0x00001000, 12}, + {0x00002000, 13}, + {0x00004000, 14}, + {0x00008000, 15}, + {0x00010000, 16}, + {0x00020000, 17}, + {0x00040000, 18}, + {0x00080000, 19}, + {0x00100000, 20}, + {0x00200000, 21}, + {0x00400000, 22}, + {0x00800000, 23}, + {0x01000000, 24}, + {0x02000000, 25}, + {0x04000000, 26}, + {0x08000000, 27}, + {0x10000000, 28}, + {0x20000000, 29}, + {0x40000000, 30} + }; + + int Error(0); + + std::clock_t Timestamps0 = std::clock(); + + for(std::size_t k = 0; k < Count; ++k) + for(std::size_t i = 0; i < sizeof(Data) / sizeof(type); ++i) + { + int Result = glm::findMSB(Data[i].Value); + Error += Data[i].Return == Result ? 0 : 1; + } + + std::clock_t Timestamps1 = std::clock(); + + for(std::size_t k = 0; k < Count; ++k) + for(std::size_t i = 0; i < sizeof(Data) / sizeof(type); ++i) + { + int Result = findMSB_nlz1(Data[i].Value); + Error += Data[i].Return == Result ? 0 : 1; + } + + std::clock_t Timestamps2 = std::clock(); + + for(std::size_t k = 0; k < Count; ++k) + for(std::size_t i = 0; i < sizeof(Data) / sizeof(type); ++i) + { + int Result = findMSB_nlz2(static_cast(Data[i].Value)); + Error += Data[i].Return == Result ? 0 : 1; + } + + std::clock_t Timestamps3 = std::clock(); + + for(std::size_t k = 0; k < Count; ++k) + for(std::size_t i = 0; i < sizeof(Data) / sizeof(type); ++i) + { + int Result = findMSB_095(static_cast(Data[i].Value)); + Error += Data[i].Return == Result ? 0 : 1; + } + + std::clock_t Timestamps4 = std::clock(); + +# if GLM_HAS_BITSCAN_WINDOWS + for(std::size_t k = 0; k < Count; ++k) + for(std::size_t i = 0; i < sizeof(Data) / sizeof(type); ++i) + { + int Result = findMSB_intrinsic(Data[i].Value); + Error += Data[i].Return == Result ? 0 : 1; + } +# endif//GLM_HAS_BITSCAN_WINDOWS + + std::clock_t Timestamps5 = std::clock(); + + for(std::size_t k = 0; k < Count; ++k) + for(std::size_t i = 0; i < sizeof(Data) / sizeof(type); ++i) + { + int Result = findMSB_pop(static_cast(Data[i].Value)); + Error += Data[i].Return == Result ? 0 : 1; + } + + std::clock_t Timestamps6 = std::clock(); + +# if GLM_ARCH & GLM_ARCH_AVX && GLM_COMPILER & GLM_COMPILER_VC + for(std::size_t k = 0; k < Count; ++k) + for(std::size_t i = 0; i < sizeof(Data) / sizeof(type); ++i) + { + int Result = findMSB_avx(Data[i].Value); + Error += Data[i].Return == Result ? 0 : 1; + } + + std::clock_t Timestamps7 = std::clock(); +# endif + + std::printf("glm::findMSB: %d clocks\n", static_cast(Timestamps1 - Timestamps0)); + std::printf("findMSB - nlz1: %d clocks\n", static_cast(Timestamps2 - Timestamps1)); + std::printf("findMSB - nlz2: %d clocks\n", static_cast(Timestamps3 - Timestamps2)); + std::printf("findMSB - 0.9.5: %d clocks\n", static_cast(Timestamps4 - Timestamps3)); + +# if GLM_HAS_BITSCAN_WINDOWS + std::printf("findMSB - intrinsics: %d clocks\n", static_cast(Timestamps5 - Timestamps4)); +# endif//GLM_HAS_BITSCAN_WINDOWS + std::printf("findMSB - pop: %d clocks\n", static_cast(Timestamps6 - Timestamps5)); + +# if GLM_ARCH & GLM_ARCH_AVX && GLM_COMPILER & GLM_COMPILER_VC + std::printf("findMSB - avx tzcnt: %d clocks\n", static_cast(Timestamps7 - Timestamps6)); +# endif//GLM_ARCH & GLM_ARCH_AVX && GLM_PLATFORM & GLM_PLATFORM_WINDOWS + + return Error; + } + + static int test_ivec4() + { + type const Data[] = + { + {glm::ivec4(0x00000000), glm::ivec4(-1)}, + {glm::ivec4(0x00000001), glm::ivec4( 0)}, + {glm::ivec4(0x00000002), glm::ivec4( 1)}, + {glm::ivec4(0x00000003), glm::ivec4( 1)}, + {glm::ivec4(0x00000004), glm::ivec4( 2)}, + {glm::ivec4(0x00000005), glm::ivec4( 2)}, + {glm::ivec4(0x00000007), glm::ivec4( 2)}, + {glm::ivec4(0x00000008), glm::ivec4( 3)}, + {glm::ivec4(0x00000010), glm::ivec4( 4)}, + {glm::ivec4(0x00000020), glm::ivec4( 5)}, + {glm::ivec4(0x00000040), glm::ivec4( 6)}, + {glm::ivec4(0x00000080), glm::ivec4( 7)}, + {glm::ivec4(0x00000100), glm::ivec4( 8)}, + {glm::ivec4(0x00000200), glm::ivec4( 9)}, + {glm::ivec4(0x00000400), glm::ivec4(10)}, + {glm::ivec4(0x00000800), glm::ivec4(11)}, + {glm::ivec4(0x00001000), glm::ivec4(12)}, + {glm::ivec4(0x00002000), glm::ivec4(13)}, + {glm::ivec4(0x00004000), glm::ivec4(14)}, + {glm::ivec4(0x00008000), glm::ivec4(15)}, + {glm::ivec4(0x00010000), glm::ivec4(16)}, + {glm::ivec4(0x00020000), glm::ivec4(17)}, + {glm::ivec4(0x00040000), glm::ivec4(18)}, + {glm::ivec4(0x00080000), glm::ivec4(19)}, + {glm::ivec4(0x00100000), glm::ivec4(20)}, + {glm::ivec4(0x00200000), glm::ivec4(21)}, + {glm::ivec4(0x00400000), glm::ivec4(22)}, + {glm::ivec4(0x00800000), glm::ivec4(23)}, + {glm::ivec4(0x01000000), glm::ivec4(24)}, + {glm::ivec4(0x02000000), glm::ivec4(25)}, + {glm::ivec4(0x04000000), glm::ivec4(26)}, + {glm::ivec4(0x08000000), glm::ivec4(27)}, + {glm::ivec4(0x10000000), glm::ivec4(28)}, + {glm::ivec4(0x20000000), glm::ivec4(29)}, + {glm::ivec4(0x40000000), glm::ivec4(30)} + }; + + int Error(0); + + for(std::size_t i = 0; i < sizeof(Data) / sizeof(type); ++i) + { + glm::ivec4 Result0 = glm::findMSB(Data[i].Value); + Error += glm::all(glm::equal(Data[i].Return, Result0)) ? 0 : 1; + } + + return Error; + } + + static int test_int() + { + typedef type entry; + + entry const Data[] = + { + {0x00000000, -1}, + {0x00000001, 0}, + {0x00000002, 1}, + {0x00000003, 1}, + {0x00000004, 2}, + {0x00000005, 2}, + {0x00000007, 2}, + {0x00000008, 3}, + {0x00000010, 4}, + {0x00000020, 5}, + {0x00000040, 6}, + {0x00000080, 7}, + {0x00000100, 8}, + {0x00000200, 9}, + {0x00000400, 10}, + {0x00000800, 11}, + {0x00001000, 12}, + {0x00002000, 13}, + {0x00004000, 14}, + {0x00008000, 15}, + {0x00010000, 16}, + {0x00020000, 17}, + {0x00040000, 18}, + {0x00080000, 19}, + {0x00100000, 20}, + {0x00200000, 21}, + {0x00400000, 22}, + {0x00800000, 23}, + {0x01000000, 24}, + {0x02000000, 25}, + {0x04000000, 26}, + {0x08000000, 27}, + {0x10000000, 28}, + {0x20000000, 29}, + {0x40000000, 30} + }; + + int Error(0); + + for(std::size_t i = 0; i < sizeof(Data) / sizeof(entry); ++i) + { + int Result0 = glm::findMSB(Data[i].Value); + Error += Data[i].Return == Result0 ? 0 : 1; + } + + for(std::size_t i = 0; i < sizeof(Data) / sizeof(entry); ++i) + { + int Result0 = findMSB_nlz1(Data[i].Value); + Error += Data[i].Return == Result0 ? 0 : 1; + } +/* + for(std::size_t i = 0; i < sizeof(Data) / sizeof(entry); ++i) + { + int Result0 = findMSB_nlz2(Data[i].Value); + Error += Data[i].Return == Result0 ? 0 : 1; + } +*/ + for(std::size_t i = 0; i < sizeof(Data) / sizeof(entry); ++i) + { + int Result0 = findMSB_095(Data[i].Value); + Error += Data[i].Return == Result0 ? 0 : 1; + } + +# if GLM_HAS_BITSCAN_WINDOWS + for(std::size_t i = 0; i < sizeof(Data) / sizeof(entry); ++i) + { + int Result0 = findMSB_intrinsic(Data[i].Value); + Error += Data[i].Return == Result0 ? 0 : 1; + } +# endif//GLM_HAS_BITSCAN_WINDOWS + + for(std::size_t i = 0; i < sizeof(Data) / sizeof(entry); ++i) + { + int Result0 = findMSB_pop(Data[i].Value); + Error += Data[i].Return == Result0 ? 0 : 1; + } + + return Error; + } + + static int test() + { + int Error(0); + + Error += test_ivec4(); + Error += test_int(); + + return Error; + } + + static int perf(std::size_t Samples) + { + int Error(0); + + Error += perf_int(Samples); + + return Error; + } +}//findMSB + +namespace findLSB +{ + template + struct type + { + genType Value; + retType Return; + }; + + typedef type entry; + + entry const DataI32[] = + { + {0x00000001, 0}, + {0x00000003, 0}, + {0x00000002, 1}, + // {0x80000000, 31}, // Clang generates an error with this + {0x00010000, 16}, + {0x7FFF0000, 16}, + {0x7F000000, 24}, + {0x7F00FF00, 8}, + {0x00000000, -1} + }; + +# if GLM_HAS_BITSCAN_WINDOWS + template + static int findLSB_intrinsic(genIUType Value) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'findLSB' only accept integer values"); + + if(Value == 0) + return -1; + + unsigned long Result(0); + _BitScanForward(&Result, Value); + return int(Result); + } +# endif + + template + static int findLSB_095(genIUType Value) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'findLSB' only accept integer values"); + if(Value == 0) + return -1; + + genIUType Bit; + for(Bit = genIUType(0); !(Value & (1 << Bit)); ++Bit){} + return Bit; + } + + template + static int findLSB_ntz2(genIUType x) + { + if(x == 0) + return -1; + + return glm::bitCount(~x & (x - static_cast(1))); + } + + template + static int findLSB_branchfree(genIUType x) + { + bool IsNull(x == 0); + int const Keep(!IsNull); + int const Discard(IsNull); + + return static_cast(glm::bitCount(~x & (x - static_cast(1)))) * Keep + Discard * -1; + } + + static int test_int() + { + int Error(0); + + for(std::size_t i = 0; i < sizeof(DataI32) / sizeof(entry); ++i) + { + int Result = glm::findLSB(DataI32[i].Value); + Error += DataI32[i].Return == Result ? 0 : 1; + } + + for(std::size_t i = 0; i < sizeof(DataI32) / sizeof(entry); ++i) + { + int Result = findLSB_095(DataI32[i].Value); + Error += DataI32[i].Return == Result ? 0 : 1; + } + +# if GLM_HAS_BITSCAN_WINDOWS + for(std::size_t i = 0; i < sizeof(DataI32) / sizeof(entry); ++i) + { + int Result = findLSB_intrinsic(DataI32[i].Value); + Error += DataI32[i].Return == Result ? 0 : 1; + } +# endif + + for(std::size_t i = 0; i < sizeof(DataI32) / sizeof(entry); ++i) + { + int Result = findLSB_ntz2(DataI32[i].Value); + Error += DataI32[i].Return == Result ? 0 : 1; + } + + for(std::size_t i = 0; i < sizeof(DataI32) / sizeof(entry); ++i) + { + int Result = findLSB_branchfree(DataI32[i].Value); + Error += DataI32[i].Return == Result ? 0 : 1; + } + + return Error; + } + + static int test() + { + int Error(0); + + Error += test_int(); + + return Error; + } + + static int perf_int(std::size_t Count) + { + int Error(0); + + std::clock_t Timestamps0 = std::clock(); + + for(std::size_t k = 0; k < Count; ++k) + for(std::size_t i = 0; i < sizeof(DataI32) / sizeof(entry); ++i) + { + int Result = glm::findLSB(DataI32[i].Value); + Error += DataI32[i].Return == Result ? 0 : 1; + } + + std::clock_t Timestamps1 = std::clock(); + + for(std::size_t k = 0; k < Count; ++k) + for(std::size_t i = 0; i < sizeof(DataI32) / sizeof(entry); ++i) + { + int Result = findLSB_095(DataI32[i].Value); + Error += DataI32[i].Return == Result ? 0 : 1; + } + + std::clock_t Timestamps2 = std::clock(); + +# if GLM_HAS_BITSCAN_WINDOWS + for(std::size_t k = 0; k < Count; ++k) + for(std::size_t i = 0; i < sizeof(DataI32) / sizeof(entry); ++i) + { + int Result = findLSB_intrinsic(DataI32[i].Value); + Error += DataI32[i].Return == Result ? 0 : 1; + } +# endif + + std::clock_t Timestamps3 = std::clock(); + + for(std::size_t k = 0; k < Count; ++k) + for(std::size_t i = 0; i < sizeof(DataI32) / sizeof(entry); ++i) + { + int Result = findLSB_ntz2(DataI32[i].Value); + Error += DataI32[i].Return == Result ? 0 : 1; + } + + std::clock_t Timestamps4 = std::clock(); + + for(std::size_t k = 0; k < Count; ++k) + for(std::size_t i = 0; i < sizeof(DataI32) / sizeof(entry); ++i) + { + int Result = findLSB_branchfree(DataI32[i].Value); + Error += DataI32[i].Return == Result ? 0 : 1; + } + + std::clock_t Timestamps5 = std::clock(); + + std::printf("glm::findLSB: %d clocks\n", static_cast(Timestamps1 - Timestamps0)); + std::printf("findLSB - 0.9.5: %d clocks\n", static_cast(Timestamps2 - Timestamps1)); + +# if GLM_HAS_BITSCAN_WINDOWS + std::printf("findLSB - intrinsics: %d clocks\n", static_cast(Timestamps3 - Timestamps2)); +# endif + + std::printf("findLSB - ntz2: %d clocks\n", static_cast(Timestamps4 - Timestamps3)); + std::printf("findLSB - branchfree: %d clocks\n", static_cast(Timestamps5 - Timestamps4)); + + return Error; + } + + static int perf(std::size_t Samples) + { + int Error(0); + + Error += perf_int(Samples); + + return Error; + } +}//findLSB + +namespace uaddCarry +{ + static int test() + { + int Error(0); + + { + glm::uint x = std::numeric_limits::max(); + glm::uint y = 0; + glm::uint Carry = 0; + glm::uint Result = glm::uaddCarry(x, y, Carry); + + Error += Carry == 0 ? 0 : 1; + Error += Result == std::numeric_limits::max() ? 0 : 1; + } + + { + glm::uint x = std::numeric_limits::max(); + glm::uint y = 1; + glm::uint Carry = 0; + glm::uint Result = glm::uaddCarry(x, y, Carry); + + Error += Carry == 1 ? 0 : 1; + Error += Result == 0 ? 0 : 1; + } + + { + glm::uvec1 x(std::numeric_limits::max()); + glm::uvec1 y(0); + glm::uvec1 Carry(0); + glm::uvec1 Result(glm::uaddCarry(x, y, Carry)); + + Error += glm::all(glm::equal(Carry, glm::uvec1(0))) ? 0 : 1; + Error += glm::all(glm::equal(Result, glm::uvec1(std::numeric_limits::max()))) ? 0 : 1; + } + + { + glm::uvec1 x(std::numeric_limits::max()); + glm::uvec1 y(1); + glm::uvec1 Carry(0); + glm::uvec1 Result(glm::uaddCarry(x, y, Carry)); + + Error += glm::all(glm::equal(Carry, glm::uvec1(1))) ? 0 : 1; + Error += glm::all(glm::equal(Result, glm::uvec1(0))) ? 0 : 1; + } + + return Error; + } +}//namespace uaddCarry + +namespace usubBorrow +{ + static int test() + { + int Error(0); + + { + glm::uint x = 16; + glm::uint y = 17; + glm::uint Borrow = 0; + glm::uint Result = glm::usubBorrow(x, y, Borrow); + + Error += Borrow == 1 ? 0 : 1; + Error += Result == 1 ? 0 : 1; + } + + { + glm::uvec1 x(16); + glm::uvec1 y(17); + glm::uvec1 Borrow(0); + glm::uvec1 Result(glm::usubBorrow(x, y, Borrow)); + + Error += glm::all(glm::equal(Borrow, glm::uvec1(1))) ? 0 : 1; + Error += glm::all(glm::equal(Result, glm::uvec1(1))) ? 0 : 1; + } + + { + glm::uvec2 x(16); + glm::uvec2 y(17); + glm::uvec2 Borrow(0); + glm::uvec2 Result(glm::usubBorrow(x, y, Borrow)); + + Error += glm::all(glm::equal(Borrow, glm::uvec2(1))) ? 0 : 1; + Error += glm::all(glm::equal(Result, glm::uvec2(1))) ? 0 : 1; + } + + { + glm::uvec3 x(16); + glm::uvec3 y(17); + glm::uvec3 Borrow(0); + glm::uvec3 Result(glm::usubBorrow(x, y, Borrow)); + + Error += glm::all(glm::equal(Borrow, glm::uvec3(1))) ? 0 : 1; + Error += glm::all(glm::equal(Result, glm::uvec3(1))) ? 0 : 1; + } + + { + glm::uvec4 x(16); + glm::uvec4 y(17); + glm::uvec4 Borrow(0); + glm::uvec4 Result(glm::usubBorrow(x, y, Borrow)); + + Error += glm::all(glm::equal(Borrow, glm::uvec4(1))) ? 0 : 1; + Error += glm::all(glm::equal(Result, glm::uvec4(1))) ? 0 : 1; + } + + return Error; + } +}//namespace usubBorrow + +namespace umulExtended +{ + static int test() + { + int Error(0); + + { + glm::uint x = 2; + glm::uint y = 3; + glm::uint msb = 0; + glm::uint lsb = 0; + glm::umulExtended(x, y, msb, lsb); + + Error += msb == 0 ? 0 : 1; + Error += lsb == 6 ? 0 : 1; + } + + { + glm::uvec1 x(2); + glm::uvec1 y(3); + glm::uvec1 msb(0); + glm::uvec1 lsb(0); + glm::umulExtended(x, y, msb, lsb); + + Error += glm::all(glm::equal(msb, glm::uvec1(0))) ? 0 : 1; + Error += glm::all(glm::equal(lsb, glm::uvec1(6))) ? 0 : 1; + } + + { + glm::uvec2 x(2); + glm::uvec2 y(3); + glm::uvec2 msb(0); + glm::uvec2 lsb(0); + glm::umulExtended(x, y, msb, lsb); + + Error += glm::all(glm::equal(msb, glm::uvec2(0))) ? 0 : 1; + Error += glm::all(glm::equal(lsb, glm::uvec2(6))) ? 0 : 1; + } + + { + glm::uvec3 x(2); + glm::uvec3 y(3); + glm::uvec3 msb(0); + glm::uvec3 lsb(0); + glm::umulExtended(x, y, msb, lsb); + + Error += glm::all(glm::equal(msb, glm::uvec3(0))) ? 0 : 1; + Error += glm::all(glm::equal(lsb, glm::uvec3(6))) ? 0 : 1; + } + + { + glm::uvec4 x(2); + glm::uvec4 y(3); + glm::uvec4 msb(0); + glm::uvec4 lsb(0); + glm::umulExtended(x, y, msb, lsb); + + Error += glm::all(glm::equal(msb, glm::uvec4(0))) ? 0 : 1; + Error += glm::all(glm::equal(lsb, glm::uvec4(6))) ? 0 : 1; + } + + return Error; + } +}//namespace umulExtended + +namespace imulExtended +{ + static int test() + { + int Error(0); + + { + int x = 2; + int y = 3; + int msb = 0; + int lsb = 0; + glm::imulExtended(x, y, msb, lsb); + + Error += msb == 0 ? 0 : 1; + Error += lsb == 6 ? 0 : 1; + } + + { + glm::ivec1 x(2); + glm::ivec1 y(3); + glm::ivec1 msb(0); + glm::ivec1 lsb(0); + glm::imulExtended(x, y, msb, lsb); + + Error += glm::all(glm::equal(msb, glm::ivec1(0))) ? 0 : 1; + Error += glm::all(glm::equal(lsb, glm::ivec1(6))) ? 0 : 1; + } + + { + glm::ivec2 x(2); + glm::ivec2 y(3); + glm::ivec2 msb(0); + glm::ivec2 lsb(0); + glm::imulExtended(x, y, msb, lsb); + + Error += glm::all(glm::equal(msb, glm::ivec2(0))) ? 0 : 1; + Error += glm::all(glm::equal(lsb, glm::ivec2(6))) ? 0 : 1; + } + + { + glm::ivec3 x(2); + glm::ivec3 y(3); + glm::ivec3 msb(0); + glm::ivec3 lsb(0); + glm::imulExtended(x, y, msb, lsb); + + Error += glm::all(glm::equal(msb, glm::ivec3(0))) ? 0 : 1; + Error += glm::all(glm::equal(lsb, glm::ivec3(6))) ? 0 : 1; + } + + { + glm::ivec4 x(2); + glm::ivec4 y(3); + glm::ivec4 msb(0); + glm::ivec4 lsb(0); + glm::imulExtended(x, y, msb, lsb); + + Error += glm::all(glm::equal(msb, glm::ivec4(0))) ? 0 : 1; + Error += glm::all(glm::equal(lsb, glm::ivec4(6))) ? 0 : 1; + } + + return Error; + } +}//namespace imulExtended + +namespace bitCount +{ + template + struct type + { + genType Value; + genType Return; + }; + + type const DataI32[] = + { + {0x00000001, 1}, + {0x00000003, 2}, + {0x00000002, 1}, + {0x7fffffff, 31}, + {0x00000000, 0} + }; + + template + inline int bitCount_if(T v) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'bitCount' only accept integer values"); + + int Count(0); + for(T i = 0, n = static_cast(sizeof(T) * 8); i < n; ++i) + { + if(v & static_cast(1 << i)) + ++Count; + } + return Count; + } + + template + inline int bitCount_vec(T v) + { + GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'bitCount' only accept integer values"); + + int Count(0); + for(T i = 0, n = static_cast(sizeof(T) * 8); i < n; ++i) + { + Count += static_cast((v >> i) & static_cast(1)); + } + return Count; + } + + template + struct compute_bitfieldBitCountStep + { + template + GLM_FUNC_QUALIFIER static glm::vec call(glm::vec const& v, T, T) + { + return v; + } + }; + + template<> + struct compute_bitfieldBitCountStep + { + template + GLM_FUNC_QUALIFIER static glm::vec call(glm::vec const& v, T Mask, T Shift) + { + return (v & Mask) + ((v >> Shift) & Mask); + } + }; + + template + static glm::vec bitCount_bitfield(glm::vec const& v) + { + glm::vec::type, Q> x(*reinterpret_cast::type, Q> const *>(&v)); + x = compute_bitfieldBitCountStep= 2>::call(x, static_cast::type>(0x5555555555555555ull), static_cast::type>( 1)); + x = compute_bitfieldBitCountStep= 4>::call(x, static_cast::type>(0x3333333333333333ull), static_cast::type>( 2)); + x = compute_bitfieldBitCountStep= 8>::call(x, static_cast::type>(0x0F0F0F0F0F0F0F0Full), static_cast::type>( 4)); + x = compute_bitfieldBitCountStep= 16>::call(x, static_cast::type>(0x00FF00FF00FF00FFull), static_cast::type>( 8)); + x = compute_bitfieldBitCountStep= 32>::call(x, static_cast::type>(0x0000FFFF0000FFFFull), static_cast::type>(16)); + x = compute_bitfieldBitCountStep= 64>::call(x, static_cast::type>(0x00000000FFFFFFFFull), static_cast::type>(32)); + return glm::vec(x); + } + + template + static int bitCount_bitfield(genType x) + { + return bitCount_bitfield(glm::vec<1, genType, glm::defaultp>(x)).x; + } + + static int perf(std::size_t Size) + { + int Error(0); + + std::vector v; + v.resize(Size); + + std::vector w; + w.resize(Size); + + + std::clock_t TimestampsA = std::clock(); + + // bitCount - TimeIf + { + for(std::size_t i = 0, n = v.size(); i < n; ++i) + v[i] = bitCount_if(static_cast(i)); + } + + std::clock_t TimestampsB = std::clock(); + + // bitCount - TimeVec + { + for(std::size_t i = 0, n = v.size(); i < n; ++i) + v[i] = bitCount_vec(i); + } + + std::clock_t TimestampsC = std::clock(); + + // bitCount - TimeDefault + { + for(std::size_t i = 0, n = v.size(); i < n; ++i) + v[i] = glm::bitCount(i); + } + + std::clock_t TimestampsD = std::clock(); + + // bitCount - TimeVec4 + { + for(std::size_t i = 0, n = v.size(); i < n; ++i) + w[i] = glm::bitCount(glm::ivec4(static_cast(i))); + } + + std::clock_t TimestampsE = std::clock(); + + { + for(std::size_t i = 0, n = v.size(); i < n; ++i) + v[i] = bitCount_bitfield(static_cast(i)); + } + + std::clock_t TimestampsF = std::clock(); + + std::printf("bitCount - TimeIf %d\n", static_cast(TimestampsB - TimestampsA)); + std::printf("bitCount - TimeVec %d\n", static_cast(TimestampsC - TimestampsB)); + std::printf("bitCount - TimeDefault %d\n", static_cast(TimestampsD - TimestampsC)); + std::printf("bitCount - TimeVec4 %d\n", static_cast(TimestampsE - TimestampsD)); + std::printf("bitCount - bitfield %d\n", static_cast(TimestampsF - TimestampsE)); + + return Error; + } + + static int test() + { + int Error(0); + + for(std::size_t i = 0, n = sizeof(DataI32) / sizeof(type); i < n; ++i) + { + int ResultA = glm::bitCount(DataI32[i].Value); + int ResultB = bitCount_if(DataI32[i].Value); + int ResultC = bitCount_vec(DataI32[i].Value); + int ResultE = bitCount_bitfield(DataI32[i].Value); + + Error += DataI32[i].Return == ResultA ? 0 : 1; + Error += DataI32[i].Return == ResultB ? 0 : 1; + Error += DataI32[i].Return == ResultC ? 0 : 1; + Error += DataI32[i].Return == ResultE ? 0 : 1; + + assert(!Error); + } + + return Error; + } +}//bitCount + +int main() +{ + int Error = 0; + + Error += ::bitCount::test(); + Error += ::bitfieldReverse::test(); + Error += ::findMSB::test(); + Error += ::findLSB::test(); + Error += ::umulExtended::test(); + Error += ::imulExtended::test(); + Error += ::uaddCarry::test(); + Error += ::usubBorrow::test(); + Error += ::bitfieldInsert::test(); + Error += ::bitfieldExtract::test(); + +# ifdef NDEBUG + std::size_t const Samples = 1000; +# else + std::size_t const Samples = 1; +# endif + + ::bitCount::perf(Samples); + ::bitfieldReverse::perf(Samples); + ::findMSB::perf(Samples); + ::findLSB::perf(Samples); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_func_integer_bit_count.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_func_integer_bit_count.cpp new file mode 100644 index 0000000000000000000000000000000000000000..956eaa75705d0b0abbf378ceeb4510b3f9cb7421 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_func_integer_bit_count.cpp @@ -0,0 +1,291 @@ +// This has the programs for computing the number of 1-bits +// in a word, or byte, etc. +// Max line length is 57, to fit in hacker.book. +#include +#include //To define "exit", req'd by XLC. +#include + +unsigned rotatel(unsigned x, int n) +{ + if (static_cast(n) > 63) { std::printf("rotatel, n out of range.\n"); std::exit(1);} + return (x << n) | (x >> (32 - n)); +} + +int pop0(unsigned x) +{ + x = (x & 0x55555555) + ((x >> 1) & 0x55555555); + x = (x & 0x33333333) + ((x >> 2) & 0x33333333); + x = (x & 0x0F0F0F0F) + ((x >> 4) & 0x0F0F0F0F); + x = (x & 0x00FF00FF) + ((x >> 8) & 0x00FF00FF); + x = (x & 0x0000FFFF) + ((x >>16) & 0x0000FFFF); + return x; +} + +int pop1(unsigned x) +{ + x = x - ((x >> 1) & 0x55555555); + x = (x & 0x33333333) + ((x >> 2) & 0x33333333); + x = (x + (x >> 4)) & 0x0F0F0F0F; + x = x + (x >> 8); + x = x + (x >> 16); + return x & 0x0000003F; +} +/* Note: an alternative to the last three executable lines above is: + return x*0x01010101 >> 24; +if your machine has a fast multiplier (suggested by Jari Kirma). */ + +int pop2(unsigned x) +{ + unsigned n; + + n = (x >> 1) & 033333333333; // Count bits in + x = x - n; // each 3-bit + n = (n >> 1) & 033333333333; // field. + x = x - n; + x = (x + (x >> 3)) & 030707070707; // 6-bit sums. + return x%63; // Add 6-bit sums. +} + +/* An alternative to the "return" statement above is: + return ((x * 0404040404) >> 26) + // Add 6-bit sums. + (x >> 30); +which runs faster on most machines (suggested by Norbert Juffa). */ + +int pop3(unsigned x) +{ + unsigned n; + + n = (x >> 1) & 0x77777777; // Count bits in + x = x - n; // each 4-bit + n = (n >> 1) & 0x77777777; // field. + x = x - n; + n = (n >> 1) & 0x77777777; + x = x - n; + x = (x + (x >> 4)) & 0x0F0F0F0F; // Get byte sums. + x = x*0x01010101; // Add the bytes. + return x >> 24; +} + +int pop4(unsigned x) +{ + int n; + + n = 0; + while (x != 0) { + n = n + 1; + x = x & (x - 1); + } + return n; +} + +int pop5(unsigned x) +{ + int i, sum; + + // Rotate and sum method // Shift right & subtract + + sum = x; // sum = x; + for (i = 1; i <= 31; i++) { // while (x != 0) { + x = rotatel(x, 1); // x = x >> 1; + sum = sum + x; // sum = sum - x; + } // } + return -sum; // return sum; +} + +int pop5a(unsigned x) +{ + int sum; + + // Shift right & subtract + + sum = x; + while (x != 0) { + x = x >> 1; + sum = sum - x; + } + return sum; +} + +int pop6(unsigned x) +{ // Table lookup. + static char table[256] = { + 0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4, + 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, + 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, + 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, + + 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, + 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, + 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, + 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, + + 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, + 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, + 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, + 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, + + 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, + 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, + 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, + 4, 5, 5, 6, 5, 6, 6, 7, 5, 6, 6, 7, 6, 7, 7, 8}; + + return table[x & 0xFF] + + table[(x >> 8) & 0xFF] + + table[(x >> 16) & 0xFF] + + table[(x >> 24)]; +} + +// The following works only for 8-bit quantities. +int pop7(unsigned x) +{ + x = x*0x08040201; // Make 4 copies. + x = x >> 3; // So next step hits proper bits. + x = x & 0x11111111; // Every 4th bit. + x = x*0x11111111; // Sum the digits (each 0 or 1). + x = x >> 28; // Position the result. + return x; +} + +// The following works only for 7-bit quantities. +int pop8(unsigned x) +{ + x = x*0x02040810; // Make 4 copies, left-adjusted. + x = x & 0x11111111; // Every 4th bit. + x = x*0x11111111; // Sum the digits (each 0 or 1). + x = x >> 28; // Position the result. + return x; +} + +// The following works only for 15-bit quantities. +int pop9(unsigned x) +{ + unsigned long long y; + y = x * 0x0002000400080010ULL; + y = y & 0x1111111111111111ULL; + y = y * 0x1111111111111111ULL; + y = y >> 60; + return static_cast(y); +} + +int errors; +void error(int x, int y) +{ + errors = errors + 1; + std::printf("Error for x = %08x, got %08x\n", x, y); +} + +int main() +{ +# ifdef NDEBUG + + int i, n; + static unsigned test[] = {0,0, 1,1, 2,1, 3,2, 4,1, 5,2, 6,2, 7,3, + 8,1, 9,2, 10,2, 11,3, 12,2, 13,3, 14,3, 15,4, 16,1, 17,2, + 0x3F,6, 0x40,1, 0x41,2, 0x7f,7, 0x80,1, 0x81,2, 0xfe,7, 0xff,8, + 0x4000,1, 0x4001,2, 0x7000,3, 0x7fff,15, + 0x55555555,16, 0xAAAAAAAA, 16, 0xFF000000,8, 0xC0C0C0C0,8, + 0x0FFFFFF0,24, 0x80000000,1, 0xFFFFFFFF,32}; + + std::size_t const Count = 1000000; + + n = sizeof(test)/4; + + std::clock_t TimestampBeg = 0; + std::clock_t TimestampEnd = 0; + + TimestampBeg = std::clock(); + for (std::size_t k = 0; k < Count; ++k) + for (i = 0; i < n; i += 2) { + if (pop0(test[i]) != test[i+1]) error(test[i], pop0(test[i]));} + TimestampEnd = std::clock(); + + std::printf("pop0: %d clocks\n", static_cast(TimestampEnd - TimestampBeg)); + + TimestampBeg = std::clock(); + for (std::size_t k = 0; k < Count; ++k) + for (i = 0; i < n; i += 2) { + if (pop1(test[i]) != test[i+1]) error(test[i], pop1(test[i]));} + TimestampEnd = std::clock(); + + std::printf("pop1: %d clocks\n", static_cast(TimestampEnd - TimestampBeg)); + + TimestampBeg = std::clock(); + for (std::size_t k = 0; k < Count; ++k) + for (i = 0; i < n; i += 2) { + if (pop2(test[i]) != test[i+1]) error(test[i], pop2(test[i]));} + TimestampEnd = std::clock(); + + std::printf("pop2: %d clocks\n", static_cast(TimestampEnd - TimestampBeg)); + + TimestampBeg = std::clock(); + for (std::size_t k = 0; k < Count; ++k) + for (i = 0; i < n; i += 2) { + if (pop3(test[i]) != test[i+1]) error(test[i], pop3(test[i]));} + TimestampEnd = std::clock(); + + std::printf("pop3: %d clocks\n", static_cast(TimestampEnd - TimestampBeg)); + + TimestampBeg = std::clock(); + for (std::size_t k = 0; k < Count; ++k) + for (i = 0; i < n; i += 2) { + if (pop4(test[i]) != test[i+1]) error(test[i], pop4(test[i]));} + TimestampEnd = std::clock(); + + std::printf("pop4: %d clocks\n", static_cast(TimestampEnd - TimestampBeg)); + + TimestampBeg = std::clock(); + for (std::size_t k = 0; k < Count; ++k) + for (i = 0; i < n; i += 2) { + if (pop5(test[i]) != test[i+1]) error(test[i], pop5(test[i]));} + TimestampEnd = std::clock(); + + std::printf("pop5: %d clocks\n", static_cast(TimestampEnd - TimestampBeg)); + + TimestampBeg = std::clock(); + for (std::size_t k = 0; k < Count; ++k) + for (i = 0; i < n; i += 2) { + if (pop5a(test[i]) != test[i+1]) error(test[i], pop5a(test[i]));} + TimestampEnd = std::clock(); + + std::printf("pop5a: %d clocks\n", static_cast(TimestampEnd - TimestampBeg)); + + TimestampBeg = std::clock(); + for (std::size_t k = 0; k < Count; ++k) + for (i = 0; i < n; i += 2) { + if (pop6(test[i]) != test[i+1]) error(test[i], pop6(test[i]));} + TimestampEnd = std::clock(); + + std::printf("pop6: %d clocks\n", static_cast(TimestampEnd - TimestampBeg)); + + TimestampBeg = std::clock(); + for (std::size_t k = 0; k < Count; ++k) + for (i = 0; i < n; i += 2) { + if ((test[i] & 0xffffff00) == 0) + if (pop7(test[i]) != test[i+1]) error(test[i], pop7(test[i]));} + TimestampEnd = std::clock(); + + std::printf("pop7: %d clocks\n", static_cast(TimestampEnd - TimestampBeg)); + + TimestampBeg = std::clock(); + for (std::size_t k = 0; k < Count; ++k) + for (i = 0; i < n; i += 2) { + if ((test[i] & 0xffffff80) == 0) + if (pop8(test[i]) != test[i+1]) error(test[i], pop8(test[i]));} + TimestampEnd = std::clock(); + + std::printf("pop8: %d clocks\n", static_cast(TimestampEnd - TimestampBeg)); + + TimestampBeg = std::clock(); + for (std::size_t k = 0; k < Count; ++k) + for (i = 0; i < n; i += 2) { + if ((test[i] & 0xffff8000) == 0) + if (pop9(test[i]) != test[i+1]) error(test[i], pop9(test[i]));} + TimestampEnd = std::clock(); + + std::printf("pop9: %d clocks\n", static_cast(TimestampEnd - TimestampBeg)); + + if (errors == 0) + std::printf("Passed all %d cases.\n", static_cast(sizeof(test)/8)); + +# endif//NDEBUG +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_func_integer_find_lsb.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_func_integer_find_lsb.cpp new file mode 100644 index 0000000000000000000000000000000000000000..828a870732dd43ba087a0d203b7f2da2d16fb20b --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_func_integer_find_lsb.cpp @@ -0,0 +1,416 @@ +#include +#include +#include //To define "exit", req'd by XLC. +#include + +int nlz(unsigned x) +{ + int pop(unsigned x); + + x = x | (x >> 1); + x = x | (x >> 2); + x = x | (x >> 4); + x = x | (x >> 8); + x = x | (x >>16); + return pop(~x); +} + +int pop(unsigned x) +{ + x = x - ((x >> 1) & 0x55555555); + x = (x & 0x33333333) + ((x >> 2) & 0x33333333); + x = (x + (x >> 4)) & 0x0F0F0F0F; + x = x + (x << 8); + x = x + (x << 16); + return x >> 24; +} + +int ntz1(unsigned x) +{ + return 32 - nlz(~x & (x-1)); +} + +int ntz2(unsigned x) +{ + return pop(~x & (x - 1)); +} + +int ntz3(unsigned x) +{ + int n; + + if (x == 0) return(32); + n = 1; + if ((x & 0x0000FFFF) == 0) {n = n +16; x = x >>16;} + if ((x & 0x000000FF) == 0) {n = n + 8; x = x >> 8;} + if ((x & 0x0000000F) == 0) {n = n + 4; x = x >> 4;} + if ((x & 0x00000003) == 0) {n = n + 2; x = x >> 2;} + return n - (x & 1); +} + +int ntz4(unsigned x) +{ + unsigned y; + int n; + + if (x == 0) return 32; + n = 31; + y = x <<16; if (y != 0) {n = n -16; x = y;} + y = x << 8; if (y != 0) {n = n - 8; x = y;} + y = x << 4; if (y != 0) {n = n - 4; x = y;} + y = x << 2; if (y != 0) {n = n - 2; x = y;} + y = x << 1; if (y != 0) {n = n - 1;} + return n; +} + +int ntz4a(unsigned x) +{ + unsigned y; + int n; + + if (x == 0) return 32; + n = 31; + y = x <<16; if (y != 0) {n = n -16; x = y;} + y = x << 8; if (y != 0) {n = n - 8; x = y;} + y = x << 4; if (y != 0) {n = n - 4; x = y;} + y = x << 2; if (y != 0) {n = n - 2; x = y;} + n = n - ((x << 1) >> 31); + return n; +} + +int ntz5(char x) +{ + if (x & 15) { + if (x & 3) { + if (x & 1) return 0; + else return 1; + } + else if (x & 4) return 2; + else return 3; + } + else if (x & 0x30) { + if (x & 0x10) return 4; + else return 5; + } + else if (x & 0x40) return 6; + else if (x) return 7; + else return 8; +} + +int ntz6(unsigned x) +{ + int n; + + x = ~x & (x - 1); + n = 0; // n = 32; + while(x != 0) + { // while (x != 0) { + n = n + 1; // n = n - 1; + x = x >> 1; // x = x + x; + } // } + return n; // return n; +} + +int ntz6a(unsigned x) +{ + int n = 32; + + while (x != 0) { + n = n - 1; + x = x + x; + } + return n; +} + +/* Dean Gaudet's algorithm. To be most useful there must be a good way +to evaluate the C "conditional expression" (a?b:c construction) without +branching. The result of a?b:c is b if a is true (nonzero), and c if a +is false (0). + For example, a compare to zero op that sets a target GPR to 1 if the +operand is 0, and to 0 if the operand is nonzero, will do it. With this +instruction, the algorithm is entirely branch-free. But the most +interesting thing about it is the high degree of parallelism. All six +lines with conditional expressions can be executed in parallel (on a +machine with sufficient computational units). + Although the instruction count is 30 measured statically, it could +execute in only 10 cycles on a machine with sufficient parallelism. + The first two uses of y can instead be x, which would increase the +useful parallelism on most machines (the assignments to y, bz, and b4 +could then all run in parallel). */ + +int ntz7(unsigned x) +{ + unsigned y, bz, b4, b3, b2, b1, b0; + + y = x & -x; // Isolate rightmost 1-bit. + bz = y ? 0 : 1; // 1 if y = 0. + b4 = (y & 0x0000FFFF) ? 0 : 16; + b3 = (y & 0x00FF00FF) ? 0 : 8; + b2 = (y & 0x0F0F0F0F) ? 0 : 4; + b1 = (y & 0x33333333) ? 0 : 2; + b0 = (y & 0x55555555) ? 0 : 1; + return bz + b4 + b3 + b2 + b1 + b0; +} + +// This file has divisions by zero to test isnan +#if GLM_COMPILER & GLM_COMPILER_VC +# pragma warning(disable : 4800) +#endif + +int ntz7_christophe(unsigned x) +{ + unsigned y, bz, b4, b3, b2, b1, b0; + + y = x & -x; // Isolate rightmost 1-bit. + bz = unsigned(!bool(y)); // 1 if y = 0. + b4 = unsigned(!bool(y & 0x0000FFFF)) * 16; + b3 = unsigned(!bool(y & 0x00FF00FF)) * 8; + b2 = unsigned(!bool(y & 0x0F0F0F0F)) * 4; + b1 = unsigned(!bool(y & 0x33333333)) * 2; + b0 = unsigned(!bool(y & 0x55555555)) * 1; + return bz + b4 + b3 + b2 + b1 + b0; +} + +/* Below is David Seal's algorithm, found at +http://www.ciphersbyritter.com/NEWS4/BITCT.HTM Table +entries marked "u" are unused. 6 ops including a +multiply, plus an indexed load. */ + +#define u 99 +int ntz8(unsigned x) +{ + static char table[64] = + {32, 0, 1,12, 2, 6, u,13, 3, u, 7, u, u, u, u,14, + 10, 4, u, u, 8, u, u,25, u, u, u, u, u,21,27,15, + 31,11, 5, u, u, u, u, u, 9, u, u,24, u, u,20,26, + 30, u, u, u, u,23, u,19, 29, u,22,18,28,17,16, u}; + + x = (x & -x)*0x0450FBAF; + return table[x >> 26]; +} + +/* Seal's algorithm with multiply expanded. +9 elementary ops plus an indexed load. */ + +int ntz8a(unsigned x) +{ + static char table[64] = + {32, 0, 1,12, 2, 6, u,13, 3, u, 7, u, u, u, u,14, + 10, 4, u, u, 8, u, u,25, u, u, u, u, u,21,27,15, + 31,11, 5, u, u, u, u, u, 9, u, u,24, u, u,20,26, + 30, u, u, u, u,23, u,19, 29, u,22,18,28,17,16, u}; + + x = (x & -x); + x = (x << 4) + x; // x = x*17. + x = (x << 6) + x; // x = x*65. + x = (x << 16) - x; // x = x*65535. + return table[x >> 26]; +} + +/* Reiser's algorithm. Three ops including a "remainder," +plus an indexed load. */ + +int ntz9(unsigned x) +{ + static char table[37] = { + 32, 0, 1, 26, 2, 23, 27, + u, 3, 16, 24, 30, 28, 11, u, 13, 4, + 7, 17, u, 25, 22, 31, 15, 29, 10, 12, + 6, u, 21, 14, 9, 5, 20, 8, 19, 18}; + + x = (x & -x)%37; + return table[x]; +} + +/* Using a de Bruijn sequence. This is a table lookup with a 32-entry +table. The de Bruijn sequence used here is + 0000 0100 1101 0111 0110 0101 0001 1111, +obtained from Danny Dube's October 3, 1997, posting in +comp.compression.research. Thanks to Norbert Juffa for this reference. */ + +int ntz10(unsigned x) { + + static char table[32] = + { 0, 1, 2,24, 3,19, 6,25, 22, 4,20,10,16, 7,12,26, + 31,23,18, 5,21, 9,15,11, 30,17, 8,14,29,13,28,27}; + + if (x == 0) return 32; + x = (x & -x)*0x04D7651F; + return table[x >> 27]; +} + +/* Norbert Juffa's code, answer to exercise 1 of Chapter 5 (2nd ed). */ + +#define SLOW_MUL +int ntz11 (unsigned int n) { + + static unsigned char tab[32] = + { 0, 1, 2, 24, 3, 19, 6, 25, + 22, 4, 20, 10, 16, 7, 12, 26, + 31, 23, 18, 5, 21, 9, 15, 11, + 30, 17, 8, 14, 29, 13, 28, 27 + }; + unsigned int k; + n = n & (-n); /* isolate lsb */ + printf("n = %d\n", n); +#if defined(SLOW_MUL) + k = (n << 11) - n; + k = (k << 2) + k; + k = (k << 8) + n; + k = (k << 5) - k; +#else + k = n * 0x4d7651f; +#endif + return n ? tab[k>>27] : 32; +} + +int errors; +void error(int x, int y) { + errors = errors + 1; + std::printf("Error for x = %08x, got %d\n", x, y); +} + +int main() +{ +# ifdef NDEBUG + + int i, m, n; + static unsigned test[] = {0,32, 1,0, 2,1, 3,0, 4,2, 5,0, 6,1, 7,0, + 8,3, 9,0, 16,4, 32,5, 64,6, 128,7, 255,0, 256,8, 512,9, 1024,10, + 2048,11, 4096,12, 8192,13, 16384,14, 32768,15, 65536,16, + 0x20000,17, 0x40000,18, 0x80000,19, 0x100000,20, 0x200000,21, + 0x400000,22, 0x800000,23, 0x1000000,24, 0x2000000,25, + 0x4000000,26, 0x8000000,27, 0x10000000,28, 0x20000000,29, + 0x40000000,30, 0x80000000,31, 0xFFFFFFF0,4, 0x3000FF00,8, + 0xC0000000,30, 0x60000000,29, 0x00011000, 12}; + + std::size_t const Count = 1000; + + n = sizeof(test)/4; + + std::clock_t TimestampBeg = 0; + std::clock_t TimestampEnd = 0; + + TimestampBeg = std::clock(); + for (std::size_t k = 0; k < Count; ++k) + for (i = 0; i < n; i += 2) { + if (ntz1(test[i]) != test[i+1]) error(test[i], ntz1(test[i]));} + TimestampEnd = std::clock(); + + std::printf("ntz1: %d clocks\n", static_cast(TimestampEnd - TimestampBeg)); + + TimestampBeg = std::clock(); + for (std::size_t k = 0; k < Count; ++k) + for (i = 0; i < n; i += 2) { + if (ntz2(test[i]) != test[i+1]) error(test[i], ntz2(test[i]));} + TimestampEnd = std::clock(); + + std::printf("ntz2: %d clocks\n", static_cast(TimestampEnd - TimestampBeg)); + + TimestampBeg = std::clock(); + for (std::size_t k = 0; k < Count; ++k) + for (i = 0; i < n; i += 2) { + if (ntz3(test[i]) != test[i+1]) error(test[i], ntz3(test[i]));} + TimestampEnd = std::clock(); + + std::printf("ntz3: %d clocks\n", static_cast(TimestampEnd - TimestampBeg)); + + TimestampBeg = std::clock(); + for (std::size_t k = 0; k < Count; ++k) + for (i = 0; i < n; i += 2) { + if (ntz4(test[i]) != test[i+1]) error(test[i], ntz4(test[i]));} + TimestampEnd = std::clock(); + + std::printf("ntz4: %d clocks\n", static_cast(TimestampEnd - TimestampBeg)); + + TimestampBeg = std::clock(); + for (std::size_t k = 0; k < Count; ++k) + for (i = 0; i < n; i += 2) { + if (ntz4a(test[i]) != test[i+1]) error(test[i], ntz4a(test[i]));} + TimestampEnd = std::clock(); + + std::printf("ntz4a: %d clocks\n", static_cast(TimestampEnd - TimestampBeg)); + + TimestampBeg = std::clock(); + for(std::size_t k = 0; k < Count; ++k) + for(i = 0; i < n; i += 2) + { + m = test[i+1]; + if(m > 8) + m = 8; + if(ntz5(static_cast(test[i])) != m) + error(test[i], ntz5(static_cast(test[i]))); + } + TimestampEnd = std::clock(); + + std::printf("ntz5: %d clocks\n", static_cast(TimestampEnd - TimestampBeg)); + + TimestampBeg = std::clock(); + for (std::size_t k = 0; k < Count; ++k) + for (i = 0; i < n; i += 2) { + if (ntz6(test[i]) != test[i+1]) error(test[i], ntz6(test[i]));} + TimestampEnd = std::clock(); + + std::printf("ntz6: %d clocks\n", static_cast(TimestampEnd - TimestampBeg)); + + TimestampBeg = std::clock(); + for (std::size_t k = 0; k < Count; ++k) + for (i = 0; i < n; i += 2) { + if (ntz6a(test[i]) != test[i+1]) error(test[i], ntz6a(test[i]));} + TimestampEnd = std::clock(); + + std::printf("ntz6a: %d clocks\n", static_cast(TimestampEnd - TimestampBeg)); + + TimestampBeg = std::clock(); + for (std::size_t k = 0; k < Count; ++k) + for (i = 0; i < n; i += 2) { + if (ntz7(test[i]) != test[i+1]) error(test[i], ntz7(test[i]));} + TimestampEnd = std::clock(); + + std::printf("ntz7: %d clocks\n", static_cast(TimestampEnd - TimestampBeg)); + + TimestampBeg = std::clock(); + for (std::size_t k = 0; k < Count; ++k) + for (i = 0; i < n; i += 2) { + if (ntz7_christophe(test[i]) != test[i+1]) error(test[i], ntz7(test[i]));} + TimestampEnd = std::clock(); + + std::printf("ntz7_christophe: %d clocks\n", static_cast(TimestampEnd - TimestampBeg)); + + TimestampBeg = std::clock(); + for (std::size_t k = 0; k < Count; ++k) + for (i = 0; i < n; i += 2) { + if (ntz8(test[i]) != test[i+1]) error(test[i], ntz8(test[i]));} + TimestampEnd = std::clock(); + + std::printf("ntz8: %d clocks\n", static_cast(TimestampEnd - TimestampBeg)); + + TimestampBeg = std::clock(); + for (std::size_t k = 0; k < Count; ++k) + for (i = 0; i < n; i += 2) { + if (ntz8a(test[i]) != test[i+1]) error(test[i], ntz8a(test[i]));} + TimestampEnd = std::clock(); + + std::printf("ntz8a: %d clocks\n", static_cast(TimestampEnd - TimestampBeg)); + + TimestampBeg = std::clock(); + for (std::size_t k = 0; k < Count; ++k) + for (i = 0; i < n; i += 2) { + if (ntz9(test[i]) != test[i+1]) error(test[i], ntz9(test[i]));} + TimestampEnd = std::clock(); + + std::printf("ntz9: %d clocks\n", static_cast(TimestampEnd - TimestampBeg)); + + TimestampBeg = std::clock(); + for (std::size_t k = 0; k < Count; ++k) + for (i = 0; i < n; i += 2) { + if (ntz10(test[i]) != test[i+1]) error(test[i], ntz10(test[i]));} + TimestampEnd = std::clock(); + + std::printf("ntz10: %d clocks\n", static_cast(TimestampEnd - TimestampBeg)); + + if (errors == 0) + std::printf("Passed all %d cases.\n", static_cast(sizeof(test)/8)); + +# endif//NDEBUG +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_func_integer_find_msb.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_func_integer_find_msb.cpp new file mode 100644 index 0000000000000000000000000000000000000000..f771d86c4f8662c2b86bb048632d459541328d57 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_func_integer_find_msb.cpp @@ -0,0 +1,440 @@ +#include +#include +#include // To define "exit", req'd by XLC. +#include + +#define LE 1 // 1 for little-endian, 0 for big-endian. + +int pop(unsigned x) { + x = x - ((x >> 1) & 0x55555555); + x = (x & 0x33333333) + ((x >> 2) & 0x33333333); + x = (x + (x >> 4)) & 0x0F0F0F0F; + x = x + (x << 8); + x = x + (x << 16); + return x >> 24; +} + +int nlz1(unsigned x) { + int n; + + if (x == 0) return(32); + n = 0; + if (x <= 0x0000FFFF) {n = n +16; x = x <<16;} + if (x <= 0x00FFFFFF) {n = n + 8; x = x << 8;} + if (x <= 0x0FFFFFFF) {n = n + 4; x = x << 4;} + if (x <= 0x3FFFFFFF) {n = n + 2; x = x << 2;} + if (x <= 0x7FFFFFFF) {n = n + 1;} + return n; +} + +int nlz1a(unsigned x) { + int n; + +/* if (x == 0) return(32); */ + if (static_cast(x) <= 0) return (~x >> 26) & 32; + n = 1; + if ((x >> 16) == 0) {n = n +16; x = x <<16;} + if ((x >> 24) == 0) {n = n + 8; x = x << 8;} + if ((x >> 28) == 0) {n = n + 4; x = x << 4;} + if ((x >> 30) == 0) {n = n + 2; x = x << 2;} + n = n - (x >> 31); + return n; +} +// On basic Risc, 12 to 20 instructions. + +int nlz2(unsigned x) { + unsigned y; + int n; + + n = 32; + y = x >>16; if (y != 0) {n = n -16; x = y;} + y = x >> 8; if (y != 0) {n = n - 8; x = y;} + y = x >> 4; if (y != 0) {n = n - 4; x = y;} + y = x >> 2; if (y != 0) {n = n - 2; x = y;} + y = x >> 1; if (y != 0) return n - 2; + return n - x; +} + +// As above but coded as a loop for compactness: +// 23 to 33 basic Risc instructions. +int nlz2a(unsigned x) { + unsigned y; + int n, c; + + n = 32; + c = 16; + do { + y = x >> c; if (y != 0) {n = n - c; x = y;} + c = c >> 1; + } while (c != 0); + return n - x; +} + +int nlz3(int x) { + int y, n; + + n = 0; + y = x; +L: if (x < 0) return n; + if (y == 0) return 32 - n; + n = n + 1; + x = x << 1; + y = y >> 1; + goto L; +} + +int nlz4(unsigned x) { + int y, m, n; + + y = -(x >> 16); // If left half of x is 0, + m = (y >> 16) & 16; // set n = 16. If left half + n = 16 - m; // is nonzero, set n = 0 and + x = x >> m; // shift x right 16. + // Now x is of the form 0000xxxx. + y = x - 0x100; // If positions 8-15 are 0, + m = (y >> 16) & 8; // add 8 to n and shift x left 8. + n = n + m; + x = x << m; + + y = x - 0x1000; // If positions 12-15 are 0, + m = (y >> 16) & 4; // add 4 to n and shift x left 4. + n = n + m; + x = x << m; + + y = x - 0x4000; // If positions 14-15 are 0, + m = (y >> 16) & 2; // add 2 to n and shift x left 2. + n = n + m; + x = x << m; + + y = x >> 14; // Set y = 0, 1, 2, or 3. + m = y & ~(y >> 1); // Set m = 0, 1, 2, or 2 resp. + return n + 2 - m; +} + +int nlz5(unsigned x) { + int pop(unsigned x); + + x = x | (x >> 1); + x = x | (x >> 2); + x = x | (x >> 4); + x = x | (x >> 8); + x = x | (x >>16); + return pop(~x); +} + +/* The four programs below are not valid ANSI C programs. This is +because they refer to the same storage locations as two different types. +However, they work with xlc/AIX, gcc/AIX, and gcc/NT. If you try to +code them more compactly by declaring a variable xx to be "double," and +then using + + n = 1054 - (*((unsigned *)&xx + LE) >> 20); + +then you are violating not only the rule above, but also the ANSI C +rule that pointer arithmetic can be performed only on pointers to +array elements. + When coded with the above statement, the program fails with xlc, +gcc/AIX, and gcc/NT, at some optimization levels. + BTW, these programs use the "anonymous union" feature of C++, not +available in C. */ + +int nlz6(unsigned k) +{ + union { + unsigned asInt[2]; + double asDouble; + }; + int n; + + asDouble = static_cast(k) + 0.5; + n = 1054 - (asInt[LE] >> 20); + return n; +} + +int nlz7(unsigned k) +{ + union { + unsigned asInt[2]; + double asDouble; + }; + int n; + + asDouble = static_cast(k); + n = 1054 - (asInt[LE] >> 20); + n = (n & 31) + (n >> 9); + return n; +} + + /* In single qualifier, round-to-nearest mode, the basic method fails for: + k = 0, k = 01FFFFFF, 03FFFFFE <= k <= 03FFFFFF, + 07FFFFFC <= k <= 07FFFFFF, + 0FFFFFF8 <= k <= 0FFFFFFF, + ... + 7FFFFFC0 <= k <= 7FFFFFFF. + FFFFFF80 <= k <= FFFFFFFF. + For k = 0 it gives 158, and for the other values it is too low by 1. */ + +int nlz8(unsigned k) +{ + union { + unsigned asInt; + float asFloat; + }; + int n; + + k = k & ~(k >> 1); /* Fix problem with rounding. */ + asFloat = static_cast(k) + 0.5f; + n = 158 - (asInt >> 23); + return n; +} + +/* The example below shows how to make a macro for nlz. It uses an +extension to the C and C++ languages that is provided by the GNU C/C++ +compiler, namely, that of allowing statements and declarations in +expressions (see "Using and Porting GNU CC", by Richard M. Stallman +(1998). The underscores are necessary to protect against the +possibility that the macro argument will conflict with one of its local +variables, e.g., NLZ(k). */ + +int nlz9(unsigned k) +{ + union { + unsigned asInt; + float asFloat; + }; + int n; + + k = k & ~(k >> 1); /* Fix problem with rounding. */ + asFloat = static_cast(k); + n = 158 - (asInt >> 23); + n = (n & 31) + (n >> 6); /* Fix problem with k = 0. */ + return n; +} + +/* Below are three nearly equivalent programs for computing the number +of leading zeros in a word. This material is not in HD, but may be in a +future edition. + Immediately below is Robert Harley's algorithm, found at the +comp.arch newsgroup entry dated 7/12/96, pointed out to me by Norbert +Juffa. + Table entries marked "u" are unused. 14 ops including a multiply, +plus an indexed load. + The smallest multiplier that works is 0x045BCED1 = 17*65*129*513 (all +of form 2**k + 1). There are no multipliers of three terms of the form +2**k +- 1 that work, with a table size of 64 or 128. There are some, +with a table size of 64, if you precede the multiplication with x = x - +(x >> 1), but that seems less elegant. There are also some if you use a +table size of 256, the smallest is 0x01033CBF = 65*255*1025 (this would +save two instructions in the form of this algorithm with the +multiplication expanded into shifts and adds, but the table size is +getting a bit large). */ + +#define u 99 +int nlz10(unsigned x) +{ + static char table[64] = + {32,31, u,16, u,30, 3, u, 15, u, u, u,29,10, 2, u, + u, u,12,14,21, u,19, u, u,28, u,25, u, 9, 1, u, + 17, u, 4, u, u, u,11, u, 13,22,20, u,26, u, u,18, + 5, u, u,23, u,27, u, 6, u,24, 7, u, 8, u, 0, u}; + + x = x | (x >> 1); // Propagate leftmost + x = x | (x >> 2); // 1-bit to the right. + x = x | (x >> 4); + x = x | (x >> 8); + x = x | (x >>16); + x = x*0x06EB14F9; // Multiplier is 7*255**3. + return table[x >> 26]; +} + +/* Harley's algorithm with multiply expanded. +19 elementary ops plus an indexed load. */ + +int nlz10a(unsigned x) +{ + static char table[64] = + {32,31, u,16, u,30, 3, u, 15, u, u, u,29,10, 2, u, + u, u,12,14,21, u,19, u, u,28, u,25, u, 9, 1, u, + 17, u, 4, u, u, u,11, u, 13,22,20, u,26, u, u,18, + 5, u, u,23, u,27, u, 6, u,24, 7, u, 8, u, 0, u}; + + x = x | (x >> 1); // Propagate leftmost + x = x | (x >> 2); // 1-bit to the right. + x = x | (x >> 4); + x = x | (x >> 8); + x = x | (x >> 16); + x = (x << 3) - x; // Multiply by 7. + x = (x << 8) - x; // Multiply by 255. + x = (x << 8) - x; // Again. + x = (x << 8) - x; // Again. + return table[x >> 26]; +} + +/* Julius Goryavsky's version of Harley's algorithm. +17 elementary ops plus an indexed load, if the machine +has "and not." */ + +int nlz10b(unsigned x) +{ + static char table[64] = + {32,20,19, u, u,18, u, 7, 10,17, u, u,14, u, 6, u, + u, 9, u,16, u, u, 1,26, u,13, u, u,24, 5, u, u, + u,21, u, 8,11, u,15, u, u, u, u, 2,27, 0,25, u, + 22, u,12, u, u, 3,28, u, 23, u, 4,29, u, u,30,31}; + + x = x | (x >> 1); // Propagate leftmost + x = x | (x >> 2); // 1-bit to the right. + x = x | (x >> 4); + x = x | (x >> 8); + x = x & ~(x >> 16); + x = x*0xFD7049FF; // Activate this line or the following 3. + // x = (x << 9) - x; // Multiply by 511. + // x = (x << 11) - x; // Multiply by 2047. + // x = (x << 14) - x; // Multiply by 16383. + return table[x >> 26]; +} + +int errors; +void error(int x, int y) +{ + errors = errors + 1; + std::printf("Error for x = %08x, got %d\n", x, y); +} + +int main() +{ +# ifdef NDEBUG + + int i, n; + static unsigned test[] = {0,32, 1,31, 2,30, 3,30, 4,29, 5,29, 6,29, + 7,29, 8,28, 9,28, 16,27, 32,26, 64,25, 128,24, 255,24, 256,23, + 512,22, 1024,21, 2048,20, 4096,19, 8192,18, 16384,17, 32768,16, + 65536,15, 0x20000,14, 0x40000,13, 0x80000,12, 0x100000,11, + 0x200000,10, 0x400000,9, 0x800000,8, 0x1000000,7, 0x2000000,6, + 0x4000000,5, 0x8000000,4, 0x0FFFFFFF,4, 0x10000000,3, + 0x3000FFFF,2, 0x50003333,1, 0x7FFFFFFF,1, 0x80000000,0, + 0xFFFFFFFF,0}; + std::size_t const Count = 1000; + + n = sizeof(test)/4; + + std::clock_t TimestampBeg = 0; + std::clock_t TimestampEnd = 0; + + TimestampBeg = std::clock(); + for (std::size_t k = 0; k < Count; ++k) + for (i = 0; i < n; i += 2) { + if (nlz1(test[i]) != test[i+1]) error(test[i], nlz1(test[i]));} + TimestampEnd = std::clock(); + + std::printf("nlz1: %d clocks\n", static_cast(TimestampEnd - TimestampBeg)); + + TimestampBeg = std::clock(); + for (std::size_t k = 0; k < Count; ++k) + for (i = 0; i < n; i += 2) { + if (nlz1a(test[i]) != test[i+1]) error(test[i], nlz1a(test[i]));} + TimestampEnd = std::clock(); + + std::printf("nlz1a: %d clocks\n", static_cast(TimestampEnd - TimestampBeg)); + + TimestampBeg = std::clock(); + for (std::size_t k = 0; k < Count; ++k) + for (i = 0; i < n; i += 2) { + if (nlz2(test[i]) != test[i+1]) error(test[i], nlz2(test[i]));} + TimestampEnd = std::clock(); + + std::printf("nlz2: %d clocks\n", static_cast(TimestampEnd - TimestampBeg)); + + TimestampBeg = std::clock(); + for (std::size_t k = 0; k < Count; ++k) + for (i = 0; i < n; i += 2) { + if (nlz2a(test[i]) != test[i+1]) error(test[i], nlz2a(test[i]));} + TimestampEnd = std::clock(); + + std::printf("nlz2a: %d clocks\n", static_cast(TimestampEnd - TimestampBeg)); + + TimestampBeg = std::clock(); + for (std::size_t k = 0; k < Count; ++k) + for (i = 0; i < n; i += 2) { + if (nlz3(test[i]) != test[i+1]) error(test[i], nlz3(test[i]));} + TimestampEnd = std::clock(); + + std::printf("nlz3: %d clocks\n", static_cast(TimestampEnd - TimestampBeg)); + + TimestampBeg = std::clock(); + for (std::size_t k = 0; k < Count; ++k) + for (i = 0; i < n; i += 2) { + if (nlz4(test[i]) != test[i+1]) error(test[i], nlz4(test[i]));} + TimestampEnd = std::clock(); + + std::printf("nlz4: %d clocks\n", static_cast(TimestampEnd - TimestampBeg)); + + TimestampBeg = std::clock(); + for (std::size_t k = 0; k < Count; ++k) + for (i = 0; i < n; i += 2) { + if (nlz5(test[i]) != test[i+1]) error(test[i], nlz5(test[i]));} + TimestampEnd = std::clock(); + + std::printf("nlz5: %d clocks\n", static_cast(TimestampEnd - TimestampBeg)); + + TimestampBeg = std::clock(); + for (std::size_t k = 0; k < Count; ++k) + for (i = 0; i < n; i += 2) { + if (nlz6(test[i]) != test[i+1]) error(test[i], nlz6(test[i]));} + TimestampEnd = std::clock(); + + std::printf("nlz6: %d clocks\n", static_cast(TimestampEnd - TimestampBeg)); + + TimestampBeg = std::clock(); + for (std::size_t k = 0; k < Count; ++k) + for (i = 0; i < n; i += 2) { + if (nlz7(test[i]) != test[i+1]) error(test[i], nlz7(test[i]));} + TimestampEnd = std::clock(); + + std::printf("nlz7: %d clocks\n", static_cast(TimestampEnd - TimestampBeg)); + + TimestampBeg = std::clock(); + for (std::size_t k = 0; k < Count; ++k) + for (i = 0; i < n; i += 2) { + if (nlz8(test[i]) != test[i+1]) error(test[i], nlz8(test[i]));} + TimestampEnd = std::clock(); + + std::printf("nlz8: %d clocks\n", static_cast(TimestampEnd - TimestampBeg)); + + TimestampBeg = std::clock(); + for (std::size_t k = 0; k < Count; ++k) + for (i = 0; i < n; i += 2) { + if (nlz9(test[i]) != test[i+1]) error(test[i], nlz9(test[i]));} + TimestampEnd = std::clock(); + + std::printf("nlz9: %d clocks\n", static_cast(TimestampEnd - TimestampBeg)); + + TimestampBeg = std::clock(); + for (std::size_t k = 0; k < Count; ++k) + for (i = 0; i < n; i += 2) { + if (nlz10(test[i]) != test[i+1]) error(test[i], nlz10(test[i]));} + TimestampEnd = std::clock(); + + std::printf("nlz10: %d clocks\n", static_cast(TimestampEnd - TimestampBeg)); + + TimestampBeg = std::clock(); + for (std::size_t k = 0; k < Count; ++k) + for (i = 0; i < n; i += 2) { + if (nlz10a(test[i]) != test[i+1]) error(test[i], nlz10a(test[i]));} + TimestampEnd = std::clock(); + + std::printf("nlz10a: %d clocks\n", static_cast(TimestampEnd - TimestampBeg)); + + TimestampBeg = std::clock(); + for (std::size_t k = 0; k < Count; ++k) + for (i = 0; i < n; i += 2) { + if (nlz10b(test[i]) != test[i+1]) error(test[i], nlz10b(test[i]));} + TimestampEnd = std::clock(); + + std::printf("nlz10b: %d clocks\n", static_cast(TimestampEnd - TimestampBeg)); + + if (errors == 0) + std::printf("Passed all %d cases.\n", static_cast(sizeof(test)/8)); + +# endif//NDEBUG +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_func_matrix.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_func_matrix.cpp new file mode 100644 index 0000000000000000000000000000000000000000..929051995a88599203526f7184c263eccc0ac0fd --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_func_matrix.cpp @@ -0,0 +1,392 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace glm; + +int test_matrixCompMult() +{ + int Error(0); + + { + mat2 m(0, 1, 2, 3); + mat2 n = matrixCompMult(m, m); + mat2 expected = mat2(0, 1, 4, 9); + Error += all(equal(n, expected, epsilon())) ? 0 : 1; + } + + { + mat2x3 m(0, 1, 2, 3, 4, 5); + mat2x3 n = matrixCompMult(m, m); + mat2x3 expected = mat2x3(0, 1, 4, 9, 16, 25); + Error += all(equal(n, expected, epsilon())) ? 0 : 1; + } + + { + mat2x4 m(0, 1, 2, 3, 4, 5, 6, 7); + mat2x4 n = matrixCompMult(m, m); + mat2x4 expected = mat2x4(0, 1, 4, 9, 16, 25, 36, 49); + Error += all(equal(n, expected, epsilon())) ? 0 : 1; + } + + { + mat3 m(0, 1, 2, 3, 4, 5, 6, 7, 8); + mat3 n = matrixCompMult(m, m); + mat3 expected = mat3(0, 1, 4, 9, 16, 25, 36, 49, 64); + Error += all(equal(n, expected, epsilon())) ? 0 : 1; + } + + { + mat3x2 m(0, 1, 2, 3, 4, 5); + mat3x2 n = matrixCompMult(m, m); + mat3x2 expected = mat3x2(0, 1, 4, 9, 16, 25); + Error += all(equal(n, expected, epsilon())) ? 0 : 1; + } + + { + mat3x4 m(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11); + mat3x4 n = matrixCompMult(m, m); + mat3x4 expected = mat3x4(0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121); + Error += all(equal(n, expected, epsilon())) ? 0 : 1; + } + + { + mat4 m(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); + mat4 n = matrixCompMult(m, m); + mat4 expected = mat4(0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 225); + Error += all(equal(n, expected, epsilon())) ? 0 : 1; + } + + { + mat4x2 m(0, 1, 2, 3, 4, 5, 6, 7); + mat4x2 n = matrixCompMult(m, m); + mat4x2 expected = mat4x2(0, 1, 4, 9, 16, 25, 36, 49); + Error += all(equal(n, expected, epsilon())) ? 0 : 1; + } + + { + mat4x3 m(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11); + mat4x3 n = matrixCompMult(m, m); + mat4x3 expected = mat4x3(0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121); + Error += all(equal(n, expected, epsilon())) ? 0 : 1; + } + + return Error; +} + +int test_outerProduct() +{ + { glm::mat2 m = glm::outerProduct(glm::vec2(1.0f), glm::vec2(1.0f)); } + { glm::mat3 m = glm::outerProduct(glm::vec3(1.0f), glm::vec3(1.0f)); } + { glm::mat4 m = glm::outerProduct(glm::vec4(1.0f), glm::vec4(1.0f)); } + + { glm::mat2x3 m = glm::outerProduct(glm::vec3(1.0f), glm::vec2(1.0f)); } + { glm::mat2x4 m = glm::outerProduct(glm::vec4(1.0f), glm::vec2(1.0f)); } + + { glm::mat3x2 m = glm::outerProduct(glm::vec2(1.0f), glm::vec3(1.0f)); } + { glm::mat3x4 m = glm::outerProduct(glm::vec4(1.0f), glm::vec3(1.0f)); } + + { glm::mat4x2 m = glm::outerProduct(glm::vec2(1.0f), glm::vec4(1.0f)); } + { glm::mat4x3 m = glm::outerProduct(glm::vec3(1.0f), glm::vec4(1.0f)); } + + return 0; +} + +int test_transpose() +{ + int Error(0); + + { + mat2 const m(0, 1, 2, 3); + mat2 const t = transpose(m); + mat2 const expected = mat2(0, 2, 1, 3); + Error += all(equal(t, expected, epsilon())) ? 0 : 1; + } + + { + mat2x3 m(0, 1, 2, 3, 4, 5); + mat3x2 t = transpose(m); + mat3x2 const expected = mat3x2(0, 3, 1, 4, 2, 5); + Error += all(equal(t, expected, epsilon())) ? 0 : 1; + } + + { + mat2x4 m(0, 1, 2, 3, 4, 5, 6, 7); + mat4x2 t = transpose(m); + mat4x2 const expected = mat4x2(0, 4, 1, 5, 2, 6, 3, 7); + Error += all(equal(t, expected, epsilon())) ? 0 : 1; + } + + { + mat3 m(0, 1, 2, 3, 4, 5, 6, 7, 8); + mat3 t = transpose(m); + mat3 const expected = mat3(0, 3, 6, 1, 4, 7, 2, 5, 8); + Error += all(equal(t, expected, epsilon())) ? 0 : 1; + } + + { + mat3x2 m(0, 1, 2, 3, 4, 5); + mat2x3 t = transpose(m); + mat2x3 const expected = mat2x3(0, 2, 4, 1, 3, 5); + Error += all(equal(t, expected, epsilon())) ? 0 : 1; + } + + { + mat3x4 m(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11); + mat4x3 t = transpose(m); + mat4x3 const expected = mat4x3(0, 4, 8, 1, 5, 9, 2, 6, 10, 3, 7, 11); + Error += all(equal(t, expected, epsilon())) ? 0 : 1; + } + + { + mat4 m(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); + mat4 t = transpose(m); + mat4 const expected = mat4(0, 4, 8, 12, 1, 5, 9, 13, 2, 6, 10, 14, 3, 7, 11, 15); + Error += all(equal(t, expected, epsilon())) ? 0 : 1; + } + + { + mat4x2 m(0, 1, 2, 3, 4, 5, 6, 7); + mat2x4 t = transpose(m); + mat2x4 const expected = mat2x4(0, 2, 4, 6, 1, 3, 5, 7); + Error += all(equal(t, expected, epsilon())) ? 0 : 1; + } + + { + mat4x3 m(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11); + mat3x4 t = transpose(m); + mat3x4 const expected = mat3x4(0, 3, 6, 9, 1, 4, 7, 10, 2, 5, 8, 11); + Error += all(equal(t, expected, epsilon())) ? 0 : 1; + } + + return Error; +} + +int test_determinant() +{ + + + return 0; +} + +int test_inverse() +{ + int Error = 0; + + { + glm::mat4x4 A4x4( + glm::vec4(1, 0, 1, 0), + glm::vec4(0, 1, 0, 0), + glm::vec4(0, 0, 1, 0), + glm::vec4(0, 0, 0, 1)); + glm::mat4x4 B4x4 = inverse(A4x4); + glm::mat4x4 I4x4 = A4x4 * B4x4; + glm::mat4x4 Identity(1); + Error += all(equal(I4x4, Identity, epsilon())) ? 0 : 1; + } + + { + glm::mat3x3 A3x3( + glm::vec3(1, 0, 1), + glm::vec3(0, 1, 0), + glm::vec3(0, 0, 1)); + glm::mat3x3 B3x3 = glm::inverse(A3x3); + glm::mat3x3 I3x3 = A3x3 * B3x3; + glm::mat3x3 Identity(1); + Error += all(equal(I3x3, Identity, epsilon())) ? 0 : 1; + } + + { + glm::mat2x2 A2x2( + glm::vec2(1, 1), + glm::vec2(0, 1)); + glm::mat2x2 B2x2 = glm::inverse(A2x2); + glm::mat2x2 I2x2 = A2x2 * B2x2; + glm::mat2x2 Identity(1); + Error += all(equal(I2x2, Identity, epsilon())) ? 0 : 1; + } + + return Error; +} + +int test_inverse_simd() +{ + int Error = 0; + + glm::mat4x4 const Identity(1); + + glm::mat4x4 const A4x4( + glm::vec4(1, 0, 1, 0), + glm::vec4(0, 1, 0, 0), + glm::vec4(0, 0, 1, 0), + glm::vec4(0, 0, 0, 1)); + glm::mat4x4 const B4x4 = glm::inverse(A4x4); + glm::mat4x4 const I4x4 = A4x4 * B4x4; + + Error += glm::all(glm::equal(I4x4, Identity, 0.001f)) ? 0 : 1; + + return Error; +} + +int test_shearing() +{ + int Error = 0; + + { + glm::vec3 const center(0, 0, 0); + glm::vec2 const l_x(2, 0); + glm::vec2 const l_y(0, 0); + glm::vec2 const l_z(0, 0); + glm::mat4x4 const A4x4( + glm::vec4(0, 0, 1, 1), + glm::vec4(0, 1, 1, 0), + glm::vec4(1, 1, 1, 0), + glm::vec4(1, 1, 0, 1)); + glm::mat4x4 const B4x4 = glm::shear(A4x4, center, l_x, l_y, l_z); + glm::mat4x4 const expected( + glm::vec4(0, 0, 1, 1), + glm::vec4(2, 1, 1, 0), + glm::vec4(3, 1, 1, 0), + glm::vec4(3, 1, 0, 1)); + Error += all(equal(B4x4, expected, epsilon())) ? 0 : 1; + } + + { + glm::vec3 const center(0, 0, 0); + glm::vec2 const l_x(1, 0); + glm::vec2 const l_y(0, 1); + glm::vec2 const l_z(1, 0); + glm::mat4x4 const A4x4( + glm::vec4(0, 0, 1, 0), + glm::vec4(0, 1, 1, 0), + glm::vec4(1, 1, 1, 0), + glm::vec4(1, 0, 0, 0)); + glm::mat4x4 const B4x4 = glm::shear(A4x4, center, l_x, l_y, l_z); + glm::mat4x4 const expected( + glm::vec4(0, 1, 1, 0), + glm::vec4(1, 2, 1, 0), + glm::vec4(2, 2, 2, 0), + glm::vec4(1, 0, 1, 0)); + Error += all(equal(B4x4, expected, epsilon())) ? 0 : 1; + } + + { + glm::vec3 const center(3, 2, 1); + glm::vec2 const l_x(1, 2); + glm::vec2 const l_y(3, 1); + glm::vec2 const l_z(4, 5); + glm::mat4x4 const A4x4(1); + glm::mat4x4 const B4x4 = glm::shear(A4x4, center, l_x, l_y, l_z); + glm::mat4x4 const expected( + glm::vec4(1, 3, 4, 0), + glm::vec4(1, 1, 5, 0), + glm::vec4(2, 1, 1, 0), + glm::vec4(-9, -8, -9, 1)); + Error += all(equal(B4x4, expected, epsilon())) ? 0 : 1; + } + + { + glm::vec3 const center(3, 2, 1); + glm::vec2 const l_x(1, 2); + glm::vec2 const l_y(3, 1); + glm::vec2 const l_z(4, 5); + glm::mat4x4 const A4x4( + glm::vec4(-3, 2, 1, 0), + glm::vec4(3, 2, 1, 0), + glm::vec4(4, -8, 0, 0), + glm::vec4(7, 1, -2, 0)); + glm::mat4x4 const B4x4 = glm::shear(A4x4, center, l_x, l_y, l_z); + glm::mat4x4 const expected( + glm::vec4(1, -6, -1, 0), + glm::vec4(7, 12, 23, 0), + glm::vec4(-4, 4, -24, 0), + glm::vec4(4, 20, 31, 0)); + Error += all(equal(B4x4, expected, epsilon())) ? 0 : 1; + } + + return Error; +} + +template +int test_inverse_perf(std::size_t Count, std::size_t Instance, char const * Message) +{ + std::vector TestInputs; + TestInputs.resize(Count); + std::vector TestOutputs; + TestOutputs.resize(TestInputs.size()); + + VEC3 Axis(glm::normalize(VEC3(1.0f, 2.0f, 3.0f))); + + for(std::size_t i = 0; i < TestInputs.size(); ++i) + { + typename MAT4::value_type f = static_cast(i + Instance) * typename MAT4::value_type(0.1) + typename MAT4::value_type(0.1); + TestInputs[i] = glm::rotate(glm::translate(MAT4(1), Axis * f), f, Axis); + //TestInputs[i] = glm::translate(MAT4(1), Axis * f); + } + + std::clock_t StartTime = std::clock(); + + for(std::size_t i = 0; i < TestInputs.size(); ++i) + TestOutputs[i] = glm::inverse(TestInputs[i]); + + std::clock_t EndTime = std::clock(); + + for(std::size_t i = 0; i < TestInputs.size(); ++i) + TestOutputs[i] = TestOutputs[i] * TestInputs[i]; + + typename MAT4::value_type Diff(0); + for(std::size_t Entry = 0; Entry < TestOutputs.size(); ++Entry) + { + MAT4 i(1.0); + MAT4 m(TestOutputs[Entry]); + for(glm::length_t y = 0; y < m.length(); ++y) + for(glm::length_t x = 0; x < m[y].length(); ++x) + Diff = glm::max(m[y][x], i[y][x]); + } + + //glm::uint Ulp = 0; + //Ulp = glm::max(glm::float_distance(*Dst, *Src), Ulp); + + std::printf("inverse<%s>(%f): %lu\n", Message, static_cast(Diff), EndTime - StartTime); + + return 0; +} + +int main() +{ + int Error = 0; + Error += test_matrixCompMult(); + Error += test_outerProduct(); + Error += test_transpose(); + Error += test_determinant(); + Error += test_inverse(); + Error += test_inverse_simd(); + Error += test_shearing(); + +# ifdef NDEBUG + std::size_t const Samples = 1000; +# else + std::size_t const Samples = 1; +# endif//NDEBUG + + for(std::size_t i = 0; i < 1; ++i) + { + Error += test_inverse_perf(Samples, i, "mat4"); + Error += test_inverse_perf(Samples, i, "dmat4"); + } + + return Error; +} + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_func_noise.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_func_noise.cpp new file mode 100644 index 0000000000000000000000000000000000000000..3268d671eef13e65d0df9569179b72217c27831e --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_func_noise.cpp @@ -0,0 +1,7 @@ +int main() +{ + int Error = 0; + + return Error; +} + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_func_packing.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_func_packing.cpp new file mode 100644 index 0000000000000000000000000000000000000000..9aaa78ec02c5571a6cdd754879175951127193fe --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_func_packing.cpp @@ -0,0 +1,156 @@ +#include +#include +#include +#include +#include + +int test_packUnorm2x16() +{ + int Error = 0; + + std::vector A; + A.push_back(glm::vec2(1.0f, 0.0f)); + A.push_back(glm::vec2(0.5f, 0.7f)); + A.push_back(glm::vec2(0.1f, 0.2f)); + + for(std::size_t i = 0; i < A.size(); ++i) + { + glm::vec2 B(A[i]); + glm::uint32 C = glm::packUnorm2x16(B); + glm::vec2 D = glm::unpackUnorm2x16(C); + Error += glm::all(glm::epsilonEqual(B, D, 1.0f / 65535.f)) ? 0 : 1; + assert(!Error); + } + + return Error; +} + +int test_packSnorm2x16() +{ + int Error = 0; + + std::vector A; + A.push_back(glm::vec2( 1.0f, 0.0f)); + A.push_back(glm::vec2(-0.5f,-0.7f)); + A.push_back(glm::vec2(-0.1f, 0.1f)); + + for(std::size_t i = 0; i < A.size(); ++i) + { + glm::vec2 B(A[i]); + glm::uint32 C = glm::packSnorm2x16(B); + glm::vec2 D = glm::unpackSnorm2x16(C); + Error += glm::all(glm::epsilonEqual(B, D, 1.0f / 32767.0f * 2.0f)) ? 0 : 1; + assert(!Error); + } + + return Error; +} + +int test_packUnorm4x8() +{ + int Error = 0; + + glm::uint32 Packed = glm::packUnorm4x8(glm::vec4(1.0f, 0.5f, 0.0f, 1.0f)); + glm::u8vec4 Vec(255, 128, 0, 255); + glm::uint32 & Ref = *reinterpret_cast(&Vec[0]); + + Error += Packed == Ref ? 0 : 1; + + std::vector A; + A.push_back(glm::vec4(1.0f, 0.7f, 0.3f, 0.0f)); + A.push_back(glm::vec4(0.5f, 0.1f, 0.2f, 0.3f)); + + for(std::size_t i = 0; i < A.size(); ++i) + { + glm::vec4 B(A[i]); + glm::uint32 C = glm::packUnorm4x8(B); + glm::vec4 D = glm::unpackUnorm4x8(C); + Error += glm::all(glm::epsilonEqual(B, D, 1.0f / 255.f)) ? 0 : 1; + assert(!Error); + } + + return Error; +} + +int test_packSnorm4x8() +{ + int Error = 0; + + std::vector A; + A.push_back(glm::vec4( 1.0f, 0.0f,-0.5f,-1.0f)); + A.push_back(glm::vec4(-0.7f,-0.1f, 0.1f, 0.7f)); + + for(std::size_t i = 0; i < A.size(); ++i) + { + glm::vec4 B(A[i]); + glm::uint32 C = glm::packSnorm4x8(B); + glm::vec4 D = glm::unpackSnorm4x8(C); + Error += glm::all(glm::epsilonEqual(B, D, 1.0f / 127.f)) ? 0 : 1; + assert(!Error); + } + + return Error; +} + +int test_packHalf2x16() +{ + int Error = 0; +/* + std::vector A; + A.push_back(glm::hvec2(glm::half( 1.0f), glm::half( 2.0f))); + A.push_back(glm::hvec2(glm::half(-1.0f), glm::half(-2.0f))); + A.push_back(glm::hvec2(glm::half(-1.1f), glm::half( 1.1f))); +*/ + std::vector A; + A.push_back(glm::vec2( 1.0f, 2.0f)); + A.push_back(glm::vec2(-1.0f,-2.0f)); + A.push_back(glm::vec2(-1.1f, 1.1f)); + + for(std::size_t i = 0; i < A.size(); ++i) + { + glm::vec2 B(A[i]); + glm::uint C = glm::packHalf2x16(B); + glm::vec2 D = glm::unpackHalf2x16(C); + //Error += B == D ? 0 : 1; + Error += glm::all(glm::epsilonEqual(B, D, 1.0f / 127.f)) ? 0 : 1; + assert(!Error); + } + + return Error; +} + +int test_packDouble2x32() +{ + int Error = 0; + + std::vector A; + A.push_back(glm::uvec2( 1, 2)); + A.push_back(glm::uvec2(-1,-2)); + A.push_back(glm::uvec2(-1000, 1100)); + + for(std::size_t i = 0; i < A.size(); ++i) + { + glm::uvec2 B(A[i]); + double C = glm::packDouble2x32(B); + glm::uvec2 D = glm::unpackDouble2x32(C); + Error += B == D ? 0 : 1; + assert(!Error); + } + + return Error; +} + +int main() +{ + int Error = 0; + + Error += test_packSnorm4x8(); + Error += test_packUnorm4x8(); + Error += test_packSnorm2x16(); + Error += test_packUnorm2x16(); + Error += test_packHalf2x16(); + Error += test_packDouble2x32(); + + return Error; +} + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_func_swizzle.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_func_swizzle.cpp new file mode 100644 index 0000000000000000000000000000000000000000..7d2686d2cd96cb19a325e03f9c5597722d739aa8 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_func_swizzle.cpp @@ -0,0 +1,164 @@ +#define GLM_FORCE_SWIZZLE +#include +#include +#include + +static int test_ivec2_swizzle() +{ + int Error = 0; + +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR || GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION + { + glm::ivec2 A(1, 2); + glm::ivec2 B = A.yx(); + glm::ivec2 C = B.yx(); + + Error += A != B ? 0 : 1; + Error += A == C ? 0 : 1; + } +# endif//GLM_CONFIG_SWIZZLE + +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR + { + glm::ivec2 A(1, 2); + glm::ivec2 B = A.yx; + glm::ivec2 C = A.yx; + + Error += A != B ? 0 : 1; + Error += B == C ? 0 : 1; + + B.xy = B.yx; + C.xy = C.yx; + + Error += B == C ? 0 : 1; + + glm::ivec2 D(0, 0); + D.yx = A.xy; + Error += A.yx() == D ? 0 : 1; + + glm::ivec2 E = A.yx; + Error += E == D ? 0 : 1; + } +# endif//GLM_CONFIG_SWIZZLE + + return Error; +} + +int test_ivec3_swizzle() +{ + int Error = 0; + +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR || GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION + { + glm::ivec3 A(1, 2, 3); + glm::ivec3 B = A.zyx(); + glm::ivec3 C = B.zyx(); + + Error += A != B ? 0 : 1; + Error += A == C ? 0 : 1; + } +# endif + +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR + { + glm::ivec3 const A(1, 2, 3); + glm::ivec2 B = A.yx; + glm::ivec2 C = A.yx; + + Error += A.yx() == B ? 0 : 1; + Error += B == C ? 0 : 1; + + B.xy = B.yx; + C.xy = C.yx; + + Error += B == C ? 0 : 1; + + glm::ivec2 D(0, 0); + D.yx = A.xy; + + Error += A.yx() == D ? 0 : 1; + + glm::ivec2 E(0, 0); + E.xy = A.xy(); + + Error += E == A.xy() ? 0 : 1; + Error += E.xy() == A.xy() ? 0 : 1; + + glm::ivec3 const F = A.xxx + A.xxx; + Error += F == glm::ivec3(2) ? 0 : 1; + + glm::ivec3 const G = A.xxx - A.xxx; + Error += G == glm::ivec3(0) ? 0 : 1; + + glm::ivec3 const H = A.xxx * A.xxx; + Error += H == glm::ivec3(1) ? 0 : 1; + + glm::ivec3 const I = A.xxx / A.xxx; + Error += I == glm::ivec3(1) ? 0 : 1; + + glm::ivec3 J(1, 2, 3); + J.xyz += glm::ivec3(1); + Error += J == glm::ivec3(2, 3, 4) ? 0 : 1; + + glm::ivec3 K(1, 2, 3); + K.xyz += A.xyz; + Error += K == glm::ivec3(2, 4, 6) ? 0 : 1; + } +# endif + + return Error; +} + +int test_ivec4_swizzle() +{ + int Error = 0; + +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR || GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION + { + glm::ivec4 A(1, 2, 3, 4); + glm::ivec4 B = A.wzyx(); + glm::ivec4 C = B.wzyx(); + + Error += A != B ? 0 : 1; + Error += A == C ? 0 : 1; + } +# endif + + return Error; +} + +int test_vec4_swizzle() +{ + int Error = 0; + +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR || GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION + { + glm::vec4 A(1, 2, 3, 4); + glm::vec4 B = A.wzyx(); + glm::vec4 C = B.wzyx(); + + Error += glm::any(glm::notEqual(A, B, 0.0001f)) ? 0 : 1; + Error += glm::all(glm::equal(A, C, 0.0001f)) ? 0 : 1; + + float D = glm::dot(C.wzyx(), C.xyzw()); + Error += glm::equal(D, 20.f, 0.001f) ? 0 : 1; + } +# endif + + return Error; +} + +int main() +{ + int Error = 0; + + Error += test_ivec2_swizzle(); + Error += test_ivec3_swizzle(); + Error += test_ivec4_swizzle(); + Error += test_vec4_swizzle(); + + return Error; +} + + + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_func_trigonometric.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_func_trigonometric.cpp new file mode 100644 index 0000000000000000000000000000000000000000..9f3b88c23cdb620029e9b2acee3754bdd66a7f35 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_func_trigonometric.cpp @@ -0,0 +1,10 @@ +#include + +int main() +{ + int Error = 0; + + + return Error; +} + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_func_vector_relational.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_func_vector_relational.cpp new file mode 100644 index 0000000000000000000000000000000000000000..083081f8a20980d0553f1c00947e5c0464382680 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_func_vector_relational.cpp @@ -0,0 +1,180 @@ +#include +#include +#include +#include +#include + +static int test_not() +{ + int Error = 0; + + { + glm::bvec1 v(false); + Error += glm::all(glm::not_(v)) ? 0 : 1; + } + + { + glm::bvec2 v(false); + Error += glm::all(glm::not_(v)) ? 0 : 1; + } + + { + glm::bvec3 v(false); + Error += glm::all(glm::not_(v)) ? 0 : 1; + } + + { + glm::bvec4 v(false); + Error += glm::all(glm::not_(v)) ? 0 : 1; + } + + return Error; +} + +static int test_less() +{ + int Error = 0; + + { + glm::vec2 const A(1, 2); + glm::vec2 const B(2, 3); + Error += glm::all(glm::lessThan(A, B)) ? 0: 1; + Error += glm::all(glm::lessThanEqual(A, B)) ? 0: 1; + } + + { + glm::vec3 const A(1, 2, 3); + glm::vec3 const B(2, 3, 4); + Error += glm::all(glm::lessThan(A, B)) ? 0: 1; + Error += glm::all(glm::lessThanEqual(A, B)) ? 0: 1; + } + + { + glm::vec4 const A(1, 2, 3, 4); + glm::vec4 const B(2, 3, 4, 5); + Error += glm::all(glm::lessThan(A, B)) ? 0: 1; + Error += glm::all(glm::lessThanEqual(A, B)) ? 0: 1; + } + + { + glm::ivec2 const A(1, 2); + glm::ivec2 const B(2, 3); + Error += glm::all(glm::lessThan(A, B)) ? 0: 1; + + glm::ivec2 const C(1, 3); + Error += glm::all(glm::lessThanEqual(A, C)) ? 0: 1; + } + + { + glm::ivec3 const A(1, 2, 3); + glm::ivec3 const B(2, 3, 4); + Error += glm::all(glm::lessThan(A, B)) ? 0: 1; + + glm::ivec3 const C(1, 3, 4); + Error += glm::all(glm::lessThanEqual(A, C)) ? 0: 1; + } + + { + glm::ivec4 const A(1, 2, 3, 4); + glm::ivec4 const B(2, 3, 4, 5); + Error += glm::all(glm::lessThan(A, B)) ? 0: 1; + + glm::ivec4 const C(1, 3, 4, 5); + Error += glm::all(glm::lessThanEqual(A, C)) ? 0: 1; + } + + return Error; +} + +static int test_greater() +{ + int Error = 0; + + { + glm::vec2 const A(1, 2); + glm::vec2 const B(2, 3); + Error += glm::all(glm::greaterThan(B, A)) ? 0: 1; + Error += glm::all(glm::greaterThanEqual(B, A)) ? 0: 1; + } + + { + glm::vec3 const A(1, 2, 3); + glm::vec3 const B(2, 3, 4); + Error += glm::all(glm::greaterThan(B, A)) ? 0: 1; + Error += glm::all(glm::greaterThanEqual(B, A)) ? 0: 1; + } + + { + glm::vec4 const A(1, 2, 3, 4); + glm::vec4 const B(2, 3, 4, 5); + Error += glm::all(glm::greaterThan(B, A)) ? 0: 1; + Error += glm::all(glm::greaterThanEqual(B, A)) ? 0: 1; + } + + { + glm::ivec2 const A(1, 2); + glm::ivec2 const B(2, 3); + Error += glm::all(glm::greaterThan(B, A)) ? 0: 1; + + glm::ivec2 const C(1, 3); + Error += glm::all(glm::greaterThanEqual(C, A)) ? 0: 1; + } + + { + glm::ivec3 const A(1, 2, 3); + glm::ivec3 const B(2, 3, 4); + Error += glm::all(glm::greaterThan(B, A)) ? 0: 1; + + glm::ivec3 const C(1, 3, 4); + Error += glm::all(glm::greaterThanEqual(C, A)) ? 0: 1; + } + + { + glm::ivec4 const A(1, 2, 3, 4); + glm::ivec4 const B(2, 3, 4, 5); + Error += glm::all(glm::greaterThan(B, A)) ? 0: 1; + + glm::ivec4 const C(1, 3, 4, 5); + Error += glm::all(glm::greaterThanEqual(C, A)) ? 0: 1; + } + + return Error; +} + +static int test_equal() +{ + int Error = 0; + + { + glm::ivec2 const A(1, 2); + glm::ivec2 const B(1, 2); + Error += glm::all(glm::equal(B, A)) ? 0: 1; + } + + { + glm::ivec3 const A(1, 2, 3); + glm::ivec3 const B(1, 2, 3); + Error += glm::all(glm::equal(B, A)) ? 0: 1; + } + + { + glm::ivec4 const A(1, 2, 3, 4); + glm::ivec4 const B(1, 2, 3, 4); + Error += glm::all(glm::equal(B, A)) ? 0: 1; + } + + return Error; +} + +int main() +{ + int Error = 0; + + Error += test_not(); + Error += test_less(); + Error += test_greater(); + Error += test_equal(); + + return Error; +} + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_setup_force_cxx98.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_setup_force_cxx98.cpp new file mode 100644 index 0000000000000000000000000000000000000000..7d6cc2c51d3782679d4bcd77cbf9809ecfd52c98 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_setup_force_cxx98.cpp @@ -0,0 +1,12 @@ +#ifndef GLM_FORCE_CXX98 +# define GLM_FORCE_CXX98 +#endif +#include +#include + +int main() +{ + int Error = 0; + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_setup_force_size_t_length.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_setup_force_size_t_length.cpp new file mode 100644 index 0000000000000000000000000000000000000000..3d9aad12120ccb18da92c367b00209c1c24bf5dc --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_setup_force_size_t_length.cpp @@ -0,0 +1,22 @@ +#define GLM_FORCE_SIZE_T_LENGTH +#include +#include + +template +genType add(genType const& a, genType const& b) +{ + genType result(0); + for(glm::length_t i = 0; i < a.length(); ++i) + result[i] = a[i] + b[i]; + return result; +} + +int main() +{ + int Error = 0; + + glm::ivec4 v(1); + Error += add(v, v) == glm::ivec4(2) ? 0 : 1; + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_setup_message.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_setup_message.cpp new file mode 100644 index 0000000000000000000000000000000000000000..ac15f84749a12b221a1aeb5793cd052404b53f80 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_setup_message.cpp @@ -0,0 +1,230 @@ +#define GLM_FORCE_MESSAGES +#include +#include + +int test_compiler() +{ + int Error(0); + + if(GLM_COMPILER & GLM_COMPILER_VC) + { + switch(GLM_COMPILER) + { + case GLM_COMPILER_VC12: + std::printf("Visual C++ 12 - 2013\n"); + break; + case GLM_COMPILER_VC14: + std::printf("Visual C++ 14 - 2015\n"); + break; + case GLM_COMPILER_VC15: + std::printf("Visual C++ 15 - 2017\n"); + break; + case GLM_COMPILER_VC15_3: + std::printf("Visual C++ 15.3 - 2017\n"); + break; + case GLM_COMPILER_VC15_5: + std::printf("Visual C++ 15.5 - 2017\n"); + break; + case GLM_COMPILER_VC15_6: + std::printf("Visual C++ 15.6 - 2017\n"); + break; + case GLM_COMPILER_VC15_7: + std::printf("Visual C++ 15.7 - 2017\n"); + break; + case GLM_COMPILER_VC15_8: + std::printf("Visual C++ 15.8 - 2017\n"); + break; + case GLM_COMPILER_VC15_9: + std::printf("Visual C++ 15.9 - 2017\n"); + break; + case GLM_COMPILER_VC16: + std::printf("Visual C++ 16 - 2019\n"); + break; + default: + std::printf("Visual C++ version not detected\n"); + Error += 1; + break; + } + } + else if(GLM_COMPILER & GLM_COMPILER_GCC) + { + switch(GLM_COMPILER) + { + case GLM_COMPILER_GCC46: + std::printf("GCC 4.6\n"); + break; + case GLM_COMPILER_GCC47: + std::printf("GCC 4.7\n"); + break; + case GLM_COMPILER_GCC48: + std::printf("GCC 4.8\n"); + break; + case GLM_COMPILER_GCC49: + std::printf("GCC 4.9\n"); + break; + case GLM_COMPILER_GCC5: + std::printf("GCC 5\n"); + break; + case GLM_COMPILER_GCC6: + std::printf("GCC 6\n"); + break; + case GLM_COMPILER_GCC7: + std::printf("GCC 7\n"); + break; + case GLM_COMPILER_GCC8: + std::printf("GCC 8\n"); + break; + default: + std::printf("GCC version not detected\n"); + Error += 1; + break; + } + } + else if(GLM_COMPILER & GLM_COMPILER_CUDA) + { + std::printf("CUDA\n"); + } + else if(GLM_COMPILER & GLM_COMPILER_CLANG) + { + switch(GLM_COMPILER) + { + case GLM_COMPILER_CLANG34: + std::printf("Clang 3.4\n"); + break; + case GLM_COMPILER_CLANG35: + std::printf("Clang 3.5\n"); + break; + case GLM_COMPILER_CLANG36: + std::printf("Clang 3.6\n"); + break; + case GLM_COMPILER_CLANG37: + std::printf("Clang 3.7\n"); + break; + case GLM_COMPILER_CLANG38: + std::printf("Clang 3.8\n"); + break; + case GLM_COMPILER_CLANG39: + std::printf("Clang 3.9\n"); + break; + case GLM_COMPILER_CLANG40: + std::printf("Clang 4.0\n"); + break; + case GLM_COMPILER_CLANG41: + std::printf("Clang 4.1\n"); + break; + case GLM_COMPILER_CLANG42: + std::printf("Clang 4.2\n"); + break; + default: + std::printf("LLVM version not detected\n"); + break; + } + } + else if(GLM_COMPILER & GLM_COMPILER_INTEL) + { + switch(GLM_COMPILER) + { + case GLM_COMPILER_INTEL14: + std::printf("ICC 14 - 2013 SP1\n"); + break; + case GLM_COMPILER_INTEL15: + std::printf("ICC 15 - 2015\n"); + break; + case GLM_COMPILER_INTEL16: + std::printf("ICC 16 - 2017\n"); + break; + case GLM_COMPILER_INTEL17: + std::printf("ICC 17 - 20XX\n"); + break; + default: + std::printf("Intel compiler version not detected\n"); + Error += 1; + break; + } + } + else + { + std::printf("Undetected compiler\n"); + Error += 1; + } + + return Error; +} + +int test_model() +{ + int Error = 0; + + Error += ((sizeof(void*) == 4) && (GLM_MODEL == GLM_MODEL_32)) || ((sizeof(void*) == 8) && (GLM_MODEL == GLM_MODEL_64)) ? 0 : 1; + + if(GLM_MODEL == GLM_MODEL_32) + std::printf("GLM_MODEL_32\n"); + else if(GLM_MODEL == GLM_MODEL_64) + std::printf("GLM_MODEL_64\n"); + + return Error; +} + +int test_instruction_set() +{ + int Error = 0; + + std::printf("GLM_ARCH: "); + + if(GLM_ARCH & GLM_ARCH_ARM_BIT) + std::printf("ARM "); + if(GLM_ARCH & GLM_ARCH_NEON_BIT) + std::printf("NEON "); + if(GLM_ARCH & GLM_ARCH_AVX2_BIT) + std::printf("AVX2 "); + if(GLM_ARCH & GLM_ARCH_AVX_BIT) + std::printf("AVX "); + if(GLM_ARCH & GLM_ARCH_SSE42_BIT) + std::printf("SSE4.2 "); + if(GLM_ARCH & GLM_ARCH_SSE41_BIT) + std::printf("SSE4.1 "); + if(GLM_ARCH & GLM_ARCH_SSSE3_BIT) + std::printf("SSSE3 "); + if(GLM_ARCH & GLM_ARCH_SSE3_BIT) + std::printf("SSE3 "); + if(GLM_ARCH & GLM_ARCH_SSE2_BIT) + std::printf("SSE2 "); + + std::printf("\n"); + + return Error; +} + +int test_cpp_version() +{ + std::printf("__cplusplus: %d\n", static_cast(__cplusplus)); + + return 0; +} + +int test_operators() +{ + glm::ivec3 A(1); + glm::ivec3 B(1); + bool R = A != B; + bool S = A == B; + + return (S && !R) ? 0 : 1; +} + +int main() +{ + int Error = 0; + +# if !defined(GLM_FORCE_PLATFORM_UNKNOWN) && !defined(GLM_FORCE_COMPILER_UNKNOWN) && !defined(GLM_FORCE_ARCH_UNKNOWN) && !defined(GLM_FORCE_CXX_UNKNOWN) + + Error += test_cpp_version(); + Error += test_compiler(); + Error += test_model(); + Error += test_instruction_set(); + Error += test_operators(); + +# endif + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_setup_platform_unknown.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_setup_platform_unknown.cpp new file mode 100644 index 0000000000000000000000000000000000000000..86169b6c7230caa72be5b1c773da0024dd34f2b9 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_setup_platform_unknown.cpp @@ -0,0 +1,21 @@ +#ifndef GLM_FORCE_PLATFORM_UNKNOWN +# define GLM_FORCE_PLATFORM_UNKNOWN +#endif +#ifndef GLM_FORCE_COMPILER_UNKNOWN +# define GLM_FORCE_COMPILER_UNKNOWN +#endif +#ifndef GLM_FORCE_ARCH_UNKNOWN +# define GLM_FORCE_ARCH_UNKNOWN +#endif +#ifndef GLM_FORCE_CXX_UNKNOWN +# define GLM_FORCE_CXX_UNKNOWN +#endif +#include +#include + +int main() +{ + int Error = 0; + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_setup_precision.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_setup_precision.cpp new file mode 100644 index 0000000000000000000000000000000000000000..84fa5d62b316ad6045cbe72ceb7dedb1a7632a1f --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_setup_precision.cpp @@ -0,0 +1,58 @@ +#define GLM_FORCE_INLINE +#define GLM_PRECISION_HIGHP_FLOAT +#include +#include + +static int test_mat() +{ + int Error = 0; + + Error += sizeof(glm::mat2) == sizeof(glm::highp_mat2) ? 0 : 1; + Error += sizeof(glm::mat3) == sizeof(glm::highp_mat3) ? 0 : 1; + Error += sizeof(glm::mat4) == sizeof(glm::highp_mat4) ? 0 : 1; + + Error += sizeof(glm::mat2x2) == sizeof(glm::highp_mat2x2) ? 0 : 1; + Error += sizeof(glm::mat2x3) == sizeof(glm::highp_mat2x3) ? 0 : 1; + Error += sizeof(glm::mat2x4) == sizeof(glm::highp_mat2x4) ? 0 : 1; + Error += sizeof(glm::mat3x2) == sizeof(glm::highp_mat3x2) ? 0 : 1; + Error += sizeof(glm::mat3x3) == sizeof(glm::highp_mat3x3) ? 0 : 1; + Error += sizeof(glm::mat3x4) == sizeof(glm::highp_mat3x4) ? 0 : 1; + Error += sizeof(glm::mat4x2) == sizeof(glm::highp_mat4x2) ? 0 : 1; + Error += sizeof(glm::mat4x3) == sizeof(glm::highp_mat4x3) ? 0 : 1; + Error += sizeof(glm::mat4x4) == sizeof(glm::highp_mat4x4) ? 0 : 1; + + return Error; +} + +static int test_vec() +{ + int Error = 0; + + Error += sizeof(glm::vec2) == sizeof(glm::highp_vec2) ? 0 : 1; + Error += sizeof(glm::vec3) == sizeof(glm::highp_vec3) ? 0 : 1; + Error += sizeof(glm::vec4) == sizeof(glm::highp_vec4) ? 0 : 1; + + return Error; +} + +static int test_dvec() +{ + int Error = 0; + + Error += sizeof(glm::dvec2) == sizeof(glm::highp_dvec2) ? 0 : 1; + Error += sizeof(glm::dvec3) == sizeof(glm::highp_dvec3) ? 0 : 1; + Error += sizeof(glm::dvec4) == sizeof(glm::highp_dvec4) ? 0 : 1; + + return Error; +} + +int main() +{ + int Error = 0; + + Error += test_mat(); + Error += test_vec(); + Error += test_dvec(); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_type_aligned.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_type_aligned.cpp new file mode 100644 index 0000000000000000000000000000000000000000..1c39f2a97134ffbdb9c09fdfb9db96d318503719 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_type_aligned.cpp @@ -0,0 +1,92 @@ +#define GLM_FORCE_DEFAULT_ALIGNED_GENTYPES +#include + +#if GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE +#include + +static_assert(sizeof(glm::bvec4) > sizeof(glm::bvec2), "Invalid sizeof"); +static_assert(sizeof(glm::ivec4) > sizeof(glm::uvec2), "Invalid sizeof"); +static_assert(sizeof(glm::dvec4) > sizeof(glm::dvec2), "Invalid sizeof"); + +static_assert(sizeof(glm::bvec4) == sizeof(glm::bvec3), "Invalid sizeof"); +static_assert(sizeof(glm::uvec4) == sizeof(glm::uvec3), "Invalid sizeof"); +static_assert(sizeof(glm::dvec4) == sizeof(glm::dvec3), "Invalid sizeof"); + +static int test_storage_aligned() +{ + int Error = 0; + + size_t size1_aligned = sizeof(glm::detail::storage<1, int, true>::type); + Error += size1_aligned == sizeof(int) * 1 ? 0 : 1; + size_t size2_aligned = sizeof(glm::detail::storage<2, int, true>::type); + Error += size2_aligned == sizeof(int) * 2 ? 0 : 1; + size_t size4_aligned = sizeof(glm::detail::storage<4, int, true>::type); + Error += size4_aligned == sizeof(int) * 4 ? 0 : 1; + + size_t align1_aligned = alignof(glm::detail::storage<1, int, true>::type); + Error += align1_aligned == 4 ? 0 : 1; + size_t align2_aligned = alignof(glm::detail::storage<2, int, true>::type); + Error += align2_aligned == 8 ? 0 : 1; + size_t align4_aligned = alignof(glm::detail::storage<4, int, true>::type); + Error += align4_aligned == 16 ? 0 : 1; + + return Error; +} + +static int test_storage_unaligned() +{ + int Error = 0; + + size_t align1_unaligned = alignof(glm::detail::storage<1, int, false>::type); + Error += align1_unaligned == sizeof(int) ? 0 : 1; + size_t align2_unaligned = alignof(glm::detail::storage<2, int, false>::type); + Error += align2_unaligned == sizeof(int) ? 0 : 1; + size_t align3_unaligned = alignof(glm::detail::storage<3, int, false>::type); + Error += align3_unaligned == sizeof(int) ? 0 : 1; + size_t align4_unaligned = alignof(glm::detail::storage<4, int, false>::type); + Error += align4_unaligned == sizeof(int) ? 0 : 1; + + return Error; +} + +static int test_vec3_aligned() +{ + int Error = 0; + + struct Struct1 + { + glm::vec4 A; + float B; + glm::vec3 C; + }; + + std::size_t const Size1 = sizeof(Struct1); + Error += Size1 == 48 ? 0 : 1; + + struct Struct2 + { + glm::vec4 A; + glm::vec3 B; + float C; + }; + + std::size_t const Size2 = sizeof(Struct2); + Error += Size2 == 48 ? 0 : 1; + + return Error; +} + +#endif + +int main() +{ + int Error = 0; + +# if GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE + Error += test_storage_aligned(); + Error += test_storage_unaligned(); + Error += test_vec3_aligned(); +# endif + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_type_cast.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_type_cast.cpp new file mode 100644 index 0000000000000000000000000000000000000000..484ec8f0cdd74a15bddfaa714befdb9b855cefe4 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_type_cast.cpp @@ -0,0 +1,146 @@ +#include +#include +#include +#include +#include +#include + +struct my_vec2 +{ + operator glm::vec2() { return glm::vec2(x, y); } + float x, y; +}; + +int test_vec2_cast() +{ + glm::vec2 A(1.0f, 2.0f); + glm::lowp_vec2 B(A); + glm::mediump_vec2 C(A); + glm::highp_vec2 D(A); + + glm::vec2 E = static_cast(A); + glm::lowp_vec2 F = static_cast(A); + glm::mediump_vec2 G = static_cast(A); + glm::highp_vec2 H = static_cast(A); + + my_vec2 I; + glm::vec2 J = static_cast(I); + glm::vec2 K(7.8f); + + int Error(0); + + Error += glm::all(glm::equal(A, E, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(B, F, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(C, G, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(D, H, glm::epsilon())) ? 0 : 1; + + return Error; +} + +int test_vec3_cast() +{ + glm::vec3 A(1.0f, 2.0f, 3.0f); + glm::lowp_vec3 B(A); + glm::mediump_vec3 C(A); + glm::highp_vec3 D(A); + + glm::vec3 E = static_cast(A); + glm::lowp_vec3 F = static_cast(A); + glm::mediump_vec3 G = static_cast(A); + glm::highp_vec3 H = static_cast(A); + + int Error(0); + + Error += glm::all(glm::equal(A, E, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(B, F, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(C, G, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(D, H, glm::epsilon())) ? 0 : 1; + + return Error; +} + +int test_vec4_cast() +{ + glm::vec4 A(1.0f, 2.0f, 3.0f, 4.0f); + glm::lowp_vec4 B(A); + glm::mediump_vec4 C(A); + glm::highp_vec4 D(A); + + glm::vec4 E = static_cast(A); + glm::lowp_vec4 F = static_cast(A); + glm::mediump_vec4 G = static_cast(A); + glm::highp_vec4 H = static_cast(A); + + int Error(0); + + Error += glm::all(glm::equal(A, E, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(B, F, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(C, G, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(D, H, glm::epsilon())) ? 0 : 1; + + return Error; +} + +int test_std_copy() +{ + int Error = 0; + + { + std::vector High; + High.resize(64); + std::vector Medium(High.size()); + + std::copy(High.begin(), High.end(), Medium.begin()); + + *Medium.begin() = *High.begin(); + } + + { + std::vector High4; + High4.resize(64); + std::vector Medium4(High4.size()); + + std::copy(High4.begin(), High4.end(), Medium4.begin()); + + *Medium4.begin() = *High4.begin(); + } + + { + std::vector High3; + High3.resize(64); + std::vector Medium3(High3.size()); + + std::copy(High3.begin(), High3.end(), Medium3.begin()); + + *Medium3.begin() = *High3.begin(); + } + + { + std::vector High2; + High2.resize(64); + std::vector Medium2(High2.size()); + + std::copy(High2.begin(), High2.end(), Medium2.begin()); + + *Medium2.begin() = *High2.begin(); + } + + glm::dvec4 v1; + glm::vec4 v2; + + v2 = v1; + + return Error; +} + +int main() +{ + int Error = 0; + + Error += test_std_copy(); + Error += test_vec2_cast(); + Error += test_vec3_cast(); + Error += test_vec4_cast(); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_type_ctor.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_type_ctor.cpp new file mode 100644 index 0000000000000000000000000000000000000000..b3df25f66b9765e1291b808786de536f80999c97 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_type_ctor.cpp @@ -0,0 +1,351 @@ +#include +#include +#include +#include +#include + +static int test_vec1_ctor() +{ + int Error = 0; + +# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_ENABLE + { + union pack + { + glm::vec1 f; + glm::ivec1 i; + } A, B; + + A.f = glm::vec1(0); + Error += glm::all(glm::equal(A.i, glm::ivec1(0))) ? 0 : 1; + + B.f = glm::vec1(1); + Error += glm::all(glm::equal(B.i, glm::ivec1(1065353216))) ? 0 : 1; + } +# endif//GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_ENABLE + + return Error; +} + +static int test_vec2_ctor() +{ + int Error = 0; + +# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_ENABLE + { + union pack + { + glm::vec2 f; + glm::ivec2 i; + } A, B; + + A.f = glm::vec2(0); + Error += glm::all(glm::equal(A.i, glm::ivec2(0))) ? 0 : 1; + + B.f = glm::vec2(1); + Error += glm::all(glm::equal(B.i, glm::ivec2(1065353216))) ? 0 : 1; + } +# endif + + return Error; +} + +static int test_vec3_ctor() +{ + int Error = 0; + +# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_ENABLE + { + union pack + { + glm::vec3 f; + glm::ivec3 i; + } A, B; + + A.f = glm::vec3(0); + Error += glm::all(glm::equal(A.i, glm::ivec3(0))) ? 0 : 1; + + B.f = glm::vec3(1); + Error += glm::all(glm::equal(B.i, glm::ivec3(1065353216))) ? 0 : 1; + } +# endif + + return Error; +} + +static int test_vec4_ctor() +{ + int Error = 0; + +# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_ENABLE + { + union pack + { + glm::vec4 f; + glm::ivec4 i; + } A, B; + + A.f = glm::vec4(0); + Error += glm::all(glm::equal(A.i, glm::ivec4(0))) ? 0 : 1; + + B.f = glm::vec4(1); + Error += glm::all(glm::equal(B.i, glm::ivec4(1065353216))) ? 0 : 1; + } +# endif + + return Error; +} + +static int test_mat2x2_ctor() +{ + int Error = 0; + +# if GLM_LANG & GLM_LANG_CXX11_FLAG + { + union pack + { + glm::mat2x2 f; + glm::mat2x2 i; + } A, B; + + A.f = glm::mat2x2(0); + Error += glm::all(glm::equal(A.i[0], glm::vec2(0), glm::epsilon())) ? 0 : 1; + + B.f = glm::mat2x2(1); + Error += glm::all(glm::equal(B.i[0], glm::vec2(1, 0), glm::epsilon())) ? 0 : 1; + } +# endif//GLM_LANG & GLM_LANG_CXX11_FLAG + + return Error; +} + +static int test_mat2x3_ctor() +{ + int Error = 0; + +# if GLM_LANG & GLM_LANG_CXX11_FLAG + { + union pack + { + glm::mat2x3 f; + glm::mat2x3 i; + } A, B; + + A.f = glm::mat2x3(0); + Error += glm::all(glm::equal(A.i[0], glm::vec3(0), glm::epsilon())) ? 0 : 1; + + B.f = glm::mat2x3(1); + Error += glm::all(glm::equal(B.i[0], glm::vec3(1, 0, 0), glm::epsilon())) ? 0 : 1; + } +# endif//GLM_LANG & GLM_LANG_CXX11_FLAG + + return Error; +} + +static int test_mat2x4_ctor() +{ + int Error = 0; + +# if GLM_LANG & GLM_LANG_CXX11_FLAG + { + union pack + { + glm::mat2x4 f; + glm::mat2x4 i; + } A, B; + + A.f = glm::mat2x4(0); + glm::vec4 const C(0, 0, 0, 0); + Error += glm::all(glm::equal(A.i[0], C, glm::epsilon())) ? 0 : 1; + + B.f = glm::mat2x4(1); + glm::vec4 const D(1, 0, 0, 0); + Error += glm::all(glm::equal(B.i[0], D, glm::epsilon())) ? 0 : 1; + } +# endif//GLM_LANG & GLM_LANG_CXX11_FLAG + + return Error; +} + +static int test_mat3x2_ctor() +{ + int Error = 0; + +# if GLM_LANG & GLM_LANG_CXX11_FLAG + { + union pack + { + glm::mat3x2 f; + glm::mat3x2 i; + } A, B; + + A.f = glm::mat3x2(0); + Error += glm::all(glm::equal(A.i[0], glm::vec2(0), glm::epsilon())) ? 0 : 1; + + B.f = glm::mat3x2(1); + Error += glm::all(glm::equal(B.i[0], glm::vec2(1, 0), glm::epsilon())) ? 0 : 1; + } +# endif//GLM_LANG & GLM_LANG_CXX11_FLAG + + return Error; +} + +static int test_mat3x3_ctor() +{ + int Error = 0; + +# if GLM_LANG & GLM_LANG_CXX11_FLAG + { + union pack + { + glm::mat3x3 f; + glm::mat3x3 i; + } A, B; + + A.f = glm::mat3x3(0); + Error += glm::all(glm::equal(A.i[0], glm::vec3(0), glm::epsilon())) ? 0 : 1; + + B.f = glm::mat3x3(1); + Error += glm::all(glm::equal(B.i[0], glm::vec3(1, 0, 0), glm::epsilon())) ? 0 : 1; + } +# endif//GLM_LANG & GLM_LANG_CXX11_FLAG + + return Error; +} + +static int test_mat3x4_ctor() +{ + int Error = 0; + +# if GLM_LANG & GLM_LANG_CXX11_FLAG + { + union pack + { + glm::mat3x4 f; + glm::mat3x4 i; + } A, B; + + A.f = glm::mat3x4(0); + Error += glm::all(glm::equal(A.i[0], glm::vec4(0), glm::epsilon())) ? 0 : 1; + + B.f = glm::mat3x4(1); + Error += glm::all(glm::equal(B.i[0], glm::vec4(1, 0, 0, 0), glm::epsilon())) ? 0 : 1; + } +# endif//GLM_LANG & GLM_LANG_CXX11_FLAG + + return Error; +} + +static int test_mat4x2_ctor() +{ + int Error = 0; + +# if GLM_LANG & GLM_LANG_CXX11_FLAG + { + union pack + { + glm::mat4x2 f; + glm::mat4x2 i; + } A, B; + + A.f = glm::mat4x2(0); + Error += glm::all(glm::equal(A.i[0], glm::vec2(0), glm::epsilon())) ? 0 : 1; + + B.f = glm::mat4x2(1); + Error += glm::all(glm::equal(B.i[0], glm::vec2(1, 0), glm::epsilon())) ? 0 : 1; + } +# endif//GLM_LANG & GLM_LANG_CXX11_FLAG + + return Error; +} + +static int test_mat4x3_ctor() +{ + int Error = 0; + +# if GLM_LANG & GLM_LANG_CXX11_FLAG + { + union pack + { + glm::mat4x3 f; + glm::mat4x3 i; + } A, B; + + A.f = glm::mat4x3(0); + Error += glm::all(glm::equal(A.i[0], glm::vec3(0), glm::epsilon())) ? 0 : 1; + + B.f = glm::mat4x3(1); + Error += glm::all(glm::equal(B.i[0], glm::vec3(1, 0, 0), glm::epsilon())) ? 0 : 1; + } +# endif//GLM_LANG & GLM_LANG_CXX11_FLAG + + return Error; +} + +static int test_mat4x4_ctor() +{ + int Error = 0; + +# if GLM_LANG & GLM_LANG_CXX11_FLAG + { + union pack + { + glm::mat4 f; + glm::mat4 i; + } A, B; + + A.f = glm::mat4(0); + Error += glm::all(glm::equal(A.i[0], glm::vec4(0), glm::epsilon())) ? 0 : 1; + + B.f = glm::mat4(1); + Error += glm::all(glm::equal(B.i[0], glm::vec4(1, 0, 0, 0), glm::epsilon())) ? 0 : 1; + } +# endif//GLM_LANG & GLM_LANG_CXX11_FLAG + + return Error; +} + +static int test_quat_ctor() +{ + int Error = 0; + +# if GLM_LANG & GLM_LANG_CXX11_FLAG + { + union pack + { + glm::quat f; + glm::quat i; + } A, B; + + A.f = glm::quat(0, 0, 0, 0); + Error += glm::all(glm::equal(A.i, glm::quat(0, 0, 0, 0), glm::epsilon())) ? 0 : 1; + + B.f = glm::quat(1, 1, 1, 1); + Error += glm::all(glm::equal(B.i, glm::quat(1, 1, 1, 1), glm::epsilon())) ? 0 : 1; + } +# endif//GLM_LANG & GLM_LANG_CXX11_FLAG + + return Error; +} + +int main() +{ + int Error = 0; + + Error += test_vec1_ctor(); + Error += test_vec2_ctor(); + Error += test_vec3_ctor(); + Error += test_vec4_ctor(); + Error += test_mat2x2_ctor(); + Error += test_mat2x3_ctor(); + Error += test_mat2x4_ctor(); + Error += test_mat3x2_ctor(); + Error += test_mat3x3_ctor(); + Error += test_mat3x4_ctor(); + Error += test_mat4x2_ctor(); + Error += test_mat4x3_ctor(); + Error += test_mat4x4_ctor(); + Error += test_quat_ctor(); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_type_int.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_type_int.cpp new file mode 100644 index 0000000000000000000000000000000000000000..4d6fde202fb7499835e7b5557ea960f27848044f --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_type_int.cpp @@ -0,0 +1,26 @@ +#include +#include + +static int test_bit_operator() +{ + int Error = 0; + + glm::ivec4 const a(1); + glm::ivec4 const b = ~a; + Error += glm::all(glm::equal(b, glm::ivec4(-2))) ? 0 : 1; + + glm::int32 const c(1); + glm::int32 const d = ~c; + Error += d == -2 ? 0 : 1; + + return Error; +} + +int main() +{ + int Error = 0; + + Error += test_bit_operator(); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_type_length.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_type_length.cpp new file mode 100644 index 0000000000000000000000000000000000000000..bcfa30a05f708d11e576ca86388f81b3c2fa7341 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_type_length.cpp @@ -0,0 +1,78 @@ +#include + +static int test_length_mat_non_squared() +{ + int Error = 0; + + Error += glm::mat2x3().length() == 2 ? 0 : 1; + Error += glm::mat2x4().length() == 2 ? 0 : 1; + Error += glm::mat3x2().length() == 3 ? 0 : 1; + Error += glm::mat3x4().length() == 3 ? 0 : 1; + Error += glm::mat4x2().length() == 4 ? 0 : 1; + Error += glm::mat4x3().length() == 4 ? 0 : 1; + + Error += glm::dmat2x3().length() == 2 ? 0 : 1; + Error += glm::dmat2x4().length() == 2 ? 0 : 1; + Error += glm::dmat3x2().length() == 3 ? 0 : 1; + Error += glm::dmat3x4().length() == 3 ? 0 : 1; + Error += glm::dmat4x2().length() == 4 ? 0 : 1; + Error += glm::dmat4x3().length() == 4 ? 0 : 1; + + return Error; +} + +static int test_length_mat() +{ + int Error = 0; + + Error += glm::mat2().length() == 2 ? 0 : 1; + Error += glm::mat3().length() == 3 ? 0 : 1; + Error += glm::mat4().length() == 4 ? 0 : 1; + Error += glm::mat2x2().length() == 2 ? 0 : 1; + Error += glm::mat3x3().length() == 3 ? 0 : 1; + Error += glm::mat4x4().length() == 4 ? 0 : 1; + + Error += glm::dmat2().length() == 2 ? 0 : 1; + Error += glm::dmat3().length() == 3 ? 0 : 1; + Error += glm::dmat4().length() == 4 ? 0 : 1; + Error += glm::dmat2x2().length() == 2 ? 0 : 1; + Error += glm::dmat3x3().length() == 3 ? 0 : 1; + Error += glm::dmat4x4().length() == 4 ? 0 : 1; + + return Error; +} + +static int test_length_vec() +{ + int Error = 0; + + Error += glm::vec2().length() == 2 ? 0 : 1; + Error += glm::vec3().length() == 3 ? 0 : 1; + Error += glm::vec4().length() == 4 ? 0 : 1; + + Error += glm::ivec2().length() == 2 ? 0 : 1; + Error += glm::ivec3().length() == 3 ? 0 : 1; + Error += glm::ivec4().length() == 4 ? 0 : 1; + + Error += glm::uvec2().length() == 2 ? 0 : 1; + Error += glm::uvec3().length() == 3 ? 0 : 1; + Error += glm::uvec4().length() == 4 ? 0 : 1; + + Error += glm::dvec2().length() == 2 ? 0 : 1; + Error += glm::dvec3().length() == 3 ? 0 : 1; + Error += glm::dvec4().length() == 4 ? 0 : 1; + + return Error; +} + +int main() +{ + int Error = 0; + + Error += test_length_vec(); + Error += test_length_mat(); + Error += test_length_mat_non_squared(); + + return Error; +} + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_type_mat2x2.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_type_mat2x2.cpp new file mode 100644 index 0000000000000000000000000000000000000000..b31f79cdd065831852eca78217fe95d94076bba6 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_type_mat2x2.cpp @@ -0,0 +1,177 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +int test_operators() +{ + glm::mat2x2 l(1.0f); + glm::mat2x2 m(1.0f); + glm::vec2 u(1.0f); + glm::vec2 v(1.0f); + float x = 1.0f; + glm::vec2 a = m * u; + glm::vec2 b = v * m; + glm::mat2x2 n = x / m; + glm::mat2x2 o = m / x; + glm::mat2x2 p = x * m; + glm::mat2x2 q = m * x; + bool R = glm::any(glm::notEqual(m, q, glm::epsilon())); + bool S = glm::all(glm::equal(m, l, glm::epsilon())); + + return (S && !R) ? 0 : 1; +} + +int test_inverse() +{ + int Error(0); + + { + glm::mat2 const Matrix(1, 2, 3, 4); + glm::mat2 const Inverse = glm::inverse(Matrix); + glm::mat2 const Identity = Matrix * Inverse; + + Error += glm::all(glm::equal(Identity[0], glm::vec2(1.0f, 0.0f), glm::vec2(0.01f))) ? 0 : 1; + Error += glm::all(glm::equal(Identity[1], glm::vec2(0.0f, 1.0f), glm::vec2(0.01f))) ? 0 : 1; + } + + { + glm::mat2 const Matrix(1, 2, 3, 4); + glm::mat2 const Identity = Matrix / Matrix; + + Error += glm::all(glm::equal(Identity[0], glm::vec2(1.0f, 0.0f), glm::vec2(0.01f))) ? 0 : 1; + Error += glm::all(glm::equal(Identity[1], glm::vec2(0.0f, 1.0f), glm::vec2(0.01f))) ? 0 : 1; + } + + return Error; +} + +int test_ctr() +{ + int Error = 0; + + { + glm::mediump_mat2x2 const A(1.0f); + glm::highp_mat2x2 const B(A); + glm::mediump_mat2x2 const C(B); + + Error += glm::all(glm::equal(A, C, glm::epsilon())) ? 0 : 1; + } + +#if GLM_HAS_INITIALIZER_LISTS + glm::mat2x2 m0( + glm::vec2(0, 1), + glm::vec2(2, 3)); + + glm::mat2x2 m1{0, 1, 2, 3}; + + glm::mat2x2 m2{ + {0, 1}, + {2, 3}}; + + Error += glm::all(glm::equal(m0, m2, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(m1, m2, glm::epsilon())) ? 0 : 1; + + std::vector v1{ + {0, 1, 2, 3}, + {0, 1, 2, 3} + }; + + std::vector v2{ + { + { 0, 1}, + { 4, 5} + }, + { + { 0, 1}, + { 4, 5} + } + }; + +#endif//GLM_HAS_INITIALIZER_LISTS + + return Error; +} + +namespace cast +{ + template + int entry() + { + int Error = 0; + + genType A(1.0f); + glm::mat2 B(A); + glm::mat2 Identity(1.0f); + + Error += glm::all(glm::equal(B, Identity, glm::epsilon())) ? 0 : 1; + + return Error; + } + + int test() + { + int Error = 0; + + Error += entry(); + Error += entry(); + Error += entry(); + Error += entry(); + Error += entry(); + Error += entry(); + Error += entry(); + Error += entry(); + Error += entry(); + + return Error; + } +}//namespace cast + +int test_size() +{ + int Error = 0; + + Error += 16 == sizeof(glm::mat2x2) ? 0 : 1; + Error += 32 == sizeof(glm::dmat2x2) ? 0 : 1; + Error += glm::mat2x2().length() == 2 ? 0 : 1; + Error += glm::dmat2x2().length() == 2 ? 0 : 1; + Error += glm::mat2x2::length() == 2 ? 0 : 1; + Error += glm::dmat2x2::length() == 2 ? 0 : 1; + + return Error; +} + +int test_constexpr() +{ +#if GLM_HAS_CONSTEXPR + static_assert(glm::mat2x2::length() == 2, "GLM: Failed constexpr"); +#endif + + return 0; +} + +int main() +{ + int Error = 0; + + Error += cast::test(); + Error += test_ctr(); + Error += test_operators(); + Error += test_inverse(); + Error += test_size(); + Error += test_constexpr(); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_type_mat2x3.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_type_mat2x3.cpp new file mode 100644 index 0000000000000000000000000000000000000000..a96102f5d09c1bc12fb012ce13bbb5e92521f8bd --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_type_mat2x3.cpp @@ -0,0 +1,142 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static int test_operators() +{ + glm::mat2x3 l(1.0f); + glm::mat2x3 m(1.0f); + glm::vec2 u(1.0f); + glm::vec3 v(1.0f); + float x = 1.0f; + glm::vec3 a = m * u; + glm::vec2 b = v * m; + glm::mat2x3 n = x / m; + glm::mat2x3 o = m / x; + glm::mat2x3 p = x * m; + glm::mat2x3 q = m * x; + bool R = glm::any(glm::notEqual(m, q, glm::epsilon())); + bool S = glm::all(glm::equal(m, l, glm::epsilon())); + + return (S && !R) ? 0 : 1; +} + +int test_ctr() +{ + int Error(0); + +#if GLM_HAS_INITIALIZER_LISTS + glm::mat2x3 m0( + glm::vec3(0, 1, 2), + glm::vec3(3, 4, 5)); + + glm::mat2x3 m1{0, 1, 2, 3, 4, 5}; + + glm::mat2x3 m2{ + {0, 1, 2}, + {3, 4, 5}}; + + Error += glm::all(glm::equal(m0, m2, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(m1, m2, glm::epsilon())) ? 0 : 1; + + std::vector v1{ + {0, 1, 2, 3, 4, 5}, + {0, 1, 2, 3, 4, 5} + }; + + std::vector v2{ + { + { 0, 1, 2}, + { 4, 5, 6} + }, + { + { 0, 1, 2}, + { 4, 5, 6} + } + }; + +#endif//GLM_HAS_INITIALIZER_LISTS + + return Error; +} + +namespace cast +{ + template + int entry() + { + int Error = 0; + + genType A(1.0f); + glm::mat2x3 B(A); + glm::mat2x3 Identity(1.0f); + + Error += glm::all(glm::equal(B, Identity, glm::epsilon())) ? 0 : 1; + + return Error; + } + + int test() + { + int Error = 0; + + Error += entry(); + Error += entry(); + Error += entry(); + Error += entry(); + Error += entry(); + Error += entry(); + Error += entry(); + Error += entry(); + Error += entry(); + + return Error; + } +}//namespace cast + +int test_size() +{ + int Error = 0; + + Error += 24 == sizeof(glm::mat2x3) ? 0 : 1; + Error += 48 == sizeof(glm::dmat2x3) ? 0 : 1; + Error += glm::mat2x3().length() == 2 ? 0 : 1; + Error += glm::dmat2x3().length() == 2 ? 0 : 1; + Error += glm::mat2x3::length() == 2 ? 0 : 1; + Error += glm::dmat2x3::length() == 2 ? 0 : 1; + + return Error; +} + +int test_constexpr() +{ +#if GLM_HAS_CONSTEXPR + static_assert(glm::mat2x3::length() == 2, "GLM: Failed constexpr"); +#endif + + return 0; +} + +int main() +{ + int Error = 0; + + Error += cast::test(); + Error += test_ctr(); + Error += test_operators(); + Error += test_size(); + Error += test_constexpr(); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_type_mat2x4.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_type_mat2x4.cpp new file mode 100644 index 0000000000000000000000000000000000000000..f5e05a2625efd775dfc86336ec85d493a66d3c35 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_type_mat2x4.cpp @@ -0,0 +1,147 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static int test_operators() +{ + glm::mat2x4 l(1.0f); + glm::mat2x4 m(1.0f); + glm::vec2 u(1.0f); + glm::vec4 v(1.0f); + float x = 1.0f; + glm::vec4 a = m * u; + glm::vec2 b = v * m; + glm::mat2x4 n = x / m; + glm::mat2x4 o = m / x; + glm::mat2x4 p = x * m; + glm::mat2x4 q = m * x; + bool R = glm::any(glm::notEqual(m, q, glm::epsilon())); + bool S = glm::all(glm::equal(m, l, glm::epsilon())); + + return (S && !R) ? 0 : 1; +} + +int test_ctr() +{ + int Error(0); + +#if(GLM_HAS_INITIALIZER_LISTS) + glm::mat2x4 m0( + glm::vec4(0, 1, 2, 3), + glm::vec4(4, 5, 6, 7)); + + glm::mat2x4 m1{0, 1, 2, 3, 4, 5, 6, 7}; + + glm::mat2x4 m2{ + {0, 1, 2, 3}, + {4, 5, 6, 7}}; + + Error += glm::all(glm::equal(m0, m2, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(m1, m2, glm::epsilon())) ? 0 : 1; + + std::vector v1{ + {0, 1, 2, 3, 4, 5, 6, 7}, + {0, 1, 2, 3, 4, 5, 6, 7} + }; + + std::vector v2{ + { + { 0, 1, 2, 3}, + { 4, 5, 6, 7} + }, + { + { 0, 1, 2, 3}, + { 4, 5, 6, 7} + } + }; + +#endif//GLM_HAS_INITIALIZER_LISTS + + return Error; +} + +namespace cast +{ + template + int entry() + { + int Error = 0; + + genType A(1.0f); + glm::mat2x4 B(A); + glm::mat2x4 Identity(1.0f); + + for(glm::length_t i = 0, length = B.length(); i < length; ++i) + Error += glm::all(glm::epsilonEqual(B[i], Identity[i], glm::epsilon())) ? 0 : 1; + + return Error; + } + + int test() + { + int Error = 0; + + Error += entry(); + Error += entry(); + Error += entry(); + Error += entry(); + Error += entry(); + Error += entry(); + Error += entry(); + Error += entry(); + Error += entry(); + + return Error; + } +}//namespace cast + +static int test_size() +{ + int Error = 0; + + Error += 32 == sizeof(glm::mat2x4) ? 0 : 1; + Error += 64 == sizeof(glm::dmat2x4) ? 0 : 1; + Error += glm::mat2x4().length() == 2 ? 0 : 1; + Error += glm::dmat2x4().length() == 2 ? 0 : 1; + Error += glm::mat2x4::length() == 2 ? 0 : 1; + Error += glm::dmat2x4::length() == 2 ? 0 : 1; + + return Error; +} + +static int test_constexpr() +{ +#if GLM_HAS_CONSTEXPR + static_assert(glm::mat2x4::length() == 2, "GLM: Failed constexpr"); +#endif + + return 0; +} + +int main() +{ + int Error = 0; + + Error += cast::test(); + Error += test_ctr(); + Error += test_operators(); + Error += test_size(); + Error += test_constexpr(); + + return Error; +} + + + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_type_mat3x2.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_type_mat3x2.cpp new file mode 100644 index 0000000000000000000000000000000000000000..c36ae7fe263db115e4ce03bc8d64b491b2713427 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_type_mat3x2.cpp @@ -0,0 +1,148 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static bool test_operators() +{ + glm::mat3x2 l(1.0f); + glm::mat3x2 m(1.0f); + glm::vec3 u(1.0f); + glm::vec2 v(1.0f); + float x = 1.0f; + glm::vec2 a = m * u; + glm::vec3 b = v * m; + glm::mat3x2 n = x / m; + glm::mat3x2 o = m / x; + glm::mat3x2 p = x * m; + glm::mat3x2 q = m * x; + bool R = glm::any(glm::notEqual(m, q, glm::epsilon())); + bool S = glm::all(glm::equal(m, l, glm::epsilon())); + + return (S && !R) ? 0 : 1; +} + +int test_ctr() +{ + int Error(0); + +#if(GLM_HAS_INITIALIZER_LISTS) + glm::mat3x2 m0( + glm::vec2(0, 1), + glm::vec2(2, 3), + glm::vec2(4, 5)); + + glm::mat3x2 m1{0, 1, 2, 3, 4, 5}; + + glm::mat3x2 m2{ + {0, 1}, + {2, 3}, + {4, 5}}; + + Error += glm::all(glm::equal(m0, m2, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(m1, m2, glm::epsilon())) ? 0 : 1; + + std::vector v1{ + {0, 1, 2, 3, 4, 5}, + {0, 1, 2, 3, 4, 5} + }; + + std::vector v2{ + { + { 0, 1}, + { 2, 3}, + { 4, 5} + }, + { + { 0, 1}, + { 2, 3}, + { 4, 5} + } + }; + +#endif//GLM_HAS_INITIALIZER_LISTS + + return Error; +} + +namespace cast +{ + template + int entry() + { + int Error = 0; + + genType A(1.0f); + glm::mat3x2 B(A); + glm::mat3x2 Identity(1.0f); + + Error += glm::all(glm::equal(B, Identity, glm::epsilon())) ? 0 : 1; + + return Error; + } + + int test() + { + int Error = 0; + + Error += entry(); + Error += entry(); + Error += entry(); + Error += entry(); + Error += entry(); + Error += entry(); + Error += entry(); + Error += entry(); + Error += entry(); + + return Error; + } +}//namespace cast + +static int test_size() +{ + int Error = 0; + + Error += 24 == sizeof(glm::mat3x2) ? 0 : 1; + Error += 48 == sizeof(glm::dmat3x2) ? 0 : 1; + Error += glm::mat3x2().length() == 3 ? 0 : 1; + Error += glm::dmat3x2().length() == 3 ? 0 : 1; + Error += glm::mat3x2::length() == 3 ? 0 : 1; + Error += glm::dmat3x2::length() == 3 ? 0 : 1; + + return Error; +} + +static int test_constexpr() +{ +#if GLM_HAS_CONSTEXPR + static_assert(glm::mat3x2::length() == 3, "GLM: Failed constexpr"); +#endif + + return 0; +} + +int main() +{ + int Error = 0; + + Error += cast::test(); + Error += test_ctr(); + Error += test_operators(); + Error += test_size(); + Error += test_constexpr(); + + return Error; +} + + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_type_mat3x3.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_type_mat3x3.cpp new file mode 100644 index 0000000000000000000000000000000000000000..501482ddffa94496db4fabe408fded99d6d46363 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_type_mat3x3.cpp @@ -0,0 +1,197 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static int test_mat3x3() +{ + glm::dmat3 Mat0( + glm::dvec3(0.6f, 0.2f, 0.3f), + glm::dvec3(0.2f, 0.7f, 0.5f), + glm::dvec3(0.3f, 0.5f, 0.7f)); + glm::dmat3 Inv0 = glm::inverse(Mat0); + glm::dmat3 Res0 = Mat0 * Inv0; + + return glm::all(glm::equal(Res0, glm::dmat3(1.0), 0.01)) ? 0 : 1; +} + +static int test_operators() +{ + glm::mat3x3 l(1.0f); + glm::mat3x3 m(1.0f); + glm::vec3 u(1.0f); + glm::vec3 v(1.0f); + float x = 1.0f; + glm::vec3 a = m * u; + glm::vec3 b = v * m; + glm::mat3x3 n = x / m; + glm::mat3x3 o = m / x; + glm::mat3x3 p = x * m; + glm::mat3x3 q = m * x; + bool R = glm::any(glm::notEqual(m, q, glm::epsilon())); + bool S = glm::all(glm::equal(m, l, glm::epsilon())); + + return (S && !R) ? 0 : 1; +} + +static int test_inverse() +{ + int Error(0); + + { + glm::mat3 const Matrix( + glm::vec3(0.6f, 0.2f, 0.3f), + glm::vec3(0.2f, 0.7f, 0.5f), + glm::vec3(0.3f, 0.5f, 0.7f)); + glm::mat3 const Inverse = glm::inverse(Matrix); + glm::mat3 const Identity = Matrix * Inverse; + + Error += glm::all(glm::equal(Identity[0], glm::vec3(1.0f, 0.0f, 0.0f), glm::vec3(0.01f))) ? 0 : 1; + Error += glm::all(glm::equal(Identity[1], glm::vec3(0.0f, 1.0f, 0.0f), glm::vec3(0.01f))) ? 0 : 1; + Error += glm::all(glm::equal(Identity[2], glm::vec3(0.0f, 0.0f, 1.0f), glm::vec3(0.01f))) ? 0 : 1; + } + + { + glm::mat3 const Matrix( + glm::vec3(0.6f, 0.2f, 0.3f), + glm::vec3(0.2f, 0.7f, 0.5f), + glm::vec3(0.3f, 0.5f, 0.7f)); + glm::mat3 const Identity = Matrix / Matrix; + + Error += glm::all(glm::equal(Identity[0], glm::vec3(1.0f, 0.0f, 0.0f), glm::vec3(0.01f))) ? 0 : 1; + Error += glm::all(glm::equal(Identity[1], glm::vec3(0.0f, 1.0f, 0.0f), glm::vec3(0.01f))) ? 0 : 1; + Error += glm::all(glm::equal(Identity[2], glm::vec3(0.0f, 0.0f, 1.0f), glm::vec3(0.01f))) ? 0 : 1; + } + + return Error; +} + +static int test_ctr() +{ + int Error(0); + +#if(GLM_HAS_INITIALIZER_LISTS) + glm::mat3x3 m0( + glm::vec3(0, 1, 2), + glm::vec3(3, 4, 5), + glm::vec3(6, 7, 8)); + + glm::mat3x3 m1{0, 1, 2, 3, 4, 5, 6, 7, 8}; + + glm::mat3x3 m2{ + {0, 1, 2}, + {3, 4, 5}, + {6, 7, 8}}; + + Error += glm::all(glm::equal(m0, m2, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(m1, m2, glm::epsilon())) ? 0 : 1; + + std::vector v1{ + {0, 1, 2, 3, 4, 5, 6, 7, 8}, + {0, 1, 2, 3, 4, 5, 6, 7, 8} + }; + + std::vector v2{ + { + { 0, 1, 2}, + { 3, 4, 5}, + { 6, 7, 8} + }, + { + { 0, 1, 2}, + { 3, 4, 5}, + { 6, 7, 8} + } + }; + +#endif//GLM_HAS_INITIALIZER_LISTS + + return Error; +} + +namespace cast +{ + template + int entry() + { + int Error = 0; + + genType A(1.0f); + glm::mat3x3 B(A); + glm::mat3x3 Identity(1.0f); + + Error += glm::all(glm::equal(B, Identity, glm::epsilon())) ? 0 : 1; + + return Error; + } + + int test() + { + int Error = 0; + + Error += entry(); + Error += entry(); + Error += entry(); + Error += entry(); + Error += entry(); + Error += entry(); + Error += entry(); + Error += entry(); + Error += entry(); + + return Error; + } +}//namespace cast + +static int test_size() +{ + int Error = 0; + + Error += 36 == sizeof(glm::mat3x3) ? 0 : 1; + Error += 72 == sizeof(glm::dmat3x3) ? 0 : 1; + Error += glm::mat3x3().length() == 3 ? 0 : 1; + Error += glm::dmat3x3().length() == 3 ? 0 : 1; + Error += glm::mat3x3::length() == 3 ? 0 : 1; + Error += glm::dmat3x3::length() == 3 ? 0 : 1; + + return Error; +} + +static int test_constexpr() +{ +#if GLM_HAS_CONSTEXPR + static_assert(glm::mat3x3::length() == 3, "GLM: Failed constexpr"); + + constexpr glm::mat3x3 const Z(0.0f); +#endif + + return 0; +} + +int main() +{ + int Error = 0; + + Error += cast::test(); + Error += test_ctr(); + Error += test_mat3x3(); + Error += test_operators(); + Error += test_inverse(); + Error += test_size(); + Error += test_constexpr(); + + return Error; +} + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_type_mat3x4.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_type_mat3x4.cpp new file mode 100644 index 0000000000000000000000000000000000000000..4ff0a6773da2b37a52b62e7694a5b99de33fde3b --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_type_mat3x4.cpp @@ -0,0 +1,149 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static bool test_operators() +{ + glm::mat3x4 l(1.0f); + glm::mat3x4 m(1.0f); + glm::vec3 u(1.0f); + glm::vec4 v(1.0f); + float x = 1.0f; + glm::vec4 a = m * u; + glm::vec3 b = v * m; + glm::mat3x4 n = x / m; + glm::mat3x4 o = m / x; + glm::mat3x4 p = x * m; + glm::mat3x4 q = m * x; + bool R = glm::any(glm::notEqual(m, q, glm::epsilon())); + bool S = glm::all(glm::equal(m, l, glm::epsilon())); + + return (S && !R) ? 0 : 1; +} + +int test_ctr() +{ + int Error(0); + +#if(GLM_HAS_INITIALIZER_LISTS) + glm::mat3x4 m0( + glm::vec4(0, 1, 2, 3), + glm::vec4(4, 5, 6, 7), + glm::vec4(8, 9, 10, 11)); + + glm::mat3x4 m1{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}; + + glm::mat3x4 m2{ + {0, 1, 2, 3}, + {4, 5, 6, 7}, + {8, 9, 10, 11}}; + + Error += glm::all(glm::equal(m0, m2, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(m1, m2, glm::epsilon())) ? 0 : 1; + + std::vector v1{ + {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}, + {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11} + }; + + std::vector v2{ + { + { 0, 1, 2, 3}, + { 4, 5, 6, 7}, + { 8, 9, 10, 11} + }, + { + { 0, 1, 2, 3}, + { 4, 5, 6, 7}, + { 8, 9, 10, 11} + } + }; + +#endif//GLM_HAS_INITIALIZER_LISTS + + return Error; +} + +namespace cast +{ + template + int entry() + { + int Error = 0; + + genType A(1.0f); + glm::mat3x4 B(A); + glm::mat3x4 Identity(1.0f); + + for(glm::length_t i = 0, length = B.length(); i < length; ++i) + Error += glm::all(glm::epsilonEqual(B[i], Identity[i], glm::epsilon())) ? 0 : 1; + + return Error; + } + + int test() + { + int Error = 0; + + Error += entry(); + Error += entry(); + Error += entry(); + Error += entry(); + Error += entry(); + Error += entry(); + Error += entry(); + Error += entry(); + Error += entry(); + + return Error; + } +}//namespace cast + +static int test_size() +{ + int Error = 0; + + Error += 48 == sizeof(glm::mat3x4) ? 0 : 1; + Error += 96 == sizeof(glm::dmat3x4) ? 0 : 1; + Error += glm::mat3x4().length() == 3 ? 0 : 1; + Error += glm::dmat3x4().length() == 3 ? 0 : 1; + Error += glm::mat3x4::length() == 3 ? 0 : 1; + Error += glm::dmat3x4::length() == 3 ? 0 : 1; + + return Error; +} + +static int test_constexpr() +{ +#if GLM_HAS_CONSTEXPR + static_assert(glm::mat3x4::length() == 3, "GLM: Failed constexpr"); +#endif + + return 0; +} + +int main() +{ + int Error = 0; + + Error += cast::test(); + Error += test_ctr(); + Error += test_operators(); + Error += test_size(); + Error += test_constexpr(); + + return Error; +} + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_type_mat4x2.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_type_mat4x2.cpp new file mode 100644 index 0000000000000000000000000000000000000000..4f92b7c36aae1674b52f5006a9b68aa93b25728a --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_type_mat4x2.cpp @@ -0,0 +1,151 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static int test_operators() +{ + glm::mat4x2 l(1.0f); + glm::mat4x2 m(1.0f); + glm::vec4 u(1.0f); + glm::vec2 v(1.0f); + float x = 1.0f; + glm::vec2 a = m * u; + glm::vec4 b = v * m; + glm::mat4x2 n = x / m; + glm::mat4x2 o = m / x; + glm::mat4x2 p = x * m; + glm::mat4x2 q = m * x; + bool R = glm::any(glm::notEqual(m, q, glm::epsilon())); + bool S = glm::all(glm::equal(m, l, glm::epsilon())); + + return (S && !R) ? 0 : 1; +} + +int test_ctr() +{ + int Error(0); + +#if(GLM_HAS_INITIALIZER_LISTS) + glm::mat4x2 m0( + glm::vec2(0, 1), + glm::vec2(2, 3), + glm::vec2(4, 5), + glm::vec2(6, 7)); + + glm::mat4x2 m1{0, 1, 2, 3, 4, 5, 6, 7}; + + glm::mat4x2 m2{ + {0, 1}, + {2, 3}, + {4, 5}, + {6, 7}}; + + Error += glm::all(glm::equal(m0, m2, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(m1, m2, glm::epsilon())) ? 0 : 1; + + std::vector v1{ + {0, 1, 2, 3, 4, 5, 6, 7}, + {0, 1, 2, 3, 4, 5, 6, 7} + }; + + std::vector v2{ + { + { 0, 1}, + { 4, 5}, + { 8, 9}, + { 12, 13} + }, + { + { 0, 1}, + { 4, 5}, + { 8, 9}, + { 12, 13} + } + }; + +#endif//GLM_HAS_INITIALIZER_LISTS + + return Error; +} + +namespace cast +{ + template + int entry() + { + int Error = 0; + + genType A(1.0f); + glm::mat4x2 B(A); + glm::mat4x2 Identity(1.0f); + + Error += glm::all(glm::equal(B, Identity, glm::epsilon())) ? 0 : 1; + + return Error; + } + + int test() + { + int Error = 0; + + Error += entry(); + Error += entry(); + Error += entry(); + Error += entry(); + Error += entry(); + Error += entry(); + Error += entry(); + Error += entry(); + Error += entry(); + + return Error; + } +}//namespace cast + +static int test_size() +{ + int Error = 0; + + Error += 32 == sizeof(glm::mat4x2) ? 0 : 1; + Error += 64 == sizeof(glm::dmat4x2) ? 0 : 1; + Error += glm::mat4x2().length() == 4 ? 0 : 1; + Error += glm::dmat4x2().length() == 4 ? 0 : 1; + Error += glm::mat4x2::length() == 4 ? 0 : 1; + Error += glm::dmat4x2::length() == 4 ? 0 : 1; + + return Error; +} + +static int test_constexpr() +{ +#if GLM_HAS_CONSTEXPR + static_assert(glm::mat4x2::length() == 4, "GLM: Failed constexpr"); +#endif + + return 0; +} + +int main() +{ + int Error = 0; + + Error += cast::test(); + Error += test_ctr(); + Error += test_operators(); + Error += test_size(); + Error += test_constexpr(); + + return Error; +} + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_type_mat4x3.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_type_mat4x3.cpp new file mode 100644 index 0000000000000000000000000000000000000000..02a7e85a9c113daa92952a502d79901e21ace94e --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_type_mat4x3.cpp @@ -0,0 +1,152 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static int test_operators() +{ + glm::mat4x3 l(1.0f); + glm::mat4x3 m(1.0f); + glm::vec4 u(1.0f); + glm::vec3 v(1.0f); + float x = 1.0f; + glm::vec3 a = m * u; + glm::vec4 b = v * m; + glm::mat4x3 n = x / m; + glm::mat4x3 o = m / x; + glm::mat4x3 p = x * m; + glm::mat4x3 q = m * x; + bool R = glm::any(glm::notEqual(m, q, glm::epsilon())); + bool S = glm::all(glm::equal(m, l, glm::epsilon())); + + return (S && !R) ? 0 : 1; +} + +int test_ctr() +{ + int Error(0); + +#if(GLM_HAS_INITIALIZER_LISTS) + glm::mat4x3 m0( + glm::vec3(0, 1, 2), + glm::vec3(3, 4, 5), + glm::vec3(6, 7, 8), + glm::vec3(9, 10, 11)); + + glm::mat4x3 m1{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}; + + glm::mat4x3 m2{ + {0, 1, 2}, + {3, 4, 5}, + {6, 7, 8}, + {9, 10, 11}}; + + Error += glm::all(glm::equal(m0, m2, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(m1, m2, glm::epsilon())) ? 0 : 1; + + std::vector v1{ + {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}, + {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11} + }; + + std::vector v2{ + { + { 0, 1, 2 }, + { 4, 5, 6 }, + { 8, 9, 10 }, + { 12, 13, 14 } + }, + { + { 0, 1, 2 }, + { 4, 5, 6 }, + { 8, 9, 10 }, + { 12, 13, 14 } + } + }; + +#endif//GLM_HAS_INITIALIZER_LISTS + + return Error; +} + +namespace cast +{ + template + int entry() + { + int Error = 0; + + genType A(1.0f); + glm::mat4x3 B(A); + glm::mat4x3 Identity(1.0f); + + Error += glm::all(glm::equal(B, Identity, glm::epsilon())) ? 0 : 1; + + return Error; + } + + int test() + { + int Error = 0; + + Error += entry(); + Error += entry(); + Error += entry(); + Error += entry(); + Error += entry(); + Error += entry(); + Error += entry(); + Error += entry(); + Error += entry(); + + return Error; + } +}//namespace cast + +static int test_size() +{ + int Error = 0; + + Error += 48 == sizeof(glm::mat4x3) ? 0 : 1; + Error += 96 == sizeof(glm::dmat4x3) ? 0 : 1; + Error += glm::mat4x3().length() == 4 ? 0 : 1; + Error += glm::dmat4x3().length() == 4 ? 0 : 1; + Error += glm::mat4x3::length() == 4 ? 0 : 1; + Error += glm::dmat4x3::length() == 4 ? 0 : 1; + + return Error; +} + +static int test_constexpr() +{ +#if GLM_HAS_CONSTEXPR + static_assert(glm::mat4x3::length() == 4, "GLM: Failed constexpr"); +#endif + + return 0; +} + +int main() +{ + int Error = 0; + + Error += cast::test(); + Error += test_ctr(); + Error += test_operators(); + Error += test_size(); + Error += test_constexpr(); + + return Error; +} + + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_type_mat4x4.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_type_mat4x4.cpp new file mode 100644 index 0000000000000000000000000000000000000000..61c78727d89ed70015564b5b3fa1b0412c491d93 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_type_mat4x4.cpp @@ -0,0 +1,218 @@ +#include +#include +#include +#include +#include +#include +#include +#include + +template +static int test_operators() +{ + typedef typename matType::value_type value_type; + + value_type const Epsilon = static_cast(0.001); + + int Error = 0; + + matType const M(static_cast(2.0f)); + matType const N(static_cast(1.0f)); + vecType const U(static_cast(2.0f)); + + { + matType const P = N * static_cast(2.0f); + Error += glm::all(glm::equal(P, M, Epsilon)) ? 0 : 1; + + matType const Q = M / static_cast(2.0f); + Error += glm::all(glm::equal(Q, N, Epsilon)) ? 0 : 1; + } + + { + vecType const V = M * U; + Error += glm::all(glm::equal(V, vecType(static_cast(4.f)), Epsilon)) ? 0 : 1; + + vecType const W = U / M; + Error += glm::all(glm::equal(W, vecType(static_cast(1.f)), Epsilon)) ? 0 : 1; + } + + { + matType const O = M * N; + Error += glm::all(glm::equal(O, matType(static_cast(2.f)), Epsilon)) ? 0 : 1; + } + + return Error; +} + +template +static int test_inverse() +{ + typedef typename matType::value_type value_type; + + value_type const Epsilon = static_cast(0.001); + + int Error = 0; + + matType const Identity(static_cast(1.0f)); + matType const Matrix( + glm::vec4(0.6f, 0.2f, 0.3f, 0.4f), + glm::vec4(0.2f, 0.7f, 0.5f, 0.3f), + glm::vec4(0.3f, 0.5f, 0.7f, 0.2f), + glm::vec4(0.4f, 0.3f, 0.2f, 0.6f)); + matType const Inverse = Identity / Matrix; + matType const Result = Matrix * Inverse; + + Error += glm::all(glm::equal(Identity, Result, Epsilon)) ? 0 : 1; + + return Error; +} + +static int test_ctr() +{ + int Error = 0; + +#if GLM_HAS_TRIVIAL_QUERIES + //Error += std::is_trivially_default_constructible::value ? 0 : 1; + //Error += std::is_trivially_copy_assignable::value ? 0 : 1; + Error += std::is_trivially_copyable::value ? 0 : 1; + //Error += std::is_copy_constructible::value ? 0 : 1; + //Error += std::has_trivial_copy_constructor::value ? 0 : 1; +#endif + +#if GLM_HAS_INITIALIZER_LISTS + glm::mat4 const m0( + glm::vec4(0, 1, 2, 3), + glm::vec4(4, 5, 6, 7), + glm::vec4(8, 9, 10, 11), + glm::vec4(12, 13, 14, 15)); + + assert(sizeof(m0) == 4 * 4 * 4); + + glm::vec4 const V{0, 1, 2, 3}; + + glm::mat4 const m1{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}; + + glm::mat4 const m2{ + {0, 1, 2, 3}, + {4, 5, 6, 7}, + {8, 9, 10, 11}, + {12, 13, 14, 15}}; + + Error += glm::all(glm::equal(m0, m2, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(m1, m2, glm::epsilon())) ? 0 : 1; + + + std::vector const m3{ + {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}, + {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}, + {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}, + {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}}; + + glm::mat4 const m4{ + {1, 0, 0, 0}, + {0, 1, 0, 0}, + {0, 0, 1, 0}, + {0, 0, 0, 1} }; + + Error += glm::equal(m4[0][0], 1.0f, 0.0001f) ? 0 : 1; + Error += glm::equal(m4[3][3], 1.0f, 0.0001f) ? 0 : 1; + + std::vector const v1{ + {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}, + {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}}; + + std::vector const v2{ + { + { 0, 1, 2, 3 }, + { 4, 5, 6, 7 }, + { 8, 9, 10, 11 }, + { 12, 13, 14, 15 } + }, + { + { 0, 1, 2, 3 }, + { 4, 5, 6, 7 }, + { 8, 9, 10, 11 }, + { 12, 13, 14, 15 } + }}; + +#endif//GLM_HAS_INITIALIZER_LISTS + + return Error; +} + +static int test_member_alloc_bug() +{ + int Error = 0; + + struct repro + { + repro(){ this->matrix = new glm::mat4(); } + ~repro(){delete this->matrix;} + + glm::mat4* matrix; + }; + + repro Repro; + + return Error; +} + +static int test_size() +{ + int Error = 0; + + Error += 64 == sizeof(glm::mat4) ? 0 : 1; + Error += 128 == sizeof(glm::dmat4) ? 0 : 1; + Error += glm::mat4().length() == 4 ? 0 : 1; + Error += glm::dmat4().length() == 4 ? 0 : 1; + Error += glm::mat4::length() == 4 ? 0 : 1; + Error += glm::dmat4::length() == 4 ? 0 : 1; + + return Error; +} + +static int test_constexpr() +{ +#if GLM_HAS_CONSTEXPR + static_assert(glm::mat4::length() == 4, "GLM: Failed constexpr"); + constexpr glm::mat4 A(1.f); + constexpr glm::mat4 B(1.f); + constexpr glm::bvec4 C = glm::equal(A, B, 0.01f); + static_assert(glm::all(C), "GLM: Failed constexpr"); +#endif + + return 0; +} + +int main() +{ + int Error = 0; + + Error += test_member_alloc_bug(); + Error += test_ctr(); + + Error += test_operators(); + Error += test_operators(); + Error += test_operators(); + Error += test_operators(); + + Error += test_operators(); + Error += test_operators(); + Error += test_operators(); + Error += test_operators(); + + Error += test_inverse(); + Error += test_inverse(); + Error += test_inverse(); + Error += test_inverse(); + + Error += test_inverse(); + Error += test_inverse(); + Error += test_inverse(); + Error += test_inverse(); + + Error += test_size(); + Error += test_constexpr(); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_type_vec1.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_type_vec1.cpp new file mode 100644 index 0000000000000000000000000000000000000000..d3411d2827baeddba44ba5f0a93f88868b18cbd0 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_type_vec1.cpp @@ -0,0 +1,169 @@ +#define GLM_FORCE_SWIZZLE +#include +#include +#include +#include +#include + +static glm::vec1 g1; +static glm::vec1 g2(1); + +int test_vec1_operators() +{ + int Error = 0; + + glm::ivec1 A(1); + glm::ivec1 B(1); + { + bool R = A != B; + bool S = A == B; + + Error += (S && !R) ? 0 : 1; + } + + { + A *= 1; + B *= 1; + A += 1; + B += 1; + + bool R = A != B; + bool S = A == B; + + Error += (S && !R) ? 0 : 1; + } + + return Error; +} + +int test_vec1_ctor() +{ + int Error = 0; + +# if GLM_HAS_TRIVIAL_QUERIES + // Error += std::is_trivially_default_constructible::value ? 0 : 1; + // Error += std::is_trivially_copy_assignable::value ? 0 : 1; + Error += std::is_trivially_copyable::value ? 0 : 1; + Error += std::is_trivially_copyable::value ? 0 : 1; + Error += std::is_trivially_copyable::value ? 0 : 1; + Error += std::is_trivially_copyable::value ? 0 : 1; + + Error += std::is_copy_constructible::value ? 0 : 1; +# endif + +/* +#if GLM_HAS_INITIALIZER_LISTS + { + glm::vec1 a{ 0 }; + std::vector v = { + {0.f}, + {4.f}, + {8.f}}; + } + + { + glm::dvec2 a{ 0 }; + std::vector v = { + {0.0}, + {4.0}, + {8.0}}; + } +#endif +*/ + + { + glm::vec2 A = glm::vec2(2.0f); + glm::vec2 B = glm::vec2(2.0f, 3.0f); + glm::vec2 C = glm::vec2(2.0f, 3.0); + //glm::vec2 D = glm::dvec2(2.0); // Build error TODO: What does the specification says? + glm::vec2 E(glm::dvec2(2.0)); + glm::vec2 F(glm::ivec2(2)); + } + + return Error; +} + +static int test_vec1_size() +{ + int Error = 0; + + Error += sizeof(glm::vec1) == sizeof(glm::mediump_vec1) ? 0 : 1; + Error += 4 == sizeof(glm::mediump_vec1) ? 0 : 1; + Error += sizeof(glm::dvec1) == sizeof(glm::highp_dvec1) ? 0 : 1; + Error += 8 == sizeof(glm::highp_dvec1) ? 0 : 1; + Error += glm::vec1().length() == 1 ? 0 : 1; + Error += glm::dvec1().length() == 1 ? 0 : 1; + Error += glm::vec1::length() == 1 ? 0 : 1; + Error += glm::dvec1::length() == 1 ? 0 : 1; + + return Error; +} + +static int test_vec1_operator_increment() +{ + int Error(0); + + glm::ivec1 v0(1); + glm::ivec1 v1(v0); + glm::ivec1 v2(v0); + glm::ivec1 v3 = ++v1; + glm::ivec1 v4 = v2++; + + Error += glm::all(glm::equal(v0, v4)) ? 0 : 1; + Error += glm::all(glm::equal(v1, v2)) ? 0 : 1; + Error += glm::all(glm::equal(v1, v3)) ? 0 : 1; + + int i0(1); + int i1(i0); + int i2(i0); + int i3 = ++i1; + int i4 = i2++; + + Error += i0 == i4 ? 0 : 1; + Error += i1 == i2 ? 0 : 1; + Error += i1 == i3 ? 0 : 1; + + return Error; +} + +static int test_swizzle() +{ + int Error = 0; + +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR + { + glm::vec1 A = glm::vec1(1.0f); + //glm::vec1 B = A.x; + glm::vec1 C(A.x); + + //Error += glm::all(glm::equal(A, B)) ? 0 : 1; + Error += glm::all(glm::equal(A, C, glm::epsilon())) ? 0 : 1; + } +# endif//GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR + + return Error; +} + +static int test_constexpr() +{ +#if GLM_HAS_CONSTEXPR + static_assert(glm::vec1::length() == 1, "GLM: Failed constexpr"); + static_assert(glm::vec1(1.0f).x > 0.0f, "GLM: Failed constexpr"); +#endif + + return 0; +} + +int main() +{ + int Error = 0; + + Error += test_vec1_size(); + Error += test_vec1_ctor(); + Error += test_vec1_operators(); + Error += test_vec1_operator_increment(); + Error += test_swizzle(); + Error += test_constexpr(); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_type_vec2.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_type_vec2.cpp new file mode 100644 index 0000000000000000000000000000000000000000..8af53556ed7bb2d410b3ff3ba44da9fc13e0eb63 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_type_vec2.cpp @@ -0,0 +1,392 @@ +#define GLM_FORCE_SWIZZLE +#include +#include +#include +#include +#include +#include +#include +#if GLM_HAS_TRIVIAL_QUERIES +# include +#endif + +static glm::ivec2 g1; +static glm::ivec2 g2(1); +static glm::ivec2 g3(1, 1); + +static int test_operators() +{ + int Error = 0; + + { + glm::ivec2 A(1); + glm::ivec2 B(1); + Error += A != B ? 1 : 0; + Error += A == B ? 0 : 1; + } + + { + glm::vec2 A(1.0f); + glm::vec2 C = A + 1.0f; + A += 1.0f; + Error += glm::all(glm::equal(A, glm::vec2(2.0f), glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(A, C, glm::epsilon())) ? 0 : 1; + } + + { + glm::vec2 A(1.0f); + glm::vec2 B(2.0f,-1.0f); + glm::vec2 C = A + B; + A += B; + Error += glm::all(glm::equal(A, glm::vec2(3.0f, 0.0f), glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(A, C, glm::epsilon())) ? 0 : 1; + } + + { + glm::vec2 A(1.0f); + glm::vec2 C = A - 1.0f; + A -= 1.0f; + Error += glm::all(glm::equal(A, glm::vec2(0.0f), glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(A, C, glm::epsilon())) ? 0 : 1; + } + + { + glm::vec2 A(1.0f); + glm::vec2 B(2.0f,-1.0f); + glm::vec2 C = A - B; + A -= B; + Error += glm::all(glm::equal(A, glm::vec2(-1.0f, 2.0f), glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(A, C, glm::epsilon())) ? 0 : 1; + } + + { + glm::vec2 A(1.0f); + glm::vec2 C = A * 2.0f; + A *= 2.0f; + Error += glm::all(glm::equal(A, glm::vec2(2.0f), glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(A, C, glm::epsilon())) ? 0 : 1; + } + + { + glm::vec2 A(2.0f); + glm::vec2 B(2.0f); + glm::vec2 C = A / B; + A /= B; + Error += glm::all(glm::equal(A, glm::vec2(1.0f), glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(A, C, glm::epsilon())) ? 0 : 1; + } + + { + glm::vec2 A(1.0f, 2.0f); + glm::vec2 B(4.0f, 5.0f); + + glm::vec2 C = A + B; + Error += glm::all(glm::equal(C, glm::vec2(5, 7), glm::epsilon())) ? 0 : 1; + + glm::vec2 D = B - A; + Error += glm::all(glm::equal(D, glm::vec2(3, 3), glm::epsilon())) ? 0 : 1; + + glm::vec2 E = A * B; + Error += glm::all(glm::equal(E, glm::vec2(4, 10), glm::epsilon())) ? 0 : 1; + + glm::vec2 F = B / A; + Error += glm::all(glm::equal(F, glm::vec2(4, 2.5), glm::epsilon())) ? 0 : 1; + + glm::vec2 G = A + 1.0f; + Error += glm::all(glm::equal(G, glm::vec2(2, 3), glm::epsilon())) ? 0 : 1; + + glm::vec2 H = B - 1.0f; + Error += glm::all(glm::equal(H, glm::vec2(3, 4), glm::epsilon())) ? 0 : 1; + + glm::vec2 I = A * 2.0f; + Error += glm::all(glm::equal(I, glm::vec2(2, 4), glm::epsilon())) ? 0 : 1; + + glm::vec2 J = B / 2.0f; + Error += glm::all(glm::equal(J, glm::vec2(2, 2.5), glm::epsilon())) ? 0 : 1; + + glm::vec2 K = 1.0f + A; + Error += glm::all(glm::equal(K, glm::vec2(2, 3), glm::epsilon())) ? 0 : 1; + + glm::vec2 L = 1.0f - B; + Error += glm::all(glm::equal(L, glm::vec2(-3, -4), glm::epsilon())) ? 0 : 1; + + glm::vec2 M = 2.0f * A; + Error += glm::all(glm::equal(M, glm::vec2(2, 4), glm::epsilon())) ? 0 : 1; + + glm::vec2 N = 2.0f / B; + Error += glm::all(glm::equal(N, glm::vec2(0.5, 2.0 / 5.0), glm::epsilon())) ? 0 : 1; + } + + { + glm::vec2 A(1.0f, 2.0f); + glm::vec2 B(4.0f, 5.0f); + + A += B; + Error += glm::all(glm::equal(A, glm::vec2(5, 7), glm::epsilon())) ? 0 : 1; + + A += 1.0f; + Error += glm::all(glm::equal(A, glm::vec2(6, 8), glm::epsilon())) ? 0 : 1; + } + { + glm::ivec2 A(1.0f, 2.0f); + glm::ivec2 B(4.0f, 5.0f); + + B -= A; + Error += B == glm::ivec2(3, 3) ? 0 : 1; + + B -= 1.0f; + Error += B == glm::ivec2(2, 2) ? 0 : 1; + } + { + glm::ivec2 A(1.0f, 2.0f); + glm::ivec2 B(4.0f, 5.0f); + + A *= B; + Error += A == glm::ivec2(4, 10) ? 0 : 1; + + A *= 2; + Error += A == glm::ivec2(8, 20) ? 0 : 1; + } + { + glm::ivec2 A(1.0f, 2.0f); + glm::ivec2 B(4.0f, 16.0f); + + B /= A; + Error += B == glm::ivec2(4, 8) ? 0 : 1; + + B /= 2.0f; + Error += B == glm::ivec2(2, 4) ? 0 : 1; + } + { + glm::ivec2 B(2); + + B /= B.y; + Error += B == glm::ivec2(1) ? 0 : 1; + } + + { + glm::ivec2 A(1.0f, 2.0f); + glm::ivec2 B = -A; + Error += B == glm::ivec2(-1.0f, -2.0f) ? 0 : 1; + } + + { + glm::ivec2 A(1.0f, 2.0f); + glm::ivec2 B = --A; + Error += B == glm::ivec2(0.0f, 1.0f) ? 0 : 1; + } + + { + glm::ivec2 A(1.0f, 2.0f); + glm::ivec2 B = A--; + Error += B == glm::ivec2(1.0f, 2.0f) ? 0 : 1; + Error += A == glm::ivec2(0.0f, 1.0f) ? 0 : 1; + } + + { + glm::ivec2 A(1.0f, 2.0f); + glm::ivec2 B = ++A; + Error += B == glm::ivec2(2.0f, 3.0f) ? 0 : 1; + } + + { + glm::ivec2 A(1.0f, 2.0f); + glm::ivec2 B = A++; + Error += B == glm::ivec2(1.0f, 2.0f) ? 0 : 1; + Error += A == glm::ivec2(2.0f, 3.0f) ? 0 : 1; + } + + return Error; +} + +static int test_ctor() +{ + int Error = 0; + + { + glm::ivec2 A(1); + glm::ivec2 B(A); + Error += A == B ? 0 : 1; + } + +# if GLM_HAS_TRIVIAL_QUERIES + // Error += std::is_trivially_default_constructible::value ? 0 : 1; + // Error += std::is_trivially_copy_assignable::value ? 0 : 1; + Error += std::is_trivially_copyable::value ? 0 : 1; + Error += std::is_trivially_copyable::value ? 0 : 1; + Error += std::is_trivially_copyable::value ? 0 : 1; + Error += std::is_trivially_copyable::value ? 0 : 1; + + Error += std::is_copy_constructible::value ? 0 : 1; +# endif + +#if GLM_HAS_INITIALIZER_LISTS + { + glm::vec2 a{ 0, 1 }; + std::vector v = { + {0, 1}, + {4, 5}, + {8, 9}}; + } + + { + glm::dvec2 a{ 0, 1 }; + std::vector v = { + {0, 1}, + {4, 5}, + {8, 9}}; + } +#endif + + { + glm::vec2 A = glm::vec2(2.0f); + glm::vec2 B = glm::vec2(2.0f, 3.0f); + glm::vec2 C = glm::vec2(2.0f, 3.0); + //glm::vec2 D = glm::dvec2(2.0); // Build error TODO: What does the specification says? + glm::vec2 E(glm::dvec2(2.0)); + glm::vec2 F(glm::ivec2(2)); + } + + { + glm::vec1 const R(1.0f); + glm::vec1 const S(2.0f); + glm::vec2 const O(1.0f, 2.0f); + + glm::vec2 const A(R); + glm::vec2 const B(1.0f); + Error += glm::all(glm::equal(A, B, 0.0001f)) ? 0 : 1; + + glm::vec2 const C(R, S); + Error += glm::all(glm::equal(C, O, 0.0001f)) ? 0 : 1; + + glm::vec2 const D(R, 2.0f); + Error += glm::all(glm::equal(D, O, 0.0001f)) ? 0 : 1; + + glm::vec2 const E(1.0f, S); + Error += glm::all(glm::equal(E, O, 0.0001f)) ? 0 : 1; + } + + { + glm::vec1 const R(1.0f); + glm::dvec1 const S(2.0); + glm::vec2 const O(1.0, 2.0); + + glm::vec2 const A(R); + glm::vec2 const B(1.0); + Error += glm::all(glm::equal(A, B, 0.0001f)) ? 0 : 1; + + glm::vec2 const C(R, S); + Error += glm::all(glm::equal(C, O, 0.0001f)) ? 0 : 1; + + glm::vec2 const D(R, 2.0); + Error += glm::all(glm::equal(D, O, 0.0001f)) ? 0 : 1; + + glm::vec2 const E(1.0, S); + Error += glm::all(glm::equal(E, O, 0.0001f)) ? 0 : 1; + } + + return Error; +} + +static int test_size() +{ + int Error = 0; + + Error += sizeof(glm::vec2) == sizeof(glm::mediump_vec2) ? 0 : 1; + Error += 8 == sizeof(glm::mediump_vec2) ? 0 : 1; + Error += sizeof(glm::dvec2) == sizeof(glm::highp_dvec2) ? 0 : 1; + Error += 16 == sizeof(glm::highp_dvec2) ? 0 : 1; + Error += glm::vec2().length() == 2 ? 0 : 1; + Error += glm::dvec2().length() == 2 ? 0 : 1; + Error += glm::vec2::length() == 2 ? 0 : 1; + Error += glm::dvec2::length() == 2 ? 0 : 1; + + GLM_CONSTEXPR std::size_t Length = glm::vec2::length(); + Error += Length == 2 ? 0 : 1; + + return Error; +} + +static int test_operator_increment() +{ + int Error = 0; + + glm::ivec2 v0(1); + glm::ivec2 v1(v0); + glm::ivec2 v2(v0); + glm::ivec2 v3 = ++v1; + glm::ivec2 v4 = v2++; + + Error += glm::all(glm::equal(v0, v4)) ? 0 : 1; + Error += glm::all(glm::equal(v1, v2)) ? 0 : 1; + Error += glm::all(glm::equal(v1, v3)) ? 0 : 1; + + int i0(1); + int i1(i0); + int i2(i0); + int i3 = ++i1; + int i4 = i2++; + + Error += i0 == i4 ? 0 : 1; + Error += i1 == i2 ? 0 : 1; + Error += i1 == i3 ? 0 : 1; + + return Error; +} + +static int test_constexpr() +{ +#if GLM_HAS_CONSTEXPR + static_assert(glm::vec2::length() == 2, "GLM: Failed constexpr"); + static_assert(glm::vec2(1.0f).x > 0.0f, "GLM: Failed constexpr"); + static_assert(glm::vec2(1.0f, -1.0f).x > 0.0f, "GLM: Failed constexpr"); + static_assert(glm::vec2(1.0f, -1.0f).y < 0.0f, "GLM: Failed constexpr"); +#endif + + return 0; +} + +static int test_swizzle() +{ + int Error = 0; + +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR + { + glm::vec2 A = glm::vec2(1.0f, 2.0f); + glm::vec2 B = A.xy; + glm::vec2 C(A.xy); + glm::vec2 D(A.xy()); + + Error += glm::all(glm::equal(A, B, 0.0001f)) ? 0 : 1; + Error += glm::all(glm::equal(A, C, 0.0001f)) ? 0 : 1; + Error += glm::all(glm::equal(A, D, 0.0001f)) ? 0 : 1; + } +# endif//GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR + +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR || GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION + { + glm::vec2 A = glm::vec2(1.0f, 2.0f); + glm::vec2 B = A.xy(); + glm::vec2 C(A.xy()); + + Error += glm::all(glm::equal(A, B, 0.0001f)) ? 0 : 1; + Error += glm::all(glm::equal(A, C, 0.0001f)) ? 0 : 1; + } +# endif//GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR || GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION + + return Error; +} + +int main() +{ + int Error = 0; + + Error += test_size(); + Error += test_ctor(); + Error += test_operators(); + Error += test_operator_increment(); + Error += test_swizzle(); + Error += test_constexpr(); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_type_vec3.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_type_vec3.cpp new file mode 100644 index 0000000000000000000000000000000000000000..12dd94cbf91ca23b63835b00c92612331c056a87 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_type_vec3.cpp @@ -0,0 +1,628 @@ +#define GLM_FORCE_SWIZZLE +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static glm::vec3 g1; +static glm::vec3 g2(1); +static glm::vec3 g3(1, 1, 1); + +int test_vec3_ctor() +{ + int Error = 0; + +# if GLM_HAS_TRIVIAL_QUERIES + // Error += std::is_trivially_default_constructible::value ? 0 : 1; + // Error += std::is_trivially_copy_assignable::value ? 0 : 1; + Error += std::is_trivially_copyable::value ? 0 : 1; + Error += std::is_trivially_copyable::value ? 0 : 1; + Error += std::is_trivially_copyable::value ? 0 : 1; + Error += std::is_trivially_copyable::value ? 0 : 1; + + Error += std::is_copy_constructible::value ? 0 : 1; +# endif + +# if GLM_HAS_INITIALIZER_LISTS + { + glm::vec3 a{ 0, 1, 2 }; + std::vector v = { + {0, 1, 2}, + {4, 5, 6}, + {8, 9, 0}}; + } + + { + glm::dvec3 a{ 0, 1, 2 }; + std::vector v = { + {0, 1, 2}, + {4, 5, 6}, + {8, 9, 0}}; + } +# endif + + { + glm::ivec3 A(1); + glm::ivec3 B(1, 1, 1); + + Error += A == B ? 0 : 1; + } + + { + std::vector Tests; + Tests.push_back(glm::ivec3(glm::ivec2(1, 2), 3)); + Tests.push_back(glm::ivec3(1, glm::ivec2(2, 3))); + Tests.push_back(glm::ivec3(1, 2, 3)); + Tests.push_back(glm::ivec3(glm::ivec4(1, 2, 3, 4))); + + for(std::size_t i = 0; i < Tests.size(); ++i) + Error += Tests[i] == glm::ivec3(1, 2, 3) ? 0 : 1; + } + + { + glm::vec1 const R(1.0f); + glm::vec1 const S(2.0f); + glm::vec1 const T(3.0f); + glm::vec3 const O(1.0f, 2.0f, 3.0f); + + glm::vec3 const A(R); + glm::vec3 const B(1.0f); + Error += glm::all(glm::equal(A, B, glm::epsilon())) ? 0 : 1; + + glm::vec3 const C(R, S, T); + Error += glm::all(glm::equal(C, O, glm::epsilon())) ? 0 : 1; + + glm::vec3 const D(R, 2.0f, 3.0f); + Error += glm::all(glm::equal(D, O, glm::epsilon())) ? 0 : 1; + + glm::vec3 const E(1.0f, S, 3.0f); + Error += glm::all(glm::equal(E, O, glm::epsilon())) ? 0 : 1; + + glm::vec3 const F(1.0f, S, T); + Error += glm::all(glm::equal(F, O, glm::epsilon())) ? 0 : 1; + + glm::vec3 const G(R, 2.0f, T); + Error += glm::all(glm::equal(G, O, glm::epsilon())) ? 0 : 1; + + glm::vec3 const H(R, S, 3.0f); + Error += glm::all(glm::equal(H, O, glm::epsilon())) ? 0 : 1; + } + + { + glm::vec1 const R(1.0); + glm::dvec1 const S(2.0); + glm::vec1 const T(3.0); + glm::vec3 const O(1.0f, 2.0f, 3.0f); + + glm::vec3 const A(R); + glm::vec3 const B(1.0); + Error += glm::all(glm::equal(A, B, glm::epsilon())) ? 0 : 1; + + glm::vec3 const C(R, S, T); + Error += glm::all(glm::equal(C, O, glm::epsilon())) ? 0 : 1; + + glm::vec3 const D(R, 2.0, 3.0); + Error += glm::all(glm::equal(D, O, glm::epsilon())) ? 0 : 1; + + glm::vec3 const E(1.0f, S, 3.0); + Error += glm::all(glm::equal(E, O, glm::epsilon())) ? 0 : 1; + + glm::vec3 const F(1.0, S, T); + Error += glm::all(glm::equal(F, O, glm::epsilon())) ? 0 : 1; + + glm::vec3 const G(R, 2.0, T); + Error += glm::all(glm::equal(G, O, glm::epsilon())) ? 0 : 1; + + glm::vec3 const H(R, S, 3.0); + Error += glm::all(glm::equal(H, O, glm::epsilon())) ? 0 : 1; + } + + return Error; +} + +float foo() +{ + glm::vec3 bar = glm::vec3(0.0f, 1.0f, 1.0f); + + return glm::length(bar); +} + +static int test_bvec3_ctor() +{ + int Error = 0; + + glm::bvec3 const A(true); + glm::bvec3 const B(true); + glm::bvec3 const C(false); + glm::bvec3 const D = A && B; + glm::bvec3 const E = A && C; + glm::bvec3 const F = A || C; + + Error += D == glm::bvec3(true) ? 0 : 1; + Error += E == glm::bvec3(false) ? 0 : 1; + Error += F == glm::bvec3(true) ? 0 : 1; + + bool const G = A == C; + bool const H = A != C; + Error += !G ? 0 : 1; + Error += H ? 0 : 1; + + return Error; +} + +static int test_vec3_operators() +{ + int Error = 0; + + { + glm::ivec3 A(1); + glm::ivec3 B(1); + bool R = A != B; + bool S = A == B; + + Error += (S && !R) ? 0 : 1; + } + + { + glm::vec3 const A(1.0f, 2.0f, 3.0f); + glm::vec3 const B(4.0f, 5.0f, 6.0f); + + glm::vec3 const C = A + B; + Error += glm::all(glm::equal(C, glm::vec3(5, 7, 9), glm::epsilon())) ? 0 : 1; + + glm::vec3 const D = B - A; + Error += glm::all(glm::equal(D, glm::vec3(3, 3, 3), glm::epsilon())) ? 0 : 1; + + glm::vec3 const E = A * B; + Error += glm::all(glm::equal(E, glm::vec3(4, 10, 18), glm::epsilon())) ? 0 : 1; + + glm::vec3 const F = B / A; + Error += glm::all(glm::equal(F, glm::vec3(4, 2.5, 2), glm::epsilon())) ? 0 : 1; + + glm::vec3 const G = A + 1.0f; + Error += glm::all(glm::equal(G, glm::vec3(2, 3, 4), glm::epsilon())) ? 0 : 1; + + glm::vec3 const H = B - 1.0f; + Error += glm::all(glm::equal(H, glm::vec3(3, 4, 5), glm::epsilon())) ? 0 : 1; + + glm::vec3 const I = A * 2.0f; + Error += glm::all(glm::equal(I, glm::vec3(2, 4, 6), glm::epsilon())) ? 0 : 1; + + glm::vec3 const J = B / 2.0f; + Error += glm::all(glm::equal(J, glm::vec3(2, 2.5, 3), glm::epsilon())) ? 0 : 1; + + glm::vec3 const K = 1.0f + A; + Error += glm::all(glm::equal(K, glm::vec3(2, 3, 4), glm::epsilon())) ? 0 : 1; + + glm::vec3 const L = 1.0f - B; + Error += glm::all(glm::equal(L, glm::vec3(-3, -4, -5), glm::epsilon())) ? 0 : 1; + + glm::vec3 const M = 2.0f * A; + Error += glm::all(glm::equal(M, glm::vec3(2, 4, 6), glm::epsilon())) ? 0 : 1; + + glm::vec3 const N = 2.0f / B; + Error += glm::all(glm::equal(N, glm::vec3(0.5, 2.0 / 5.0, 2.0 / 6.0), glm::epsilon())) ? 0 : 1; + } + + { + glm::ivec3 A(1.0f, 2.0f, 3.0f); + glm::ivec3 B(4.0f, 5.0f, 6.0f); + + A += B; + Error += A == glm::ivec3(5, 7, 9) ? 0 : 1; + + A += 1; + Error += A == glm::ivec3(6, 8, 10) ? 0 : 1; + } + { + glm::ivec3 A(1.0f, 2.0f, 3.0f); + glm::ivec3 B(4.0f, 5.0f, 6.0f); + + B -= A; + Error += B == glm::ivec3(3, 3, 3) ? 0 : 1; + + B -= 1; + Error += B == glm::ivec3(2, 2, 2) ? 0 : 1; + } + { + glm::ivec3 A(1.0f, 2.0f, 3.0f); + glm::ivec3 B(4.0f, 5.0f, 6.0f); + + A *= B; + Error += A == glm::ivec3(4, 10, 18) ? 0 : 1; + + A *= 2; + Error += A == glm::ivec3(8, 20, 36) ? 0 : 1; + } + { + glm::ivec3 A(1.0f, 2.0f, 3.0f); + glm::ivec3 B(4.0f, 4.0f, 6.0f); + + B /= A; + Error += B == glm::ivec3(4, 2, 2) ? 0 : 1; + + B /= 2; + Error += B == glm::ivec3(2, 1, 1) ? 0 : 1; + } + { + glm::ivec3 B(2); + + B /= B.y; + Error += B == glm::ivec3(1) ? 0 : 1; + } + + { + glm::ivec3 A(1.0f, 2.0f, 3.0f); + glm::ivec3 B = -A; + Error += B == glm::ivec3(-1.0f, -2.0f, -3.0f) ? 0 : 1; + } + + { + glm::ivec3 A(1.0f, 2.0f, 3.0f); + glm::ivec3 B = --A; + Error += B == glm::ivec3(0.0f, 1.0f, 2.0f) ? 0 : 1; + } + + { + glm::ivec3 A(1.0f, 2.0f, 3.0f); + glm::ivec3 B = A--; + Error += B == glm::ivec3(1.0f, 2.0f, 3.0f) ? 0 : 1; + Error += A == glm::ivec3(0.0f, 1.0f, 2.0f) ? 0 : 1; + } + + { + glm::ivec3 A(1.0f, 2.0f, 3.0f); + glm::ivec3 B = ++A; + Error += B == glm::ivec3(2.0f, 3.0f, 4.0f) ? 0 : 1; + } + + { + glm::ivec3 A(1.0f, 2.0f, 3.0f); + glm::ivec3 B = A++; + Error += B == glm::ivec3(1.0f, 2.0f, 3.0f) ? 0 : 1; + Error += A == glm::ivec3(2.0f, 3.0f, 4.0f) ? 0 : 1; + } + + return Error; +} + +int test_vec3_size() +{ + int Error = 0; + + Error += sizeof(glm::vec3) == sizeof(glm::lowp_vec3) ? 0 : 1; + Error += sizeof(glm::vec3) == sizeof(glm::mediump_vec3) ? 0 : 1; + Error += sizeof(glm::vec3) == sizeof(glm::highp_vec3) ? 0 : 1; + Error += 12 == sizeof(glm::mediump_vec3) ? 0 : 1; + Error += sizeof(glm::dvec3) == sizeof(glm::lowp_dvec3) ? 0 : 1; + Error += sizeof(glm::dvec3) == sizeof(glm::mediump_dvec3) ? 0 : 1; + Error += sizeof(glm::dvec3) == sizeof(glm::highp_dvec3) ? 0 : 1; + Error += 24 == sizeof(glm::highp_dvec3) ? 0 : 1; + Error += glm::vec3().length() == 3 ? 0 : 1; + Error += glm::dvec3().length() == 3 ? 0 : 1; + Error += glm::vec3::length() == 3 ? 0 : 1; + Error += glm::dvec3::length() == 3 ? 0 : 1; + + GLM_CONSTEXPR std::size_t Length = glm::vec3::length(); + Error += Length == 3 ? 0 : 1; + + return Error; +} + +int test_vec3_swizzle3_2() +{ + int Error = 0; + +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR + { + glm::ivec3 v(1, 2, 3); + glm::ivec2 u; + + // Can not assign a vec3 swizzle to a vec2 + //u = v.xyz; //Illegal + //u = v.rgb; //Illegal + //u = v.stp; //Illegal + + u = v.xx; Error += (u.x == 1 && u.y == 1) ? 0 : 1; + u = v.xy; Error += (u.x == 1 && u.y == 2) ? 0 : 1; + u = v.xz; Error += (u.x == 1 && u.y == 3) ? 0 : 1; + u = v.yx; Error += (u.x == 2 && u.y == 1) ? 0 : 1; + u = v.yy; Error += (u.x == 2 && u.y == 2) ? 0 : 1; + u = v.yz; Error += (u.x == 2 && u.y == 3) ? 0 : 1; + u = v.zx; Error += (u.x == 3 && u.y == 1) ? 0 : 1; + u = v.zy; Error += (u.x == 3 && u.y == 2) ? 0 : 1; + u = v.zz; Error += (u.x == 3 && u.y == 3) ? 0 : 1; + + u = v.rr; Error += (u.r == 1 && u.g == 1) ? 0 : 1; + u = v.rg; Error += (u.r == 1 && u.g == 2) ? 0 : 1; + u = v.rb; Error += (u.r == 1 && u.g == 3) ? 0 : 1; + u = v.gr; Error += (u.r == 2 && u.g == 1) ? 0 : 1; + u = v.gg; Error += (u.r == 2 && u.g == 2) ? 0 : 1; + u = v.gb; Error += (u.r == 2 && u.g == 3) ? 0 : 1; + u = v.br; Error += (u.r == 3 && u.g == 1) ? 0 : 1; + u = v.bg; Error += (u.r == 3 && u.g == 2) ? 0 : 1; + u = v.bb; Error += (u.r == 3 && u.g == 3) ? 0 : 1; + + u = v.ss; Error += (u.s == 1 && u.t == 1) ? 0 : 1; + u = v.st; Error += (u.s == 1 && u.t == 2) ? 0 : 1; + u = v.sp; Error += (u.s == 1 && u.t == 3) ? 0 : 1; + u = v.ts; Error += (u.s == 2 && u.t == 1) ? 0 : 1; + u = v.tt; Error += (u.s == 2 && u.t == 2) ? 0 : 1; + u = v.tp; Error += (u.s == 2 && u.t == 3) ? 0 : 1; + u = v.ps; Error += (u.s == 3 && u.t == 1) ? 0 : 1; + u = v.pt; Error += (u.s == 3 && u.t == 2) ? 0 : 1; + u = v.pp; Error += (u.s == 3 && u.t == 3) ? 0 : 1; + // Mixed member aliases are not valid + //u = v.rx; //Illegal + //u = v.sy; //Illegal + + u = glm::ivec2(1, 2); + v = glm::ivec3(1, 2, 3); + //v.xx = u; //Illegal + v.xy = u; Error += (v.x == 1 && v.y == 2 && v.z == 3) ? 0 : 1; + v.xz = u; Error += (v.x == 1 && v.y == 2 && v.z == 2) ? 0 : 1; + v.yx = u; Error += (v.x == 2 && v.y == 1 && v.z == 2) ? 0 : 1; + //v.yy = u; //Illegal + v.yz = u; Error += (v.x == 2 && v.y == 1 && v.z == 2) ? 0 : 1; + v.zx = u; Error += (v.x == 2 && v.y == 1 && v.z == 1) ? 0 : 1; + v.zy = u; Error += (v.x == 2 && v.y == 2 && v.z == 1) ? 0 : 1; + //v.zz = u; //Illegal + } +# endif//GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR + + return Error; +} + +int test_vec3_swizzle3_3() +{ + int Error = 0; + +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR + { + glm::ivec3 v(1, 2, 3); + glm::ivec3 u; + + u = v; Error += (u.x == 1 && u.y == 2 && u.z == 3) ? 0 : 1; + + u = v.xyz; Error += (u.x == 1 && u.y == 2 && u.z == 3) ? 0 : 1; + u = v.zyx; Error += (u.x == 3 && u.y == 2 && u.z == 1) ? 0 : 1; + u.zyx = v; Error += (u.x == 3 && u.y == 2 && u.z == 1) ? 0 : 1; + + u = v.rgb; Error += (u.x == 1 && u.y == 2 && u.z == 3) ? 0 : 1; + u = v.bgr; Error += (u.x == 3 && u.y == 2 && u.z == 1) ? 0 : 1; + u.bgr = v; Error += (u.x == 3 && u.y == 2 && u.z == 1) ? 0 : 1; + + u = v.stp; Error += (u.x == 1 && u.y == 2 && u.z == 3) ? 0 : 1; + u = v.pts; Error += (u.x == 3 && u.y == 2 && u.z == 1) ? 0 : 1; + u.pts = v; Error += (u.x == 3 && u.y == 2 && u.z == 1) ? 0 : 1; + } +# endif//GLM_LANG + + return Error; +} + +int test_vec3_swizzle_operators() +{ + int Error = 0; + + glm::ivec3 const u = glm::ivec3(1, 2, 3); + glm::ivec3 const v = glm::ivec3(10, 20, 30); + +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR + { + glm::ivec3 q; + + // Swizzle, swizzle binary operators + q = u.xyz + v.xyz; Error += (q == (u + v)) ? 0 : 1; + q = (u.zyx + v.zyx).zyx; Error += (q == (u + v)) ? 0 : 1; + q = (u.xyz - v.xyz); Error += (q == (u - v)) ? 0 : 1; + q = (u.xyz * v.xyz); Error += (q == (u * v)) ? 0 : 1; + q = (u.xxx * v.xxx); Error += (q == glm::ivec3(u.x * v.x)) ? 0 : 1; + q = (u.xyz / v.xyz); Error += (q == (u / v)) ? 0 : 1; + + // vec, swizzle binary operators + q = u + v.xyz; Error += (q == (u + v)) ? 0 : 1; + q = (u - v.xyz); Error += (q == (u - v)) ? 0 : 1; + q = (u * v.xyz); Error += (q == (u * v)) ? 0 : 1; + q = (u * v.xxx); Error += (q == v.x * u) ? 0 : 1; + q = (u / v.xyz); Error += (q == (u / v)) ? 0 : 1; + + // swizzle,vec binary operators + q = u.xyz + v; Error += (q == (u + v)) ? 0 : 1; + q = (u.xyz - v); Error += (q == (u - v)) ? 0 : 1; + q = (u.xyz * v); Error += (q == (u * v)) ? 0 : 1; + q = (u.xxx * v); Error += (q == u.x * v) ? 0 : 1; + q = (u.xyz / v); Error += (q == (u / v)) ? 0 : 1; + } +# endif//GLM_LANG + + // Compile errors + //q = (u.yz * v.xyz); + //q = (u * v.xy); + + return Error; +} + +int test_vec3_swizzle_functions() +{ + int Error = 0; + +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR || GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION + { + // NOTE: template functions cannot pick up the implicit conversion from + // a swizzle to the unswizzled type, therefore the operator() must be + // used. E.g.: + // + // glm::dot(u.xy, v.xy); <--- Compile error + // glm::dot(u.xy(), v.xy()); <--- Compiles correctly + + float r; + + // vec2 + glm::vec2 a(1, 2); + glm::vec2 b(10, 20); + r = glm::dot(a, b); Error += (int(r) == 50) ? 0 : 1; + r = glm::dot(glm::vec2(a.xy()), glm::vec2(b.xy())); Error += (int(r) == 50) ? 0 : 1; + r = glm::dot(glm::vec2(a.xy()), glm::vec2(b.yy())); Error += (int(r) == 60) ? 0 : 1; + + // vec3 + glm::vec3 u = glm::vec3(1, 2, 3); + glm::vec3 v = glm::vec3(10, 20, 30); + r = glm::dot(u, v); Error += (int(r) == 140) ? 0 : 1; + r = glm::dot(u.xyz(), v.zyz()); Error += (int(r) == 160) ? 0 : 1; + r = glm::dot(u, v.zyx()); Error += (int(r) == 100) ? 0 : 1; + r = glm::dot(u.xyz(), v); Error += (int(r) == 140) ? 0 : 1; + r = glm::dot(u.xy(), v.xy()); Error += (int(r) == 50) ? 0 : 1; + + // vec4 + glm::vec4 s = glm::vec4(1, 2, 3, 4); + glm::vec4 t = glm::vec4(10, 20, 30, 40); + r = glm::dot(s, t); Error += (int(r) == 300) ? 0 : 1; + r = glm::dot(s.xyzw(), t.xyzw()); Error += (int(r) == 300) ? 0 : 1; + r = glm::dot(s.xyz(), t.xyz()); Error += (int(r) == 140) ? 0 : 1; + } +# endif//GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR || GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION + + return Error; +} + +int test_vec3_swizzle_partial() +{ + int Error = 0; + +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR + { + glm::vec3 const A(1, 2, 3); + glm::vec3 B(A.xy, 3); + Error += glm::all(glm::equal(A, B, glm::epsilon())) ? 0 : 1; + } + + { + glm::ivec3 const A(1, 2, 3); + glm::ivec3 const B(1, A.yz); + Error += A == B ? 0 : 1; + } + + { + glm::ivec3 const A(1, 2, 3); + glm::ivec3 const B(A.xyz); + Error += A == B ? 0 : 1; + } +# endif//GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR + + return Error; +} + +static int test_operator_increment() +{ + int Error = 0; + + glm::ivec3 v0(1); + glm::ivec3 v1(v0); + glm::ivec3 v2(v0); + glm::ivec3 v3 = ++v1; + glm::ivec3 v4 = v2++; + + Error += glm::all(glm::equal(v0, v4)) ? 0 : 1; + Error += glm::all(glm::equal(v1, v2)) ? 0 : 1; + Error += glm::all(glm::equal(v1, v3)) ? 0 : 1; + + int i0(1); + int i1(i0); + int i2(i0); + int i3 = ++i1; + int i4 = i2++; + + Error += i0 == i4 ? 0 : 1; + Error += i1 == i2 ? 0 : 1; + Error += i1 == i3 ? 0 : 1; + + return Error; +} + +static int test_swizzle() +{ + int Error = 0; + +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR + { + glm::vec3 A = glm::vec3(1.0f, 2.0f, 3.0f); + glm::vec3 B = A.xyz; + glm::vec3 C(A.xyz); + glm::vec3 D(A.xyz()); + glm::vec3 E(A.x, A.yz); + glm::vec3 F(A.x, A.yz()); + glm::vec3 G(A.xy, A.z); + glm::vec3 H(A.xy(), A.z); + + Error += glm::all(glm::equal(A, B, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(A, C, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(A, D, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(A, E, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(A, F, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(A, G, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(A, H, glm::epsilon())) ? 0 : 1; + } +# endif//GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR + +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR || GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION + { + glm::vec3 A = glm::vec3(1.0f, 2.0f, 3.0f); + glm::vec3 B = A.xyz(); + glm::vec3 C(A.xyz()); + glm::vec3 D(A.xyz()); + glm::vec3 E(A.x, A.yz()); + glm::vec3 F(A.x, A.yz()); + glm::vec3 G(A.xy(), A.z); + glm::vec3 H(A.xy(), A.z); + + Error += glm::all(glm::equal(A, B, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(A, C, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(A, D, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(A, E, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(A, F, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(A, G, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(A, H, glm::epsilon())) ? 0 : 1; + } +# endif//GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR || GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION + + return Error; +} + +static int test_constexpr() +{ +#if GLM_HAS_CONSTEXPR + static_assert(glm::vec3::length() == 3, "GLM: Failed constexpr"); + static_assert(glm::vec3(1.0f).x > 0.0f, "GLM: Failed constexpr"); + static_assert(glm::vec3(1.0f, -1.0f, -1.0f).x > 0.0f, "GLM: Failed constexpr"); + static_assert(glm::vec3(1.0f, -1.0f, -1.0f).y < 0.0f, "GLM: Failed constexpr"); +#endif + + return 0; +} + +int main() +{ + int Error = 0; + + Error += test_vec3_ctor(); + Error += test_bvec3_ctor(); + Error += test_vec3_operators(); + Error += test_vec3_size(); + Error += test_operator_increment(); + Error += test_constexpr(); + + Error += test_swizzle(); + Error += test_vec3_swizzle3_2(); + Error += test_vec3_swizzle3_3(); + Error += test_vec3_swizzle_partial(); + Error += test_vec3_swizzle_operators(); + Error += test_vec3_swizzle_functions(); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_type_vec4.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_type_vec4.cpp new file mode 100644 index 0000000000000000000000000000000000000000..c5d1ba14e7cff1f1568139b0c3feb7719371676f --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/core/core_type_vec4.cpp @@ -0,0 +1,850 @@ +#define GLM_FORCE_SWIZZLE +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static glm::vec4 g1; +static glm::vec4 g2(1); +static glm::vec4 g3(1, 1, 1, 1); + +template +struct mask +{ + enum{value = Value}; +}; + +enum comp +{ + X, + Y, + Z, + W +}; + +//template +//__m128 swizzle(glm::vec4 const& v) +//{ +// __m128 Src = _mm_set_ps(v.w, v.z, v.y, v.x); +// return _mm_shuffle_ps(Src, Src, mask<(int(W) << 6) | (int(Z) << 4) | (int(Y) << 2) | (int(X) << 0)>::value); +//} + +static int test_vec4_ctor() +{ + int Error = 0; + + { + glm::ivec4 A(1, 2, 3, 4); + glm::ivec4 B(A); + Error += glm::all(glm::equal(A, B)) ? 0 : 1; + } + +# if GLM_HAS_TRIVIAL_QUERIES + // Error += std::is_trivially_default_constructible::value ? 0 : 1; + // Error += std::is_trivially_copy_assignable::value ? 0 : 1; + Error += std::is_trivially_copyable::value ? 0 : 1; + Error += std::is_trivially_copyable::value ? 0 : 1; + Error += std::is_trivially_copyable::value ? 0 : 1; + Error += std::is_trivially_copyable::value ? 0 : 1; + + Error += std::is_copy_constructible::value ? 0 : 1; +# endif + +#if GLM_HAS_INITIALIZER_LISTS + { + glm::vec4 a{ 0, 1, 2, 3 }; + std::vector v = { + {0, 1, 2, 3}, + {4, 5, 6, 7}, + {8, 9, 0, 1}}; + } + + { + glm::dvec4 a{ 0, 1, 2, 3 }; + std::vector v = { + {0, 1, 2, 3}, + {4, 5, 6, 7}, + {8, 9, 0, 1}}; + } +#endif + + { + glm::ivec4 const A(1); + glm::ivec4 const B(1, 1, 1, 1); + + Error += A == B ? 0 : 1; + } + + { + std::vector Tests; + Tests.push_back(glm::ivec4(glm::ivec2(1, 2), 3, 4)); + Tests.push_back(glm::ivec4(1, glm::ivec2(2, 3), 4)); + Tests.push_back(glm::ivec4(1, 2, glm::ivec2(3, 4))); + Tests.push_back(glm::ivec4(glm::ivec3(1, 2, 3), 4)); + Tests.push_back(glm::ivec4(1, glm::ivec3(2, 3, 4))); + Tests.push_back(glm::ivec4(glm::ivec2(1, 2), glm::ivec2(3, 4))); + Tests.push_back(glm::ivec4(1, 2, 3, 4)); + Tests.push_back(glm::ivec4(glm::ivec4(1, 2, 3, 4))); + + for(std::size_t i = 0; i < Tests.size(); ++i) + Error += Tests[i] == glm::ivec4(1, 2, 3, 4) ? 0 : 1; + } + + { + glm::vec1 const R(1.0f); + glm::vec1 const S(2.0f); + glm::vec1 const T(3.0f); + glm::vec1 const U(4.0f); + glm::vec4 const O(1.0f, 2.0f, 3.0f, 4.0f); + + glm::vec4 const A(R); + glm::vec4 const B(1.0f); + Error += glm::all(glm::equal(A, B, glm::epsilon())) ? 0 : 1; + + glm::vec4 const C(R, S, T, U); + Error += glm::all(glm::equal(C, O, glm::epsilon())) ? 0 : 1; + + glm::vec4 const D(R, 2.0f, 3.0f, 4.0f); + Error += glm::all(glm::equal(D, O, glm::epsilon())) ? 0 : 1; + + glm::vec4 const E(1.0f, S, 3.0f, 4.0f); + Error += glm::all(glm::equal(E, O, glm::epsilon())) ? 0 : 1; + + glm::vec4 const F(R, S, 3.0f, 4.0f); + Error += glm::all(glm::equal(F, O, glm::epsilon())) ? 0 : 1; + + glm::vec4 const G(1.0f, 2.0f, T, 4.0f); + Error += glm::all(glm::equal(G, O, glm::epsilon())) ? 0 : 1; + + glm::vec4 const H(R, 2.0f, T, 4.0f); + Error += glm::all(glm::equal(H, O, glm::epsilon())) ? 0 : 1; + + glm::vec4 const I(1.0f, S, T, 4.0f); + Error += glm::all(glm::equal(I, O, glm::epsilon())) ? 0 : 1; + + glm::vec4 const J(R, S, T, 4.0f); + Error += glm::all(glm::equal(J, O, glm::epsilon())) ? 0 : 1; + + glm::vec4 const K(R, 2.0f, 3.0f, U); + Error += glm::all(glm::equal(K, O, glm::epsilon())) ? 0 : 1; + + glm::vec4 const L(1.0f, S, 3.0f, U); + Error += glm::all(glm::equal(L, O, glm::epsilon())) ? 0 : 1; + + glm::vec4 const M(R, S, 3.0f, U); + Error += glm::all(glm::equal(M, O, glm::epsilon())) ? 0 : 1; + + glm::vec4 const N(1.0f, 2.0f, T, U); + Error += glm::all(glm::equal(N, O, glm::epsilon())) ? 0 : 1; + + glm::vec4 const P(R, 2.0f, T, U); + Error += glm::all(glm::equal(P, O, glm::epsilon())) ? 0 : 1; + + glm::vec4 const Q(1.0f, S, T, U); + Error += glm::all(glm::equal(Q, O, glm::epsilon())) ? 0 : 1; + + glm::vec4 const V(R, S, T, U); + Error += glm::all(glm::equal(V, O, glm::epsilon())) ? 0 : 1; + } + + { + glm::vec1 const R(1.0f); + glm::dvec1 const S(2.0); + glm::vec1 const T(3.0); + glm::dvec1 const U(4.0); + glm::vec4 const O(1.0f, 2.0, 3.0f, 4.0); + + glm::vec4 const A(R); + glm::vec4 const B(1.0); + Error += glm::all(glm::equal(A, B, glm::epsilon())) ? 0 : 1; + + glm::vec4 const C(R, S, T, U); + Error += glm::all(glm::equal(C, O, glm::epsilon())) ? 0 : 1; + + glm::vec4 const D(R, 2.0f, 3.0, 4.0f); + Error += glm::all(glm::equal(D, O, glm::epsilon())) ? 0 : 1; + + glm::vec4 const E(1.0, S, 3.0f, 4.0); + Error += glm::all(glm::equal(E, O, glm::epsilon())) ? 0 : 1; + + glm::vec4 const F(R, S, 3.0, 4.0f); + Error += glm::all(glm::equal(F, O, glm::epsilon())) ? 0 : 1; + + glm::vec4 const G(1.0f, 2.0, T, 4.0); + Error += glm::all(glm::equal(G, O, glm::epsilon())) ? 0 : 1; + + glm::vec4 const H(R, 2.0, T, 4.0); + Error += glm::all(glm::equal(H, O, glm::epsilon())) ? 0 : 1; + + glm::vec4 const I(1.0, S, T, 4.0f); + Error += glm::all(glm::equal(I, O, glm::epsilon())) ? 0 : 1; + + glm::vec4 const J(R, S, T, 4.0f); + Error += glm::all(glm::equal(J, O, glm::epsilon())) ? 0 : 1; + + glm::vec4 const K(R, 2.0f, 3.0, U); + Error += glm::all(glm::equal(K, O, glm::epsilon())) ? 0 : 1; + + glm::vec4 const L(1.0f, S, 3.0, U); + Error += glm::all(glm::equal(L, O, glm::epsilon())) ? 0 : 1; + + glm::vec4 const M(R, S, 3.0, U); + Error += glm::all(glm::equal(M, O, glm::epsilon())) ? 0 : 1; + + glm::vec4 const N(1.0f, 2.0, T, U); + Error += glm::all(glm::equal(N, O, glm::epsilon())) ? 0 : 1; + + glm::vec4 const P(R, 2.0, T, U); + Error += glm::all(glm::equal(P, O, glm::epsilon())) ? 0 : 1; + + glm::vec4 const Q(1.0f, S, T, U); + Error += glm::all(glm::equal(Q, O, glm::epsilon())) ? 0 : 1; + + glm::vec4 const V(R, S, T, U); + Error += glm::all(glm::equal(V, O, glm::epsilon())) ? 0 : 1; + } + + { + glm::vec1 const v1_0(1.0f); + glm::vec1 const v1_1(2.0f); + glm::vec1 const v1_2(3.0f); + glm::vec1 const v1_3(4.0f); + + glm::vec2 const v2_0(1.0f, 2.0f); + glm::vec2 const v2_1(2.0f, 3.0f); + glm::vec2 const v2_2(3.0f, 4.0f); + + glm::vec3 const v3_0(1.0f, 2.0f, 3.0f); + glm::vec3 const v3_1(2.0f, 3.0f, 4.0f); + + glm::vec4 const O(1.0f, 2.0, 3.0f, 4.0); + + glm::vec4 const A(v1_0, v1_1, v2_2); + Error += glm::all(glm::equal(A, O, glm::epsilon())) ? 0 : 1; + + glm::vec4 const B(1.0f, 2.0f, v2_2); + Error += glm::all(glm::equal(B, O, glm::epsilon())) ? 0 : 1; + + glm::vec4 const C(v1_0, 2.0f, v2_2); + Error += glm::all(glm::equal(C, O, glm::epsilon())) ? 0 : 1; + + glm::vec4 const D(1.0f, v1_1, v2_2); + Error += glm::all(glm::equal(D, O, glm::epsilon())) ? 0 : 1; + + glm::vec4 const E(v2_0, v1_2, v1_3); + Error += glm::all(glm::equal(E, O, glm::epsilon())) ? 0 : 1; + + glm::vec4 const F(v2_0, 3.0, v1_3); + Error += glm::all(glm::equal(F, O, glm::epsilon())) ? 0 : 1; + + glm::vec4 const G(v2_0, v1_2, 4.0); + Error += glm::all(glm::equal(G, O, glm::epsilon())) ? 0 : 1; + + glm::vec4 const H(v2_0, 3.0f, 4.0); + Error += glm::all(glm::equal(H, O, glm::epsilon())) ? 0 : 1; + } + + { + glm::vec1 const v1_0(1.0f); + glm::vec1 const v1_1(2.0f); + glm::vec1 const v1_2(3.0f); + glm::vec1 const v1_3(4.0f); + + glm::vec2 const v2(2.0f, 3.0f); + + glm::vec4 const O(1.0f, 2.0, 3.0f, 4.0); + + glm::vec4 const A(v1_0, v2, v1_3); + Error += glm::all(glm::equal(A, O, glm::epsilon())) ? 0 : 1; + + glm::vec4 const B(v1_0, v2, 4.0); + Error += glm::all(glm::equal(B, O, glm::epsilon())) ? 0 : 1; + + glm::vec4 const C(1.0, v2, v1_3); + Error += glm::all(glm::equal(C, O, glm::epsilon())) ? 0 : 1; + + glm::vec4 const D(1.0f, v2, 4.0); + Error += glm::all(glm::equal(D, O, glm::epsilon())) ? 0 : 1; + + glm::vec4 const E(1.0, v2, 4.0f); + Error += glm::all(glm::equal(E, O, glm::epsilon())) ? 0 : 1; + } + + return Error; +} + +static int test_bvec4_ctor() +{ + int Error = 0; + + glm::bvec4 const A(true); + glm::bvec4 const B(true); + glm::bvec4 const C(false); + glm::bvec4 const D = A && B; + glm::bvec4 const E = A && C; + glm::bvec4 const F = A || C; + + Error += D == glm::bvec4(true) ? 0 : 1; + Error += E == glm::bvec4(false) ? 0 : 1; + Error += F == glm::bvec4(true) ? 0 : 1; + + bool const G = A == C; + bool const H = A != C; + Error += !G ? 0 : 1; + Error += H ? 0 : 1; + + return Error; +} + +static int test_operators() +{ + int Error = 0; + + { + glm::ivec4 A(1); + glm::ivec4 B(1); + bool R = A != B; + bool S = A == B; + + Error += (S && !R) ? 0 : 1; + } + + { + glm::vec4 const A(1.0f, 2.0f, 3.0f, 4.0f); + glm::vec4 const B(4.0f, 5.0f, 6.0f, 7.0f); + + glm::vec4 const C = A + B; + Error += glm::all(glm::equal(C, glm::vec4(5, 7, 9, 11), glm::epsilon())) ? 0 : 1; + + glm::vec4 const D = B - A; + Error += glm::all(glm::equal(D, glm::vec4(3, 3, 3, 3), glm::epsilon())) ? 0 : 1; + + glm::vec4 const E = A * B; + Error += glm::all(glm::equal(E, glm::vec4(4, 10, 18, 28), glm::epsilon()) )? 0 : 1; + + glm::vec4 const F = B / A; + Error += glm::all(glm::equal(F, glm::vec4(4, 2.5, 2, 7.0f / 4.0f), glm::epsilon())) ? 0 : 1; + + glm::vec4 const G = A + 1.0f; + Error += glm::all(glm::equal(G, glm::vec4(2, 3, 4, 5), glm::epsilon())) ? 0 : 1; + + glm::vec4 const H = B - 1.0f; + Error += glm::all(glm::equal(H, glm::vec4(3, 4, 5, 6), glm::epsilon())) ? 0 : 1; + + glm::vec4 const I = A * 2.0f; + Error += glm::all(glm::equal(I, glm::vec4(2, 4, 6, 8), glm::epsilon())) ? 0 : 1; + + glm::vec4 const J = B / 2.0f; + Error += glm::all(glm::equal(J, glm::vec4(2, 2.5, 3, 3.5), glm::epsilon())) ? 0 : 1; + + glm::vec4 const K = 1.0f + A; + Error += glm::all(glm::equal(K, glm::vec4(2, 3, 4, 5), glm::epsilon())) ? 0 : 1; + + glm::vec4 const L = 1.0f - B; + Error += glm::all(glm::equal(L, glm::vec4(-3, -4, -5, -6), glm::epsilon())) ? 0 : 1; + + glm::vec4 const M = 2.0f * A; + Error += glm::all(glm::equal(M, glm::vec4(2, 4, 6, 8), glm::epsilon())) ? 0 : 1; + + glm::vec4 const N = 2.0f / B; + Error += glm::all(glm::equal(N, glm::vec4(0.5, 2.0 / 5.0, 2.0 / 6.0, 2.0 / 7.0), glm::epsilon())) ? 0 : 1; + } + + { + glm::ivec4 A(1.0f, 2.0f, 3.0f, 4.0f); + glm::ivec4 B(4.0f, 5.0f, 6.0f, 7.0f); + + A += B; + Error += A == glm::ivec4(5, 7, 9, 11) ? 0 : 1; + + A += 1; + Error += A == glm::ivec4(6, 8, 10, 12) ? 0 : 1; + } + { + glm::ivec4 A(1.0f, 2.0f, 3.0f, 4.0f); + glm::ivec4 B(4.0f, 5.0f, 6.0f, 7.0f); + + B -= A; + Error += B == glm::ivec4(3, 3, 3, 3) ? 0 : 1; + + B -= 1; + Error += B == glm::ivec4(2, 2, 2, 2) ? 0 : 1; + } + { + glm::ivec4 A(1.0f, 2.0f, 3.0f, 4.0f); + glm::ivec4 B(4.0f, 5.0f, 6.0f, 7.0f); + + A *= B; + Error += A == glm::ivec4(4, 10, 18, 28) ? 0 : 1; + + A *= 2; + Error += A == glm::ivec4(8, 20, 36, 56) ? 0 : 1; + } + { + glm::ivec4 A(1.0f, 2.0f, 2.0f, 4.0f); + glm::ivec4 B(4.0f, 4.0f, 8.0f, 8.0f); + + B /= A; + Error += B == glm::ivec4(4, 2, 4, 2) ? 0 : 1; + + B /= 2; + Error += B == glm::ivec4(2, 1, 2, 1) ? 0 : 1; + } + { + glm::ivec4 B(2); + + B /= B.y; + Error += B == glm::ivec4(1) ? 0 : 1; + } + + { + glm::ivec4 A(1.0f, 2.0f, 3.0f, 4.0f); + glm::ivec4 B = -A; + Error += B == glm::ivec4(-1.0f, -2.0f, -3.0f, -4.0f) ? 0 : 1; + } + + { + glm::ivec4 A(1.0f, 2.0f, 3.0f, 4.0f); + glm::ivec4 B = --A; + Error += B == glm::ivec4(0.0f, 1.0f, 2.0f, 3.0f) ? 0 : 1; + } + + { + glm::ivec4 A(1.0f, 2.0f, 3.0f, 4.0f); + glm::ivec4 B = A--; + Error += B == glm::ivec4(1.0f, 2.0f, 3.0f, 4.0f) ? 0 : 1; + Error += A == glm::ivec4(0.0f, 1.0f, 2.0f, 3.0f) ? 0 : 1; + } + + { + glm::ivec4 A(1.0f, 2.0f, 3.0f, 4.0f); + glm::ivec4 B = ++A; + Error += B == glm::ivec4(2.0f, 3.0f, 4.0f, 5.0f) ? 0 : 1; + } + + { + glm::ivec4 A(1.0f, 2.0f, 3.0f, 4.0f); + glm::ivec4 B = A++; + Error += B == glm::ivec4(1.0f, 2.0f, 3.0f, 4.0f) ? 0 : 1; + Error += A == glm::ivec4(2.0f, 3.0f, 4.0f, 5.0f) ? 0 : 1; + } + + return Error; +} + +static int test_equal() +{ + int Error = 0; + + { + glm::uvec4 const A(1, 2, 3, 4); + glm::uvec4 const B(1, 2, 3, 4); + Error += A == B ? 0 : 1; + Error += A != B ? 1 : 0; + } + + { + glm::ivec4 const A(1, 2, 3, 4); + glm::ivec4 const B(1, 2, 3, 4); + Error += A == B ? 0 : 1; + Error += A != B ? 1 : 0; + } + + return Error; +} + +static int test_size() +{ + int Error = 0; + + Error += sizeof(glm::vec4) == sizeof(glm::lowp_vec4) ? 0 : 1; + Error += sizeof(glm::vec4) == sizeof(glm::mediump_vec4) ? 0 : 1; + Error += sizeof(glm::vec4) == sizeof(glm::highp_vec4) ? 0 : 1; + Error += 16 == sizeof(glm::mediump_vec4) ? 0 : 1; + Error += sizeof(glm::dvec4) == sizeof(glm::lowp_dvec4) ? 0 : 1; + Error += sizeof(glm::dvec4) == sizeof(glm::mediump_dvec4) ? 0 : 1; + Error += sizeof(glm::dvec4) == sizeof(glm::highp_dvec4) ? 0 : 1; + Error += 32 == sizeof(glm::highp_dvec4) ? 0 : 1; + Error += glm::vec4().length() == 4 ? 0 : 1; + Error += glm::dvec4().length() == 4 ? 0 : 1; + Error += glm::vec4::length() == 4 ? 0 : 1; + Error += glm::dvec4::length() == 4 ? 0 : 1; + + return Error; +} + +static int test_swizzle_partial() +{ + int Error = 0; + + glm::vec4 const A(1, 2, 3, 4); + +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR + { + glm::vec4 B(A.xy, A.zw); + Error += glm::all(glm::equal(A, B, glm::epsilon())) ? 0 : 1; + } + { + glm::vec4 B(A.xy, 3.0f, 4.0f); + Error += glm::all(glm::equal(A, B, glm::epsilon())) ? 0 : 1; + } + { + glm::vec4 B(1.0f, A.yz, 4.0f); + Error += glm::all(glm::equal(A, B, glm::epsilon())) ? 0 : 1; + } + { + glm::vec4 B(1.0f, 2.0f, A.zw); + Error += glm::all(glm::equal(A, B, glm::epsilon())) ? 0 : 1; + } + + { + glm::vec4 B(A.xyz, 4.0f); + Error += glm::all(glm::equal(A, B, glm::epsilon())) ? 0 : 1; + } + { + glm::vec4 B(1.0f, A.yzw); + Error += glm::all(glm::equal(A, B, glm::epsilon())) ? 0 : 1; + } +# endif//GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR || GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION + + return Error; +} + +static int test_swizzle() +{ + int Error = 0; + +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR + { + glm::ivec4 A = glm::ivec4(1.0f, 2.0f, 3.0f, 4.0f); + glm::ivec4 B = A.xyzw; + glm::ivec4 C(A.xyzw); + glm::ivec4 D(A.xyzw()); + glm::ivec4 E(A.x, A.yzw); + glm::ivec4 F(A.x, A.yzw()); + glm::ivec4 G(A.xyz, A.w); + glm::ivec4 H(A.xyz(), A.w); + glm::ivec4 I(A.xy, A.zw); + glm::ivec4 J(A.xy(), A.zw()); + glm::ivec4 K(A.x, A.y, A.zw); + glm::ivec4 L(A.x, A.yz, A.w); + glm::ivec4 M(A.xy, A.z, A.w); + + Error += glm::all(glm::equal(A, B)) ? 0 : 1; + Error += glm::all(glm::equal(A, C)) ? 0 : 1; + Error += glm::all(glm::equal(A, D)) ? 0 : 1; + Error += glm::all(glm::equal(A, E)) ? 0 : 1; + Error += glm::all(glm::equal(A, F)) ? 0 : 1; + Error += glm::all(glm::equal(A, G)) ? 0 : 1; + Error += glm::all(glm::equal(A, H)) ? 0 : 1; + Error += glm::all(glm::equal(A, I)) ? 0 : 1; + Error += glm::all(glm::equal(A, J)) ? 0 : 1; + Error += glm::all(glm::equal(A, K)) ? 0 : 1; + Error += glm::all(glm::equal(A, L)) ? 0 : 1; + Error += glm::all(glm::equal(A, M)) ? 0 : 1; + } +# endif//GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR + +# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR || GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION + { + glm::vec4 A = glm::vec4(1.0f, 2.0f, 3.0f, 4.0f); + glm::vec4 B = A.xyzw(); + glm::vec4 C(A.xyzw()); + glm::vec4 D(A.xyzw()); + glm::vec4 E(A.x, A.yzw()); + glm::vec4 F(A.x, A.yzw()); + glm::vec4 G(A.xyz(), A.w); + glm::vec4 H(A.xyz(), A.w); + glm::vec4 I(A.xy(), A.zw()); + glm::vec4 J(A.xy(), A.zw()); + glm::vec4 K(A.x, A.y, A.zw()); + glm::vec4 L(A.x, A.yz(), A.w); + glm::vec4 M(A.xy(), A.z, A.w); + + Error += glm::all(glm::equal(A, B, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(A, C, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(A, D, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(A, E, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(A, F, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(A, G, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(A, H, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(A, I, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(A, J, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(A, K, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(A, L, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(A, M, glm::epsilon())) ? 0 : 1; + } +# endif//GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR || GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION + + return Error; +} + +static int test_operator_increment() +{ + int Error = 0; + + glm::ivec4 v0(1); + glm::ivec4 v1(v0); + glm::ivec4 v2(v0); + glm::ivec4 v3 = ++v1; + glm::ivec4 v4 = v2++; + + Error += glm::all(glm::equal(v0, v4)) ? 0 : 1; + Error += glm::all(glm::equal(v1, v2)) ? 0 : 1; + Error += glm::all(glm::equal(v1, v3)) ? 0 : 1; + + int i0(1); + int i1(i0); + int i2(i0); + int i3 = ++i1; + int i4 = i2++; + + Error += i0 == i4 ? 0 : 1; + Error += i1 == i2 ? 0 : 1; + Error += i1 == i3 ? 0 : 1; + + return Error; +} + +struct AoS +{ + glm::vec4 A; + glm::vec3 B; + glm::vec3 C; + glm::vec2 D; +}; + +static int test_perf_AoS(std::size_t Size) +{ + int Error = 0; + + std::vector In; + std::vector Out; + In.resize(Size); + Out.resize(Size); + + std::clock_t StartTime = std::clock(); + + for(std::size_t i = 0; i < In.size(); ++i) + Out[i] = In[i]; + + std::clock_t EndTime = std::clock(); + + std::printf("AoS: %d\n", static_cast(EndTime - StartTime)); + + return Error; +} + +static int test_perf_SoA(std::size_t Size) +{ + int Error = 0; + + std::vector InA; + std::vector InB; + std::vector InC; + std::vector InD; + std::vector OutA; + std::vector OutB; + std::vector OutC; + std::vector OutD; + + InA.resize(Size); + InB.resize(Size); + InC.resize(Size); + InD.resize(Size); + OutA.resize(Size); + OutB.resize(Size); + OutC.resize(Size); + OutD.resize(Size); + + std::clock_t StartTime = std::clock(); + + for(std::size_t i = 0; i < InA.size(); ++i) + { + OutA[i] = InA[i]; + OutB[i] = InB[i]; + OutC[i] = InC[i]; + OutD[i] = InD[i]; + } + + std::clock_t EndTime = std::clock(); + + std::printf("SoA: %d\n", static_cast(EndTime - StartTime)); + + return Error; +} + +namespace heap +{ + struct A + { + float f; + }; + + struct B : public A + { + float g; + glm::vec4 v; + }; + + static int test() + { + int Error = 0; + + A* p = new B; + p->f = 0.0f; + delete p; + + Error += sizeof(B) == sizeof(glm::vec4) + sizeof(float) * 2 ? 0 : 1; + + return Error; + } +}//namespace heap + +static int test_simd() +{ + int Error = 0; + + glm::vec4 const a(std::clock(), std::clock(), std::clock(), std::clock()); + glm::vec4 const b(std::clock(), std::clock(), std::clock(), std::clock()); + + glm::vec4 const c(b * a); + glm::vec4 const d(a + c); + + Error += glm::all(glm::greaterThanEqual(d, glm::vec4(0))) ? 0 : 1; + + return Error; +} + +static int test_inheritance() +{ + struct my_vec4 : public glm::vec4 + { + my_vec4() + : glm::vec4(76.f, 75.f, 74.f, 73.f) + , member(82) + {} + + int member; + }; + + int Error = 0; + + my_vec4 v; + + Error += v.member == 82 ? 0 : 1; + Error += glm::equal(v.x, 76.f, glm::epsilon()) ? 0 : 1; + Error += glm::equal(v.y, 75.f, glm::epsilon()) ? 0 : 1; + Error += glm::equal(v.z, 74.f, glm::epsilon()) ? 0 : 1; + Error += glm::equal(v.w, 73.f, glm::epsilon()) ? 0 : 1; + + return Error; +} + +static int test_constexpr() +{ +#if GLM_HAS_CONSTEXPR + static_assert(glm::vec4::length() == 4, "GLM: Failed constexpr"); + static_assert(glm::vec4(1.0f).x > 0.0f, "GLM: Failed constexpr"); + static_assert(glm::vec4(1.0f, -1.0f, -1.0f, -1.0f).x > 0.0f, "GLM: Failed constexpr"); + static_assert(glm::vec4(1.0f, -1.0f, -1.0f, -1.0f).y < 0.0f, "GLM: Failed constexpr"); +#endif + + return 0; +} +/* +static int test_simd_gen() +{ + int Error = 0; + + int const C = static_cast(std::clock()); + int const D = static_cast(std::clock()); + + glm::ivec4 const A(C); + glm::ivec4 const B(D); + + Error += A != B ? 0 : 1; + + return Error; +} +*/ +int main() +{ + int Error = 0; + + //Error += test_simd_gen(); + +/* + { + glm::ivec4 const a1(2); + glm::ivec4 const b1 = a1 >> 1; + + __m128i const e1 = _mm_set1_epi32(2); + __m128i const f1 = _mm_srli_epi32(e1, 1); + + glm::ivec4 const g1 = *reinterpret_cast(&f1); + + glm::ivec4 const a2(-2); + glm::ivec4 const b2 = a2 >> 1; + + __m128i const e2 = _mm_set1_epi32(-1); + __m128i const f2 = _mm_srli_epi32(e2, 1); + + glm::ivec4 const g2 = *reinterpret_cast(&f2); + + std::printf("GNI\n"); + } + + { + glm::uvec4 const a1(2); + glm::uvec4 const b1 = a1 >> 1u; + + __m128i const e1 = _mm_set1_epi32(2); + __m128i const f1 = _mm_srli_epi32(e1, 1); + + glm::uvec4 const g1 = *reinterpret_cast(&f1); + + glm::uvec4 const a2(-1); + glm::uvec4 const b2 = a2 >> 1u; + + __m128i const e2 = _mm_set1_epi32(-1); + __m128i const f2 = _mm_srli_epi32(e2, 1); + + glm::uvec4 const g2 = *reinterpret_cast(&f2); + + std::printf("GNI\n"); + } +*/ + +# ifdef NDEBUG + std::size_t const Size(1000000); +# else + std::size_t const Size(1); +# endif//NDEBUG + + Error += test_perf_AoS(Size); + Error += test_perf_SoA(Size); + + Error += test_vec4_ctor(); + Error += test_bvec4_ctor(); + Error += test_size(); + Error += test_operators(); + Error += test_equal(); + Error += test_swizzle(); + Error += test_swizzle_partial(); + Error += test_simd(); + Error += test_operator_increment(); + Error += heap::test(); + Error += test_inheritance(); + Error += test_constexpr(); + + return Error; +} + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/CMakeLists.txt b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..8b86dfdaa16b98af9d13fb9ff4ecd24f14d798b1 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/CMakeLists.txt @@ -0,0 +1,55 @@ +glmCreateTestGTC(ext_matrix_relational) +glmCreateTestGTC(ext_matrix_transform) +glmCreateTestGTC(ext_matrix_common) +glmCreateTestGTC(ext_matrix_integer) +glmCreateTestGTC(ext_matrix_int2x2_sized) +glmCreateTestGTC(ext_matrix_int2x3_sized) +glmCreateTestGTC(ext_matrix_int2x4_sized) +glmCreateTestGTC(ext_matrix_int3x2_sized) +glmCreateTestGTC(ext_matrix_int3x3_sized) +glmCreateTestGTC(ext_matrix_int3x4_sized) +glmCreateTestGTC(ext_matrix_int4x2_sized) +glmCreateTestGTC(ext_matrix_int4x3_sized) +glmCreateTestGTC(ext_matrix_int4x4_sized) +glmCreateTestGTC(ext_matrix_uint2x2_sized) +glmCreateTestGTC(ext_matrix_uint2x3_sized) +glmCreateTestGTC(ext_matrix_uint2x4_sized) +glmCreateTestGTC(ext_matrix_uint3x2_sized) +glmCreateTestGTC(ext_matrix_uint3x3_sized) +glmCreateTestGTC(ext_matrix_uint3x4_sized) +glmCreateTestGTC(ext_matrix_uint4x2_sized) +glmCreateTestGTC(ext_matrix_uint4x3_sized) +glmCreateTestGTC(ext_matrix_uint4x4_sized) +glmCreateTestGTC(ext_quaternion_common) +glmCreateTestGTC(ext_quaternion_exponential) +glmCreateTestGTC(ext_quaternion_geometric) +glmCreateTestGTC(ext_quaternion_relational) +glmCreateTestGTC(ext_quaternion_transform) +glmCreateTestGTC(ext_quaternion_trigonometric) +glmCreateTestGTC(ext_quaternion_type) +glmCreateTestGTC(ext_scalar_common) +glmCreateTestGTC(ext_scalar_constants) +glmCreateTestGTC(ext_scalar_int_sized) +glmCreateTestGTC(ext_scalar_uint_sized) +glmCreateTestGTC(ext_scalar_integer) +glmCreateTestGTC(ext_scalar_ulp) +glmCreateTestGTC(ext_scalar_reciprocal) +glmCreateTestGTC(ext_scalar_relational) +glmCreateTestGTC(ext_vec1) +glmCreateTestGTC(ext_vector_bool1) +glmCreateTestGTC(ext_vector_common) +glmCreateTestGTC(ext_vector_iec559) +glmCreateTestGTC(ext_vector_int1_sized) +glmCreateTestGTC(ext_vector_int2_sized) +glmCreateTestGTC(ext_vector_int3_sized) +glmCreateTestGTC(ext_vector_int4_sized) +glmCreateTestGTC(ext_vector_integer) +glmCreateTestGTC(ext_vector_integer_sized) +glmCreateTestGTC(ext_vector_uint1_sized) +glmCreateTestGTC(ext_vector_uint2_sized) +glmCreateTestGTC(ext_vector_uint3_sized) +glmCreateTestGTC(ext_vector_uint4_sized) +glmCreateTestGTC(ext_vector_reciprocal) +glmCreateTestGTC(ext_vector_relational) +glmCreateTestGTC(ext_vector_ulp) + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_matrix_clip_space.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_matrix_clip_space.cpp new file mode 100644 index 0000000000000000000000000000000000000000..1b7f00b516e6907053cb510a774fe0935a08736f --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_matrix_clip_space.cpp @@ -0,0 +1,13 @@ +#include +#include +#include +#include +#include +#include + +int main() +{ + int Error = 0; + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_matrix_common.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_matrix_common.cpp new file mode 100644 index 0000000000000000000000000000000000000000..6a74fb3c219a3b30c43dfaa556263d2ea0d5e30e --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_matrix_common.cpp @@ -0,0 +1,236 @@ +#include +#include +#include +#include +#include +#include + +static int test_mix() +{ + int Error = 0; + + { + glm::mat4 A(2); + glm::mat4 B(4); + glm::mat4 C = glm::mix(A, B, 0.5f); + glm::bvec4 const D = glm::equal(C, glm::mat4(3), 1); + Error += glm::all(D) ? 0 : 1; + } + + { + glm::mat4 A(2); + glm::mat4 B(4); + glm::mat4 C = glm::mix(A, B, 0.5); + glm::bvec4 const D = glm::equal(C, glm::mat4(3), 1); + Error += glm::all(D) ? 0 : 1; + } + + { + glm::dmat4 A(2); + glm::dmat4 B(4); + glm::dmat4 C = glm::mix(A, B, 0.5); + glm::bvec4 const D = glm::equal(C, glm::dmat4(3), 1); + Error += glm::all(D) ? 0 : 1; + } + + { + glm::dmat4 A(2); + glm::dmat4 B(4); + glm::dmat4 C = glm::mix(A, B, 0.5f); + glm::bvec4 const D = glm::equal(C, glm::dmat4(3), 1); + Error += glm::all(D) ? 0 : 1; + } + + return Error; +} + +static int test_abs() +{ + int Error = 0; + + // -------------------- // + // glm::mat4 variants : // + // -------------------- // + { + glm::mat4 A( + 3.0f, 1.0f, 5.2f, 4.9f, + 1.4f, 0.5f, 9.3f, 3.7f, + 6.8f, 8.4f, 4.3f, 3.9f, + 5.6f, 7.2f, 1.1f, 4.4f + ); + glm::mat4 B( + 1.0,-1.0, 1.0, 1.0, + -1.0, 1.0, 1.0,-1.0, + 1.0,-1.0,-1.0,-1.0, + -1.0,-1.0, 1.0, 1.0 + ); + glm::mat4 C = glm::matrixCompMult(A, B); // Not * to avoid matrix product. + glm::mat4 D = glm::abs(C); + glm::bvec4 const col1 = glm::equal(D[0], A[0]); + glm::bvec4 const col2 = glm::equal(D[1], A[1]); + glm::bvec4 const col3 = glm::equal(D[2], A[2]); + glm::bvec4 const col4 = glm::equal(D[3], A[3]); + Error += glm::all(glm::bvec4{glm::all(col1), glm::all(col2), glm::all(col3), glm::all(col4)}) ? 0 : 1; + } + { + glm::mat4x3 A( + 3.0f, 1.0f, 5.2f, + 4.9f, 1.4f, 0.5f, + 9.3f, 3.7f, 6.8f, + 8.4f, 4.3f, 3.9f + ); + glm::mat4x3 B( + 1.0,-1.0, 1.0, + 1.0,-1.0, 1.0, + 1.0,-1.0, 1.0, + -1.0,-1.0,-1.0 + ); + glm::mat4x3 C = glm::matrixCompMult(A, B); // Not * to avoid matrix product. + glm::mat4x3 D = glm::abs(C); + glm::bvec3 const col1 = glm::equal(D[0], A[0]); + glm::bvec3 const col2 = glm::equal(D[1], A[1]); + glm::bvec3 const col3 = glm::equal(D[2], A[2]); + glm::bvec3 const col4 = glm::equal(D[3], A[3]); + Error += glm::all(glm::bvec4{glm::all(col1), glm::all(col2), glm::all(col3), glm::all(col4)}) ? 0 : 1; + } + { + glm::mat4x2 A( + 3.0f, 1.0f, + 1.4f, 0.5f, + 6.8f, 8.4f, + 5.6f, 7.2f + ); + glm::mat4x2 B( + 1.0,-1.0, + -1.0, 1.0, + 1.0,-1.0, + -1.0,-1.0 + ); + glm::mat4x2 C = glm::matrixCompMult(A, B); // Not * to avoid matrix product. + glm::mat4x2 D = glm::abs(C); + glm::bvec2 const col1 = glm::equal(D[0], A[0]); + glm::bvec2 const col2 = glm::equal(D[1], A[1]); + glm::bvec2 const col3 = glm::equal(D[2], A[2]); + glm::bvec2 const col4 = glm::equal(D[3], A[3]); + Error += glm::all(glm::bvec4{glm::all(col1), glm::all(col2), glm::all(col3), glm::all(col4)}) ? 0 : 1; + } + + // -------------------- // + // glm::mat3 variants : // + // -------------------- // + { + glm::mat3x4 A( + 3.0f, 1.0f, 5.2f, 4.9f, + 1.4f, 0.5f, 9.3f, 3.7f, + 6.8f, 8.4f, 4.3f, 3.9f + ); + glm::mat3x4 B( + 1.0,-1.0, 1.0, 1.0, + -1.0, 1.0, 1.0,-1.0, + 1.0,-1.0,-1.0,-1.0 + ); + glm::mat3x4 C = glm::matrixCompMult(A, B); // Not * to avoid matrix product. + glm::mat3x4 D = glm::abs(C); + glm::bvec4 const col1 = glm::equal(D[0], A[0]); + glm::bvec4 const col2 = glm::equal(D[1], A[1]); + glm::bvec4 const col3 = glm::equal(D[2], A[2]); + Error += glm::all(glm::bvec3{glm::all(col1), glm::all(col2), glm::all(col3)}) ? 0 : 1; + } + { + glm::mat3 A( + 3.0f, 1.0f, 5.2f, + 1.4f, 0.5f, 9.3f, + 6.8f, 8.4f, 4.3f + ); + glm::mat3 B( + 1.0,-1.0, 1.0, + -1.0, 1.0, 1.0, + 1.0,-1.0,-1.0 + ); + glm::mat3 C = glm::matrixCompMult(A, B); // Not * to avoid matrix product. + glm::mat3 D = glm::abs(C); + glm::bvec3 const col1 = glm::equal(D[0], A[0]); + glm::bvec3 const col2 = glm::equal(D[1], A[1]); + glm::bvec3 const col3 = glm::equal(D[2], A[2]); + Error += glm::all(glm::bvec3{glm::all(col1), glm::all(col2), glm::all(col3)}) ? 0 : 1; + } + { + glm::mat3x2 A( + 5.2f, 4.9f, + 9.3f, 3.7f, + 4.3f, 3.9f + ); + glm::mat3x2 B( + 1.0, 1.0, + 1.0,-1.0, + -1.0,-1.0 + ); + glm::mat3x2 C = glm::matrixCompMult(A, B); // Not * to avoid matrix product. + glm::mat3x2 D = glm::abs(C); + glm::bvec2 const col1 = glm::equal(D[0], A[0]); + glm::bvec2 const col2 = glm::equal(D[1], A[1]); + glm::bvec2 const col3 = glm::equal(D[2], A[2]); + Error += glm::all(glm::bvec3{glm::all(col1), glm::all(col2), glm::all(col3)}) ? 0 : 1; + } + + // -------------------- // + // glm::mat2 variants : // + // -------------------- // + { + glm::mat2x4 A( + 3.0f, 1.0f, 5.2f, 4.9f, + 5.6f, 7.2f, 1.1f, 4.4f + ); + glm::mat2x4 B( + 1.0,-1.0, 1.0, 1.0, + -1.0,-1.0, 1.0, 1.0 + ); + glm::mat2x4 C = glm::matrixCompMult(A, B); // Not * to avoid matrix product. + glm::mat2x4 D = glm::abs(C); + glm::bvec4 const col1 = glm::equal(D[0], A[0]); + glm::bvec4 const col2 = glm::equal(D[1], A[1]); + Error += glm::all(glm::bvec2{glm::all(col1), glm::all(col2)}) ? 0 : 1; + } + { + glm::mat2x3 A( + 3.0f, 1.0f, 5.2f, + 8.4f, 4.3f, 3.9f + ); + glm::mat2x3 B( + 1.0,-1.0, 1.0, + -1.0,-1.0,-1.0 + ); + glm::mat2x3 C = glm::matrixCompMult(A, B); // Not * to avoid matrix product. + glm::mat2x3 D = glm::abs(C); + glm::bvec3 const col1 = glm::equal(D[0], A[0]); + glm::bvec3 const col2 = glm::equal(D[1], A[1]); + Error += glm::all(glm::bvec2{glm::all(col1), glm::all(col2)}) ? 0 : 1; + } + { + glm::mat2 A( + 3.0f, 1.0f, + 5.6f, 7.2f + ); + glm::mat2 B( + 1.0,-1.0, + -1.0,-1.0 + ); + glm::mat2 C = glm::matrixCompMult(A, B); // Not * to avoid matrix product. + glm::mat2 D = glm::abs(C); + glm::bvec2 const col1 = glm::equal(D[0], A[0]); + glm::bvec2 const col2 = glm::equal(D[1], A[1]); + Error += glm::all(glm::bvec2{glm::all(col1), glm::all(col2)}) ? 0 : 1; + } + + return Error; +} + +int main() +{ + int Error = 0; + + Error += test_mix(); + Error += test_abs(); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_matrix_int2x2_sized.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_matrix_int2x2_sized.cpp new file mode 100644 index 0000000000000000000000000000000000000000..e974eecd81dc31f531df2a6b1769089aea564361 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_matrix_int2x2_sized.cpp @@ -0,0 +1,28 @@ +#include + +#if GLM_HAS_STATIC_ASSERT + static_assert(sizeof(glm::i8mat2x2) == 4, "int8 size isn't 1 byte on this platform"); + static_assert(sizeof(glm::i16mat2x2) == 8, "int16 size isn't 2 bytes on this platform"); + static_assert(sizeof(glm::i32mat2x2) == 16, "int32 size isn't 4 bytes on this platform"); + static_assert(sizeof(glm::i64mat2x2) == 32, "int64 size isn't 8 bytes on this platform"); +#endif + +static int test_comp() +{ + int Error = 0; + + Error += sizeof(glm::i8mat2x2) < sizeof(glm::i16mat2x2) ? 0 : 1; + Error += sizeof(glm::i16mat2x2) < sizeof(glm::i32mat2x2) ? 0 : 1; + Error += sizeof(glm::i32mat2x2) < sizeof(glm::i64mat2x2) ? 0 : 1; + + return Error; +} + +int main() +{ + int Error = 0; + + Error += test_comp(); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_matrix_int2x3_sized.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_matrix_int2x3_sized.cpp new file mode 100644 index 0000000000000000000000000000000000000000..79546eaa75bda5ef6aebb4c981a5ee9abdb8832d --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_matrix_int2x3_sized.cpp @@ -0,0 +1,28 @@ +#include + +#if GLM_HAS_STATIC_ASSERT +static_assert(sizeof(glm::i8mat2x3) == 6, "int8 size isn't 1 byte on this platform"); +static_assert(sizeof(glm::i16mat2x3) == 12, "int16 size isn't 2 bytes on this platform"); +static_assert(sizeof(glm::i32mat2x3) == 24, "int32 size isn't 4 bytes on this platform"); +static_assert(sizeof(glm::i64mat2x3) == 48, "int64 size isn't 8 bytes on this platform"); +#endif + +static int test_comp() +{ + int Error = 0; + + Error += sizeof(glm::i8mat2x3) < sizeof(glm::i16mat2x3) ? 0 : 1; + Error += sizeof(glm::i16mat2x3) < sizeof(glm::i32mat2x3) ? 0 : 1; + Error += sizeof(glm::i32mat2x3) < sizeof(glm::i64mat2x3) ? 0 : 1; + + return Error; +} + +int main() +{ + int Error = 0; + + Error += test_comp(); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_matrix_int2x4_sized.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_matrix_int2x4_sized.cpp new file mode 100644 index 0000000000000000000000000000000000000000..082e5046ecf571718d177415ee828d89c69d7617 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_matrix_int2x4_sized.cpp @@ -0,0 +1,28 @@ +#include + +#if GLM_HAS_STATIC_ASSERT +static_assert(sizeof(glm::i8mat2x4) == 8, "int8 size isn't 1 byte on this platform"); +static_assert(sizeof(glm::i16mat2x4) == 16, "int16 size isn't 2 bytes on this platform"); +static_assert(sizeof(glm::i32mat2x4) == 32, "int32 size isn't 4 bytes on this platform"); +static_assert(sizeof(glm::i64mat2x4) == 64, "int64 size isn't 8 bytes on this platform"); +#endif + +static int test_comp() +{ + int Error = 0; + + Error += sizeof(glm::i8mat2x4) < sizeof(glm::i16mat2x4) ? 0 : 1; + Error += sizeof(glm::i16mat2x4) < sizeof(glm::i32mat2x4) ? 0 : 1; + Error += sizeof(glm::i32mat2x4) < sizeof(glm::i64mat2x4) ? 0 : 1; + + return Error; +} + +int main() +{ + int Error = 0; + + Error += test_comp(); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_matrix_int3x2_sized.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_matrix_int3x2_sized.cpp new file mode 100644 index 0000000000000000000000000000000000000000..9e6529d68e2fb5921dbb8a1990754473eb3f0e54 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_matrix_int3x2_sized.cpp @@ -0,0 +1,28 @@ +#include + +#if GLM_HAS_STATIC_ASSERT +static_assert(sizeof(glm::i8mat3x2) == 6, "int8 size isn't 1 byte on this platform"); +static_assert(sizeof(glm::i16mat3x2) == 12, "int16 size isn't 2 bytes on this platform"); +static_assert(sizeof(glm::i32mat3x2) == 24, "int32 size isn't 4 bytes on this platform"); +static_assert(sizeof(glm::i64mat3x2) == 48, "int64 size isn't 8 bytes on this platform"); +#endif + +static int test_comp() +{ + int Error = 0; + + Error += sizeof(glm::i8mat3x2) < sizeof(glm::i16mat3x2) ? 0 : 1; + Error += sizeof(glm::i16mat3x2) < sizeof(glm::i32mat3x2) ? 0 : 1; + Error += sizeof(glm::i32mat3x2) < sizeof(glm::i64mat3x2) ? 0 : 1; + + return Error; +} + +int main() +{ + int Error = 0; + + Error += test_comp(); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_matrix_int3x3_sized.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_matrix_int3x3_sized.cpp new file mode 100644 index 0000000000000000000000000000000000000000..891fe25d7827192d780060328d04a62b370e3d39 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_matrix_int3x3_sized.cpp @@ -0,0 +1,28 @@ +#include + +#if GLM_HAS_STATIC_ASSERT +static_assert(sizeof(glm::i8mat3x3) == 9, "int8 size isn't 1 byte on this platform"); +static_assert(sizeof(glm::i16mat3x3) == 18, "int16 size isn't 2 bytes on this platform"); +static_assert(sizeof(glm::i32mat3x3) == 36, "int32 size isn't 4 bytes on this platform"); +static_assert(sizeof(glm::i64mat3x3) == 72, "int64 size isn't 8 bytes on this platform"); +#endif + +static int test_comp() +{ + int Error = 0; + + Error += sizeof(glm::i8mat3x3) < sizeof(glm::i16mat3x3) ? 0 : 1; + Error += sizeof(glm::i16mat3x3) < sizeof(glm::i32mat3x3) ? 0 : 1; + Error += sizeof(glm::i32mat3x3) < sizeof(glm::i64mat3x3) ? 0 : 1; + + return Error; +} + +int main() +{ + int Error = 0; + + Error += test_comp(); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_matrix_int3x4_sized.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_matrix_int3x4_sized.cpp new file mode 100644 index 0000000000000000000000000000000000000000..b85c91913c03f2eae0fd2dc98f53d0d769e15c8b --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_matrix_int3x4_sized.cpp @@ -0,0 +1,28 @@ +#include + +#if GLM_HAS_STATIC_ASSERT +static_assert(sizeof(glm::i8mat3x4) == 12, "int8 size isn't 1 byte on this platform"); +static_assert(sizeof(glm::i16mat3x4) == 24, "int16 size isn't 2 bytes on this platform"); +static_assert(sizeof(glm::i32mat3x4) == 48, "int32 size isn't 4 bytes on this platform"); +static_assert(sizeof(glm::i64mat3x4) == 96, "int64 size isn't 8 bytes on this platform"); +#endif + +static int test_comp() +{ + int Error = 0; + + Error += sizeof(glm::i8mat3x4) < sizeof(glm::i16mat3x4) ? 0 : 1; + Error += sizeof(glm::i16mat3x4) < sizeof(glm::i32mat3x4) ? 0 : 1; + Error += sizeof(glm::i32mat3x4) < sizeof(glm::i64mat3x4) ? 0 : 1; + + return Error; +} + +int main() +{ + int Error = 0; + + Error += test_comp(); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_matrix_int4x2_sized.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_matrix_int4x2_sized.cpp new file mode 100644 index 0000000000000000000000000000000000000000..a5b369b86a6ef6622e25ac387c9c1e386e9e2011 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_matrix_int4x2_sized.cpp @@ -0,0 +1,28 @@ +#include + +#if GLM_HAS_STATIC_ASSERT +static_assert(sizeof(glm::i8mat4x2) == 8, "int8 size isn't 1 byte on this platform"); +static_assert(sizeof(glm::i16mat4x2) == 16, "int16 size isn't 2 bytes on this platform"); +static_assert(sizeof(glm::i32mat4x2) == 32, "int32 size isn't 4 bytes on this platform"); +static_assert(sizeof(glm::i64mat4x2) == 64, "int64 size isn't 8 bytes on this platform"); +#endif + +static int test_comp() +{ + int Error = 0; + + Error += sizeof(glm::i8mat4x2) < sizeof(glm::i16mat4x2) ? 0 : 1; + Error += sizeof(glm::i16mat4x2) < sizeof(glm::i32mat4x2) ? 0 : 1; + Error += sizeof(glm::i32mat4x2) < sizeof(glm::i64mat4x2) ? 0 : 1; + + return Error; +} + +int main() +{ + int Error = 0; + + Error += test_comp(); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_matrix_int4x3_sized.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_matrix_int4x3_sized.cpp new file mode 100644 index 0000000000000000000000000000000000000000..fe672b64d0c1cd54a12e3abb0133917bd796f01c --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_matrix_int4x3_sized.cpp @@ -0,0 +1,28 @@ +#include + +#if GLM_HAS_STATIC_ASSERT +static_assert(sizeof(glm::i8mat4x3) == 12, "int8 size isn't 1 byte on this platform"); +static_assert(sizeof(glm::i16mat4x3) == 24, "int16 size isn't 2 bytes on this platform"); +static_assert(sizeof(glm::i32mat4x3) == 48, "int32 size isn't 4 bytes on this platform"); +static_assert(sizeof(glm::i64mat4x3) == 96, "int64 size isn't 8 bytes on this platform"); +#endif + +static int test_comp() +{ + int Error = 0; + + Error += sizeof(glm::i8mat4x3) < sizeof(glm::i16mat4x3) ? 0 : 1; + Error += sizeof(glm::i16mat4x3) < sizeof(glm::i32mat4x3) ? 0 : 1; + Error += sizeof(glm::i32mat4x3) < sizeof(glm::i64mat4x3) ? 0 : 1; + + return Error; +} + +int main() +{ + int Error = 0; + + Error += test_comp(); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_matrix_int4x4_sized.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_matrix_int4x4_sized.cpp new file mode 100644 index 0000000000000000000000000000000000000000..cfba11f72f8a49285dd0b30572b3ade6d9a52230 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_matrix_int4x4_sized.cpp @@ -0,0 +1,28 @@ +#include + +#if GLM_HAS_STATIC_ASSERT +static_assert(sizeof(glm::i8mat4x4) == 16, "int8 size isn't 1 byte on this platform"); +static_assert(sizeof(glm::i16mat4x4) == 32, "int16 size isn't 2 bytes on this platform"); +static_assert(sizeof(glm::i32mat4x4) == 64, "int32 size isn't 4 bytes on this platform"); +static_assert(sizeof(glm::i64mat4x4) == 128, "int64 size isn't 8 bytes on this platform"); +#endif + +static int test_comp() +{ + int Error = 0; + + Error += sizeof(glm::i8mat4x4) < sizeof(glm::i16mat4x4) ? 0 : 1; + Error += sizeof(glm::i16mat4x4) < sizeof(glm::i32mat4x4) ? 0 : 1; + Error += sizeof(glm::i32mat4x4) < sizeof(glm::i64mat4x4) ? 0 : 1; + + return Error; +} + +int main() +{ + int Error = 0; + + Error += test_comp(); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_matrix_integer.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_matrix_integer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..564dd76e77bd5eccc0e8863d92068df3987ca794 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_matrix_integer.cpp @@ -0,0 +1,237 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace glm; + +int test_matrixCompMult() +{ + int Error = 0; + + { + imat2 m(0, 1, 2, 3); + imat2 n = matrixCompMult(m, m); + imat2 expected = imat2(0, 1, 4, 9); + Error += all(equal(n, expected)) ? 0 : 1; + } + + { + imat2x3 m(0, 1, 2, 3, 4, 5); + imat2x3 n = matrixCompMult(m, m); + imat2x3 expected = imat2x3(0, 1, 4, 9, 16, 25); + Error += all(equal(n, expected)) ? 0 : 1; + } + + { + imat2x4 m(0, 1, 2, 3, 4, 5, 6, 7); + imat2x4 n = matrixCompMult(m, m); + imat2x4 expected = imat2x4(0, 1, 4, 9, 16, 25, 36, 49); + Error += all(equal(n, expected)) ? 0 : 1; + } + + { + imat3 m(0, 1, 2, 3, 4, 5, 6, 7, 8); + imat3 n = matrixCompMult(m, m); + imat3 expected = imat3(0, 1, 4, 9, 16, 25, 36, 49, 64); + Error += all(equal(n, expected)) ? 0 : 1; + } + + { + imat3x2 m(0, 1, 2, 3, 4, 5); + imat3x2 n = matrixCompMult(m, m); + imat3x2 expected = imat3x2(0, 1, 4, 9, 16, 25); + Error += all(equal(n, expected)) ? 0 : 1; + } + + { + imat3x4 m(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11); + imat3x4 n = matrixCompMult(m, m); + imat3x4 expected = imat3x4(0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121); + Error += all(equal(n, expected)) ? 0 : 1; + } + + { + imat4 m(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); + imat4 n = matrixCompMult(m, m); + imat4 expected = imat4(0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 225); + Error += all(equal(n, expected)) ? 0 : 1; + } + + { + imat4x2 m(0, 1, 2, 3, 4, 5, 6, 7); + imat4x2 n = matrixCompMult(m, m); + imat4x2 expected = imat4x2(0, 1, 4, 9, 16, 25, 36, 49); + Error += all(equal(n, expected)) ? 0 : 1; + } + + { + imat4x3 m(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11); + imat4x3 n = matrixCompMult(m, m); + imat4x3 expected = imat4x3(0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121); + Error += all(equal(n, expected)) ? 0 : 1; + } + + return Error; +} + +int test_outerProduct() +{ + int Error = 0; + + { + glm::imat2x2 const m = glm::outerProduct(glm::ivec2(1), glm::ivec2(1)); + Error += all(equal(m, glm::imat2x2(1, 1, 1, 1))) ? 0 : 1; + } + { + glm::imat2x3 const m = glm::outerProduct(glm::ivec3(1), glm::ivec2(1)); + Error += all(equal(m, glm::imat2x3(1, 1, 1, 1, 1, 1))) ? 0 : 1; + } + { + glm::imat2x4 const m = glm::outerProduct(glm::ivec4(1), glm::ivec2(1)); + Error += all(equal(m, glm::imat2x4(1, 1, 1, 1, 1, 1, 1, 1))) ? 0 : 1; + } + + { + glm::imat3x2 const m = glm::outerProduct(glm::ivec2(1), glm::ivec3(1)); + Error += all(equal(m, glm::imat3x2(1, 1, 1, 1, 1, 1))) ? 0 : 1; + } + { + glm::imat3x3 const m = glm::outerProduct(glm::ivec3(1), glm::ivec3(1)); + Error += all(equal(m, glm::imat3x3(1, 1, 1, 1, 1, 1, 1, 1, 1))) ? 0 : 1; + } + { + glm::imat3x4 const m = glm::outerProduct(glm::ivec4(1), glm::ivec3(1)); + Error += all(equal(m, glm::imat3x4(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1))) ? 0 : 1; + } + + + { + glm::imat4x2 const m = glm::outerProduct(glm::ivec2(1), glm::ivec4(1)); + Error += all(equal(m, glm::imat4x2(1, 1, 1, 1, 1, 1, 1, 1))) ? 0 : 1; + } + { + glm::imat4x3 const m = glm::outerProduct(glm::ivec3(1), glm::ivec4(1)); + Error += all(equal(m, glm::imat4x3(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1))) ? 0 : 1; + } + { + glm::imat4x4 const m = glm::outerProduct(glm::ivec4(1), glm::ivec4(1)); + Error += all(equal(m, glm::imat4x4(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1))) ? 0 : 1; + } + + return Error; +} + +int test_transpose() +{ + int Error = 0; + + { + imat2 const m(0, 1, 2, 3); + imat2 const t = transpose(m); + imat2 const expected = imat2(0, 2, 1, 3); + Error += all(equal(t, expected)) ? 0 : 1; + } + + { + imat2x3 m(0, 1, 2, 3, 4, 5); + imat3x2 t = transpose(m); + imat3x2 const expected = imat3x2(0, 3, 1, 4, 2, 5); + Error += all(equal(t, expected)) ? 0 : 1; + } + + { + imat2x4 m(0, 1, 2, 3, 4, 5, 6, 7); + imat4x2 t = transpose(m); + imat4x2 const expected = imat4x2(0, 4, 1, 5, 2, 6, 3, 7); + Error += all(equal(t, expected)) ? 0 : 1; + } + + { + imat3 m(0, 1, 2, 3, 4, 5, 6, 7, 8); + imat3 t = transpose(m); + imat3 const expected = imat3(0, 3, 6, 1, 4, 7, 2, 5, 8); + Error += all(equal(t, expected)) ? 0 : 1; + } + + { + imat3x2 m(0, 1, 2, 3, 4, 5); + imat2x3 t = transpose(m); + imat2x3 const expected = imat2x3(0, 2, 4, 1, 3, 5); + Error += all(equal(t, expected)) ? 0 : 1; + } + + { + imat3x4 m(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11); + imat4x3 t = transpose(m); + imat4x3 const expected = imat4x3(0, 4, 8, 1, 5, 9, 2, 6, 10, 3, 7, 11); + Error += all(equal(t, expected)) ? 0 : 1; + } + + { + imat4 m(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); + imat4 t = transpose(m); + imat4 const expected = imat4(0, 4, 8, 12, 1, 5, 9, 13, 2, 6, 10, 14, 3, 7, 11, 15); + Error += all(equal(t, expected)) ? 0 : 1; + } + + { + imat4x2 m(0, 1, 2, 3, 4, 5, 6, 7); + imat2x4 t = transpose(m); + imat2x4 const expected = imat2x4(0, 2, 4, 6, 1, 3, 5, 7); + Error += all(equal(t, expected)) ? 0 : 1; + } + + { + imat4x3 m(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11); + imat3x4 t = transpose(m); + imat3x4 const expected = imat3x4(0, 3, 6, 9, 1, 4, 7, 10, 2, 5, 8, 11); + Error += all(equal(t, expected)) ? 0 : 1; + } + + return Error; +} + +int test_determinant() +{ + int Error = 0; + + { + imat2 const m(1, 1, 1, 1); + int const t = determinant(m); + Error += t == 0 ? 0 : 1; + } + + { + imat3 m(1, 1, 1, 1, 1, 1, 1, 1, 1); + int t = determinant(m); + Error += t == 0 ? 0 : 1; + } + + { + imat4 m(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); + int t = determinant(m); + Error += t == 0 ? 0 : 1; + } + + return Error; +} + +int main() +{ + int Error = 0; + + Error += test_matrixCompMult(); + Error += test_outerProduct(); + Error += test_transpose(); + Error += test_determinant(); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_matrix_projection.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_matrix_projection.cpp new file mode 100644 index 0000000000000000000000000000000000000000..92a4a7a0751bab82977b3d20213f3a8eee7b9b43 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_matrix_projection.cpp @@ -0,0 +1,13 @@ +#include +#include +#include +#include +#include +#include + +int main() +{ + int Error = 0; + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_matrix_relational.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_matrix_relational.cpp new file mode 100644 index 0000000000000000000000000000000000000000..bf84a3f8243db6565d16ebc5bd9c5dca99f25216 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_matrix_relational.cpp @@ -0,0 +1,163 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +template +static int test_equal() +{ + typedef typename matType::value_type valType; + + valType const Epsilon = static_cast(0.001f); + valType const One = static_cast(1); + valType const Two = static_cast(2); + + int Error = 0; + + Error += glm::all(glm::equal(matType(One), matType(One), Epsilon)) ? 0 : 1; + Error += glm::all(glm::equal(matType(One), matType(Two), vecType(Epsilon))) ? 1 : 0; + + return Error; +} + +template +static int test_notEqual() +{ + typedef typename matType::value_type valType; + + valType const Epsilon = static_cast(0.001f); + valType const One = static_cast(1); + valType const Two = static_cast(2); + + int Error = 0; + + Error += !glm::any(glm::notEqual(matType(One), matType(One), Epsilon)) ? 0 : 1; + Error += !glm::any(glm::notEqual(matType(One), matType(Two), vecType(Epsilon))) ? 1 : 0; + + return Error; +} + + +template +static int test_equal_ulps() +{ + typedef glm::mat<4, 4, T, glm::defaultp> mat4; + + T const One(1); + mat4 const Ones(1); + + int Error = 0; + + T const ULP1Plus = glm::nextFloat(One); + Error += glm::all(glm::equal(Ones, mat4(ULP1Plus), 1)) ? 0 : 1; + + T const ULP2Plus = glm::nextFloat(ULP1Plus); + Error += !glm::all(glm::equal(Ones, mat4(ULP2Plus), 1)) ? 0 : 1; + + T const ULP1Minus = glm::prevFloat(One); + Error += glm::all(glm::equal(Ones, mat4(ULP1Minus), 1)) ? 0 : 1; + + T const ULP2Minus = glm::prevFloat(ULP1Minus); + Error += !glm::all(glm::equal(Ones, mat4(ULP2Minus), 1)) ? 0 : 1; + + return Error; +} + +template +static int test_notEqual_ulps() +{ + typedef glm::mat<4, 4, T, glm::defaultp> mat4; + + T const One(1); + mat4 const Ones(1); + + int Error = 0; + + T const ULP1Plus = glm::nextFloat(One); + Error += !glm::all(glm::notEqual(Ones, mat4(ULP1Plus), 1)) ? 0 : 1; + + T const ULP2Plus = glm::nextFloat(ULP1Plus); + Error += glm::all(glm::notEqual(Ones, mat4(ULP2Plus), 1)) ? 0 : 1; + + T const ULP1Minus = glm::prevFloat(One); + Error += !glm::all(glm::notEqual(Ones, mat4(ULP1Minus), 1)) ? 0 : 1; + + T const ULP2Minus = glm::prevFloat(ULP1Minus); + Error += glm::all(glm::notEqual(Ones, mat4(ULP2Minus), 1)) ? 0 : 1; + + return Error; +} + +int main() +{ + int Error = 0; + + Error += test_equal_ulps(); + Error += test_equal_ulps(); + Error += test_notEqual_ulps(); + Error += test_notEqual_ulps(); + + Error += test_equal(); + Error += test_equal(); + Error += test_equal(); + Error += test_equal(); + Error += test_equal(); + Error += test_equal(); + Error += test_equal(); + Error += test_equal(); + Error += test_equal(); + + Error += test_equal(); + Error += test_equal(); + Error += test_equal(); + Error += test_equal(); + Error += test_equal(); + Error += test_equal(); + Error += test_equal(); + Error += test_equal(); + Error += test_equal(); + + Error += test_notEqual(); + Error += test_notEqual(); + Error += test_notEqual(); + Error += test_notEqual(); + Error += test_notEqual(); + Error += test_notEqual(); + Error += test_notEqual(); + Error += test_notEqual(); + Error += test_notEqual(); + + Error += test_notEqual(); + Error += test_notEqual(); + Error += test_notEqual(); + Error += test_notEqual(); + Error += test_notEqual(); + Error += test_notEqual(); + Error += test_notEqual(); + Error += test_notEqual(); + Error += test_notEqual(); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_matrix_transform.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_matrix_transform.cpp new file mode 100644 index 0000000000000000000000000000000000000000..3f02c336b497b9b168b09b8080b71d22b7eca5c1 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_matrix_transform.cpp @@ -0,0 +1,61 @@ +#include +#include +#include +#include +#include +#include + +static int test_translate() +{ + int Error = 0; + + glm::mat4 const M(1.0f); + glm::vec3 const V(1.0f); + + glm::mat4 const T = glm::translate(M, V); + Error += glm::all(glm::equal(T[3], glm::vec4(1.0f), glm::epsilon())) ? 0 : 1; + + return Error; +} + +static int test_scale() +{ + int Error = 0; + + glm::mat4 const M(1.0f); + glm::vec3 const V(2.0f); + + glm::mat4 const S = glm::scale(M, V); + glm::mat4 const R = glm::mat4( + glm::vec4(2, 0, 0, 0), + glm::vec4(0, 2, 0, 0), + glm::vec4(0, 0, 2, 0), + glm::vec4(0, 0, 0, 1)); + Error += glm::all(glm::equal(S, R, glm::epsilon())) ? 0 : 1; + + return Error; +} + +static int test_rotate() +{ + int Error = 0; + + glm::vec4 const A(1.0f, 0.0f, 0.0f, 1.0f); + + glm::mat4 const R = glm::rotate(glm::mat4(1.0f), glm::radians(90.f), glm::vec3(0, 0, 1)); + glm::vec4 const B = R * A; + Error += glm::all(glm::equal(B, glm::vec4(0.0f, 1.0f, 0.0f, 1.0f), 0.0001f)) ? 0 : 1; + + return Error; +} + +int main() +{ + int Error = 0; + + Error += test_translate(); + Error += test_scale(); + Error += test_rotate(); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_matrix_uint2x2_sized.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_matrix_uint2x2_sized.cpp new file mode 100644 index 0000000000000000000000000000000000000000..62c499328442ee4d4f732e1dafc880f418934591 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_matrix_uint2x2_sized.cpp @@ -0,0 +1,28 @@ +#include + +#if GLM_HAS_STATIC_ASSERT + static_assert(sizeof(glm::u8mat2x2) == 4, "uint8 size isn't 1 byte on this platform"); + static_assert(sizeof(glm::u16mat2x2) == 8, "uint16 size isn't 2 bytes on this platform"); + static_assert(sizeof(glm::u32mat2x2) == 16, "uint32 size isn't 4 bytes on this platform"); + static_assert(sizeof(glm::u64mat2x2) == 32, "uint64 size isn't 8 bytes on this platform"); +#endif + +static int test_comp() +{ + int Error = 0; + + Error += sizeof(glm::u8mat2x2) < sizeof(glm::u16mat2x2) ? 0 : 1; + Error += sizeof(glm::u16mat2x2) < sizeof(glm::u32mat2x2) ? 0 : 1; + Error += sizeof(glm::u32mat2x2) < sizeof(glm::u64mat2x2) ? 0 : 1; + + return Error; +} + +int main() +{ + int Error = 0; + + Error += test_comp(); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_matrix_uint2x3_sized.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_matrix_uint2x3_sized.cpp new file mode 100644 index 0000000000000000000000000000000000000000..f0810e4ebc7a855ff5a3c2d5bf246cfc9ebe253e --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_matrix_uint2x3_sized.cpp @@ -0,0 +1,28 @@ +#include + +#if GLM_HAS_STATIC_ASSERT +static_assert(sizeof(glm::u8mat2x3) == 6, "uint8 size isn't 1 byte on this platform"); +static_assert(sizeof(glm::u16mat2x3) == 12, "uint16 size isn't 2 bytes on this platform"); +static_assert(sizeof(glm::u32mat2x3) == 24, "uint32 size isn't 4 bytes on this platform"); +static_assert(sizeof(glm::u64mat2x3) == 48, "uint64 size isn't 8 bytes on this platform"); +#endif + +static int test_comp() +{ + int Error = 0; + + Error += sizeof(glm::u8mat2x3) < sizeof(glm::u16mat2x3) ? 0 : 1; + Error += sizeof(glm::u16mat2x3) < sizeof(glm::u32mat2x3) ? 0 : 1; + Error += sizeof(glm::u32mat2x3) < sizeof(glm::u64mat2x3) ? 0 : 1; + + return Error; +} + +int main() +{ + int Error = 0; + + Error += test_comp(); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_matrix_uint2x4_sized.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_matrix_uint2x4_sized.cpp new file mode 100644 index 0000000000000000000000000000000000000000..701d312984a02a2dd60397b9ee0691bc19af478c --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_matrix_uint2x4_sized.cpp @@ -0,0 +1,28 @@ +#include + +#if GLM_HAS_STATIC_ASSERT +static_assert(sizeof(glm::u8mat2x4) == 8, "uint8 size isn't 1 byte on this platform"); +static_assert(sizeof(glm::u16mat2x4) == 16, "uint16 size isn't 2 bytes on this platform"); +static_assert(sizeof(glm::u32mat2x4) == 32, "uint32 size isn't 4 bytes on this platform"); +static_assert(sizeof(glm::u64mat2x4) == 64, "uint64 size isn't 8 bytes on this platform"); +#endif + +static int test_comp() +{ + int Error = 0; + + Error += sizeof(glm::u8mat2x4) < sizeof(glm::u16mat2x4) ? 0 : 1; + Error += sizeof(glm::u16mat2x4) < sizeof(glm::u32mat2x4) ? 0 : 1; + Error += sizeof(glm::u32mat2x4) < sizeof(glm::u64mat2x4) ? 0 : 1; + + return Error; +} + +int main() +{ + int Error = 0; + + Error += test_comp(); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_matrix_uint3x2_sized.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_matrix_uint3x2_sized.cpp new file mode 100644 index 0000000000000000000000000000000000000000..aa7aef562c1cc560b919be8d491db4d226fb384e --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_matrix_uint3x2_sized.cpp @@ -0,0 +1,28 @@ +#include + +#if GLM_HAS_STATIC_ASSERT +static_assert(sizeof(glm::u8mat3x2) == 6, "uint8 size isn't 1 byte on this platform"); +static_assert(sizeof(glm::u16mat3x2) == 12, "uint16 size isn't 2 bytes on this platform"); +static_assert(sizeof(glm::u32mat3x2) == 24, "uint32 size isn't 4 bytes on this platform"); +static_assert(sizeof(glm::u64mat3x2) == 48, "uint64 size isn't 8 bytes on this platform"); +#endif + +static int test_comp() +{ + int Error = 0; + + Error += sizeof(glm::u8mat3x2) < sizeof(glm::u16mat3x2) ? 0 : 1; + Error += sizeof(glm::u16mat3x2) < sizeof(glm::u32mat3x2) ? 0 : 1; + Error += sizeof(glm::u32mat3x2) < sizeof(glm::u64mat3x2) ? 0 : 1; + + return Error; +} + +int main() +{ + int Error = 0; + + Error += test_comp(); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_matrix_uint3x3_sized.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_matrix_uint3x3_sized.cpp new file mode 100644 index 0000000000000000000000000000000000000000..69429c9e7e84949bfd921d2e5861a53316eaf238 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_matrix_uint3x3_sized.cpp @@ -0,0 +1,28 @@ +#include + +#if GLM_HAS_STATIC_ASSERT +static_assert(sizeof(glm::u8mat3x3) == 9, "uint8 size isn't 1 byte on this platform"); +static_assert(sizeof(glm::u16mat3x3) == 18, "uint16 size isn't 2 bytes on this platform"); +static_assert(sizeof(glm::u32mat3x3) == 36, "uint32 size isn't 4 bytes on this platform"); +static_assert(sizeof(glm::u64mat3x3) == 72, "uint64 size isn't 8 bytes on this platform"); +#endif + +static int test_comp() +{ + int Error = 0; + + Error += sizeof(glm::u8mat3x3) < sizeof(glm::u16mat3x3) ? 0 : 1; + Error += sizeof(glm::u16mat3x3) < sizeof(glm::u32mat3x3) ? 0 : 1; + Error += sizeof(glm::u32mat3x3) < sizeof(glm::u64mat3x3) ? 0 : 1; + + return Error; +} + +int main() +{ + int Error = 0; + + Error += test_comp(); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_matrix_uint3x4_sized.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_matrix_uint3x4_sized.cpp new file mode 100644 index 0000000000000000000000000000000000000000..8a56515ff41e0a0a536941cb5a6eaa5ee2b46992 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_matrix_uint3x4_sized.cpp @@ -0,0 +1,28 @@ +#include + +#if GLM_HAS_STATIC_ASSERT +static_assert(sizeof(glm::u8mat3x4) == 12, "uint8 size isn't 1 byte on this platform"); +static_assert(sizeof(glm::u16mat3x4) == 24, "uint16 size isn't 2 bytes on this platform"); +static_assert(sizeof(glm::u32mat3x4) == 48, "uint32 size isn't 4 bytes on this platform"); +static_assert(sizeof(glm::u64mat3x4) == 96, "uint64 size isn't 8 bytes on this platform"); +#endif + +static int test_comp() +{ + int Error = 0; + + Error += sizeof(glm::u8mat3x4) < sizeof(glm::u16mat3x4) ? 0 : 1; + Error += sizeof(glm::u16mat3x4) < sizeof(glm::u32mat3x4) ? 0 : 1; + Error += sizeof(glm::u32mat3x4) < sizeof(glm::u64mat3x4) ? 0 : 1; + + return Error; +} + +int main() +{ + int Error = 0; + + Error += test_comp(); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_matrix_uint4x2_sized.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_matrix_uint4x2_sized.cpp new file mode 100644 index 0000000000000000000000000000000000000000..2c964705823ae82252706195323e21b759484b0c --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_matrix_uint4x2_sized.cpp @@ -0,0 +1,28 @@ +#include + +#if GLM_HAS_STATIC_ASSERT +static_assert(sizeof(glm::u8mat4x2) == 8, "uint8 size isn't 1 byte on this platform"); +static_assert(sizeof(glm::u16mat4x2) == 16, "uint16 size isn't 2 bytes on this platform"); +static_assert(sizeof(glm::u32mat4x2) == 32, "uint32 size isn't 4 bytes on this platform"); +static_assert(sizeof(glm::u64mat4x2) == 64, "uint64 size isn't 8 bytes on this platform"); +#endif + +static int test_comp() +{ + int Error = 0; + + Error += sizeof(glm::u8mat4x2) < sizeof(glm::u16mat4x2) ? 0 : 1; + Error += sizeof(glm::u16mat4x2) < sizeof(glm::u32mat4x2) ? 0 : 1; + Error += sizeof(glm::u32mat4x2) < sizeof(glm::u64mat4x2) ? 0 : 1; + + return Error; +} + +int main() +{ + int Error = 0; + + Error += test_comp(); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_matrix_uint4x3_sized.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_matrix_uint4x3_sized.cpp new file mode 100644 index 0000000000000000000000000000000000000000..67d3c0f9c0f105cf58e248e0c90ea12cfe6b67a7 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_matrix_uint4x3_sized.cpp @@ -0,0 +1,28 @@ +#include + +#if GLM_HAS_STATIC_ASSERT +static_assert(sizeof(glm::u8mat4x3) == 12, "uint8 size isn't 1 byte on this platform"); +static_assert(sizeof(glm::u16mat4x3) == 24, "uint16 size isn't 2 bytes on this platform"); +static_assert(sizeof(glm::u32mat4x3) == 48, "uint32 size isn't 4 bytes on this platform"); +static_assert(sizeof(glm::u64mat4x3) == 96, "uint64 size isn't 8 bytes on this platform"); +#endif + +static int test_comp() +{ + int Error = 0; + + Error += sizeof(glm::u8mat4x3) < sizeof(glm::u16mat4x3) ? 0 : 1; + Error += sizeof(glm::u16mat4x3) < sizeof(glm::u32mat4x3) ? 0 : 1; + Error += sizeof(glm::u32mat4x3) < sizeof(glm::u64mat4x3) ? 0 : 1; + + return Error; +} + +int main() +{ + int Error = 0; + + Error += test_comp(); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_matrix_uint4x4_sized.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_matrix_uint4x4_sized.cpp new file mode 100644 index 0000000000000000000000000000000000000000..a79383126734d170991444e646630adac991a03c --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_matrix_uint4x4_sized.cpp @@ -0,0 +1,28 @@ +#include + +#if GLM_HAS_STATIC_ASSERT +static_assert(sizeof(glm::u8mat4x4) == 16, "uint8 size isn't 1 byte on this platform"); +static_assert(sizeof(glm::u16mat4x4) == 32, "uint16 size isn't 2 bytes on this platform"); +static_assert(sizeof(glm::u32mat4x4) == 64, "uint32 size isn't 4 bytes on this platform"); +static_assert(sizeof(glm::u64mat4x4) == 128, "uint64 size isn't 8 bytes on this platform"); +#endif + +static int test_comp() +{ + int Error = 0; + + Error += sizeof(glm::u8mat4x4) < sizeof(glm::u16mat4x4) ? 0 : 1; + Error += sizeof(glm::u16mat4x4) < sizeof(glm::u32mat4x4) ? 0 : 1; + Error += sizeof(glm::u32mat4x4) < sizeof(glm::u64mat4x4) ? 0 : 1; + + return Error; +} + +int main() +{ + int Error = 0; + + Error += test_comp(); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_quaternion_common.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_quaternion_common.cpp new file mode 100644 index 0000000000000000000000000000000000000000..7edb573c11b531e79e17692e871d33f865b3f72b --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_quaternion_common.cpp @@ -0,0 +1,61 @@ +#include +#include +#include +#include +#include +#include +#include + +static int test_conjugate() +{ + int Error = 0; + + glm::quat const A(glm::vec3(1, 0, 0), glm::vec3(0, 1, 0)); + glm::quat const C = glm::conjugate(A); + Error += glm::any(glm::notEqual(A, C, glm::epsilon())) ? 0 : 1; + + glm::quat const B = glm::conjugate(C); + Error += glm::all(glm::equal(A, B, glm::epsilon())) ? 0 : 1; + + return Error; +} + +static int test_mix() +{ + int Error = 0; + + glm::quat const Q1(glm::vec3(1, 0, 0), glm::vec3(1, 0, 0)); + glm::quat const Q2(glm::vec3(1, 0, 0), glm::vec3(0, 1, 0)); + + { + glm::quat const Q3 = glm::mix(Q1, Q2, 0.5f); + float const F3 = glm::degrees(glm::angle(Q3)); + Error += glm::equal(F3, 45.0f, 0.001f) ? 0 : 1; + + glm::quat const Q4 = glm::mix(Q2, Q1, 0.5f); + float const F4 = glm::degrees(glm::angle(Q4)); + Error += glm::equal(F4, 45.0f, 0.001f) ? 0 : 1; + } + + { + glm::quat const Q3 = glm::slerp(Q1, Q2, 0.5f); + float const F3 = glm::degrees(glm::angle(Q3)); + Error += glm::equal(F3, 45.0f, 0.001f) ? 0 : 1; + + glm::quat const Q4 = glm::slerp(Q2, Q1, 0.5f); + float const F4 = glm::degrees(glm::angle(Q4)); + Error += glm::equal(F4, 45.0f, 0.001f) ? 0 : 1; + } + + return Error; +} + +int main() +{ + int Error = 0; + + Error += test_conjugate(); + Error += test_mix(); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_quaternion_exponential.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_quaternion_exponential.cpp new file mode 100644 index 0000000000000000000000000000000000000000..12d66fcf6b85f206d1019792ea0b21c4887b678b --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_quaternion_exponential.cpp @@ -0,0 +1,87 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +template +int test_log() +{ + typedef typename quaType::value_type T; + + T const Epsilon = static_cast(0.001f); + + int Error = 0; + + quaType const Q(vecType(1, 0, 0), vecType(0, 1, 0)); + quaType const P = glm::log(Q); + Error += glm::any(glm::notEqual(Q, P, Epsilon)) ? 0 : 1; + + quaType const R = glm::exp(P); + Error += glm::all(glm::equal(Q, R, Epsilon)) ? 0 : 1; + + return Error; +} + +template +int test_pow() +{ + typedef typename quaType::value_type T; + + T const Epsilon = static_cast(0.001f); + + int Error = 0; + + quaType const Q(vecType(1, 0, 0), vecType(0, 1, 0)); + + { + T const One = static_cast(1.0f); + quaType const P = glm::pow(Q, One); + Error += glm::all(glm::equal(Q, P, Epsilon)) ? 0 : 1; + } + + { + T const Two = static_cast(2.0f); + quaType const P = glm::pow(Q, Two); + quaType const R = Q * Q; + Error += glm::all(glm::equal(P, R, Epsilon)) ? 0 : 1; + + quaType const U = glm::sqrt(P); + Error += glm::all(glm::equal(Q, U, Epsilon)) ? 0 : 1; + } + + return Error; +} + +int main() +{ + int Error = 0; + + Error += test_log(); + Error += test_log(); + Error += test_log(); + Error += test_log(); + + Error += test_log(); + Error += test_log(); + Error += test_log(); + Error += test_log(); + + Error += test_pow(); + Error += test_pow(); + Error += test_pow(); + Error += test_pow(); + + Error += test_pow(); + Error += test_pow(); + Error += test_pow(); + Error += test_pow(); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_quaternion_geometric.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_quaternion_geometric.cpp new file mode 100644 index 0000000000000000000000000000000000000000..34ae2a58af64793d9891035c132e7d82c0882950 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_quaternion_geometric.cpp @@ -0,0 +1,88 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +float const Epsilon = 0.001f; + +static int test_length() +{ + int Error = 0; + + { + float const A = glm::length(glm::quat(1, 0, 0, 0)); + Error += glm::equal(A, 1.0f, Epsilon) ? 0 : 1; + } + + { + float const A = glm::length(glm::quat(1, glm::vec3(0))); + Error += glm::equal(A, 1.0f, Epsilon) ? 0 : 1; + } + + { + float const A = glm::length(glm::quat(glm::vec3(1, 0, 0), glm::vec3(0, 1, 0))); + Error += glm::equal(A, 1.0f, Epsilon) ? 0 : 1; + } + + return Error; +} + +static int test_normalize() +{ + int Error = 0; + + { + glm::quat const A = glm::quat(1, 0, 0, 0); + glm::quat const N = glm::normalize(A); + Error += glm::all(glm::equal(A, N, Epsilon)) ? 0 : 1; + } + + { + glm::quat const A = glm::quat(1, glm::vec3(0)); + glm::quat const N = glm::normalize(A); + Error += glm::all(glm::equal(A, N, Epsilon)) ? 0 : 1; + } + + return Error; +} + +static int test_dot() +{ + int Error = 0; + + { + glm::quat const A = glm::quat(1, 0, 0, 0); + glm::quat const B = glm::quat(1, 0, 0, 0); + float const C = glm::dot(A, B); + Error += glm::equal(C, 1.0f, Epsilon) ? 0 : 1; + } + + return Error; +} + +static int test_cross() +{ + int Error = 0; + + return Error; +} + +int main() +{ + int Error = 0; + + Error += test_length(); + Error += test_normalize(); + Error += test_dot(); + Error += test_cross(); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_quaternion_relational.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_quaternion_relational.cpp new file mode 100644 index 0000000000000000000000000000000000000000..660fd784f4f88882851f1d2ef56ca49e23ba0d10 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_quaternion_relational.cpp @@ -0,0 +1,51 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +template +static int test_equal() +{ + int Error = 0; + + quaType const Q(1, 0, 0, 0); + quaType const P(1, 0, 0, 0); + Error += glm::all(glm::equal(Q, P, glm::epsilon())) ? 0 : 1; + + return Error; +} + +template +static int test_notEqual() +{ + int Error = 0; + + quaType const Q(1, 0, 0, 0); + quaType const P(1, 0, 0, 0); + Error += glm::any(glm::notEqual(Q, P, glm::epsilon())) ? 1 : 0; + + return Error; +} + +int main() +{ + int Error = 0; + + Error += test_equal(); + Error += test_equal(); + Error += test_equal(); + Error += test_equal(); + + Error += test_notEqual(); + Error += test_notEqual(); + Error += test_notEqual(); + Error += test_notEqual(); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_quaternion_transform.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_quaternion_transform.cpp new file mode 100644 index 0000000000000000000000000000000000000000..10c62dfe586318a35638dcc0cb10814ee26da9d3 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_quaternion_transform.cpp @@ -0,0 +1,45 @@ +#include +#include +#include +#include + +#define GLM_ENABLE_EXPERIMENTAL +#include + +static int test_lookAt() +{ + int Error(0); + + glm::vec3 eye(0.0f); + glm::vec3 center(1.1f, -2.0f, 3.1416f); + glm::vec3 up(-0.17f, 7.23f, -1.744f); + + glm::quat test_quat = glm::quatLookAt(glm::normalize(center - eye), up); + glm::quat test_mat = glm::conjugate(glm::quat_cast(glm::lookAt(eye, center, up))); + + Error += static_cast(glm::abs(glm::length(test_quat) - 1.0f) > glm::epsilon()); + Error += static_cast(glm::min(glm::length(test_quat + (-test_mat)), glm::length(test_quat + test_mat)) > glm::epsilon()); + + // Test left-handed implementation + glm::quat test_quatLH = glm::quatLookAtLH(glm::normalize(center - eye), up); + glm::quat test_matLH = glm::conjugate(glm::quat_cast(glm::lookAtLH(eye, center, up))); + Error += static_cast(glm::abs(glm::length(test_quatLH) - 1.0f) > glm::epsilon()); + Error += static_cast(glm::min(glm::length(test_quatLH - test_matLH), glm::length(test_quatLH + test_matLH)) > glm::epsilon()); + + // Test right-handed implementation + glm::quat test_quatRH = glm::quatLookAtRH(glm::normalize(center - eye), up); + glm::quat test_matRH = glm::conjugate(glm::quat_cast(glm::lookAtRH(eye, center, up))); + Error += static_cast(glm::abs(glm::length(test_quatRH) - 1.0f) > glm::epsilon()); + Error += static_cast(glm::min(glm::length(test_quatRH - test_matRH), glm::length(test_quatRH + test_matRH)) > glm::epsilon()); + + return Error; +} + +int main() +{ + int Error = 0; + + Error += test_lookAt(); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_quaternion_trigonometric.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_quaternion_trigonometric.cpp new file mode 100644 index 0000000000000000000000000000000000000000..ef5c1307f2268a7e895e8c444b28349d8309bacb --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_quaternion_trigonometric.cpp @@ -0,0 +1,40 @@ +#include +#include +#include +#include + +float const Epsilon = 0.001f; + +static int test_angle() +{ + int Error = 0; + + { + glm::quat const Q = glm::quat(glm::vec3(1, 0, 0), glm::vec3(0, 1, 0)); + float const A = glm::degrees(glm::angle(Q)); + Error += glm::equal(A, 90.0f, Epsilon) ? 0 : 1; + } + + { + glm::quat const Q = glm::quat(glm::vec3(0, 1, 0), glm::vec3(1, 0, 0)); + float const A = glm::degrees(glm::angle(Q)); + Error += glm::equal(A, 90.0f, Epsilon) ? 0 : 1; + } + + { + glm::quat const Q = glm::angleAxis(glm::two_pi() - 1.0f, glm::vec3(1, 0, 0)); + float const A = glm::angle(Q); + Error += glm::equal(A, 1.0f, Epsilon) ? 1 : 0; + } + + return Error; +} + +int main() +{ + int Error = 0; + + Error += test_angle(); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_quaternion_type.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_quaternion_type.cpp new file mode 100644 index 0000000000000000000000000000000000000000..02c596d6b6e486127ecdb36e7448c493177fc482 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_quaternion_type.cpp @@ -0,0 +1,113 @@ +#include +#include +#include +#include +#include +#include +#include +#include + +static int test_ctr() +{ + int Error(0); + +# if GLM_HAS_TRIVIAL_QUERIES + // Error += std::is_trivially_default_constructible::value ? 0 : 1; + // Error += std::is_trivially_default_constructible::value ? 0 : 1; + // Error += std::is_trivially_copy_assignable::value ? 0 : 1; + // Error += std::is_trivially_copy_assignable::value ? 0 : 1; + Error += std::is_trivially_copyable::value ? 0 : 1; + Error += std::is_trivially_copyable::value ? 0 : 1; + + Error += std::is_copy_constructible::value ? 0 : 1; + Error += std::is_copy_constructible::value ? 0 : 1; +# endif + +# if GLM_HAS_INITIALIZER_LISTS + { + glm::quat A{0, 1, 2, 3}; + + std::vector B{ + {0, 1, 2, 3}, + {0, 1, 2, 3}}; + } +# endif//GLM_HAS_INITIALIZER_LISTS + + return Error; +} + +static int test_two_axis_ctr() +{ + int Error = 0; + + glm::quat const q1(glm::vec3(1, 0, 0), glm::vec3(0, 1, 0)); + glm::vec3 const v1 = q1 * glm::vec3(1, 0, 0); + Error += glm::all(glm::equal(v1, glm::vec3(0, 1, 0), 0.0001f)) ? 0 : 1; + + glm::quat const q2 = q1 * q1; + glm::vec3 const v2 = q2 * glm::vec3(1, 0, 0); + Error += glm::all(glm::equal(v2, glm::vec3(-1, 0, 0), 0.0001f)) ? 0 : 1; + + glm::quat const q3(glm::vec3(1, 0, 0), glm::vec3(-1, 0, 0)); + glm::vec3 const v3 = q3 * glm::vec3(1, 0, 0); + Error += glm::all(glm::equal(v3, glm::vec3(-1, 0, 0), 0.0001f)) ? 0 : 1; + + glm::quat const q4(glm::vec3(0, 1, 0), glm::vec3(0, -1, 0)); + glm::vec3 const v4 = q4 * glm::vec3(0, 1, 0); + Error += glm::all(glm::equal(v4, glm::vec3(0, -1, 0), 0.0001f)) ? 0 : 1; + + glm::quat const q5(glm::vec3(0, 0, 1), glm::vec3(0, 0, -1)); + glm::vec3 const v5 = q5 * glm::vec3(0, 0, 1); + Error += glm::all(glm::equal(v5, glm::vec3(0, 0, -1), 0.0001f)) ? 0 : 1; + + return Error; +} + +static int test_size() +{ + int Error = 0; + + std::size_t const A = sizeof(glm::quat); + Error += 16 == A ? 0 : 1; + std::size_t const B = sizeof(glm::dquat); + Error += 32 == B ? 0 : 1; + Error += glm::quat().length() == 4 ? 0 : 1; + Error += glm::dquat().length() == 4 ? 0 : 1; + Error += glm::quat::length() == 4 ? 0 : 1; + Error += glm::dquat::length() == 4 ? 0 : 1; + + return Error; +} + +static int test_precision() +{ + int Error = 0; + + Error += sizeof(glm::lowp_quat) <= sizeof(glm::mediump_quat) ? 0 : 1; + Error += sizeof(glm::mediump_quat) <= sizeof(glm::highp_quat) ? 0 : 1; + + return Error; +} + +static int test_constexpr() +{ +#if GLM_HAS_CONSTEXPR + static_assert(glm::quat::length() == 4, "GLM: Failed constexpr"); + static_assert(glm::quat(1.0f, glm::vec3(0.0f)).w > 0.0f, "GLM: Failed constexpr"); +#endif + + return 0; +} + +int main() +{ + int Error = 0; + + Error += test_ctr(); + Error += test_two_axis_ctr(); + Error += test_size(); + Error += test_precision(); + Error += test_constexpr(); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_scalar_common.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_scalar_common.cpp new file mode 100644 index 0000000000000000000000000000000000000000..6cb51f02e3fa2580ded4455fb19f4b61db85f4ee --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_scalar_common.cpp @@ -0,0 +1,360 @@ +#include +#include +#include +#include + +#if ((GLM_LANG & GLM_LANG_CXX11_FLAG) || (GLM_COMPILER & GLM_COMPILER_VC)) +# define GLM_NAN(T) NAN +#else +# define GLM_NAN(T) (static_cast(0.0f) / static_cast(0.0f)) +#endif + +template +static int test_min() +{ + int Error = 0; + + T const N = static_cast(0); + T const B = static_cast(1); + Error += glm::equal(glm::min(N, B), N, glm::epsilon()) ? 0 : 1; + Error += glm::equal(glm::min(B, N), N, glm::epsilon()) ? 0 : 1; + + T const C = static_cast(2); + Error += glm::equal(glm::min(N, B, C), N, glm::epsilon()) ? 0 : 1; + Error += glm::equal(glm::min(B, N, C), N, glm::epsilon()) ? 0 : 1; + Error += glm::equal(glm::min(C, N, B), N, glm::epsilon()) ? 0 : 1; + Error += glm::equal(glm::min(C, B, N), N, glm::epsilon()) ? 0 : 1; + Error += glm::equal(glm::min(B, C, N), N, glm::epsilon()) ? 0 : 1; + Error += glm::equal(glm::min(N, C, B), N, glm::epsilon()) ? 0 : 1; + + T const D = static_cast(3); + Error += glm::equal(glm::min(D, N, B, C), N, glm::epsilon()) ? 0 : 1; + Error += glm::equal(glm::min(B, D, N, C), N, glm::epsilon()) ? 0 : 1; + Error += glm::equal(glm::min(C, N, D, B), N, glm::epsilon()) ? 0 : 1; + Error += glm::equal(glm::min(C, B, D, N), N, glm::epsilon()) ? 0 : 1; + Error += glm::equal(glm::min(B, C, N, D), N, glm::epsilon()) ? 0 : 1; + Error += glm::equal(glm::min(N, C, B, D), N, glm::epsilon()) ? 0 : 1; + + return Error; +} + +template +static int test_min_nan() +{ + int Error = 0; + + T const B = static_cast(1); + T const N = static_cast(GLM_NAN(T)); + Error += glm::isnan(glm::min(N, B)) ? 0 : 1; + Error += !glm::isnan(glm::min(B, N)) ? 0 : 1; + + T const C = static_cast(2); + Error += glm::isnan(glm::min(N, B, C)) ? 0 : 1; + Error += !glm::isnan(glm::min(B, N, C)) ? 0 : 1; + Error += !glm::isnan(glm::min(C, N, B)) ? 0 : 1; + Error += !glm::isnan(glm::min(C, B, N)) ? 0 : 1; + Error += !glm::isnan(glm::min(B, C, N)) ? 0 : 1; + Error += glm::isnan(glm::min(N, C, B)) ? 0 : 1; + + T const D = static_cast(3); + Error += !glm::isnan(glm::min(D, N, B, C)) ? 0 : 1; + Error += !glm::isnan(glm::min(B, D, N, C)) ? 0 : 1; + Error += !glm::isnan(glm::min(C, N, D, B)) ? 0 : 1; + Error += !glm::isnan(glm::min(C, B, D, N)) ? 0 : 1; + Error += !glm::isnan(glm::min(B, C, N, D)) ? 0 : 1; + Error += glm::isnan(glm::min(N, C, B, D)) ? 0 : 1; + + return Error; +} + +template +static int test_max() +{ + int Error = 0; + + T const N = static_cast(0); + T const B = static_cast(1); + Error += glm::equal(glm::max(N, B), B, glm::epsilon()) ? 0 : 1; + Error += glm::equal(glm::max(B, N), B, glm::epsilon()) ? 0 : 1; + + T const C = static_cast(2); + Error += glm::equal(glm::max(N, B, C), C, glm::epsilon()) ? 0 : 1; + Error += glm::equal(glm::max(B, N, C), C, glm::epsilon()) ? 0 : 1; + Error += glm::equal(glm::max(C, N, B), C, glm::epsilon()) ? 0 : 1; + Error += glm::equal(glm::max(C, B, N), C, glm::epsilon()) ? 0 : 1; + Error += glm::equal(glm::max(B, C, N), C, glm::epsilon()) ? 0 : 1; + Error += glm::equal(glm::max(N, C, B), C, glm::epsilon()) ? 0 : 1; + + T const D = static_cast(3); + Error += glm::equal(glm::max(D, N, B, C), D, glm::epsilon()) ? 0 : 1; + Error += glm::equal(glm::max(B, D, N, C), D, glm::epsilon()) ? 0 : 1; + Error += glm::equal(glm::max(C, N, D, B), D, glm::epsilon()) ? 0 : 1; + Error += glm::equal(glm::max(C, B, D, N), D, glm::epsilon()) ? 0 : 1; + Error += glm::equal(glm::max(B, C, N, D), D, glm::epsilon()) ? 0 : 1; + Error += glm::equal(glm::max(N, C, B, D), D, glm::epsilon()) ? 0 : 1; + + return Error; +} + +template +static int test_max_nan() +{ + int Error = 0; + + T const B = static_cast(1); + T const N = static_cast(GLM_NAN(T)); + Error += glm::isnan(glm::max(N, B)) ? 0 : 1; + Error += !glm::isnan(glm::max(B, N)) ? 0 : 1; + + T const C = static_cast(2); + Error += glm::isnan(glm::max(N, B, C)) ? 0 : 1; + Error += !glm::isnan(glm::max(B, N, C)) ? 0 : 1; + Error += !glm::isnan(glm::max(C, N, B)) ? 0 : 1; + Error += !glm::isnan(glm::max(C, B, N)) ? 0 : 1; + Error += !glm::isnan(glm::max(B, C, N)) ? 0 : 1; + Error += glm::isnan(glm::max(N, C, B)) ? 0 : 1; + + T const D = static_cast(3); + Error += !glm::isnan(glm::max(D, N, B, C)) ? 0 : 1; + Error += !glm::isnan(glm::max(B, D, N, C)) ? 0 : 1; + Error += !glm::isnan(glm::max(C, N, D, B)) ? 0 : 1; + Error += !glm::isnan(glm::max(C, B, D, N)) ? 0 : 1; + Error += !glm::isnan(glm::max(B, C, N, D)) ? 0 : 1; + Error += glm::isnan(glm::max(N, C, B, D)) ? 0 : 1; + + return Error; +} + +template +static int test_fmin() +{ + int Error = 0; + + T const B = static_cast(1); + T const N = static_cast(GLM_NAN(T)); + Error += glm::equal(glm::fmin(N, B), B, glm::epsilon()) ? 0 : 1; + Error += glm::equal(glm::fmin(B, N), B, glm::epsilon()) ? 0 : 1; + + T const C = static_cast(2); + Error += glm::equal(glm::fmin(N, B, C), B, glm::epsilon()) ? 0 : 1; + Error += glm::equal(glm::fmin(B, N, C), B, glm::epsilon()) ? 0 : 1; + Error += glm::equal(glm::fmin(C, N, B), B, glm::epsilon()) ? 0 : 1; + Error += glm::equal(glm::fmin(C, B, N), B, glm::epsilon()) ? 0 : 1; + Error += glm::equal(glm::fmin(B, C, N), B, glm::epsilon()) ? 0 : 1; + Error += glm::equal(glm::fmin(N, C, B), B, glm::epsilon()) ? 0 : 1; + + T const D = static_cast(3); + Error += glm::equal(glm::fmin(D, N, B, C), B, glm::epsilon()) ? 0 : 1; + Error += glm::equal(glm::fmin(B, D, N, C), B, glm::epsilon()) ? 0 : 1; + Error += glm::equal(glm::fmin(C, N, D, B), B, glm::epsilon()) ? 0 : 1; + Error += glm::equal(glm::fmin(C, B, D, N), B, glm::epsilon()) ? 0 : 1; + Error += glm::equal(glm::fmin(B, C, N, D), B, glm::epsilon()) ? 0 : 1; + Error += glm::equal(glm::fmin(N, C, B, D), B, glm::epsilon()) ? 0 : 1; + + return Error; +} + +template +static int test_fmax() +{ + int Error = 0; + + T const B = static_cast(1); + T const N = static_cast(GLM_NAN(T)); + Error += glm::equal(glm::fmax(N, B), B, glm::epsilon()) ? 0 : 1; + Error += glm::equal(glm::fmax(B, N), B, glm::epsilon()) ? 0 : 1; + + T const C = static_cast(2); + Error += glm::equal(glm::fmax(N, B, C), C, glm::epsilon()) ? 0 : 1; + Error += glm::equal(glm::fmax(B, N, C), C, glm::epsilon()) ? 0 : 1; + Error += glm::equal(glm::fmax(C, N, B), C, glm::epsilon()) ? 0 : 1; + Error += glm::equal(glm::fmax(C, B, N), C, glm::epsilon()) ? 0 : 1; + Error += glm::equal(glm::fmax(B, C, N), C, glm::epsilon()) ? 0 : 1; + Error += glm::equal(glm::fmax(N, C, B), C, glm::epsilon()) ? 0 : 1; + + T const D = static_cast(3); + Error += glm::equal(glm::fmax(D, N, B, C), D, glm::epsilon()) ? 0 : 1; + Error += glm::equal(glm::fmax(B, D, N, C), D, glm::epsilon()) ? 0 : 1; + Error += glm::equal(glm::fmax(C, N, D, B), D, glm::epsilon()) ? 0 : 1; + Error += glm::equal(glm::fmax(C, B, D, N), D, glm::epsilon()) ? 0 : 1; + Error += glm::equal(glm::fmax(B, C, N, D), D, glm::epsilon()) ? 0 : 1; + Error += glm::equal(glm::fmax(N, C, B, D), D, glm::epsilon()) ? 0 : 1; + + return Error; +} + +static int test_clamp() +{ + int Error = 0; + + float A = glm::clamp(0.5f); + Error += glm::equal(A, 0.5f, 0.00001f) ? 0 : 1; + + float B = glm::clamp(0.0f); + Error += glm::equal(B, 0.0f, 0.00001f) ? 0 : 1; + + float C = glm::clamp(1.0f); + Error += glm::equal(C, 1.0f, 0.00001f) ? 0 : 1; + + float D = glm::clamp(-0.5f); + Error += glm::equal(D, 0.0f, 0.00001f) ? 0 : 1; + + float E = glm::clamp(1.5f); + Error += glm::equal(E, 1.0f, 0.00001f) ? 0 : 1; + + return Error; +} + +static int test_repeat() +{ + int Error = 0; + + float A = glm::repeat(0.5f); + Error += glm::equal(A, 0.5f, 0.00001f) ? 0 : 1; + + float B = glm::repeat(0.0f); + Error += glm::equal(B, 0.0f, 0.00001f) ? 0 : 1; + + float C = glm::repeat(1.0f); + Error += glm::equal(C, 0.0f, 0.00001f) ? 0 : 1; + + float D = glm::repeat(-0.5f); + Error += glm::equal(D, 0.5f, 0.00001f) ? 0 : 1; + + float E = glm::repeat(1.5f); + Error += glm::equal(E, 0.5f, 0.00001f) ? 0 : 1; + + float F = glm::repeat(0.9f); + Error += glm::equal(F, 0.9f, 0.00001f) ? 0 : 1; + + return Error; +} + +static int test_mirrorClamp() +{ + int Error = 0; + + float A = glm::mirrorClamp(0.5f); + Error += glm::equal(A, 0.5f, 0.00001f) ? 0 : 1; + + float B = glm::mirrorClamp(0.0f); + Error += glm::equal(B, 0.0f, 0.00001f) ? 0 : 1; + + float C = glm::mirrorClamp(1.1f); + Error += glm::equal(C, 0.1f, 0.00001f) ? 0 : 1; + + float D = glm::mirrorClamp(-0.5f); + Error += glm::equal(D, 0.5f, 0.00001f) ? 0 : 1; + + float E = glm::mirrorClamp(1.5f); + Error += glm::equal(E, 0.5f, 0.00001f) ? 0 : 1; + + float F = glm::mirrorClamp(0.9f); + Error += glm::equal(F, 0.9f, 0.00001f) ? 0 : 1; + + float G = glm::mirrorClamp(3.1f); + Error += glm::equal(G, 0.1f, 0.00001f) ? 0 : 1; + + float H = glm::mirrorClamp(-3.1f); + Error += glm::equal(H, 0.1f, 0.00001f) ? 0 : 1; + + float I = glm::mirrorClamp(-0.9f); + Error += glm::equal(I, 0.9f, 0.00001f) ? 0 : 1; + + return Error; +} + +static int test_mirrorRepeat() +{ + int Error = 0; + + float A = glm::mirrorRepeat(0.5f); + Error += glm::equal(A, 0.5f, 0.00001f) ? 0 : 1; + + float B = glm::mirrorRepeat(0.0f); + Error += glm::equal(B, 0.0f, 0.00001f) ? 0 : 1; + + float C = glm::mirrorRepeat(1.0f); + Error += glm::equal(C, 1.0f, 0.00001f) ? 0 : 1; + + float D = glm::mirrorRepeat(-0.5f); + Error += glm::equal(D, 0.5f, 0.00001f) ? 0 : 1; + + float E = glm::mirrorRepeat(1.5f); + Error += glm::equal(E, 0.5f, 0.00001f) ? 0 : 1; + + float F = glm::mirrorRepeat(0.9f); + Error += glm::equal(F, 0.9f, 0.00001f) ? 0 : 1; + + float G = glm::mirrorRepeat(3.0f); + Error += glm::equal(G, 1.0f, 0.00001f) ? 0 : 1; + + float H = glm::mirrorRepeat(-3.0f); + Error += glm::equal(H, 1.0f, 0.00001f) ? 0 : 1; + + float I = glm::mirrorRepeat(-1.0f); + Error += glm::equal(I, 1.0f, 0.00001f) ? 0 : 1; + + return Error; +} + +static int test_iround() +{ + int Error = 0; + + for(float f = 0.0f; f < 3.1f; f += 0.05f) + { + int RoundFast = static_cast(glm::iround(f)); + int RoundSTD = static_cast(glm::round(f)); + Error += RoundFast == RoundSTD ? 0 : 1; + assert(!Error); + } + + return Error; +} + +static int test_uround() +{ + int Error = 0; + + for(float f = 0.0f; f < 3.1f; f += 0.05f) + { + int RoundFast = static_cast(glm::uround(f)); + int RoundSTD = static_cast(glm::round(f)); + Error += RoundFast == RoundSTD ? 0 : 1; + assert(!Error); + } + + return Error; +} + +int main() +{ + int Error = 0; + + Error += test_min(); + Error += test_min(); + Error += test_min_nan(); + Error += test_min_nan(); + + Error += test_max(); + Error += test_max(); + Error += test_max_nan(); + Error += test_max_nan(); + + Error += test_fmin(); + Error += test_fmin(); + + Error += test_fmax(); + Error += test_fmax(); + + Error += test_clamp(); + Error += test_repeat(); + Error += test_mirrorClamp(); + Error += test_mirrorRepeat(); + + Error += test_iround(); + Error += test_uround(); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_scalar_constants.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_scalar_constants.cpp new file mode 100644 index 0000000000000000000000000000000000000000..807f84a60a3a241031d547d2db5d57414b6b413f --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_scalar_constants.cpp @@ -0,0 +1,36 @@ +#include + +template +static int test_epsilon() +{ + int Error = 0; + + valType const Test = glm::epsilon(); + Error += Test > static_cast(0) ? 0 : 1; + + return Error; +} + +template +static int test_pi() +{ + int Error = 0; + + valType const Test = glm::pi(); + Error += Test > static_cast(3.14) ? 0 : 1; + Error += Test < static_cast(3.15) ? 0 : 1; + + return Error; +} + +int main() +{ + int Error = 0; + + Error += test_epsilon(); + Error += test_epsilon(); + Error += test_pi(); + Error += test_pi(); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_scalar_int_sized.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_scalar_int_sized.cpp new file mode 100644 index 0000000000000000000000000000000000000000..10f3a3f28d1a9cfbc81f39d3ba52a5d7b313709b --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_scalar_int_sized.cpp @@ -0,0 +1,43 @@ +#include + +#if GLM_HAS_STATIC_ASSERT + static_assert(sizeof(glm::int8) == 1, "int8 size isn't 1 byte on this platform"); + static_assert(sizeof(glm::int16) == 2, "int16 size isn't 2 bytes on this platform"); + static_assert(sizeof(glm::int32) == 4, "int32 size isn't 4 bytes on this platform"); + static_assert(sizeof(glm::int64) == 8, "int64 size isn't 8 bytes on this platform"); + static_assert(sizeof(glm::int16) == sizeof(short), "signed short size isn't 4 bytes on this platform"); + static_assert(sizeof(glm::int32) == sizeof(int), "signed int size isn't 4 bytes on this platform"); +#endif + +static int test_size() +{ + int Error = 0; + + Error += sizeof(glm::int8) == 1 ? 0 : 1; + Error += sizeof(glm::int16) == 2 ? 0 : 1; + Error += sizeof(glm::int32) == 4 ? 0 : 1; + Error += sizeof(glm::int64) == 8 ? 0 : 1; + + return Error; +} + +static int test_comp() +{ + int Error = 0; + + Error += sizeof(glm::int8) < sizeof(glm::int16) ? 0 : 1; + Error += sizeof(glm::int16) < sizeof(glm::int32) ? 0 : 1; + Error += sizeof(glm::int32) < sizeof(glm::int64) ? 0 : 1; + + return Error; +} + +int main() +{ + int Error = 0; + + Error += test_size(); + Error += test_comp(); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_scalar_integer.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_scalar_integer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..78f2dfbe8db90ff08a0f787427a856ba98715494 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_scalar_integer.cpp @@ -0,0 +1,686 @@ +#include +#include +#include +#include +#include +#include + +#if GLM_LANG & GLM_LANG_CXX11_FLAG +#include + +namespace isPowerOfTwo +{ + template + struct type + { + genType Value; + bool Return; + }; + + int test_int16() + { + type const Data[] = + { + {0x0001, true}, + {0x0002, true}, + {0x0004, true}, + {0x0080, true}, + {0x0000, true}, + {0x0003, false} + }; + + int Error = 0; + + for(std::size_t i = 0, n = sizeof(Data) / sizeof(type); i < n; ++i) + { + bool Result = glm::isPowerOfTwo(Data[i].Value); + Error += Data[i].Return == Result ? 0 : 1; + } + + return Error; + } + + int test_uint16() + { + type const Data[] = + { + {0x0001, true}, + {0x0002, true}, + {0x0004, true}, + {0x0000, true}, + {0x0000, true}, + {0x0003, false} + }; + + int Error = 0; + + for(std::size_t i = 0, n = sizeof(Data) / sizeof(type); i < n; ++i) + { + bool Result = glm::isPowerOfTwo(Data[i].Value); + Error += Data[i].Return == Result ? 0 : 1; + } + + return Error; + } + + int test_int32() + { + type const Data[] = + { + {0x00000001, true}, + {0x00000002, true}, + {0x00000004, true}, + {0x0000000f, false}, + {0x00000000, true}, + {0x00000003, false} + }; + + int Error = 0; + + for(std::size_t i = 0, n = sizeof(Data) / sizeof(type); i < n; ++i) + { + bool Result = glm::isPowerOfTwo(Data[i].Value); + Error += Data[i].Return == Result ? 0 : 1; + } + + return Error; + } + + int test_uint32() + { + type const Data[] = + { + {0x00000001, true}, + {0x00000002, true}, + {0x00000004, true}, + {0x80000000, true}, + {0x00000000, true}, + {0x00000003, false} + }; + + int Error = 0; + + for(std::size_t i = 0, n = sizeof(Data) / sizeof(type); i < n; ++i) + { + bool Result = glm::isPowerOfTwo(Data[i].Value); + Error += Data[i].Return == Result ? 0 : 1; + } + + return Error; + } + + int test() + { + int Error = 0; + + Error += test_int16(); + Error += test_uint16(); + Error += test_int32(); + Error += test_uint32(); + + return Error; + } +}//isPowerOfTwo + +namespace nextPowerOfTwo_advanced +{ + template + GLM_FUNC_QUALIFIER genIUType highestBitValue(genIUType Value) + { + genIUType tmp = Value; + genIUType result = genIUType(0); + while(tmp) + { + result = (tmp & (~tmp + 1)); // grab lowest bit + tmp &= ~result; // clear lowest bit + } + return result; + } + + template + GLM_FUNC_QUALIFIER genType nextPowerOfTwo_loop(genType value) + { + return glm::isPowerOfTwo(value) ? value : highestBitValue(value) << 1; + } + + template + struct type + { + genType Value; + genType Return; + }; + + int test_int32() + { + type const Data[] = + { + {0x0000ffff, 0x00010000}, + {-3, -4}, + {-8, -8}, + {0x00000001, 0x00000001}, + {0x00000002, 0x00000002}, + {0x00000004, 0x00000004}, + {0x00000007, 0x00000008}, + {0x0000fff0, 0x00010000}, + {0x0000f000, 0x00010000}, + {0x08000000, 0x08000000}, + {0x00000000, 0x00000000}, + {0x00000003, 0x00000004} + }; + + int Error(0); + + for(std::size_t i = 0, n = sizeof(Data) / sizeof(type); i < n; ++i) + { + glm::int32 Result = glm::nextPowerOfTwo(Data[i].Value); + Error += Data[i].Return == Result ? 0 : 1; + } + + return Error; + } + + int test_uint32() + { + type const Data[] = + { + {0x00000001, 0x00000001}, + {0x00000002, 0x00000002}, + {0x00000004, 0x00000004}, + {0x00000007, 0x00000008}, + {0x0000ffff, 0x00010000}, + {0x0000fff0, 0x00010000}, + {0x0000f000, 0x00010000}, + {0x80000000, 0x80000000}, + {0x00000000, 0x00000000}, + {0x00000003, 0x00000004} + }; + + int Error(0); + + for(std::size_t i = 0, n = sizeof(Data) / sizeof(type); i < n; ++i) + { + glm::uint32 Result = glm::nextPowerOfTwo(Data[i].Value); + Error += Data[i].Return == Result ? 0 : 1; + } + + return Error; + } + + int perf() + { + int Error(0); + + std::vector v; + v.resize(100000000); + + std::clock_t Timestramp0 = std::clock(); + + for(glm::uint32 i = 0, n = static_cast(v.size()); i < n; ++i) + v[i] = nextPowerOfTwo_loop(i); + + std::clock_t Timestramp1 = std::clock(); + + for(glm::uint32 i = 0, n = static_cast(v.size()); i < n; ++i) + v[i] = glm::nextPowerOfTwo(i); + + std::clock_t Timestramp2 = std::clock(); + + std::printf("nextPowerOfTwo_loop: %d clocks\n", static_cast(Timestramp1 - Timestramp0)); + std::printf("glm::nextPowerOfTwo: %d clocks\n", static_cast(Timestramp2 - Timestramp1)); + + return Error; + } + + int test() + { + int Error(0); + + Error += test_int32(); + Error += test_uint32(); + + return Error; + } +}//namespace nextPowerOfTwo_advanced + +namespace prevPowerOfTwo +{ + template + int run() + { + int Error = 0; + + T const A = glm::prevPowerOfTwo(static_cast(7)); + Error += A == static_cast(4) ? 0 : 1; + + T const B = glm::prevPowerOfTwo(static_cast(15)); + Error += B == static_cast(8) ? 0 : 1; + + T const C = glm::prevPowerOfTwo(static_cast(31)); + Error += C == static_cast(16) ? 0 : 1; + + T const D = glm::prevPowerOfTwo(static_cast(32)); + Error += D == static_cast(32) ? 0 : 1; + + return Error; + } + + int test() + { + int Error = 0; + + Error += run(); + Error += run(); + Error += run(); + Error += run(); + + Error += run(); + Error += run(); + Error += run(); + Error += run(); + + return Error; + } +}//namespace prevPowerOfTwo + +namespace nextPowerOfTwo +{ + template + int run() + { + int Error = 0; + + T const A = glm::nextPowerOfTwo(static_cast(7)); + Error += A == static_cast(8) ? 0 : 1; + + T const B = glm::nextPowerOfTwo(static_cast(15)); + Error += B == static_cast(16) ? 0 : 1; + + T const C = glm::nextPowerOfTwo(static_cast(31)); + Error += C == static_cast(32) ? 0 : 1; + + T const D = glm::nextPowerOfTwo(static_cast(32)); + Error += D == static_cast(32) ? 0 : 1; + + return Error; + } + + int test() + { + int Error = 0; + + Error += run(); + Error += run(); + Error += run(); + Error += run(); + + Error += run(); + Error += run(); + Error += run(); + Error += run(); + + return Error; + } +}//namespace nextPowerOfTwo + +namespace prevMultiple +{ + template + struct type + { + genIUType Source; + genIUType Multiple; + genIUType Return; + }; + + template + int run() + { + type const Data[] = + { + {8, 3, 6}, + {7, 7, 7} + }; + + int Error = 0; + + for(std::size_t i = 0, n = sizeof(Data) / sizeof(type); i < n; ++i) + { + T const Result = glm::prevMultiple(Data[i].Source, Data[i].Multiple); + Error += Data[i].Return == Result ? 0 : 1; + } + + return Error; + } + + int test() + { + int Error = 0; + + Error += run(); + Error += run(); + Error += run(); + Error += run(); + + Error += run(); + Error += run(); + Error += run(); + Error += run(); + + return Error; + } +}//namespace prevMultiple + +namespace nextMultiple +{ + static glm::uint const Multiples = 128; + + int perf_nextMultiple(glm::uint Samples) + { + std::vector Results(Samples * Multiples); + + std::chrono::high_resolution_clock::time_point t0 = std::chrono::high_resolution_clock::now(); + + for(glm::uint Source = 0; Source < Samples; ++Source) + for(glm::uint Multiple = 0; Multiple < Multiples; ++Multiple) + { + Results[Source * Multiples + Multiple] = glm::nextMultiple(Source, Multiples); + } + + std::chrono::high_resolution_clock::time_point t1 = std::chrono::high_resolution_clock::now(); + + std::printf("- glm::nextMultiple Time %d microseconds\n", static_cast(std::chrono::duration_cast(t1 - t0).count())); + + glm::uint Result = 0; + for(std::size_t i = 0, n = Results.size(); i < n; ++i) + Result += Results[i]; + + return Result > 0 ? 0 : 1; + } + + template + GLM_FUNC_QUALIFIER T nextMultipleMod(T Source, T Multiple) + { + T const Tmp = Source - static_cast(1); + return Tmp + (Multiple - (Tmp % Multiple)); + } + + int perf_nextMultipleMod(glm::uint Samples) + { + std::vector Results(Samples * Multiples); + + std::chrono::high_resolution_clock::time_point t0 = std::chrono::high_resolution_clock::now(); + + for(glm::uint Multiple = 0; Multiple < Multiples; ++Multiple) + for (glm::uint Source = 0; Source < Samples; ++Source) + { + Results[Source * Multiples + Multiple] = nextMultipleMod(Source, Multiples); + } + + std::chrono::high_resolution_clock::time_point t1 = std::chrono::high_resolution_clock::now(); + + std::printf("- nextMultipleMod Time %d microseconds\n", static_cast(std::chrono::duration_cast(t1 - t0).count())); + + glm::uint Result = 0; + for(std::size_t i = 0, n = Results.size(); i < n; ++i) + Result += Results[i]; + + return Result > 0 ? 0 : 1; + } + + template + GLM_FUNC_QUALIFIER T nextMultipleNeg(T Source, T Multiple) + { + if(Source > static_cast(0)) + { + T const Tmp = Source - static_cast(1); + return Tmp + (Multiple - (Tmp % Multiple)); + } + else + return Source + (-Source % Multiple); + } + + int perf_nextMultipleNeg(glm::uint Samples) + { + std::vector Results(Samples * Multiples); + + std::chrono::high_resolution_clock::time_point t0 = std::chrono::high_resolution_clock::now(); + + for(glm::uint Source = 0; Source < Samples; ++Source) + for(glm::uint Multiple = 0; Multiple < Multiples; ++Multiple) + { + Results[Source * Multiples + Multiple] = nextMultipleNeg(Source, Multiples); + } + + std::chrono::high_resolution_clock::time_point t1 = std::chrono::high_resolution_clock::now(); + + std::printf("- nextMultipleNeg Time %d microseconds\n", static_cast(std::chrono::duration_cast(t1 - t0).count())); + + glm::uint Result = 0; + for (std::size_t i = 0, n = Results.size(); i < n; ++i) + Result += Results[i]; + + return Result > 0 ? 0 : 1; + } + + template + GLM_FUNC_QUALIFIER T nextMultipleUFloat(T Source, T Multiple) + { + return Source + (Multiple - std::fmod(Source, Multiple)); + } + + int perf_nextMultipleUFloat(glm::uint Samples) + { + std::vector Results(Samples * Multiples); + + std::chrono::high_resolution_clock::time_point t0 = std::chrono::high_resolution_clock::now(); + + for(glm::uint Source = 0; Source < Samples; ++Source) + for(glm::uint Multiple = 0; Multiple < Multiples; ++Multiple) + { + Results[Source * Multiples + Multiple] = nextMultipleUFloat(static_cast(Source), static_cast(Multiples)); + } + + std::chrono::high_resolution_clock::time_point t1 = std::chrono::high_resolution_clock::now(); + + std::printf("- nextMultipleUFloat Time %d microseconds\n", static_cast(std::chrono::duration_cast(t1 - t0).count())); + + float Result = 0; + for (std::size_t i = 0, n = Results.size(); i < n; ++i) + Result += Results[i]; + + return Result > 0.0f ? 0 : 1; + } + + template + GLM_FUNC_QUALIFIER T nextMultipleFloat(T Source, T Multiple) + { + if(Source > static_cast(0)) + return Source + (Multiple - std::fmod(Source, Multiple)); + else + return Source + std::fmod(-Source, Multiple); + } + + int perf_nextMultipleFloat(glm::uint Samples) + { + std::vector Results(Samples * Multiples); + + std::chrono::high_resolution_clock::time_point t0 = std::chrono::high_resolution_clock::now(); + + for(glm::uint Source = 0; Source < Samples; ++Source) + for(glm::uint Multiple = 0; Multiple < Multiples; ++Multiple) + { + Results[Source * Multiples + Multiple] = nextMultipleFloat(static_cast(Source), static_cast(Multiples)); + } + + std::chrono::high_resolution_clock::time_point t1 = std::chrono::high_resolution_clock::now(); + + std::printf("- nextMultipleFloat Time %d microseconds\n", static_cast(std::chrono::duration_cast(t1 - t0).count())); + + float Result = 0; + for (std::size_t i = 0, n = Results.size(); i < n; ++i) + Result += Results[i]; + + return Result > 0.0f ? 0 : 1; + } + + template + struct type + { + genIUType Source; + genIUType Multiple; + genIUType Return; + }; + + template + int test_uint() + { + type const Data[] = + { + { 3, 4, 4 }, + { 6, 3, 6 }, + { 5, 3, 6 }, + { 7, 7, 7 }, + { 0, 1, 0 }, + { 8, 3, 9 } + }; + + int Error = 0; + + for(std::size_t i = 0, n = sizeof(Data) / sizeof(type); i < n; ++i) + { + T const Result0 = glm::nextMultiple(Data[i].Source, Data[i].Multiple); + Error += Data[i].Return == Result0 ? 0 : 1; + assert(!Error); + + T const Result1 = nextMultipleMod(Data[i].Source, Data[i].Multiple); + Error += Data[i].Return == Result1 ? 0 : 1; + assert(!Error); + } + + return Error; + } + + int perf() + { + int Error = 0; + + glm::uint const Samples = 10000; + + for(int i = 0; i < 4; ++i) + { + std::printf("Run %d :\n", i); + Error += perf_nextMultiple(Samples); + Error += perf_nextMultipleMod(Samples); + Error += perf_nextMultipleNeg(Samples); + Error += perf_nextMultipleUFloat(Samples); + Error += perf_nextMultipleFloat(Samples); + std::printf("\n"); + } + + return Error; + } + + int test() + { + int Error = 0; + + Error += test_uint(); + Error += test_uint(); + Error += test_uint(); + Error += test_uint(); + + Error += test_uint(); + Error += test_uint(); + Error += test_uint(); + Error += test_uint(); + + return Error; + } +}//namespace nextMultiple + +namespace findNSB +{ + template + struct type + { + T Source; + int SignificantBitCount; + int Return; + }; + + template + int run() + { + type const Data[] = + { + { 0x00, 1,-1 }, + { 0x01, 2,-1 }, + { 0x02, 2,-1 }, + { 0x06, 3,-1 }, + { 0x01, 1, 0 }, + { 0x03, 1, 0 }, + { 0x03, 2, 1 }, + { 0x07, 2, 1 }, + { 0x05, 2, 2 }, + { 0x0D, 2, 2 } + }; + + int Error = 0; + + for (std::size_t i = 0, n = sizeof(Data) / sizeof(type); i < n; ++i) + { + int const Result0 = glm::findNSB(Data[i].Source, Data[i].SignificantBitCount); + Error += Data[i].Return == Result0 ? 0 : 1; + assert(!Error); + } + + return Error; + } + + int test() + { + int Error = 0; + + Error += run(); + Error += run(); + Error += run(); + Error += run(); + + Error += run(); + Error += run(); + Error += run(); + Error += run(); + + return Error; + } +}//namespace findNSB + +int main() +{ + int Error = 0; + + Error += findNSB::test(); + + Error += isPowerOfTwo::test(); + Error += prevPowerOfTwo::test(); + Error += nextPowerOfTwo::test(); + Error += nextPowerOfTwo_advanced::test(); + Error += prevMultiple::test(); + Error += nextMultiple::test(); + +# ifdef NDEBUG + Error += nextPowerOfTwo_advanced::perf(); + Error += nextMultiple::perf(); +# endif//NDEBUG + + return Error; +} + +#else + +int main() +{ + return 0; +} + +#endif diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_scalar_packing.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_scalar_packing.cpp new file mode 100644 index 0000000000000000000000000000000000000000..90b5ae1bc9aeaddc7a088d062a5fb78425981e9c --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_scalar_packing.cpp @@ -0,0 +1,28 @@ +#include +#include + +int test_packUnorm() +{ + int Error = 0; + + + return Error; +} + +int test_packSnorm() +{ + int Error = 0; + + + return Error; +} + +int main() +{ + int Error = 0; + + Error += test_packUnorm(); + Error += test_packSnorm(); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_scalar_reciprocal.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_scalar_reciprocal.cpp new file mode 100644 index 0000000000000000000000000000000000000000..f069a41a5242f9cbbc34cfd2c812550d9bcf4e1e --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_scalar_reciprocal.cpp @@ -0,0 +1,171 @@ +#include +#include +#include + +static int test_sec() +{ + int Error = 0; + + Error += glm::equal(glm::sec(0.0), 1.0, 0.01) ? 0 : 1; + Error += glm::equal(glm::sec(glm::pi() * 2.0), 1.0, 0.01) ? 0 : 1; + Error += glm::equal(glm::sec(glm::pi() * -2.0), 1.0, 0.01) ? 0 : 1; + Error += glm::equal(glm::sec(glm::pi() * 1.0), -1.0, 0.01) ? 0 : 1; + Error += glm::equal(glm::sec(glm::pi() * -1.0), -1.0, 0.01) ? 0 : 1; + + return Error; +} + +static int test_csc() +{ + int Error = 0; + + double const a = glm::csc(glm::pi() * 0.5); + Error += glm::equal(a, 1.0, 0.01) ? 0 : 1; + double const b = glm::csc(glm::pi() * -0.5); + Error += glm::equal(b, -1.0, 0.01) ? 0 : 1; + + return Error; +} + +static int test_cot() +{ + int Error = 0; + + double const a = glm::cot(glm::pi() * 0.5); + Error += glm::equal(a, 0.0, 0.01) ? 0 : 1; + double const b = glm::cot(glm::pi() * -0.5); + Error += glm::equal(b, 0.0, 0.01) ? 0 : 1; + + return Error; +} + +static int test_asec() +{ + int Error = 0; + + Error += glm::equal(glm::asec(100000.0), glm::pi() * 0.5, 0.01) ? 0 : 1; + Error += glm::equal(glm::asec(-100000.0), glm::pi() * 0.5, 0.01) ? 0 : 1; + + return Error; +} + +static int test_acsc() +{ + int Error = 0; + + Error += glm::equal(glm::acsc(100000.0), 0.0, 0.01) ? 0 : 1; + Error += glm::equal(glm::acsc(-100000.0), 0.0, 0.01) ? 0 : 1; + + return Error; +} + +static int test_acot() +{ + int Error = 0; + + Error += glm::equal(glm::acot(100000.0), 0.0, 0.01) ? 0 : 1; + Error += glm::equal(glm::acot(-100000.0), glm::pi(), 0.01) ? 0 : 1; + Error += glm::equal(glm::acot(0.0), glm::pi() * 0.5, 0.01) ? 0 : 1; + + return Error; +} + +static int test_sech() +{ + int Error = 0; + + Error += glm::equal(glm::sech(100000.0), 0.0, 0.01) ? 0 : 1; + Error += glm::equal(glm::sech(-100000.0), 0.0, 0.01) ? 0 : 1; + Error += glm::equal(glm::sech(0.0), 1.0, 0.01) ? 0 : 1; + + return Error; +} + +static int test_csch() +{ + int Error = 0; + + Error += glm::equal(glm::csch(100000.0), 0.0, 0.01) ? 0 : 1; + Error += glm::equal(glm::csch(-100000.0), 0.0, 0.01) ? 0 : 1; + + return Error; +} + +static int test_coth() +{ + int Error = 0; + + double const a = glm::coth(100.0); + Error += glm::equal(a, 1.0, 0.01) ? 0 : 1; + + double const b = glm::coth(-100.0); + Error += glm::equal(b, -1.0, 0.01) ? 0 : 1; + + return Error; +} + +static int test_asech() +{ + int Error = 0; + + double const a = glm::asech(1.0); + Error += glm::equal(a, 0.0, 0.01) ? 0 : 1; + + return Error; +} + +static int test_acsch() +{ + int Error = 0; + + Error += glm::acsch(0.01) > 1.0 ? 0 : 1; + Error += glm::acsch(-0.01) < -1.0 ? 0 : 1; + + Error += glm::equal(glm::acsch(100.0), 0.0, 0.01) ? 0 : 1; + Error += glm::equal(glm::acsch(-100.0), 0.0, 0.01) ? 0 : 1; + + return Error; +} + +static int test_acoth() +{ + int Error = 0; + + double const a = glm::acoth(1.00001); + Error += a > 6.0 ? 0 : 1; + + double const b = glm::acoth(-1.00001); + Error += b < -6.0 ? 0 : 1; + + double const c = glm::acoth(10000.0); + Error += glm::equal(c, 0.0, 0.01) ? 0 : 1; + + double const d = glm::acoth(-10000.0); + Error += glm::equal(d, 0.0, 0.01) ? 0 : 1; + + return Error; +} + + +int main() +{ + int Error = 0; + + Error += test_sec(); + Error += test_csc(); + Error += test_cot(); + + Error += test_asec(); + Error += test_acsc(); + Error += test_acot(); + + Error += test_sech(); + Error += test_csch(); + Error += test_coth(); + + Error += test_asech(); + Error += test_acsch(); + Error += test_acoth(); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_scalar_relational.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_scalar_relational.cpp new file mode 100644 index 0000000000000000000000000000000000000000..2a1937e2a069084ac686b6729c92dcf9eec3e38c --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_scalar_relational.cpp @@ -0,0 +1,106 @@ +#include +#include +#include +#include + +static int test_equal_epsilon() +{ +# if GLM_CONFIG_CONSTEXP == GLM_ENABLE + static_assert(glm::equal(1.01f, 1.02f, 0.1f), "GLM: Failed constexpr"); + static_assert(!glm::equal(1.01f, 1.02f, 0.001f), "GLM: Failed constexpr"); +# endif + + int Error = 0; + + Error += glm::equal(1.01f, 1.02f, 0.1f) ? 0 : 1; + Error += !glm::equal(1.01f, 1.02f, 0.001f) ? 0 : 1; + + return Error; +} + +static int test_notEqual_epsilon() +{ +# if GLM_CONFIG_CONSTEXP == GLM_ENABLE + static_assert(glm::notEqual(1.01f, 1.02f, 0.001f), "GLM: Failed constexpr"); + static_assert(!glm::notEqual(1.01f, 1.02f, 0.1f), "GLM: Failed constexpr"); +# endif + + int Error = 0; + + Error += glm::notEqual(1.01f, 1.02f, 0.001f) ? 0 : 1; + Error += !glm::notEqual(1.01f, 1.02f, 0.1f) ? 0 : 1; + + return Error; +} + +static int test_equal_ulps() +{ + int Error = 0; + + float const ULP1Plus = glm::nextFloat(1.0f); + Error += glm::equal(1.0f, ULP1Plus, 1) ? 0 : 1; + + float const ULP2Plus = glm::nextFloat(ULP1Plus); + Error += !glm::equal(1.0f, ULP2Plus, 1) ? 0 : 1; + + float const ULP1Minus = glm::prevFloat(1.0f); + Error += glm::equal(1.0f, ULP1Minus, 1) ? 0 : 1; + + float const ULP2Minus = glm::prevFloat(ULP1Minus); + Error += !glm::equal(1.0f, ULP2Minus, 1) ? 0 : 1; + + return Error; +} + +static int test_notEqual_ulps() +{ + int Error = 0; + + float const ULP1Plus = glm::nextFloat(1.0f); + Error += !glm::notEqual(1.0f, ULP1Plus, 1) ? 0 : 1; + + float const ULP2Plus = glm::nextFloat(ULP1Plus); + Error += glm::notEqual(1.0f, ULP2Plus, 1) ? 0 : 1; + + float const ULP1Minus = glm::prevFloat(1.0f); + Error += !glm::notEqual(1.0f, ULP1Minus, 1) ? 0 : 1; + + float const ULP2Minus = glm::prevFloat(ULP1Minus); + Error += glm::notEqual(1.0f, ULP2Minus, 1) ? 0 : 1; + + return Error; +} + +static int test_equal_sign() +{ + int Error = 0; + + Error += !glm::equal(-0.0f, 0.0f, 2) ? 0 : 1; + Error += !glm::equal(-0.0, 0.0, 2) ? 0 : 1; + + Error += !glm::equal(-1.0f, 2.0f, 2) ? 0 : 1; + Error += !glm::equal(-1.0, 2.0, 2) ? 0 : 1; + + Error += !glm::equal(-0.00001f, 1.00000f, 2) ? 0 : 1; + Error += !glm::equal(-0.00001, 1.00000, 2) ? 0 : 1; + + Error += !glm::equal(-1.0f, 1.0f, 2) ? 0 : 1; + Error += !glm::equal(-1.0, 1.0, 2) ? 0 : 1; + + return Error; +} + +int main() +{ + int Error = 0; + + Error += test_equal_epsilon(); + Error += test_notEqual_epsilon(); + + Error += test_equal_ulps(); + Error += test_notEqual_ulps(); + + Error += test_equal_sign(); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_scalar_uint_sized.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_scalar_uint_sized.cpp new file mode 100644 index 0000000000000000000000000000000000000000..41043fd97c15b071b191f34fe9c3a622ea93b317 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_scalar_uint_sized.cpp @@ -0,0 +1,43 @@ +#include + +#if GLM_HAS_STATIC_ASSERT + static_assert(sizeof(glm::uint8) == 1, "uint8 size isn't 1 byte on this platform"); + static_assert(sizeof(glm::uint16) == 2, "uint16 size isn't 2 bytes on this platform"); + static_assert(sizeof(glm::uint32) == 4, "uint32 size isn't 4 bytes on this platform"); + static_assert(sizeof(glm::uint64) == 8, "uint64 size isn't 8 bytes on this platform"); + static_assert(sizeof(glm::uint16) == sizeof(unsigned short), "unsigned short size isn't 4 bytes on this platform"); + static_assert(sizeof(glm::uint32) == sizeof(unsigned int), "unsigned int size isn't 4 bytes on this platform"); +#endif + +static int test_size() +{ + int Error = 0; + + Error += sizeof(glm::uint8) == 1 ? 0 : 1; + Error += sizeof(glm::uint16) == 2 ? 0 : 1; + Error += sizeof(glm::uint32) == 4 ? 0 : 1; + Error += sizeof(glm::uint64) == 8 ? 0 : 1; + + return Error; +} + +static int test_comp() +{ + int Error = 0; + + Error += sizeof(glm::uint8) < sizeof(glm::uint16) ? 0 : 1; + Error += sizeof(glm::uint16) < sizeof(glm::uint32) ? 0 : 1; + Error += sizeof(glm::uint32) < sizeof(glm::uint64) ? 0 : 1; + + return Error; +} + +int main() +{ + int Error = 0; + + Error += test_size(); + Error += test_comp(); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_scalar_ulp.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_scalar_ulp.cpp new file mode 100644 index 0000000000000000000000000000000000000000..7a1d961962a7bdd70594360f3f6d9d8e44921be1 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_scalar_ulp.cpp @@ -0,0 +1,96 @@ +#include +#include + +static int test_ulp_float_dist() +{ + int Error = 0; + + float A = 1.0f; + + float B = glm::nextFloat(A); + Error += glm::notEqual(A, B, 0) ? 0 : 1; + float C = glm::prevFloat(B); + Error += glm::equal(A, C, 0) ? 0 : 1; + + int D = glm::floatDistance(A, B); + Error += D == 1 ? 0 : 1; + int E = glm::floatDistance(A, C); + Error += E == 0 ? 0 : 1; + + return Error; +} + +static int test_ulp_float_step() +{ + int Error = 0; + + float A = 1.0f; + + for(int i = 10; i < 1000; i *= 10) + { + float B = glm::nextFloat(A, i); + Error += glm::notEqual(A, B, 0) ? 0 : 1; + float C = glm::prevFloat(B, i); + Error += glm::equal(A, C, 0) ? 0 : 1; + + int D = glm::floatDistance(A, B); + Error += D == i ? 0 : 1; + int E = glm::floatDistance(A, C); + Error += E == 0 ? 0 : 1; + } + + return Error; +} + +static int test_ulp_double_dist() +{ + int Error = 0; + + double A = 1.0; + + double B = glm::nextFloat(A); + Error += glm::notEqual(A, B, 0) ? 0 : 1; + double C = glm::prevFloat(B); + Error += glm::equal(A, C, 0) ? 0 : 1; + + glm::int64 const D = glm::floatDistance(A, B); + Error += D == 1 ? 0 : 1; + glm::int64 const E = glm::floatDistance(A, C); + Error += E == 0 ? 0 : 1; + + return Error; +} + +static int test_ulp_double_step() +{ + int Error = 0; + + double A = 1.0; + + for(int i = 10; i < 1000; i *= 10) + { + double B = glm::nextFloat(A, i); + Error += glm::notEqual(A, B, 0) ? 0 : 1; + double C = glm::prevFloat(B, i); + Error += glm::equal(A, C, 0) ? 0 : 1; + + glm::int64 const D = glm::floatDistance(A, B); + Error += D == i ? 0 : 1; + glm::int64 const E = glm::floatDistance(A, C); + Error += E == 0 ? 0 : 1; + } + + return Error; +} + +int main() +{ + int Error = 0; + + Error += test_ulp_float_dist(); + Error += test_ulp_float_step(); + Error += test_ulp_double_dist(); + Error += test_ulp_double_step(); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_vec1.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_vec1.cpp new file mode 100644 index 0000000000000000000000000000000000000000..ef6e35874d34a0797e24dc4128438837da9b10d4 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_vec1.cpp @@ -0,0 +1,157 @@ +#define GLM_FORCE_SWIZZLE +#include +#include +#include + +static glm::vec1 g1; +static glm::vec1 g2(1); + +static int test_vec1_operators() +{ + int Error(0); + + glm::ivec1 A(1); + glm::ivec1 B(1); + { + bool R = A != B; + bool S = A == B; + + Error += (S && !R) ? 0 : 1; + } + + { + A *= 1; + B *= 1; + A += 1; + B += 1; + + bool R = A != B; + bool S = A == B; + + Error += (S && !R) ? 0 : 1; + } + + return Error; +} + +static int test_vec1_ctor() +{ + int Error = 0; + +# if GLM_HAS_TRIVIAL_QUERIES + // Error += std::is_trivially_default_constructible::value ? 0 : 1; + // Error += std::is_trivially_copy_assignable::value ? 0 : 1; + Error += std::is_trivially_copyable::value ? 0 : 1; + Error += std::is_trivially_copyable::value ? 0 : 1; + Error += std::is_trivially_copyable::value ? 0 : 1; + Error += std::is_trivially_copyable::value ? 0 : 1; + + Error += std::is_copy_constructible::value ? 0 : 1; +# endif + + + { + glm::ivec1 A = glm::vec1(2.0f); + + glm::ivec1 E(glm::dvec1(2.0)); + Error += A == E ? 0 : 1; + + glm::ivec1 F(glm::ivec1(2)); + Error += A == F ? 0 : 1; + } + + return Error; +} + +static int test_vec1_size() +{ + int Error = 0; + + Error += sizeof(glm::vec1) == sizeof(glm::mediump_vec1) ? 0 : 1; + Error += 4 == sizeof(glm::mediump_vec1) ? 0 : 1; + Error += sizeof(glm::dvec1) == sizeof(glm::highp_dvec1) ? 0 : 1; + Error += 8 == sizeof(glm::highp_dvec1) ? 0 : 1; + Error += glm::vec1().length() == 1 ? 0 : 1; + Error += glm::dvec1().length() == 1 ? 0 : 1; + Error += glm::vec1::length() == 1 ? 0 : 1; + Error += glm::dvec1::length() == 1 ? 0 : 1; + + GLM_CONSTEXPR std::size_t Length = glm::vec1::length(); + Error += Length == 1 ? 0 : 1; + + return Error; +} + +static int test_vec1_operator_increment() +{ + int Error(0); + + glm::ivec1 v0(1); + glm::ivec1 v1(v0); + glm::ivec1 v2(v0); + glm::ivec1 v3 = ++v1; + glm::ivec1 v4 = v2++; + + Error += glm::all(glm::equal(v0, v4)) ? 0 : 1; + Error += glm::all(glm::equal(v1, v2)) ? 0 : 1; + Error += glm::all(glm::equal(v1, v3)) ? 0 : 1; + + int i0(1); + int i1(i0); + int i2(i0); + int i3 = ++i1; + int i4 = i2++; + + Error += i0 == i4 ? 0 : 1; + Error += i1 == i2 ? 0 : 1; + Error += i1 == i3 ? 0 : 1; + + return Error; +} + +static int test_bvec1_ctor() +{ + int Error = 0; + + glm::bvec1 const A(true); + glm::bvec1 const B(true); + glm::bvec1 const C(false); + glm::bvec1 const D = A && B; + glm::bvec1 const E = A && C; + glm::bvec1 const F = A || C; + + Error += D == glm::bvec1(true) ? 0 : 1; + Error += E == glm::bvec1(false) ? 0 : 1; + Error += F == glm::bvec1(true) ? 0 : 1; + + bool const G = A == C; + bool const H = A != C; + Error += !G ? 0 : 1; + Error += H ? 0 : 1; + + return Error; +} + +static int test_constexpr() +{ +#if GLM_HAS_CONSTEXPR + static_assert(glm::vec1::length() == 1, "GLM: Failed constexpr"); + static_assert(glm::vec1(1.0f).x > 0.0f, "GLM: Failed constexpr"); +#endif + + return 0; +} + +int main() +{ + int Error = 0; + + Error += test_vec1_size(); + Error += test_vec1_ctor(); + Error += test_bvec1_ctor(); + Error += test_vec1_operators(); + Error += test_vec1_operator_increment(); + Error += test_constexpr(); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_vector_bool1.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_vector_bool1.cpp new file mode 100644 index 0000000000000000000000000000000000000000..728c8c2c201404931be4d92900a16e4f4913a216 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_vector_bool1.cpp @@ -0,0 +1,104 @@ +#include +#include + +template +static int test_operators() +{ + int Error = 0; + + genType const A(true); + genType const B(true); + { + bool const R = A != B; + bool const S = A == B; + Error += (S && !R) ? 0 : 1; + } + + return Error; +} + +template +static int test_ctor() +{ + int Error = 0; + + glm::bvec1 const A = genType(true); + + glm::bvec1 const E(genType(true)); + Error += A == E ? 0 : 1; + + glm::bvec1 const F(E); + Error += A == F ? 0 : 1; + + return Error; +} + +template +static int test_size() +{ + int Error = 0; + + Error += sizeof(glm::bvec1) == sizeof(genType) ? 0 : 1; + Error += genType().length() == 1 ? 0 : 1; + Error += genType::length() == 1 ? 0 : 1; + + return Error; +} + +template +static int test_relational() +{ + int Error = 0; + + genType const A(true); + genType const B(true); + genType const C(false); + + Error += A == B ? 0 : 1; + Error += (A && B) == A ? 0 : 1; + Error += (A || C) == A ? 0 : 1; + + return Error; +} + +template +static int test_constexpr() +{ +# if GLM_HAS_CONSTEXPR + static_assert(genType::length() == 1, "GLM: Failed constexpr"); +# endif + + return 0; +} + +int main() +{ + int Error = 0; + + Error += test_operators(); + Error += test_operators(); + Error += test_operators(); + Error += test_operators(); + + Error += test_ctor(); + Error += test_ctor(); + Error += test_ctor(); + Error += test_ctor(); + + Error += test_size(); + Error += test_size(); + Error += test_size(); + Error += test_size(); + + Error += test_relational(); + Error += test_relational(); + Error += test_relational(); + Error += test_relational(); + + Error += test_constexpr(); + Error += test_constexpr(); + Error += test_constexpr(); + Error += test_constexpr(); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_vector_common.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_vector_common.cpp new file mode 100644 index 0000000000000000000000000000000000000000..1ffa7537da0eed39c88ab60444f5ba3a5d7d559e --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_vector_common.cpp @@ -0,0 +1,365 @@ +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#if ((GLM_LANG & GLM_LANG_CXX11_FLAG) || (GLM_COMPILER & GLM_COMPILER_VC)) +# define GLM_NAN(T) NAN +#else +# define GLM_NAN(T) (static_cast(0.0f) / static_cast(0.0f)) +#endif + +template +static int test_min() +{ + typedef typename vecType::value_type T; + + int Error = 0; + + vecType const N(static_cast(0)); + vecType const B(static_cast(1)); + + Error += glm::all(glm::equal(glm::min(N, B), N, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(glm::min(B, N), N, glm::epsilon())) ? 0 : 1; + + vecType const C(static_cast(2)); + Error += glm::all(glm::equal(glm::min(N, B, C), N, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(glm::min(B, N, C), N, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(glm::min(C, N, B), N, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(glm::min(C, B, N), N, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(glm::min(B, C, N), N, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(glm::min(N, C, B), N, glm::epsilon())) ? 0 : 1; + + vecType const D(static_cast(3)); + Error += glm::all(glm::equal(glm::min(D, N, B, C), N, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(glm::min(B, D, N, C), N, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(glm::min(C, N, D, B), N, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(glm::min(C, B, D, N), N, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(glm::min(B, C, N, D), N, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(glm::min(N, C, B, D), N, glm::epsilon())) ? 0 : 1; + + return Error; +} + +template +static int test_min_nan() +{ + typedef typename vecType::value_type T; + + int Error = 0; + + vecType const B(static_cast(1)); + vecType const N(GLM_NAN(T)); + + Error += glm::all(glm::isnan(glm::min(N, B))) ? 0 : 1; + Error += !glm::all(glm::isnan(glm::min(B, N))) ? 0 : 1; + + vecType const C(static_cast(2)); + Error += glm::all(glm::isnan(glm::min(N, B, C))) ? 0 : 1; + Error += !glm::all(glm::isnan(glm::min(B, N, C))) ? 0 : 1; + Error += !glm::all(glm::isnan(glm::min(C, N, B))) ? 0 : 1; + Error += !glm::all(glm::isnan(glm::min(C, B, N))) ? 0 : 1; + Error += !glm::all(glm::isnan(glm::min(B, C, N))) ? 0 : 1; + Error += glm::all(glm::isnan(glm::min(N, C, B))) ? 0 : 1; + + vecType const D(static_cast(3)); + Error += !glm::all(glm::isnan(glm::min(D, N, B, C))) ? 0 : 1; + Error += !glm::all(glm::isnan(glm::min(B, D, N, C))) ? 0 : 1; + Error += !glm::all(glm::isnan(glm::min(C, N, D, B))) ? 0 : 1; + Error += !glm::all(glm::isnan(glm::min(C, B, D, N))) ? 0 : 1; + Error += !glm::all(glm::isnan(glm::min(B, C, N, D))) ? 0 : 1; + Error += glm::all(glm::isnan(glm::min(N, C, B, D))) ? 0 : 1; + + return Error; +} + +template +static int test_max() +{ + typedef typename vecType::value_type T; + + int Error = 0; + + vecType const N(static_cast(0)); + vecType const B(static_cast(1)); + Error += glm::all(glm::equal(glm::max(N, B), B, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(glm::max(B, N), B, glm::epsilon())) ? 0 : 1; + + vecType const C(static_cast(2)); + Error += glm::all(glm::equal(glm::max(N, B, C), C, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(glm::max(B, N, C), C, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(glm::max(C, N, B), C, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(glm::max(C, B, N), C, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(glm::max(B, C, N), C, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(glm::max(N, C, B), C, glm::epsilon())) ? 0 : 1; + + vecType const D(static_cast(3)); + Error += glm::all(glm::equal(glm::max(D, N, B, C), D, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(glm::max(B, D, N, C), D, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(glm::max(C, N, D, B), D, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(glm::max(C, B, D, N), D, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(glm::max(B, C, N, D), D, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(glm::max(N, C, B, D), D, glm::epsilon())) ? 0 : 1; + + return Error; +} + +template +static int test_max_nan() +{ + typedef typename vecType::value_type T; + + int Error = 0; + + vecType const B(static_cast(1)); + vecType const N(GLM_NAN(T)); + + Error += glm::all(glm::isnan(glm::max(N, B))) ? 0 : 1; + Error += !glm::all(glm::isnan(glm::max(B, N))) ? 0 : 1; + + vecType const C(static_cast(2)); + Error += glm::all(glm::isnan(glm::max(N, B, C))) ? 0 : 1; + Error += !glm::all(glm::isnan(glm::max(B, N, C))) ? 0 : 1; + Error += !glm::all(glm::isnan(glm::max(C, N, B))) ? 0 : 1; + Error += !glm::all(glm::isnan(glm::max(C, B, N))) ? 0 : 1; + Error += !glm::all(glm::isnan(glm::max(B, C, N))) ? 0 : 1; + Error += glm::all(glm::isnan(glm::max(N, C, B))) ? 0 : 1; + + vecType const D(static_cast(3)); + Error += !glm::all(glm::isnan(glm::max(D, N, B, C))) ? 0 : 1; + Error += !glm::all(glm::isnan(glm::max(B, D, N, C))) ? 0 : 1; + Error += !glm::all(glm::isnan(glm::max(C, N, D, B))) ? 0 : 1; + Error += !glm::all(glm::isnan(glm::max(C, B, D, N))) ? 0 : 1; + Error += !glm::all(glm::isnan(glm::max(B, C, N, D))) ? 0 : 1; + Error += glm::all(glm::isnan(glm::max(N, C, B, D))) ? 0 : 1; + + return Error; +} + +template +static int test_fmin() +{ + typedef typename vecType::value_type T; + + int Error = 0; + + vecType const B(static_cast(1)); + vecType const N(GLM_NAN(T)); + + Error += glm::all(glm::equal(glm::fmin(N, B), B, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(glm::fmin(B, N), B, glm::epsilon())) ? 0 : 1; + + vecType const C(static_cast(2)); + Error += glm::all(glm::equal(glm::fmin(N, B, C), B, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(glm::fmin(B, N, C), B, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(glm::fmin(C, N, B), B, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(glm::fmin(C, B, N), B, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(glm::fmin(B, C, N), B, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(glm::fmin(N, C, B), B, glm::epsilon())) ? 0 : 1; + + vecType const D(static_cast(3)); + Error += glm::all(glm::equal(glm::fmin(D, N, B, C), B, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(glm::fmin(B, D, N, C), B, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(glm::fmin(C, N, D, B), B, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(glm::fmin(C, B, D, N), B, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(glm::fmin(B, C, N, D), B, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(glm::fmin(N, C, B, D), B, glm::epsilon())) ? 0 : 1; + + return Error; +} + +template +static int test_fmax() +{ + typedef typename vecType::value_type T; + + int Error = 0; + + vecType const B(static_cast(1)); + vecType const N(GLM_NAN(T)); + + Error += glm::all(glm::equal(glm::fmax(N, B), B, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(glm::fmax(B, N), B, glm::epsilon())) ? 0 : 1; + + vecType const C(static_cast(2)); + Error += glm::all(glm::equal(glm::fmax(N, B, C), C, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(glm::fmax(B, N, C), C, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(glm::fmax(C, N, B), C, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(glm::fmax(C, B, N), C, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(glm::fmax(B, C, N), C, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(glm::fmax(N, C, B), C, glm::epsilon())) ? 0 : 1; + + vecType const D(static_cast(3)); + Error += glm::all(glm::equal(glm::fmax(D, N, B, C), D, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(glm::fmax(B, D, N, C), D, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(glm::fmax(C, N, D, B), D, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(glm::fmax(C, B, D, N), D, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(glm::fmax(B, C, N, D), D, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(glm::fmax(N, C, B, D), D, glm::epsilon())) ? 0 : 1; + + return Error; +} + +static int test_clamp() +{ + int Error = 0; + + glm::vec2 K = glm::clamp(glm::vec2(0.5f)); + Error += glm::all(glm::equal(K, glm::vec2(0.5f), glm::vec2(0.00001f))) ? 0 : 1; + + glm::vec3 L = glm::clamp(glm::vec3(0.5f)); + Error += glm::all(glm::equal(L, glm::vec3(0.5f), glm::vec3(0.00001f))) ? 0 : 1; + + glm::vec4 M = glm::clamp(glm::vec4(0.5f)); + Error += glm::all(glm::equal(M, glm::vec4(0.5f), glm::vec4(0.00001f))) ? 0 : 1; + + glm::vec1 N = glm::clamp(glm::vec1(0.5f)); + Error += glm::all(glm::equal(N, glm::vec1(0.5f), glm::vec1(0.00001f))) ? 0 : 1; + + return Error; +} + +static int test_repeat() +{ + int Error = 0; + + glm::vec2 K = glm::repeat(glm::vec2(0.5f)); + Error += glm::all(glm::equal(K, glm::vec2(0.5f), glm::vec2(0.00001f))) ? 0 : 1; + + glm::vec3 L = glm::repeat(glm::vec3(0.5f)); + Error += glm::all(glm::equal(L, glm::vec3(0.5f), glm::vec3(0.00001f))) ? 0 : 1; + + glm::vec4 M = glm::repeat(glm::vec4(0.5f)); + Error += glm::all(glm::equal(M, glm::vec4(0.5f), glm::vec4(0.00001f))) ? 0 : 1; + + glm::vec1 N = glm::repeat(glm::vec1(0.5f)); + Error += glm::all(glm::equal(N, glm::vec1(0.5f), glm::vec1(0.00001f))) ? 0 : 1; + + return Error; +} + +static int test_mirrorClamp() +{ + int Error = 0; + + glm::vec2 K = glm::mirrorClamp(glm::vec2(0.5f)); + Error += glm::all(glm::equal(K, glm::vec2(0.5f), glm::vec2(0.00001f))) ? 0 : 1; + + glm::vec3 L = glm::mirrorClamp(glm::vec3(0.5f)); + Error += glm::all(glm::equal(L, glm::vec3(0.5f), glm::vec3(0.00001f))) ? 0 : 1; + + glm::vec4 M = glm::mirrorClamp(glm::vec4(0.5f)); + Error += glm::all(glm::equal(M, glm::vec4(0.5f), glm::vec4(0.00001f))) ? 0 : 1; + + glm::vec1 N = glm::mirrorClamp(glm::vec1(0.5f)); + Error += glm::all(glm::equal(N, glm::vec1(0.5f), glm::vec1(0.00001f))) ? 0 : 1; + + return Error; +} + +static int test_mirrorRepeat() +{ + int Error = 0; + + glm::vec2 K = glm::mirrorRepeat(glm::vec2(0.5f)); + Error += glm::all(glm::equal(K, glm::vec2(0.5f), glm::vec2(0.00001f))) ? 0 : 1; + + glm::vec3 L = glm::mirrorRepeat(glm::vec3(0.5f)); + Error += glm::all(glm::equal(L, glm::vec3(0.5f), glm::vec3(0.00001f))) ? 0 : 1; + + glm::vec4 M = glm::mirrorRepeat(glm::vec4(0.5f)); + Error += glm::all(glm::equal(M, glm::vec4(0.5f), glm::vec4(0.00001f))) ? 0 : 1; + + glm::vec1 N = glm::mirrorRepeat(glm::vec1(0.5f)); + Error += glm::all(glm::equal(N, glm::vec1(0.5f), glm::vec1(0.00001f))) ? 0 : 1; + + return Error; +} + +static int test_iround() +{ + int Error = 0; + + for(float f = 0.0f; f < 3.1f; f += 0.05f) + { + int RoundFast = static_cast(glm::iround(f)); + int RoundSTD = static_cast(glm::round(f)); + Error += RoundFast == RoundSTD ? 0 : 1; + assert(!Error); + } + + return Error; +} + +static int test_uround() +{ + int Error = 0; + + for(float f = 0.0f; f < 3.1f; f += 0.05f) + { + int RoundFast = static_cast(glm::uround(f)); + int RoundSTD = static_cast(glm::round(f)); + Error += RoundFast == RoundSTD ? 0 : 1; + assert(!Error); + } + + return Error; +} + +int main() +{ + int Error = 0; + + Error += test_min(); + Error += test_min(); + Error += test_min_nan(); + Error += test_min_nan(); + + Error += test_max(); + Error += test_max(); + Error += test_max_nan(); + Error += test_max_nan(); + + Error += test_fmin(); + Error += test_fmin(); + + Error += test_fmax(); + Error += test_fmax(); + + Error += test_clamp(); + Error += test_repeat(); + Error += test_mirrorClamp(); + Error += test_mirrorRepeat(); + + Error += test_iround(); + Error += test_uround(); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_vector_iec559.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_vector_iec559.cpp new file mode 100644 index 0000000000000000000000000000000000000000..87e993467b739a887466ba7ab811e5f94217b5cc --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_vector_iec559.cpp @@ -0,0 +1,166 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +template +static int test_operators() +{ + typedef typename genType::value_type valType; + + int Error = 0; + + { + genType const A(1); + genType const B(1); + + genType const C = A + B; + Error += glm::all(glm::equal(C, genType(2), glm::epsilon())) ? 0 : 1; + + genType const D = A - B; + Error += glm::all(glm::equal(D, genType(0), glm::epsilon())) ? 0 : 1; + + genType const E = A * B; + Error += glm::all(glm::equal(E, genType(1), glm::epsilon())) ? 0 : 1; + + genType const F = A / B; + Error += glm::all(glm::equal(F, genType(1), glm::epsilon())) ? 0 : 1; + } + + return Error; +} + +template +static int test_ctor() +{ + typedef typename genType::value_type T; + + int Error = 0; + + glm::vec<1, T> const A = genType(1); + + glm::vec<1, T> const E(genType(1)); + Error += glm::all(glm::equal(A, E, glm::epsilon())) ? 0 : 1; + + glm::vec<1, T> const F(E); + Error += glm::all(glm::equal(A, F, glm::epsilon())) ? 0 : 1; + + genType const B = genType(1); + genType const G(glm::vec<2, T>(1)); + Error += glm::all(glm::equal(B, G, glm::epsilon())) ? 0 : 1; + + genType const H(glm::vec<3, T>(1)); + Error += glm::all(glm::equal(B, H, glm::epsilon())) ? 0 : 1; + + genType const I(glm::vec<4, T>(1)); + Error += glm::all(glm::equal(B, I, glm::epsilon())) ? 0 : 1; + + return Error; +} + +template +static int test_size() +{ + typedef typename genType::value_type T; + + int Error = 0; + + Error += sizeof(glm::vec<1, T>) == sizeof(genType) ? 0 : 1; + Error += genType().length() == 1 ? 0 : 1; + Error += genType::length() == 1 ? 0 : 1; + + return Error; +} + +template +static int test_relational() +{ + typedef typename genType::value_type valType; + + int Error = 0; + + genType const A(1); + genType const B(1); + genType const C(0); + + Error += all(equal(A, B, glm::epsilon())) ? 0 : 1; + Error += any(notEqual(A, C, glm::epsilon())) ? 0 : 1; + + return Error; +} + +template +static int test_constexpr() +{ +# if GLM_CONFIG_CONSTEXP == GLM_ENABLE + static_assert(genType::length() == 1, "GLM: Failed constexpr"); +# endif + + return 0; +} + +int main() +{ + int Error = 0; + + Error += test_operators(); + Error += test_operators(); + Error += test_operators(); + Error += test_operators(); + + Error += test_ctor(); + Error += test_ctor(); + Error += test_ctor(); + Error += test_ctor(); + + Error += test_size(); + Error += test_size(); + Error += test_size(); + Error += test_size(); + + Error += test_relational(); + Error += test_relational(); + Error += test_relational(); + Error += test_relational(); + + Error += test_constexpr(); + Error += test_constexpr(); + Error += test_constexpr(); + Error += test_constexpr(); + + Error += test_operators(); + Error += test_operators(); + Error += test_operators(); + Error += test_operators(); + + Error += test_ctor(); + Error += test_ctor(); + Error += test_ctor(); + Error += test_ctor(); + + Error += test_size(); + Error += test_size(); + Error += test_size(); + Error += test_size(); + + Error += test_relational(); + Error += test_relational(); + Error += test_relational(); + Error += test_relational(); + + Error += test_constexpr(); + Error += test_constexpr(); + Error += test_constexpr(); + Error += test_constexpr(); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_vector_int1_sized.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_vector_int1_sized.cpp new file mode 100644 index 0000000000000000000000000000000000000000..22e6f9b597e2d647a2241a198656742d2281af17 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_vector_int1_sized.cpp @@ -0,0 +1,41 @@ +#include + +#if GLM_HAS_STATIC_ASSERT + static_assert(sizeof(glm::i8vec1) == 1, "int8 size isn't 1 byte on this platform"); + static_assert(sizeof(glm::i16vec1) == 2, "int16 size isn't 2 bytes on this platform"); + static_assert(sizeof(glm::i32vec1) == 4, "int32 size isn't 4 bytes on this platform"); + static_assert(sizeof(glm::i64vec1) == 8, "int64 size isn't 8 bytes on this platform"); +#endif + +static int test_size() +{ + int Error = 0; + + Error += sizeof(glm::i8vec1) == 1 ? 0 : 1; + Error += sizeof(glm::i16vec1) == 2 ? 0 : 1; + Error += sizeof(glm::i32vec1) == 4 ? 0 : 1; + Error += sizeof(glm::i64vec1) == 8 ? 0 : 1; + + return Error; +} + +static int test_comp() +{ + int Error = 0; + + Error += sizeof(glm::i8vec1) < sizeof(glm::i16vec1) ? 0 : 1; + Error += sizeof(glm::i16vec1) < sizeof(glm::i32vec1) ? 0 : 1; + Error += sizeof(glm::i32vec1) < sizeof(glm::i64vec1) ? 0 : 1; + + return Error; +} + +int main() +{ + int Error = 0; + + Error += test_size(); + Error += test_comp(); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_vector_int2_sized.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_vector_int2_sized.cpp new file mode 100644 index 0000000000000000000000000000000000000000..b08f259512fa36ce7907d11edaa9eb6af5357a95 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_vector_int2_sized.cpp @@ -0,0 +1,41 @@ +#include + +#if GLM_HAS_STATIC_ASSERT + static_assert(sizeof(glm::i8vec2) == 2, "int8 size isn't 1 byte on this platform"); + static_assert(sizeof(glm::i16vec2) == 4, "int16 size isn't 2 bytes on this platform"); + static_assert(sizeof(glm::i32vec2) == 8, "int32 size isn't 4 bytes on this platform"); + static_assert(sizeof(glm::i64vec2) == 16, "int64 size isn't 8 bytes on this platform"); +#endif + +static int test_size() +{ + int Error = 0; + + Error += sizeof(glm::i8vec2) == 2 ? 0 : 1; + Error += sizeof(glm::i16vec2) == 4 ? 0 : 1; + Error += sizeof(glm::i32vec2) == 8 ? 0 : 1; + Error += sizeof(glm::i64vec2) == 16 ? 0 : 1; + + return Error; +} + +static int test_comp() +{ + int Error = 0; + + Error += sizeof(glm::i8vec2) < sizeof(glm::i16vec2) ? 0 : 1; + Error += sizeof(glm::i16vec2) < sizeof(glm::i32vec2) ? 0 : 1; + Error += sizeof(glm::i32vec2) < sizeof(glm::i64vec2) ? 0 : 1; + + return Error; +} + +int main() +{ + int Error = 0; + + Error += test_size(); + Error += test_comp(); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_vector_int3_sized.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_vector_int3_sized.cpp new file mode 100644 index 0000000000000000000000000000000000000000..6b6884d784595cb7a4d25b8b609d00030ba8906f --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_vector_int3_sized.cpp @@ -0,0 +1,41 @@ +#include + +#if GLM_HAS_STATIC_ASSERT + static_assert(sizeof(glm::i8vec3) == 3, "int8 size isn't 1 byte on this platform"); + static_assert(sizeof(glm::i16vec3) == 6, "int16 size isn't 2 bytes on this platform"); + static_assert(sizeof(glm::i32vec3) == 12, "int32 size isn't 4 bytes on this platform"); + static_assert(sizeof(glm::i64vec3) == 24, "int64 size isn't 8 bytes on this platform"); +#endif + +static int test_size() +{ + int Error = 0; + + Error += sizeof(glm::i8vec3) == 3 ? 0 : 1; + Error += sizeof(glm::i16vec3) == 6 ? 0 : 1; + Error += sizeof(glm::i32vec3) == 12 ? 0 : 1; + Error += sizeof(glm::i64vec3) == 24 ? 0 : 1; + + return Error; +} + +static int test_comp() +{ + int Error = 0; + + Error += sizeof(glm::i8vec3) < sizeof(glm::i16vec3) ? 0 : 1; + Error += sizeof(glm::i16vec3) < sizeof(glm::i32vec3) ? 0 : 1; + Error += sizeof(glm::i32vec3) < sizeof(glm::i64vec3) ? 0 : 1; + + return Error; +} + +int main() +{ + int Error = 0; + + Error += test_size(); + Error += test_comp(); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_vector_int4_sized.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_vector_int4_sized.cpp new file mode 100644 index 0000000000000000000000000000000000000000..ebd60b289b06678f09990dbb5c8ad9ff61cd6307 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_vector_int4_sized.cpp @@ -0,0 +1,41 @@ +#include + +#if GLM_HAS_STATIC_ASSERT +static_assert(sizeof(glm::i8vec4) == 4, "int8 size isn't 1 byte on this platform"); +static_assert(sizeof(glm::i16vec4) == 8, "int16 size isn't 2 bytes on this platform"); +static_assert(sizeof(glm::i32vec4) == 16, "int32 size isn't 4 bytes on this platform"); +static_assert(sizeof(glm::i64vec4) == 32, "int64 size isn't 8 bytes on this platform"); +#endif + +static int test_size() +{ + int Error = 0; + + Error += sizeof(glm::i8vec4) == 4 ? 0 : 1; + Error += sizeof(glm::i16vec4) == 8 ? 0 : 1; + Error += sizeof(glm::i32vec4) == 16 ? 0 : 1; + Error += sizeof(glm::i64vec4) == 32 ? 0 : 1; + + return Error; +} + +static int test_comp() +{ + int Error = 0; + + Error += sizeof(glm::i8vec4) < sizeof(glm::i16vec4) ? 0 : 1; + Error += sizeof(glm::i16vec4) < sizeof(glm::i32vec4) ? 0 : 1; + Error += sizeof(glm::i32vec4) < sizeof(glm::i64vec4) ? 0 : 1; + + return Error; +} + +int main() +{ + int Error = 0; + + Error += test_size(); + Error += test_comp(); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_vector_integer.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_vector_integer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..dca9cfec507447986b3a62db9fc68330f2d6d014 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_vector_integer.cpp @@ -0,0 +1,547 @@ +#include +#include +#include +#include +#include +#include + +namespace isPowerOfTwo +{ + template + struct type + { + genType Value; + bool Return; + }; + + template + int test_int16() + { + type const Data[] = + { + { 0x0001, true }, + { 0x0002, true }, + { 0x0004, true }, + { 0x0080, true }, + { 0x0000, true }, + { 0x0003, false } + }; + + int Error = 0; + + for (std::size_t i = 0, n = sizeof(Data) / sizeof(type); i < n; ++i) + { + glm::vec const Result = glm::isPowerOfTwo(glm::vec(Data[i].Value)); + Error += glm::vec(Data[i].Return) == Result ? 0 : 1; + } + + return Error; + } + + template + int test_uint16() + { + type const Data[] = + { + { 0x0001, true }, + { 0x0002, true }, + { 0x0004, true }, + { 0x0000, true }, + { 0x0000, true }, + { 0x0003, false } + }; + + int Error = 0; + + for (std::size_t i = 0, n = sizeof(Data) / sizeof(type); i < n; ++i) + { + glm::vec const Result = glm::isPowerOfTwo(glm::vec(Data[i].Value)); + Error += glm::vec(Data[i].Return) == Result ? 0 : 1; + } + + return Error; + } + + template + int test_int32() + { + type const Data[] = + { + { 0x00000001, true }, + { 0x00000002, true }, + { 0x00000004, true }, + { 0x0000000f, false }, + { 0x00000000, true }, + { 0x00000003, false } + }; + + int Error = 0; + + for (std::size_t i = 0, n = sizeof(Data) / sizeof(type); i < n; ++i) + { + glm::vec const Result = glm::isPowerOfTwo(glm::vec(Data[i].Value)); + Error += glm::vec(Data[i].Return) == Result ? 0 : 1; + } + + return Error; + } + + template + int test_uint32() + { + type const Data[] = + { + { 0x00000001, true }, + { 0x00000002, true }, + { 0x00000004, true }, + { 0x80000000, true }, + { 0x00000000, true }, + { 0x00000003, false } + }; + + int Error = 0; + + for (std::size_t i = 0, n = sizeof(Data) / sizeof(type); i < n; ++i) + { + glm::vec const Result = glm::isPowerOfTwo(glm::vec(Data[i].Value)); + Error += glm::vec(Data[i].Return) == Result ? 0 : 1; + } + + return Error; + } + + int test() + { + int Error = 0; + + Error += test_int16<1>(); + Error += test_int16<2>(); + Error += test_int16<3>(); + Error += test_int16<4>(); + + Error += test_uint16<1>(); + Error += test_uint16<2>(); + Error += test_uint16<3>(); + Error += test_uint16<4>(); + + Error += test_int32<1>(); + Error += test_int32<2>(); + Error += test_int32<3>(); + Error += test_int32<4>(); + + Error += test_uint32<1>(); + Error += test_uint32<2>(); + Error += test_uint32<3>(); + Error += test_uint32<4>(); + + return Error; + } +}//isPowerOfTwo + +namespace prevPowerOfTwo +{ + template + int run() + { + int Error = 0; + + glm::vec const A = glm::prevPowerOfTwo(glm::vec(7)); + Error += A == glm::vec(4) ? 0 : 1; + + glm::vec const B = glm::prevPowerOfTwo(glm::vec(15)); + Error += B == glm::vec(8) ? 0 : 1; + + glm::vec const C = glm::prevPowerOfTwo(glm::vec(31)); + Error += C == glm::vec(16) ? 0 : 1; + + glm::vec const D = glm::prevPowerOfTwo(glm::vec(32)); + Error += D == glm::vec(32) ? 0 : 1; + + return Error; + } + + int test() + { + int Error = 0; + + Error += run<1, glm::int8>(); + Error += run<2, glm::int8>(); + Error += run<3, glm::int8>(); + Error += run<4, glm::int8>(); + + Error += run<1, glm::int16>(); + Error += run<2, glm::int16>(); + Error += run<3, glm::int16>(); + Error += run<4, glm::int16>(); + + Error += run<1, glm::int32>(); + Error += run<2, glm::int32>(); + Error += run<3, glm::int32>(); + Error += run<4, glm::int32>(); + + Error += run<1, glm::int64>(); + Error += run<2, glm::int64>(); + Error += run<3, glm::int64>(); + Error += run<4, glm::int64>(); + + Error += run<1, glm::uint8>(); + Error += run<2, glm::uint8>(); + Error += run<3, glm::uint8>(); + Error += run<4, glm::uint8>(); + + Error += run<1, glm::uint16>(); + Error += run<2, glm::uint16>(); + Error += run<3, glm::uint16>(); + Error += run<4, glm::uint16>(); + + Error += run<1, glm::uint32>(); + Error += run<2, glm::uint32>(); + Error += run<3, glm::uint32>(); + Error += run<4, glm::uint32>(); + + Error += run<1, glm::uint64>(); + Error += run<2, glm::uint64>(); + Error += run<3, glm::uint64>(); + Error += run<4, glm::uint64>(); + + return Error; + } +}//namespace prevPowerOfTwo + +namespace nextPowerOfTwo +{ + template + int run() + { + int Error = 0; + + glm::vec const A = glm::nextPowerOfTwo(glm::vec(7)); + Error += A == glm::vec(8) ? 0 : 1; + + glm::vec const B = glm::nextPowerOfTwo(glm::vec(15)); + Error += B == glm::vec(16) ? 0 : 1; + + glm::vec const C = glm::nextPowerOfTwo(glm::vec(31)); + Error += C == glm::vec(32) ? 0 : 1; + + glm::vec const D = glm::nextPowerOfTwo(glm::vec(32)); + Error += D == glm::vec(32) ? 0 : 1; + + return Error; + } + + int test() + { + int Error = 0; + + Error += run<1, glm::int8>(); + Error += run<2, glm::int8>(); + Error += run<3, glm::int8>(); + Error += run<4, glm::int8>(); + + Error += run<1, glm::int16>(); + Error += run<2, glm::int16>(); + Error += run<3, glm::int16>(); + Error += run<4, glm::int16>(); + + Error += run<1, glm::int32>(); + Error += run<2, glm::int32>(); + Error += run<3, glm::int32>(); + Error += run<4, glm::int32>(); + + Error += run<1, glm::int64>(); + Error += run<2, glm::int64>(); + Error += run<3, glm::int64>(); + Error += run<4, glm::int64>(); + + Error += run<1, glm::uint8>(); + Error += run<2, glm::uint8>(); + Error += run<3, glm::uint8>(); + Error += run<4, glm::uint8>(); + + Error += run<1, glm::uint16>(); + Error += run<2, glm::uint16>(); + Error += run<3, glm::uint16>(); + Error += run<4, glm::uint16>(); + + Error += run<1, glm::uint32>(); + Error += run<2, glm::uint32>(); + Error += run<3, glm::uint32>(); + Error += run<4, glm::uint32>(); + + Error += run<1, glm::uint64>(); + Error += run<2, glm::uint64>(); + Error += run<3, glm::uint64>(); + Error += run<4, glm::uint64>(); + + return Error; + } +}//namespace nextPowerOfTwo + +namespace prevMultiple +{ + template + struct type + { + genIUType Source; + genIUType Multiple; + genIUType Return; + }; + + template + int run() + { + type const Data[] = + { + { 8, 3, 6 }, + { 7, 7, 7 } + }; + + int Error = 0; + + for (std::size_t i = 0, n = sizeof(Data) / sizeof(type); i < n; ++i) + { + glm::vec const Result0 = glm::prevMultiple(glm::vec(Data[i].Source), Data[i].Multiple); + Error += glm::vec(Data[i].Return) == Result0 ? 0 : 1; + + glm::vec const Result1 = glm::prevMultiple(glm::vec(Data[i].Source), glm::vec(Data[i].Multiple)); + Error += glm::vec(Data[i].Return) == Result1 ? 0 : 1; + } + + return Error; + } + + int test() + { + int Error = 0; + + Error += run<1, glm::int8>(); + Error += run<2, glm::int8>(); + Error += run<3, glm::int8>(); + Error += run<4, glm::int8>(); + + Error += run<1, glm::int16>(); + Error += run<2, glm::int16>(); + Error += run<3, glm::int16>(); + Error += run<4, glm::int16>(); + + Error += run<1, glm::int32>(); + Error += run<2, glm::int32>(); + Error += run<3, glm::int32>(); + Error += run<4, glm::int32>(); + + Error += run<1, glm::int64>(); + Error += run<2, glm::int64>(); + Error += run<3, glm::int64>(); + Error += run<4, glm::int64>(); + + Error += run<1, glm::uint8>(); + Error += run<2, glm::uint8>(); + Error += run<3, glm::uint8>(); + Error += run<4, glm::uint8>(); + + Error += run<1, glm::uint16>(); + Error += run<2, glm::uint16>(); + Error += run<3, glm::uint16>(); + Error += run<4, glm::uint16>(); + + Error += run<1, glm::uint32>(); + Error += run<2, glm::uint32>(); + Error += run<3, glm::uint32>(); + Error += run<4, glm::uint32>(); + + Error += run<1, glm::uint64>(); + Error += run<2, glm::uint64>(); + Error += run<3, glm::uint64>(); + Error += run<4, glm::uint64>(); + + return Error; + } +}//namespace prevMultiple + +namespace nextMultiple +{ + template + struct type + { + genIUType Source; + genIUType Multiple; + genIUType Return; + }; + + template + int run() + { + type const Data[] = + { + { 3, 4, 4 }, + { 6, 3, 6 }, + { 5, 3, 6 }, + { 7, 7, 7 }, + { 0, 1, 0 }, + { 8, 3, 9 } + }; + + int Error = 0; + + for (std::size_t i = 0, n = sizeof(Data) / sizeof(type); i < n; ++i) + { + glm::vec const Result0 = glm::nextMultiple(glm::vec(Data[i].Source), glm::vec(Data[i].Multiple)); + Error += glm::vec(Data[i].Return) == Result0 ? 0 : 1; + + glm::vec const Result1 = glm::nextMultiple(glm::vec(Data[i].Source), Data[i].Multiple); + Error += glm::vec(Data[i].Return) == Result1 ? 0 : 1; + } + + return Error; + } + + int test() + { + int Error = 0; + + Error += run<1, glm::int8>(); + Error += run<2, glm::int8>(); + Error += run<3, glm::int8>(); + Error += run<4, glm::int8>(); + + Error += run<1, glm::int16>(); + Error += run<2, glm::int16>(); + Error += run<3, glm::int16>(); + Error += run<4, glm::int16>(); + + Error += run<1, glm::int32>(); + Error += run<2, glm::int32>(); + Error += run<3, glm::int32>(); + Error += run<4, glm::int32>(); + + Error += run<1, glm::int64>(); + Error += run<2, glm::int64>(); + Error += run<3, glm::int64>(); + Error += run<4, glm::int64>(); + + Error += run<1, glm::uint8>(); + Error += run<2, glm::uint8>(); + Error += run<3, glm::uint8>(); + Error += run<4, glm::uint8>(); + + Error += run<1, glm::uint16>(); + Error += run<2, glm::uint16>(); + Error += run<3, glm::uint16>(); + Error += run<4, glm::uint16>(); + + Error += run<1, glm::uint32>(); + Error += run<2, glm::uint32>(); + Error += run<3, glm::uint32>(); + Error += run<4, glm::uint32>(); + + Error += run<1, glm::uint64>(); + Error += run<2, glm::uint64>(); + Error += run<3, glm::uint64>(); + Error += run<4, glm::uint64>(); + + return Error; + } +}//namespace nextMultiple + +namespace findNSB +{ + template + struct type + { + T Source; + int SignificantBitCount; + int Return; + }; + + template + int run() + { + type const Data[] = + { + { 0x00, 1,-1 }, + { 0x01, 2,-1 }, + { 0x02, 2,-1 }, + { 0x06, 3,-1 }, + { 0x01, 1, 0 }, + { 0x03, 1, 0 }, + { 0x03, 2, 1 }, + { 0x07, 2, 1 }, + { 0x05, 2, 2 }, + { 0x0D, 2, 2 } + }; + + int Error = 0; + + for (std::size_t i = 0, n = sizeof(Data) / sizeof(type); i < n; ++i) + { + glm::vec const Result0 = glm::findNSB(glm::vec(Data[i].Source), glm::vec(Data[i].SignificantBitCount)); + Error += glm::vec(Data[i].Return) == Result0 ? 0 : 1; + assert(!Error); + } + + return Error; + } + + int test() + { + int Error = 0; + + Error += run<1, glm::uint8>(); + Error += run<2, glm::uint8>(); + Error += run<3, glm::uint8>(); + Error += run<4, glm::uint8>(); + + Error += run<1, glm::uint16>(); + Error += run<2, glm::uint16>(); + Error += run<3, glm::uint16>(); + Error += run<4, glm::uint16>(); + + Error += run<1, glm::uint32>(); + Error += run<2, glm::uint32>(); + Error += run<3, glm::uint32>(); + Error += run<4, glm::uint32>(); + + Error += run<1, glm::uint64>(); + Error += run<2, glm::uint64>(); + Error += run<3, glm::uint64>(); + Error += run<4, glm::uint64>(); + + Error += run<1, glm::int8>(); + Error += run<2, glm::int8>(); + Error += run<3, glm::int8>(); + Error += run<4, glm::int8>(); + + Error += run<1, glm::int16>(); + Error += run<2, glm::int16>(); + Error += run<3, glm::int16>(); + Error += run<4, glm::int16>(); + + Error += run<1, glm::int32>(); + Error += run<2, glm::int32>(); + Error += run<3, glm::int32>(); + Error += run<4, glm::int32>(); + + Error += run<1, glm::int64>(); + Error += run<2, glm::int64>(); + Error += run<3, glm::int64>(); + Error += run<4, glm::int64>(); + + + return Error; + } +}//namespace findNSB + +int main() +{ + int Error = 0; + + Error += isPowerOfTwo::test(); + Error += prevPowerOfTwo::test(); + Error += nextPowerOfTwo::test(); + Error += prevMultiple::test(); + Error += nextMultiple::test(); + Error += findNSB::test(); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_vector_integer_sized.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_vector_integer_sized.cpp new file mode 100644 index 0000000000000000000000000000000000000000..0ef930b4735ce71d72ccd5dc1321c37e8437888e --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_vector_integer_sized.cpp @@ -0,0 +1,216 @@ +#include +#include +#include +#include +#include + +template +static int test_operators() +{ + int Error = 0; + + { + genType const A(1); + genType const B(1); + + bool const R = A != B; + bool const S = A == B; + Error += (S && !R) ? 0 : 1; + } + + { + genType const A(1); + genType const B(1); + + genType const C = A + B; + Error += C == genType(2) ? 0 : 1; + + genType const D = A - B; + Error += D == genType(0) ? 0 : 1; + + genType const E = A * B; + Error += E == genType(1) ? 0 : 1; + + genType const F = A / B; + Error += F == genType(1) ? 0 : 1; + } + + { + genType const A(3); + genType const B(2); + + genType const C = A % B; + Error += C == genType(1) ? 0 : 1; + } + + { + genType const A(1); + genType const B(1); + genType const C(0); + + genType const I = A & B; + Error += I == genType(1) ? 0 : 1; + genType const D = A & C; + Error += D == genType(0) ? 0 : 1; + + genType const E = A | B; + Error += E == genType(1) ? 0 : 1; + genType const F = A | C; + Error += F == genType(1) ? 0 : 1; + + genType const G = A ^ B; + Error += G == genType(0) ? 0 : 1; + genType const H = A ^ C; + Error += H == genType(1) ? 0 : 1; + } + + { + genType const A(0); + genType const B(1); + genType const C(2); + + genType const D = B << B; + Error += D == genType(2) ? 0 : 1; + genType const E = C >> B; + Error += E == genType(1) ? 0 : 1; + } + + return Error; +} + +template +static int test_ctor() +{ + typedef typename genType::value_type T; + + int Error = 0; + + genType const A = genType(1); + + genType const E(genType(1)); + Error += A == E ? 0 : 1; + + genType const F(E); + Error += A == F ? 0 : 1; + + genType const B = genType(1); + genType const G(glm::vec<2, T>(1)); + Error += B == G ? 0 : 1; + + genType const H(glm::vec<3, T>(1)); + Error += B == H ? 0 : 1; + + genType const I(glm::vec<4, T>(1)); + Error += B == I ? 0 : 1; + + return Error; +} + +template +static int test_size() +{ + int Error = 0; + + Error += sizeof(typename genType::value_type) == sizeof(genType) ? 0 : 1; + Error += genType().length() == 1 ? 0 : 1; + Error += genType::length() == 1 ? 0 : 1; + + return Error; +} + +template +static int test_relational() +{ + int Error = 0; + + genType const A(1); + genType const B(1); + genType const C(0); + + Error += A == B ? 0 : 1; + Error += A != C ? 0 : 1; + Error += all(equal(A, B)) ? 0 : 1; + Error += any(notEqual(A, C)) ? 0 : 1; + + return Error; +} + +template +static int test_constexpr() +{ +# if GLM_CONFIG_CONSTEXP == GLM_ENABLE + static_assert(genType::length() == 1, "GLM: Failed constexpr"); + static_assert(genType(1)[0] == 1, "GLM: Failed constexpr"); + static_assert(genType(1) == genType(1), "GLM: Failed constexpr"); + static_assert(genType(1) != genType(0), "GLM: Failed constexpr"); +# endif + + return 0; +} + +int main() +{ + int Error = 0; + + Error += test_operators(); + Error += test_operators(); + Error += test_operators(); + Error += test_operators(); + Error += test_operators(); + + Error += test_ctor(); + Error += test_ctor(); + Error += test_ctor(); + Error += test_ctor(); + Error += test_ctor(); + + Error += test_size(); + Error += test_size(); + Error += test_size(); + Error += test_size(); + Error += test_size(); + + Error += test_relational(); + Error += test_relational(); + Error += test_relational(); + Error += test_relational(); + Error += test_relational(); + + Error += test_constexpr(); + Error += test_constexpr(); + Error += test_constexpr(); + Error += test_constexpr(); + Error += test_constexpr(); + + Error += test_operators(); + Error += test_operators(); + Error += test_operators(); + Error += test_operators(); + Error += test_operators(); + + Error += test_ctor(); + Error += test_ctor(); + Error += test_ctor(); + Error += test_ctor(); + Error += test_ctor(); + + Error += test_size(); + Error += test_size(); + Error += test_size(); + Error += test_size(); + Error += test_size(); + + Error += test_relational(); + Error += test_relational(); + Error += test_relational(); + Error += test_relational(); + Error += test_relational(); + + Error += test_constexpr(); + Error += test_constexpr(); + Error += test_constexpr(); + Error += test_constexpr(); + Error += test_constexpr(); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_vector_packing.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_vector_packing.cpp new file mode 100644 index 0000000000000000000000000000000000000000..6deaef2c5b303638932f15a9055ea6fae7626d6c --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_vector_packing.cpp @@ -0,0 +1,58 @@ +#include +#include +#include +#include +#include +#include +#include + +int test_packUnorm() +{ + int Error = 0; + + std::vector A; + A.push_back(glm::vec2(1.0f, 0.7f)); + A.push_back(glm::vec2(0.5f, 0.1f)); + + for (std::size_t i = 0; i < A.size(); ++i) + { + glm::vec2 B(A[i]); + glm::u16vec2 C = glm::packUnorm(B); + glm::vec2 D = glm::unpackUnorm(C); + Error += glm::all(glm::equal(B, D, 1.0f / 255.f)) ? 0 : 1; + assert(!Error); + } + + return Error; +} + +int test_packSnorm() +{ + int Error = 0; + + std::vector A; + A.push_back(glm::vec2(1.0f, 0.0f)); + A.push_back(glm::vec2(-0.5f, -0.7f)); + A.push_back(glm::vec2(-0.1f, 0.1f)); + + for (std::size_t i = 0; i < A.size(); ++i) + { + glm::vec2 B(A[i]); + glm::i16vec2 C = glm::packSnorm(B); + glm::vec2 D = glm::unpackSnorm(C); + Error += glm::all(glm::equal(B, D, 1.0f / 32767.0f * 2.0f)) ? 0 : 1; + assert(!Error); + } + + return Error; +} + +int main() +{ + int Error = 0; + + Error += test_packUnorm(); + Error += test_packSnorm(); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_vector_reciprocal.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_vector_reciprocal.cpp new file mode 100644 index 0000000000000000000000000000000000000000..fa1987fddc1260f1afab9ad7716131cbfbf72847 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_vector_reciprocal.cpp @@ -0,0 +1,186 @@ +#include +#include +#include +#include + +static int test_sec() +{ + int Error = 0; + + glm::dvec1 const a = glm::sec(glm::dvec1(0.0)); + Error += glm::all(glm::equal(a, glm::dvec1(1.0), 0.01)) ? 0 : 1; + + glm::dvec1 const b = glm::sec(glm::dvec1(glm::pi() * 2.0)); + Error += glm::all(glm::equal(b, glm::dvec1(1.0), 0.01)) ? 0 : 1; + + glm::dvec1 const c = glm::sec(glm::dvec1(glm::pi() * -2.0)); + Error += glm::all(glm::equal(c, glm::dvec1(1.0), 0.01)) ? 0 : 1; + + glm::dvec1 const d = glm::sec(glm::dvec1(glm::pi() * 1.0)); + Error += glm::all(glm::equal(d, -glm::dvec1(1.0), 0.01)) ? 0 : 1; + + glm::dvec1 const e = glm::sec(glm::dvec1(glm::pi() * -1.0)); + Error += glm::all(glm::equal(e, -glm::dvec1(1.0), 0.01)) ? 0 : 1; + + return Error; +} + +static int test_csc() +{ + int Error = 0; + + glm::dvec1 const a = glm::csc(glm::dvec1(glm::pi() * 0.5)); + Error += glm::all(glm::equal(a, glm::dvec1(1.0), 0.01)) ? 0 : 1; + + glm::dvec1 const b = glm::csc(glm::dvec1(glm::pi() * -0.5)); + Error += glm::all(glm::equal(b, glm::dvec1(-1.0), 0.01)) ? 0 : 1; + + return Error; +} + +static int test_cot() +{ + int Error = 0; + + glm::dvec1 const a = glm::cot(glm::dvec1(glm::pi() * 0.5)); + Error += glm::all(glm::equal(a, glm::dvec1(0.0), 0.01)) ? 0 : 1; + + glm::dvec1 const b = glm::cot(glm::dvec1(glm::pi() * -0.5)); + Error += glm::all(glm::equal(b, glm::dvec1(0.0), 0.01)) ? 0 : 1; + + return Error; +} + +static int test_asec() +{ + int Error = 0; + + Error += glm::all(glm::equal(glm::asec(glm::dvec1(100000.0)), glm::dvec1(glm::pi() * 0.5), 0.01)) ? 0 : 1; + Error += glm::all(glm::equal(glm::asec(glm::dvec1(-100000.0)), glm::dvec1(glm::pi() * 0.5), 0.01)) ? 0 : 1; + + return Error; +} + +static int test_acsc() +{ + int Error = 0; + + Error += glm::all(glm::equal(glm::acsc(glm::dvec1(100000.0)), glm::dvec1(0.0), 0.01)) ? 0 : 1; + Error += glm::all(glm::equal(glm::acsc(glm::dvec1(-100000.0)), glm::dvec1(0.0), 0.01)) ? 0 : 1; + + return Error; +} + +static int test_acot() +{ + int Error = 0; + + Error += glm::all(glm::equal(glm::acot(glm::dvec1(100000.0)), glm::dvec1(0.0), 0.01)) ? 0 : 1; + Error += glm::all(glm::equal(glm::acot(glm::dvec1(-100000.0)), glm::dvec1(glm::pi()), 0.01)) ? 0 : 1; + Error += glm::all(glm::equal(glm::acot(glm::dvec1(0.0)), glm::dvec1(glm::pi() * 0.5), 0.01)) ? 0 : 1; + + return Error; +} + +static int test_sech() +{ + int Error = 0; + + Error += glm::all(glm::equal(glm::sech(glm::dvec1(100000.0)), glm::dvec1(0.0), 0.01)) ? 0 : 1; + Error += glm::all(glm::equal(glm::sech(glm::dvec1(-100000.0)), glm::dvec1(0.0), 0.01)) ? 0 : 1; + Error += glm::all(glm::equal(glm::sech(glm::dvec1(0.0)), glm::dvec1(1.0), 0.01)) ? 0 : 1; + + return Error; +} + +static int test_csch() +{ + int Error = 0; + + Error += glm::all(glm::equal(glm::csch(glm::dvec1(100000.0)), glm::dvec1(0.0), 0.01)) ? 0 : 1; + Error += glm::all(glm::equal(glm::csch(glm::dvec1(-100000.0)), glm::dvec1(0.0), 0.01)) ? 0 : 1; + + return Error; +} + +static int test_coth() +{ + int Error = 0; + + glm::dvec1 const a = glm::coth(glm::dvec1(100.0)); + Error += glm::all(glm::equal(a, glm::dvec1(1.0), 0.01)) ? 0 : 1; + + glm::dvec1 const b = glm::coth(glm::dvec1(-100.0)); + Error += glm::all(glm::equal(b, glm::dvec1(-1.0), 0.01)) ? 0 : 1; + + return Error; +} + +static int test_asech() +{ + int Error = 0; + + glm::dvec1 const a = glm::asech(glm::dvec1(1.0)); + Error += glm::all(glm::equal(a, glm::dvec1(0.0), 0.01)) ? 0 : 1; + + return Error; +} + +static int test_acsch() +{ + int Error = 0; + + glm::dvec1 const a(glm::acsch(glm::dvec1(0.01))); + Error += a.x > 1.0 ? 0 : 1; + + glm::dvec1 const b(glm::acsch(glm::dvec1(-0.01))); + Error += b.x < -1.0 ? 0 : 1; + + Error += glm::all(glm::equal(glm::acsch(glm::dvec1(100.0)), glm::dvec1(0.0), 0.01)) ? 0 : 1; + Error += glm::all(glm::equal(glm::acsch(glm::dvec1(-100.0)), glm::dvec1(0.0), 0.01)) ? 0 : 1; + + return Error; +} + +static int test_acoth() +{ + int Error = 0; + + glm::dvec1 const a = glm::acoth(glm::dvec1(1.00001)); + Error += a.x > 6.0 ? 0 : 1; + + glm::dvec1 const b = glm::acoth(glm::dvec1(-1.00001)); + Error += b.x < -6.0 ? 0 : 1; + + glm::dvec1 const c = glm::acoth(glm::dvec1(10000.0)); + Error += glm::all(glm::equal(c, glm::dvec1(0.0), 0.01)) ? 0 : 1; + + glm::dvec1 const d = glm::acoth(glm::dvec1(-10000.0)); + Error += glm::all(glm::equal(d, glm::dvec1(0.0), 0.01)) ? 0 : 1; + + return Error; +} + + +int main() +{ + int Error = 0; + + Error += test_sec(); + Error += test_csc(); + Error += test_cot(); + + Error += test_asec(); + Error += test_acsc(); + Error += test_acot(); + + Error += test_sech(); + Error += test_csch(); + Error += test_coth(); + + Error += test_asech(); + Error += test_acsch(); + Error += test_acoth(); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_vector_relational.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_vector_relational.cpp new file mode 100644 index 0000000000000000000000000000000000000000..a6a8ecc728ac18aba75ec340289f1e0fbf446bbc --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_vector_relational.cpp @@ -0,0 +1,205 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +template +static int test_equal() +{ + typedef typename vecType::value_type valType; + + valType const A = static_cast(1.01f); + valType const B = static_cast(1.02f); + valType const Epsilon1 = static_cast(0.1f); + valType const Epsilon2 = static_cast(0.001f); + + int Error = 0; + + Error += glm::all(glm::equal(vecType(A), vecType(B), Epsilon1)) ? 0 : 1; + Error += glm::all(glm::equal(vecType(A), vecType(B), vecType(Epsilon1))) ? 0 : 1; + + Error += !glm::any(glm::equal(vecType(A), vecType(B), Epsilon2)) ? 0 : 1; + Error += !glm::any(glm::equal(vecType(A), vecType(B), vecType(Epsilon2))) ? 0 : 1; + + return Error; +} + +template +static int test_notEqual() +{ + typedef typename vecType::value_type valType; + + valType const A = static_cast(1.01f); + valType const B = static_cast(1.02f); + valType const Epsilon1 = static_cast(0.1f); + valType const Epsilon2 = static_cast(0.001f); + + int Error = 0; + + Error += glm::all(glm::notEqual(vecType(A), vecType(B), Epsilon2)) ? 0 : 1; + Error += glm::all(glm::notEqual(vecType(A), vecType(B), vecType(Epsilon2))) ? 0 : 1; + + Error += !glm::any(glm::notEqual(vecType(A), vecType(B), Epsilon1)) ? 0 : 1; + Error += !glm::any(glm::notEqual(vecType(A), vecType(B), vecType(Epsilon1))) ? 0 : 1; + + return Error; +} + +template +static int test_constexpr() +{ +# if GLM_CONFIG_CONSTEXP == GLM_ENABLE + static_assert(glm::all(glm::equal(genType(static_cast(1.01f)), genType(static_cast(1.02f)), static_cast(0.1f))), "GLM: Failed constexpr"); +# endif + + return 0; +} + +template +static int test_equal_ulps() +{ + typedef glm::vec<4, T, glm::defaultp> vec4; + + T const One(1); + vec4 const Ones(1); + + int Error = 0; + + T const ULP1Plus = glm::nextFloat(One); + Error += glm::all(glm::equal(Ones, vec4(ULP1Plus), 1)) ? 0 : 1; + + T const ULP2Plus = glm::nextFloat(ULP1Plus); + Error += !glm::all(glm::equal(Ones, vec4(ULP2Plus), 1)) ? 0 : 1; + + T const ULP1Minus = glm::prevFloat(One); + Error += glm::all(glm::equal(Ones, vec4(ULP1Minus), 1)) ? 0 : 1; + + T const ULP2Minus = glm::prevFloat(ULP1Minus); + Error += !glm::all(glm::equal(Ones, vec4(ULP2Minus), 1)) ? 0 : 1; + + return Error; +} + +template +static int test_notEqual_ulps() +{ + typedef glm::vec<4, T, glm::defaultp> vec4; + + T const One(1); + vec4 const Ones(1); + + int Error = 0; + + T const ULP1Plus = glm::nextFloat(One); + Error += !glm::all(glm::notEqual(Ones, vec4(ULP1Plus), 1)) ? 0 : 1; + + T const ULP2Plus = glm::nextFloat(ULP1Plus); + Error += glm::all(glm::notEqual(Ones, vec4(ULP2Plus), 1)) ? 0 : 1; + + T const ULP1Minus = glm::prevFloat(One); + Error += !glm::all(glm::notEqual(Ones, vec4(ULP1Minus), 1)) ? 0 : 1; + + T const ULP2Minus = glm::prevFloat(ULP1Minus); + Error += glm::all(glm::notEqual(Ones, vec4(ULP2Minus), 1)) ? 0 : 1; + + return Error; +} + +int main() +{ + int Error = 0; + + Error += test_equal_ulps(); + Error += test_equal_ulps(); + Error += test_notEqual_ulps(); + Error += test_notEqual_ulps(); + + Error += test_equal(); + Error += test_equal(); + Error += test_equal(); + Error += test_equal(); + Error += test_equal(); + Error += test_equal(); + Error += test_equal(); + Error += test_equal(); + Error += test_equal(); + Error += test_equal(); + Error += test_equal(); + Error += test_equal(); + Error += test_equal(); + Error += test_equal(); + Error += test_equal(); + Error += test_equal(); + + Error += test_equal(); + Error += test_equal(); + Error += test_equal(); + Error += test_equal(); + Error += test_equal(); + Error += test_equal(); + Error += test_equal(); + Error += test_equal(); + Error += test_equal(); + Error += test_equal(); + Error += test_equal(); + Error += test_equal(); + Error += test_equal(); + Error += test_equal(); + Error += test_equal(); + Error += test_equal(); + + Error += test_notEqual(); + Error += test_notEqual(); + Error += test_notEqual(); + Error += test_notEqual(); + Error += test_notEqual(); + Error += test_notEqual(); + Error += test_notEqual(); + Error += test_notEqual(); + Error += test_notEqual(); + Error += test_notEqual(); + Error += test_notEqual(); + Error += test_notEqual(); + Error += test_notEqual(); + Error += test_notEqual(); + Error += test_notEqual(); + Error += test_notEqual(); + + Error += test_notEqual(); + Error += test_notEqual(); + Error += test_notEqual(); + Error += test_notEqual(); + Error += test_notEqual(); + Error += test_notEqual(); + Error += test_notEqual(); + Error += test_notEqual(); + Error += test_notEqual(); + Error += test_notEqual(); + Error += test_notEqual(); + Error += test_notEqual(); + Error += test_notEqual(); + Error += test_notEqual(); + Error += test_notEqual(); + Error += test_notEqual(); + + Error += test_constexpr(); + Error += test_constexpr(); + Error += test_constexpr(); + Error += test_constexpr(); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_vector_uint1_sized.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_vector_uint1_sized.cpp new file mode 100644 index 0000000000000000000000000000000000000000..7ccdeb557bf38d244eebf0d77c9e593f592ea10c --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_vector_uint1_sized.cpp @@ -0,0 +1,41 @@ +#include + +#if GLM_HAS_STATIC_ASSERT + static_assert(sizeof(glm::u8vec1) == 1, "uint8 size isn't 1 byte on this platform"); + static_assert(sizeof(glm::u16vec1) == 2, "uint16 size isn't 2 bytes on this platform"); + static_assert(sizeof(glm::u32vec1) == 4, "uint32 size isn't 4 bytes on this platform"); + static_assert(sizeof(glm::u64vec1) == 8, "uint64 size isn't 8 bytes on this platform"); +#endif + +static int test_size() +{ + int Error = 0; + + Error += sizeof(glm::u8vec1) == 1 ? 0 : 1; + Error += sizeof(glm::u16vec1) == 2 ? 0 : 1; + Error += sizeof(glm::u32vec1) == 4 ? 0 : 1; + Error += sizeof(glm::u64vec1) == 8 ? 0 : 1; + + return Error; +} + +static int test_comp() +{ + int Error = 0; + + Error += sizeof(glm::u8vec1) < sizeof(glm::u16vec1) ? 0 : 1; + Error += sizeof(glm::u16vec1) < sizeof(glm::u32vec1) ? 0 : 1; + Error += sizeof(glm::u32vec1) < sizeof(glm::u64vec1) ? 0 : 1; + + return Error; +} + +int main() +{ + int Error = 0; + + Error += test_size(); + Error += test_comp(); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_vector_uint2_sized.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_vector_uint2_sized.cpp new file mode 100644 index 0000000000000000000000000000000000000000..7b1b328a23d91e920307d206a92866703835f8d1 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_vector_uint2_sized.cpp @@ -0,0 +1,41 @@ +#include + +#if GLM_HAS_STATIC_ASSERT +static_assert(sizeof(glm::u8vec2) == 2, "int8 size isn't 1 byte on this platform"); +static_assert(sizeof(glm::u16vec2) == 4, "int16 size isn't 2 bytes on this platform"); +static_assert(sizeof(glm::u32vec2) == 8, "int32 size isn't 4 bytes on this platform"); +static_assert(sizeof(glm::u64vec2) == 16, "int64 size isn't 8 bytes on this platform"); +#endif + +static int test_size() +{ + int Error = 0; + + Error += sizeof(glm::u8vec2) == 2 ? 0 : 1; + Error += sizeof(glm::u16vec2) == 4 ? 0 : 1; + Error += sizeof(glm::u32vec2) == 8 ? 0 : 1; + Error += sizeof(glm::u64vec2) == 16 ? 0 : 1; + + return Error; +} + +static int test_comp() +{ + int Error = 0; + + Error += sizeof(glm::u8vec2) < sizeof(glm::u16vec2) ? 0 : 1; + Error += sizeof(glm::u16vec2) < sizeof(glm::u32vec2) ? 0 : 1; + Error += sizeof(glm::u32vec2) < sizeof(glm::u64vec2) ? 0 : 1; + + return Error; +} + +int main() +{ + int Error = 0; + + Error += test_size(); + Error += test_comp(); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_vector_uint3_sized.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_vector_uint3_sized.cpp new file mode 100644 index 0000000000000000000000000000000000000000..abcd78cd3b5ba33eebe4d2e7950f25d4d4aeb50a --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_vector_uint3_sized.cpp @@ -0,0 +1,41 @@ +#include + +#if GLM_HAS_STATIC_ASSERT +static_assert(sizeof(glm::u8vec3) == 3, "int8 size isn't 1 byte on this platform"); +static_assert(sizeof(glm::u16vec3) == 6, "int16 size isn't 2 bytes on this platform"); +static_assert(sizeof(glm::u32vec3) == 12, "int32 size isn't 4 bytes on this platform"); +static_assert(sizeof(glm::u64vec3) == 24, "int64 size isn't 8 bytes on this platform"); +#endif + +static int test_size() +{ + int Error = 0; + + Error += sizeof(glm::u8vec3) == 3 ? 0 : 1; + Error += sizeof(glm::u16vec3) == 6 ? 0 : 1; + Error += sizeof(glm::u32vec3) == 12 ? 0 : 1; + Error += sizeof(glm::u64vec3) == 24 ? 0 : 1; + + return Error; +} + +static int test_comp() +{ + int Error = 0; + + Error += sizeof(glm::u8vec3) < sizeof(glm::u16vec3) ? 0 : 1; + Error += sizeof(glm::u16vec3) < sizeof(glm::u32vec3) ? 0 : 1; + Error += sizeof(glm::u32vec3) < sizeof(glm::u64vec3) ? 0 : 1; + + return Error; +} + +int main() +{ + int Error = 0; + + Error += test_size(); + Error += test_comp(); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_vector_uint4_sized.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_vector_uint4_sized.cpp new file mode 100644 index 0000000000000000000000000000000000000000..4afbb1d2c91d5c2cb0181296db90a259a5ae0ab6 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_vector_uint4_sized.cpp @@ -0,0 +1,41 @@ +#include + +#if GLM_HAS_STATIC_ASSERT +static_assert(sizeof(glm::u8vec4) == 4, "int8 size isn't 1 byte on this platform"); +static_assert(sizeof(glm::u16vec4) == 8, "int16 size isn't 2 bytes on this platform"); +static_assert(sizeof(glm::u32vec4) == 16, "int32 size isn't 4 bytes on this platform"); +static_assert(sizeof(glm::u64vec4) == 32, "int64 size isn't 8 bytes on this platform"); +#endif + +static int test_size() +{ + int Error = 0; + + Error += sizeof(glm::u8vec4) == 4 ? 0 : 1; + Error += sizeof(glm::u16vec4) == 8 ? 0 : 1; + Error += sizeof(glm::u32vec4) == 16 ? 0 : 1; + Error += sizeof(glm::u64vec4) == 32 ? 0 : 1; + + return Error; +} + +static int test_comp() +{ + int Error = 0; + + Error += sizeof(glm::u8vec4) < sizeof(glm::u16vec4) ? 0 : 1; + Error += sizeof(glm::u16vec4) < sizeof(glm::u32vec4) ? 0 : 1; + Error += sizeof(glm::u32vec4) < sizeof(glm::u64vec4) ? 0 : 1; + + return Error; +} + +int main() +{ + int Error = 0; + + Error += test_size(); + Error += test_comp(); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_vector_ulp.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_vector_ulp.cpp new file mode 100644 index 0000000000000000000000000000000000000000..c6c8eb8a6de88d3198cc1a277e83aea970aff8c8 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/ext/ext_vector_ulp.cpp @@ -0,0 +1,99 @@ +#include +#include +#include +#include +#include + +static int test_ulp_float_dist() +{ + int Error = 0; + + glm::vec4 const A(1.0f); + + glm::vec4 const B = glm::nextFloat(A); + Error += glm::any(glm::notEqual(A, B, 0)) ? 0 : 1; + glm::vec4 const C = glm::prevFloat(B); + Error += glm::all(glm::equal(A, C, 0)) ? 0 : 1; + + glm::ivec4 const D = glm::floatDistance(A, B); + Error += D == glm::ivec4(1) ? 0 : 1; + glm::ivec4 const E = glm::floatDistance(A, C); + Error += E == glm::ivec4(0) ? 0 : 1; + + return Error; +} + +static int test_ulp_float_step() +{ + int Error = 0; + + glm::vec4 const A(1.0f); + + for(int i = 10; i < 1000; i *= 10) + { + glm::vec4 const B = glm::nextFloat(A, i); + Error += glm::any(glm::notEqual(A, B, 0)) ? 0 : 1; + glm::vec4 const C = glm::prevFloat(B, i); + Error += glm::all(glm::equal(A, C, 0)) ? 0 : 1; + + glm::ivec4 const D = glm::floatDistance(A, B); + Error += D == glm::ivec4(i) ? 0 : 1; + glm::ivec4 const E = glm::floatDistance(A, C); + Error += E == glm::ivec4(0) ? 0 : 1; + } + + return Error; +} + +static int test_ulp_double_dist() +{ + int Error = 0; + + glm::dvec4 const A(1.0); + + glm::dvec4 const B = glm::nextFloat(A); + Error += glm::any(glm::notEqual(A, B, 0)) ? 0 : 1; + glm::dvec4 const C = glm::prevFloat(B); + Error += glm::all(glm::equal(A, C, 0)) ? 0 : 1; + + glm::ivec4 const D(glm::floatDistance(A, B)); + Error += D == glm::ivec4(1) ? 0 : 1; + glm::ivec4 const E = glm::floatDistance(A, C); + Error += E == glm::ivec4(0) ? 0 : 1; + + return Error; +} + +static int test_ulp_double_step() +{ + int Error = 0; + + glm::dvec4 const A(1.0); + + for(int i = 10; i < 1000; i *= 10) + { + glm::dvec4 const B = glm::nextFloat(A, i); + Error += glm::any(glm::notEqual(A, B, 0)) ? 0 : 1; + glm::dvec4 const C = glm::prevFloat(B, i); + Error += glm::all(glm::equal(A, C, 0)) ? 0 : 1; + + glm::ivec4 const D(glm::floatDistance(A, B)); + Error += D == glm::ivec4(i) ? 0 : 1; + glm::ivec4 const E(glm::floatDistance(A, C)); + Error += E == glm::ivec4(0) ? 0 : 1; + } + + return Error; +} + +int main() +{ + int Error = 0; + + Error += test_ulp_float_dist(); + Error += test_ulp_float_step(); + Error += test_ulp_double_dist(); + Error += test_ulp_double_step(); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/glm.cppcheck b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/glm.cppcheck new file mode 100644 index 0000000000000000000000000000000000000000..b4236b3c42ee151fa460fdb77ea975f3331cd490 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/glm.cppcheck @@ -0,0 +1,6 @@ + + + + + + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtc/CMakeLists.txt b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtc/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..8af61f5b7733f287faf57a187b36843c14655ffc --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtc/CMakeLists.txt @@ -0,0 +1,20 @@ +glmCreateTestGTC(gtc_bitfield) +glmCreateTestGTC(gtc_color_space) +glmCreateTestGTC(gtc_constants) +glmCreateTestGTC(gtc_epsilon) +glmCreateTestGTC(gtc_integer) +glmCreateTestGTC(gtc_matrix_access) +glmCreateTestGTC(gtc_matrix_integer) +glmCreateTestGTC(gtc_matrix_inverse) +glmCreateTestGTC(gtc_matrix_transform) +glmCreateTestGTC(gtc_noise) +glmCreateTestGTC(gtc_packing) +glmCreateTestGTC(gtc_quaternion) +glmCreateTestGTC(gtc_random) +glmCreateTestGTC(gtc_round) +glmCreateTestGTC(gtc_reciprocal) +glmCreateTestGTC(gtc_type_aligned) +glmCreateTestGTC(gtc_type_precision) +glmCreateTestGTC(gtc_type_ptr) +glmCreateTestGTC(gtc_ulp) +glmCreateTestGTC(gtc_vec1) diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtc/gtc_bitfield.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtc/gtc_bitfield.cpp new file mode 100644 index 0000000000000000000000000000000000000000..436a88a84d8c17b09290ca53c9f363ce5e4c9925 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtc/gtc_bitfield.cpp @@ -0,0 +1,936 @@ +#include +#include +#include +#include +#include +#include +#include + +namespace mask +{ + template + struct type + { + genType Value; + genType Return; + }; + + inline int mask_zero(int Bits) + { + return ~((~0) << Bits); + } + + inline int mask_mix(int Bits) + { + return Bits >= sizeof(int) * 8 ? 0xffffffff : (static_cast(1) << Bits) - static_cast(1); + } + + inline int mask_half(int Bits) + { + // We do the shift in two steps because 1 << 32 on an int is undefined. + + int const Half = Bits >> 1; + int const Fill = ~0; + int const ShiftHaft = (Fill << Half); + int const Rest = Bits - Half; + int const Reversed = ShiftHaft << Rest; + + return ~Reversed; + } + + inline int mask_loop(int Bits) + { + int Mask = 0; + for(int Bit = 0; Bit < Bits; ++Bit) + Mask |= (static_cast(1) << Bit); + return Mask; + } + + int perf() + { + int const Count = 100000000; + + std::clock_t Timestamp1 = std::clock(); + + { + std::vector Mask; + Mask.resize(Count); + for(int i = 0; i < Count; ++i) + Mask[i] = mask_mix(i % 32); + } + + std::clock_t Timestamp2 = std::clock(); + + { + std::vector Mask; + Mask.resize(Count); + for(int i = 0; i < Count; ++i) + Mask[i] = mask_loop(i % 32); + } + + std::clock_t Timestamp3 = std::clock(); + + { + std::vector Mask; + Mask.resize(Count); + for(int i = 0; i < Count; ++i) + Mask[i] = glm::mask(i % 32); + } + + std::clock_t Timestamp4 = std::clock(); + + { + std::vector Mask; + Mask.resize(Count); + for(int i = 0; i < Count; ++i) + Mask[i] = mask_zero(i % 32); + } + + std::clock_t Timestamp5 = std::clock(); + + { + std::vector Mask; + Mask.resize(Count); + for(int i = 0; i < Count; ++i) + Mask[i] = mask_half(i % 32); + } + + std::clock_t Timestamp6 = std::clock(); + + std::clock_t TimeMix = Timestamp2 - Timestamp1; + std::clock_t TimeLoop = Timestamp3 - Timestamp2; + std::clock_t TimeDefault = Timestamp4 - Timestamp3; + std::clock_t TimeZero = Timestamp5 - Timestamp4; + std::clock_t TimeHalf = Timestamp6 - Timestamp5; + + std::printf("mask[mix]: %d\n", static_cast(TimeMix)); + std::printf("mask[loop]: %d\n", static_cast(TimeLoop)); + std::printf("mask[default]: %d\n", static_cast(TimeDefault)); + std::printf("mask[zero]: %d\n", static_cast(TimeZero)); + std::printf("mask[half]: %d\n", static_cast(TimeHalf)); + + return TimeDefault < TimeLoop ? 0 : 1; + } + + int test_uint() + { + type const Data[] = + { + { 0, 0x00000000}, + { 1, 0x00000001}, + { 2, 0x00000003}, + { 3, 0x00000007}, + {31, 0x7fffffff}, + {32, 0xffffffff} + }; + + int Error = 0; +/* mask_zero is sadly not a correct code + for(std::size_t i = 0; i < sizeof(Data) / sizeof(type); ++i) + { + int Result = mask_zero(Data[i].Value); + Error += Data[i].Return == Result ? 0 : 1; + } +*/ + for(std::size_t i = 0; i < sizeof(Data) / sizeof(type); ++i) + { + int Result = mask_mix(Data[i].Value); + Error += Data[i].Return == Result ? 0 : 1; + } + + for(std::size_t i = 0; i < sizeof(Data) / sizeof(type); ++i) + { + int Result = mask_half(Data[i].Value); + Error += Data[i].Return == Result ? 0 : 1; + } + + for(std::size_t i = 0; i < sizeof(Data) / sizeof(type); ++i) + { + int Result = mask_loop(Data[i].Value); + Error += Data[i].Return == Result ? 0 : 1; + } + + for(std::size_t i = 0; i < sizeof(Data) / sizeof(type); ++i) + { + int Result = glm::mask(Data[i].Value); + Error += Data[i].Return == Result ? 0 : 1; + } + + return Error; + } + + int test_uvec4() + { + type const Data[] = + { + {glm::ivec4( 0), glm::ivec4(0x00000000)}, + {glm::ivec4( 1), glm::ivec4(0x00000001)}, + {glm::ivec4( 2), glm::ivec4(0x00000003)}, + {glm::ivec4( 3), glm::ivec4(0x00000007)}, + {glm::ivec4(31), glm::ivec4(0x7fffffff)}, + {glm::ivec4(32), glm::ivec4(0xffffffff)} + }; + + int Error(0); + + for(std::size_t i = 0, n = sizeof(Data) / sizeof(type); i < n; ++i) + { + glm::ivec4 Result = glm::mask(Data[i].Value); + Error += glm::all(glm::equal(Data[i].Return, Result)) ? 0 : 1; + } + + return Error; + } + + int test() + { + int Error(0); + + Error += test_uint(); + Error += test_uvec4(); + + return Error; + } +}//namespace mask + +namespace bitfieldInterleave3 +{ + template + inline RET refBitfieldInterleave(PARAM x, PARAM y, PARAM z) + { + RET Result = 0; + for(RET i = 0; i < sizeof(PARAM) * 8; ++i) + { + Result |= ((RET(x) & (RET(1U) << i)) << ((i << 1) + 0)); + Result |= ((RET(y) & (RET(1U) << i)) << ((i << 1) + 1)); + Result |= ((RET(z) & (RET(1U) << i)) << ((i << 1) + 2)); + } + return Result; + } + + int test() + { + int Error(0); + + glm::uint16 x_max = 1 << 11; + glm::uint16 y_max = 1 << 11; + glm::uint16 z_max = 1 << 11; + + for(glm::uint16 z = 0; z < z_max; z += 27) + for(glm::uint16 y = 0; y < y_max; y += 27) + for(glm::uint16 x = 0; x < x_max; x += 27) + { + glm::uint64 ResultA = refBitfieldInterleave(x, y, z); + glm::uint64 ResultB = glm::bitfieldInterleave(x, y, z); + Error += ResultA == ResultB ? 0 : 1; + } + + return Error; + } +} + +namespace bitfieldInterleave4 +{ + template + inline RET loopBitfieldInterleave(PARAM x, PARAM y, PARAM z, PARAM w) + { + RET const v[4] = {x, y, z, w}; + RET Result = 0; + for(RET i = 0; i < sizeof(PARAM) * 8; i++) + { + Result |= ((((v[0] >> i) & 1U)) << ((i << 2) + 0)); + Result |= ((((v[1] >> i) & 1U)) << ((i << 2) + 1)); + Result |= ((((v[2] >> i) & 1U)) << ((i << 2) + 2)); + Result |= ((((v[3] >> i) & 1U)) << ((i << 2) + 3)); + } + return Result; + } + + int test() + { + int Error(0); + + glm::uint16 x_max = 1 << 11; + glm::uint16 y_max = 1 << 11; + glm::uint16 z_max = 1 << 11; + glm::uint16 w_max = 1 << 11; + + for(glm::uint16 w = 0; w < w_max; w += 27) + for(glm::uint16 z = 0; z < z_max; z += 27) + for(glm::uint16 y = 0; y < y_max; y += 27) + for(glm::uint16 x = 0; x < x_max; x += 27) + { + glm::uint64 ResultA = loopBitfieldInterleave(x, y, z, w); + glm::uint64 ResultB = glm::bitfieldInterleave(x, y, z, w); + Error += ResultA == ResultB ? 0 : 1; + } + + return Error; + } +} + +namespace bitfieldInterleave +{ + inline glm::uint64 fastBitfieldInterleave(glm::uint32 x, glm::uint32 y) + { + glm::uint64 REG1; + glm::uint64 REG2; + + REG1 = x; + REG1 = ((REG1 << 16) | REG1) & glm::uint64(0x0000FFFF0000FFFF); + REG1 = ((REG1 << 8) | REG1) & glm::uint64(0x00FF00FF00FF00FF); + REG1 = ((REG1 << 4) | REG1) & glm::uint64(0x0F0F0F0F0F0F0F0F); + REG1 = ((REG1 << 2) | REG1) & glm::uint64(0x3333333333333333); + REG1 = ((REG1 << 1) | REG1) & glm::uint64(0x5555555555555555); + + REG2 = y; + REG2 = ((REG2 << 16) | REG2) & glm::uint64(0x0000FFFF0000FFFF); + REG2 = ((REG2 << 8) | REG2) & glm::uint64(0x00FF00FF00FF00FF); + REG2 = ((REG2 << 4) | REG2) & glm::uint64(0x0F0F0F0F0F0F0F0F); + REG2 = ((REG2 << 2) | REG2) & glm::uint64(0x3333333333333333); + REG2 = ((REG2 << 1) | REG2) & glm::uint64(0x5555555555555555); + + return REG1 | (REG2 << 1); + } + + inline glm::uint64 interleaveBitfieldInterleave(glm::uint32 x, glm::uint32 y) + { + glm::uint64 REG1; + glm::uint64 REG2; + + REG1 = x; + REG2 = y; + + REG1 = ((REG1 << 16) | REG1) & glm::uint64(0x0000FFFF0000FFFF); + REG2 = ((REG2 << 16) | REG2) & glm::uint64(0x0000FFFF0000FFFF); + + REG1 = ((REG1 << 8) | REG1) & glm::uint64(0x00FF00FF00FF00FF); + REG2 = ((REG2 << 8) | REG2) & glm::uint64(0x00FF00FF00FF00FF); + + REG1 = ((REG1 << 4) | REG1) & glm::uint64(0x0F0F0F0F0F0F0F0F); + REG2 = ((REG2 << 4) | REG2) & glm::uint64(0x0F0F0F0F0F0F0F0F); + + REG1 = ((REG1 << 2) | REG1) & glm::uint64(0x3333333333333333); + REG2 = ((REG2 << 2) | REG2) & glm::uint64(0x3333333333333333); + + REG1 = ((REG1 << 1) | REG1) & glm::uint64(0x5555555555555555); + REG2 = ((REG2 << 1) | REG2) & glm::uint64(0x5555555555555555); + + return REG1 | (REG2 << 1); + } +/* + inline glm::uint64 loopBitfieldInterleave(glm::uint32 x, glm::uint32 y) + { + static glm::uint64 const Mask[5] = + { + 0x5555555555555555, + 0x3333333333333333, + 0x0F0F0F0F0F0F0F0F, + 0x00FF00FF00FF00FF, + 0x0000FFFF0000FFFF + }; + + glm::uint64 REG1 = x; + glm::uint64 REG2 = y; + for(int i = 4; i >= 0; --i) + { + REG1 = ((REG1 << (1 << i)) | REG1) & Mask[i]; + REG2 = ((REG2 << (1 << i)) | REG2) & Mask[i]; + } + + return REG1 | (REG2 << 1); + } +*/ +#if GLM_ARCH & GLM_ARCH_SSE2_BIT + inline glm::uint64 sseBitfieldInterleave(glm::uint32 x, glm::uint32 y) + { + __m128i const Array = _mm_set_epi32(0, y, 0, x); + + __m128i const Mask4 = _mm_set1_epi32(0x0000FFFF); + __m128i const Mask3 = _mm_set1_epi32(0x00FF00FF); + __m128i const Mask2 = _mm_set1_epi32(0x0F0F0F0F); + __m128i const Mask1 = _mm_set1_epi32(0x33333333); + __m128i const Mask0 = _mm_set1_epi32(0x55555555); + + __m128i Reg1; + __m128i Reg2; + + // REG1 = x; + // REG2 = y; + Reg1 = _mm_load_si128(&Array); + + //REG1 = ((REG1 << 16) | REG1) & glm::uint64(0x0000FFFF0000FFFF); + //REG2 = ((REG2 << 16) | REG2) & glm::uint64(0x0000FFFF0000FFFF); + Reg2 = _mm_slli_si128(Reg1, 2); + Reg1 = _mm_or_si128(Reg2, Reg1); + Reg1 = _mm_and_si128(Reg1, Mask4); + + //REG1 = ((REG1 << 8) | REG1) & glm::uint64(0x00FF00FF00FF00FF); + //REG2 = ((REG2 << 8) | REG2) & glm::uint64(0x00FF00FF00FF00FF); + Reg2 = _mm_slli_si128(Reg1, 1); + Reg1 = _mm_or_si128(Reg2, Reg1); + Reg1 = _mm_and_si128(Reg1, Mask3); + + //REG1 = ((REG1 << 4) | REG1) & glm::uint64(0x0F0F0F0F0F0F0F0F); + //REG2 = ((REG2 << 4) | REG2) & glm::uint64(0x0F0F0F0F0F0F0F0F); + Reg2 = _mm_slli_epi32(Reg1, 4); + Reg1 = _mm_or_si128(Reg2, Reg1); + Reg1 = _mm_and_si128(Reg1, Mask2); + + //REG1 = ((REG1 << 2) | REG1) & glm::uint64(0x3333333333333333); + //REG2 = ((REG2 << 2) | REG2) & glm::uint64(0x3333333333333333); + Reg2 = _mm_slli_epi32(Reg1, 2); + Reg1 = _mm_or_si128(Reg2, Reg1); + Reg1 = _mm_and_si128(Reg1, Mask1); + + //REG1 = ((REG1 << 1) | REG1) & glm::uint64(0x5555555555555555); + //REG2 = ((REG2 << 1) | REG2) & glm::uint64(0x5555555555555555); + Reg2 = _mm_slli_epi32(Reg1, 1); + Reg1 = _mm_or_si128(Reg2, Reg1); + Reg1 = _mm_and_si128(Reg1, Mask0); + + //return REG1 | (REG2 << 1); + Reg2 = _mm_slli_epi32(Reg1, 1); + Reg2 = _mm_srli_si128(Reg2, 8); + Reg1 = _mm_or_si128(Reg1, Reg2); + + __m128i Result; + _mm_store_si128(&Result, Reg1); + return *reinterpret_cast(&Result); + } + + inline glm::uint64 sseUnalignedBitfieldInterleave(glm::uint32 x, glm::uint32 y) + { + __m128i const Array = _mm_set_epi32(0, y, 0, x); + + __m128i const Mask4 = _mm_set1_epi32(0x0000FFFF); + __m128i const Mask3 = _mm_set1_epi32(0x00FF00FF); + __m128i const Mask2 = _mm_set1_epi32(0x0F0F0F0F); + __m128i const Mask1 = _mm_set1_epi32(0x33333333); + __m128i const Mask0 = _mm_set1_epi32(0x55555555); + + __m128i Reg1; + __m128i Reg2; + + // REG1 = x; + // REG2 = y; + Reg1 = _mm_loadu_si128(&Array); + + //REG1 = ((REG1 << 16) | REG1) & glm::uint64(0x0000FFFF0000FFFF); + //REG2 = ((REG2 << 16) | REG2) & glm::uint64(0x0000FFFF0000FFFF); + Reg2 = _mm_slli_si128(Reg1, 2); + Reg1 = _mm_or_si128(Reg2, Reg1); + Reg1 = _mm_and_si128(Reg1, Mask4); + + //REG1 = ((REG1 << 8) | REG1) & glm::uint64(0x00FF00FF00FF00FF); + //REG2 = ((REG2 << 8) | REG2) & glm::uint64(0x00FF00FF00FF00FF); + Reg2 = _mm_slli_si128(Reg1, 1); + Reg1 = _mm_or_si128(Reg2, Reg1); + Reg1 = _mm_and_si128(Reg1, Mask3); + + //REG1 = ((REG1 << 4) | REG1) & glm::uint64(0x0F0F0F0F0F0F0F0F); + //REG2 = ((REG2 << 4) | REG2) & glm::uint64(0x0F0F0F0F0F0F0F0F); + Reg2 = _mm_slli_epi32(Reg1, 4); + Reg1 = _mm_or_si128(Reg2, Reg1); + Reg1 = _mm_and_si128(Reg1, Mask2); + + //REG1 = ((REG1 << 2) | REG1) & glm::uint64(0x3333333333333333); + //REG2 = ((REG2 << 2) | REG2) & glm::uint64(0x3333333333333333); + Reg2 = _mm_slli_epi32(Reg1, 2); + Reg1 = _mm_or_si128(Reg2, Reg1); + Reg1 = _mm_and_si128(Reg1, Mask1); + + //REG1 = ((REG1 << 1) | REG1) & glm::uint64(0x5555555555555555); + //REG2 = ((REG2 << 1) | REG2) & glm::uint64(0x5555555555555555); + Reg2 = _mm_slli_epi32(Reg1, 1); + Reg1 = _mm_or_si128(Reg2, Reg1); + Reg1 = _mm_and_si128(Reg1, Mask0); + + //return REG1 | (REG2 << 1); + Reg2 = _mm_slli_epi32(Reg1, 1); + Reg2 = _mm_srli_si128(Reg2, 8); + Reg1 = _mm_or_si128(Reg1, Reg2); + + __m128i Result; + _mm_store_si128(&Result, Reg1); + return *reinterpret_cast(&Result); + } +#endif//GLM_ARCH & GLM_ARCH_SSE2_BIT + + int test() + { + int Error = 0; + +/* + { + for(glm::uint32 y = 0; y < (1 << 10); ++y) + for(glm::uint32 x = 0; x < (1 << 10); ++x) + { + glm::uint64 A = glm::bitfieldInterleave(x, y); + glm::uint64 B = fastBitfieldInterleave(x, y); + //glm::uint64 C = loopBitfieldInterleave(x, y); + glm::uint64 D = interleaveBitfieldInterleave(x, y); + + assert(A == B); + //assert(A == C); + assert(A == D); + +# if GLM_ARCH & GLM_ARCH_SSE2_BIT + glm::uint64 E = sseBitfieldInterleave(x, y); + glm::uint64 F = sseUnalignedBitfieldInterleave(x, y); + assert(A == E); + assert(A == F); + + __m128i G = glm_i128_interleave(_mm_set_epi32(0, y, 0, x)); + glm::uint64 Result[2]; + _mm_storeu_si128((__m128i*)Result, G); + assert(A == Result[0]); +# endif//GLM_ARCH & GLM_ARCH_SSE2_BIT + } + } +*/ + { + for(glm::uint8 y = 0; y < 127; ++y) + for(glm::uint8 x = 0; x < 127; ++x) + { + glm::uint64 A(glm::bitfieldInterleave(glm::u8vec2(x, y))); + glm::uint64 B(glm::bitfieldInterleave(glm::u16vec2(x, y))); + glm::uint64 C(glm::bitfieldInterleave(glm::u32vec2(x, y))); + + Error += A == B ? 0 : 1; + Error += A == C ? 0 : 1; + + glm::u32vec2 const& D = glm::bitfieldDeinterleave(C); + Error += D.x == x ? 0 : 1; + Error += D.y == y ? 0 : 1; + } + } + + { + for(glm::uint8 y = 0; y < 127; ++y) + for(glm::uint8 x = 0; x < 127; ++x) + { + glm::int64 A(glm::bitfieldInterleave(glm::int8(x), glm::int8(y))); + glm::int64 B(glm::bitfieldInterleave(glm::int16(x), glm::int16(y))); + glm::int64 C(glm::bitfieldInterleave(glm::int32(x), glm::int32(y))); + + Error += A == B ? 0 : 1; + Error += A == C ? 0 : 1; + } + } + + return Error; + } + + int perf() + { + glm::uint32 x_max = 1 << 11; + glm::uint32 y_max = 1 << 10; + + // ALU + std::vector Data(x_max * y_max); + std::vector Param(x_max * y_max); + for(glm::uint32 i = 0; i < Param.size(); ++i) + Param[i] = glm::u32vec2(i % x_max, i / y_max); + + { + std::clock_t LastTime = std::clock(); + + for(std::size_t i = 0; i < Data.size(); ++i) + Data[i] = glm::bitfieldInterleave(Param[i].x, Param[i].y); + + std::clock_t Time = std::clock() - LastTime; + + std::printf("glm::bitfieldInterleave Time %d clocks\n", static_cast(Time)); + } + + { + std::clock_t LastTime = std::clock(); + + for(std::size_t i = 0; i < Data.size(); ++i) + Data[i] = fastBitfieldInterleave(Param[i].x, Param[i].y); + + std::clock_t Time = std::clock() - LastTime; + + std::printf("fastBitfieldInterleave Time %d clocks\n", static_cast(Time)); + } +/* + { + std::clock_t LastTime = std::clock(); + + for(std::size_t i = 0; i < Data.size(); ++i) + Data[i] = loopBitfieldInterleave(Param[i].x, Param[i].y); + + std::clock_t Time = std::clock() - LastTime; + + std::printf("loopBitfieldInterleave Time %d clocks\n", static_cast(Time)); + } +*/ + { + std::clock_t LastTime = std::clock(); + + for(std::size_t i = 0; i < Data.size(); ++i) + Data[i] = interleaveBitfieldInterleave(Param[i].x, Param[i].y); + + std::clock_t Time = std::clock() - LastTime; + + std::printf("interleaveBitfieldInterleave Time %d clocks\n", static_cast(Time)); + } + +# if GLM_ARCH & GLM_ARCH_SSE2_BIT + { + std::clock_t LastTime = std::clock(); + + for(std::size_t i = 0; i < Data.size(); ++i) + Data[i] = sseBitfieldInterleave(Param[i].x, Param[i].y); + + std::clock_t Time = std::clock() - LastTime; + + std::printf("sseBitfieldInterleave Time %d clocks\n", static_cast(Time)); + } + + { + std::clock_t LastTime = std::clock(); + + for(std::size_t i = 0; i < Data.size(); ++i) + Data[i] = sseUnalignedBitfieldInterleave(Param[i].x, Param[i].y); + + std::clock_t Time = std::clock() - LastTime; + + std::printf("sseUnalignedBitfieldInterleave Time %d clocks\n", static_cast(Time)); + } +# endif//GLM_ARCH & GLM_ARCH_SSE2_BIT + + { + std::clock_t LastTime = std::clock(); + + for(std::size_t i = 0; i < Data.size(); ++i) + Data[i] = glm::bitfieldInterleave(Param[i].x, Param[i].y, Param[i].x); + + std::clock_t Time = std::clock() - LastTime; + + std::printf("glm::detail::bitfieldInterleave Time %d clocks\n", static_cast(Time)); + } + +# if(GLM_ARCH & GLM_ARCH_SSE2_BIT && !(GLM_COMPILER & GLM_COMPILER_GCC)) + { + // SIMD + std::vector<__m128i> SimdData; + SimdData.resize(static_cast(x_max * y_max)); + std::vector<__m128i> SimdParam; + SimdParam.resize(static_cast(x_max * y_max)); + for(std::size_t i = 0; i < SimdParam.size(); ++i) + SimdParam[i] = _mm_set_epi32(static_cast(i % static_cast(x_max)), 0, static_cast(i / static_cast(y_max)), 0); + + std::clock_t LastTime = std::clock(); + + for(std::size_t i = 0; i < SimdData.size(); ++i) + SimdData[i] = glm_i128_interleave(SimdParam[i]); + + std::clock_t Time = std::clock() - LastTime; + + std::printf("_mm_bit_interleave_si128 Time %d clocks\n", static_cast(Time)); + } +# endif//GLM_ARCH & GLM_ARCH_SSE2_BIT + + return 0; + } +}//namespace bitfieldInterleave + +namespace bitfieldInterleave5 +{ + GLM_FUNC_QUALIFIER glm::uint16 bitfieldInterleave_u8vec2(glm::uint8 x, glm::uint8 y) + { + glm::uint32 Result = (glm::uint32(y) << 16) | glm::uint32(x); + Result = ((Result << 4) | Result) & 0x0F0F0F0F; + Result = ((Result << 2) | Result) & 0x33333333; + Result = ((Result << 1) | Result) & 0x55555555; + return static_cast((Result & 0x0000FFFF) | (Result >> 15)); + } + + GLM_FUNC_QUALIFIER glm::u8vec2 bitfieldDeinterleave_u8vec2(glm::uint16 InterleavedBitfield) + { + glm::uint32 Result(InterleavedBitfield); + Result = ((Result << 15) | Result) & 0x55555555; + Result = ((Result >> 1) | Result) & 0x33333333; + Result = ((Result >> 2) | Result) & 0x0F0F0F0F; + Result = ((Result >> 4) | Result) & 0x00FF00FF; + return glm::u8vec2(Result & 0x0000FFFF, Result >> 16); + } + + GLM_FUNC_QUALIFIER glm::uint32 bitfieldInterleave_u8vec4(glm::uint8 x, glm::uint8 y, glm::uint8 z, glm::uint8 w) + { + glm::uint64 Result = (glm::uint64(w) << 48) | (glm::uint64(z) << 32) | (glm::uint64(y) << 16) | glm::uint64(x); + Result = ((Result << 12) | Result) & 0x000F000F000F000Full; + Result = ((Result << 6) | Result) & 0x0303030303030303ull; + Result = ((Result << 3) | Result) & 0x1111111111111111ull; + + const glm::uint32 a = static_cast((Result & 0x000000000000FFFF) >> ( 0 - 0)); + const glm::uint32 b = static_cast((Result & 0x00000000FFFF0000) >> (16 - 3)); + const glm::uint32 c = static_cast((Result & 0x0000FFFF00000000) >> (32 - 6)); + const glm::uint32 d = static_cast((Result & 0xFFFF000000000000) >> (48 - 12)); + + return a | b | c | d; + } + + GLM_FUNC_QUALIFIER glm::u8vec4 bitfieldDeinterleave_u8vec4(glm::uint32 InterleavedBitfield) + { + glm::uint64 Result(InterleavedBitfield); + Result = ((Result << 15) | Result) & 0x9249249249249249ull; + Result = ((Result >> 1) | Result) & 0x30C30C30C30C30C3ull; + Result = ((Result >> 2) | Result) & 0xF00F00F00F00F00Full; + Result = ((Result >> 4) | Result) & 0x00FF0000FF0000FFull; + return glm::u8vec4( + (Result >> 0) & 0x000000000000FFFFull, + (Result >> 16) & 0x00000000FFFF0000ull, + (Result >> 32) & 0x0000FFFF00000000ull, + (Result >> 48) & 0xFFFF000000000000ull); + } + + GLM_FUNC_QUALIFIER glm::uint32 bitfieldInterleave_u16vec2(glm::uint16 x, glm::uint16 y) + { + glm::uint64 Result = (glm::uint64(y) << 32) | glm::uint64(x); + Result = ((Result << 8) | Result) & static_cast(0x00FF00FF00FF00FFull); + Result = ((Result << 4) | Result) & static_cast(0x0F0F0F0F0F0F0F0Full); + Result = ((Result << 2) | Result) & static_cast(0x3333333333333333ull); + Result = ((Result << 1) | Result) & static_cast(0x5555555555555555ull); + return static_cast((Result & 0x00000000FFFFFFFFull) | (Result >> 31)); + } + + GLM_FUNC_QUALIFIER glm::u16vec2 bitfieldDeinterleave_u16vec2(glm::uint32 InterleavedBitfield) + { + glm::uint64 Result(InterleavedBitfield); + Result = ((Result << 31) | Result) & 0x5555555555555555ull; + Result = ((Result >> 1) | Result) & 0x3333333333333333ull; + Result = ((Result >> 2) | Result) & 0x0F0F0F0F0F0F0F0Full; + Result = ((Result >> 4) | Result) & 0x00FF00FF00FF00FFull; + Result = ((Result >> 8) | Result) & 0x0000FFFF0000FFFFull; + return glm::u16vec2(Result & 0x00000000FFFFFFFFull, Result >> 32); + } + + int test() + { + int Error = 0; + + for(glm::size_t j = 0; j < 256; ++j) + for(glm::size_t i = 0; i < 256; ++i) + { + glm::uint16 A = bitfieldInterleave_u8vec2(glm::uint8(i), glm::uint8(j)); + glm::uint16 B = glm::bitfieldInterleave(glm::uint8(i), glm::uint8(j)); + Error += A == B ? 0 : 1; + + glm::u8vec2 C = bitfieldDeinterleave_u8vec2(A); + Error += C.x == glm::uint8(i) ? 0 : 1; + Error += C.y == glm::uint8(j) ? 0 : 1; + } + + for(glm::size_t j = 0; j < 256; ++j) + for(glm::size_t i = 0; i < 256; ++i) + { + glm::uint32 A = bitfieldInterleave_u8vec4(glm::uint8(i), glm::uint8(j), glm::uint8(i), glm::uint8(j)); + glm::uint32 B = glm::bitfieldInterleave(glm::uint8(i), glm::uint8(j), glm::uint8(i), glm::uint8(j)); + Error += A == B ? 0 : 1; +/* + glm::u8vec4 C = bitfieldDeinterleave_u8vec4(A); + Error += C.x == glm::uint8(i) ? 0 : 1; + Error += C.y == glm::uint8(j) ? 0 : 1; + Error += C.z == glm::uint8(i) ? 0 : 1; + Error += C.w == glm::uint8(j) ? 0 : 1; +*/ + } + + for(glm::size_t j = 0; j < 256; ++j) + for(glm::size_t i = 0; i < 256; ++i) + { + glm::uint32 A = bitfieldInterleave_u16vec2(glm::uint16(i), glm::uint16(j)); + glm::uint32 B = glm::bitfieldInterleave(glm::uint16(i), glm::uint16(j)); + Error += A == B ? 0 : 1; + } + + return Error; + } + + int perf_old_u8vec2(std::vector& Result) + { + int Error = 0; + + const std::clock_t BeginTime = std::clock(); + + for(glm::size_t k = 0; k < 10000; ++k) + for(glm::size_t j = 0; j < 256; ++j) + for(glm::size_t i = 0; i < 256; ++i) + Error += Result[j * 256 + i] == glm::bitfieldInterleave(glm::uint8(i), glm::uint8(j)) ? 0 : 1; + + const std::clock_t EndTime = std::clock(); + + std::printf("glm::bitfieldInterleave Time %d clocks\n", static_cast(EndTime - BeginTime)); + + return Error; + } + + int perf_new_u8vec2(std::vector& Result) + { + int Error = 0; + + const std::clock_t BeginTime = std::clock(); + + for(glm::size_t k = 0; k < 10000; ++k) + for(glm::size_t j = 0; j < 256; ++j) + for(glm::size_t i = 0; i < 256; ++i) + Error += Result[j * 256 + i] == bitfieldInterleave_u8vec2(glm::uint8(i), glm::uint8(j)) ? 0 : 1; + + const std::clock_t EndTime = std::clock(); + + std::printf("bitfieldInterleave_u8vec2 Time %d clocks\n", static_cast(EndTime - BeginTime)); + + return Error; + } + + int perf_old_u8vec4(std::vector& Result) + { + int Error = 0; + + const std::clock_t BeginTime = std::clock(); + + for(glm::size_t k = 0; k < 10000; ++k) + for(glm::size_t j = 0; j < 256; ++j) + for(glm::size_t i = 0; i < 256; ++i) + Error += Result[j * 256 + i] == glm::bitfieldInterleave(glm::uint8(i), glm::uint8(j), glm::uint8(i), glm::uint8(j)) ? 0 : 1; + + const std::clock_t EndTime = std::clock(); + + std::printf("glm::bitfieldInterleave Time %d clocks\n", static_cast(EndTime - BeginTime)); + + return Error; + } + + int perf_new_u8vec4(std::vector& Result) + { + int Error = 0; + + const std::clock_t BeginTime = std::clock(); + + for(glm::size_t k = 0; k < 10000; ++k) + for(glm::size_t j = 0; j < 256; ++j) + for(glm::size_t i = 0; i < 256; ++i) + Error += Result[j * 256 + i] == bitfieldInterleave_u8vec4(glm::uint8(i), glm::uint8(j), glm::uint8(i), glm::uint8(j)) ? 0 : 1; + + const std::clock_t EndTime = std::clock(); + + std::printf("bitfieldInterleave_u8vec4 Time %d clocks\n", static_cast(EndTime - BeginTime)); + + return Error; + } + + int perf_old_u16vec2(std::vector& Result) + { + int Error = 0; + + const std::clock_t BeginTime = std::clock(); + + for(glm::size_t k = 0; k < 10000; ++k) + for(glm::size_t j = 0; j < 256; ++j) + for(glm::size_t i = 0; i < 256; ++i) + Error += Result[j * 256 + i] == glm::bitfieldInterleave(glm::uint16(i), glm::uint16(j)) ? 0 : 1; + + const std::clock_t EndTime = std::clock(); + + std::printf("glm::bitfieldInterleave Time %d clocks\n", static_cast(EndTime - BeginTime)); + + return Error; + } + + int perf_new_u16vec2(std::vector& Result) + { + int Error = 0; + + const std::clock_t BeginTime = std::clock(); + + for(glm::size_t k = 0; k < 10000; ++k) + for(glm::size_t j = 0; j < 256; ++j) + for(glm::size_t i = 0; i < 256; ++i) + Error += Result[j * 256 + i] == bitfieldInterleave_u16vec2(glm::uint16(i), glm::uint16(j)) ? 0 : 1; + + const std::clock_t EndTime = std::clock(); + + std::printf("bitfieldInterleave_u16vec2 Time %d clocks\n", static_cast(EndTime - BeginTime)); + + return Error; + } + + int perf() + { + int Error = 0; + + std::printf("bitfieldInterleave perf: init\r"); + + std::vector Result_u8vec2(256 * 256, 0); + for(glm::size_t j = 0; j < 256; ++j) + for(glm::size_t i = 0; i < 256; ++i) + Result_u8vec2[j * 256 + i] = glm::bitfieldInterleave(glm::uint8(i), glm::uint8(j)); + + Error += perf_old_u8vec2(Result_u8vec2); + Error += perf_new_u8vec2(Result_u8vec2); + + std::vector Result_u8vec4(256 * 256, 0); + for(glm::size_t j = 0; j < 256; ++j) + for(glm::size_t i = 0; i < 256; ++i) + Result_u8vec4[j * 256 + i] = glm::bitfieldInterleave(glm::uint8(i), glm::uint8(j), glm::uint8(i), glm::uint8(j)); + + Error += perf_old_u8vec4(Result_u8vec4); + Error += perf_new_u8vec4(Result_u8vec4); + + std::vector Result_u16vec2(256 * 256, 0); + for(glm::size_t j = 0; j < 256; ++j) + for(glm::size_t i = 0; i < 256; ++i) + Result_u16vec2[j * 256 + i] = glm::bitfieldInterleave(glm::uint16(i), glm::uint16(j)); + + Error += perf_old_u16vec2(Result_u16vec2); + Error += perf_new_u16vec2(Result_u16vec2); + + std::printf("bitfieldInterleave perf: %d Errors\n", Error); + + return Error; + } + +}//namespace bitfieldInterleave5 + +static int test_bitfieldRotateRight() +{ + glm::ivec4 const A = glm::bitfieldRotateRight(glm::ivec4(2), 1); + glm::ivec4 const B = glm::ivec4(2) >> 1; + + return A == B; +} + +static int test_bitfieldRotateLeft() +{ + glm::ivec4 const A = glm::bitfieldRotateLeft(glm::ivec4(2), 1); + glm::ivec4 const B = glm::ivec4(2) << 1; + + return A == B; +} + +int main() +{ + int Error = 0; + +/* Tests for a faster and to reserve bitfieldInterleave + Error += ::bitfieldInterleave5::test(); + Error += ::bitfieldInterleave5::perf(); +*/ + Error += ::mask::test(); + Error += ::bitfieldInterleave3::test(); + Error += ::bitfieldInterleave4::test(); + Error += ::bitfieldInterleave::test(); + + Error += test_bitfieldRotateRight(); + Error += test_bitfieldRotateLeft(); + +# ifdef NDEBUG + Error += ::mask::perf(); + Error += ::bitfieldInterleave::perf(); +# endif//NDEBUG + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtc/gtc_color_space.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtc/gtc_color_space.cpp new file mode 100644 index 0000000000000000000000000000000000000000..df81b56f6b646e4469a2099189c2302ec74fda42 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtc/gtc_color_space.cpp @@ -0,0 +1,78 @@ +#include +#include +#include + +namespace srgb +{ + int test() + { + int Error(0); + + glm::vec3 const ColorSourceRGB(1.0, 0.5, 0.0); + + { + glm::vec3 const ColorSRGB = glm::convertLinearToSRGB(ColorSourceRGB); + glm::vec3 const ColorRGB = glm::convertSRGBToLinear(ColorSRGB); + Error += glm::all(glm::epsilonEqual(ColorSourceRGB, ColorRGB, 0.00001f)) ? 0 : 1; + } + + { + glm::vec3 const ColorSRGB = glm::convertLinearToSRGB(ColorSourceRGB, 2.8f); + glm::vec3 const ColorRGB = glm::convertSRGBToLinear(ColorSRGB, 2.8f); + Error += glm::all(glm::epsilonEqual(ColorSourceRGB, ColorRGB, 0.00001f)) ? 0 : 1; + } + + glm::vec4 const ColorSourceRGBA(1.0, 0.5, 0.0, 1.0); + + { + glm::vec4 const ColorSRGB = glm::convertLinearToSRGB(ColorSourceRGBA); + glm::vec4 const ColorRGB = glm::convertSRGBToLinear(ColorSRGB); + Error += glm::all(glm::epsilonEqual(ColorSourceRGBA, ColorRGB, 0.00001f)) ? 0 : 1; + } + + { + glm::vec4 const ColorSRGB = glm::convertLinearToSRGB(ColorSourceRGBA, 2.8f); + glm::vec4 const ColorRGB = glm::convertSRGBToLinear(ColorSRGB, 2.8f); + Error += glm::all(glm::epsilonEqual(ColorSourceRGBA, ColorRGB, 0.00001f)) ? 0 : 1; + } + + glm::vec4 const ColorSourceGNI = glm::vec4(107, 107, 104, 131) / glm::vec4(255); + + { + glm::vec4 const ColorGNA = glm::convertSRGBToLinear(ColorSourceGNI) * glm::vec4(255); + glm::vec4 const ColorGNE = glm::convertLinearToSRGB(ColorSourceGNI) * glm::vec4(255); + glm::vec4 const ColorSRGB = glm::convertLinearToSRGB(ColorSourceGNI); + glm::vec4 const ColorRGB = glm::convertSRGBToLinear(ColorSRGB); + Error += glm::all(glm::epsilonEqual(ColorSourceGNI, ColorRGB, 0.00001f)) ? 0 : 1; + } + + return Error; + } +}//namespace srgb + +namespace srgb_lowp +{ + int test() + { + int Error(0); + + for(float Color = 0.0f; Color < 1.0f; Color += 0.01f) + { + glm::highp_vec3 const HighpSRGB = glm::convertLinearToSRGB(glm::highp_vec3(Color)); + glm::lowp_vec3 const LowpSRGB = glm::convertLinearToSRGB(glm::lowp_vec3(Color)); + Error += glm::all(glm::epsilonEqual(glm::abs(HighpSRGB - glm::highp_vec3(LowpSRGB)), glm::highp_vec3(0), 0.1f)) ? 0 : 1; + } + + return Error; + } +}//namespace srgb_lowp + +int main() +{ + int Error(0); + + Error += srgb::test(); + Error += srgb_lowp::test(); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtc/gtc_constants.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtc/gtc_constants.cpp new file mode 100644 index 0000000000000000000000000000000000000000..5ac5ce33de775678dd30525e3eaa950f5b0030dc --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtc/gtc_constants.cpp @@ -0,0 +1,30 @@ +#include + +int test_epsilon() +{ + int Error = 0; + + { + float Test = glm::epsilon(); + Error += Test > 0.0f ? 0 : 1; + } + + { + double Test = glm::epsilon(); + Error += Test > 0.0 ? 0 : 1; + } + + return Error; +} + +int main() +{ + int Error(0); + + //float MinHalf = 0.0f; + //while (glm::half(MinHalf) == glm::half(0.0f)) + // MinHalf += std::numeric_limits::epsilon(); + Error += test_epsilon(); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtc/gtc_epsilon.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtc/gtc_epsilon.cpp new file mode 100644 index 0000000000000000000000000000000000000000..0f346d37119d71a54c9e1d2de1e7e036545736ae --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtc/gtc_epsilon.cpp @@ -0,0 +1,78 @@ +#include +#include +#include +#include + +int test_defined() +{ + glm::epsilonEqual(glm::vec2(), glm::vec2(), glm::vec2()); + glm::epsilonEqual(glm::vec3(), glm::vec3(), glm::vec3()); + glm::epsilonEqual(glm::vec4(), glm::vec4(), glm::vec4()); + + glm::epsilonNotEqual(glm::vec2(), glm::vec2(), glm::vec2()); + glm::epsilonNotEqual(glm::vec3(), glm::vec3(), glm::vec3()); + glm::epsilonNotEqual(glm::vec4(), glm::vec4(), glm::vec4()); + + glm::epsilonEqual(glm::vec2(), glm::vec2(), 0.0f); + glm::epsilonEqual(glm::vec3(), glm::vec3(), 0.0f); + glm::epsilonEqual(glm::vec4(), glm::vec4(), 0.0f); + glm::epsilonEqual(glm::quat(), glm::quat(), 0.0f); + + glm::epsilonNotEqual(glm::vec2(), glm::vec2(), 0.0f); + glm::epsilonNotEqual(glm::vec3(), glm::vec3(), 0.0f); + glm::epsilonNotEqual(glm::vec4(), glm::vec4(), 0.0f); + glm::epsilonNotEqual(glm::quat(), glm::quat(), 0.0f); + + return 0; +} + +template +int test_equal() +{ + int Error(0); + + { + T A = glm::epsilon(); + T B = glm::epsilon(); + Error += glm::epsilonEqual(A, B, glm::epsilon() * T(2)) ? 0 : 1; + } + + { + T A(0); + T B = static_cast(0) + glm::epsilon(); + Error += glm::epsilonEqual(A, B, glm::epsilon() * T(2)) ? 0 : 1; + } + + { + T A(0); + T B = static_cast(0) - glm::epsilon(); + Error += glm::epsilonEqual(A, B, glm::epsilon() * T(2)) ? 0 : 1; + } + + { + T A = static_cast(0) + glm::epsilon(); + T B = static_cast(0); + Error += glm::epsilonEqual(A, B, glm::epsilon() * T(2)) ? 0 : 1; + } + + { + T A = static_cast(0) - glm::epsilon(); + T B = static_cast(0); + Error += glm::epsilonEqual(A, B, glm::epsilon() * T(2)) ? 0 : 1; + } + + return Error; +} + +int main() +{ + int Error(0); + + Error += test_defined(); + Error += test_equal(); + Error += test_equal(); + + return Error; +} + + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtc/gtc_integer.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtc/gtc_integer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..0f0d719a24cd3bd0eace9e500da9066fa390f02f --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtc/gtc_integer.cpp @@ -0,0 +1,233 @@ +#define GLM_ENABLE_EXPERIMENTAL +#define GLM_FORCE_INLINE +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace log2_ +{ + int test() + { + int Error = 0; + + int A0 = static_cast(glm::log2(16.f)); + glm::ivec1 B0(glm::log2(glm::vec1(16.f))); + glm::ivec2 C0(glm::log2(glm::vec2(16.f))); + glm::ivec3 D0(glm::log2(glm::vec3(16.f))); + glm::ivec4 E0(glm::log2(glm::vec4(16.f))); + + int A1 = glm::log2(int(16)); + glm::ivec1 B1 = glm::log2(glm::ivec1(16)); + glm::ivec2 C1 = glm::log2(glm::ivec2(16)); + glm::ivec3 D1 = glm::log2(glm::ivec3(16)); + glm::ivec4 E1 = glm::log2(glm::ivec4(16)); + + Error += A0 == A1 ? 0 : 1; + Error += glm::all(glm::equal(B0, B1)) ? 0 : 1; + Error += glm::all(glm::equal(C0, C1)) ? 0 : 1; + Error += glm::all(glm::equal(D0, D1)) ? 0 : 1; + Error += glm::all(glm::equal(E0, E1)) ? 0 : 1; + + glm::uint64 A2 = glm::log2(glm::uint64(16)); + glm::u64vec1 B2 = glm::log2(glm::u64vec1(16)); + glm::u64vec2 C2 = glm::log2(glm::u64vec2(16)); + glm::u64vec3 D2 = glm::log2(glm::u64vec3(16)); + glm::u64vec4 E2 = glm::log2(glm::u64vec4(16)); + + Error += A2 == glm::uint64(4) ? 0 : 1; + Error += glm::all(glm::equal(B2, glm::u64vec1(4))) ? 0 : 1; + Error += glm::all(glm::equal(C2, glm::u64vec2(4))) ? 0 : 1; + Error += glm::all(glm::equal(D2, glm::u64vec3(4))) ? 0 : 1; + Error += glm::all(glm::equal(E2, glm::u64vec4(4))) ? 0 : 1; + + return Error; + } + + int perf(std::size_t Count) + { + int Error = 0; + + { + std::vector Result; + Result.resize(Count); + + std::clock_t Begin = clock(); + + for(int i = 0; i < static_cast(Count); ++i) + Result[i] = glm::log2(static_cast(i)); + + std::clock_t End = clock(); + + std::printf("glm::log2: %d clocks\n", static_cast(End - Begin)); + } + + { + std::vector Result; + Result.resize(Count); + + std::clock_t Begin = clock(); + + for(int i = 0; i < static_cast(Count); ++i) + Result[i] = glm::log2(glm::ivec4(i)); + + std::clock_t End = clock(); + + std::printf("glm::log2: %d clocks\n", static_cast(End - Begin)); + } + +# if GLM_HAS_BITSCAN_WINDOWS + { + std::vector Result; + Result.resize(Count); + + std::clock_t Begin = clock(); + + for(std::size_t i = 0; i < Count; ++i) + { + glm::vec<4, unsigned long, glm::defaultp> Tmp; + _BitScanReverse(&Tmp.x, i); + _BitScanReverse(&Tmp.y, i); + _BitScanReverse(&Tmp.z, i); + _BitScanReverse(&Tmp.w, i); + Result[i] = glm::ivec4(Tmp); + } + + std::clock_t End = clock(); + + std::printf("glm::log2 inlined: %d clocks\n", static_cast(End - Begin)); + } + + + { + std::vector > Result; + Result.resize(Count); + + std::clock_t Begin = clock(); + + for(std::size_t i = 0; i < Count; ++i) + { + _BitScanReverse(&Result[i].x, i); + _BitScanReverse(&Result[i].y, i); + _BitScanReverse(&Result[i].z, i); + _BitScanReverse(&Result[i].w, i); + } + + std::clock_t End = clock(); + + std::printf("glm::log2 inlined no cast: %d clocks\n", static_cast(End - Begin)); + } + + + { + std::vector Result; + Result.resize(Count); + + std::clock_t Begin = clock(); + + for(std::size_t i = 0; i < Count; ++i) + { + _BitScanReverse(reinterpret_cast(&Result[i].x), i); + _BitScanReverse(reinterpret_cast(&Result[i].y), i); + _BitScanReverse(reinterpret_cast(&Result[i].z), i); + _BitScanReverse(reinterpret_cast(&Result[i].w), i); + } + + std::clock_t End = clock(); + + std::printf("glm::log2 reinterpret: %d clocks\n", static_cast(End - Begin)); + } +# endif//GLM_HAS_BITSCAN_WINDOWS + + { + std::vector Result; + Result.resize(Count); + + std::clock_t Begin = clock(); + + for(std::size_t i = 0; i < Count; ++i) + Result[i] = glm::log2(static_cast(i)); + + std::clock_t End = clock(); + + std::printf("glm::log2: %d clocks\n", static_cast(End - Begin)); + } + + { + std::vector Result; + Result.resize(Count); + + std::clock_t Begin = clock(); + + for(int i = 0; i < static_cast(Count); ++i) + Result[i] = glm::log2(glm::vec4(static_cast(i))); + + std::clock_t End = clock(); + + std::printf("glm::log2: %d clocks\n", static_cast(End - Begin)); + } + + return Error; + } +}//namespace log2_ + +namespace iround +{ + int test() + { + int Error = 0; + + for(float f = 0.0f; f < 3.1f; f += 0.05f) + { + int RoundFast = static_cast(glm::iround(f)); + int RoundSTD = static_cast(glm::round(f)); + Error += RoundFast == RoundSTD ? 0 : 1; + assert(!Error); + } + + return Error; + } +}//namespace iround + +namespace uround +{ + int test() + { + int Error = 0; + + for(float f = 0.0f; f < 3.1f; f += 0.05f) + { + int RoundFast = static_cast(glm::uround(f)); + int RoundSTD = static_cast(glm::round(f)); + Error += RoundFast == RoundSTD ? 0 : 1; + assert(!Error); + } + + return Error; + } +}//namespace uround + +int main() +{ + int Error(0); + + Error += ::log2_::test(); + Error += ::iround::test(); + Error += ::uround::test(); + +# ifdef NDEBUG + std::size_t const Samples(1000); + Error += ::log2_::perf(Samples); +# endif//NDEBUG + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtc/gtc_matrix_access.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtc/gtc_matrix_access.cpp new file mode 100644 index 0000000000000000000000000000000000000000..4e94ea31d9c985dc4b89836a676ddf67e7814bcb --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtc/gtc_matrix_access.cpp @@ -0,0 +1,383 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +int test_mat2x2_row_set() +{ + int Error = 0; + + glm::mat2x2 m(1); + + m = glm::row(m, 0, glm::vec2( 0, 1)); + m = glm::row(m, 1, glm::vec2( 4, 5)); + + Error += glm::all(glm::equal(glm::row(m, 0), glm::vec2( 0, 1), glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(glm::row(m, 1), glm::vec2( 4, 5), glm::epsilon())) ? 0 : 1; + + return Error; +} + +int test_mat2x2_col_set() +{ + int Error = 0; + + glm::mat2x2 m(1); + + m = glm::column(m, 0, glm::vec2( 0, 1)); + m = glm::column(m, 1, glm::vec2( 4, 5)); + + Error += glm::all(glm::equal(glm::column(m, 0), glm::vec2( 0, 1), glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(glm::column(m, 1), glm::vec2( 4, 5), glm::epsilon())) ? 0 : 1; + + return Error; +} + +int test_mat2x3_row_set() +{ + int Error = 0; + + glm::mat2x3 m(1); + + m = glm::row(m, 0, glm::vec2( 0, 1)); + m = glm::row(m, 1, glm::vec2( 4, 5)); + m = glm::row(m, 2, glm::vec2( 8, 9)); + + Error += glm::all(glm::equal(glm::row(m, 0), glm::vec2( 0, 1), glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(glm::row(m, 1), glm::vec2( 4, 5), glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(glm::row(m, 2), glm::vec2( 8, 9), glm::epsilon())) ? 0 : 1; + + return Error; +} + +int test_mat2x3_col_set() +{ + int Error = 0; + + glm::mat2x3 m(1); + + m = glm::column(m, 0, glm::vec3( 0, 1, 2)); + m = glm::column(m, 1, glm::vec3( 4, 5, 6)); + + Error += glm::all(glm::equal(glm::column(m, 0), glm::vec3( 0, 1, 2), glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(glm::column(m, 1), glm::vec3( 4, 5, 6), glm::epsilon())) ? 0 : 1; + + return Error; +} + +int test_mat2x4_row_set() +{ + int Error = 0; + + glm::mat2x4 m(1); + + m = glm::row(m, 0, glm::vec2( 0, 1)); + m = glm::row(m, 1, glm::vec2( 4, 5)); + m = glm::row(m, 2, glm::vec2( 8, 9)); + m = glm::row(m, 3, glm::vec2(12, 13)); + + Error += glm::all(glm::equal(glm::row(m, 0), glm::vec2( 0, 1), glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(glm::row(m, 1), glm::vec2( 4, 5), glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(glm::row(m, 2), glm::vec2( 8, 9), glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(glm::row(m, 3), glm::vec2(12, 13), glm::epsilon())) ? 0 : 1; + + return Error; +} + +int test_mat2x4_col_set() +{ + int Error = 0; + + glm::mat2x4 m(1); + + m = glm::column(m, 0, glm::vec4( 0, 1, 2, 3)); + m = glm::column(m, 1, glm::vec4( 4, 5, 6, 7)); + + Error += glm::all(glm::equal(glm::column(m, 0), glm::vec4( 0, 1, 2, 3), glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(glm::column(m, 1), glm::vec4( 4, 5, 6, 7), glm::epsilon())) ? 0 : 1; + + return Error; +} + +int test_mat3x2_row_set() +{ + int Error = 0; + + glm::mat3x2 m(1); + + m = glm::row(m, 0, glm::vec3( 0, 1, 2)); + m = glm::row(m, 1, glm::vec3( 4, 5, 6)); + + Error += glm::all(glm::equal(glm::row(m, 0), glm::vec3( 0, 1, 2), glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(glm::row(m, 1), glm::vec3( 4, 5, 6), glm::epsilon())) ? 0 : 1; + + return Error; +} + +int test_mat3x2_col_set() +{ + int Error = 0; + + glm::mat3x2 m(1); + + m = glm::column(m, 0, glm::vec2( 0, 1)); + m = glm::column(m, 1, glm::vec2( 4, 5)); + m = glm::column(m, 2, glm::vec2( 8, 9)); + + Error += glm::all(glm::equal(glm::column(m, 0), glm::vec2( 0, 1), glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(glm::column(m, 1), glm::vec2( 4, 5), glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(glm::column(m, 2), glm::vec2( 8, 9), glm::epsilon())) ? 0 : 1; + + return Error; +} + +int test_mat3x3_row_set() +{ + int Error = 0; + + glm::mat3x3 m(1); + + m = glm::row(m, 0, glm::vec3( 0, 1, 2)); + m = glm::row(m, 1, glm::vec3( 4, 5, 6)); + m = glm::row(m, 2, glm::vec3( 8, 9, 10)); + + Error += glm::all(glm::equal(glm::row(m, 0), glm::vec3( 0, 1, 2), glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(glm::row(m, 1), glm::vec3( 4, 5, 6), glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(glm::row(m, 2), glm::vec3( 8, 9, 10), glm::epsilon())) ? 0 : 1; + + return Error; +} + +int test_mat3x3_col_set() +{ + int Error = 0; + + glm::mat3x3 m(1); + + m = glm::column(m, 0, glm::vec3( 0, 1, 2)); + m = glm::column(m, 1, glm::vec3( 4, 5, 6)); + m = glm::column(m, 2, glm::vec3( 8, 9, 10)); + + Error += glm::all(glm::equal(glm::column(m, 0), glm::vec3( 0, 1, 2), glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(glm::column(m, 1), glm::vec3( 4, 5, 6), glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(glm::column(m, 2), glm::vec3( 8, 9, 10), glm::epsilon())) ? 0 : 1; + + return Error; +} + +int test_mat3x4_row_set() +{ + int Error = 0; + + glm::mat3x4 m(1); + + m = glm::row(m, 0, glm::vec3( 0, 1, 2)); + m = glm::row(m, 1, glm::vec3( 4, 5, 6)); + m = glm::row(m, 2, glm::vec3( 8, 9, 10)); + m = glm::row(m, 3, glm::vec3(12, 13, 14)); + + Error += glm::all(glm::equal(glm::row(m, 0), glm::vec3( 0, 1, 2), glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(glm::row(m, 1), glm::vec3( 4, 5, 6), glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(glm::row(m, 2), glm::vec3( 8, 9, 10), glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(glm::row(m, 3), glm::vec3(12, 13, 14), glm::epsilon())) ? 0 : 1; + + return Error; +} + +int test_mat3x4_col_set() +{ + int Error = 0; + + glm::mat3x4 m(1); + + m = glm::column(m, 0, glm::vec4( 0, 1, 2, 3)); + m = glm::column(m, 1, glm::vec4( 4, 5, 6, 7)); + m = glm::column(m, 2, glm::vec4( 8, 9, 10, 11)); + + Error += glm::all(glm::equal(glm::column(m, 0), glm::vec4( 0, 1, 2, 3), glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(glm::column(m, 1), glm::vec4( 4, 5, 6, 7), glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(glm::column(m, 2), glm::vec4( 8, 9, 10, 11), glm::epsilon())) ? 0 : 1; + + return Error; +} + +int test_mat4x2_row_set() +{ + int Error = 0; + + glm::mat4x2 m(1); + + m = glm::row(m, 0, glm::vec4( 0, 1, 2, 3)); + m = glm::row(m, 1, glm::vec4( 4, 5, 6, 7)); + + Error += glm::all(glm::equal(glm::row(m, 0), glm::vec4( 0, 1, 2, 3), glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(glm::row(m, 1), glm::vec4( 4, 5, 6, 7), glm::epsilon())) ? 0 : 1; + + return Error; +} + +int test_mat4x2_col_set() +{ + int Error = 0; + + glm::mat4x2 m(1); + + m = glm::column(m, 0, glm::vec2( 0, 1)); + m = glm::column(m, 1, glm::vec2( 4, 5)); + m = glm::column(m, 2, glm::vec2( 8, 9)); + m = glm::column(m, 3, glm::vec2(12, 13)); + + Error += glm::all(glm::equal(glm::column(m, 0), glm::vec2( 0, 1), glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(glm::column(m, 1), glm::vec2( 4, 5), glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(glm::column(m, 2), glm::vec2( 8, 9), glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(glm::column(m, 3), glm::vec2(12, 13), glm::epsilon())) ? 0 : 1; + + return Error; +} + +int test_mat4x3_row_set() +{ + int Error = 0; + + glm::mat4x3 m(1); + + m = glm::row(m, 0, glm::vec4( 0, 1, 2, 3)); + m = glm::row(m, 1, glm::vec4( 4, 5, 6, 7)); + m = glm::row(m, 2, glm::vec4( 8, 9, 10, 11)); + + Error += glm::all(glm::equal(glm::row(m, 0), glm::vec4( 0, 1, 2, 3), glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(glm::row(m, 1), glm::vec4( 4, 5, 6, 7), glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(glm::row(m, 2), glm::vec4( 8, 9, 10, 11), glm::epsilon())) ? 0 : 1; + + return Error; +} + +int test_mat4x3_col_set() +{ + int Error = 0; + + glm::mat4x3 m(1); + + m = glm::column(m, 0, glm::vec3( 0, 1, 2)); + m = glm::column(m, 1, glm::vec3( 4, 5, 6)); + m = glm::column(m, 2, glm::vec3( 8, 9, 10)); + m = glm::column(m, 3, glm::vec3(12, 13, 14)); + + Error += glm::all(glm::equal(glm::column(m, 0), glm::vec3( 0, 1, 2), glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(glm::column(m, 1), glm::vec3( 4, 5, 6), glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(glm::column(m, 2), glm::vec3( 8, 9, 10), glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(glm::column(m, 3), glm::vec3(12, 13, 14), glm::epsilon())) ? 0 : 1; + + return Error; +} + +int test_mat4x4_row_set() +{ + int Error = 0; + + glm::mat4 m(1); + + m = glm::row(m, 0, glm::vec4( 0, 1, 2, 3)); + m = glm::row(m, 1, glm::vec4( 4, 5, 6, 7)); + m = glm::row(m, 2, glm::vec4( 8, 9, 10, 11)); + m = glm::row(m, 3, glm::vec4(12, 13, 14, 15)); + + Error += glm::all(glm::equal(glm::row(m, 0), glm::vec4( 0, 1, 2, 3), glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(glm::row(m, 1), glm::vec4( 4, 5, 6, 7), glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(glm::row(m, 2), glm::vec4( 8, 9, 10, 11), glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(glm::row(m, 3), glm::vec4(12, 13, 14, 15), glm::epsilon())) ? 0 : 1; + + return Error; +} + +int test_mat4x4_col_set() +{ + int Error = 0; + + glm::mat4 m(1); + + m = glm::column(m, 0, glm::vec4( 0, 1, 2, 3)); + m = glm::column(m, 1, glm::vec4( 4, 5, 6, 7)); + m = glm::column(m, 2, glm::vec4( 8, 9, 10, 11)); + m = glm::column(m, 3, glm::vec4(12, 13, 14, 15)); + + Error += glm::all(glm::equal(glm::column(m, 0), glm::vec4( 0, 1, 2, 3), glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(glm::column(m, 1), glm::vec4( 4, 5, 6, 7), glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(glm::column(m, 2), glm::vec4( 8, 9, 10, 11), glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(glm::column(m, 3), glm::vec4(12, 13, 14, 15), glm::epsilon())) ? 0 : 1; + + return Error; +} + +int test_mat4x4_row_get() +{ + int Error = 0; + + glm::mat4 m(1); + + glm::vec4 A = glm::row(m, 0); + Error += glm::all(glm::equal(A, glm::vec4(1, 0, 0, 0), glm::epsilon())) ? 0 : 1; + glm::vec4 B = glm::row(m, 1); + Error += glm::all(glm::equal(B, glm::vec4(0, 1, 0, 0), glm::epsilon())) ? 0 : 1; + glm::vec4 C = glm::row(m, 2); + Error += glm::all(glm::equal(C, glm::vec4(0, 0, 1, 0), glm::epsilon())) ? 0 : 1; + glm::vec4 D = glm::row(m, 3); + Error += glm::all(glm::equal(D, glm::vec4(0, 0, 0, 1), glm::epsilon())) ? 0 : 1; + + return Error; +} + +int test_mat4x4_col_get() +{ + int Error = 0; + + glm::mat4 m(1); + + glm::vec4 A = glm::column(m, 0); + Error += glm::all(glm::equal(A, glm::vec4(1, 0, 0, 0), glm::epsilon())) ? 0 : 1; + glm::vec4 B = glm::column(m, 1); + Error += glm::all(glm::equal(B, glm::vec4(0, 1, 0, 0), glm::epsilon())) ? 0 : 1; + glm::vec4 C = glm::column(m, 2); + Error += glm::all(glm::equal(C, glm::vec4(0, 0, 1, 0), glm::epsilon())) ? 0 : 1; + glm::vec4 D = glm::column(m, 3); + Error += glm::all(glm::equal(D, glm::vec4(0, 0, 0, 1), glm::epsilon())) ? 0 : 1; + + return Error; +} + +int main() +{ + int Error = 0; + + Error += test_mat2x2_row_set(); + Error += test_mat2x2_col_set(); + Error += test_mat2x3_row_set(); + Error += test_mat2x3_col_set(); + Error += test_mat2x4_row_set(); + Error += test_mat2x4_col_set(); + Error += test_mat3x2_row_set(); + Error += test_mat3x2_col_set(); + Error += test_mat3x3_row_set(); + Error += test_mat3x3_col_set(); + Error += test_mat3x4_row_set(); + Error += test_mat3x4_col_set(); + Error += test_mat4x2_row_set(); + Error += test_mat4x2_col_set(); + Error += test_mat4x3_row_set(); + Error += test_mat4x3_col_set(); + Error += test_mat4x4_row_set(); + Error += test_mat4x4_col_set(); + + Error += test_mat4x4_row_get(); + Error += test_mat4x4_col_get(); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtc/gtc_matrix_integer.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtc/gtc_matrix_integer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..b2051fec0a9ecb2b5149fc11ff618ee051773f96 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtc/gtc_matrix_integer.cpp @@ -0,0 +1,8 @@ +#include + +int main() +{ + int Error = 0; + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtc/gtc_matrix_inverse.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtc/gtc_matrix_inverse.cpp new file mode 100644 index 0000000000000000000000000000000000000000..b2c0d1c2ff193fbbab73e7ef5a3dc10f0e3bb64d --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtc/gtc_matrix_inverse.cpp @@ -0,0 +1,51 @@ +#include +#include + +int test_affine() +{ + int Error = 0; + + { + glm::mat3 const M( + 2.f, 0.f, 0.f, + 0.f, 2.f, 0.f, + 0.f, 0.f, 1.f); + glm::mat3 const A = glm::affineInverse(M); + glm::mat3 const I = glm::inverse(M); + glm::mat3 const R = glm::affineInverse(A); + + for(glm::length_t i = 0; i < A.length(); ++i) + { + Error += glm::all(glm::epsilonEqual(M[i], R[i], 0.01f)) ? 0 : 1; + Error += glm::all(glm::epsilonEqual(A[i], I[i], 0.01f)) ? 0 : 1; + } + } + + { + glm::mat4 const M( + 2.f, 0.f, 0.f, 0.f, + 0.f, 2.f, 0.f, 0.f, + 0.f, 0.f, 2.f, 0.f, + 0.f, 0.f, 0.f, 1.f); + glm::mat4 const A = glm::affineInverse(M); + glm::mat4 const I = glm::inverse(M); + glm::mat4 const R = glm::affineInverse(A); + + for(glm::length_t i = 0; i < A.length(); ++i) + { + Error += glm::all(glm::epsilonEqual(M[i], R[i], 0.01f)) ? 0 : 1; + Error += glm::all(glm::epsilonEqual(A[i], I[i], 0.01f)) ? 0 : 1; + } + } + + return Error; +} + +int main() +{ + int Error = 0; + + Error += test_affine(); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtc/gtc_matrix_transform.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtc/gtc_matrix_transform.cpp new file mode 100644 index 0000000000000000000000000000000000000000..ee28fd5bd080026ad09faa095e2376a0e33522b0 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtc/gtc_matrix_transform.cpp @@ -0,0 +1,55 @@ +#include +#include +#include + +int test_perspective() +{ + int Error = 0; + + glm::mat4 Projection = glm::perspective(glm::pi() * 0.25f, 4.0f / 3.0f, 0.1f, 100.0f); + + return Error; +} + +int test_pick() +{ + int Error = 0; + + glm::mat4 Pick = glm::pickMatrix(glm::vec2(1, 2), glm::vec2(3, 4), glm::ivec4(0, 0, 320, 240)); + + return Error; +} + +int test_tweakedInfinitePerspective() +{ + int Error = 0; + + glm::mat4 ProjectionA = glm::tweakedInfinitePerspective(45.f, 640.f/480.f, 1.0f); + glm::mat4 ProjectionB = glm::tweakedInfinitePerspective(45.f, 640.f/480.f, 1.0f, 0.001f); + + + return Error; +} + +int test_translate() +{ + int Error = 0; + + glm::lowp_vec3 v(1.0); + glm::lowp_mat4 m(0); + glm::lowp_mat4 t = glm::translate(m, v); + + return Error; +} + +int main() +{ + int Error = 0; + + Error += test_translate(); + Error += test_tweakedInfinitePerspective(); + Error += test_pick(); + Error += test_perspective(); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtc/gtc_noise.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtc/gtc_noise.cpp new file mode 100644 index 0000000000000000000000000000000000000000..ed2facbbb208a09083834a20e896e2e43dc8c4fe --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtc/gtc_noise.cpp @@ -0,0 +1,86 @@ +#define GLM_ENABLE_EXPERIMENTAL +#include +#include +#include + +static int test_simplex_float() +{ + int Error = 0; + + glm::u8vec4 const PixelSimplex2D(glm::byte(glm::abs(glm::simplex(glm::vec2(0.f, 0.f))) * 255.f)); + glm::u8vec4 const PixelSimplex3D(glm::byte(glm::abs(glm::simplex(glm::vec3(0.f, 0.f, 0.f))) * 255.f)); + glm::u8vec4 const PixelSimplex4D(glm::byte(glm::abs(glm::simplex(glm::vec4(0.f, 0.f, 0.f, 0.f))) * 255.f)); + + return Error; +} + +static int test_simplex_double() +{ + int Error = 0; + + glm::u8vec4 const PixelSimplex2D(glm::byte(glm::abs(glm::simplex(glm::dvec2(0.f, 0.f))) * 255.)); + glm::u8vec4 const PixelSimplex3D(glm::byte(glm::abs(glm::simplex(glm::dvec3(0.f, 0.f, 0.f))) * 255.)); + glm::u8vec4 const PixelSimplex4D(glm::byte(glm::abs(glm::simplex(glm::dvec4(0.f, 0.f, 0.f, 0.f))) * 255.)); + + return Error; +} + +static int test_perlin_float() +{ + int Error = 0; + + glm::u8vec4 const PixelPerlin2D(glm::byte(glm::abs(glm::perlin(glm::vec2(0.f, 0.f))) * 255.f)); + glm::u8vec4 const PixelPerlin3D(glm::byte(glm::abs(glm::perlin(glm::vec3(0.f, 0.f, 0.f))) * 255.f)); + glm::u8vec4 const PixelPerlin4D(glm::byte(glm::abs(glm::perlin(glm::vec4(0.f, 0.f, 0.f, 0.f))) * 255.f)); + + return Error; +} + +static int test_perlin_double() +{ + int Error = 0; + + glm::u8vec4 const PixelPerlin2D(glm::byte(glm::abs(glm::perlin(glm::dvec2(0.f, 0.f))) * 255.)); + glm::u8vec4 const PixelPerlin3D(glm::byte(glm::abs(glm::perlin(glm::dvec3(0.f, 0.f, 0.f))) * 255.)); + glm::u8vec4 const PixelPerlin4D(glm::byte(glm::abs(glm::perlin(glm::dvec4(0.f, 0.f, 0.f, 0.f))) * 255.)); + + return Error; +} + +static int test_perlin_pedioric_float() +{ + int Error = 0; + + glm::u8vec4 const PixelPeriodic2D(glm::byte(glm::abs(glm::perlin(glm::vec2(0.f, 0.f), glm::vec2(2.0f))) * 255.f)); + glm::u8vec4 const PixelPeriodic3D(glm::byte(glm::abs(glm::perlin(glm::vec3(0.f, 0.f, 0.f), glm::vec3(2.0f))) * 255.f)); + glm::u8vec4 const PixelPeriodic4D(glm::byte(glm::abs(glm::perlin(glm::vec4(0.f, 0.f, 0.f, 0.f), glm::vec4(2.0f))) * 255.f)); + + return Error; +} + +static int test_perlin_pedioric_double() +{ + int Error = 0; + + glm::u8vec4 const PixelPeriodic2D(glm::byte(glm::abs(glm::perlin(glm::dvec2(0.f, 0.f), glm::dvec2(2.0))) * 255.)); + glm::u8vec4 const PixelPeriodic3D(glm::byte(glm::abs(glm::perlin(glm::dvec3(0.f, 0.f, 0.f), glm::dvec3(2.0))) * 255.)); + glm::u8vec4 const PixelPeriodic4D(glm::byte(glm::abs(glm::perlin(glm::dvec4(0.f, 0.f, 0.f, 0.f), glm::dvec4(2.0))) * 255.)); + + return Error; +} + +int main() +{ + int Error = 0; + + Error += test_simplex_float(); + Error += test_simplex_double(); + + Error += test_perlin_float(); + Error += test_perlin_double(); + + Error += test_perlin_pedioric_float(); + Error += test_perlin_pedioric_double(); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtc/gtc_packing.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtc/gtc_packing.cpp new file mode 100644 index 0000000000000000000000000000000000000000..ddb936bfcb183263e638adcdc8bafb287e520d9f --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtc/gtc_packing.cpp @@ -0,0 +1,878 @@ +#include +#include +#include +#include +#include +#include + +void print_bits(float const& s) +{ + union + { + float f; + unsigned int i; + } uif; + + uif.f = s; + + std::printf("f32: "); + for(std::size_t j = sizeof(s) * 8; j > 0; --j) + { + if(j == 23 || j == 31) + std::printf(" "); + std::printf("%d", (uif.i & (1 << (j - 1))) ? 1 : 0); + } +} + +void print_10bits(glm::uint const& s) +{ + std::printf("10b: "); + for(std::size_t j = 10; j > 0; --j) + { + if(j == 5) + std::printf(" "); + std::printf("%d", (s & (1 << (j - 1))) ? 1 : 0); + } +} + +void print_11bits(glm::uint const& s) +{ + std::printf("11b: "); + for(std::size_t j = 11; j > 0; --j) + { + if(j == 6) + std::printf(" "); + std::printf("%d", (s & (1 << (j - 1))) ? 1 : 0); + } +} + +void print_value(float const& s) +{ + std::printf("%2.5f, ", static_cast(s)); + print_bits(s); + std::printf(", "); +// print_11bits(detail::floatTo11bit(s)); +// std::printf(", "); +// print_10bits(detail::floatTo10bit(s)); + std::printf("\n"); +} + +int test_Half1x16() +{ + int Error = 0; + + std::vector Tests; + Tests.push_back(0.0f); + Tests.push_back(1.0f); + Tests.push_back(-1.0f); + Tests.push_back(2.0f); + Tests.push_back(-2.0f); + Tests.push_back(1.9f); + + for(std::size_t i = 0; i < Tests.size(); ++i) + { + glm::uint16 p0 = glm::packHalf1x16(Tests[i]); + float v0 = glm::unpackHalf1x16(p0); + glm::uint16 p1 = glm::packHalf1x16(v0); + float v1 = glm::unpackHalf1x16(p1); + Error += glm::epsilonEqual(v0, v1, glm::epsilon()) ? 0 : 1; + } + + return Error; +} + +int test_Half4x16() +{ + int Error = 0; + + std::vector Tests; + Tests.push_back(glm::vec4(1.0f)); + Tests.push_back(glm::vec4(0.0f)); + Tests.push_back(glm::vec4(2.0f)); + Tests.push_back(glm::vec4(0.1f)); + Tests.push_back(glm::vec4(0.5f)); + Tests.push_back(glm::vec4(-0.9f)); + + for(std::size_t i = 0; i < Tests.size(); ++i) + { + glm::uint64 p0 = glm::packHalf4x16(Tests[i]); + glm::vec4 v0 = glm::unpackHalf4x16(p0); + glm::uint64 p1 = glm::packHalf4x16(v0); + glm::vec4 v1 = glm::unpackHalf4x16(p1); + glm::u16vec4 p2 = glm::packHalf(v0); + glm::vec4 v2 = glm::unpackHalf(p2); + + Error += glm::all(glm::equal(v0, v1, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(v0, v2, glm::epsilon())) ? 0 : 1; + } + + return Error; +} + +int test_I3x10_1x2() +{ + int Error = 0; + + std::vector Tests; + Tests.push_back(glm::ivec4(0)); + Tests.push_back(glm::ivec4(1)); + Tests.push_back(glm::ivec4(-1)); + Tests.push_back(glm::ivec4(2)); + Tests.push_back(glm::ivec4(-2)); + Tests.push_back(glm::ivec4(3)); + + for(std::size_t i = 0; i < Tests.size(); ++i) + { + glm::uint32 p0 = glm::packI3x10_1x2(Tests[i]); + glm::ivec4 v0 = glm::unpackI3x10_1x2(p0); + glm::uint32 p1 = glm::packI3x10_1x2(v0); + glm::ivec4 v1 = glm::unpackI3x10_1x2(p1); + Error += glm::all(glm::equal(v0, v1)) ? 0 : 1; + } + + return Error; +} + +int test_U3x10_1x2() +{ + int Error = 0; + + std::vector Tests; + Tests.push_back(glm::uvec4(0)); + Tests.push_back(glm::uvec4(1)); + Tests.push_back(glm::uvec4(2)); + Tests.push_back(glm::uvec4(3)); + Tests.push_back(glm::uvec4(4)); + Tests.push_back(glm::uvec4(5)); + + for(std::size_t i = 0; i < Tests.size(); ++i) + { + glm::uint32 p0 = glm::packU3x10_1x2(Tests[i]); + glm::uvec4 v0 = glm::unpackU3x10_1x2(p0); + glm::uint32 p1 = glm::packU3x10_1x2(v0); + glm::uvec4 v1 = glm::unpackU3x10_1x2(p1); + Error += glm::all(glm::equal(v0, v1)) ? 0 : 1; + } + + glm::u8vec4 const v0(0xff, 0x77, 0x0, 0x33); + glm::uint32 const p0 = *reinterpret_cast(&v0[0]); + glm::uint32 const r0 = 0x330077ff; + + Error += p0 == r0 ? 0 : 1; + + glm::uvec4 const v1(0xff, 0x77, 0x0, 0x33); + glm::uint32 const p1 = glm::packU3x10_1x2(v1); + glm::uint32 const r1 = 0xc001dcff; + + Error += p1 == r1 ? 0 : 1; + + return Error; +} + +int test_Snorm3x10_1x2() +{ + int Error = 0; + + std::vector Tests; + Tests.push_back(glm::vec4(1.0f)); + Tests.push_back(glm::vec4(0.0f)); + Tests.push_back(glm::vec4(2.0f)); + Tests.push_back(glm::vec4(0.1f)); + Tests.push_back(glm::vec4(0.5f)); + Tests.push_back(glm::vec4(0.9f)); + + for(std::size_t i = 0; i < Tests.size(); ++i) + { + glm::uint32 p0 = glm::packSnorm3x10_1x2(Tests[i]); + glm::vec4 v0 = glm::unpackSnorm3x10_1x2(p0); + glm::uint32 p1 = glm::packSnorm3x10_1x2(v0); + glm::vec4 v1 = glm::unpackSnorm3x10_1x2(p1); + + Error += glm::all(glm::epsilonEqual(v0, v1, 0.01f)) ? 0 : 1; + } + + return Error; +} + +int test_Unorm3x10_1x2() +{ + int Error = 0; + + std::vector Tests; + Tests.push_back(glm::vec4(1.0f)); + Tests.push_back(glm::vec4(0.0f)); + Tests.push_back(glm::vec4(2.0f)); + Tests.push_back(glm::vec4(0.1f)); + Tests.push_back(glm::vec4(0.5f)); + Tests.push_back(glm::vec4(0.9f)); + + for(std::size_t i = 0; i < Tests.size(); ++i) + { + glm::uint32 p0 = glm::packUnorm3x10_1x2(Tests[i]); + glm::vec4 v0 = glm::unpackUnorm3x10_1x2(p0); + glm::uint32 p1 = glm::packUnorm3x10_1x2(v0); + glm::vec4 v1 = glm::unpackUnorm3x10_1x2(p1); + + Error += glm::all(glm::epsilonEqual(v0, v1, 0.001f)) ? 0 : 1; + } + + return Error; +} + +int test_F2x11_1x10() +{ + int Error = 0; + + std::vector Tests; + Tests.push_back(glm::vec3(1.0f)); + Tests.push_back(glm::vec3(0.0f)); + Tests.push_back(glm::vec3(2.0f)); + Tests.push_back(glm::vec3(0.1f)); + Tests.push_back(glm::vec3(0.5f)); + Tests.push_back(glm::vec3(0.9f)); + + for(std::size_t i = 0; i < Tests.size(); ++i) + { + glm::uint32 p0 = glm::packF2x11_1x10(Tests[i]); + glm::vec3 v0 = glm::unpackF2x11_1x10(p0); + glm::uint32 p1 = glm::packF2x11_1x10(v0); + glm::vec3 v1 = glm::unpackF2x11_1x10(p1); + Error += glm::all(glm::equal(v0, v1, glm::epsilon())) ? 0 : 1; + } + + return Error; +} + +int test_F3x9_E1x5() +{ + int Error = 0; + + std::vector Tests; + Tests.push_back(glm::vec3(1.0f)); + Tests.push_back(glm::vec3(0.0f)); + Tests.push_back(glm::vec3(2.0f)); + Tests.push_back(glm::vec3(0.1f)); + Tests.push_back(glm::vec3(0.5f)); + Tests.push_back(glm::vec3(0.9f)); + + for(std::size_t i = 0; i < Tests.size(); ++i) + { + glm::uint32 p0 = glm::packF3x9_E1x5(Tests[i]); + glm::vec3 v0 = glm::unpackF3x9_E1x5(p0); + glm::uint32 p1 = glm::packF3x9_E1x5(v0); + glm::vec3 v1 = glm::unpackF3x9_E1x5(p1); + Error += glm::all(glm::equal(v0, v1, glm::epsilon())) ? 0 : 1; + } + + return Error; +} + +int test_RGBM() +{ + int Error = 0; + + for(std::size_t i = 0; i < 1024; ++i) + { + glm::vec3 const Color(static_cast(i)); + glm::vec4 const RGBM = glm::packRGBM(Color); + glm::vec3 const Result= glm::unpackRGBM(RGBM); + + Error += glm::all(glm::equal(Color, Result, 0.01f)) ? 0 : 1; + } + + return Error; +} + +int test_packUnorm1x16() +{ + int Error = 0; + + std::vector A; + A.push_back(glm::vec1(1.0f)); + A.push_back(glm::vec1(0.5f)); + A.push_back(glm::vec1(0.1f)); + A.push_back(glm::vec1(0.0f)); + + for(std::size_t i = 0; i < A.size(); ++i) + { + glm::vec1 B(A[i]); + glm::uint16 C = glm::packUnorm1x16(B.x); + glm::vec1 D(glm::unpackUnorm1x16(C)); + Error += glm::all(glm::epsilonEqual(B, D, 1.0f / 65535.f)) ? 0 : 1; + assert(!Error); + } + + return Error; +} + +int test_packSnorm1x16() +{ + int Error = 0; + + std::vector A; + A.push_back(glm::vec1( 1.0f)); + A.push_back(glm::vec1( 0.0f)); + A.push_back(glm::vec1(-0.5f)); + A.push_back(glm::vec1(-0.1f)); + + for(std::size_t i = 0; i < A.size(); ++i) + { + glm::vec1 B(A[i]); + glm::uint16 C = glm::packSnorm1x16(B.x); + glm::vec1 D(glm::unpackSnorm1x16(C)); + Error += glm::all(glm::epsilonEqual(B, D, 1.0f / 32767.0f * 2.0f)) ? 0 : 1; + } + + return Error; +} + +int test_packUnorm2x16() +{ + int Error = 0; + + std::vector A; + A.push_back(glm::vec2(1.0f, 0.0f)); + A.push_back(glm::vec2(0.5f, 0.7f)); + A.push_back(glm::vec2(0.1f, 0.2f)); + + for(std::size_t i = 0; i < A.size(); ++i) + { + glm::vec2 B(A[i]); + glm::uint32 C = glm::packUnorm2x16(B); + glm::vec2 D = glm::unpackUnorm2x16(C); + Error += glm::all(glm::epsilonEqual(B, D, 1.0f / 65535.f)) ? 0 : 1; + assert(!Error); + } + + return Error; +} + +int test_packSnorm2x16() +{ + int Error = 0; + + std::vector A; + A.push_back(glm::vec2( 1.0f, 0.0f)); + A.push_back(glm::vec2(-0.5f,-0.7f)); + A.push_back(glm::vec2(-0.1f, 0.1f)); + + for(std::size_t i = 0; i < A.size(); ++i) + { + glm::vec2 B(A[i]); + glm::uint32 C = glm::packSnorm2x16(B); + glm::vec2 D = glm::unpackSnorm2x16(C); + Error += glm::all(glm::epsilonEqual(B, D, 1.0f / 32767.0f * 2.0f)) ? 0 : 1; + assert(!Error); + } + + return Error; +} + +int test_packUnorm4x16() +{ + int Error = 0; + + std::vector A; + A.push_back(glm::vec4(1.0f)); + A.push_back(glm::vec4(0.5f)); + A.push_back(glm::vec4(0.1f)); + A.push_back(glm::vec4(0.0f)); + + for(std::size_t i = 0; i < A.size(); ++i) + { + glm::vec4 B(A[i]); + glm::uint64 C = glm::packUnorm4x16(B); + glm::vec4 D(glm::unpackUnorm4x16(C)); + Error += glm::all(glm::epsilonEqual(B, D, 1.0f / 65535.f)) ? 0 : 1; + assert(!Error); + } + + return Error; +} + +int test_packSnorm4x16() +{ + int Error = 0; + + std::vector A; + A.push_back(glm::vec4( 1.0f, 0.0f, -0.5f, 0.5f)); + A.push_back(glm::vec4(-0.3f,-0.7f, 0.3f, 0.7f)); + A.push_back(glm::vec4(-0.1f, 0.1f, -0.2f, 0.2f)); + + for(std::size_t i = 0; i < A.size(); ++i) + { + glm::vec4 B(A[i]); + glm::uint64 C = glm::packSnorm4x16(B); + glm::vec4 D(glm::unpackSnorm4x16(C)); + Error += glm::all(glm::epsilonEqual(B, D, 1.0f / 32767.0f * 2.0f)) ? 0 : 1; + assert(!Error); + } + + return Error; +} + +int test_packUnorm1x8() +{ + int Error = 0; + + std::vector A; + A.push_back(glm::vec1(1.0f)); + A.push_back(glm::vec1(0.5f)); + A.push_back(glm::vec1(0.0f)); + + for(std::size_t i = 0; i < A.size(); ++i) + { + glm::vec1 B(A[i]); + glm::uint8 C = glm::packUnorm1x8(B.x); + glm::vec1 D(glm::unpackUnorm1x8(C)); + Error += glm::all(glm::epsilonEqual(B, D, 1.0f / 255.f)) ? 0 : 1; + assert(!Error); + } + + return Error; +} + +int test_packSnorm1x8() +{ + int Error = 0; + + std::vector A; + A.push_back(glm::vec1( 1.0f)); + A.push_back(glm::vec1(-0.7f)); + A.push_back(glm::vec1(-1.0f)); + + for(std::size_t i = 0; i < A.size(); ++i) + { + glm::vec1 B(A[i]); + glm::uint8 C = glm::packSnorm1x8(B.x); + glm::vec1 D(glm::unpackSnorm1x8(C)); + Error += glm::all(glm::epsilonEqual(B, D, 1.0f / 127.f)) ? 0 : 1; + } + + return Error; +} + +int test_packUnorm2x8() +{ + int Error = 0; + + std::vector A; + A.push_back(glm::vec2(1.0f, 0.7f)); + A.push_back(glm::vec2(0.5f, 0.1f)); + + for(std::size_t i = 0; i < A.size(); ++i) + { + glm::vec2 B(A[i]); + glm::uint16 C = glm::packUnorm2x8(B); + glm::vec2 D = glm::unpackUnorm2x8(C); + Error += glm::all(glm::epsilonEqual(B, D, 1.0f / 255.f)) ? 0 : 1; + assert(!Error); + } + + return Error; +} + +int test_packSnorm2x8() +{ + int Error = 0; + + std::vector A; + A.push_back(glm::vec2( 1.0f, 0.0f)); + A.push_back(glm::vec2(-0.7f,-0.1f)); + + for(std::size_t i = 0; i < A.size(); ++i) + { + glm::vec2 B(A[i]); + glm::uint16 C = glm::packSnorm2x8(B); + glm::vec2 D = glm::unpackSnorm2x8(C); + Error += glm::all(glm::epsilonEqual(B, D, 1.0f / 127.f)) ? 0 : 1; + } + + return Error; +} + +int test_packUnorm4x8() +{ + int Error = 0; + + std::vector A; + A.push_back(glm::vec4(1.0f, 0.7f, 0.3f, 0.0f)); + A.push_back(glm::vec4(0.5f, 0.1f, 0.2f, 0.3f)); + + for(std::size_t i = 0; i < A.size(); ++i) + { + glm::vec4 B(A[i]); + glm::uint32 C = glm::packUnorm4x8(B); + glm::vec4 D = glm::unpackUnorm4x8(C); + Error += glm::all(glm::epsilonEqual(B, D, 1.0f / 255.f)) ? 0 : 1; + assert(!Error); + } + + return Error; +} + +int test_packSnorm4x8() +{ + int Error = 0; + + std::vector A; + A.push_back(glm::vec4( 1.0f, 0.0f,-0.5f,-1.0f)); + A.push_back(glm::vec4(-0.7f,-0.1f, 0.1f, 0.7f)); + + for(std::size_t i = 0; i < A.size(); ++i) + { + glm::vec4 B(A[i]); + glm::uint32 C = glm::packSnorm4x8(B); + glm::vec4 D = glm::unpackSnorm4x8(C); + Error += glm::all(glm::epsilonEqual(B, D, 1.0f / 127.f)) ? 0 : 1; + assert(!Error); + } + + return Error; +} + +int test_packUnorm() +{ + int Error = 0; + + std::vector A; + A.push_back(glm::vec2(1.0f, 0.7f)); + A.push_back(glm::vec2(0.5f, 0.1f)); + + for(std::size_t i = 0; i < A.size(); ++i) + { + glm::vec2 B(A[i]); + glm::u16vec2 C = glm::packUnorm(B); + glm::vec2 D = glm::unpackUnorm(C); + Error += glm::all(glm::epsilonEqual(B, D, 1.0f / 255.f)) ? 0 : 1; + assert(!Error); + } + + return Error; +} + +int test_packSnorm() +{ + int Error = 0; + + std::vector A; + A.push_back(glm::vec2( 1.0f, 0.0f)); + A.push_back(glm::vec2(-0.5f,-0.7f)); + A.push_back(glm::vec2(-0.1f, 0.1f)); + + for(std::size_t i = 0; i < A.size(); ++i) + { + glm::vec2 B(A[i]); + glm::i16vec2 C = glm::packSnorm(B); + glm::vec2 D = glm::unpackSnorm(C); + Error += glm::all(glm::epsilonEqual(B, D, 1.0f / 32767.0f * 2.0f)) ? 0 : 1; + assert(!Error); + } + + return Error; +} + +int test_packUnorm2x4() +{ + int Error = 0; + + std::vector A; + A.push_back(glm::vec2(1.0f, 0.7f)); + A.push_back(glm::vec2(0.5f, 0.0f)); + + for(std::size_t i = 0; i < A.size(); ++i) + { + glm::vec2 B(A[i]); + glm::uint8 C = glm::packUnorm2x4(B); + glm::vec2 D = glm::unpackUnorm2x4(C); + Error += glm::all(glm::epsilonEqual(B, D, 1.0f / 15.f)) ? 0 : 1; + assert(!Error); + } + + return Error; +} + +int test_packUnorm4x4() +{ + int Error = 0; + + std::vector A; + A.push_back(glm::vec4(1.0f, 0.7f, 0.5f, 0.0f)); + A.push_back(glm::vec4(0.5f, 0.1f, 0.0f, 1.0f)); + + for(std::size_t i = 0; i < A.size(); ++i) + { + glm::vec4 B(A[i]); + glm::uint16 C = glm::packUnorm4x4(B); + glm::vec4 D = glm::unpackUnorm4x4(C); + Error += glm::all(glm::epsilonEqual(B, D, 1.0f / 15.f)) ? 0 : 1; + assert(!Error); + } + + return Error; +} + +int test_packUnorm3x5_1x1() +{ + int Error = 0; + + std::vector A; + A.push_back(glm::vec4(1.0f, 0.7f, 0.5f, 0.0f)); + A.push_back(glm::vec4(0.5f, 0.1f, 0.0f, 1.0f)); + + for(std::size_t i = 0; i < A.size(); ++i) + { + glm::vec4 B(A[i]); + glm::uint16 C = glm::packUnorm3x5_1x1(B); + glm::vec4 D = glm::unpackUnorm3x5_1x1(C); + Error += glm::all(glm::epsilonEqual(B, D, 1.0f / 15.f)) ? 0 : 1; + assert(!Error); + } + + return Error; +} + +int test_packUnorm1x5_1x6_1x5() +{ + int Error = 0; + + std::vector A; + A.push_back(glm::vec3(1.0f, 0.7f, 0.5f)); + A.push_back(glm::vec3(0.5f, 0.1f, 0.0f)); + + for(std::size_t i = 0; i < A.size(); ++i) + { + glm::vec3 B(A[i]); + glm::uint16 C = glm::packUnorm1x5_1x6_1x5(B); + glm::vec3 D = glm::unpackUnorm1x5_1x6_1x5(C); + Error += glm::all(glm::epsilonEqual(B, D, 1.0f / 15.f)) ? 0 : 1; + assert(!Error); + } + + return Error; +} + +int test_packUnorm2x3_1x2() +{ + int Error = 0; + + std::vector A; + A.push_back(glm::vec3(1.0f, 0.7f, 0.5f)); + A.push_back(glm::vec3(0.5f, 0.1f, 0.0f)); + + for(std::size_t i = 0; i < A.size(); ++i) + { + glm::vec3 B(A[i]); + glm::uint8 C = glm::packUnorm2x3_1x2(B); + glm::vec3 D = glm::unpackUnorm2x3_1x2(C); + Error += glm::all(glm::epsilonEqual(B, D, 1.0f / 3.f)) ? 0 : 1; + assert(!Error); + } + + return Error; +} + +int test_packUint2x8() +{ + int Error = 0; + + glm::u8vec2 const Source(1, 2); + + glm::uint16 const Packed = glm::packUint2x8(Source); + Error += Packed != 0 ? 0 : 1; + + glm::u8vec2 const Unpacked = glm::unpackUint2x8(Packed); + Error += Source == Unpacked ? 0 : 1; + + return Error; +} + +int test_packUint4x8() +{ + int Error = 0; + + glm::u8vec4 const Source(1, 2, 3, 4); + + glm::uint32 const Packed = glm::packUint4x8(Source); + Error += Packed != 0 ? 0 : 1; + + glm::u8vec4 const Unpacked = glm::unpackUint4x8(Packed); + Error += Source == Unpacked ? 0 : 1; + + return Error; +} + +int test_packUint2x16() +{ + int Error = 0; + + glm::u16vec2 const Source(1, 2); + + glm::uint32 const Packed = glm::packUint2x16(Source); + Error += Packed != 0 ? 0 : 1; + + glm::u16vec2 const Unpacked = glm::unpackUint2x16(Packed); + Error += Source == Unpacked ? 0 : 1; + + return Error; +} + +int test_packUint4x16() +{ + int Error = 0; + + glm::u16vec4 const Source(1, 2, 3, 4); + + glm::uint64 const Packed = glm::packUint4x16(Source); + Error += Packed != 0 ? 0 : 1; + + glm::u16vec4 const Unpacked = glm::unpackUint4x16(Packed); + Error += Source == Unpacked ? 0 : 1; + + return Error; +} + +int test_packUint2x32() +{ + int Error = 0; + + glm::u32vec2 const Source(1, 2); + + glm::uint64 const Packed = glm::packUint2x32(Source); + Error += Packed != 0 ? 0 : 1; + + glm::u32vec2 const Unpacked = glm::unpackUint2x32(Packed); + Error += Source == Unpacked ? 0 : 1; + + return Error; +} + +int test_packInt2x8() +{ + int Error = 0; + + glm::i8vec2 const Source(1, 2); + + glm::int16 const Packed = glm::packInt2x8(Source); + Error += Packed != 0 ? 0 : 1; + + glm::i8vec2 const Unpacked = glm::unpackInt2x8(Packed); + Error += Source == Unpacked ? 0 : 1; + + return Error; +} + +int test_packInt4x8() +{ + int Error = 0; + + glm::i8vec4 const Source(1, 2, 3, 4); + + glm::int32 const Packed = glm::packInt4x8(Source); + Error += Packed != 0 ? 0 : 1; + + glm::i8vec4 const Unpacked = glm::unpackInt4x8(Packed); + Error += Source == Unpacked ? 0 : 1; + + return Error; +} + +int test_packInt2x16() +{ + int Error = 0; + + glm::i16vec2 const Source(1, 2); + + glm::int32 const Packed = glm::packInt2x16(Source); + Error += Packed != 0 ? 0 : 1; + + glm::i16vec2 const Unpacked = glm::unpackInt2x16(Packed); + Error += Source == Unpacked ? 0 : 1; + + return Error; +} + +int test_packInt4x16() +{ + int Error = 0; + + glm::i16vec4 const Source(1, 2, 3, 4); + + glm::int64 const Packed = glm::packInt4x16(Source); + Error += Packed != 0 ? 0 : 1; + + glm::i16vec4 const Unpacked = glm::unpackInt4x16(Packed); + Error += Source == Unpacked ? 0 : 1; + + return Error; +} + +int test_packInt2x32() +{ + int Error = 0; + + glm::i32vec2 const Source(1, 2); + + glm::int64 const Packed = glm::packInt2x32(Source); + Error += Packed != 0 ? 0 : 1; + + glm::i32vec2 const Unpacked = glm::unpackInt2x32(Packed); + Error += Source == Unpacked ? 0 : 1; + + return Error; +} + +int main() +{ + int Error = 0; + + Error += test_packUnorm(); + Error += test_packSnorm(); + + Error += test_packSnorm1x16(); + Error += test_packSnorm2x16(); + Error += test_packSnorm4x16(); + + Error += test_packSnorm1x8(); + Error += test_packSnorm2x8(); + Error += test_packSnorm4x8(); + + Error += test_packUnorm1x16(); + Error += test_packUnorm2x16(); + Error += test_packUnorm4x16(); + + Error += test_packUnorm1x8(); + Error += test_packUnorm2x8(); + Error += test_packUnorm4x8(); + + Error += test_packUnorm2x4(); + Error += test_packUnorm4x4(); + Error += test_packUnorm3x5_1x1(); + Error += test_packUnorm1x5_1x6_1x5(); + Error += test_packUnorm2x3_1x2(); + + Error += test_packUint2x8(); + Error += test_packUint4x8(); + Error += test_packUint2x16(); + Error += test_packUint4x16(); + Error += test_packUint2x32(); + + Error += test_packInt2x8(); + Error += test_packInt4x8(); + Error += test_packInt2x16(); + Error += test_packInt4x16(); + Error += test_packInt2x32(); + + Error += test_F2x11_1x10(); + Error += test_F3x9_E1x5(); + Error += test_RGBM(); + Error += test_Unorm3x10_1x2(); + Error += test_Snorm3x10_1x2(); + + Error += test_I3x10_1x2(); + Error += test_U3x10_1x2(); + Error += test_Half1x16(); + Error += test_Half4x16(); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtc/gtc_quaternion.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtc/gtc_quaternion.cpp new file mode 100644 index 0000000000000000000000000000000000000000..47b5dd251f2c662f8f1239867a035722eacac2ba --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtc/gtc_quaternion.cpp @@ -0,0 +1,345 @@ +#include +#include +#include +#include +#include +#include +#include +#include + +int test_quat_angle() +{ + int Error = 0; + + { + glm::quat Q = glm::angleAxis(glm::pi() * 0.25f, glm::vec3(0, 0, 1)); + glm::quat N = glm::normalize(Q); + float L = glm::length(N); + Error += glm::equal(L, 1.0f, 0.01f) ? 0 : 1; + float A = glm::angle(N); + Error += glm::equal(A, glm::pi() * 0.25f, 0.01f) ? 0 : 1; + } + { + glm::quat Q = glm::angleAxis(glm::pi() * 0.25f, glm::normalize(glm::vec3(0, 1, 1))); + glm::quat N = glm::normalize(Q); + float L = glm::length(N); + Error += glm::equal(L, 1.0f, 0.01f) ? 0 : 1; + float A = glm::angle(N); + Error += glm::equal(A, glm::pi() * 0.25f, 0.01f) ? 0 : 1; + } + { + glm::quat Q = glm::angleAxis(glm::pi() * 0.25f, glm::normalize(glm::vec3(1, 2, 3))); + glm::quat N = glm::normalize(Q); + float L = glm::length(N); + Error += glm::equal(L, 1.0f, 0.01f) ? 0 : 1; + float A = glm::angle(N); + Error += glm::equal(A, glm::pi() * 0.25f, 0.01f) ? 0 : 1; + } + + return Error; +} + +int test_quat_angleAxis() +{ + int Error = 0; + + glm::quat A = glm::angleAxis(0.f, glm::vec3(0.f, 0.f, 1.f)); + glm::quat B = glm::angleAxis(glm::pi() * 0.5f, glm::vec3(0, 0, 1)); + glm::quat C = glm::mix(A, B, 0.5f); + glm::quat D = glm::angleAxis(glm::pi() * 0.25f, glm::vec3(0, 0, 1)); + + Error += glm::equal(C.x, D.x, 0.01f) ? 0 : 1; + Error += glm::equal(C.y, D.y, 0.01f) ? 0 : 1; + Error += glm::equal(C.z, D.z, 0.01f) ? 0 : 1; + Error += glm::equal(C.w, D.w, 0.01f) ? 0 : 1; + + return Error; +} + +int test_quat_mix() +{ + int Error = 0; + + glm::quat A = glm::angleAxis(0.f, glm::vec3(0.f, 0.f, 1.f)); + glm::quat B = glm::angleAxis(glm::pi() * 0.5f, glm::vec3(0, 0, 1)); + glm::quat C = glm::mix(A, B, 0.5f); + glm::quat D = glm::angleAxis(glm::pi() * 0.25f, glm::vec3(0, 0, 1)); + + Error += glm::equal(C.x, D.x, 0.01f) ? 0 : 1; + Error += glm::equal(C.y, D.y, 0.01f) ? 0 : 1; + Error += glm::equal(C.z, D.z, 0.01f) ? 0 : 1; + Error += glm::equal(C.w, D.w, 0.01f) ? 0 : 1; + + return Error; +} + +int test_quat_normalize() +{ + int Error(0); + + { + glm::quat Q = glm::angleAxis(glm::pi() * 0.25f, glm::vec3(0, 0, 1)); + glm::quat N = glm::normalize(Q); + float L = glm::length(N); + Error += glm::equal(L, 1.0f, 0.000001f) ? 0 : 1; + } + { + glm::quat Q = glm::angleAxis(glm::pi() * 0.25f, glm::vec3(0, 0, 2)); + glm::quat N = glm::normalize(Q); + float L = glm::length(N); + Error += glm::equal(L, 1.0f, 0.000001f) ? 0 : 1; + } + { + glm::quat Q = glm::angleAxis(glm::pi() * 0.25f, glm::vec3(1, 2, 3)); + glm::quat N = glm::normalize(Q); + float L = glm::length(N); + Error += glm::equal(L, 1.0f, 0.000001f) ? 0 : 1; + } + + return Error; +} + +int test_quat_euler() +{ + int Error = 0; + + { + glm::quat q(1.0f, 0.0f, 0.0f, 1.0f); + float Roll = glm::roll(q); + float Pitch = glm::pitch(q); + float Yaw = glm::yaw(q); + glm::vec3 Angles = glm::eulerAngles(q); + Error += glm::all(glm::equal(Angles, glm::vec3(Pitch, Yaw, Roll), 0.000001f)) ? 0 : 1; + } + + { + glm::dquat q(1.0, 0.0, 0.0, 1.0); + double Roll = glm::roll(q); + double Pitch = glm::pitch(q); + double Yaw = glm::yaw(q); + glm::dvec3 Angles = glm::eulerAngles(q); + Error += glm::all(glm::equal(Angles, glm::dvec3(Pitch, Yaw, Roll), 0.000001)) ? 0 : 1; + } + + return Error; +} + +int test_quat_slerp() +{ + int Error = 0; + + float const Epsilon = 0.0001f;//glm::epsilon(); + + float sqrt2 = std::sqrt(2.0f)/2.0f; + glm::quat id(static_cast(1), static_cast(0), static_cast(0), static_cast(0)); + glm::quat Y90rot(sqrt2, 0.0f, sqrt2, 0.0f); + glm::quat Y180rot(0.0f, 0.0f, 1.0f, 0.0f); + + // Testing a == 0 + // Must be id + glm::quat id2 = glm::slerp(id, Y90rot, 0.0f); + Error += glm::all(glm::equal(id, id2, Epsilon)) ? 0 : 1; + + // Testing a == 1 + // Must be 90 rotation on Y : 0 0.7 0 0.7 + glm::quat Y90rot2 = glm::slerp(id, Y90rot, 1.0f); + Error += glm::all(glm::equal(Y90rot, Y90rot2, Epsilon)) ? 0 : 1; + + // Testing standard, easy case + // Must be 45 rotation on Y : 0 0.38 0 0.92 + glm::quat Y45rot1 = glm::slerp(id, Y90rot, 0.5f); + + // Testing reverse case + // Must be 45 rotation on Y : 0 0.38 0 0.92 + glm::quat Ym45rot2 = glm::slerp(Y90rot, id, 0.5f); + + // Testing against full circle around the sphere instead of shortest path + // Must be 45 rotation on Y + // certainly not a 135 rotation + glm::quat Y45rot3 = glm::slerp(id , -Y90rot, 0.5f); + float Y45angle3 = glm::angle(Y45rot3); + Error += glm::equal(Y45angle3, glm::pi() * 0.25f, Epsilon) ? 0 : 1; + Error += glm::all(glm::equal(Ym45rot2, Y45rot3, Epsilon)) ? 0 : 1; + + // Same, but inverted + // Must also be 45 rotation on Y : 0 0.38 0 0.92 + // -0 -0.38 -0 -0.92 is ok too + glm::quat Y45rot4 = glm::slerp(-Y90rot, id, 0.5f); + Error += glm::all(glm::equal(Ym45rot2, -Y45rot4, Epsilon)) ? 0 : 1; + + // Testing q1 = q2 + // Must be 90 rotation on Y : 0 0.7 0 0.7 + glm::quat Y90rot3 = glm::slerp(Y90rot, Y90rot, 0.5f); + Error += glm::all(glm::equal(Y90rot, Y90rot3, Epsilon)) ? 0 : 1; + + // Testing 180 rotation + // Must be 90 rotation on almost any axis that is on the XZ plane + glm::quat XZ90rot = glm::slerp(id, -Y90rot, 0.5f); + float XZ90angle = glm::angle(XZ90rot); // Must be PI/4 = 0.78; + Error += glm::equal(XZ90angle, glm::pi() * 0.25f, Epsilon) ? 0 : 1; + + // Testing almost equal quaternions (this test should pass through the linear interpolation) + // Must be 0 0.00X 0 0.99999 + glm::quat almostid = glm::slerp(id, glm::angleAxis(0.1f, glm::vec3(0.0f, 1.0f, 0.0f)), 0.5f); + + // Testing quaternions with opposite sign + { + glm::quat a(-1, 0, 0, 0); + + glm::quat result = glm::slerp(a, id, 0.5f); + + Error += glm::equal(glm::pow(glm::dot(id, result), 2.f), 1.f, 0.01f) ? 0 : 1; + } + + return Error; +} + +int test_quat_slerp_spins() +{ + int Error = 0; + + float const Epsilon = 0.0001f;//glm::epsilon(); + + float sqrt2 = std::sqrt(2.0f) / 2.0f; + glm::quat id(static_cast(1), static_cast(0), static_cast(0), static_cast(0)); + glm::quat Y90rot(sqrt2, 0.0f, sqrt2, 0.0f); + glm::quat Y180rot(0.0f, 0.0f, 1.0f, 0.0f); + + // Testing a == 0, k == 1 + // Must be id + glm::quat id2 = glm::slerp(id, id, 1.0f, 1); + Error += glm::all(glm::equal(id, id2, Epsilon)) ? 0 : 1; + + // Testing a == 1, k == 2 + // Must be id + glm::quat id3 = glm::slerp(id, id, 1.0f, 2); + Error += glm::all(glm::equal(id, id3, Epsilon)) ? 0 : 1; + + // Testing a == 1, k == 1 + // Must be 90 rotation on Y : 0 0.7 0 0.7 + // Negative quaternion is representing same orientation + glm::quat Y90rot2 = glm::slerp(id, Y90rot, 1.0f, 1); + Error += glm::all(glm::equal(Y90rot, -Y90rot2, Epsilon)) ? 0 : 1; + + // Testing a == 1, k == 2 + // Must be id + glm::quat Y90rot3 = glm::slerp(id, Y90rot, 8.0f / 9.0f, 2); + Error += glm::all(glm::equal(id, Y90rot3, Epsilon)) ? 0 : 1; + + // Testing a == 1, k == 1 + // Must be 90 rotation on Y : 0 0.7 0 0.7 + glm::quat Y90rot4 = glm::slerp(id, Y90rot, 0.2f, 1); + Error += glm::all(glm::equal(Y90rot, Y90rot4, Epsilon)) ? 0 : 1; + + // Testing reverse case + // Must be 45 rotation on Y : 0 0.38 0 0.92 + // Negative quaternion is representing same orientation + glm::quat Ym45rot2 = glm::slerp(Y90rot, id, 0.9f, 1); + glm::quat Ym45rot3 = glm::slerp(Y90rot, id, 0.5f); + Error += glm::all(glm::equal(-Ym45rot2, Ym45rot3, Epsilon)) ? 0 : 1; + + // Testing against full circle around the sphere instead of shortest path + // Must be 45 rotation on Y + // certainly not a 135 rotation + glm::quat Y45rot3 = glm::slerp(id, -Y90rot, 0.5f, 0); + float Y45angle3 = glm::angle(Y45rot3); + Error += glm::equal(Y45angle3, glm::pi() * 0.25f, Epsilon) ? 0 : 1; + Error += glm::all(glm::equal(Ym45rot3, Y45rot3, Epsilon)) ? 0 : 1; + + // Same, but inverted + // Must also be 45 rotation on Y : 0 0.38 0 0.92 + // -0 -0.38 -0 -0.92 is ok too + glm::quat Y45rot4 = glm::slerp(-Y90rot, id, 0.5f, 0); + Error += glm::all(glm::equal(Ym45rot2, Y45rot4, Epsilon)) ? 0 : 1; + + // Testing q1 = q2 k == 2 + // Must be 90 rotation on Y : 0 0.7 0 0.7 + glm::quat Y90rot5 = glm::slerp(Y90rot, Y90rot, 0.5f, 2); + Error += glm::all(glm::equal(Y90rot, Y90rot5, Epsilon)) ? 0 : 1; + + // Testing 180 rotation + // Must be 90 rotation on almost any axis that is on the XZ plane + glm::quat XZ90rot = glm::slerp(id, -Y90rot, 0.5f, 1); + float XZ90angle = glm::angle(XZ90rot); // Must be PI/4 = 0.78; + Error += glm::equal(XZ90angle, glm::pi() * 1.25f, Epsilon) ? 0 : 1; + + // Testing rotation over long arc + // Distance from id to 90 is 270, so 2/3 of it should be 180 + // Negative quaternion is representing same orientation + glm::quat Neg90rot = glm::slerp(id, Y90rot, 2.0f / 3.0f, -1); + Error += glm::all(glm::equal(Y180rot, -Neg90rot, Epsilon)) ? 0 : 1; + + return Error; +} + +static int test_quat_mul_vec() +{ + int Error(0); + + glm::quat q = glm::angleAxis(glm::pi() * 0.5f, glm::vec3(0, 0, 1)); + glm::vec3 v(1, 0, 0); + glm::vec3 u(q * v); + glm::vec3 w(u * q); + + Error += glm::all(glm::equal(v, w, 0.01f)) ? 0 : 1; + + return Error; +} + +static int test_mul() +{ + int Error = 0; + + glm::quat temp1 = glm::normalize(glm::quat(1.0f, glm::vec3(0.0, 1.0, 0.0))); + glm::quat temp2 = glm::normalize(glm::quat(0.5f, glm::vec3(1.0, 0.0, 0.0))); + + glm::vec3 transformed0 = (temp1 * glm::vec3(0.0, 1.0, 0.0) * glm::inverse(temp1)); + glm::vec3 temp4 = temp2 * transformed0 * glm::inverse(temp2); + + glm::quat temp5 = glm::normalize(temp1 * temp2); + glm::vec3 temp6 = temp5 * glm::vec3(0.0, 1.0, 0.0) * glm::inverse(temp5); + + glm::quat temp7(1.0f, glm::vec3(0.0, 1.0, 0.0)); + + temp7 *= temp5; + temp7 *= glm::inverse(temp5); + + Error += glm::any(glm::notEqual(temp7, glm::quat(1.0f, glm::vec3(0.0, 1.0, 0.0)), glm::epsilon())) ? 1 : 0; + + return Error; +} + +int test_identity() +{ + int Error = 0; + + glm::quat const Q = glm::identity(); + + Error += glm::all(glm::equal(Q, glm::quat(1, 0, 0, 0), 0.0001f)) ? 0 : 1; + Error += glm::any(glm::notEqual(Q, glm::quat(1, 0, 0, 0), 0.0001f)) ? 1 : 0; + + glm::mat4 const M = glm::identity(); + glm::mat4 const N(1.0f); + + Error += glm::all(glm::equal(M, N, 0.0001f)) ? 0 : 1; + + return Error; +} + +int main() +{ + int Error = 0; + + Error += test_mul(); + Error += test_quat_mul_vec(); + Error += test_quat_angle(); + Error += test_quat_angleAxis(); + Error += test_quat_mix(); + Error += test_quat_normalize(); + Error += test_quat_euler(); + Error += test_quat_slerp(); + Error += test_quat_slerp_spins(); + Error += test_identity(); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtc/gtc_random.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtc/gtc_random.cpp new file mode 100644 index 0000000000000000000000000000000000000000..a68b5e3bfae77fe66992f57f3250bd4ffebd2eed --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtc/gtc_random.cpp @@ -0,0 +1,381 @@ +#define GLM_FORCE_DEFAULT_ALIGNED_GENTYPES +#include +#include +#include +#if GLM_LANG & GLM_LANG_CXX0X_FLAG +# include +#endif + +std::size_t const TestSamples = 10000; + +int test_linearRand() +{ + int Error = 0; + + glm::int32 const Min = 16; + glm::int32 const Max = 32; + + { + glm::u8vec2 AMin(std::numeric_limits::max()); + glm::u8vec2 AMax(std::numeric_limits::min()); + { + for(std::size_t i = 0; i < TestSamples; ++i) + { + glm::u8vec2 A = glm::linearRand(glm::u8vec2(Min), glm::u8vec2(Max)); + AMin = glm::min(AMin, A); + AMax = glm::max(AMax, A); + + if(!glm::all(glm::lessThanEqual(A, glm::u8vec2(Max)))) + ++Error; + if(!glm::all(glm::greaterThanEqual(A, glm::u8vec2(Min)))) + ++Error; + assert(!Error); + } + + Error += glm::all(glm::equal(AMin, glm::u8vec2(Min))) ? 0 : 1; + Error += glm::all(glm::equal(AMax, glm::u8vec2(Max))) ? 0 : 1; + assert(!Error); + } + + glm::u16vec2 BMin(std::numeric_limits::max()); + glm::u16vec2 BMax(std::numeric_limits::min()); + { + for(std::size_t i = 0; i < TestSamples; ++i) + { + glm::u16vec2 B = glm::linearRand(glm::u16vec2(Min), glm::u16vec2(Max)); + BMin = glm::min(BMin, B); + BMax = glm::max(BMax, B); + + if(!glm::all(glm::lessThanEqual(B, glm::u16vec2(Max)))) + ++Error; + if(!glm::all(glm::greaterThanEqual(B, glm::u16vec2(Min)))) + ++Error; + assert(!Error); + } + + Error += glm::all(glm::equal(BMin, glm::u16vec2(Min))) ? 0 : 1; + Error += glm::all(glm::equal(BMax, glm::u16vec2(Max))) ? 0 : 1; + assert(!Error); + } + + glm::u32vec2 CMin(std::numeric_limits::max()); + glm::u32vec2 CMax(std::numeric_limits::min()); + { + for(std::size_t i = 0; i < TestSamples; ++i) + { + glm::u32vec2 C = glm::linearRand(glm::u32vec2(Min), glm::u32vec2(Max)); + CMin = glm::min(CMin, C); + CMax = glm::max(CMax, C); + + if(!glm::all(glm::lessThanEqual(C, glm::u32vec2(Max)))) + ++Error; + if(!glm::all(glm::greaterThanEqual(C, glm::u32vec2(Min)))) + ++Error; + assert(!Error); + } + + Error += glm::all(glm::equal(CMin, glm::u32vec2(Min))) ? 0 : 1; + Error += glm::all(glm::equal(CMax, glm::u32vec2(Max))) ? 0 : 1; + assert(!Error); + } + + glm::u64vec2 DMin(std::numeric_limits::max()); + glm::u64vec2 DMax(std::numeric_limits::min()); + { + for(std::size_t i = 0; i < TestSamples; ++i) + { + glm::u64vec2 D = glm::linearRand(glm::u64vec2(Min), glm::u64vec2(Max)); + DMin = glm::min(DMin, D); + DMax = glm::max(DMax, D); + + if(!glm::all(glm::lessThanEqual(D, glm::u64vec2(Max)))) + ++Error; + if(!glm::all(glm::greaterThanEqual(D, glm::u64vec2(Min)))) + ++Error; + assert(!Error); + } + + Error += glm::all(glm::equal(DMin, glm::u64vec2(Min))) ? 0 : 1; + Error += glm::all(glm::equal(DMax, glm::u64vec2(Max))) ? 0 : 1; + assert(!Error); + } + } + + { + glm::i8vec2 AMin(std::numeric_limits::max()); + glm::i8vec2 AMax(std::numeric_limits::min()); + { + for(std::size_t i = 0; i < TestSamples; ++i) + { + glm::i8vec2 A = glm::linearRand(glm::i8vec2(Min), glm::i8vec2(Max)); + AMin = glm::min(AMin, A); + AMax = glm::max(AMax, A); + + if(!glm::all(glm::lessThanEqual(A, glm::i8vec2(Max)))) + ++Error; + if(!glm::all(glm::greaterThanEqual(A, glm::i8vec2(Min)))) + ++Error; + assert(!Error); + } + + Error += glm::all(glm::equal(AMin, glm::i8vec2(Min))) ? 0 : 1; + Error += glm::all(glm::equal(AMax, glm::i8vec2(Max))) ? 0 : 1; + assert(!Error); + } + + glm::i16vec2 BMin(std::numeric_limits::max()); + glm::i16vec2 BMax(std::numeric_limits::min()); + { + for(std::size_t i = 0; i < TestSamples; ++i) + { + glm::i16vec2 B = glm::linearRand(glm::i16vec2(Min), glm::i16vec2(Max)); + BMin = glm::min(BMin, B); + BMax = glm::max(BMax, B); + + if(!glm::all(glm::lessThanEqual(B, glm::i16vec2(Max)))) + ++Error; + if(!glm::all(glm::greaterThanEqual(B, glm::i16vec2(Min)))) + ++Error; + assert(!Error); + } + + Error += glm::all(glm::equal(BMin, glm::i16vec2(Min))) ? 0 : 1; + Error += glm::all(glm::equal(BMax, glm::i16vec2(Max))) ? 0 : 1; + assert(!Error); + } + + glm::i32vec2 CMin(std::numeric_limits::max()); + glm::i32vec2 CMax(std::numeric_limits::min()); + { + for(std::size_t i = 0; i < TestSamples; ++i) + { + glm::i32vec2 C = glm::linearRand(glm::i32vec2(Min), glm::i32vec2(Max)); + CMin = glm::min(CMin, C); + CMax = glm::max(CMax, C); + + if(!glm::all(glm::lessThanEqual(C, glm::i32vec2(Max)))) + ++Error; + if(!glm::all(glm::greaterThanEqual(C, glm::i32vec2(Min)))) + ++Error; + assert(!Error); + } + + Error += glm::all(glm::equal(CMin, glm::i32vec2(Min))) ? 0 : 1; + Error += glm::all(glm::equal(CMax, glm::i32vec2(Max))) ? 0 : 1; + assert(!Error); + } + + glm::i64vec2 DMin(std::numeric_limits::max()); + glm::i64vec2 DMax(std::numeric_limits::min()); + { + for(std::size_t i = 0; i < TestSamples; ++i) + { + glm::i64vec2 D = glm::linearRand(glm::i64vec2(Min), glm::i64vec2(Max)); + DMin = glm::min(DMin, D); + DMax = glm::max(DMax, D); + + if(!glm::all(glm::lessThanEqual(D, glm::i64vec2(Max)))) + ++Error; + if(!glm::all(glm::greaterThanEqual(D, glm::i64vec2(Min)))) + ++Error; + assert(!Error); + } + + Error += glm::all(glm::equal(DMin, glm::i64vec2(Min))) ? 0 : 1; + Error += glm::all(glm::equal(DMax, glm::i64vec2(Max))) ? 0 : 1; + assert(!Error); + } + } + + for(std::size_t i = 0; i < TestSamples; ++i) + { + glm::f32vec2 const A(glm::linearRand(glm::f32vec2(static_cast(Min)), glm::f32vec2(static_cast(Max)))); + if(!glm::all(glm::lessThanEqual(A, glm::f32vec2(static_cast(Max))))) + ++Error; + if(!glm::all(glm::greaterThanEqual(A, glm::f32vec2(static_cast(Min))))) + ++Error; + + glm::f64vec2 const B(glm::linearRand(glm::f64vec2(Min), glm::f64vec2(Max))); + if(!glm::all(glm::lessThanEqual(B, glm::f64vec2(Max)))) + ++Error; + if(!glm::all(glm::greaterThanEqual(B, glm::f64vec2(Min)))) + ++Error; + assert(!Error); + } + + { + float ResultFloat = 0.0f; + double ResultDouble = 0.0; + for(std::size_t i = 0; i < TestSamples; ++i) + { + ResultFloat += glm::linearRand(-1.0f, 1.0f); + ResultDouble += glm::linearRand(-1.0, 1.0); + } + + Error += glm::epsilonEqual(ResultFloat, 0.0f, 0.0001f); + Error += glm::epsilonEqual(ResultDouble, 0.0, 0.0001); + assert(!Error); + } + + return Error; +} + +int test_circularRand() +{ + int Error = 0; + + { + std::size_t Max = TestSamples; + float ResultFloat = 0.0f; + double ResultDouble = 0.0; + double Radius = 2.0; + + for(std::size_t i = 0; i < Max; ++i) + { + ResultFloat += glm::length(glm::circularRand(1.0f)); + ResultDouble += glm::length(glm::circularRand(Radius)); + } + + Error += glm::epsilonEqual(ResultFloat, float(Max), 0.01f) ? 0 : 1; + Error += glm::epsilonEqual(ResultDouble, double(Max) * double(Radius), 0.01) ? 0 : 1; + assert(!Error); + } + + return Error; +} + +int test_sphericalRand() +{ + int Error = 0; + + { + std::size_t Max = TestSamples; + float ResultFloatA = 0.0f; + float ResultFloatB = 0.0f; + float ResultFloatC = 0.0f; + double ResultDoubleA = 0.0; + double ResultDoubleB = 0.0; + double ResultDoubleC = 0.0; + + for(std::size_t i = 0; i < Max; ++i) + { + ResultFloatA += glm::length(glm::sphericalRand(1.0f)); + ResultDoubleA += glm::length(glm::sphericalRand(1.0)); + ResultFloatB += glm::length(glm::sphericalRand(2.0f)); + ResultDoubleB += glm::length(glm::sphericalRand(2.0)); + ResultFloatC += glm::length(glm::sphericalRand(3.0f)); + ResultDoubleC += glm::length(glm::sphericalRand(3.0)); + } + + Error += glm::epsilonEqual(ResultFloatA, float(Max), 0.01f) ? 0 : 1; + Error += glm::epsilonEqual(ResultDoubleA, double(Max), 0.0001) ? 0 : 1; + Error += glm::epsilonEqual(ResultFloatB, float(Max * 2), 0.01f) ? 0 : 1; + Error += glm::epsilonEqual(ResultDoubleB, double(Max * 2), 0.0001) ? 0 : 1; + Error += glm::epsilonEqual(ResultFloatC, float(Max * 3), 0.01f) ? 0 : 1; + Error += glm::epsilonEqual(ResultDoubleC, double(Max * 3), 0.01) ? 0 : 1; + assert(!Error); + } + + return Error; +} + +int test_diskRand() +{ + int Error = 0; + + { + float ResultFloat = 0.0f; + double ResultDouble = 0.0; + + for(std::size_t i = 0; i < TestSamples; ++i) + { + ResultFloat += glm::length(glm::diskRand(2.0f)); + ResultDouble += glm::length(glm::diskRand(2.0)); + } + + Error += ResultFloat < float(TestSamples) * 2.f ? 0 : 1; + Error += ResultDouble < double(TestSamples) * 2.0 ? 0 : 1; + assert(!Error); + } + + return Error; +} + +int test_ballRand() +{ + int Error = 0; + + { + float ResultFloat = 0.0f; + double ResultDouble = 0.0; + + for(std::size_t i = 0; i < TestSamples; ++i) + { + ResultFloat += glm::length(glm::ballRand(2.0f)); + ResultDouble += glm::length(glm::ballRand(2.0)); + } + + Error += ResultFloat < float(TestSamples) * 2.f ? 0 : 1; + Error += ResultDouble < double(TestSamples) * 2.0 ? 0 : 1; + assert(!Error); + } + + return Error; +} +/* +#if(GLM_LANG & GLM_LANG_CXX0X_FLAG) +int test_grid() +{ + int Error = 0; + + typedef std::array colors; + typedef std::array grid; + + grid Grid; + colors Colors; + + grid GridBest; + colors ColorsBest; + + while(true) + { + for(std::size_t i = 0; i < Grid.size(); ++i) + Grid[i] = int(glm::linearRand(0.0, 8.0 * 8.0 * 8.0 - 1.0) / 64.0); + + for(std::size_t i = 0; i < Grid.size(); ++i) + ++Colors[Grid[i]]; + + bool Exit = true; + for(std::size_t i = 0; i < Colors.size(); ++i) + { + if(Colors[i] == 8) + continue; + + Exit = false; + break; + } + + if(Exit == true) + break; + } + + return Error; +} +#endif +*/ +int main() +{ + int Error = 0; + + Error += test_linearRand(); + Error += test_circularRand(); + Error += test_sphericalRand(); + Error += test_diskRand(); + Error += test_ballRand(); +/* +#if(GLM_LANG & GLM_LANG_CXX0X_FLAG) + Error += test_grid(); +#endif +*/ + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtc/gtc_reciprocal.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtc/gtc_reciprocal.cpp new file mode 100644 index 0000000000000000000000000000000000000000..9e83a64b84dec5ee96d1e174793921ad737a3dd7 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtc/gtc_reciprocal.cpp @@ -0,0 +1,8 @@ +#include +#include + +int main() +{ + return 0; +} + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtc/gtc_round.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtc/gtc_round.cpp new file mode 100644 index 0000000000000000000000000000000000000000..d1c614a8d3267fbc7378e7c9cad55c259bb90560 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtc/gtc_round.cpp @@ -0,0 +1,458 @@ +#include +#include +#include +#include +#include +#include +#include + +namespace isPowerOfTwo +{ + template + struct type + { + genType Value; + bool Return; + }; + + int test_int16() + { + type const Data[] = + { + {0x0001, true}, + {0x0002, true}, + {0x0004, true}, + {0x0080, true}, + {0x0000, true}, + {0x0003, false} + }; + + int Error(0); + + for(std::size_t i = 0, n = sizeof(Data) / sizeof(type); i < n; ++i) + { + bool Result = glm::isPowerOfTwo(Data[i].Value); + Error += Data[i].Return == Result ? 0 : 1; + } + + return Error; + } + + int test_uint16() + { + type const Data[] = + { + {0x0001, true}, + {0x0002, true}, + {0x0004, true}, + {0x0000, true}, + {0x0000, true}, + {0x0003, false} + }; + + int Error(0); + + for(std::size_t i = 0, n = sizeof(Data) / sizeof(type); i < n; ++i) + { + bool Result = glm::isPowerOfTwo(Data[i].Value); + Error += Data[i].Return == Result ? 0 : 1; + } + + return Error; + } + + int test_int32() + { + type const Data[] = + { + {0x00000001, true}, + {0x00000002, true}, + {0x00000004, true}, + {0x0000000f, false}, + {0x00000000, true}, + {0x00000003, false} + }; + + int Error(0); + + for(std::size_t i = 0, n = sizeof(Data) / sizeof(type); i < n; ++i) + { + bool Result = glm::isPowerOfTwo(Data[i].Value); + Error += Data[i].Return == Result ? 0 : 1; + } + + for(std::size_t i = 0, n = sizeof(Data) / sizeof(type); i < n; ++i) + { + glm::bvec1 Result = glm::isPowerOfTwo(glm::ivec1(Data[i].Value)); + Error += glm::all(glm::equal(glm::bvec1(Data[i].Return), Result)) ? 0 : 1; + } + + for(std::size_t i = 0, n = sizeof(Data) / sizeof(type); i < n; ++i) + { + glm::bvec2 Result = glm::isPowerOfTwo(glm::ivec2(Data[i].Value)); + Error += glm::all(glm::equal(glm::bvec2(Data[i].Return), Result)) ? 0 : 1; + } + + for(std::size_t i = 0, n = sizeof(Data) / sizeof(type); i < n; ++i) + { + glm::bvec3 Result = glm::isPowerOfTwo(glm::ivec3(Data[i].Value)); + Error += glm::all(glm::equal(glm::bvec3(Data[i].Return), Result)) ? 0 : 1; + } + + for(std::size_t i = 0, n = sizeof(Data) / sizeof(type); i < n; ++i) + { + glm::bvec4 Result = glm::isPowerOfTwo(glm::ivec4(Data[i].Value)); + Error += glm::all(glm::equal(glm::bvec4(Data[i].Return), Result)) ? 0 : 1; + } + + return Error; + } + + int test_uint32() + { + type const Data[] = + { + {0x00000001, true}, + {0x00000002, true}, + {0x00000004, true}, + {0x80000000, true}, + {0x00000000, true}, + {0x00000003, false} + }; + + int Error(0); + + for(std::size_t i = 0, n = sizeof(Data) / sizeof(type); i < n; ++i) + { + bool Result = glm::isPowerOfTwo(Data[i].Value); + Error += Data[i].Return == Result ? 0 : 1; + } + + return Error; + } + + int test() + { + int Error(0); + + Error += test_int16(); + Error += test_uint16(); + Error += test_int32(); + Error += test_uint32(); + + return Error; + } +}//isPowerOfTwo + +namespace ceilPowerOfTwo_advanced +{ + template + GLM_FUNC_QUALIFIER genIUType highestBitValue(genIUType Value) + { + genIUType tmp = Value; + genIUType result = genIUType(0); + while(tmp) + { + result = (tmp & (~tmp + 1)); // grab lowest bit + tmp &= ~result; // clear lowest bit + } + return result; + } + + template + GLM_FUNC_QUALIFIER genType ceilPowerOfTwo_loop(genType value) + { + return glm::isPowerOfTwo(value) ? value : highestBitValue(value) << 1; + } + + template + struct type + { + genType Value; + genType Return; + }; + + int test_int32() + { + type const Data[] = + { + {0x0000ffff, 0x00010000}, + {-3, -4}, + {-8, -8}, + {0x00000001, 0x00000001}, + {0x00000002, 0x00000002}, + {0x00000004, 0x00000004}, + {0x00000007, 0x00000008}, + {0x0000fff0, 0x00010000}, + {0x0000f000, 0x00010000}, + {0x08000000, 0x08000000}, + {0x00000000, 0x00000000}, + {0x00000003, 0x00000004} + }; + + int Error(0); + + for(std::size_t i = 0, n = sizeof(Data) / sizeof(type); i < n; ++i) + { + glm::int32 Result = glm::ceilPowerOfTwo(Data[i].Value); + Error += Data[i].Return == Result ? 0 : 1; + } + + return Error; + } + + int test_uint32() + { + type const Data[] = + { + {0x00000001, 0x00000001}, + {0x00000002, 0x00000002}, + {0x00000004, 0x00000004}, + {0x00000007, 0x00000008}, + {0x0000ffff, 0x00010000}, + {0x0000fff0, 0x00010000}, + {0x0000f000, 0x00010000}, + {0x80000000, 0x80000000}, + {0x00000000, 0x00000000}, + {0x00000003, 0x00000004} + }; + + int Error(0); + + for(std::size_t i = 0, n = sizeof(Data) / sizeof(type); i < n; ++i) + { + glm::uint32 Result = glm::ceilPowerOfTwo(Data[i].Value); + Error += Data[i].Return == Result ? 0 : 1; + } + + return Error; + } + + int perf() + { + int Error(0); + + std::vector v; + v.resize(100000000); + + std::clock_t Timestramp0 = std::clock(); + + for(glm::uint32 i = 0, n = static_cast(v.size()); i < n; ++i) + v[i] = ceilPowerOfTwo_loop(i); + + std::clock_t Timestramp1 = std::clock(); + + for(glm::uint32 i = 0, n = static_cast(v.size()); i < n; ++i) + v[i] = glm::ceilPowerOfTwo(i); + + std::clock_t Timestramp2 = std::clock(); + + std::printf("ceilPowerOfTwo_loop: %d clocks\n", static_cast(Timestramp1 - Timestramp0)); + std::printf("glm::ceilPowerOfTwo: %d clocks\n", static_cast(Timestramp2 - Timestramp1)); + + return Error; + } + + int test() + { + int Error(0); + + Error += test_int32(); + Error += test_uint32(); + + return Error; + } +}//namespace ceilPowerOfTwo_advanced + +namespace roundPowerOfTwo +{ + int test() + { + int Error = 0; + + glm::uint32 const A = glm::roundPowerOfTwo(7u); + Error += A == 8u ? 0 : 1; + + glm::uint32 const B = glm::roundPowerOfTwo(15u); + Error += B == 16u ? 0 : 1; + + glm::uint32 const C = glm::roundPowerOfTwo(31u); + Error += C == 32u ? 0 : 1; + + glm::uint32 const D = glm::roundPowerOfTwo(9u); + Error += D == 8u ? 0 : 1; + + glm::uint32 const E = glm::roundPowerOfTwo(17u); + Error += E == 16u ? 0 : 1; + + glm::uint32 const F = glm::roundPowerOfTwo(33u); + Error += F == 32u ? 0 : 1; + + return Error; + } +}//namespace roundPowerOfTwo + +namespace floorPowerOfTwo +{ + int test() + { + int Error = 0; + + glm::uint32 const A = glm::floorPowerOfTwo(7u); + Error += A == 4u ? 0 : 1; + + glm::uint32 const B = glm::floorPowerOfTwo(15u); + Error += B == 8u ? 0 : 1; + + glm::uint32 const C = glm::floorPowerOfTwo(31u); + Error += C == 16u ? 0 : 1; + + return Error; + } +}//namespace floorPowerOfTwo + +namespace ceilPowerOfTwo +{ + int test() + { + int Error = 0; + + glm::uint32 const A = glm::ceilPowerOfTwo(7u); + Error += A == 8u ? 0 : 1; + + glm::uint32 const B = glm::ceilPowerOfTwo(15u); + Error += B == 16u ? 0 : 1; + + glm::uint32 const C = glm::ceilPowerOfTwo(31u); + Error += C == 32u ? 0 : 1; + + return Error; + } +}//namespace ceilPowerOfTwo + +namespace floorMultiple +{ + template + struct type + { + genType Source; + genType Multiple; + genType Return; + genType Epsilon; + }; + + int test_float() + { + type const Data[] = + { + {3.4, 0.3, 3.3, 0.0001}, + {-1.4, 0.3, -1.5, 0.0001}, + }; + + int Error(0); + + for(std::size_t i = 0, n = sizeof(Data) / sizeof(type); i < n; ++i) + { + glm::float64 Result = glm::floorMultiple(Data[i].Source, Data[i].Multiple); + Error += glm::epsilonEqual(Data[i].Return, Result, Data[i].Epsilon) ? 0 : 1; + } + + return Error; + } + + int test() + { + int Error(0); + + Error += test_float(); + + return Error; + } +}//namespace floorMultiple + +namespace ceilMultiple +{ + template + struct type + { + genType Source; + genType Multiple; + genType Return; + genType Epsilon; + }; + + int test_float() + { + type const Data[] = + { + {3.4, 0.3, 3.6, 0.0001}, + {-1.4, 0.3, -1.2, 0.0001}, + }; + + int Error(0); + + for(std::size_t i = 0, n = sizeof(Data) / sizeof(type); i < n; ++i) + { + glm::float64 Result = glm::ceilMultiple(Data[i].Source, Data[i].Multiple); + Error += glm::epsilonEqual(Data[i].Return, Result, Data[i].Epsilon) ? 0 : 1; + } + + return Error; + } + + int test_int() + { + type const Data[] = + { + {3, 4, 4, 0}, + {7, 4, 8, 0}, + {5, 4, 8, 0}, + {1, 4, 4, 0}, + {1, 3, 3, 0}, + {4, 3, 6, 0}, + {4, 1, 4, 0}, + {1, 1, 1, 0}, + {7, 1, 7, 0}, + }; + + int Error(0); + + for(std::size_t i = 0, n = sizeof(Data) / sizeof(type); i < n; ++i) + { + int Result = glm::ceilMultiple(Data[i].Source, Data[i].Multiple); + Error += Data[i].Return == Result ? 0 : 1; + } + + return Error; + } + + int test() + { + int Error(0); + + Error += test_int(); + Error += test_float(); + + return Error; + } +}//namespace ceilMultiple + +int main() +{ + int Error(0); + + Error += isPowerOfTwo::test(); + Error += floorPowerOfTwo::test(); + Error += roundPowerOfTwo::test(); + Error += ceilPowerOfTwo::test(); + Error += ceilPowerOfTwo_advanced::test(); + +# ifdef NDEBUG + Error += ceilPowerOfTwo_advanced::perf(); +# endif//NDEBUG + + Error += floorMultiple::test(); + Error += ceilMultiple::test(); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtc/gtc_type_aligned.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtc/gtc_type_aligned.cpp new file mode 100644 index 0000000000000000000000000000000000000000..2bbddba3a6f34180d950bde1626626fafadb1d8a --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtc/gtc_type_aligned.cpp @@ -0,0 +1,181 @@ +#include + +#if GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE +#include +#include +#include +#include + +GLM_STATIC_ASSERT(glm::detail::is_aligned::value, "aligned_lowp is not aligned"); +GLM_STATIC_ASSERT(glm::detail::is_aligned::value, "aligned_mediump is not aligned"); +GLM_STATIC_ASSERT(glm::detail::is_aligned::value, "aligned_highp is not aligned"); +GLM_STATIC_ASSERT(!glm::detail::is_aligned::value, "packed_highp is aligned"); +GLM_STATIC_ASSERT(!glm::detail::is_aligned::value, "packed_mediump is aligned"); +GLM_STATIC_ASSERT(!glm::detail::is_aligned::value, "packed_lowp is aligned"); + +struct my_vec4_packed +{ + glm::uint32 a; + glm::vec4 b; +}; +GLM_STATIC_ASSERT(sizeof(my_vec4_packed) == sizeof(glm::uint32) + sizeof(glm::vec4), "glm::vec4 packed is not correct"); + +struct my_vec4_aligned +{ + glm::uint32 a; + glm::aligned_vec4 b; +}; +GLM_STATIC_ASSERT(sizeof(my_vec4_aligned) == sizeof(glm::aligned_vec4) * 2, "glm::vec4 aligned is not correct"); + +struct my_dvec4_packed +{ + glm::uint64 a; + glm::dvec4 b; +}; +GLM_STATIC_ASSERT(sizeof(my_dvec4_packed) == sizeof(glm::uint64) + sizeof(glm::dvec4), "glm::dvec4 packed is not correct"); + +struct my_dvec4_aligned +{ + glm::uint64 a; + glm::aligned_dvec4 b; +}; +//GLM_STATIC_ASSERT(sizeof(my_dvec4_aligned) == sizeof(glm::aligned_dvec4) * 2, "glm::dvec4 aligned is not correct"); + +struct my_ivec4_packed +{ + glm::uint32 a; + glm::ivec4 b; +}; +GLM_STATIC_ASSERT(sizeof(my_ivec4_packed) == sizeof(glm::uint32) + sizeof(glm::ivec4), "glm::ivec4 packed is not correct"); + +struct my_ivec4_aligned +{ + glm::uint32 a; + glm::aligned_ivec4 b; +}; +GLM_STATIC_ASSERT(sizeof(my_ivec4_aligned) == sizeof(glm::aligned_ivec4) * 2, "glm::ivec4 aligned is not correct"); + +struct my_u8vec4_packed +{ + glm::uint32 a; + glm::u8vec4 b; +}; +GLM_STATIC_ASSERT(sizeof(my_u8vec4_packed) == sizeof(glm::uint32) + sizeof(glm::u8vec4), "glm::u8vec4 packed is not correct"); + +static int test_copy() +{ + int Error = 0; + + { + glm::aligned_ivec4 const a(1, 2, 3, 4); + glm::ivec4 const u(a); + + Error += a.x == u.x ? 0 : 1; + Error += a.y == u.y ? 0 : 1; + Error += a.z == u.z ? 0 : 1; + Error += a.w == u.w ? 0 : 1; + } + + { + my_ivec4_aligned a; + a.b = glm::ivec4(1, 2, 3, 4); + + my_ivec4_packed u; + u.b = a.b; + + Error += a.b.x == u.b.x ? 0 : 1; + Error += a.b.y == u.b.y ? 0 : 1; + Error += a.b.z == u.b.z ? 0 : 1; + Error += a.b.w == u.b.w ? 0 : 1; + } + + return Error; +} + +static int test_ctor() +{ + int Error = 0; + +# if GLM_HAS_CONSTEXPR + { + constexpr glm::aligned_ivec4 v(1); + + Error += v.x == 1 ? 0 : 1; + Error += v.y == 1 ? 0 : 1; + Error += v.z == 1 ? 0 : 1; + Error += v.w == 1 ? 0 : 1; + } + + { + constexpr glm::packed_ivec4 v(1); + + Error += v.x == 1 ? 0 : 1; + Error += v.y == 1 ? 0 : 1; + Error += v.z == 1 ? 0 : 1; + Error += v.w == 1 ? 0 : 1; + } + + { + constexpr glm::ivec4 v(1); + + Error += v.x == 1 ? 0 : 1; + Error += v.y == 1 ? 0 : 1; + Error += v.z == 1 ? 0 : 1; + Error += v.w == 1 ? 0 : 1; + } +# endif//GLM_HAS_CONSTEXPR + + return Error; +} + +static int test_aligned_ivec4() +{ + int Error = 0; + + glm::aligned_ivec4 const v(1, 2, 3, 4); + Error += glm::all(glm::equal(v, glm::aligned_ivec4(1, 2, 3, 4))) ? 0 : 1; + + glm::aligned_ivec4 const u = v * 2; + Error += glm::all(glm::equal(u, glm::aligned_ivec4(2, 4, 6, 8))) ? 0 : 1; + + return Error; +} + +static int test_aligned_mat4() +{ + int Error = 0; + + glm::aligned_vec4 const u(1.f, 2.f, 3.f, 4.f); + Error += glm::all(glm::equal(u, glm::aligned_vec4(1.f, 2.f, 3.f, 4.f), 0.0001f)) ? 0 : 1; + + glm::aligned_vec4 const v(1, 2, 3, 4); + Error += glm::all(glm::equal(v, glm::aligned_vec4(1.f, 2.f, 3.f, 4.f), 0.0001f)) ? 0 : 1; + + glm::aligned_mat4 const m(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); + glm::aligned_mat4 const t = glm::transpose(m); + glm::aligned_mat4 const expected = glm::mat4(0, 4, 8, 12, 1, 5, 9, 13, 2, 6, 10, 14, 3, 7, 11, 15); + Error += glm::all(glm::equal(t, expected, 0.0001f)) ? 0 : 1; + + return Error; +} + +int main() +{ + int Error = 0; + + Error += test_ctor(); + Error += test_copy(); + Error += test_aligned_ivec4(); + Error += test_aligned_mat4(); + + return Error; +} + +#else + +int main() +{ + return 0; +} + +#endif diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtc/gtc_type_precision.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtc/gtc_type_precision.cpp new file mode 100644 index 0000000000000000000000000000000000000000..531d0e7ea3ed79950bb8518551487c4e6d8f78ba --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtc/gtc_type_precision.cpp @@ -0,0 +1,1041 @@ +#include +#include +#include +#include +#include +#if GLM_HAS_OPENMP +# include +#endif + +#if GLM_HAS_STATIC_ASSERT +static_assert(sizeof(glm::lowp_u8vec1) == 1, "uint8 size isn't 1 byte on this platform"); +static_assert(sizeof(glm::mediump_u8vec1) == 1, "uint8 size isn't 1 byte on this platform"); +static_assert(sizeof(glm::highp_u8vec1) == 1, "uint8 size isn't 1 byte on this platform"); + +static_assert(sizeof(glm::lowp_u16vec1) == 2, "uint16 size isn't 2 bytes on this platform"); +static_assert(sizeof(glm::mediump_u16vec1) == 2, "uint16 size isn't 2 bytes on this platform"); +static_assert(sizeof(glm::highp_u16vec1) == 2, "uint16 size isn't 2 bytes on this platform"); + +static_assert(sizeof(glm::lowp_u32vec1) == 4, "uint32 size isn't 4 bytes on this platform"); +static_assert(sizeof(glm::mediump_u32vec1) == 4, "uint32 size isn't 4 bytes on this platform"); +static_assert(sizeof(glm::highp_u32vec1) == 4, "uint32 size isn't 4 bytes on this platform"); + +static_assert(sizeof(glm::lowp_u64vec1) == 8, "uint64 size isn't 8 bytes on this platform"); +static_assert(sizeof(glm::mediump_u64vec1) == 8, "uint64 size isn't 8 bytes on this platform"); +static_assert(sizeof(glm::highp_u64vec1) == 8, "uint64 size isn't 8 bytes on this platform"); + + +static_assert(sizeof(glm::lowp_u8vec2) == 2, "uint8 size isn't 1 byte on this platform"); +static_assert(sizeof(glm::mediump_u8vec2) == 2, "uint8 size isn't 1 byte on this platform"); +static_assert(sizeof(glm::highp_u8vec2) == 2, "uint8 size isn't 1 byte on this platform"); + +static_assert(sizeof(glm::lowp_u16vec2) == 4, "uint16 size isn't 2 bytes on this platform"); +static_assert(sizeof(glm::mediump_u16vec2) == 4, "uint16 size isn't 2 bytes on this platform"); +static_assert(sizeof(glm::highp_u16vec2) == 4, "uint16 size isn't 2 bytes on this platform"); + +static_assert(sizeof(glm::lowp_u32vec2) == 8, "uint32 size isn't 4 bytes on this platform"); +static_assert(sizeof(glm::mediump_u32vec2) == 8, "uint32 size isn't 4 bytes on this platform"); +static_assert(sizeof(glm::highp_u32vec2) == 8, "uint32 size isn't 4 bytes on this platform"); + +static_assert(sizeof(glm::lowp_u64vec2) == 16, "uint64 size isn't 8 bytes on this platform"); +static_assert(sizeof(glm::mediump_u64vec2) == 16, "uint64 size isn't 8 bytes on this platform"); +static_assert(sizeof(glm::highp_u64vec2) == 16, "uint64 size isn't 8 bytes on this platform"); + + +static_assert(sizeof(glm::lowp_u8vec3) == 3, "uint8 size isn't 1 byte on this platform"); +static_assert(sizeof(glm::mediump_u8vec3) == 3, "uint8 size isn't 1 byte on this platform"); +static_assert(sizeof(glm::highp_u8vec3) == 3, "uint8 size isn't 1 byte on this platform"); + +static_assert(sizeof(glm::lowp_u16vec3) == 6, "uint16 size isn't 2 bytes on this platform"); +static_assert(sizeof(glm::mediump_u16vec3) == 6, "uint16 size isn't 2 bytes on this platform"); +static_assert(sizeof(glm::highp_u16vec3) == 6, "uint16 size isn't 2 bytes on this platform"); + +static_assert(sizeof(glm::lowp_u32vec3) == 12, "uint32 size isn't 4 bytes on this platform"); +static_assert(sizeof(glm::mediump_u32vec3) == 12, "uint32 size isn't 4 bytes on this platform"); +static_assert(sizeof(glm::highp_u32vec3) == 12, "uint32 size isn't 4 bytes on this platform"); + +static_assert(sizeof(glm::lowp_u64vec3) == 24, "uint64 size isn't 8 bytes on this platform"); +static_assert(sizeof(glm::mediump_u64vec3) == 24, "uint64 size isn't 8 bytes on this platform"); +static_assert(sizeof(glm::highp_u64vec3) == 24, "uint64 size isn't 8 bytes on this platform"); + + +static_assert(sizeof(glm::lowp_u8vec4) == 4, "int8 size isn't 1 byte on this platform"); +static_assert(sizeof(glm::mediump_u8vec4) == 4, "int8 size isn't 1 byte on this platform"); +static_assert(sizeof(glm::highp_u8vec4) == 4, "int8 size isn't 1 byte on this platform"); + +static_assert(sizeof(glm::lowp_u16vec4) == 8, "int16 size isn't 2 bytes on this platform"); +static_assert(sizeof(glm::mediump_u16vec4) == 8, "int16 size isn't 2 bytes on this platform"); +static_assert(sizeof(glm::highp_u16vec4) == 8, "int16 size isn't 2 bytes on this platform"); + +static_assert(sizeof(glm::lowp_u32vec4) == 16, "int32 size isn't 4 bytes on this platform"); +static_assert(sizeof(glm::mediump_u32vec4) == 16, "int32 size isn't 4 bytes on this platform"); +static_assert(sizeof(glm::highp_u32vec4) == 16, "int32 size isn't 4 bytes on this platform"); + +static_assert(sizeof(glm::lowp_u64vec4) == 32, "int64 size isn't 8 bytes on this platform"); +static_assert(sizeof(glm::mediump_u64vec4) == 32, "int64 size isn't 8 bytes on this platform"); +static_assert(sizeof(glm::highp_u64vec4) == 32, "int64 size isn't 8 bytes on this platform"); + + +static_assert(sizeof(glm::lowp_u8vec1) == 1, "uint8 size isn't 1 byte on this platform"); +static_assert(sizeof(glm::mediump_u8vec1) == 1, "uint8 size isn't 1 byte on this platform"); +static_assert(sizeof(glm::highp_u8vec1) == 1, "uint8 size isn't 1 byte on this platform"); + +static_assert(sizeof(glm::lowp_u16vec1) == 2, "uint16 size isn't 2 bytes on this platform"); +static_assert(sizeof(glm::mediump_u16vec1) == 2, "uint16 size isn't 2 bytes on this platform"); +static_assert(sizeof(glm::highp_u16vec1) == 2, "uint16 size isn't 2 bytes on this platform"); + +static_assert(sizeof(glm::lowp_u32vec1) == 4, "uint32 size isn't 4 bytes on this platform"); +static_assert(sizeof(glm::mediump_u32vec1) == 4, "uint32 size isn't 4 bytes on this platform"); +static_assert(sizeof(glm::highp_u32vec1) == 4, "uint32 size isn't 4 bytes on this platform"); + +static_assert(sizeof(glm::lowp_u64vec1) == 8, "uint64 size isn't 8 bytes on this platform"); +static_assert(sizeof(glm::mediump_u64vec1) == 8, "uint64 size isn't 8 bytes on this platform"); +static_assert(sizeof(glm::highp_u64vec1) == 8, "uint64 size isn't 8 bytes on this platform"); + + +static_assert(sizeof(glm::lowp_u8vec2) == 2, "uint8 size isn't 1 byte on this platform"); +static_assert(sizeof(glm::mediump_u8vec2) == 2, "uint8 size isn't 1 byte on this platform"); +static_assert(sizeof(glm::highp_u8vec2) == 2, "uint8 size isn't 1 byte on this platform"); + +static_assert(sizeof(glm::lowp_u16vec2) == 4, "uint16 size isn't 2 bytes on this platform"); +static_assert(sizeof(glm::mediump_u16vec2) == 4, "uint16 size isn't 2 bytes on this platform"); +static_assert(sizeof(glm::highp_u16vec2) == 4, "uint16 size isn't 2 bytes on this platform"); + +static_assert(sizeof(glm::lowp_u32vec2) == 8, "uint32 size isn't 4 bytes on this platform"); +static_assert(sizeof(glm::mediump_u32vec2) == 8, "uint32 size isn't 4 bytes on this platform"); +static_assert(sizeof(glm::highp_u32vec2) == 8, "uint32 size isn't 4 bytes on this platform"); + +static_assert(sizeof(glm::lowp_u64vec2) == 16, "uint64 size isn't 8 bytes on this platform"); +static_assert(sizeof(glm::mediump_u64vec2) == 16, "uint64 size isn't 8 bytes on this platform"); +static_assert(sizeof(glm::highp_u64vec2) == 16, "uint64 size isn't 8 bytes on this platform"); + + +static_assert(sizeof(glm::lowp_u8vec3) == 3, "uint8 size isn't 1 byte on this platform"); +static_assert(sizeof(glm::mediump_u8vec3) == 3, "uint8 size isn't 1 byte on this platform"); +static_assert(sizeof(glm::highp_u8vec3) == 3, "uint8 size isn't 1 byte on this platform"); + +static_assert(sizeof(glm::lowp_u16vec3) == 6, "uint16 size isn't 2 bytes on this platform"); +static_assert(sizeof(glm::mediump_u16vec3) == 6, "uint16 size isn't 2 bytes on this platform"); +static_assert(sizeof(glm::highp_u16vec3) == 6, "uint16 size isn't 2 bytes on this platform"); + +static_assert(sizeof(glm::lowp_u32vec3) == 12, "uint32 size isn't 4 bytes on this platform"); +static_assert(sizeof(glm::mediump_u32vec3) == 12, "uint32 size isn't 4 bytes on this platform"); +static_assert(sizeof(glm::highp_u32vec3) == 12, "uint32 size isn't 4 bytes on this platform"); + +static_assert(sizeof(glm::lowp_u64vec3) == 24, "uint64 size isn't 8 bytes on this platform"); +static_assert(sizeof(glm::mediump_u64vec3) == 24, "uint64 size isn't 8 bytes on this platform"); +static_assert(sizeof(glm::highp_u64vec3) == 24, "uint64 size isn't 8 bytes on this platform"); + + +static_assert(sizeof(glm::lowp_u8vec4) == 4, "uint8 size isn't 1 byte on this platform"); +static_assert(sizeof(glm::mediump_u8vec4) == 4, "uint8 size isn't 1 byte on this platform"); +static_assert(sizeof(glm::highp_u8vec4) == 4, "uint8 size isn't 1 byte on this platform"); + +static_assert(sizeof(glm::lowp_u16vec4) == 8, "uint16 size isn't 2 bytes on this platform"); +static_assert(sizeof(glm::mediump_u16vec4) == 8, "uint16 size isn't 2 bytes on this platform"); +static_assert(sizeof(glm::highp_u16vec4) == 8, "uint16 size isn't 2 bytes on this platform"); + +static_assert(sizeof(glm::lowp_u32vec4) == 16, "uint32 size isn't 4 bytes on this platform"); +static_assert(sizeof(glm::mediump_u32vec4) == 16, "uint32 size isn't 4 bytes on this platform"); +static_assert(sizeof(glm::highp_u32vec4) == 16, "uint32 size isn't 4 bytes on this platform"); + +static_assert(sizeof(glm::lowp_u64vec4) == 32, "uint64 size isn't 8 bytes on this platform"); +static_assert(sizeof(glm::mediump_u64vec4) == 32, "uint64 size isn't 8 bytes on this platform"); +static_assert(sizeof(glm::highp_u64vec4) == 32, "uint64 size isn't 8 bytes on this platform"); + +#endif + +static int test_scalar_size() +{ + int Error = 0; + + Error += sizeof(glm::int8) != 1; + Error += sizeof(glm::int16) != 2; + Error += sizeof(glm::int32) != 4; + Error += sizeof(glm::int64) != 8; + Error += sizeof(glm::uint8) != 1; + Error += sizeof(glm::uint16) != 2; + Error += sizeof(glm::uint32) != 4; + Error += sizeof(glm::uint64) != 8; + Error += sizeof(glm::float32) != 4; + Error += sizeof(glm::float64) != 8; + + Error += sizeof(glm::lowp_int8) != 1; + Error += sizeof(glm::lowp_int16) != 2; + Error += sizeof(glm::lowp_int32) != 4; + Error += sizeof(glm::lowp_int64) != 8; + Error += sizeof(glm::lowp_uint8) != 1; + Error += sizeof(glm::lowp_uint16) != 2; + Error += sizeof(glm::lowp_uint32) != 4; + Error += sizeof(glm::lowp_uint64) != 8; + Error += sizeof(glm::lowp_float32) != 4; + Error += sizeof(glm::lowp_float64) != 8; + + Error += sizeof(glm::mediump_int8) != 1; + Error += sizeof(glm::mediump_int16) != 2; + Error += sizeof(glm::mediump_int32) != 4; + Error += sizeof(glm::mediump_int64) != 8; + Error += sizeof(glm::mediump_uint8) != 1; + Error += sizeof(glm::mediump_uint16) != 2; + Error += sizeof(glm::mediump_uint32) != 4; + Error += sizeof(glm::mediump_uint64) != 8; + Error += sizeof(glm::mediump_float32) != 4; + Error += sizeof(glm::mediump_float64) != 8; + + Error += sizeof(glm::highp_int8) != 1; + Error += sizeof(glm::highp_int16) != 2; + Error += sizeof(glm::highp_int32) != 4; + Error += sizeof(glm::highp_int64) != 8; + Error += sizeof(glm::highp_uint8) != 1; + Error += sizeof(glm::highp_uint16) != 2; + Error += sizeof(glm::highp_uint32) != 4; + Error += sizeof(glm::highp_uint64) != 8; + Error += sizeof(glm::highp_float32) != 4; + Error += sizeof(glm::highp_float64) != 8; + + return Error; +} + +static int test_fvec_size() +{ + int Error = 0; + + Error += sizeof(glm::f32vec2) != 8; + Error += sizeof(glm::f32vec3) != 12; + Error += sizeof(glm::f32vec4) != 16; + Error += sizeof(glm::f64vec2) != 16; + Error += sizeof(glm::f64vec3) != 24; + Error += sizeof(glm::f64vec4) != 32; + + Error += sizeof(glm::lowp_f32vec2) != 8; + Error += sizeof(glm::lowp_f32vec3) != 12; + Error += sizeof(glm::lowp_f32vec4) != 16; + Error += sizeof(glm::lowp_f64vec2) != 16; + Error += sizeof(glm::lowp_f64vec3) != 24; + Error += sizeof(glm::lowp_f64vec4) != 32; + + Error += sizeof(glm::mediump_f32vec2) != 8; + Error += sizeof(glm::mediump_f32vec3) != 12; + Error += sizeof(glm::mediump_f32vec4) != 16; + Error += sizeof(glm::mediump_f64vec2) != 16; + Error += sizeof(glm::mediump_f64vec3) != 24; + Error += sizeof(glm::mediump_f64vec4) != 32; + + Error += sizeof(glm::highp_f32vec2) != 8; + Error += sizeof(glm::highp_f32vec3) != 12; + Error += sizeof(glm::highp_f32vec4) != 16; + Error += sizeof(glm::highp_f64vec2) != 16; + Error += sizeof(glm::highp_f64vec3) != 24; + Error += sizeof(glm::highp_f64vec4) != 32; + + return Error; +} + +static int test_fvec_precision() +{ + int Error = 0; + + { + glm::f32vec2 v1(1.f); + glm::lowp_f32vec2 v2(v1); + glm::mediump_f32vec2 v3(v1); + glm::highp_f32vec2 v4(v1); + + Error += glm::all(glm::equal(v1, glm::f32vec2(v2), glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(v1, glm::f32vec2(v3), glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(v1, glm::f32vec2(v4), glm::epsilon())) ? 0 : 1; + } + + { + glm::f32vec3 v1(1.f); + glm::lowp_f32vec3 v2(v1); + glm::mediump_f32vec3 v3(v1); + glm::highp_f32vec3 v4(v1); + + Error += glm::all(glm::equal(v1, glm::f32vec3(v2), glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(v1, glm::f32vec3(v3), glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(v1, glm::f32vec3(v4), glm::epsilon())) ? 0 : 1; + } + + { + glm::f32vec4 v1(1.f); + glm::lowp_f32vec4 v2(v1); + glm::mediump_f32vec4 v3(v1); + glm::highp_f32vec4 v4(v1); + + Error += glm::all(glm::equal(v1, glm::f32vec4(v2), glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(v1, glm::f32vec4(v3), glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(v1, glm::f32vec4(v4), glm::epsilon())) ? 0 : 1; + } + + return Error; +} + +static int test_dvec_precision() +{ + int Error = 0; + + { + glm::f64vec2 v1(1.0); + glm::lowp_f64vec2 v2(v1); + glm::mediump_f64vec2 v3(v1); + glm::highp_f64vec2 v4(v1); + + Error += glm::all(glm::equal(v1, glm::f64vec2(v2), glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(v1, glm::f64vec2(v3), glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(v1, glm::f64vec2(v4), glm::epsilon())) ? 0 : 1; + } + + { + glm::f64vec3 v1(1.0); + glm::lowp_f64vec3 v2(v1); + glm::mediump_f64vec3 v3(v1); + glm::highp_f64vec3 v4(v1); + + Error += glm::all(glm::equal(v1, glm::f64vec3(v2), glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(v1, glm::f64vec3(v3), glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(v1, glm::f64vec3(v4), glm::epsilon())) ? 0 : 1; + } + + { + glm::f64vec4 v1(1.0); + glm::lowp_f64vec4 v2(v1); + glm::mediump_f64vec4 v3(v1); + glm::highp_f64vec4 v4(v1); + + Error += glm::all(glm::equal(v1, glm::f64vec4(v2), glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(v1, glm::f64vec4(v3), glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(v1, glm::f64vec4(v4), glm::epsilon())) ? 0 : 1; + } + + return Error; +} + +static int test_ivec_size() +{ + int Error = 0; + + Error += sizeof(glm::i8vec2) != 2; + Error += sizeof(glm::i8vec3) != 3; + Error += sizeof(glm::i8vec4) != 4; + Error += sizeof(glm::i16vec2) != 4; + Error += sizeof(glm::i16vec3) != 6; + Error += sizeof(glm::i16vec4) != 8; + Error += sizeof(glm::i32vec2) != 8; + Error += sizeof(glm::i32vec3) != 12; + Error += sizeof(glm::i32vec4) != 16; + Error += sizeof(glm::i64vec2) != 16; + Error += sizeof(glm::i64vec3) != 24; + Error += sizeof(glm::i64vec4) != 32; + + Error += sizeof(glm::lowp_i8vec2) != 2; + Error += sizeof(glm::lowp_i8vec3) != 3; + Error += sizeof(glm::lowp_i8vec4) != 4; + Error += sizeof(glm::lowp_i16vec2) != 4; + Error += sizeof(glm::lowp_i16vec3) != 6; + Error += sizeof(glm::lowp_i16vec4) != 8; + Error += sizeof(glm::lowp_i32vec2) != 8; + Error += sizeof(glm::lowp_i32vec3) != 12; + Error += sizeof(glm::lowp_i32vec4) != 16; + Error += sizeof(glm::lowp_i64vec2) != 16; + Error += sizeof(glm::lowp_i64vec3) != 24; + Error += sizeof(glm::lowp_i64vec4) != 32; + + Error += sizeof(glm::mediump_i8vec2) != 2; + Error += sizeof(glm::mediump_i8vec3) != 3; + Error += sizeof(glm::mediump_i8vec4) != 4; + Error += sizeof(glm::mediump_i16vec2) != 4; + Error += sizeof(glm::mediump_i16vec3) != 6; + Error += sizeof(glm::mediump_i16vec4) != 8; + Error += sizeof(glm::mediump_i32vec2) != 8; + Error += sizeof(glm::mediump_i32vec3) != 12; + Error += sizeof(glm::mediump_i32vec4) != 16; + Error += sizeof(glm::mediump_i64vec2) != 16; + Error += sizeof(glm::mediump_i64vec3) != 24; + Error += sizeof(glm::mediump_i64vec4) != 32; + + Error += sizeof(glm::highp_i8vec2) != 2; + Error += sizeof(glm::highp_i8vec3) != 3; + Error += sizeof(glm::highp_i8vec4) != 4; + Error += sizeof(glm::highp_i16vec2) != 4; + Error += sizeof(glm::highp_i16vec3) != 6; + Error += sizeof(glm::highp_i16vec4) != 8; + Error += sizeof(glm::highp_i32vec2) != 8; + Error += sizeof(glm::highp_i32vec3) != 12; + Error += sizeof(glm::highp_i32vec4) != 16; + Error += sizeof(glm::highp_i64vec2) != 16; + Error += sizeof(glm::highp_i64vec3) != 24; + Error += sizeof(glm::highp_i64vec4) != 32; + + return Error; +} + +static int test_ivec_precision() +{ + int Error = 0; + + { + glm::i8vec2 v1(0); + glm::lowp_i8vec2 v2(v1); + glm::mediump_i8vec2 v3(v1); + glm::highp_i8vec2 v4(v1); + + Error += glm::all(glm::equal(v1, glm::i8vec2(v2))) ? 0 : 1; + Error += glm::all(glm::equal(v1, glm::i8vec2(v3))) ? 0 : 1; + Error += glm::all(glm::equal(v1, glm::i8vec2(v4))) ? 0 : 1; + } + + { + glm::i8vec3 v1(0); + glm::lowp_i8vec3 v2(v1); + glm::mediump_i8vec3 v3(v1); + glm::highp_i8vec3 v4(v1); + + Error += glm::all(glm::equal(v1, glm::i8vec3(v2))) ? 0 : 1; + Error += glm::all(glm::equal(v1, glm::i8vec3(v3))) ? 0 : 1; + Error += glm::all(glm::equal(v1, glm::i8vec3(v4))) ? 0 : 1; + } + + { + glm::i8vec4 v1(0); + glm::lowp_i8vec4 v2(v1); + glm::mediump_i8vec4 v3(v1); + glm::highp_i8vec4 v4(v1); + + Error += glm::all(glm::equal(v1, glm::i8vec4(v2))) ? 0 : 1; + Error += glm::all(glm::equal(v1, glm::i8vec4(v3))) ? 0 : 1; + Error += glm::all(glm::equal(v1, glm::i8vec4(v4))) ? 0 : 1; + } + + { + glm::i16vec2 v1(0); + glm::lowp_i16vec2 v2(v1); + glm::mediump_i16vec2 v3(v1); + glm::highp_i16vec2 v4(v1); + + Error += glm::all(glm::equal(v1, glm::i16vec2(v2))) ? 0 : 1; + Error += glm::all(glm::equal(v1, glm::i16vec2(v3))) ? 0 : 1; + Error += glm::all(glm::equal(v1, glm::i16vec2(v4))) ? 0 : 1; + } + + { + glm::i16vec3 v1(0); + glm::lowp_i16vec3 v2(v1); + glm::mediump_i16vec3 v3(v1); + glm::highp_i16vec3 v4(v1); + + Error += glm::all(glm::equal(v1, glm::i16vec3(v2))) ? 0 : 1; + Error += glm::all(glm::equal(v1, glm::i16vec3(v3))) ? 0 : 1; + Error += glm::all(glm::equal(v1, glm::i16vec3(v4))) ? 0 : 1; + } + + { + glm::i16vec4 v1(0); + glm::lowp_i16vec4 v2(v1); + glm::mediump_i16vec4 v3(v1); + glm::highp_i16vec4 v4(v1); + + Error += glm::all(glm::equal(v1, glm::i16vec4(v2))) ? 0 : 1; + Error += glm::all(glm::equal(v1, glm::i16vec4(v3))) ? 0 : 1; + Error += glm::all(glm::equal(v1, glm::i16vec4(v4))) ? 0 : 1; + } + + { + glm::i32vec2 v1(0); + glm::lowp_i32vec2 v2(v1); + glm::mediump_i32vec2 v3(v1); + glm::highp_i32vec2 v4(v1); + + Error += glm::all(glm::equal(v1, glm::i32vec2(v2))) ? 0 : 1; + Error += glm::all(glm::equal(v1, glm::i32vec2(v3))) ? 0 : 1; + Error += glm::all(glm::equal(v1, glm::i32vec2(v4))) ? 0 : 1; + } + + { + glm::i32vec3 v1(0); + glm::lowp_i32vec3 v2(v1); + glm::mediump_i32vec3 v3(v1); + glm::highp_i32vec3 v4(v1); + + Error += glm::all(glm::equal(v1, glm::i32vec3(v2))) ? 0 : 1; + Error += glm::all(glm::equal(v1, glm::i32vec3(v3))) ? 0 : 1; + Error += glm::all(glm::equal(v1, glm::i32vec3(v4))) ? 0 : 1; + } + + { + glm::i32vec4 v1(0); + glm::lowp_i32vec4 v2(v1); + glm::mediump_i32vec4 v3(v1); + glm::highp_i32vec4 v4(v1); + + Error += glm::all(glm::equal(v1, glm::i32vec4(v2))) ? 0 : 1; + Error += glm::all(glm::equal(v1, glm::i32vec4(v3))) ? 0 : 1; + Error += glm::all(glm::equal(v1, glm::i32vec4(v4))) ? 0 : 1; + } + + { + glm::i64vec2 v1(0); + glm::lowp_i64vec2 v2(v1); + glm::mediump_i64vec2 v3(v1); + glm::highp_i64vec2 v4(v1); + + Error += glm::all(glm::equal(v1, glm::i64vec2(v2))) ? 0 : 1; + Error += glm::all(glm::equal(v1, glm::i64vec2(v3))) ? 0 : 1; + Error += glm::all(glm::equal(v1, glm::i64vec2(v4))) ? 0 : 1; + } + + { + glm::i64vec3 v1(0); + glm::lowp_i64vec3 v2(v1); + glm::mediump_i64vec3 v3(v1); + glm::highp_i64vec3 v4(v1); + + Error += glm::all(glm::equal(v1, glm::i64vec3(v2))) ? 0 : 1; + Error += glm::all(glm::equal(v1, glm::i64vec3(v3))) ? 0 : 1; + Error += glm::all(glm::equal(v1, glm::i64vec3(v4))) ? 0 : 1; + } + + { + glm::i64vec4 v1(0); + glm::lowp_i64vec4 v2(v1); + glm::mediump_i64vec4 v3(v1); + glm::highp_i64vec4 v4(v1); + + Error += glm::all(glm::equal(v1, glm::i64vec4(v2))) ? 0 : 1; + Error += glm::all(glm::equal(v1, glm::i64vec4(v3))) ? 0 : 1; + Error += glm::all(glm::equal(v1, glm::i64vec4(v4))) ? 0 : 1; + } + + return Error; +} + +static int test_uvec_size() +{ + int Error = 0; + + Error += sizeof(glm::u8vec2) != 2; + Error += sizeof(glm::u8vec3) != 3; + Error += sizeof(glm::u8vec4) != 4; + Error += sizeof(glm::u16vec2) != 4; + Error += sizeof(glm::u16vec3) != 6; + Error += sizeof(glm::u16vec4) != 8; + Error += sizeof(glm::u32vec2) != 8; + Error += sizeof(glm::u32vec3) != 12; + Error += sizeof(glm::u32vec4) != 16; + Error += sizeof(glm::u64vec2) != 16; + Error += sizeof(glm::u64vec3) != 24; + Error += sizeof(glm::u64vec4) != 32; + + Error += sizeof(glm::lowp_u8vec2) != 2; + Error += sizeof(glm::lowp_u8vec3) != 3; + Error += sizeof(glm::lowp_u8vec4) != 4; + Error += sizeof(glm::lowp_u16vec2) != 4; + Error += sizeof(glm::lowp_u16vec3) != 6; + Error += sizeof(glm::lowp_u16vec4) != 8; + Error += sizeof(glm::lowp_u32vec2) != 8; + Error += sizeof(glm::lowp_u32vec3) != 12; + Error += sizeof(glm::lowp_u32vec4) != 16; + Error += sizeof(glm::lowp_u64vec2) != 16; + Error += sizeof(glm::lowp_u64vec3) != 24; + Error += sizeof(glm::lowp_u64vec4) != 32; + + Error += sizeof(glm::mediump_u8vec2) != 2; + Error += sizeof(glm::mediump_u8vec3) != 3; + Error += sizeof(glm::mediump_u8vec4) != 4; + Error += sizeof(glm::mediump_u16vec2) != 4; + Error += sizeof(glm::mediump_u16vec3) != 6; + Error += sizeof(glm::mediump_u16vec4) != 8; + Error += sizeof(glm::mediump_u32vec2) != 8; + Error += sizeof(glm::mediump_u32vec3) != 12; + Error += sizeof(glm::mediump_u32vec4) != 16; + Error += sizeof(glm::mediump_u64vec2) != 16; + Error += sizeof(glm::mediump_u64vec3) != 24; + Error += sizeof(glm::mediump_u64vec4) != 32; + + Error += sizeof(glm::highp_u8vec2) != 2; + Error += sizeof(glm::highp_u8vec3) != 3; + Error += sizeof(glm::highp_u8vec4) != 4; + Error += sizeof(glm::highp_u16vec2) != 4; + Error += sizeof(glm::highp_u16vec3) != 6; + Error += sizeof(glm::highp_u16vec4) != 8; + Error += sizeof(glm::highp_u32vec2) != 8; + Error += sizeof(glm::highp_u32vec3) != 12; + Error += sizeof(glm::highp_u32vec4) != 16; + Error += sizeof(glm::highp_u64vec2) != 16; + Error += sizeof(glm::highp_u64vec3) != 24; + Error += sizeof(glm::highp_u64vec4) != 32; + + return Error; +} + +static int test_uvec_precision() +{ + int Error = 0; + + { + glm::u8vec2 v1(0); + glm::lowp_u8vec2 v2(v1); + glm::mediump_u8vec2 v3(v1); + glm::highp_u8vec2 v4(v1); + + Error += glm::all(glm::equal(v1, glm::u8vec2(v2))) ? 0 : 1; + Error += glm::all(glm::equal(v1, glm::u8vec2(v3))) ? 0 : 1; + Error += glm::all(glm::equal(v1, glm::u8vec2(v4))) ? 0 : 1; + } + + { + glm::u8vec3 v1(0); + glm::lowp_u8vec3 v2(v1); + glm::mediump_u8vec3 v3(v1); + glm::highp_u8vec3 v4(v1); + + Error += glm::all(glm::equal(v1, glm::u8vec3(v2))) ? 0 : 1; + Error += glm::all(glm::equal(v1, glm::u8vec3(v3))) ? 0 : 1; + Error += glm::all(glm::equal(v1, glm::u8vec3(v4))) ? 0 : 1; + } + + { + glm::u8vec4 v1(0); + glm::lowp_u8vec4 v2(v1); + glm::mediump_u8vec4 v3(v1); + glm::highp_u8vec4 v4(v1); + + Error += glm::all(glm::equal(v1, glm::u8vec4(v2))) ? 0 : 1; + Error += glm::all(glm::equal(v1, glm::u8vec4(v3))) ? 0 : 1; + Error += glm::all(glm::equal(v1, glm::u8vec4(v4))) ? 0 : 1; + } + + { + glm::u16vec2 v1(0); + glm::lowp_u16vec2 v2(v1); + glm::mediump_u16vec2 v3(v1); + glm::highp_u16vec2 v4(v1); + + Error += glm::all(glm::equal(v1, glm::u16vec2(v2))) ? 0 : 1; + Error += glm::all(glm::equal(v1, glm::u16vec2(v3))) ? 0 : 1; + Error += glm::all(glm::equal(v1, glm::u16vec2(v4))) ? 0 : 1; + } + + { + glm::u16vec3 v1(0); + glm::lowp_u16vec3 v2(v1); + glm::mediump_u16vec3 v3(v1); + glm::highp_u16vec3 v4(v1); + + Error += glm::all(glm::equal(v1, glm::u16vec3(v2))) ? 0 : 1; + Error += glm::all(glm::equal(v1, glm::u16vec3(v3))) ? 0 : 1; + Error += glm::all(glm::equal(v1, glm::u16vec3(v4))) ? 0 : 1; + } + + { + glm::u16vec4 v1(0); + glm::lowp_u16vec4 v2(v1); + glm::mediump_u16vec4 v3(v1); + glm::highp_u16vec4 v4(v1); + + Error += glm::all(glm::equal(v1, glm::u16vec4(v2))) ? 0 : 1; + Error += glm::all(glm::equal(v1, glm::u16vec4(v3))) ? 0 : 1; + Error += glm::all(glm::equal(v1, glm::u16vec4(v4))) ? 0 : 1; + } + + { + glm::u32vec2 v1(0); + glm::lowp_u32vec2 v2(v1); + glm::mediump_u32vec2 v3(v1); + glm::highp_u32vec2 v4(v1); + + Error += glm::all(glm::equal(v1, glm::u32vec2(v2))) ? 0 : 1; + Error += glm::all(glm::equal(v1, glm::u32vec2(v3))) ? 0 : 1; + Error += glm::all(glm::equal(v1, glm::u32vec2(v4))) ? 0 : 1; + } + + { + glm::u32vec3 v1(0); + glm::lowp_u32vec3 v2(v1); + glm::mediump_u32vec3 v3(v1); + glm::highp_u32vec3 v4(v1); + + Error += glm::all(glm::equal(v1, glm::u32vec3(v2))) ? 0 : 1; + Error += glm::all(glm::equal(v1, glm::u32vec3(v3))) ? 0 : 1; + Error += glm::all(glm::equal(v1, glm::u32vec3(v4))) ? 0 : 1; + } + + { + glm::u32vec4 v1(0); + glm::lowp_u32vec4 v2(v1); + glm::mediump_u32vec4 v3(v1); + glm::highp_u32vec4 v4(v1); + + Error += glm::all(glm::equal(v1, glm::u32vec4(v2))) ? 0 : 1; + Error += glm::all(glm::equal(v1, glm::u32vec4(v3))) ? 0 : 1; + Error += glm::all(glm::equal(v1, glm::u32vec4(v4))) ? 0 : 1; + } + + { + glm::u64vec2 v1(0); + glm::lowp_u64vec2 v2(v1); + glm::mediump_u64vec2 v3(v1); + glm::highp_u64vec2 v4(v1); + + Error += glm::all(glm::equal(v1, glm::u64vec2(v2))) ? 0 : 1; + Error += glm::all(glm::equal(v1, glm::u64vec2(v3))) ? 0 : 1; + Error += glm::all(glm::equal(v1, glm::u64vec2(v4))) ? 0 : 1; + } + + { + glm::u64vec3 v1(0); + glm::lowp_u64vec3 v2(v1); + glm::mediump_u64vec3 v3(v1); + glm::highp_u64vec3 v4(v1); + + Error += glm::all(glm::equal(v1, glm::u64vec3(v2))) ? 0 : 1; + Error += glm::all(glm::equal(v1, glm::u64vec3(v3))) ? 0 : 1; + Error += glm::all(glm::equal(v1, glm::u64vec3(v4))) ? 0 : 1; + } + + { + glm::u64vec4 v1(0); + glm::lowp_u64vec4 v2(v1); + glm::mediump_u64vec4 v3(v1); + glm::highp_u64vec4 v4(v1); + + Error += glm::all(glm::equal(v1, glm::u64vec4(v2))) ? 0 : 1; + Error += glm::all(glm::equal(v1, glm::u64vec4(v3))) ? 0 : 1; + Error += glm::all(glm::equal(v1, glm::u64vec4(v4))) ? 0 : 1; + } + + return Error; +} + +static int test_fmat_size() +{ + int Error = 0; + + Error += sizeof(glm::mat2) != 16; + Error += sizeof(glm::mat3) != 36; + Error += sizeof(glm::mat4) != 64; + Error += sizeof(glm::mat2x2) != 16; + Error += sizeof(glm::mat2x3) != 24; + Error += sizeof(glm::mat2x4) != 32; + Error += sizeof(glm::mat3x2) != 24; + Error += sizeof(glm::mat3x3) != 36; + Error += sizeof(glm::mat3x4) != 48; + Error += sizeof(glm::mat4x2) != 32; + Error += sizeof(glm::mat4x3) != 48; + Error += sizeof(glm::mat4x4) != 64; + + Error += sizeof(glm::fmat2) != 16; + Error += sizeof(glm::fmat3) != 36; + Error += sizeof(glm::fmat4) != 64; + Error += sizeof(glm::fmat2x2) != 16; + Error += sizeof(glm::fmat2x3) != 24; + Error += sizeof(glm::fmat2x4) != 32; + Error += sizeof(glm::fmat3x2) != 24; + Error += sizeof(glm::fmat3x3) != 36; + Error += sizeof(glm::fmat3x4) != 48; + Error += sizeof(glm::fmat4x2) != 32; + Error += sizeof(glm::fmat4x3) != 48; + Error += sizeof(glm::fmat4x4) != 64; + + Error += sizeof(glm::f32mat2) != 16; + Error += sizeof(glm::f32mat3) != 36; + Error += sizeof(glm::f32mat4) != 64; + Error += sizeof(glm::f32mat2x2) != 16; + Error += sizeof(glm::f32mat2x3) != 24; + Error += sizeof(glm::f32mat2x4) != 32; + Error += sizeof(glm::f32mat3x2) != 24; + Error += sizeof(glm::f32mat3x3) != 36; + Error += sizeof(glm::f32mat3x4) != 48; + Error += sizeof(glm::f32mat4x2) != 32; + Error += sizeof(glm::f32mat4x3) != 48; + Error += sizeof(glm::f32mat4x4) != 64; + + + Error += sizeof(glm::lowp_mat2) != 16; + Error += sizeof(glm::lowp_mat3) != 36; + Error += sizeof(glm::lowp_mat4) != 64; + Error += sizeof(glm::lowp_mat2x2) != 16; + Error += sizeof(glm::lowp_mat2x3) != 24; + Error += sizeof(glm::lowp_mat2x4) != 32; + Error += sizeof(glm::lowp_mat3x2) != 24; + Error += sizeof(glm::lowp_mat3x3) != 36; + Error += sizeof(glm::lowp_mat3x4) != 48; + Error += sizeof(glm::lowp_mat4x2) != 32; + Error += sizeof(glm::lowp_mat4x3) != 48; + Error += sizeof(glm::lowp_mat4x4) != 64; + + Error += sizeof(glm::lowp_fmat2) != 16; + Error += sizeof(glm::lowp_fmat3) != 36; + Error += sizeof(glm::lowp_fmat4) != 64; + Error += sizeof(glm::lowp_fmat2x2) != 16; + Error += sizeof(glm::lowp_fmat2x3) != 24; + Error += sizeof(glm::lowp_fmat2x4) != 32; + Error += sizeof(glm::lowp_fmat3x2) != 24; + Error += sizeof(glm::lowp_fmat3x3) != 36; + Error += sizeof(glm::lowp_fmat3x4) != 48; + Error += sizeof(glm::lowp_fmat4x2) != 32; + Error += sizeof(glm::lowp_fmat4x3) != 48; + Error += sizeof(glm::lowp_fmat4x4) != 64; + + Error += sizeof(glm::lowp_f32mat2) != 16; + Error += sizeof(glm::lowp_f32mat3) != 36; + Error += sizeof(glm::lowp_f32mat4) != 64; + Error += sizeof(glm::lowp_f32mat2x2) != 16; + Error += sizeof(glm::lowp_f32mat2x3) != 24; + Error += sizeof(glm::lowp_f32mat2x4) != 32; + Error += sizeof(glm::lowp_f32mat3x2) != 24; + Error += sizeof(glm::lowp_f32mat3x3) != 36; + Error += sizeof(glm::lowp_f32mat3x4) != 48; + Error += sizeof(glm::lowp_f32mat4x2) != 32; + Error += sizeof(glm::lowp_f32mat4x3) != 48; + Error += sizeof(glm::lowp_f32mat4x4) != 64; + + Error += sizeof(glm::mediump_mat2) != 16; + Error += sizeof(glm::mediump_mat3) != 36; + Error += sizeof(glm::mediump_mat4) != 64; + Error += sizeof(glm::mediump_mat2x2) != 16; + Error += sizeof(glm::mediump_mat2x3) != 24; + Error += sizeof(glm::mediump_mat2x4) != 32; + Error += sizeof(glm::mediump_mat3x2) != 24; + Error += sizeof(glm::mediump_mat3x3) != 36; + Error += sizeof(glm::mediump_mat3x4) != 48; + Error += sizeof(glm::mediump_mat4x2) != 32; + Error += sizeof(glm::mediump_mat4x3) != 48; + Error += sizeof(glm::mediump_mat4x4) != 64; + + Error += sizeof(glm::mediump_fmat2) != 16; + Error += sizeof(glm::mediump_fmat3) != 36; + Error += sizeof(glm::mediump_fmat4) != 64; + Error += sizeof(glm::mediump_fmat2x2) != 16; + Error += sizeof(glm::mediump_fmat2x3) != 24; + Error += sizeof(glm::mediump_fmat2x4) != 32; + Error += sizeof(glm::mediump_fmat3x2) != 24; + Error += sizeof(glm::mediump_fmat3x3) != 36; + Error += sizeof(glm::mediump_fmat3x4) != 48; + Error += sizeof(glm::mediump_fmat4x2) != 32; + Error += sizeof(glm::mediump_fmat4x3) != 48; + Error += sizeof(glm::mediump_fmat4x4) != 64; + + Error += sizeof(glm::mediump_f32mat2) != 16; + Error += sizeof(glm::mediump_f32mat3) != 36; + Error += sizeof(glm::mediump_f32mat4) != 64; + Error += sizeof(glm::mediump_f32mat2x2) != 16; + Error += sizeof(glm::mediump_f32mat2x3) != 24; + Error += sizeof(glm::mediump_f32mat2x4) != 32; + Error += sizeof(glm::mediump_f32mat3x2) != 24; + Error += sizeof(glm::mediump_f32mat3x3) != 36; + Error += sizeof(glm::mediump_f32mat3x4) != 48; + Error += sizeof(glm::mediump_f32mat4x2) != 32; + Error += sizeof(glm::mediump_f32mat4x3) != 48; + Error += sizeof(glm::mediump_f32mat4x4) != 64; + + Error += sizeof(glm::highp_mat2) != 16; + Error += sizeof(glm::highp_mat3) != 36; + Error += sizeof(glm::highp_mat4) != 64; + Error += sizeof(glm::highp_mat2x2) != 16; + Error += sizeof(glm::highp_mat2x3) != 24; + Error += sizeof(glm::highp_mat2x4) != 32; + Error += sizeof(glm::highp_mat3x2) != 24; + Error += sizeof(glm::highp_mat3x3) != 36; + Error += sizeof(glm::highp_mat3x4) != 48; + Error += sizeof(glm::highp_mat4x2) != 32; + Error += sizeof(glm::highp_mat4x3) != 48; + Error += sizeof(glm::highp_mat4x4) != 64; + + Error += sizeof(glm::highp_fmat2) != 16; + Error += sizeof(glm::highp_fmat3) != 36; + Error += sizeof(glm::highp_fmat4) != 64; + Error += sizeof(glm::highp_fmat2x2) != 16; + Error += sizeof(glm::highp_fmat2x3) != 24; + Error += sizeof(glm::highp_fmat2x4) != 32; + Error += sizeof(glm::highp_fmat3x2) != 24; + Error += sizeof(glm::highp_fmat3x3) != 36; + Error += sizeof(glm::highp_fmat3x4) != 48; + Error += sizeof(glm::highp_fmat4x2) != 32; + Error += sizeof(glm::highp_fmat4x3) != 48; + Error += sizeof(glm::highp_fmat4x4) != 64; + + Error += sizeof(glm::highp_f32mat2) != 16; + Error += sizeof(glm::highp_f32mat3) != 36; + Error += sizeof(glm::highp_f32mat4) != 64; + Error += sizeof(glm::highp_f32mat2x2) != 16; + Error += sizeof(glm::highp_f32mat2x3) != 24; + Error += sizeof(glm::highp_f32mat2x4) != 32; + Error += sizeof(glm::highp_f32mat3x2) != 24; + Error += sizeof(glm::highp_f32mat3x3) != 36; + Error += sizeof(glm::highp_f32mat3x4) != 48; + Error += sizeof(glm::highp_f32mat4x2) != 32; + Error += sizeof(glm::highp_f32mat4x3) != 48; + Error += sizeof(glm::highp_f32mat4x4) != 64; + + return Error; +} + +static int test_dmat_size() +{ + int Error = 0; + + Error += sizeof(glm::f64mat2) != 32; + Error += sizeof(glm::f64mat3) != 72; + Error += sizeof(glm::f64mat4) != 128; + Error += sizeof(glm::f64mat2x2) != 32; + Error += sizeof(glm::f64mat2x3) != 48; + Error += sizeof(glm::f64mat2x4) != 64; + Error += sizeof(glm::f64mat3x2) != 48; + Error += sizeof(glm::f64mat3x3) != 72; + Error += sizeof(glm::f64mat3x4) != 96; + Error += sizeof(glm::f64mat4x2) != 64; + Error += sizeof(glm::f64mat4x3) != 96; + Error += sizeof(glm::f64mat4x4) != 128; + + Error += sizeof(glm::lowp_f64mat2) != 32; + Error += sizeof(glm::lowp_f64mat3) != 72; + Error += sizeof(glm::lowp_f64mat4) != 128; + Error += sizeof(glm::lowp_f64mat2x2) != 32; + Error += sizeof(glm::lowp_f64mat2x3) != 48; + Error += sizeof(glm::lowp_f64mat2x4) != 64; + Error += sizeof(glm::lowp_f64mat3x2) != 48; + Error += sizeof(glm::lowp_f64mat3x3) != 72; + Error += sizeof(glm::lowp_f64mat3x4) != 96; + Error += sizeof(glm::lowp_f64mat4x2) != 64; + Error += sizeof(glm::lowp_f64mat4x3) != 96; + Error += sizeof(glm::lowp_f64mat4x4) != 128; + + Error += sizeof(glm::mediump_f64mat2) != 32; + Error += sizeof(glm::mediump_f64mat3) != 72; + Error += sizeof(glm::mediump_f64mat4) != 128; + Error += sizeof(glm::mediump_f64mat2x2) != 32; + Error += sizeof(glm::mediump_f64mat2x3) != 48; + Error += sizeof(glm::mediump_f64mat2x4) != 64; + Error += sizeof(glm::mediump_f64mat3x2) != 48; + Error += sizeof(glm::mediump_f64mat3x3) != 72; + Error += sizeof(glm::mediump_f64mat3x4) != 96; + Error += sizeof(glm::mediump_f64mat4x2) != 64; + Error += sizeof(glm::mediump_f64mat4x3) != 96; + Error += sizeof(glm::mediump_f64mat4x4) != 128; + + Error += sizeof(glm::highp_f64mat2) != 32; + Error += sizeof(glm::highp_f64mat3) != 72; + Error += sizeof(glm::highp_f64mat4) != 128; + Error += sizeof(glm::highp_f64mat2x2) != 32; + Error += sizeof(glm::highp_f64mat2x3) != 48; + Error += sizeof(glm::highp_f64mat2x4) != 64; + Error += sizeof(glm::highp_f64mat3x2) != 48; + Error += sizeof(glm::highp_f64mat3x3) != 72; + Error += sizeof(glm::highp_f64mat3x4) != 96; + Error += sizeof(glm::highp_f64mat4x2) != 64; + Error += sizeof(glm::highp_f64mat4x3) != 96; + Error += sizeof(glm::highp_f64mat4x4) != 128; + + return Error; +} + +static int test_quat_size() +{ + int Error = 0; + + Error += sizeof(glm::f32quat) != 16; + Error += sizeof(glm::f64quat) != 32; + + Error += sizeof(glm::lowp_f32quat) != 16; + Error += sizeof(glm::lowp_f64quat) != 32; + + Error += sizeof(glm::mediump_f32quat) != 16; + Error += sizeof(glm::mediump_f64quat) != 32; + + Error += sizeof(glm::highp_f32quat) != 16; + Error += sizeof(glm::highp_f64quat) != 32; + + return Error; +} + +static int test_quat_precision() +{ + int Error = 0; + + { + glm::f32quat q1(0.f, glm::vec3(0.f, 0.f, 1.f)); + glm::lowp_f32quat qA(q1); + glm::mediump_f32quat qB(q1); + glm::highp_f32quat qC(q1); + glm::f32quat q2(qA); + glm::f32quat q3(qB); + glm::f32quat q4(qC); + + Error += glm::all(glm::equal(q1, q2, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(q1, q3, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(q1, q4, glm::epsilon())) ? 0 : 1; + } + + return Error; +} + +static int test_fvec_conversion() +{ + int Error(0); + + { + glm::highp_vec4 a = glm::vec4(1, 2, 3, 4); + glm::mediump_vec4 b = glm::vec4(1, 2, 3, 4); + glm::lowp_vec4 c = b; + glm::mediump_vec4 d = c; + glm::lowp_ivec4 e = glm::ivec4(d); + glm::lowp_ivec3 f = glm::ivec3(e); + + Error += glm::all(glm::equal(b, d, glm::epsilon())) ? 0 : 1; + } + + return Error; +} + +#if GLM_HAS_OPENMP +static int test_openmp() +{ + std::vector VectorA(1000); + std::vector VectorB(1000); + std::vector VectorC(1000); + + for (std::size_t i = 0; i < VectorA.size(); ++i) + { + VectorA[i] = glm::u8vec3(1, 1, 1); + VectorB[i] = glm::u8vec3(1, 1, 1); + } + + #pragma omp parallel for default(none) shared(VectorA, VectorB, VectorC) + for (int i = 0; i < static_cast(VectorC.size()); ++i) + { + VectorC[i] = VectorA[i] + VectorB[i]; + } + + return 0; +} +#endif//GLM_HAS_OPENMP + +int main() +{ + int Error = 0; + + Error += test_scalar_size(); + Error += test_fvec_size(); + + Error += test_fvec_precision(); + Error += test_fvec_conversion(); + + Error += test_dvec_precision(); + + Error += test_uvec_size(); + Error += test_uvec_precision(); + Error += test_ivec_size(); + Error += test_ivec_precision(); + + Error += test_fmat_size(); + Error += test_dmat_size(); + Error += test_quat_size(); + Error += test_quat_precision(); + +# if GLM_HAS_OPENMP + Error += test_openmp(); +# endif// + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtc/gtc_type_ptr.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtc/gtc_type_ptr.cpp new file mode 100644 index 0000000000000000000000000000000000000000..9b9e0640bedfb555e887b56ffbb8148bc6fe2bbf --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtc/gtc_type_ptr.cpp @@ -0,0 +1,335 @@ +#include +#include +#include +#include + +int test_value_ptr_vec() +{ + int Error = 0; + + { + glm::vec2 v(1.0); + float * p = glm::value_ptr(v); + Error += p == &v[0] ? 0 : 1; + } + { + glm::vec3 v(1.0); + float * p = glm::value_ptr(v); + Error += p == &v[0] ? 0 : 1; + } + { + glm::vec4 v(1.0); + float * p = glm::value_ptr(v); + Error += p == &v[0] ? 0 : 1; + } + + { + glm::dvec2 v(1.0); + double * p = glm::value_ptr(v); + Error += p == &v[0] ? 0 : 1; + } + { + glm::dvec3 v(1.0); + double * p = glm::value_ptr(v); + Error += p == &v[0] ? 0 : 1; + } + { + glm::dvec4 v(1.0); + double * p = glm::value_ptr(v); + Error += p == &v[0] ? 0 : 1; + } + + return Error; +} + +int test_value_ptr_vec_const() +{ + int Error = 0; + + { + glm::vec2 const v(1.0); + float const * p = glm::value_ptr(v); + Error += p == &v[0] ? 0 : 1; + } + { + glm::vec3 const v(1.0); + float const * p = glm::value_ptr(v); + Error += p == &v[0] ? 0 : 1; + } + { + glm::vec4 const v(1.0); + float const * p = glm::value_ptr(v); + Error += p == &v[0] ? 0 : 1; + } + + { + glm::dvec2 const v(1.0); + double const * p = glm::value_ptr(v); + Error += p == &v[0] ? 0 : 1; + } + { + glm::dvec3 const v(1.0); + double const * p = glm::value_ptr(v); + Error += p == &v[0] ? 0 : 1; + } + { + glm::dvec4 const v(1.0); + double const * p = glm::value_ptr(v); + Error += p == &v[0] ? 0 : 1; + } + + return Error; +} + +int test_value_ptr_mat() +{ + int Error = 0; + + { + glm::mat2x2 m(1.0); + float * p = glm::value_ptr(m); + Error += p == &m[0][0] ? 0 : 1; + } + { + glm::mat2x3 m(1.0); + float * p = glm::value_ptr(m); + Error += p == &m[0][0] ? 0 : 1; + } + { + glm::mat2x4 m(1.0); + float * p = glm::value_ptr(m); + Error += p == &m[0][0] ? 0 : 1; + } + { + glm::mat3x2 m(1.0); + float * p = glm::value_ptr(m); + Error += p == &m[0][0] ? 0 : 1; + } + { + glm::mat3x3 m(1.0); + float * p = glm::value_ptr(m); + Error += p == &m[0][0] ? 0 : 1; + } + { + glm::mat3x4 m(1.0); + float * p = glm::value_ptr(m); + Error += p == &m[0][0] ? 0 : 1; + } + { + glm::mat4x2 m(1.0); + float * p = glm::value_ptr(m); + Error += p == &m[0][0] ? 0 : 1; + } + { + glm::mat4x3 m(1.0); + float * p = glm::value_ptr(m); + Error += p == &m[0][0] ? 0 : 1; + } + { + glm::mat4x4 m(1.0); + float * p = glm::value_ptr(m); + Error += p == &m[0][0] ? 0 : 1; + } + + return Error; +} + +int test_value_ptr_mat_const() +{ + int Error = 0; + + { + glm::mat2x2 const m(1.0); + float const * p = glm::value_ptr(m); + Error += p == &m[0][0] ? 0 : 1; + } + { + glm::mat2x3 const m(1.0); + float const * p = glm::value_ptr(m); + Error += p == &m[0][0] ? 0 : 1; + } + { + glm::mat2x4 const m(1.0); + float const * p = glm::value_ptr(m); + Error += p == &m[0][0] ? 0 : 1; + } + { + glm::mat3x2 const m(1.0); + float const * p = glm::value_ptr(m); + Error += p == &m[0][0] ? 0 : 1; + } + { + glm::mat3x3 const m(1.0); + float const * p = glm::value_ptr(m); + Error += p == &m[0][0] ? 0 : 1; + } + { + glm::mat3x4 const m(1.0); + float const * p = glm::value_ptr(m); + Error += p == &m[0][0] ? 0 : 1; + } + { + glm::mat4x2 const m(1.0); + float const * p = glm::value_ptr(m); + Error += p == &m[0][0] ? 0 : 1; + } + { + glm::mat4x3 const m(1.0); + float const * p = glm::value_ptr(m); + Error += p == &m[0][0] ? 0 : 1; + } + { + glm::mat4x4 const m(1.0); + float const * p = glm::value_ptr(m); + Error += p == &m[0][0] ? 0 : 1; + } + + return Error; +} + +int test_make_pointer_mat() +{ + int Error = 0; + + float ArrayA[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}; + double ArrayB[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}; + + glm::mat2x2 Mat2x2A = glm::make_mat2x2(ArrayA); + glm::mat2x3 Mat2x3A = glm::make_mat2x3(ArrayA); + glm::mat2x4 Mat2x4A = glm::make_mat2x4(ArrayA); + glm::mat3x2 Mat3x2A = glm::make_mat3x2(ArrayA); + glm::mat3x3 Mat3x3A = glm::make_mat3x3(ArrayA); + glm::mat3x4 Mat3x4A = glm::make_mat3x4(ArrayA); + glm::mat4x2 Mat4x2A = glm::make_mat4x2(ArrayA); + glm::mat4x3 Mat4x3A = glm::make_mat4x3(ArrayA); + glm::mat4x4 Mat4x4A = glm::make_mat4x4(ArrayA); + + glm::dmat2x2 Mat2x2B = glm::make_mat2x2(ArrayB); + glm::dmat2x3 Mat2x3B = glm::make_mat2x3(ArrayB); + glm::dmat2x4 Mat2x4B = glm::make_mat2x4(ArrayB); + glm::dmat3x2 Mat3x2B = glm::make_mat3x2(ArrayB); + glm::dmat3x3 Mat3x3B = glm::make_mat3x3(ArrayB); + glm::dmat3x4 Mat3x4B = glm::make_mat3x4(ArrayB); + glm::dmat4x2 Mat4x2B = glm::make_mat4x2(ArrayB); + glm::dmat4x3 Mat4x3B = glm::make_mat4x3(ArrayB); + glm::dmat4x4 Mat4x4B = glm::make_mat4x4(ArrayB); + + return Error; +} + +int test_make_pointer_vec() +{ + int Error = 0; + + float ArrayA[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}; + int ArrayB[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}; + bool ArrayC[] = {true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false}; + + glm::vec2 Vec2A = glm::make_vec2(ArrayA); + glm::vec3 Vec3A = glm::make_vec3(ArrayA); + glm::vec4 Vec4A = glm::make_vec4(ArrayA); + + glm::ivec2 Vec2B = glm::make_vec2(ArrayB); + glm::ivec3 Vec3B = glm::make_vec3(ArrayB); + glm::ivec4 Vec4B = glm::make_vec4(ArrayB); + + glm::bvec2 Vec2C = glm::make_vec2(ArrayC); + glm::bvec3 Vec3C = glm::make_vec3(ArrayC); + glm::bvec4 Vec4C = glm::make_vec4(ArrayC); + + return Error; +} + +int test_make_vec1() +{ + int Error = 0; + + glm::ivec1 const v1 = glm::make_vec1(glm::ivec1(2)); + Error += v1 == glm::ivec1(2) ? 0 : 1; + + glm::ivec1 const v2 = glm::make_vec1(glm::ivec2(2)); + Error += v2 == glm::ivec1(2) ? 0 : 1; + + glm::ivec1 const v3 = glm::make_vec1(glm::ivec3(2)); + Error += v3 == glm::ivec1(2) ? 0 : 1; + + glm::ivec1 const v4 = glm::make_vec1(glm::ivec4(2)); + Error += v3 == glm::ivec1(2) ? 0 : 1; + + return Error; +} + +int test_make_vec2() +{ + int Error = 0; + + glm::ivec2 const v1 = glm::make_vec2(glm::ivec1(2)); + Error += v1 == glm::ivec2(2, 0) ? 0 : 1; + + glm::ivec2 const v2 = glm::make_vec2(glm::ivec2(2)); + Error += v2 == glm::ivec2(2, 2) ? 0 : 1; + + glm::ivec2 const v3 = glm::make_vec2(glm::ivec3(2)); + Error += v3 == glm::ivec2(2, 2) ? 0 : 1; + + glm::ivec2 const v4 = glm::make_vec2(glm::ivec4(2)); + Error += v3 == glm::ivec2(2, 2) ? 0 : 1; + + return Error; +} + +int test_make_vec3() +{ + int Error = 0; + + glm::ivec3 const v1 = glm::make_vec3(glm::ivec1(2)); + Error += v1 == glm::ivec3(2, 0, 0) ? 0 : 1; + + glm::ivec3 const v2 = glm::make_vec3(glm::ivec2(2)); + Error += v2 == glm::ivec3(2, 2, 0) ? 0 : 1; + + glm::ivec3 const v3 = glm::make_vec3(glm::ivec3(2)); + Error += v3 == glm::ivec3(2, 2, 2) ? 0 : 1; + + glm::ivec3 const v4 = glm::make_vec3(glm::ivec4(2)); + Error += v3 == glm::ivec3(2, 2, 2) ? 0 : 1; + + return Error; +} + +int test_make_vec4() +{ + int Error = 0; + + glm::ivec4 const v1 = glm::make_vec4(glm::ivec1(2)); + Error += v1 == glm::ivec4(2, 0, 0, 1) ? 0 : 1; + + glm::ivec4 const v2 = glm::make_vec4(glm::ivec2(2)); + Error += v2 == glm::ivec4(2, 2, 0, 1) ? 0 : 1; + + glm::ivec4 const v3 = glm::make_vec4(glm::ivec3(2)); + Error += v3 == glm::ivec4(2, 2, 2, 1) ? 0 : 1; + + glm::ivec4 const v4 = glm::make_vec4(glm::ivec4(2)); + Error += v4 == glm::ivec4(2, 2, 2, 2) ? 0 : 1; + + return Error; +} + +int main() +{ + int Error = 0; + + Error += test_make_vec1(); + Error += test_make_vec2(); + Error += test_make_vec3(); + Error += test_make_vec4(); + Error += test_make_pointer_vec(); + Error += test_make_pointer_mat(); + Error += test_value_ptr_vec(); + Error += test_value_ptr_vec_const(); + Error += test_value_ptr_mat(); + Error += test_value_ptr_mat_const(); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtc/gtc_ulp.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtc/gtc_ulp.cpp new file mode 100644 index 0000000000000000000000000000000000000000..84b8e1e6ca2fef2cb0ab90a9c27742bc7f94423b --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtc/gtc_ulp.cpp @@ -0,0 +1,99 @@ +#include +#include +#include + +int test_ulp_float_dist() +{ + int Error = 0; + + float A = 1.0f; + + float B = glm::next_float(A); + Error += glm::notEqual(A, B, 0) ? 0 : 1; + float C = glm::prev_float(B); + Error += glm::equal(A, C, 0) ? 0 : 1; + + int D = glm::float_distance(A, B); + Error += D == 1 ? 0 : 1; + int E = glm::float_distance(A, C); + Error += E == 0 ? 0 : 1; + + return Error; +} + +int test_ulp_float_step() +{ + int Error = 0; + + float A = 1.0f; + + for(int i = 10; i < 1000; i *= 10) + { + float B = glm::next_float(A, i); + Error += glm::notEqual(A, B, 0) ? 0 : 1; + float C = glm::prev_float(B, i); + Error += glm::equal(A, C, 0) ? 0 : 1; + + int D = glm::float_distance(A, B); + Error += D == i ? 0 : 1; + int E = glm::float_distance(A, C); + Error += E == 0 ? 0 : 1; + } + + return Error; +} + +int test_ulp_double_dist() +{ + int Error = 0; + + double A = 1.0; + + double B = glm::next_float(A); + Error += glm::notEqual(A, B, 0) ? 0 : 1; + double C = glm::prev_float(B); + Error += glm::equal(A, C, 0) ? 0 : 1; + + glm::int64 const D = glm::float_distance(A, B); + Error += D == 1 ? 0 : 1; + glm::int64 const E = glm::float_distance(A, C); + Error += E == 0 ? 0 : 1; + + return Error; +} + +int test_ulp_double_step() +{ + int Error = 0; + + double A = 1.0; + + for(int i = 10; i < 1000; i *= 10) + { + double B = glm::next_float(A, i); + Error += glm::notEqual(A, B, 0) ? 0 : 1; + double C = glm::prev_float(B, i); + Error += glm::equal(A, C, 0) ? 0 : 1; + + glm::int64 const D = glm::float_distance(A, B); + Error += D == i ? 0 : 1; + glm::int64 const E = glm::float_distance(A, C); + Error += E == 0 ? 0 : 1; + } + + return Error; +} + +int main() +{ + int Error = 0; + + Error += test_ulp_float_dist(); + Error += test_ulp_float_step(); + Error += test_ulp_double_dist(); + Error += test_ulp_double_step(); + + return Error; +} + + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtc/gtc_user_defined_types.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtc/gtc_user_defined_types.cpp new file mode 100644 index 0000000000000000000000000000000000000000..718e90cf5ea57c401219969822c86f8fbc6b3714 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtc/gtc_user_defined_types.cpp @@ -0,0 +1,30 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2010-09-16 +// Updated : 2011-05-27 +// Licence : This source is under MIT licence +// File : test/gtc/type_ptr.cpp +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#define GLM_FORCE_RADIANS +#include + +int test_make_pointer_vec() +{ + int Error = 0; + + glm::func(); + //func(); + + return Error; +} + +int main() +{ + int Error = 0; + + Error += test_make_pointer_vec(); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtc/gtc_vec1.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtc/gtc_vec1.cpp new file mode 100644 index 0000000000000000000000000000000000000000..b259d745f883077f31ce28c42c7065044fce8fdb --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtc/gtc_vec1.cpp @@ -0,0 +1,8 @@ +#include + +int main() +{ + int Error = 0; + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/CMakeLists.txt b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..92bb787cae1ca7a32aa81051ef5a0d3867ce3929 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/CMakeLists.txt @@ -0,0 +1,60 @@ +glmCreateTestGTC(gtx) +glmCreateTestGTC(gtx_associated_min_max) +glmCreateTestGTC(gtx_closest_point) +glmCreateTestGTC(gtx_color_encoding) +glmCreateTestGTC(gtx_color_space_YCoCg) +glmCreateTestGTC(gtx_color_space) +glmCreateTestGTC(gtx_common) +glmCreateTestGTC(gtx_compatibility) +glmCreateTestGTC(gtx_component_wise) +glmCreateTestGTC(gtx_easing) +glmCreateTestGTC(gtx_euler_angle) +glmCreateTestGTC(gtx_extend) +glmCreateTestGTC(gtx_extended_min_max) +glmCreateTestGTC(gtx_exterior_product) +glmCreateTestGTC(gtx_fast_exponential) +glmCreateTestGTC(gtx_fast_square_root) +glmCreateTestGTC(gtx_fast_trigonometry) +glmCreateTestGTC(gtx_functions) +glmCreateTestGTC(gtx_gradient_paint) +glmCreateTestGTC(gtx_handed_coordinate_space) +glmCreateTestGTC(gtx_hash) +glmCreateTestGTC(gtx_integer) +glmCreateTestGTC(gtx_intersect) +glmCreateTestGTC(gtx_io) +glmCreateTestGTC(gtx_load) +glmCreateTestGTC(gtx_log_base) +glmCreateTestGTC(gtx_matrix_cross_product) +glmCreateTestGTC(gtx_matrix_decompose) +glmCreateTestGTC(gtx_matrix_factorisation) +glmCreateTestGTC(gtx_matrix_interpolation) +glmCreateTestGTC(gtx_matrix_major_storage) +glmCreateTestGTC(gtx_matrix_operation) +glmCreateTestGTC(gtx_matrix_query) +glmCreateTestGTC(gtx_matrix_transform_2d) +glmCreateTestGTC(gtx_norm) +glmCreateTestGTC(gtx_normal) +glmCreateTestGTC(gtx_normalize_dot) +glmCreateTestGTC(gtx_number_precision) +glmCreateTestGTC(gtx_orthonormalize) +glmCreateTestGTC(gtx_optimum_pow) +glmCreateTestGTC(gtx_pca) +glmCreateTestGTC(gtx_perpendicular) +glmCreateTestGTC(gtx_polar_coordinates) +glmCreateTestGTC(gtx_projection) +glmCreateTestGTC(gtx_quaternion) +glmCreateTestGTC(gtx_dual_quaternion) +glmCreateTestGTC(gtx_range) +glmCreateTestGTC(gtx_rotate_normalized_axis) +glmCreateTestGTC(gtx_rotate_vector) +glmCreateTestGTC(gtx_scalar_multiplication) +glmCreateTestGTC(gtx_scalar_relational) +glmCreateTestGTC(gtx_spline) +glmCreateTestGTC(gtx_string_cast) +glmCreateTestGTC(gtx_texture) +glmCreateTestGTC(gtx_type_aligned) +glmCreateTestGTC(gtx_type_trait) +glmCreateTestGTC(gtx_vec_swizzle) +glmCreateTestGTC(gtx_vector_angle) +glmCreateTestGTC(gtx_vector_query) +glmCreateTestGTC(gtx_wrap) diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx.cpp new file mode 100644 index 0000000000000000000000000000000000000000..3bbfa68e6cc4a052c48faaccb1447a9db2ab849f --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx.cpp @@ -0,0 +1,8 @@ +#include + +int main() +{ + int Error = 0; + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_associated_min_max.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_associated_min_max.cpp new file mode 100644 index 0000000000000000000000000000000000000000..3b8b80d77563875a7da0ea531f1000ae72936b7f --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_associated_min_max.cpp @@ -0,0 +1,10 @@ +#define GLM_ENABLE_EXPERIMENTAL +#include +#include + +int main() +{ + int Error(0); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_closest_point.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_closest_point.cpp new file mode 100644 index 0000000000000000000000000000000000000000..cd3cde9438aab8b4f0269d2ba91dff62c9bfc64e --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_closest_point.cpp @@ -0,0 +1,9 @@ +#define GLM_ENABLE_EXPERIMENTAL +#include + +int main() +{ + int Error(0); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_color_encoding.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_color_encoding.cpp new file mode 100644 index 0000000000000000000000000000000000000000..5373e63394560d22d14a62efcee84725d21c6edd --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_color_encoding.cpp @@ -0,0 +1,51 @@ +#include +#include +#include +#include + +namespace srgb +{ + int test() + { + int Error(0); + + glm::vec3 const ColorSourceRGB(1.0, 0.5, 0.0); +/* + { + glm::vec3 const ColorSRGB = glm::convertLinearSRGBToD65XYZ(ColorSourceRGB); + glm::vec3 const ColorRGB = glm::convertD65XYZToLinearSRGB(ColorSRGB); + Error += glm::all(glm::epsilonEqual(ColorSourceRGB, ColorRGB, 0.00001f)) ? 0 : 1; + } +*/ + { + glm::vec3 const ColorSRGB = glm::convertLinearToSRGB(ColorSourceRGB, 2.8f); + glm::vec3 const ColorRGB = glm::convertSRGBToLinear(ColorSRGB, 2.8f); + Error += glm::all(glm::epsilonEqual(ColorSourceRGB, ColorRGB, 0.00001f)) ? 0 : 1; + } + + glm::vec4 const ColorSourceRGBA(1.0, 0.5, 0.0, 1.0); + + { + glm::vec4 const ColorSRGB = glm::convertLinearToSRGB(ColorSourceRGBA); + glm::vec4 const ColorRGB = glm::convertSRGBToLinear(ColorSRGB); + Error += glm::all(glm::epsilonEqual(ColorSourceRGBA, ColorRGB, 0.00001f)) ? 0 : 1; + } + + { + glm::vec4 const ColorSRGB = glm::convertLinearToSRGB(ColorSourceRGBA, 2.8f); + glm::vec4 const ColorRGB = glm::convertSRGBToLinear(ColorSRGB, 2.8f); + Error += glm::all(glm::epsilonEqual(ColorSourceRGBA, ColorRGB, 0.00001f)) ? 0 : 1; + } + + return Error; + } +}//namespace srgb + +int main() +{ + int Error(0); + + Error += srgb::test(); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_color_space.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_color_space.cpp new file mode 100644 index 0000000000000000000000000000000000000000..6a9160787989ee0bc3881983f80f822994547c5e --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_color_space.cpp @@ -0,0 +1,20 @@ +#define GLM_ENABLE_EXPERIMENTAL +#include + +int test_saturation() +{ + int Error(0); + + glm::vec4 Color = glm::saturation(1.0f, glm::vec4(1.0, 0.5, 0.0, 1.0)); + + return Error; +} + +int main() +{ + int Error(0); + + Error += test_saturation(); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_color_space_YCoCg.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_color_space_YCoCg.cpp new file mode 100644 index 0000000000000000000000000000000000000000..43cfd5ec38abd10f2f9f23d3a25b8128641c106c --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_color_space_YCoCg.cpp @@ -0,0 +1,9 @@ +#define GLM_ENABLE_EXPERIMENTAL +#include + +int main() +{ + int Error(0); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_common.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_common.cpp new file mode 100644 index 0000000000000000000000000000000000000000..2aa16a5c5332d1058177cbbaf9d620853e80f0ae --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_common.cpp @@ -0,0 +1,161 @@ +#define GLM_ENABLE_EXPERIMENTAL +#include +#include +#include +#include +#include + +namespace fmod_ +{ + template + GLM_FUNC_QUALIFIER genType modTrunc(genType a, genType b) + { + return a - b * glm::trunc(a / b); + } + + int test() + { + int Error(0); + + { + float A0(3.0); + float B0(2.0f); + float C0 = glm::fmod(A0, B0); + + Error += glm::abs(C0 - 1.0f) < 0.00001f ? 0 : 1; + + glm::vec4 A1(3.0); + float B1(2.0f); + glm::vec4 C1 = glm::fmod(A1, B1); + + Error += glm::all(glm::epsilonEqual(C1, glm::vec4(1.0f), 0.00001f)) ? 0 : 1; + + glm::vec4 A2(3.0); + glm::vec4 B2(2.0f); + glm::vec4 C2 = glm::fmod(A2, B2); + + Error += glm::all(glm::epsilonEqual(C2, glm::vec4(1.0f), 0.00001f)) ? 0 : 1; + + glm::ivec4 A3(3); + int B3(2); + glm::ivec4 C3 = glm::fmod(A3, B3); + + Error += glm::all(glm::equal(C3, glm::ivec4(1))) ? 0 : 1; + + glm::ivec4 A4(3); + glm::ivec4 B4(2); + glm::ivec4 C4 = glm::fmod(A4, B4); + + Error += glm::all(glm::equal(C4, glm::ivec4(1))) ? 0 : 1; + } + + { + float A0(22.0); + float B0(-10.0f); + float C0 = glm::fmod(A0, B0); + + Error += glm::abs(C0 - 2.0f) < 0.00001f ? 0 : 1; + + glm::vec4 A1(22.0); + float B1(-10.0f); + glm::vec4 C1 = glm::fmod(A1, B1); + + Error += glm::all(glm::epsilonEqual(C1, glm::vec4(2.0f), 0.00001f)) ? 0 : 1; + + glm::vec4 A2(22.0); + glm::vec4 B2(-10.0f); + glm::vec4 C2 = glm::fmod(A2, B2); + + Error += glm::all(glm::epsilonEqual(C2, glm::vec4(2.0f), 0.00001f)) ? 0 : 1; + + glm::ivec4 A3(22); + int B3(-10); + glm::ivec4 C3 = glm::fmod(A3, B3); + + Error += glm::all(glm::equal(C3, glm::ivec4(2))) ? 0 : 1; + + glm::ivec4 A4(22); + glm::ivec4 B4(-10); + glm::ivec4 C4 = glm::fmod(A4, B4); + + Error += glm::all(glm::equal(C4, glm::ivec4(2))) ? 0 : 1; + } + + // http://stackoverflow.com/questions/7610631/glsl-mod-vs-hlsl-fmod + { + for (float y = -10.0f; y < 10.0f; y += 0.1f) + for (float x = -10.0f; x < 10.0f; x += 0.1f) + { + float const A(std::fmod(x, y)); + //float const B(std::remainder(x, y)); + float const C(glm::fmod(x, y)); + float const D(modTrunc(x, y)); + + //Error += glm::epsilonEqual(A, B, 0.0001f) ? 0 : 1; + //assert(!Error); + Error += glm::epsilonEqual(A, C, 0.0001f) ? 0 : 1; + assert(!Error); + Error += glm::epsilonEqual(A, D, 0.00001f) ? 0 : 1; + assert(!Error); + } + } + + return Error; + } +}//namespace fmod_ + +int test_isdenormal() +{ + int Error = 0; + + bool A = glm::isdenormal(1.0f); + Error += !A ? 0 : 1; + + glm::bvec1 B = glm::isdenormal(glm::vec1(1.0f)); + Error += !glm::any(B) ? 0 : 1; + + glm::bvec2 C = glm::isdenormal(glm::vec2(1.0f)); + Error += !glm::any(C) ? 0 : 1; + + glm::bvec3 D = glm::isdenormal(glm::vec3(1.0f)); + Error += !glm::any(D) ? 0 : 1; + + glm::bvec4 E = glm::isdenormal(glm::vec4(1.0f)); + Error += !glm::any(E) ? 0 : 1; + + return Error; +} + +int test_openBounded() +{ + int Error = 0; + + Error += glm::all(glm::openBounded(glm::ivec2(2), glm::ivec2(1), glm::ivec2(3))) ? 0 : 1; + Error += !glm::all(glm::openBounded(glm::ivec2(1), glm::ivec2(1), glm::ivec2(3))) ? 0 : 1; + Error += !glm::all(glm::openBounded(glm::ivec2(3), glm::ivec2(1), glm::ivec2(3))) ? 0 : 1; + + return Error; +} + +int test_closeBounded() +{ + int Error = 0; + + Error += glm::all(glm::closeBounded(glm::ivec2(2), glm::ivec2(1), glm::ivec2(3))) ? 0 : 1; + Error += glm::all(glm::closeBounded(glm::ivec2(1), glm::ivec2(1), glm::ivec2(3))) ? 0 : 1; + Error += glm::all(glm::closeBounded(glm::ivec2(3), glm::ivec2(1), glm::ivec2(3))) ? 0 : 1; + + return Error; +} + +int main() +{ + int Error = 0; + + Error += test_isdenormal(); + Error += ::fmod_::test(); + Error += test_openBounded(); + Error += test_closeBounded(); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_compatibility.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_compatibility.cpp new file mode 100644 index 0000000000000000000000000000000000000000..255c9f969ecc722e0172ac378c2f85bb519f3ead --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_compatibility.cpp @@ -0,0 +1,19 @@ +#define GLM_ENABLE_EXPERIMENTAL +#include + +int main() +{ + int Error(0); + + Error += glm::isfinite(1.0f) ? 0 : 1; + Error += glm::isfinite(1.0) ? 0 : 1; + Error += glm::isfinite(-1.0f) ? 0 : 1; + Error += glm::isfinite(-1.0) ? 0 : 1; + + Error += glm::all(glm::isfinite(glm::vec4(1.0f))) ? 0 : 1; + Error += glm::all(glm::isfinite(glm::dvec4(1.0))) ? 0 : 1; + Error += glm::all(glm::isfinite(glm::vec4(-1.0f))) ? 0 : 1; + Error += glm::all(glm::isfinite(glm::dvec4(-1.0))) ? 0 : 1; + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_component_wise.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_component_wise.cpp new file mode 100644 index 0000000000000000000000000000000000000000..6cc8f63f5a436907b4c2a10b9756cea5ec96adb3 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_component_wise.cpp @@ -0,0 +1,116 @@ +#define GLM_ENABLE_EXPERIMENTAL +#include +#include +#include +#include +#include + +namespace compNormalize +{ + int run() + { + int Error(0); + + { + glm::vec4 const A = glm::compNormalize(glm::u8vec4(0, 127, 128, 255)); + + Error += glm::epsilonEqual(A.x, 0.0f, glm::epsilon()) ? 0 : 1; + Error += A.y < 0.5f ? 0 : 1; + Error += A.z > 0.5f ? 0 : 1; + Error += glm::epsilonEqual(A.w, 1.0f, glm::epsilon()) ? 0 : 1; + } + + { + glm::vec4 const A = glm::compNormalize(glm::i8vec4(-128, -1, 0, 127)); + + Error += glm::epsilonEqual(A.x,-1.0f, glm::epsilon()) ? 0 : 1; + Error += A.y < 0.0f ? 0 : 1; + Error += A.z > 0.0f ? 0 : 1; + Error += glm::epsilonEqual(A.w, 1.0f, glm::epsilon()) ? 0 : 1; + } + + { + glm::vec4 const A = glm::compNormalize(glm::u16vec4( + std::numeric_limits::min(), + (std::numeric_limits::max() >> 1) + 0, + (std::numeric_limits::max() >> 1) + 1, + std::numeric_limits::max())); + + Error += glm::epsilonEqual(A.x, 0.0f, glm::epsilon()) ? 0 : 1; + Error += A.y < 0.5f ? 0 : 1; + Error += A.z > 0.5f ? 0 : 1; + Error += glm::epsilonEqual(A.w, 1.0f, glm::epsilon()) ? 0 : 1; + } + + { + glm::vec4 const A = glm::compNormalize(glm::i16vec4( + std::numeric_limits::min(), + static_cast(-1), + static_cast(0), + std::numeric_limits::max())); + + Error += glm::epsilonEqual(A.x,-1.0f, glm::epsilon()) ? 0 : 1; + Error += A.y < 0.0f ? 0 : 1; + Error += A.z > 0.0f ? 0 : 1; + Error += glm::epsilonEqual(A.w, 1.0f, glm::epsilon()) ? 0 : 1; + } + + return Error; + } +}//namespace compNormalize + +namespace compScale +{ + int run() + { + int Error(0); + + { + glm::u8vec4 const A = glm::compScale(glm::vec4(0.0f, 0.2f, 0.5f, 1.0f)); + + Error += A.x == std::numeric_limits::min() ? 0 : 1; + Error += A.y < (std::numeric_limits::max() >> 2) ? 0 : 1; + Error += A.z == 127 ? 0 : 1; + Error += A.w == 255 ? 0 : 1; + } + + { + glm::i8vec4 const A = glm::compScale(glm::vec4(0.0f,-1.0f, 0.5f, 1.0f)); + + Error += A.x == 0 ? 0 : 1; + Error += A.y == -128 ? 0 : 1; + Error += A.z == 63 ? 0 : 1; + Error += A.w == 127 ? 0 : 1; + } + + { + glm::u16vec4 const A = glm::compScale(glm::vec4(0.0f, 0.2f, 0.5f, 1.0f)); + + Error += A.x == std::numeric_limits::min() ? 0 : 1; + Error += A.y < (std::numeric_limits::max() >> 2) ? 0 : 1; + Error += A.z == 32767 ? 0 : 1; + Error += A.w == 65535 ? 0 : 1; + } + + { + glm::i16vec4 const A = glm::compScale(glm::vec4(0.0f,-1.0f, 0.5f, 1.0f)); + + Error += A.x == 0 ? 0 : 1; + Error += A.y == -32768 ? 0 : 1; + Error += A.z == 16383 ? 0 : 1; + Error += A.w == 32767 ? 0 : 1; + } + + return Error; + } +}// compScale + +int main() +{ + int Error(0); + + Error += compNormalize::run(); + Error += compScale::run(); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_dual_quaternion.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_dual_quaternion.cpp new file mode 100644 index 0000000000000000000000000000000000000000..a505344fd70d1329b90eb992fbcd044ce2d88105 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_dual_quaternion.cpp @@ -0,0 +1,205 @@ +#define GLM_ENABLE_EXPERIMENTAL +#define GLM_FORCE_CTOR_INIT +#include +#include +#include +#include +#include +#if GLM_HAS_TRIVIAL_QUERIES +# include +#endif + +int myrand() +{ + static int holdrand = 1; + return (((holdrand = holdrand * 214013L + 2531011L) >> 16) & 0x7fff); +} + +float myfrand() // returns values from -1 to 1 inclusive +{ + return float(double(myrand()) / double( 0x7ffff )) * 2.0f - 1.0f; +} + +int test_dquat_type() +{ + glm::dvec3 vA; + glm::dquat dqA, dqB; + glm::ddualquat C(dqA, dqB); + glm::ddualquat B(dqA); + glm::ddualquat D(dqA, vA); + return 0; +} + +int test_scalars() +{ + float const Epsilon = 0.0001f; + + int Error(0); + + glm::quat src_q1 = glm::quat(1.0f,2.0f,3.0f,4.0f); + glm::quat src_q2 = glm::quat(5.0f,6.0f,7.0f,8.0f); + glm::dualquat src1(src_q1,src_q2); + + { + glm::dualquat dst1 = src1 * 2.0f; + glm::dualquat dst2 = 2.0f * src1; + glm::dualquat dst3 = src1; + dst3 *= 2.0f; + glm::dualquat dstCmp(src_q1 * 2.0f,src_q2 * 2.0f); + Error += glm::all(glm::epsilonEqual(dst1.real,dstCmp.real, Epsilon)) && glm::all(glm::epsilonEqual(dst1.dual,dstCmp.dual, Epsilon)) ? 0 : 1; + Error += glm::all(glm::epsilonEqual(dst2.real,dstCmp.real, Epsilon)) && glm::all(glm::epsilonEqual(dst2.dual,dstCmp.dual, Epsilon)) ? 0 : 1; + Error += glm::all(glm::epsilonEqual(dst3.real,dstCmp.real, Epsilon)) && glm::all(glm::epsilonEqual(dst3.dual,dstCmp.dual, Epsilon)) ? 0 : 1; + } + + { + glm::dualquat dst1 = src1 / 2.0f; + glm::dualquat dst2 = src1; + dst2 /= 2.0f; + glm::dualquat dstCmp(src_q1 / 2.0f,src_q2 / 2.0f); + Error += glm::all(glm::epsilonEqual(dst1.real,dstCmp.real, Epsilon)) && glm::all(glm::epsilonEqual(dst1.dual,dstCmp.dual, Epsilon)) ? 0 : 1; + Error += glm::all(glm::epsilonEqual(dst2.real,dstCmp.real, Epsilon)) && glm::all(glm::epsilonEqual(dst2.dual,dstCmp.dual, Epsilon)) ? 0 : 1; + } + return Error; +} + +int test_inverse() +{ + int Error(0); + + float const Epsilon = 0.0001f; + + glm::dualquat dqid = glm::dual_quat_identity(); + glm::mat4x4 mid(1.0f); + + for (int j = 0; j < 100; ++j) + { + glm::mat4x4 rot = glm::yawPitchRoll(myfrand() * 360.0f, myfrand() * 360.0f, myfrand() * 360.0f); + glm::vec3 vt = glm::vec3(myfrand() * 10.0f, myfrand() * 10.0f, myfrand() * 10.0f); + + glm::mat4x4 m = glm::translate(mid, vt) * rot; + + glm::quat qr = glm::quat_cast(m); + + glm::dualquat dq(qr); + + glm::dualquat invdq = glm::inverse(dq); + + glm::dualquat r1 = invdq * dq; + glm::dualquat r2 = dq * invdq; + + Error += glm::all(glm::epsilonEqual(r1.real, dqid.real, Epsilon)) && glm::all(glm::epsilonEqual(r1.dual, dqid.dual, Epsilon)) ? 0 : 1; + Error += glm::all(glm::epsilonEqual(r2.real, dqid.real, Epsilon)) && glm::all(glm::epsilonEqual(r2.dual, dqid.dual, Epsilon)) ? 0 : 1; + + // testing commutative property + glm::dualquat r ( glm::quat( myfrand() * glm::pi() * 2.0f, myfrand(), myfrand(), myfrand() ), + glm::vec3(myfrand() * 10.0f, myfrand() * 10.0f, myfrand() * 10.0f) ); + glm::dualquat riq = (r * invdq) * dq; + glm::dualquat rqi = (r * dq) * invdq; + + Error += glm::all(glm::epsilonEqual(riq.real, rqi.real, Epsilon)) && glm::all(glm::epsilonEqual(riq.dual, rqi.dual, Epsilon)) ? 0 : 1; + } + + return Error; +} + +int test_mul() +{ + int Error(0); + + float const Epsilon = 0.0001f; + + glm::mat4x4 mid(1.0f); + + for (int j = 0; j < 100; ++j) + { + // generate random rotations and translations and compare transformed by matrix and dualquats random points + glm::vec3 vt1 = glm::vec3(myfrand() * 10.0f, myfrand() * 10.0f, myfrand() * 10.0f); + glm::vec3 vt2 = glm::vec3(myfrand() * 10.0f, myfrand() * 10.0f, myfrand() * 10.0f); + + glm::mat4x4 rot1 = glm::yawPitchRoll(myfrand() * 360.0f, myfrand() * 360.0f, myfrand() * 360.0f); + glm::mat4x4 rot2 = glm::yawPitchRoll(myfrand() * 360.0f, myfrand() * 360.0f, myfrand() * 360.0f); + glm::mat4x4 m1 = glm::translate(mid, vt1) * rot1; + glm::mat4x4 m2 = glm::translate(mid, vt2) * rot2; + glm::mat4x4 m3 = m2 * m1; + glm::mat4x4 m4 = m1 * m2; + + glm::quat qrot1 = glm::quat_cast(rot1); + glm::quat qrot2 = glm::quat_cast(rot2); + + glm::dualquat dq1 = glm::dualquat(qrot1,vt1); + glm::dualquat dq2 = glm::dualquat(qrot2,vt2); + glm::dualquat dq3 = dq2 * dq1; + glm::dualquat dq4 = dq1 * dq2; + + for (int i = 0; i < 100; ++i) + { + glm::vec4 src_pt = glm::vec4(myfrand() * 4.0f, myfrand() * 5.0f, myfrand() * 3.0f,1.0f); + // test both multiplication orders + glm::vec4 dst_pt_m3 = m3 * src_pt; + glm::vec4 dst_pt_dq3 = dq3 * src_pt; + + glm::vec4 dst_pt_m3_i = glm::inverse(m3) * src_pt; + glm::vec4 dst_pt_dq3_i = src_pt * dq3; + + glm::vec4 dst_pt_m4 = m4 * src_pt; + glm::vec4 dst_pt_dq4 = dq4 * src_pt; + + glm::vec4 dst_pt_m4_i = glm::inverse(m4) * src_pt; + glm::vec4 dst_pt_dq4_i = src_pt * dq4; + + Error += glm::all(glm::epsilonEqual(dst_pt_m3, dst_pt_dq3, Epsilon)) ? 0 : 1; + Error += glm::all(glm::epsilonEqual(dst_pt_m4, dst_pt_dq4, Epsilon)) ? 0 : 1; + Error += glm::all(glm::epsilonEqual(dst_pt_m3_i, dst_pt_dq3_i, Epsilon)) ? 0 : 1; + Error += glm::all(glm::epsilonEqual(dst_pt_m4_i, dst_pt_dq4_i, Epsilon)) ? 0 : 1; + } + } + + return Error; +} + +int test_dual_quat_ctr() +{ + int Error(0); + +# if GLM_HAS_TRIVIAL_QUERIES + // Error += std::is_trivially_default_constructible::value ? 0 : 1; + // Error += std::is_trivially_default_constructible::value ? 0 : 1; + // Error += std::is_trivially_copy_assignable::value ? 0 : 1; + // Error += std::is_trivially_copy_assignable::value ? 0 : 1; + Error += std::is_trivially_copyable::value ? 0 : 1; + Error += std::is_trivially_copyable::value ? 0 : 1; + + Error += std::is_copy_constructible::value ? 0 : 1; + Error += std::is_copy_constructible::value ? 0 : 1; +# endif + + return Error; +} + +int test_size() +{ + int Error = 0; + + Error += 32 == sizeof(glm::dualquat) ? 0 : 1; + Error += 64 == sizeof(glm::ddualquat) ? 0 : 1; + Error += glm::dualquat().length() == 2 ? 0 : 1; + Error += glm::ddualquat().length() == 2 ? 0 : 1; + Error += glm::dualquat::length() == 2 ? 0 : 1; + Error += glm::ddualquat::length() == 2 ? 0 : 1; + + return Error; +} + +int main() +{ + int Error = 0; + + Error += test_dual_quat_ctr(); + Error += test_dquat_type(); + Error += test_scalars(); + Error += test_inverse(); + Error += test_mul(); + Error += test_size(); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_easing.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_easing.cpp new file mode 100644 index 0000000000000000000000000000000000000000..38b020615271667fef06f038ae05b8adac909c93 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_easing.cpp @@ -0,0 +1,65 @@ +#define GLM_ENABLE_EXPERIMENTAL +#include +#include +#include + +namespace +{ + + template + void _test_easing() + { + T a = static_cast(0.5); + T r; + + r = glm::linearInterpolation(a); + + r = glm::quadraticEaseIn(a); + r = glm::quadraticEaseOut(a); + r = glm::quadraticEaseInOut(a); + + r = glm::cubicEaseIn(a); + r = glm::cubicEaseOut(a); + r = glm::cubicEaseInOut(a); + + r = glm::quarticEaseIn(a); + r = glm::quarticEaseOut(a); + r = glm::quinticEaseInOut(a); + + r = glm::sineEaseIn(a); + r = glm::sineEaseOut(a); + r = glm::sineEaseInOut(a); + + r = glm::circularEaseIn(a); + r = glm::circularEaseOut(a); + r = glm::circularEaseInOut(a); + + r = glm::exponentialEaseIn(a); + r = glm::exponentialEaseOut(a); + r = glm::exponentialEaseInOut(a); + + r = glm::elasticEaseIn(a); + r = glm::elasticEaseOut(a); + r = glm::elasticEaseInOut(a); + + r = glm::backEaseIn(a); + r = glm::backEaseOut(a); + r = glm::backEaseInOut(a); + + r = glm::bounceEaseIn(a); + r = glm::bounceEaseOut(a); + r = glm::bounceEaseInOut(a); + } + +} + +int main() +{ + int Error = 0; + + _test_easing(); + _test_easing(); + + return Error; +} + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_euler_angle.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_euler_angle.cpp new file mode 100644 index 0000000000000000000000000000000000000000..2686784305d21f877cacad2678ff29294fc07715 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_euler_angle.cpp @@ -0,0 +1,539 @@ +// Code sample from Filippo Ramaciotti + +#define GLM_ENABLE_EXPERIMENTAL +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace test_eulerAngleX +{ + int test() + { + int Error = 0; + + float const Angle(glm::pi() * 0.5f); + glm::vec3 const X(1.0f, 0.0f, 0.0f); + + glm::vec4 const Y(0.0f, 1.0f, 0.0f, 1.0f); + glm::vec4 const Y1 = glm::rotate(glm::mat4(1.0f), Angle, X) * Y; + glm::vec4 const Y2 = glm::eulerAngleX(Angle) * Y; + glm::vec4 const Y3 = glm::eulerAngleXY(Angle, 0.0f) * Y; + glm::vec4 const Y4 = glm::eulerAngleYX(0.0f, Angle) * Y; + glm::vec4 const Y5 = glm::eulerAngleXZ(Angle, 0.0f) * Y; + glm::vec4 const Y6 = glm::eulerAngleZX(0.0f, Angle) * Y; + glm::vec4 const Y7 = glm::eulerAngleYXZ(0.0f, Angle, 0.0f) * Y; + Error += glm::all(glm::epsilonEqual(Y1, Y2, 0.00001f)) ? 0 : 1; + Error += glm::all(glm::epsilonEqual(Y1, Y3, 0.00001f)) ? 0 : 1; + Error += glm::all(glm::epsilonEqual(Y1, Y4, 0.00001f)) ? 0 : 1; + Error += glm::all(glm::epsilonEqual(Y1, Y5, 0.00001f)) ? 0 : 1; + Error += glm::all(glm::epsilonEqual(Y1, Y6, 0.00001f)) ? 0 : 1; + Error += glm::all(glm::epsilonEqual(Y1, Y7, 0.00001f)) ? 0 : 1; + + glm::vec4 const Z(0.0f, 0.0f, 1.0f, 1.0f); + glm::vec4 const Z1 = glm::rotate(glm::mat4(1.0f), Angle, X) * Z; + glm::vec4 const Z2 = glm::eulerAngleX(Angle) * Z; + glm::vec4 const Z3 = glm::eulerAngleXY(Angle, 0.0f) * Z; + glm::vec4 const Z4 = glm::eulerAngleYX(0.0f, Angle) * Z; + glm::vec4 const Z5 = glm::eulerAngleXZ(Angle, 0.0f) * Z; + glm::vec4 const Z6 = glm::eulerAngleZX(0.0f, Angle) * Z; + glm::vec4 const Z7 = glm::eulerAngleYXZ(0.0f, Angle, 0.0f) * Z; + Error += glm::all(glm::epsilonEqual(Z1, Z2, 0.00001f)) ? 0 : 1; + Error += glm::all(glm::epsilonEqual(Z1, Z3, 0.00001f)) ? 0 : 1; + Error += glm::all(glm::epsilonEqual(Z1, Z4, 0.00001f)) ? 0 : 1; + Error += glm::all(glm::epsilonEqual(Z1, Z5, 0.00001f)) ? 0 : 1; + Error += glm::all(glm::epsilonEqual(Z1, Z6, 0.00001f)) ? 0 : 1; + Error += glm::all(glm::epsilonEqual(Z1, Z7, 0.00001f)) ? 0 : 1; + + return Error; + } +}//namespace test_eulerAngleX + +namespace test_eulerAngleY +{ + int test() + { + int Error = 0; + + float const Angle(glm::pi() * 0.5f); + glm::vec3 const Y(0.0f, 1.0f, 0.0f); + + glm::vec4 const X(1.0f, 0.0f, 0.0f, 1.0f); + glm::vec4 const X1 = glm::rotate(glm::mat4(1.0f), Angle, Y) * X; + glm::vec4 const X2 = glm::eulerAngleY(Angle) * X; + glm::vec4 const X3 = glm::eulerAngleYX(Angle, 0.0f) * X; + glm::vec4 const X4 = glm::eulerAngleXY(0.0f, Angle) * X; + glm::vec4 const X5 = glm::eulerAngleYZ(Angle, 0.0f) * X; + glm::vec4 const X6 = glm::eulerAngleZY(0.0f, Angle) * X; + glm::vec4 const X7 = glm::eulerAngleYXZ(Angle, 0.0f, 0.0f) * X; + Error += glm::all(glm::epsilonEqual(X1, X2, 0.00001f)) ? 0 : 1; + Error += glm::all(glm::epsilonEqual(X1, X3, 0.00001f)) ? 0 : 1; + Error += glm::all(glm::epsilonEqual(X1, X4, 0.00001f)) ? 0 : 1; + Error += glm::all(glm::epsilonEqual(X1, X5, 0.00001f)) ? 0 : 1; + Error += glm::all(glm::epsilonEqual(X1, X6, 0.00001f)) ? 0 : 1; + Error += glm::all(glm::epsilonEqual(X1, X7, 0.00001f)) ? 0 : 1; + + glm::vec4 const Z(0.0f, 0.0f, 1.0f, 1.0f); + glm::vec4 const Z1 = glm::eulerAngleY(Angle) * Z; + glm::vec4 const Z2 = glm::rotate(glm::mat4(1.0f), Angle, Y) * Z; + glm::vec4 const Z3 = glm::eulerAngleYX(Angle, 0.0f) * Z; + glm::vec4 const Z4 = glm::eulerAngleXY(0.0f, Angle) * Z; + glm::vec4 const Z5 = glm::eulerAngleYZ(Angle, 0.0f) * Z; + glm::vec4 const Z6 = glm::eulerAngleZY(0.0f, Angle) * Z; + glm::vec4 const Z7 = glm::eulerAngleYXZ(Angle, 0.0f, 0.0f) * Z; + Error += glm::all(glm::epsilonEqual(Z1, Z2, 0.00001f)) ? 0 : 1; + Error += glm::all(glm::epsilonEqual(Z1, Z3, 0.00001f)) ? 0 : 1; + Error += glm::all(glm::epsilonEqual(Z1, Z4, 0.00001f)) ? 0 : 1; + Error += glm::all(glm::epsilonEqual(Z1, Z5, 0.00001f)) ? 0 : 1; + Error += glm::all(glm::epsilonEqual(Z1, Z6, 0.00001f)) ? 0 : 1; + Error += glm::all(glm::epsilonEqual(Z1, Z7, 0.00001f)) ? 0 : 1; + + return Error; + } +}//namespace test_eulerAngleY + +namespace test_eulerAngleZ +{ + int test() + { + int Error = 0; + + float const Angle(glm::pi() * 0.5f); + glm::vec3 const Z(0.0f, 0.0f, 1.0f); + + glm::vec4 const X(1.0f, 0.0f, 0.0f, 1.0f); + glm::vec4 const X1 = glm::rotate(glm::mat4(1.0f), Angle, Z) * X; + glm::vec4 const X2 = glm::eulerAngleZ(Angle) * X; + glm::vec4 const X3 = glm::eulerAngleZX(Angle, 0.0f) * X; + glm::vec4 const X4 = glm::eulerAngleXZ(0.0f, Angle) * X; + glm::vec4 const X5 = glm::eulerAngleZY(Angle, 0.0f) * X; + glm::vec4 const X6 = glm::eulerAngleYZ(0.0f, Angle) * X; + glm::vec4 const X7 = glm::eulerAngleYXZ(0.0f, 0.0f, Angle) * X; + Error += glm::all(glm::epsilonEqual(X1, X2, 0.00001f)) ? 0 : 1; + Error += glm::all(glm::epsilonEqual(X1, X3, 0.00001f)) ? 0 : 1; + Error += glm::all(glm::epsilonEqual(X1, X4, 0.00001f)) ? 0 : 1; + Error += glm::all(glm::epsilonEqual(X1, X5, 0.00001f)) ? 0 : 1; + Error += glm::all(glm::epsilonEqual(X1, X6, 0.00001f)) ? 0 : 1; + Error += glm::all(glm::epsilonEqual(X1, X7, 0.00001f)) ? 0 : 1; + + glm::vec4 const Y(1.0f, 0.0f, 0.0f, 1.0f); + glm::vec4 const Z1 = glm::rotate(glm::mat4(1.0f), Angle, Z) * Y; + glm::vec4 const Z2 = glm::eulerAngleZ(Angle) * Y; + glm::vec4 const Z3 = glm::eulerAngleZX(Angle, 0.0f) * Y; + glm::vec4 const Z4 = glm::eulerAngleXZ(0.0f, Angle) * Y; + glm::vec4 const Z5 = glm::eulerAngleZY(Angle, 0.0f) * Y; + glm::vec4 const Z6 = glm::eulerAngleYZ(0.0f, Angle) * Y; + glm::vec4 const Z7 = glm::eulerAngleYXZ(0.0f, 0.0f, Angle) * Y; + Error += glm::all(glm::epsilonEqual(Z1, Z2, 0.00001f)) ? 0 : 1; + Error += glm::all(glm::epsilonEqual(Z1, Z3, 0.00001f)) ? 0 : 1; + Error += glm::all(glm::epsilonEqual(Z1, Z4, 0.00001f)) ? 0 : 1; + Error += glm::all(glm::epsilonEqual(Z1, Z5, 0.00001f)) ? 0 : 1; + Error += glm::all(glm::epsilonEqual(Z1, Z6, 0.00001f)) ? 0 : 1; + Error += glm::all(glm::epsilonEqual(Z1, Z7, 0.00001f)) ? 0 : 1; + + return Error; + } +}//namespace test_eulerAngleZ + +namespace test_derivedEulerAngles +{ + bool epsilonEqual(glm::mat4 const& mat1, glm::mat4 const& mat2, glm::mat4::value_type const& epsilon) + { + return glm::all(glm::epsilonEqual(mat1[0], mat2[0], epsilon)) ? + ( + glm::all(glm::epsilonEqual(mat1[1], mat2[1], epsilon)) ? + ( + glm::all(glm::epsilonEqual(mat1[2], mat2[2], epsilon)) ? + ( + glm::all(glm::epsilonEqual(mat1[3], mat2[3], epsilon)) ? true : false + ) : false + ) : false + ) : false; + } + + template + int test(RotationFunc rotationFunc, TestDerivedFunc testDerivedFunc, const glm::vec3& basis) + { + int Error = 0; + + typedef glm::vec3::value_type value; + value const zeroAngle(0.0f); + value const Angle(glm::pi() * 0.75f); + value const negativeAngle(-Angle); + value const zeroAngleVelocity(0.0f); + value const AngleVelocity(glm::pi() * 0.27f); + value const negativeAngleVelocity(-AngleVelocity); + + typedef std::pair AngleAndAngleVelocity; + std::vector testPairs; + testPairs.push_back(AngleAndAngleVelocity(zeroAngle, zeroAngleVelocity)); + testPairs.push_back(AngleAndAngleVelocity(zeroAngle, AngleVelocity)); + testPairs.push_back(AngleAndAngleVelocity(zeroAngle, negativeAngleVelocity)); + testPairs.push_back(AngleAndAngleVelocity(Angle, zeroAngleVelocity)); + testPairs.push_back(AngleAndAngleVelocity(Angle, AngleVelocity)); + testPairs.push_back(AngleAndAngleVelocity(Angle, negativeAngleVelocity)); + testPairs.push_back(AngleAndAngleVelocity(negativeAngle, zeroAngleVelocity)); + testPairs.push_back(AngleAndAngleVelocity(negativeAngle, AngleVelocity)); + testPairs.push_back(AngleAndAngleVelocity(negativeAngle, negativeAngleVelocity)); + + for (size_t i = 0, size = testPairs.size(); i < size; ++i) + { + AngleAndAngleVelocity const& pair = testPairs.at(i); + + glm::mat4 const W = glm::matrixCross4(basis * pair.second); + glm::mat4 const rotMt = glm::transpose(rotationFunc(pair.first)); + glm::mat4 const derivedRotM = testDerivedFunc(pair.first, pair.second); + + Error += epsilonEqual(W, derivedRotM * rotMt, 0.00001f) ? 0 : 1; + } + + return Error; + } +}//namespace test_derivedEulerAngles + +namespace test_eulerAngleXY +{ + int test() + { + int Error = 0; + + glm::vec4 const V(1.0f); + + float const AngleX(glm::pi() * 0.5f); + float const AngleY(glm::pi() * 0.25f); + + glm::vec3 const axisX(1.0f, 0.0f, 0.0f); + glm::vec3 const axisY(0.0f, 1.0f, 0.0f); + + glm::vec4 const V1 = (glm::rotate(glm::mat4(1.0f), AngleX, axisX) * glm::rotate(glm::mat4(1.0f), AngleY, axisY)) * V; + glm::vec4 const V2 = glm::eulerAngleXY(AngleX, AngleY) * V; + glm::vec4 const V3 = glm::eulerAngleX(AngleX) * glm::eulerAngleY(AngleY) * V; + Error += glm::all(glm::epsilonEqual(V1, V2, 0.00001f)) ? 0 : 1; + Error += glm::all(glm::epsilonEqual(V1, V3, 0.00001f)) ? 0 : 1; + + return Error; + } +}//namespace test_eulerAngleXY + +namespace test_eulerAngleYX +{ + int test() + { + int Error = 0; + + glm::vec4 const V(1.0f); + + float const AngleX(glm::pi() * 0.5f); + float const AngleY(glm::pi() * 0.25f); + + glm::vec3 const axisX(1.0f, 0.0f, 0.0f); + glm::vec3 const axisY(0.0f, 1.0f, 0.0f); + + glm::vec4 const V1 = (glm::rotate(glm::mat4(1.0f), AngleY, axisY) * glm::rotate(glm::mat4(1.0f), AngleX, axisX)) * V; + glm::vec4 const V2 = glm::eulerAngleYX(AngleY, AngleX) * V; + glm::vec4 const V3 = glm::eulerAngleY(AngleY) * glm::eulerAngleX(AngleX) * V; + Error += glm::all(glm::epsilonEqual(V1, V2, 0.00001f)) ? 0 : 1; + Error += glm::all(glm::epsilonEqual(V1, V3, 0.00001f)) ? 0 : 1; + + return Error; + } +}//namespace test_eulerAngleYX + +namespace test_eulerAngleXZ +{ + int test() + { + int Error = 0; + + glm::vec4 const V(1.0f); + + float const AngleX(glm::pi() * 0.5f); + float const AngleZ(glm::pi() * 0.25f); + + glm::vec3 const axisX(1.0f, 0.0f, 0.0f); + glm::vec3 const axisZ(0.0f, 0.0f, 1.0f); + + glm::vec4 const V1 = (glm::rotate(glm::mat4(1.0f), AngleX, axisX) * glm::rotate(glm::mat4(1.0f), AngleZ, axisZ)) * V; + glm::vec4 const V2 = glm::eulerAngleXZ(AngleX, AngleZ) * V; + glm::vec4 const V3 = glm::eulerAngleX(AngleX) * glm::eulerAngleZ(AngleZ) * V; + Error += glm::all(glm::epsilonEqual(V1, V2, 0.00001f)) ? 0 : 1; + Error += glm::all(glm::epsilonEqual(V1, V3, 0.00001f)) ? 0 : 1; + + return Error; + } +}//namespace test_eulerAngleXZ + +namespace test_eulerAngleZX +{ + int test() + { + int Error = 0; + + glm::vec4 const V(1.0f); + + float const AngleX(glm::pi() * 0.5f); + float const AngleZ(glm::pi() * 0.25f); + + glm::vec3 const axisX(1.0f, 0.0f, 0.0f); + glm::vec3 const axisZ(0.0f, 0.0f, 1.0f); + + glm::vec4 const V1 = (glm::rotate(glm::mat4(1.0f), AngleZ, axisZ) * glm::rotate(glm::mat4(1.0f), AngleX, axisX)) * V; + glm::vec4 const V2 = glm::eulerAngleZX(AngleZ, AngleX) * V; + glm::vec4 const V3 = glm::eulerAngleZ(AngleZ) * glm::eulerAngleX(AngleX) * V; + Error += glm::all(glm::epsilonEqual(V1, V2, 0.00001f)) ? 0 : 1; + Error += glm::all(glm::epsilonEqual(V1, V3, 0.00001f)) ? 0 : 1; + + return Error; + } +}//namespace test_eulerAngleZX + +namespace test_eulerAngleYZ +{ + int test() + { + int Error = 0; + + glm::vec4 const V(1.0f); + + float const AngleY(glm::pi() * 0.5f); + float const AngleZ(glm::pi() * 0.25f); + + glm::vec3 const axisX(1.0f, 0.0f, 0.0f); + glm::vec3 const axisY(0.0f, 1.0f, 0.0f); + glm::vec3 const axisZ(0.0f, 0.0f, 1.0f); + + glm::vec4 const V1 = (glm::rotate(glm::mat4(1.0f), AngleY, axisY) * glm::rotate(glm::mat4(1.0f), AngleZ, axisZ)) * V; + glm::vec4 const V2 = glm::eulerAngleYZ(AngleY, AngleZ) * V; + glm::vec4 const V3 = glm::eulerAngleY(AngleY) * glm::eulerAngleZ(AngleZ) * V; + Error += glm::all(glm::epsilonEqual(V1, V2, 0.00001f)) ? 0 : 1; + Error += glm::all(glm::epsilonEqual(V1, V3, 0.00001f)) ? 0 : 1; + + return Error; + } +}//namespace test_eulerAngleYZ + +namespace test_eulerAngleZY +{ + int test() + { + int Error = 0; + + glm::vec4 const V(1.0f); + + float const AngleY(glm::pi() * 0.5f); + float const AngleZ(glm::pi() * 0.25f); + + glm::vec3 const axisX(1.0f, 0.0f, 0.0f); + glm::vec3 const axisY(0.0f, 1.0f, 0.0f); + glm::vec3 const axisZ(0.0f, 0.0f, 1.0f); + + glm::vec4 const V1 = (glm::rotate(glm::mat4(1.0f), AngleZ, axisZ) * glm::rotate(glm::mat4(1.0f), AngleY, axisY)) * V; + glm::vec4 const V2 = glm::eulerAngleZY(AngleZ, AngleY) * V; + glm::vec4 const V3 = glm::eulerAngleZ(AngleZ) * glm::eulerAngleY(AngleY) * V; + Error += glm::all(glm::epsilonEqual(V1, V2, 0.00001f)) ? 0 : 1; + Error += glm::all(glm::epsilonEqual(V1, V3, 0.00001f)) ? 0 : 1; + + return Error; + } +}//namespace test_eulerAngleZY + +namespace test_eulerAngleYXZ +{ + int test() + { + glm::f32 first = 1.046f; + glm::f32 second = 0.52f; + glm::f32 third = -0.785f; + + glm::fmat4 rotationEuler = glm::eulerAngleYXZ(first, second, third); + + glm::fmat4 rotationInvertedY = glm::eulerAngleY(-1.f*first) * glm::eulerAngleX(second) * glm::eulerAngleZ(third); + glm::fmat4 rotationDumb = glm::fmat4(); + rotationDumb = glm::rotate(rotationDumb, first, glm::fvec3(0,1,0)); + rotationDumb = glm::rotate(rotationDumb, second, glm::fvec3(1,0,0)); + rotationDumb = glm::rotate(rotationDumb, third, glm::fvec3(0,0,1)); + + std::printf("%s\n", glm::to_string(glm::fmat3(rotationEuler)).c_str()); + std::printf("%s\n", glm::to_string(glm::fmat3(rotationDumb)).c_str()); + std::printf("%s\n", glm::to_string(glm::fmat3(rotationInvertedY)).c_str()); + + std::printf("\nRESIDUAL\n"); + std::printf("%s\n", glm::to_string(glm::fmat3(rotationEuler-(rotationDumb))).c_str()); + std::printf("%s\n", glm::to_string(glm::fmat3(rotationEuler-(rotationInvertedY))).c_str()); + + return 0; + } +}//namespace eulerAngleYXZ + +namespace test_eulerAngles +{ + template + int test(TestRotationFunc testRotationFunc, glm::vec3 const& I, glm::vec3 const& J, glm::vec3 const& K) + { + int Error = 0; + + typedef glm::mat4::value_type value; + value const minAngle(-glm::pi()); + value const maxAngle(glm::pi()); + value const maxAngleWithDelta(maxAngle - 0.0000001f); + value const minMidAngle(-glm::pi() * 0.5f); + value const maxMidAngle(glm::pi() * 0.5f); + + std::vector testEulerAngles; + testEulerAngles.push_back(glm::vec3(1.046f, 0.52f, -0.785f)); + testEulerAngles.push_back(glm::vec3(minAngle, minMidAngle, minAngle)); + testEulerAngles.push_back(glm::vec3(minAngle, minMidAngle, maxAngle)); + testEulerAngles.push_back(glm::vec3(minAngle, minMidAngle, maxAngleWithDelta)); + testEulerAngles.push_back(glm::vec3(minAngle, maxMidAngle, minAngle)); + testEulerAngles.push_back(glm::vec3(minAngle, maxMidAngle, maxAngle)); + testEulerAngles.push_back(glm::vec3(minAngle, maxMidAngle, maxAngleWithDelta)); + testEulerAngles.push_back(glm::vec3(maxAngle, minMidAngle, minAngle)); + testEulerAngles.push_back(glm::vec3(maxAngle, minMidAngle, maxAngle)); + testEulerAngles.push_back(glm::vec3(maxAngle, minMidAngle, maxAngleWithDelta)); + testEulerAngles.push_back(glm::vec3(maxAngleWithDelta, minMidAngle, maxAngle)); + testEulerAngles.push_back(glm::vec3(maxAngleWithDelta, minMidAngle, maxAngleWithDelta)); + testEulerAngles.push_back(glm::vec3(maxAngle, maxMidAngle, minAngle)); + testEulerAngles.push_back(glm::vec3(maxAngleWithDelta, maxMidAngle, minAngle)); + testEulerAngles.push_back(glm::vec3(maxAngle, maxMidAngle, maxAngle)); + testEulerAngles.push_back(glm::vec3(maxAngle, maxMidAngle, maxAngleWithDelta)); + testEulerAngles.push_back(glm::vec3(maxAngleWithDelta, maxMidAngle, maxAngle)); + testEulerAngles.push_back(glm::vec3(maxAngleWithDelta, maxMidAngle, maxAngleWithDelta)); + testEulerAngles.push_back(glm::vec3(minAngle, 0.0f, minAngle)); + testEulerAngles.push_back(glm::vec3(minAngle, 0.0f, maxAngle)); + testEulerAngles.push_back(glm::vec3(maxAngle, maxAngle, minAngle)); + testEulerAngles.push_back(glm::vec3(maxAngle, maxAngle, maxAngle)); + + for (size_t i = 0, size = testEulerAngles.size(); i < size; ++i) + { + glm::vec3 const& angles = testEulerAngles.at(i); + glm::mat4 const rotationEuler = testRotationFunc(angles.x, angles.y, angles.z); + + glm::mat4 rotationDumb = glm::diagonal4x4(glm::mat4::col_type(1.0f)); + rotationDumb = glm::rotate(rotationDumb, angles.x, I); + rotationDumb = glm::rotate(rotationDumb, angles.y, J); + rotationDumb = glm::rotate(rotationDumb, angles.z, K); + + glm::vec4 const V(1.0f,1.0f,1.0f,1.0f); + glm::vec4 const V1 = rotationEuler * V; + glm::vec4 const V2 = rotationDumb * V; + + Error += glm::all(glm::epsilonEqual(V1, V2, 0.00001f)) ? 0 : 1; + } + + return Error; + } +}//namespace test_extractsEulerAngles + +namespace test_extractsEulerAngles +{ + template + int test(RotationFunc rotationFunc, TestExtractionFunc testExtractionFunc) + { + int Error = 0; + + typedef glm::mat4::value_type value; + value const minAngle(-glm::pi()); + value const maxAngle(glm::pi()); + value const maxAngleWithDelta(maxAngle - 0.0000001f); + value const minMidAngle(-glm::pi() * 0.5f); + value const maxMidAngle(glm::pi() * 0.5f); + + std::vector testEulerAngles; + testEulerAngles.push_back(glm::vec3(1.046f, 0.52f, -0.785f)); + testEulerAngles.push_back(glm::vec3(minAngle, minMidAngle, minAngle)); + testEulerAngles.push_back(glm::vec3(minAngle, minMidAngle, maxAngle)); + testEulerAngles.push_back(glm::vec3(minAngle, minMidAngle, maxAngleWithDelta)); + testEulerAngles.push_back(glm::vec3(minAngle, maxMidAngle, minAngle)); + testEulerAngles.push_back(glm::vec3(minAngle, maxMidAngle, maxAngle)); + testEulerAngles.push_back(glm::vec3(minAngle, maxMidAngle, maxAngleWithDelta)); + testEulerAngles.push_back(glm::vec3(maxAngle, minMidAngle, minAngle)); + testEulerAngles.push_back(glm::vec3(maxAngle, minMidAngle, maxAngle)); + testEulerAngles.push_back(glm::vec3(maxAngle, minMidAngle, maxAngleWithDelta)); + testEulerAngles.push_back(glm::vec3(maxAngleWithDelta, minMidAngle, maxAngle)); + testEulerAngles.push_back(glm::vec3(maxAngleWithDelta, minMidAngle, maxAngleWithDelta)); + testEulerAngles.push_back(glm::vec3(maxAngle, maxMidAngle, minAngle)); + testEulerAngles.push_back(glm::vec3(maxAngleWithDelta, maxMidAngle, minAngle)); + testEulerAngles.push_back(glm::vec3(maxAngle, maxMidAngle, maxAngle)); + testEulerAngles.push_back(glm::vec3(maxAngle, maxMidAngle, maxAngleWithDelta)); + testEulerAngles.push_back(glm::vec3(maxAngleWithDelta, maxMidAngle, maxAngle)); + testEulerAngles.push_back(glm::vec3(maxAngleWithDelta, maxMidAngle, maxAngleWithDelta)); + testEulerAngles.push_back(glm::vec3(minAngle, 0.0f, minAngle)); + testEulerAngles.push_back(glm::vec3(minAngle, 0.0f, maxAngle)); + testEulerAngles.push_back(glm::vec3(maxAngle, maxAngle, minAngle)); + testEulerAngles.push_back(glm::vec3(maxAngle, maxAngle, maxAngle)); + + for (size_t i = 0, size = testEulerAngles.size(); i < size; ++i) + { + glm::vec3 const& angles = testEulerAngles.at(i); + glm::mat4 const rotation = rotationFunc(angles.x, angles.y, angles.z); + + glm::vec3 extractedEulerAngles(0.0f); + testExtractionFunc(rotation, extractedEulerAngles.x, extractedEulerAngles.y, extractedEulerAngles.z); + glm::mat4 const extractedRotation = rotationFunc(extractedEulerAngles.x, extractedEulerAngles.y, extractedEulerAngles.z); + + glm::vec4 const V(1.0f,1.0f,1.0f,1.0f); + glm::vec4 const V1 = rotation * V; + glm::vec4 const V2 = extractedRotation * V; + + Error += glm::all(glm::epsilonEqual(V1, V2, 0.00001f)) ? 0 : 1; + } + + return Error; + } +}//namespace test_extractsEulerAngles + +int main() +{ + int Error = 0; + + typedef glm::mat4::value_type value; + glm::vec3 const X(1.0f, 0.0f, 0.0f); + glm::vec3 const Y(0.0f, 1.0f, 0.0f); + glm::vec3 const Z(0.0f, 0.0f, 1.0f); + + Error += test_eulerAngleX::test(); + Error += test_eulerAngleY::test(); + Error += test_eulerAngleZ::test(); + + Error += test_derivedEulerAngles::test(glm::eulerAngleX, glm::derivedEulerAngleX, X); + Error += test_derivedEulerAngles::test(glm::eulerAngleY, glm::derivedEulerAngleY, Y); + Error += test_derivedEulerAngles::test(glm::eulerAngleZ, glm::derivedEulerAngleZ, Z); + + Error += test_eulerAngleXY::test(); + Error += test_eulerAngleYX::test(); + Error += test_eulerAngleXZ::test(); + Error += test_eulerAngleZX::test(); + Error += test_eulerAngleYZ::test(); + Error += test_eulerAngleZY::test(); + Error += test_eulerAngleYXZ::test(); + + Error += test_eulerAngles::test(glm::eulerAngleXZX, X, Z, X); + Error += test_eulerAngles::test(glm::eulerAngleXYX, X, Y, X); + Error += test_eulerAngles::test(glm::eulerAngleYXY, Y, X, Y); + Error += test_eulerAngles::test(glm::eulerAngleYZY, Y, Z, Y); + Error += test_eulerAngles::test(glm::eulerAngleZYZ, Z, Y, Z); + Error += test_eulerAngles::test(glm::eulerAngleZXZ, Z, X, Z); + Error += test_eulerAngles::test(glm::eulerAngleXZY, X, Z, Y); + Error += test_eulerAngles::test(glm::eulerAngleYZX, Y, Z, X); + Error += test_eulerAngles::test(glm::eulerAngleZYX, Z, Y, X); + Error += test_eulerAngles::test(glm::eulerAngleZXY, Z, X, Y); + + Error += test_extractsEulerAngles::test(glm::eulerAngleYXZ, glm::extractEulerAngleYXZ); + Error += test_extractsEulerAngles::test(glm::eulerAngleXZX, glm::extractEulerAngleXZX); + Error += test_extractsEulerAngles::test(glm::eulerAngleXYX, glm::extractEulerAngleXYX); + Error += test_extractsEulerAngles::test(glm::eulerAngleYXY, glm::extractEulerAngleYXY); + Error += test_extractsEulerAngles::test(glm::eulerAngleYZY, glm::extractEulerAngleYZY); + Error += test_extractsEulerAngles::test(glm::eulerAngleZYZ, glm::extractEulerAngleZYZ); + Error += test_extractsEulerAngles::test(glm::eulerAngleZXZ, glm::extractEulerAngleZXZ); + Error += test_extractsEulerAngles::test(glm::eulerAngleXZY, glm::extractEulerAngleXZY); + Error += test_extractsEulerAngles::test(glm::eulerAngleYZX, glm::extractEulerAngleYZX); + Error += test_extractsEulerAngles::test(glm::eulerAngleZYX, glm::extractEulerAngleZYX); + Error += test_extractsEulerAngles::test(glm::eulerAngleZXY, glm::extractEulerAngleZXY); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_extend.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_extend.cpp new file mode 100644 index 0000000000000000000000000000000000000000..91c392fadc74171495aea6c234188d389defafd8 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_extend.cpp @@ -0,0 +1,9 @@ +#define GLM_ENABLE_EXPERIMENTAL +#include + +int main() +{ + int Error(0); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_extended_min_max.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_extended_min_max.cpp new file mode 100644 index 0000000000000000000000000000000000000000..d068fc46185b2839f422717947295b3cda3417e0 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_extended_min_max.cpp @@ -0,0 +1,101 @@ +#define GLM_ENABLE_EXPERIMENTAL + +#include +#include +#include +#include +#include + +// This file has divisions by zero to test isnan +#if GLM_COMPILER & GLM_COMPILER_VC +# pragma warning(disable : 4723) +#endif + +namespace fmin_ +{ + static int test() + { + int Error = 0; + + float Zero_f = 0.0f; + glm::vec1 A0 = glm::fmin(glm::vec1(1), glm::vec1(Zero_f / 0.0f)); + Error += glm::equal(A0.x, 1.0f, glm::epsilon()) ? 0 : 1; + + glm::vec1 A1 = glm::fmin(glm::vec1(Zero_f / 0.0f), glm::vec1(1)); + Error += glm::equal(A1.x, 1.0f, glm::epsilon()) ? 0 : 1; + + glm::vec2 B0 = glm::fmin(glm::vec2(1), glm::vec2(1)); + glm::vec2 B1 = glm::fmin(glm::vec2(1), 1.0f); + bool B2 = glm::all(glm::equal(B0, B1, glm::epsilon())); + Error += B2 ? 0 : 1; + + glm::vec3 C0 = glm::fmin(glm::vec3(1), glm::vec3(1)); + glm::vec3 C1 = glm::fmin(glm::vec3(1), 1.0f); + bool C2 = glm::all(glm::equal(C0, C1, glm::epsilon())); + Error += C2 ? 0 : 1; + + glm::vec4 D0 = glm::fmin(glm::vec4(1), glm::vec4(1)); + glm::vec4 D1 = glm::fmin(glm::vec4(1), 1.0f); + bool D2 = glm::all(glm::equal(D0, D1, glm::epsilon())); + Error += D2 ? 0 : 1; + + return Error; + } +}//namespace fmin_ + +namespace fmax_ +{ + static int test() + { + int Error = 0; + + float Zero_f = 0.0f; + glm::vec1 A0 = glm::fmax(glm::vec1(1), glm::vec1(Zero_f / 0.0f)); + Error += glm::equal(A0.x, 1.0f, glm::epsilon()) ? 0 : 1; + + glm::vec1 A1 = glm::fmax(glm::vec1(Zero_f / 0.0f), glm::vec1(1)); + Error += glm::equal(A0.x, 1.0f, glm::epsilon()) ? 0 : 1; + + glm::vec2 B0 = glm::fmax(glm::vec2(1), glm::vec2(1)); + glm::vec2 B1 = glm::fmax(glm::vec2(1), 1.0f); + bool B2 = glm::all(glm::equal(B0, B1, glm::epsilon())); + Error += B2 ? 0 : 1; + + glm::vec3 C0 = glm::fmax(glm::vec3(1), glm::vec3(1)); + glm::vec3 C1 = glm::fmax(glm::vec3(1), 1.0f); + bool C2 = glm::all(glm::equal(C0, C1, glm::epsilon())); + Error += C2 ? 0 : 1; + + glm::vec4 D0 = glm::fmax(glm::vec4(1), glm::vec4(1)); + glm::vec4 D1 = glm::fmax(glm::vec4(1), 1.0f); + bool D2 = glm::all(glm::equal(D0, D1, glm::epsilon())); + Error += D2 ? 0 : 1; + + return Error; + } +}//namespace fmax_ + +namespace fclamp_ +{ + static int test() + { + int Error = 0; + + float Zero_f = 0.0f; + glm::vec1 A0 = glm::fclamp(glm::vec1(1), glm::vec1(Zero_f / 0.0f), glm::vec1(2.0f)); + Error += glm::equal(A0.x, 1.0f, glm::epsilon()) ? 0 : 1; + + return Error; + } +}//namespace fclamp_ + +int main() +{ + int Error = 0; + + Error += fmin_::test(); + Error += fmax_::test(); + Error += fclamp_::test(); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_extented_min_max.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_extented_min_max.cpp new file mode 100644 index 0000000000000000000000000000000000000000..9d59a16dd5b6f8bfa189912df5821632aeb0605e --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_extented_min_max.cpp @@ -0,0 +1,39 @@ +/////////////////////////////////////////////////////////////////////////////////// +/// OpenGL Mathematics (glm.g-truc.net) +/// +/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) +/// Permission is hereby granted, free of charge, to any person obtaining a copy +/// of this software and associated documentation files (the "Software"), to deal +/// in the Software without restriction, including without limitation the rights +/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +/// copies of the Software, and to permit persons to whom the Software is +/// furnished to do so, subject to the following conditions: +/// +/// The above copyright notice and this permission notice shall be included in +/// all copies or substantial portions of the Software. +/// +/// Restrictions: +/// By making use of the Software for military purposes, you choose to make +/// a Bunny unhappy. +/// +/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +/// THE SOFTWARE. +/// +/// @file test/gtx/gtx_extented_min_max.cpp +/// @date 2013-10-25 / 2014-11-25 +/// @author Christophe Riccio +/////////////////////////////////////////////////////////////////////////////////// + +#include + +int main() +{ + int Error(0); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_exterior_product.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_exterior_product.cpp new file mode 100644 index 0000000000000000000000000000000000000000..fbdb717f6e77a915d9ba64dd7a68119b03b63cbb --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_exterior_product.cpp @@ -0,0 +1,14 @@ +#include +#include +#include + +int main() +{ + int Error = 0; + + float const f = glm::cross(glm::vec2(1.0f, 1.0f), glm::vec2(1.0f, 1.0f)); + Error += glm::epsilonEqual(f, 0.0f, 0.001f) ? 0 : 1; + + return Error; +} + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_fast_exponential.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_fast_exponential.cpp new file mode 100644 index 0000000000000000000000000000000000000000..48285d7ab5a93497b0cb7cfbfa155e891e920a2b --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_fast_exponential.cpp @@ -0,0 +1,9 @@ +#define GLM_ENABLE_EXPERIMENTAL +#include + +int main() +{ + int Error(0); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_fast_square_root.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_fast_square_root.cpp new file mode 100644 index 0000000000000000000000000000000000000000..023a13fa37ff1c27152dae98c5522d300462d5cf --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_fast_square_root.cpp @@ -0,0 +1,45 @@ +#define GLM_ENABLE_EXPERIMENTAL +#include +#include +#include +#include + +int test_fastInverseSqrt() +{ + int Error = 0; + + Error += glm::epsilonEqual(glm::fastInverseSqrt(1.0f), 1.0f, 0.01f) ? 0 : 1; + Error += glm::epsilonEqual(glm::fastInverseSqrt(1.0), 1.0, 0.01) ? 0 : 1; + Error += glm::all(glm::epsilonEqual(glm::fastInverseSqrt(glm::vec2(1.0f)), glm::vec2(1.0f), 0.01f)) ? 0 : 1; + Error += glm::all(glm::epsilonEqual(glm::fastInverseSqrt(glm::dvec3(1.0)), glm::dvec3(1.0), 0.01)) ? 0 : 1; + Error += glm::all(glm::epsilonEqual(glm::fastInverseSqrt(glm::dvec4(1.0)), glm::dvec4(1.0), 0.01)) ? 0 : 1; + + return Error; +} + +int test_fastDistance() +{ + int Error = 0; + + float const A = glm::fastDistance(0.0f, 1.0f); + float const B = glm::fastDistance(glm::vec2(0.0f), glm::vec2(1.0f, 0.0f)); + float const C = glm::fastDistance(glm::vec3(0.0f), glm::vec3(1.0f, 0.0f, 0.0f)); + float const D = glm::fastDistance(glm::vec4(0.0f), glm::vec4(1.0f, 0.0f, 0.0f, 0.0f)); + + Error += glm::epsilonEqual(A, 1.0f, 0.01f) ? 0 : 1; + Error += glm::epsilonEqual(B, 1.0f, 0.01f) ? 0 : 1; + Error += glm::epsilonEqual(C, 1.0f, 0.01f) ? 0 : 1; + Error += glm::epsilonEqual(D, 1.0f, 0.01f) ? 0 : 1; + + return Error; +} + +int main() +{ + int Error = 0; + + Error += test_fastInverseSqrt(); + Error += test_fastDistance(); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_fast_trigonometry.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_fast_trigonometry.cpp new file mode 100644 index 0000000000000000000000000000000000000000..0e7a349efd5311b45b75104602ba1df6bad88141 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_fast_trigonometry.cpp @@ -0,0 +1,564 @@ +#include + +#define GLM_ENABLE_EXPERIMENTAL +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace fastCos +{ + int perf(bool NextFloat) + { + const float begin = -glm::pi(); + const float end = glm::pi(); + float result = 0.f; + + const std::clock_t timestamp1 = std::clock(); + for(float i = begin; i < end; i = NextFloat ? glm::nextFloat(i) : i += 0.1f) + result = glm::fastCos(i); + + const std::clock_t timestamp2 = std::clock(); + for(float i = begin; i < end; i = NextFloat ? glm::nextFloat(i) : i += 0.1f) + result = glm::cos(i); + + const std::clock_t timestamp3 = std::clock(); + const std::clock_t time_fast = timestamp2 - timestamp1; + const std::clock_t time_default = timestamp3 - timestamp2; + std::printf("fastCos Time %d clocks\n", static_cast(time_fast)); + std::printf("cos Time %d clocks\n", static_cast(time_default)); + + return time_fast <= time_default ? 0 : 1; + } +}//namespace fastCos + +namespace fastSin +{ + /* + float sin(float x) { + float temp; + temp = (x + M_PI) / ((2 * M_PI) - M_PI); + return limited_sin((x + M_PI) - ((2 * M_PI) - M_PI) * temp)); + } + */ + + int perf(bool NextFloat) + { + const float begin = -glm::pi(); + const float end = glm::pi(); + float result = 0.f; + + const std::clock_t timestamp1 = std::clock(); + for(float i = begin; i < end; i = NextFloat ? glm::nextFloat(i) : i += 0.1f) + result = glm::fastSin(i); + + const std::clock_t timestamp2 = std::clock(); + for(float i = begin; i < end; i = NextFloat ? glm::nextFloat(i) : i += 0.1f) + result = glm::sin(i); + + const std::clock_t timestamp3 = std::clock(); + const std::clock_t time_fast = timestamp2 - timestamp1; + const std::clock_t time_default = timestamp3 - timestamp2; + std::printf("fastSin Time %d clocks\n", static_cast(time_fast)); + std::printf("sin Time %d clocks\n", static_cast(time_default)); + + return time_fast <= time_default ? 0 : 1; + } +}//namespace fastSin + +namespace fastTan +{ + int perf(bool NextFloat) + { + const float begin = -glm::pi(); + const float end = glm::pi(); + float result = 0.f; + + const std::clock_t timestamp1 = std::clock(); + for(float i = begin; i < end; i = NextFloat ? glm::nextFloat(i) : i += 0.1f) + result = glm::fastTan(i); + + const std::clock_t timestamp2 = std::clock(); + for (float i = begin; i < end; i = NextFloat ? glm::nextFloat(i) : i += 0.1f) + result = glm::tan(i); + + const std::clock_t timestamp3 = std::clock(); + const std::clock_t time_fast = timestamp2 - timestamp1; + const std::clock_t time_default = timestamp3 - timestamp2; + std::printf("fastTan Time %d clocks\n", static_cast(time_fast)); + std::printf("tan Time %d clocks\n", static_cast(time_default)); + + return time_fast <= time_default ? 0 : 1; + } +}//namespace fastTan + +namespace fastAcos +{ + int perf(bool NextFloat) + { + const float begin = -glm::pi(); + const float end = glm::pi(); + float result = 0.f; + + const std::clock_t timestamp1 = std::clock(); + for(float i = begin; i < end; i = NextFloat ? glm::nextFloat(i) : i += 0.1f) + result = glm::fastAcos(i); + + const std::clock_t timestamp2 = std::clock(); + for(float i = begin; i < end; i = NextFloat ? glm::nextFloat(i) : i += 0.1f) + result = glm::acos(i); + + const std::clock_t timestamp3 = std::clock(); + const std::clock_t time_fast = timestamp2 - timestamp1; + const std::clock_t time_default = timestamp3 - timestamp2; + + std::printf("fastAcos Time %d clocks\n", static_cast(time_fast)); + std::printf("acos Time %d clocks\n", static_cast(time_default)); + + return time_fast <= time_default ? 0 : 1; + } +}//namespace fastAcos + +namespace fastAsin +{ + int perf(bool NextFloat) + { + const float begin = -glm::pi(); + const float end = glm::pi(); + float result = 0.f; + const std::clock_t timestamp1 = std::clock(); + for(float i = begin; i < end; i = NextFloat ? glm::nextFloat(i) : i += 0.1f) + result = glm::fastAsin(i); + const std::clock_t timestamp2 = std::clock(); + for(float i = begin; i < end; i = NextFloat ? glm::nextFloat(i) : i += 0.1f) + result = glm::asin(i); + const std::clock_t timestamp3 = std::clock(); + const std::clock_t time_fast = timestamp2 - timestamp1; + const std::clock_t time_default = timestamp3 - timestamp2; + std::printf("fastAsin Time %d clocks\n", static_cast(time_fast)); + std::printf("asin Time %d clocks\n", static_cast(time_default)); + + return time_fast <= time_default ? 0 : 1; + } +}//namespace fastAsin + +namespace fastAtan +{ + int perf(bool NextFloat) + { + const float begin = -glm::pi(); + const float end = glm::pi(); + float result = 0.f; + const std::clock_t timestamp1 = std::clock(); + for(float i = begin; i < end; i = NextFloat ? glm::nextFloat(i) : i += 0.1f) + result = glm::fastAtan(i); + const std::clock_t timestamp2 = std::clock(); + for(float i = begin; i < end; i = NextFloat ? glm::nextFloat(i) : i += 0.1f) + result = glm::atan(i); + const std::clock_t timestamp3 = std::clock(); + const std::clock_t time_fast = timestamp2 - timestamp1; + const std::clock_t time_default = timestamp3 - timestamp2; + std::printf("fastAtan Time %d clocks\n", static_cast(time_fast)); + std::printf("atan Time %d clocks\n", static_cast(time_default)); + + return time_fast <= time_default ? 0 : 1; + } +}//namespace fastAtan + +namespace taylorCos +{ + using glm::qualifier; + using glm::length_t; + + glm::vec4 const AngleShift(0.0f, glm::half_pi(), glm::pi(), glm::three_over_two_pi()); + + template + GLM_FUNC_QUALIFIER glm::vec taylorSeriesNewCos(glm::vec const& x) + { + glm::vec const Powed2(x * x); + glm::vec const Powed4(Powed2 * Powed2); + glm::vec const Powed6(Powed4 * Powed2); + glm::vec const Powed8(Powed4 * Powed4); + + return static_cast(1) + - Powed2 * static_cast(0.5) + + Powed4 * static_cast(0.04166666666666666666666666666667) + - Powed6 * static_cast(0.00138888888888888888888888888889) + + Powed8 * static_cast(2.4801587301587301587301587301587e-5); + } + + template + GLM_FUNC_QUALIFIER glm::vec taylorSeriesNewCos6(glm::vec const& x) + { + glm::vec const Powed2(x * x); + glm::vec const Powed4(Powed2 * Powed2); + glm::vec const Powed6(Powed4 * Powed2); + + return static_cast(1) + - Powed2 * static_cast(0.5) + + Powed4 * static_cast(0.04166666666666666666666666666667) + - Powed6 * static_cast(0.00138888888888888888888888888889); + } + + template + GLM_FUNC_QUALIFIER glm::vec fastAbs(glm::vec x) + { + int* Pointer = reinterpret_cast(&x[0]); + Pointer[0] &= 0x7fffffff; + Pointer[1] &= 0x7fffffff; + Pointer[2] &= 0x7fffffff; + Pointer[3] &= 0x7fffffff; + return x; + } + + template + GLM_FUNC_QUALIFIER glm::vec fastCosNew(glm::vec const& x) + { + glm::vec const Angle0_PI(fastAbs(fmod(x + glm::pi(), glm::two_pi()) - glm::pi())); + return taylorSeriesNewCos6(x); +/* + vec const FirstQuarterPi(lessThanEqual(Angle0_PI, vec(glm::half_pi()))); + + vec const RevertAngle(mix(vec(glm::pi()), vec(0), FirstQuarterPi)); + vec const ReturnSign(mix(vec(-1), vec(1), FirstQuarterPi)); + vec const SectionAngle(RevertAngle - Angle0_PI); + + return ReturnSign * taylorSeriesNewCos(SectionAngle); +*/ + } + + int perf_fastCosNew(float Begin, float End, std::size_t Samples) + { + std::vector Results; + Results.resize(Samples); + + float const Steps = (End - Begin) / static_cast(Samples); + + std::clock_t const TimeStampBegin = std::clock(); + + for(std::size_t i = 0; i < Samples; ++i) + Results[i] = fastCosNew(AngleShift + glm::vec4(Begin + Steps * static_cast(i))); + + std::clock_t const TimeStampEnd = std::clock(); + + std::printf("fastCosNew %d clocks\n", static_cast(TimeStampEnd - TimeStampBegin)); + + int Error = 0; + for(std::size_t i = 0; i < Samples; ++i) + Error += Results[i].x >= -1.0f && Results[i].x <= 1.0f ? 0 : 1; + return Error; + } + + template + GLM_FUNC_QUALIFIER glm::vec deterministic_fmod(glm::vec const& x, T y) + { + return x - y * trunc(x / y); + } + + template + GLM_FUNC_QUALIFIER glm::vec fastCosDeterminisctic(glm::vec const& x) + { + glm::vec const Angle0_PI(abs(deterministic_fmod(x + glm::pi(), glm::two_pi()) - glm::pi())); + glm::vec const FirstQuarterPi(lessThanEqual(Angle0_PI, glm::vec(glm::half_pi()))); + + glm::vec const RevertAngle(mix(glm::vec(glm::pi()), glm::vec(0), FirstQuarterPi)); + glm::vec const ReturnSign(mix(glm::vec(-1), glm::vec(1), FirstQuarterPi)); + glm::vec const SectionAngle(RevertAngle - Angle0_PI); + + return ReturnSign * taylorSeriesNewCos(SectionAngle); + } + + int perf_fastCosDeterminisctic(float Begin, float End, std::size_t Samples) + { + std::vector Results; + Results.resize(Samples); + + float const Steps = (End - Begin) / static_cast(Samples); + + std::clock_t const TimeStampBegin = std::clock(); + + for(std::size_t i = 0; i < Samples; ++i) + Results[i] = taylorCos::fastCosDeterminisctic(AngleShift + glm::vec4(Begin + Steps * static_cast(i))); + + std::clock_t const TimeStampEnd = std::clock(); + + std::printf("fastCosDeterminisctic %d clocks\n", static_cast(TimeStampEnd - TimeStampBegin)); + + int Error = 0; + for(std::size_t i = 0; i < Samples; ++i) + Error += Results[i].x >= -1.0f && Results[i].x <= 1.0f ? 0 : 1; + return Error; + } + + template + GLM_FUNC_QUALIFIER glm::vec taylorSeriesRefCos(glm::vec const& x) + { + return static_cast(1) + - (x * x) / glm::factorial(static_cast(2)) + + (x * x * x * x) / glm::factorial(static_cast(4)) + - (x * x * x * x * x * x) / glm::factorial(static_cast(6)) + + (x * x * x * x * x * x * x * x) / glm::factorial(static_cast(8)); + } + + template + GLM_FUNC_QUALIFIER glm::vec fastRefCos(glm::vec const& x) + { + glm::vec const Angle0_PI(glm::abs(fmod(x + glm::pi(), glm::two_pi()) - glm::pi())); +// return taylorSeriesRefCos(Angle0_PI); + + glm::vec const FirstQuarterPi(lessThanEqual(Angle0_PI, glm::vec(glm::half_pi()))); + + glm::vec const RevertAngle(mix(glm::vec(glm::pi()), glm::vec(0), FirstQuarterPi)); + glm::vec const ReturnSign(mix(glm::vec(-1), glm::vec(1), FirstQuarterPi)); + glm::vec const SectionAngle(RevertAngle - Angle0_PI); + + return ReturnSign * taylorSeriesRefCos(SectionAngle); + } + + int perf_fastCosRef(float Begin, float End, std::size_t Samples) + { + std::vector Results; + Results.resize(Samples); + + float const Steps = (End - Begin) / static_cast(Samples); + + std::clock_t const TimeStampBegin = std::clock(); + + for(std::size_t i = 0; i < Samples; ++i) + Results[i] = taylorCos::fastRefCos(AngleShift + glm::vec4(Begin + Steps * static_cast(i))); + + std::clock_t const TimeStampEnd = std::clock(); + + std::printf("fastCosRef %d clocks\n", static_cast(TimeStampEnd - TimeStampBegin)); + + int Error = 0; + for(std::size_t i = 0; i < Samples; ++i) + Error += Results[i].x >= -1.0f && Results[i].x <= 1.0f ? 0 : 1; + return Error; + } + + int perf_fastCosOld(float Begin, float End, std::size_t Samples) + { + std::vector Results; + Results.resize(Samples); + + float const Steps = (End - Begin) / static_cast(Samples); + + std::clock_t const TimeStampBegin = std::clock(); + + for(std::size_t i = 0; i < Samples; ++i) + Results[i] = glm::fastCos(AngleShift + glm::vec4(Begin + Steps * static_cast(i))); + + std::clock_t const TimeStampEnd = std::clock(); + + std::printf("fastCosOld %d clocks\n", static_cast(TimeStampEnd - TimeStampBegin)); + + int Error = 0; + for(std::size_t i = 0; i < Samples; ++i) + Error += Results[i].x >= -1.0f && Results[i].x <= 1.0f ? 0 : 1; + return Error; + } + + int perf_cos(float Begin, float End, std::size_t Samples) + { + std::vector Results; + Results.resize(Samples); + + float const Steps = (End - Begin) / static_cast(Samples); + + std::clock_t const TimeStampBegin = std::clock(); + + for(std::size_t i = 0; i < Samples; ++i) + Results[i] = glm::cos(AngleShift + glm::vec4(Begin + Steps * static_cast(i))); + + std::clock_t const TimeStampEnd = std::clock(); + + std::printf("cos %d clocks\n", static_cast(TimeStampEnd - TimeStampBegin)); + + int Error = 0; + for(std::size_t i = 0; i < Samples; ++i) + Error += Results[i].x >= -1.0f && Results[i].x <= 1.0f ? 0 : 1; + return Error; + } + + int perf(std::size_t const Samples) + { + int Error = 0; + + float const Begin = -glm::pi(); + float const End = glm::pi(); + + Error += perf_cos(Begin, End, Samples); + Error += perf_fastCosOld(Begin, End, Samples); + Error += perf_fastCosRef(Begin, End, Samples); + //Error += perf_fastCosNew(Begin, End, Samples); + Error += perf_fastCosDeterminisctic(Begin, End, Samples); + + return Error; + } + + int test() + { + int Error = 0; + + //for(float Angle = -4.0f * glm::pi(); Angle < 4.0f * glm::pi(); Angle += 0.1f) + //for(float Angle = -720.0f; Angle < 720.0f; Angle += 0.1f) + for(float Angle = 0.0f; Angle < 180.0f; Angle += 0.1f) + { + float const modAngle = std::fmod(glm::abs(Angle), 360.f); + assert(modAngle >= 0.0f && modAngle <= 360.f); + float const radAngle = glm::radians(modAngle); + float const Cos0 = std::cos(radAngle); + + float const Cos1 = taylorCos::fastRefCos(glm::fvec1(radAngle)).x; + Error += glm::abs(Cos1 - Cos0) < 0.1f ? 0 : 1; + + //float const Cos2 = taylorCos::fastCosNew(glm::fvec1(radAngle)).x; + //Error += glm::abs(Cos2 - Cos0) < 0.1f ? 0 : 1; + + assert(!Error); + } + + return Error; + } +}//namespace taylorCos + +namespace taylor2 +{ + glm::vec4 const AngleShift(0.0f, glm::pi() * 0.5f, glm::pi() * 1.0f, glm::pi() * 1.5f); + + float taylorCosA(float x) + { + return 1.f + - (x * x) * (1.f / 2.f) + + (x * x * x * x) * (1.f / 24.f) + - (x * x * x * x * x * x) * (1.f / 720.f) + + (x * x * x * x * x * x * x * x) * (1.f / 40320.f); + } + + float taylorCosB(float x) + { + return 1.f + - (x * x) * (1.f / 2.f) + + (x * x * x * x) * (1.f / 24.f) + - (x * x * x * x * x * x) * (1.f / 720.f) + + (x * x * x * x * x * x * x * x) * (1.f / 40320.f); + } + + float taylorCosC(float x) + { + return 1.f + - (x * x) * (1.f / 2.f) + + ((x * x) * (x * x)) * (1.f / 24.f) + - (((x * x) * (x * x)) * (x * x)) * (1.f / 720.f) + + (((x * x) * (x * x)) * ((x * x) * (x * x))) * (1.f / 40320.f); + } + + int perf_taylorCosA(float Begin, float End, std::size_t Samples) + { + std::vector Results; + Results.resize(Samples); + + float const Steps = (End - Begin) / static_cast(Samples); + + std::clock_t const TimeStampBegin = std::clock(); + + for(std::size_t i = 0; i < Samples; ++i) + Results[i] = taylorCosA(AngleShift.x + Begin + Steps * static_cast(i)); + + std::clock_t const TimeStampEnd = std::clock(); + + std::printf("taylorCosA %d clocks\n", static_cast(TimeStampEnd - TimeStampBegin)); + + int Error = 0; + for(std::size_t i = 0; i < Samples; ++i) + Error += Results[i] >= -1.0f && Results[i] <= 1.0f ? 0 : 1; + return Error; + } + + int perf_taylorCosB(float Begin, float End, std::size_t Samples) + { + std::vector Results; + Results.resize(Samples); + + float const Steps = (End - Begin) / static_cast(Samples); + + std::clock_t const TimeStampBegin = std::clock(); + + for(std::size_t i = 0; i < Samples; ++i) + Results[i] = taylorCosB(AngleShift.x + Begin + Steps * static_cast(i)); + + std::clock_t const TimeStampEnd = std::clock(); + + std::printf("taylorCosB %d clocks\n", static_cast(TimeStampEnd - TimeStampBegin)); + + int Error = 0; + for(std::size_t i = 0; i < Samples; ++i) + Error += Results[i] >= -1.0f && Results[i] <= 1.0f ? 0 : 1; + return Error; + } + + int perf_taylorCosC(float Begin, float End, std::size_t Samples) + { + std::vector Results; + Results.resize(Samples); + + float const Steps = (End - Begin) / static_cast(Samples); + + std::clock_t const TimeStampBegin = std::clock(); + + for(std::size_t i = 0; i < Samples; ++i) + Results[i] = taylorCosC(AngleShift.x + Begin + Steps * static_cast(i)); + + std::clock_t const TimeStampEnd = std::clock(); + + std::printf("taylorCosC %d clocks\n", static_cast(TimeStampEnd - TimeStampBegin)); + + int Error = 0; + for(std::size_t i = 0; i < Samples; ++i) + Error += Results[i] >= -1.0f && Results[i] <= 1.0f ? 0 : 1; + return Error; + } + + int perf(std::size_t Samples) + { + int Error = 0; + + float const Begin = -glm::pi(); + float const End = glm::pi(); + + Error += perf_taylorCosA(Begin, End, Samples); + Error += perf_taylorCosB(Begin, End, Samples); + Error += perf_taylorCosC(Begin, End, Samples); + + return Error; + } + +}//namespace taylor2 + +int main() +{ + int Error(0); + + Error += ::taylor2::perf(1000); + Error += ::taylorCos::test(); + Error += ::taylorCos::perf(1000); + +# ifdef NDEBUG + ::fastCos::perf(false); + ::fastSin::perf(false); + ::fastTan::perf(false); + ::fastAcos::perf(false); + ::fastAsin::perf(false); + ::fastAtan::perf(false); +# endif//NDEBUG + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_functions.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_functions.cpp new file mode 100644 index 0000000000000000000000000000000000000000..1ec1aed826582506c22c37615641da9c3263636b --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_functions.cpp @@ -0,0 +1,36 @@ +#include +#include +#include + +int test_gauss_1d() +{ + int Error = 0; + + std::vector Result(20); + for(std::size_t i = 0, n = Result.size(); i < n; ++i) + Result[i] = glm::gauss(static_cast(i) * 0.1f, 0.0f, 1.0f); + + return Error; +} + +int test_gauss_2d() +{ + int Error = 0; + + std::vector Result(20); + for(std::size_t i = 0, n = Result.size(); i < n; ++i) + Result[i] = glm::gauss(glm::vec2(static_cast(i)) * 0.1f, glm::vec2(0.0f), glm::vec2(1.0f)); + + return Error; +} + +int main() +{ + int Error = 0; + + Error += test_gauss_1d(); + Error += test_gauss_2d(); + + return Error; +} + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_gradient_paint.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_gradient_paint.cpp new file mode 100644 index 0000000000000000000000000000000000000000..d28f82cf893831a448f1515e0b4133ee35274cb0 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_gradient_paint.cpp @@ -0,0 +1,34 @@ +#define GLM_ENABLE_EXPERIMENTAL +#include + +int test_radialGradient() +{ + int Error = 0; + + float Gradient = glm::radialGradient(glm::vec2(0), 1.0f, glm::vec2(1), glm::vec2(0.5)); + Error += Gradient != 0.0f ? 0 : 1; + + return Error; +} + +int test_linearGradient() +{ + int Error = 0; + + float Gradient = glm::linearGradient(glm::vec2(0), glm::vec2(1), glm::vec2(0.5)); + Error += Gradient != 0.0f ? 0 : 1; + + return Error; +} + +int main() +{ + int Error = 0; + + Error += test_radialGradient(); + Error += test_linearGradient(); + + return Error; +} + + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_handed_coordinate_space.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_handed_coordinate_space.cpp new file mode 100644 index 0000000000000000000000000000000000000000..bb8d6a1ea22c72deaf60e5e51dfd6943ff2d2141 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_handed_coordinate_space.cpp @@ -0,0 +1,9 @@ +#define GLM_ENABLE_EXPERIMENTAL +#include + +int main() +{ + int Error(0); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_hash.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_hash.cpp new file mode 100644 index 0000000000000000000000000000000000000000..264ca4fdd45967eb0c73686675fbf481090f861a --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_hash.cpp @@ -0,0 +1,55 @@ +#define GLM_ENABLE_EXPERIMENTAL +#include +#include + +int test_compile() +{ + int Error = 0; + + // Vector types + std::unordered_map map_vec1; + Error += ++map_vec1[glm::vec1(0.0f)]; + std::unordered_map map_vec2; + Error += ++map_vec2[glm::vec2(0.0f)]; + std::unordered_map map_vec3; + Error += ++map_vec3[glm::vec3(0.0f)]; + std::unordered_map map_vec4; + Error += ++map_vec4[glm::vec4(0.0f)]; + + // Quaternion types + std::unordered_map map_quat; + Error += ++map_quat[glm::quat(0.0f, glm::vec3(0.0f))]; + std::unordered_map map_dualquat; + Error += ++map_dualquat[glm::dualquat(glm::vec3(0.0f))]; + + // Matrix types + std::unordered_map map_mat2x2; + Error += ++map_mat2x2[glm::mat2x2(0.0f)]; + std::unordered_map map_mat2x3; + Error += ++map_mat2x3[glm::mat2x3(0.0f)]; + std::unordered_map map_mat2x4; + Error += ++map_mat2x4[glm::mat2x4(0.0f)]; + std::unordered_map map_mat3x2; + Error += ++map_mat3x2[glm::mat3x2(0.0f)]; + std::unordered_map map_mat3x3; + Error += ++map_mat3x3[glm::mat3x3(0.0f)]; + std::unordered_map map_mat3x4; + Error += ++map_mat3x4[glm::mat3x4(0.0f)]; + std::unordered_map map_mat4x2; + Error += ++map_mat4x2[glm::mat4x2(0.0f)]; + std::unordered_map map_mat4x3; + Error += ++map_mat4x3[glm::mat4x3(0.0f)]; + std::unordered_map map_mat4x4; + Error += ++map_mat4x4[glm::mat4x4(0.0f)]; + + return Error > 0 ? 0 : 1; +} + +int main() +{ + int Error = 0; + + Error += test_compile(); + + return Error; +} \ No newline at end of file diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_int_10_10_10_2.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_int_10_10_10_2.cpp new file mode 100644 index 0000000000000000000000000000000000000000..9bcb638494136fce0a332b760b8b51943fc158e3 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_int_10_10_10_2.cpp @@ -0,0 +1,18 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2013-10-25 +// Updated : 2013-10-25 +// Licence : This source is under MIT licence +// File : test/gtx/associated_min_max.cpp +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#include +#include + +int main() +{ + int Error(0); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_integer.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_integer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..74cf9deb011efa04faf4d5f321c23a9a133669a2 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_integer.cpp @@ -0,0 +1,108 @@ +#define GLM_ENABLE_EXPERIMENTAL +#include +#include +#include +#include +/* +int test_floor_log2() +{ + int Error = 0; + + for(std::size_t i = 1; i < 1000000; ++i) + { + glm::uint A = glm::floor_log2(glm::uint(i)); + glm::uint B = glm::uint(glm::floor(glm::log2(double(i)))); // Will fail with float, lack of accuracy + + Error += A == B ? 0 : 1; + assert(!Error); + } + + return Error; +} +*/ +int test_log2() +{ + int Error = 0; + + for(std::size_t i = 1; i < 24; ++i) + { + glm::uint A = glm::log2(glm::uint(1 << i)); + glm::uint B = glm::uint(glm::log2(double(1 << i))); + + //Error += glm::equalEpsilon(double(A), B, 1.0) ? 0 : 1; + Error += glm::abs(double(A) - B) <= 24 ? 0 : 1; + assert(!Error); + + std::printf("Log2(%d) error A=%d, B=%d\n", 1 << i, A, B); + } + + std::printf("log2 error=%d\n", Error); + + return Error; +} + +int test_nlz() +{ + int Error = 0; + + for(glm::uint i = 1; i < glm::uint(33); ++i) + Error += glm::nlz(i) == glm::uint(31u) - glm::findMSB(i) ? 0 : 1; + //printf("%d, %d\n", glm::nlz(i), 31u - glm::findMSB(i)); + + return Error; +} + +int test_pow_uint() +{ + int Error = 0; + + glm::uint const p0 = glm::pow(2u, 0u); + Error += p0 == 1u ? 0 : 1; + + glm::uint const p1 = glm::pow(2u, 1u); + Error += p1 == 2u ? 0 : 1; + + glm::uint const p2 = glm::pow(2u, 2u); + Error += p2 == 4u ? 0 : 1; + + return Error; +} + +int test_pow_int() +{ + int Error = 0; + + int const p0 = glm::pow(2, 0u); + Error += p0 == 1 ? 0 : 1; + + int const p1 = glm::pow(2, 1u); + Error += p1 == 2 ? 0 : 1; + + int const p2 = glm::pow(2, 2u); + Error += p2 == 4 ? 0 : 1; + + int const p0n = glm::pow(-2, 0u); + Error += p0n == -1 ? 0 : 1; + + int const p1n = glm::pow(-2, 1u); + Error += p1n == -2 ? 0 : 1; + + int const p2n = glm::pow(-2, 2u); + Error += p2n == 4 ? 0 : 1; + + return Error; +} + +int main() +{ + int Error = 0; + + Error += test_nlz(); +// Error += test_floor_log2(); + Error += test_log2(); + Error += test_pow_uint(); + Error += test_pow_int(); + + return Error; +} + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_intersect.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_intersect.cpp new file mode 100644 index 0000000000000000000000000000000000000000..b16add8a2f7d236666413b5cd2775cd2f7b7fb64 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_intersect.cpp @@ -0,0 +1,88 @@ +#define GLM_ENABLE_EXPERIMENTAL +#include +#include +#include + +int test_intersectRayPlane() +{ + int Error = 0; + glm::vec3 const PlaneOrigin(0, 0, 1); + glm::vec3 const PlaneNormal(0, 0, -1); + glm::vec3 const RayOrigin(0, 0, 0); + glm::vec3 const RayDir(0, 0, 1); + + // check that inversion of the plane normal has no effect + { + float Distance = 0; + bool const Result = glm::intersectRayPlane(RayOrigin, RayDir, PlaneOrigin, PlaneNormal, Distance); + Error += glm::abs(Distance - 1.f) <= std::numeric_limits::epsilon() ? 0 : 1; + Error += Result ? 0 : 1; + } + { + float Distance = 0; + bool const Result = glm::intersectRayPlane(RayOrigin, RayDir, PlaneOrigin, -1.f * PlaneNormal, Distance); + Error += glm::abs(Distance - 1.f) <= std::numeric_limits::epsilon() ? 0 : 1; + Error += Result ? 0 : 1; + } + + // check if plane is before of behind the ray origin + { + float Distance = 9.9999f; // value should not be changed + bool const Result = glm::intersectRayPlane(RayOrigin, RayDir, -1.f * PlaneOrigin, PlaneNormal, Distance); + Error += glm::abs(Distance - 9.9999f) <= std::numeric_limits::epsilon() ? 0 : 1; + Error += Result ? 1 : 0; // there is no intersection in front of the ray origin, only behind + } + + return Error; +} + +int test_intersectRayTriangle() +{ + int Error = 0; + + glm::vec3 const Orig(0, 0, 2); + glm::vec3 const Dir(0, 0, -1); + glm::vec3 const Vert0(0, 0, 0); + glm::vec3 const Vert1(-1, -1, 0); + glm::vec3 const Vert2(1, -1, 0); + glm::vec2 BaryPosition(0); + float Distance = 0; + + bool const Result = glm::intersectRayTriangle(Orig, Dir, Vert0, Vert1, Vert2, BaryPosition, Distance); + + Error += glm::all(glm::epsilonEqual(BaryPosition, glm::vec2(0), std::numeric_limits::epsilon())) ? 0 : 1; + Error += glm::abs(Distance - 2.f) <= std::numeric_limits::epsilon() ? 0 : 1; + Error += Result ? 0 : 1; + + return Error; +} + +int test_intersectLineTriangle() +{ + int Error = 0; + + glm::vec3 const Orig(0, 0, 2); + glm::vec3 const Dir(0, 0, -1); + glm::vec3 const Vert0(0, 0, 0); + glm::vec3 const Vert1(-1, -1, 0); + glm::vec3 const Vert2(1, -1, 0); + glm::vec3 Position(2.0f, 0.0f, 0.0f); + + bool const Result = glm::intersectLineTriangle(Orig, Dir, Vert0, Vert1, Vert2, Position); + + Error += glm::all(glm::epsilonEqual(Position, glm::vec3(2.0f, 0.0f, 0.0f), std::numeric_limits::epsilon())) ? 0 : 1; + Error += Result ? 0 : 1; + + return Error; +} + +int main() +{ + int Error = 0; + + Error += test_intersectRayPlane(); + Error += test_intersectRayTriangle(); + Error += test_intersectLineTriangle(); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_io.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_io.cpp new file mode 100644 index 0000000000000000000000000000000000000000..410d9c124341493ef19068e19a67ebaf9fe190ee --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_io.cpp @@ -0,0 +1,186 @@ +#define GLM_ENABLE_EXPERIMENTAL +#include +#if GLM_LANG & GLM_LANG_CXXMS_FLAG +#include +#include +#include +#include +#include + +namespace +{ + template + std::basic_ostream& operator<<(std::basic_ostream& os, glm::qualifier const& a) + { + typename std::basic_ostream::sentry const cerberus(os); + + if (cerberus) + { + switch (a) { + case glm::highp: os << "uhi"; break; + case glm::mediump: os << "umd"; break; + case glm::lowp: os << "ulo"; break; +# if GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE + case glm::aligned_highp: os << "ahi"; break; + case glm::aligned_mediump: os << "amd"; break; + case glm::aligned_lowp: os << "alo"; break; +# endif + } + } + + return os; + } + + template + std::basic_string type_name(std::basic_ostream&, T const&) + { + std::basic_ostringstream ostr; + + if (typeid(T) == typeid(glm::qua)) { ostr << "quat"; } + else if (typeid(T) == typeid(glm::vec<2, U,P>)) { ostr << "vec2"; } + else if (typeid(T) == typeid(glm::vec<3, U,P>)) { ostr << "vec3"; } + else if (typeid(T) == typeid(glm::vec<4, U,P>)) { ostr << "vec4"; } + else if (typeid(T) == typeid(glm::mat<2, 2, U,P>)) { ostr << "mat2x2"; } + else if (typeid(T) == typeid(glm::mat<2, 3, U,P>)) { ostr << "mat2x3"; } + else if (typeid(T) == typeid(glm::mat<2, 4, U,P>)) { ostr << "mat2x4"; } + else if (typeid(T) == typeid(glm::mat<3, 2, U,P>)) { ostr << "mat3x2"; } + else if (typeid(T) == typeid(glm::mat<3, 3, U,P>)) { ostr << "mat3x3"; } + else if (typeid(T) == typeid(glm::mat<3, 4, U,P>)) { ostr << "mat3x4"; } + else if (typeid(T) == typeid(glm::mat<4, 2, U,P>)) { ostr << "mat4x2"; } + else if (typeid(T) == typeid(glm::mat<4, 3, U,P>)) { ostr << "mat4x3"; } + else if (typeid(T) == typeid(glm::mat<4, 4, U,P>)) { ostr << "mat4x4"; } + else { ostr << "unknown"; } + + ostr << '<' << typeid(U).name() << ',' << P << '>'; + + return ostr.str(); + } +} // namespace { + +template +int test_io_quat(OS& os) +{ + os << '\n' << typeid(OS).name() << '\n'; + + glm::qua const q(1, 0, 0, 0); + + { + glm::io::basic_format_saver const iofs(os); + + os << glm::io::precision(2) << glm::io::width(1 + 2 + 1 + 2) + << type_name(os, q) << ": " << q << '\n'; + } + + { + glm::io::basic_format_saver const iofs(os); + + os << glm::io::unformatted + << type_name(os, q) << ": " << q << '\n'; + } + + return 0; +} + +template +int test_io_vec(OS& os) +{ + os << '\n' << typeid(OS).name() << '\n'; + + glm::vec<2, T,P> const v2(0, 1); + glm::vec<3, T,P> const v3(2, 3, 4); + glm::vec<4, T,P> const v4(5, 6, 7, 8); + + os << type_name(os, v2) << ": " << v2 << '\n' + << type_name(os, v3) << ": " << v3 << '\n' + << type_name(os, v4) << ": " << v4 << '\n'; + + glm::io::basic_format_saver const iofs(os); + + os << glm::io::precision(2) << glm::io::width(1 + 2 + 1 + 2) + << type_name(os, v2) << ": " << v2 << '\n' + << type_name(os, v3) << ": " << v3 << '\n' + << type_name(os, v4) << ": " << v4 << '\n'; + + return 0; +} + +template +int test_io_mat(OS& os, glm::io::order_type otype) +{ + os << '\n' << typeid(OS).name() << '\n'; + + glm::vec<2, T,P> const v2_1( 0, 1); + glm::vec<2, T,P> const v2_2( 2, 3); + glm::vec<2, T,P> const v2_3( 4, 5); + glm::vec<2, T,P> const v2_4( 6, 7); + glm::vec<3, T,P> const v3_1( 8, 9, 10); + glm::vec<3, T,P> const v3_2(11, 12, 13); + glm::vec<3, T,P> const v3_3(14, 15, 16); + glm::vec<3, T,P> const v3_4(17, 18, 19); + glm::vec<4, T,P> const v4_1(20, 21, 22, 23); + glm::vec<4, T,P> const v4_2(24, 25, 26, 27); + glm::vec<4, T,P> const v4_3(28, 29, 30, 31); + glm::vec<4, T,P> const v4_4(32, 33, 34, 35); + + glm::io::basic_format_saver const iofs(os); + + os << glm::io::precision(2) << glm::io::width(1 + 2 + 1 + 2) + << glm::io::order(otype) + << "mat2x2<" << typeid(T).name() << ',' << P << ">: " << glm::mat<2, 2, T,P>(v2_1, v2_2) << '\n' + << "mat2x3<" << typeid(T).name() << ',' << P << ">: " << glm::mat<2, 3, T,P>(v3_1, v3_2) << '\n' + << "mat2x4<" << typeid(T).name() << ',' << P << ">: " << glm::mat<2, 4, T,P>(v4_1, v4_2) << '\n' + << "mat3x2<" << typeid(T).name() << ',' << P << ">: " << glm::mat<3, 2, T,P>(v2_1, v2_2, v2_3) << '\n' + << "mat3x3<" << typeid(T).name() << ',' << P << ">: " << glm::mat<3, 3, T,P>(v3_1, v3_2, v3_3) << '\n' + << "mat3x4<" << typeid(T).name() << ',' << P << ">: " << glm::mat<3, 4, T,P>(v4_1, v4_2, v4_3) << '\n' + << "mat4x2<" << typeid(T).name() << ',' << P << ">: " << glm::mat<4, 2, T,P>(v2_1, v2_2, v2_3, v2_4) << '\n' + << "mat4x3<" << typeid(T).name() << ',' << P << ">: " << glm::mat<4, 3, T,P>(v3_1, v3_2, v3_3, v3_4) << '\n' + << "mat4x4<" << typeid(T).name() << ',' << P << ">: " << glm::mat<4, 4, T,P>(v4_1, v4_2, v4_3, v4_4) << '\n'; + + os << glm::io::unformatted + << glm::io::order(otype) + << "mat2x2<" << typeid(T).name() << ',' << P << ">: " << glm::mat<2, 2, T,P>(v2_1, v2_2) << '\n' + << "mat2x3<" << typeid(T).name() << ',' << P << ">: " << glm::mat<2, 3, T,P>(v3_1, v3_2) << '\n' + << "mat2x4<" << typeid(T).name() << ',' << P << ">: " << glm::mat<2, 4, T,P>(v4_1, v4_2) << '\n' + << "mat3x2<" << typeid(T).name() << ',' << P << ">: " << glm::mat<3, 2, T,P>(v2_1, v2_2, v2_3) << '\n' + << "mat3x3<" << typeid(T).name() << ',' << P << ">: " << glm::mat<3, 3, T,P>(v3_1, v3_2, v3_3) << '\n' + << "mat3x4<" << typeid(T).name() << ',' << P << ">: " << glm::mat<3, 4, T,P>(v4_1, v4_2, v4_3) << '\n' + << "mat4x2<" << typeid(T).name() << ',' << P << ">: " << glm::mat<4, 2, T,P>(v2_1, v2_2, v2_3, v2_4) << '\n' + << "mat4x3<" << typeid(T).name() << ',' << P << ">: " << glm::mat<4, 3, T,P>(v3_1, v3_2, v3_3, v3_4) << '\n' + << "mat4x4<" << typeid(T).name() << ',' << P << ">: " << glm::mat<4, 4, T,P>(v4_1, v4_2, v4_3, v4_4) << '\n'; + + return 0; +} + +int main() +{ + int Error(0); + + Error += test_io_quat(std::cout); + Error += test_io_quat(std::wcout); + Error += test_io_quat(std::cout); + Error += test_io_quat(std::wcout); + Error += test_io_quat(std::cout); + Error += test_io_quat(std::wcout); + + Error += test_io_vec(std::cout); + Error += test_io_vec(std::wcout); + Error += test_io_vec(std::cout); + Error += test_io_vec(std::wcout); + Error += test_io_vec(std::cout); + Error += test_io_vec(std::wcout); + + Error += test_io_mat(std::cout, glm::io::column_major); + Error += test_io_mat(std::wcout, glm::io::column_major); + Error += test_io_mat(std::cout, glm::io::row_major); + Error += test_io_mat(std::wcout, glm::io::row_major); + + return Error; +} +#else + +int main() +{ + return 0; +} + +#endif// GLM_LANG & GLM_LANG_CXXMS_FLAG diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_load.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_load.cpp new file mode 100644 index 0000000000000000000000000000000000000000..4b3744ed201a64c2bcb670c41ad3066214fb2287 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_load.cpp @@ -0,0 +1,124 @@ +#define GLM_ENABLE_EXPERIMENTAL +#include +/* +#if GLM_CONFIG_SIMD == GLM_ENABLE + +#include +#include +#include +#include +#include + +namespace glm +{ + enum genTypeEnum + { + QUALIFIER_HIGHP, + QUALIFIER_MEDIUMP, + QUALIFIER_LOWP + }; + + template + struct genTypeTrait + {}; + + template + struct genTypeTrait > + { + static const genTypeEnum GENTYPE = QUALIFIER_HIGHP; + }; + + template + struct genTypeTrait > + { + static const genTypeEnum GENTYPE = QUALIFIER_MEDIUMP; + }; + + template + struct genTypeTrait > + { + static const genTypeEnum GENTYPE = QUALIFIER_LOWP; + }; + + template + struct load_gentype + { + + }; + +# if GLM_ARCH & GLM_ARCH_SSE_BIT + template + struct load_gentype<4, float, Q, true> + { + GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec<4, float, Q> load(float const* Mem) + { + vec<4, float, Q> Result; + Result.data = _mm_loadu_ps(Mem); + return Result; + } + }; +# endif//GLM_ARCH & GLM_ARCH_SSE_BIT + + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType example_identity() + { + return detail::init_gentype::GENTYPE>::identity(); + } + + template + genType load(valType const* Mem) + { + + } + + aligned_vec4 loadu(float const* Mem) + { + aligned_vec4 Result; +# if GLM_ARCH & GLM_ARCH_SSE_BIT + Result.data = _mm_loadu_ps(Mem); +# else + Result[0] = *(Mem + 0); + Result[1] = *(Mem + 1); + Result[2] = *(Mem + 2); + Result[3] = *(Mem + 3); +# endif//GLM_ARCH & GLM_ARCH_SSE_BIT + return Result; + } + + aligned_vec4 loada(float const* Mem) + { + aligned_vec4 Result; +# if GLM_ARCH & GLM_ARCH_SSE_BIT + Result.data = _mm_load_ps(Mem); +# else + Result[0] = *(Mem + 0); + Result[1] = *(Mem + 1); + Result[2] = *(Mem + 2); + Result[3] = *(Mem + 3); +# endif//GLM_ARCH & GLM_ARCH_SSE_BIT + return Result; + } +}//namespace glm + +int test_vec4_load() +{ + int Error = 0; + + float Data[] = {1.f, 2.f, 3.f, 4.f}; + glm::aligned_vec4 const V = glm::loadu(Data); + Error += glm::all(glm::equal(V, glm::aligned_vec4(1.f, 2.f, 3.f, 4.f), glm::epsilon())) ? 0 : 1; + + return Error; +} +#endif +*/ +int main() +{ + int Error = 0; +/* +# if GLM_CONFIG_SIMD == GLM_ENABLE + Error += test_vec4_load(); +# endif +*/ + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_log_base.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_log_base.cpp new file mode 100644 index 0000000000000000000000000000000000000000..c0b92b075733931ea4e676c9dee0017b6186dd6b --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_log_base.cpp @@ -0,0 +1,54 @@ +#define GLM_ENABLE_EXPERIMENTAL +#include +#include +#include +#include + +namespace test_log +{ + int run() + { + int Error = 0; + + { + float A = glm::log(10.f, 2.0f); + float B = glm::log2(10.f); + Error += glm::epsilonEqual(A, B, 0.00001f) ? 0 : 1; + } + + { + glm::vec1 A = glm::log(glm::vec1(10.f), glm::vec1(2.0f)); + glm::vec1 B = glm::log2(glm::vec1(10.f)); + Error += glm::all(glm::epsilonEqual(A, B, glm::vec1(0.00001f))) ? 0 : 1; + } + + { + glm::vec2 A = glm::log(glm::vec2(10.f), glm::vec2(2.0f)); + glm::vec2 B = glm::log2(glm::vec2(10.f)); + Error += glm::all(glm::epsilonEqual(A, B, glm::vec2(0.00001f))) ? 0 : 1; + } + + { + glm::vec3 A = glm::log(glm::vec3(10.f), glm::vec3(2.0f)); + glm::vec3 B = glm::log2(glm::vec3(10.f)); + Error += glm::all(glm::epsilonEqual(A, B, glm::vec3(0.00001f))) ? 0 : 1; + } + + { + glm::vec4 A = glm::log(glm::vec4(10.f), glm::vec4(2.0f)); + glm::vec4 B = glm::log2(glm::vec4(10.f)); + Error += glm::all(glm::epsilonEqual(A, B, glm::vec4(0.00001f))) ? 0 : 1; + } + + return Error; + } +}//namespace test_log + +int main() +{ + int Error(0); + + Error += test_log::run(); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_matrix_cross_product.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_matrix_cross_product.cpp new file mode 100644 index 0000000000000000000000000000000000000000..8f7da31005ac17b973a549cec3e45b473507b264 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_matrix_cross_product.cpp @@ -0,0 +1,9 @@ +#define GLM_ENABLE_EXPERIMENTAL +#include + +int main() +{ + int Error(0); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_matrix_decompose.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_matrix_decompose.cpp new file mode 100644 index 0000000000000000000000000000000000000000..3d967cbe7f9861e9b3a5525f2e37060c58d23032 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_matrix_decompose.cpp @@ -0,0 +1,19 @@ +#define GLM_ENABLE_EXPERIMENTAL +#include + +int main() +{ + int Error(0); + + glm::mat4 Matrix(1); + + glm::vec3 Scale; + glm::quat Orientation; + glm::vec3 Translation; + glm::vec3 Skew(1); + glm::vec4 Perspective(1); + + glm::decompose(Matrix, Scale, Orientation, Translation, Skew, Perspective); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_matrix_factorisation.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_matrix_factorisation.cpp new file mode 100644 index 0000000000000000000000000000000000000000..ca34b22f06bf55b4df77ba9344fc1148d70b3b3f --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_matrix_factorisation.cpp @@ -0,0 +1,105 @@ +#define GLM_ENABLE_EXPERIMENTAL +#include +#include +#include + +template +int test_qr(glm::mat m) +{ + int Error = 0; + + T const epsilon = static_cast(1e-10); + + glm::mat<(C < R ? C : R), R, T, Q> q(-999); + glm::mat r(-999); + + glm::qr_decompose(m, q, r); + + //Test if q*r really equals the input matrix + glm::mat tm = q*r; + glm::mat err = tm - m; + + for (glm::length_t i = 0; i < C; i++) + for (glm::length_t j = 0; j < R; j++) + Error += glm::abs(err[i][j]) > epsilon ? 1 : 0; + + //Test if the columns of q are orthonormal + for (glm::length_t i = 0; i < (C < R ? C : R); i++) + { + Error += (length(q[i]) - 1) > epsilon ? 1 : 0; + + for (glm::length_t j = 0; j epsilon ? 1 : 0; + } + + //Test if the matrix r is upper triangular + for (glm::length_t i = 0; i < C; i++) + for (glm::length_t j = i + 1; j < (C < R ? C : R); j++) + Error += glm::epsilonEqual(r[i][j], static_cast(0), glm::epsilon()) ? 0 : 1; + + return Error; +} + +template +int test_rq(glm::mat m) +{ + int Error = 0; + + T const epsilon = static_cast(1e-10); + + glm::mat q(-999); + glm::mat<(C < R ? C : R), R, T, Q> r(-999); + + glm::rq_decompose(m, r, q); + + //Test if q*r really equals the input matrix + glm::mat tm = r*q; + glm::mat err = tm - m; + + for (glm::length_t i = 0; i < C; i++) + for (glm::length_t j = 0; j < R; j++) + Error += glm::abs(err[i][j]) > epsilon ? 1 : 0; + + //Test if the rows of q are orthonormal + glm::mat<(C < R ? C : R), C, T, Q> tq = transpose(q); + + for (glm::length_t i = 0; i < (C < R ? C : R); i++) + { + Error += (length(tq[i]) - 1) > epsilon ? 1 : 0; + + for (glm::length_t j = 0; j epsilon ? 1 : 0; + } + + //Test if the matrix r is upper triangular + for (glm::length_t i = 0; i < (C < R ? C : R); i++) + for (glm::length_t j = R - (C < R ? C : R) + i + 1; j < R; j++) + Error += glm::epsilonEqual(r[i][j], static_cast(0), glm::epsilon()) ? 0 : 1; + + return Error; +} + +int main() +{ + int Error = 0; + + //Test QR square + Error += test_qr(glm::dmat3(12.0, 6.0, -4.0, -51.0, 167.0, 24.0, 4.0, -68.0, -41.0)) ? 1 : 0; + + //Test RQ square + Error += test_rq(glm::dmat3(12.0, 6.0, -4.0, -51.0, 167.0, 24.0, 4.0, -68.0, -41.0)) ? 1 : 0; + + //Test QR triangular 1 + Error += test_qr(glm::dmat3x4(12.0, 6.0, -4.0, -51.0, 167.0, 24.0, 4.0, -68.0, -41.0, 7.0, 2.0, 15.0)) ? 1 : 0; + + //Test QR triangular 2 + Error += test_qr(glm::dmat4x3(12.0, 6.0, -4.0, -51.0, 167.0, 24.0, 4.0, -68.0, -41.0, 7.0, 2.0, 15.0)) ? 1 : 0; + + //Test RQ triangular 1 : Fails at the triangular test + Error += test_rq(glm::dmat3x4(12.0, 6.0, -4.0, -51.0, 167.0, 24.0, 4.0, -68.0, -41.0, 7.0, 2.0, 15.0)) ? 1 : 0; + + //Test QR triangular 2 + Error += test_rq(glm::dmat4x3(12.0, 6.0, -4.0, -51.0, 167.0, 24.0, 4.0, -68.0, -41.0, 7.0, 2.0, 15.0)) ? 1 : 0; + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_matrix_interpolation.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_matrix_interpolation.cpp new file mode 100644 index 0000000000000000000000000000000000000000..0c9a7963b3f57c8b85a90c98aa2c461dc6780671 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_matrix_interpolation.cpp @@ -0,0 +1,122 @@ +#define GLM_ENABLE_EXPERIMENTAL +#include +#include +#include + +#include +#include +#include + + +static int test_axisAngle() +{ + int Error = 0; + + glm::mat4 m1(-0.9946f, 0.0f, -0.104531f, 0.0f, + 0.0f, 1.0f, 0.0f, 0.0f, + 0.104531f, 0.0f, -0.9946f, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f); + glm::mat4 m2(-0.992624f, 0.0f, -0.121874f, 0.0f, + 0.0f, 1.0f, 0.0f, 0.0f, + 0.121874f, 0.0f, -0.992624f, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f); + + glm::mat4 const m1rot = glm::extractMatrixRotation(m1); + glm::mat4 const dltRotation = m2 * glm::transpose(m1rot); + + glm::vec3 dltAxis(0.0f); + float dltAngle = 0.0f; + glm::axisAngle(dltRotation, dltAxis, dltAngle); + + std::cout << "dltAxis: (" << dltAxis.x << ", " << dltAxis.y << ", " << dltAxis.z << "), dltAngle: " << dltAngle << std::endl; + + glm::quat q = glm::quat_cast(dltRotation); + std::cout << "q: (" << q.x << ", " << q.y << ", " << q.z << ", " << q.w << ")" << std::endl; + float yaw = glm::yaw(q); + std::cout << "Yaw: " << yaw << std::endl; + + return Error; +} + +template +int testForAxisAngle(glm::vec<3, T, glm::defaultp> const axisTrue, T const angleTrue) +{ + T const eps = std::sqrt(std::numeric_limits::epsilon()); + + glm::mat<4, 4, T, glm::defaultp> const matTrue = glm::axisAngleMatrix(axisTrue, angleTrue); + + glm::vec<3, T, glm::defaultp> axis; + T angle; + glm::axisAngle(matTrue, axis, angle); + glm::mat<4, 4, T, glm::defaultp> const matRebuilt = glm::axisAngleMatrix(axis, angle); + + glm::mat<4, 4, T, glm::defaultp> const errMat = matTrue - matRebuilt; + T const maxErr = glm::compMax(glm::vec<4, T, glm::defaultp>( + glm::compMax(glm::abs(errMat[0])), + glm::compMax(glm::abs(errMat[1])), + glm::compMax(glm::abs(errMat[2])), + glm::compMax(glm::abs(errMat[3])) + )); + + return maxErr < eps ? 0 : 1; +} + +static int test_axisAngle2() +{ + int Error = 0; + + Error += testForAxisAngle(glm::vec3(0.0f, 1.0f, 0.0f), 0.0f); + Error += testForAxisAngle(glm::vec3(0.358f, 0.0716f, 0.9309f), 0.00001f); + Error += testForAxisAngle(glm::vec3(1.0f, 0.0f, 0.0f), 0.0001f); + Error += testForAxisAngle(glm::vec3(0.0f, 0.0f, 1.0f), 0.001f); + Error += testForAxisAngle(glm::vec3(0.0f, 0.0f, 1.0f), 0.001f); + Error += testForAxisAngle(glm::vec3(0.0f, 1.0f, 0.0f), 0.005f); + Error += testForAxisAngle(glm::vec3(0.0f, 0.0f, 1.0f), 0.005f); + Error += testForAxisAngle(glm::vec3(0.358f, 0.0716f, 0.9309f), 0.03f); + Error += testForAxisAngle(glm::vec3(0.358f, 0.0716f, 0.9309f), 0.0003f); + Error += testForAxisAngle(glm::vec3(0.0f, 0.0f, 1.0f), 0.01f); + Error += testForAxisAngle(glm::dvec3(0.0f, 1.0f, 0.0f), 0.00005); + Error += testForAxisAngle(glm::dvec3(-1.0f, 0.0f, 0.0f), 0.000001); + Error += testForAxisAngle(glm::dvec3(0.7071f, 0.7071f, 0.0f), 0.5); + Error += testForAxisAngle(glm::dvec3(0.7071f, 0.0f, 0.7071f), 0.0002); + Error += testForAxisAngle(glm::dvec3(0.7071f, 0.0f, 0.7071f), 0.00002); + Error += testForAxisAngle(glm::dvec3(0.7071f, 0.0f, 0.7071f), 0.000002); + Error += testForAxisAngle(glm::dvec3(0.7071f, 0.0f, 0.7071f), 0.0000002); + Error += testForAxisAngle(glm::vec3(0.0f, 0.7071f, 0.7071f), 1.3f); + Error += testForAxisAngle(glm::vec3(0.0f, 0.7071f, 0.7071f), 6.3f); + Error += testForAxisAngle(glm::vec3(1.0f, 0.0f, 0.0f), -0.23456f); + Error += testForAxisAngle(glm::vec3(1.0f, 0.0f, 0.0f), glm::pi()); + Error += testForAxisAngle(glm::vec3(0.0f, 1.0f, 0.0f), -glm::pi()); + Error += testForAxisAngle(glm::vec3(0.358f, 0.0716f, 0.9309f), -glm::pi()); + Error += testForAxisAngle(glm::vec3(1.0f, 0.0f, 0.0f), glm::pi() + 2e-6f); + Error += testForAxisAngle(glm::vec3(1.0f, 0.0f, 0.0f), glm::pi() + 1e-4f); + Error += testForAxisAngle(glm::vec3(0.0f, 1.0f, 0.0f), -glm::pi() + 1e-3f); + Error += testForAxisAngle(glm::vec3(0.358f, 0.0716f, 0.9309f), -glm::pi() + 5e-3f); + + return Error; +} + +static int test_rotate() +{ + glm::mat4 m2(1.0); + float myAngle = 1.0f; + m2 = glm::rotate(m2, myAngle, glm::vec3(1.0f, 0.0f, 0.0f)); + glm::vec3 m2Axis; + float m2Angle; + glm::axisAngle(m2, m2Axis, m2Angle); + + return 0; +} + +int main() +{ + int Error = 0; + + Error += test_axisAngle(); + Error += test_axisAngle2(); + Error += test_rotate(); + + return Error; +} + + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_matrix_major_storage.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_matrix_major_storage.cpp new file mode 100644 index 0000000000000000000000000000000000000000..5e05a2ad155567e5188fde5334fe4a07f5e13bcb --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_matrix_major_storage.cpp @@ -0,0 +1,9 @@ +#define GLM_ENABLE_EXPERIMENTAL +#include + +int main() +{ + int Error(0); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_matrix_operation.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_matrix_operation.cpp new file mode 100644 index 0000000000000000000000000000000000000000..4a0d2677827e4570dfd0f4cdbc1743dd0ce19df6 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_matrix_operation.cpp @@ -0,0 +1,86 @@ +#define GLM_ENABLE_EXPERIMENTAL +#include +#include +#include +#include + +int test_adjugate() +{ + int Error = 0; + + const float epsilon = std::numeric_limits::epsilon(); + + // mat2 + const glm::mat2 m2( + 2, 3, + 1, 5 + ); + + const glm::mat2 eam2( + 5, -3, + -1, 2 + ); + + const glm::mat2 am2 = glm::adjugate(m2); + + Error += glm::all(glm::bvec2( + glm::all(glm::epsilonEqual(am2[0], eam2[0], epsilon)), + glm::all(glm::epsilonEqual(am2[1], eam2[1], epsilon)) + )) ? 0 : 1; + + // mat3 + const glm::mat3 m3( + 2, 3, 3, + 1, 5, 4, + 4, 6, 8 + ); + + const glm::mat3 eam3( + 16, -6, -3, + 8, 4, -5, + -14, 0, 7 + ); + + const glm::mat3 am3 = glm::adjugate(m3); + + Error += glm::all(glm::bvec3( + glm::all(glm::epsilonEqual(am3[0], eam3[0], epsilon)), + glm::all(glm::epsilonEqual(am3[1], eam3[1], epsilon)), + glm::all(glm::epsilonEqual(am3[2], eam3[2], epsilon)) + )) ? 0 : 1; + + // mat4 + const glm::mat4 m4( + 2, 3, 3, 1, + 1, 5, 4, 3, + 4, 6, 8, 5, + -2, -3, -3, 4 + ); + + const glm::mat4 eam4( + 97, -30, -15, 17, + 45, 20, -25, 5, + -91, 0, 35, -21, + 14, 0, 0, 14 + ); + + const glm::mat4 am4 = glm::adjugate(m4); + + Error += glm::all(glm::bvec4( + glm::all(glm::epsilonEqual(am4[0], eam4[0], epsilon)), + glm::all(glm::epsilonEqual(am4[1], eam4[1], epsilon)), + glm::all(glm::epsilonEqual(am4[2], eam4[2], epsilon)), + glm::all(glm::epsilonEqual(am4[3], eam4[3], epsilon)) + )) ? 0 : 1; + + return Error; +} + +int main() +{ + int Error = 0; + + Error += test_adjugate(); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_matrix_query.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_matrix_query.cpp new file mode 100644 index 0000000000000000000000000000000000000000..dfca12be63dfd6bec231397b2b5db7bae9b7796c --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_matrix_query.cpp @@ -0,0 +1,66 @@ +#define GLM_ENABLE_EXPERIMENTAL +#include + +int test_isNull() +{ + int Error(0); + + bool TestA = glm::isNull(glm::mat4(0), 0.00001f); + Error += TestA ? 0 : 1; + + return Error; +} + +int test_isIdentity() +{ + int Error(0); + + { + bool TestA = glm::isIdentity(glm::mat2(1), 0.00001f); + Error += TestA ? 0 : 1; + } + { + bool TestA = glm::isIdentity(glm::mat3(1), 0.00001f); + Error += TestA ? 0 : 1; + } + { + bool TestA = glm::isIdentity(glm::mat4(1), 0.00001f); + Error += TestA ? 0 : 1; + } + + return Error; +} + +int test_isNormalized() +{ + int Error(0); + + bool TestA = glm::isNormalized(glm::mat4(1), 0.00001f); + Error += TestA ? 0 : 1; + + return Error; +} + +int test_isOrthogonal() +{ + int Error(0); + + bool TestA = glm::isOrthogonal(glm::mat4(1), 0.00001f); + Error += TestA ? 0 : 1; + + return Error; +} + +int main() +{ + int Error(0); + + Error += test_isNull(); + Error += test_isIdentity(); + Error += test_isNormalized(); + Error += test_isOrthogonal(); + + return Error; +} + + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_matrix_transform_2d.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_matrix_transform_2d.cpp new file mode 100644 index 0000000000000000000000000000000000000000..1f955cf4148517a8008d152e0c83c6ebb4e5b9ff --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_matrix_transform_2d.cpp @@ -0,0 +1,9 @@ +#define GLM_ENABLE_EXPERIMENTAL +#include + +int main() +{ + int Error(0); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_mixed_product.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_mixed_product.cpp new file mode 100644 index 0000000000000000000000000000000000000000..9bcb638494136fce0a332b760b8b51943fc158e3 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_mixed_product.cpp @@ -0,0 +1,18 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2013-10-25 +// Updated : 2013-10-25 +// Licence : This source is under MIT licence +// File : test/gtx/associated_min_max.cpp +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#include +#include + +int main() +{ + int Error(0); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_norm.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_norm.cpp new file mode 100644 index 0000000000000000000000000000000000000000..077e2f70bde74de123358ef88f8722c619e79927 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_norm.cpp @@ -0,0 +1,81 @@ +#define GLM_ENABLE_EXPERIMENTAL +#include + + +int test_lMaxNorm() +{ + int Error(0); + + { + float norm = glm::lMaxNorm(glm::vec3(-1, -2, -3)); + Error += glm::epsilonEqual(norm, 3.f, 0.00001f) ? 0 : 1; + } + + { + float norm = glm::lMaxNorm(glm::vec3(2, 3, 1)); + Error += glm::epsilonEqual(norm, 3.f, 0.00001f) ? 0 : 1; + } + + return Error; +} + +int test_lxNorm() +{ + int Error(0); + + { + unsigned int depth_1 = 1; + float normA = glm::lxNorm(glm::vec3(2, 3, 1), depth_1); + float normB = glm::l1Norm(glm::vec3(2, 3, 1)); + Error += glm::epsilonEqual(normA, normB, 0.00001f) ? 0 : 1; + Error += glm::epsilonEqual(normA, 6.f, 0.00001f) ? 0 : 1; + } + + { + unsigned int depth_1 = 1; + float normA = glm::lxNorm(glm::vec3(-1, -2, -3), depth_1); + float normB = glm::l1Norm(glm::vec3(-1, -2, -3)); + Error += glm::epsilonEqual(normA, normB, 0.00001f) ? 0 : 1; + Error += glm::epsilonEqual(normA, 6.f, 0.00001f) ? 0 : 1; + } + + { + unsigned int depth_2 = 2; + float normA = glm::lxNorm(glm::vec3(2, 3, 1), depth_2); + float normB = glm::l2Norm(glm::vec3(2, 3, 1)); + Error += glm::epsilonEqual(normA, normB, 0.00001f) ? 0 : 1; + Error += glm::epsilonEqual(normA, 3.741657387f, 0.00001f) ? 0 : 1; + } + + { + unsigned int depth_2 = 2; + float normA = glm::lxNorm(glm::vec3(-1, -2, -3), depth_2); + float normB = glm::l2Norm(glm::vec3(-1, -2, -3)); + Error += glm::epsilonEqual(normA, normB, 0.00001f) ? 0 : 1; + Error += glm::epsilonEqual(normA, 3.741657387f, 0.00001f) ? 0 : 1; + } + + { + unsigned int oddDepth = 3; + float norm = glm::lxNorm(glm::vec3(2, 3, 1), oddDepth); + Error += glm::epsilonEqual(norm, 3.301927249f, 0.00001f) ? 0 : 1; + } + + { + unsigned int oddDepth = 3; + float norm = glm::lxNorm(glm::vec3(-1, -2, -3), oddDepth); + Error += glm::epsilonEqual(norm, 3.301927249f, 0.00001f) ? 0 : 1; + } + + return Error; +} + +int main() +{ + int Error(0); + + Error += test_lMaxNorm(); + Error += test_lxNorm(); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_normal.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_normal.cpp new file mode 100644 index 0000000000000000000000000000000000000000..e83911bac035c5900b6397ee331119dc2a70cf18 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_normal.cpp @@ -0,0 +1,9 @@ +#define GLM_ENABLE_EXPERIMENTAL +#include + +int main() +{ + int Error(0); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_normalize_dot.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_normalize_dot.cpp new file mode 100644 index 0000000000000000000000000000000000000000..929994cc988b31e18e3165b88f39ead1c1dad002 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_normalize_dot.cpp @@ -0,0 +1,9 @@ +#define GLM_ENABLE_EXPERIMENTAL +#include + +int main() +{ + int Error(0); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_number_precision.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_number_precision.cpp new file mode 100644 index 0000000000000000000000000000000000000000..2fff54d133c5b2b539e4c7f4631a6bf584ce830b --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_number_precision.cpp @@ -0,0 +1,9 @@ +#define GLM_ENABLE_EXPERIMENTAL +#include + +int main() +{ + int Error(0); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_optimum_pow.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_optimum_pow.cpp new file mode 100644 index 0000000000000000000000000000000000000000..2ec3832a335186799e0e00662d91a2f0126afe5b --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_optimum_pow.cpp @@ -0,0 +1,9 @@ +#define GLM_ENABLE_EXPERIMENTAL +#include + +int main() +{ + int Error(0); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_orthonormalize.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_orthonormalize.cpp new file mode 100644 index 0000000000000000000000000000000000000000..cee68d7ef5725077da736026819ad74a3ea6946a --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_orthonormalize.cpp @@ -0,0 +1,9 @@ +#define GLM_ENABLE_EXPERIMENTAL +#include + +int main() +{ + int Error(0); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_pca.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_pca.cpp new file mode 100644 index 0000000000000000000000000000000000000000..c8c8216541c2dbeb278bb2ef3ff834310d2f0be8 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_pca.cpp @@ -0,0 +1,724 @@ +#define GLM_ENABLE_EXPERIMENTAL +#include +#include +#include +#include + +#include +#include +#if GLM_HAS_CXX11_STL == 1 +#include +#endif + +template +T myEpsilon(); +template<> +GLM_INLINE GLM_CONSTEXPR float myEpsilon() { return 0.00001f; } +template<> +GLM_INLINE GLM_CONSTEXPR double myEpsilon() { return 0.000001; } + +template +bool vectorEpsilonEqual(glm::vec const& a, glm::vec const& b, T epsilon) +{ + for (int c = 0; c < D; ++c) + if (!glm::epsilonEqual(a[c], b[c], epsilon)) + { + fprintf(stderr, "failing vectorEpsilonEqual: [%d] %lf != %lf (~%lf)\n", + c, + static_cast(a[c]), + static_cast(b[c]), + static_cast(epsilon) + ); + return false; + } + return true; +} + +template +bool matrixEpsilonEqual(glm::mat const& a, glm::mat const& b, T epsilon) +{ + for (int c = 0; c < D; ++c) + for (int r = 0; r < D; ++r) + if (!glm::epsilonEqual(a[c][r], b[c][r], epsilon)) + { + fprintf(stderr, "failing vectorEpsilonEqual: [%d][%d] %lf != %lf (~%lf)\n", + c, r, + static_cast(a[c][r]), + static_cast(b[c][r]), + static_cast(epsilon) + ); + return false; + } + return true; +} + +template +GLM_INLINE bool sameSign(T const& a, T const& b) +{ + return ((a >= 0) && (b >= 0)) || ((a < 0) && (b < 0)); +} + +template +T failReport(T line) +{ + fprintf(stderr, "Failed in line %d\n", static_cast(line)); + return line; +} + +// Test data: 1AGA 'agarose double helix' +// https://www.rcsb.org/structure/1aga +// The fourth coordinate is randomized +namespace _1aga +{ + + // Fills `outTestData` with hard-coded atom positions from 1AGA + // The fourth coordinate is randomized + template + void fillTestData(std::vector& outTestData) + { + // x,y,z coordinates copied from RCSB PDB file of 1AGA + // w coordinate randomized with standard normal distribution + static const double _1aga[] = { + 3.219, -0.637, 19.462, 2.286, + 4.519, 0.024, 18.980, -0.828, + 4.163, 1.425, 18.481, -0.810, + 3.190, 1.341, 17.330, -0.170, + 1.962, 0.991, 18.165, 0.816, + 2.093, 1.952, 19.331, 0.276, + 5.119, -0.701, 17.908, -0.490, + 3.517, 2.147, 19.514, -0.207, + 2.970, 2.609, 16.719, 0.552, + 2.107, -0.398, 18.564, 0.403, + 2.847, 2.618, 15.335, 0.315, + 1.457, 3.124, 14.979, 0.683, + 1.316, 3.291, 13.473, 0.446, + 2.447, 4.155, 12.931, 1.324, + 3.795, 3.614, 13.394, 0.112, + 4.956, 4.494, 12.982, 0.253, + 0.483, 2.217, 15.479, 1.316, + 0.021, 3.962, 13.166, 1.522, + 2.311, 5.497, 13.395, 0.248, + 3.830, 3.522, 14.827, 0.591, + 5.150, 4.461, 11.576, 0.635, + -1.057, 3.106, 13.132, 0.191, + -2.280, 3.902, 12.650, 1.135, + -3.316, 2.893, 12.151, 0.794, + -2.756, 2.092, 11.000, 0.720, + -1.839, 1.204, 11.835, -1.172, + -2.737, 0.837, 13.001, -0.313, + -1.952, 4.784, 11.578, 2.082, + -3.617, 1.972, 13.184, 0.653, + -3.744, 1.267, 10.389, -0.413, + -0.709, 2.024, 12.234, -1.747, + -3.690, 1.156, 9.005, -1.275, + -3.434, -0.300, 8.649, 0.441, + -3.508, -0.506, 7.143, 0.237, + -4.822, 0.042, 6.601, -2.856, + -5.027, 1.480, 7.064, 0.985, + -6.370, 2.045, 6.652, 0.915, + -2.162, -0.690, 9.149, 1.100, + -3.442, -1.963, 6.836, -0.081, + -5.916, -0.747, 7.065, -2.345, + -4.965, 1.556, 8.497, 0.504, + -6.439, 2.230, 5.246, 1.451, + -2.161, -2.469, 6.802, -1.171, + -2.239, -3.925, 6.320, -1.434, + -0.847, -4.318, 5.821, 0.098, + -0.434, -3.433, 4.670, -1.446, + -0.123, -2.195, 5.505, 0.182, + 0.644, -2.789, 6.671, 0.865, + -3.167, -4.083, 5.248, -0.098, + 0.101, -4.119, 6.854, -0.001, + 0.775, -3.876, 4.059, 1.061, + -1.398, -1.625, 5.904, 0.230, + 0.844, -3.774, 2.675, 1.313, + 1.977, -2.824, 2.319, -0.112, + 2.192, -2.785, 0.813, -0.981, + 2.375, -4.197, 0.271, -0.355, + 1.232, -5.093, 0.734, 0.632, + 1.414, -6.539, 0.322, 0.576, + 1.678, -1.527, 2.819, -1.187, + 3.421, -1.999, 0.496, -1.770, + 3.605, -4.750, 0.735, 1.099, + 1.135, -5.078, 2.167, 0.854, + 1.289, -6.691, -1.084, -0.487, + -1.057, 3.106, 22.602, -1.297, + -2.280, 3.902, 22.120, 0.376, + -3.316, 2.893, 21.621, 0.932, + -2.756, 2.092, 20.470, 1.680, + -1.839, 1.204, 21.305, 0.615, + -2.737, 0.837, 22.471, 0.899, + -1.952, 4.784, 21.048, -0.521, + -3.617, 1.972, 22.654, 0.133, + -3.744, 1.267, 19.859, 0.081, + -0.709, 2.024, 21.704, 1.420, + -3.690, 1.156, 18.475, -0.850, + -3.434, -0.300, 18.119, -0.249, + -3.508, -0.506, 16.613, 1.434, + -4.822, 0.042, 16.071, -2.466, + -5.027, 1.480, 16.534, -1.045, + -6.370, 2.045, 16.122, 1.707, + -2.162, -0.690, 18.619, -2.023, + -3.442, -1.963, 16.336, -0.304, + -5.916, -0.747, 16.535, 0.979, + -4.965, 1.556, 17.967, -1.165, + -6.439, 2.230, 14.716, 0.929, + -2.161, -2.469, 16.302, -0.234, + -2.239, -3.925, 15.820, -0.228, + -0.847, -4.318, 15.321, 1.844, + -0.434, -3.433, 14.170, 1.132, + -0.123, -2.195, 15.005, 0.211, + 0.644, -2.789, 16.171, -0.632, + -3.167, -4.083, 14.748, -0.519, + 0.101, -4.119, 16.354, 0.173, + 0.775, -3.876, 13.559, 1.243, + -1.398, -1.625, 15.404, -0.187, + 0.844, -3.774, 12.175, -1.332, + 1.977, -2.824, 11.819, -1.616, + 2.192, -2.785, 10.313, 1.320, + 2.375, -4.197, 9.771, 0.237, + 1.232, -5.093, 10.234, 0.851, + 1.414, -6.539, 9.822, 1.816, + 1.678, -1.527, 12.319, -1.657, + 3.421, -1.999, 10.036, 1.559, + 3.605, -4.750, 10.235, 0.831, + 1.135, -5.078, 11.667, 0.060, + 1.289, -6.691, 8.416, 1.066, + 3.219, -0.637, 10.002, 2.111, + 4.519, 0.024, 9.520, -0.874, + 4.163, 1.425, 9.021, -1.012, + 3.190, 1.341, 7.870, -0.250, + 1.962, 0.991, 8.705, -1.359, + 2.093, 1.952, 9.871, -0.126, + 5.119, -0.701, 8.448, 0.995, + 3.517, 2.147, 10.054, 0.941, + 2.970, 2.609, 7.259, -0.562, + 2.107, -0.398, 9.104, -0.038, + 2.847, 2.618, 5.875, 0.398, + 1.457, 3.124, 5.519, 0.481, + 1.316, 3.291, 4.013, -0.187, + 2.447, 4.155, 3.471, -0.429, + 3.795, 3.614, 3.934, -0.432, + 4.956, 4.494, 3.522, -0.788, + 0.483, 2.217, 6.019, -0.923, + 0.021, 3.962, 3.636, -0.316, + 2.311, 5.497, 3.935, -1.917, + 3.830, 3.522, 5.367, -0.302, + 5.150, 4.461, 2.116, -1.615 + }; + static const glm::length_t _1agaSize = sizeof(_1aga) / (4 * sizeof(double)); + + outTestData.resize(_1agaSize); + for(glm::length_t i = 0; i < _1agaSize; ++i) + for(glm::length_t d = 0; d < static_cast(vec::length()); ++d) + outTestData[i][d] = static_cast(_1aga[i * 4 + d]); + } + + // All reference values computed separately using symbolic precision + // https://github.com/sgrottel/exp-pca-precision + // This applies to all functions named: `_1aga::expected*()` + + GLM_INLINE glm::dmat4 const& expectedCovarData() + { + static const glm::dmat4 covar4x4d( + 9.62434068027210898322, -0.00006657369614512471, -4.29321376568405099761, 0.01879374187452758846, + -0.00006657369614512471, 9.62443937868480681175, 5.35113872637944076871, -0.11569259145880574080, + -4.29321376568405099761, 5.35113872637944076871, 35.62848549634668415820, 0.90874239254220201545, + 0.01879374187452758846, -0.11569259145880574080, 0.90874239254220201545, 1.09705971856890904803 + ); + return covar4x4d; + } + + template + GLM_INLINE glm::vec const& expectedEigenvalues(); + template<> + GLM_INLINE glm::dvec2 const& expectedEigenvalues<2>() + { + static const glm::dvec2 evals2( + 9.62447289926297399961763301774251330057894539467032275382255, + 9.62430715969394210015560961264297422776572580714373620309355 + ); + return evals2; + } + template<> + GLM_INLINE glm::dvec3 const& expectedEigenvalues<3>() + { + static const glm::dvec3 evals3( + 37.3274494274683425233695502581182052836449738530676689472257, + 9.62431434161498823505729817436585077939509766554969096873168, + 7.92550178622027216422369326567668971675332732240052872097887 + ); + return evals3; + } + template<> + GLM_INLINE glm::dvec4 const& expectedEigenvalues<4>() + { + static const glm::dvec4 evals4( + 37.3477389918792213596879452204499702406947817221901007885630, + 9.62470688921105696017807313860277172063600080413412567999700, + 7.94017075281634999342344275928070533134615133171969063657713, + 1.06170863996588365446060186982477896078741484440002343404155 + ); + return evals4; + } + + template + GLM_INLINE glm::mat const& expectedEigenvectors(); + template<> + GLM_INLINE glm::dmat2 const& expectedEigenvectors<2>() + { + static const glm::dmat2 evecs2( + glm::dvec2( + -0.503510847492551904906870957742619139443409162857537237123308, + 1 + ), + glm::dvec2( + 1.98605453086051402895741763848787613048533838388005162794043, + 1 + ) + ); + return evecs2; + } + template<> + GLM_INLINE glm::dmat3 const& expectedEigenvectors<3>() + { + static const glm::dmat3 evecs3( + glm::dvec3( + -0.154972738414395866005286433008304444294405085038689821864654, + 0.193161285869815165989799191097521722568079378840201629578695, + 1 + ), + glm::dvec3( + -158565.112775416943154745839952575022429933119522746586149868, + -127221.506282351944358932458687410410814983610301927832439675, + 1 + ), + glm::dvec3( + 2.52702248596556806145700361724323960543858113426446460406536, + -3.14959802931313870497377546974185300816008580801457419079412, + 1 + ) + ); + return evecs3; + } + template<> + GLM_INLINE glm::dmat4 const& expectedEigenvectors<4>() + { + static const glm::dmat4 evecs4( + glm::dvec4( + -6.35322390281037045217295803597357821705371650876122113027264, + 7.91546394153385394517767054617789939529794642646629201212056, + 41.0301543819240679808549819457450130787045236815736490549663, + 1 + ), + glm::dvec4( + -114.622418941087829756565311692197154422302604224781253861297, + -92.2070185807065289900871215218752013659402949497379896153118, + 0.0155846091025912430932734548933329458404665760587569100867246, + 1 + ), + glm::dvec4( + 13.1771887761559019483954743159026938257325190511642952175789, + -16.3688257459634877666638419310116970616615816436949741766895, + 5.17386502341472097227408249233288958059579189051394773143190, + 1 + ), + glm::dvec4( + -0.0192777078948229800494895064532553117703859768210647632969276, + 0.0348034950916108873629241563077465542944938906271231198634442, + -0.0340715609308469289267379681032545422644143611273049912226126, + 1 + ) + ); + return evecs4; + } + +} // namespace _1aga + +// Compute center of gravity +template +vec computeCenter(const std::vector& testData) +{ + double c[4]; + std::fill(c, c + vec::length(), 0.0); + + typename std::vector::const_iterator e = testData.end(); + for(typename std::vector::const_iterator i = testData.begin(); i != e; ++i) + for(glm::length_t d = 0; d < static_cast(vec::length()); ++d) + c[d] += static_cast((*i)[d]); + + vec cVec(0); + for(glm::length_t d = 0; d < static_cast(vec::length()); ++d) + cVec[d] = static_cast(c[d] / static_cast(testData.size())); + return cVec; +} + +// Test sorting of Eigenvalue&Eigenvector lists. Use exhaustive search. +template +int testEigenvalueSort() +{ + // Test input data: four arbitrary values + static const glm::vec refVal( + glm::vec<4, T, Q>( + 10, 8, 6, 4 + ) + ); + // Test input data: four arbitrary vectors, which can be matched to the above values + static const glm::mat refVec( + glm::mat<4, 4, T, Q>( + 10, 20, 5, 40, + 8, 16, 4, 32, + 6, 12, 3, 24, + 4, 8, 2, 16 + ) + ); + // Permutations of test input data for exhaustive check, based on `D` (1 <= D <= 4) + static const int permutationCount[] = { + 0, + 1, + 2, + 6, + 24 + }; + // The permutations t perform, based on `D` (1 <= D <= 4) + static const glm::ivec4 permutation[] = { + glm::ivec4(0, 1, 2, 3), + glm::ivec4(1, 0, 2, 3), // last for D = 2 + glm::ivec4(0, 2, 1, 3), + glm::ivec4(1, 2, 0, 3), + glm::ivec4(2, 0, 1, 3), + glm::ivec4(2, 1, 0, 3), // last for D = 3 + glm::ivec4(0, 1, 3, 2), + glm::ivec4(1, 0, 3, 2), + glm::ivec4(0, 2, 3, 1), + glm::ivec4(1, 2, 3, 0), + glm::ivec4(2, 0, 3, 1), + glm::ivec4(2, 1, 3, 0), + glm::ivec4(0, 3, 1, 2), + glm::ivec4(1, 3, 0, 2), + glm::ivec4(0, 3, 2, 1), + glm::ivec4(1, 3, 2, 0), + glm::ivec4(2, 3, 0, 1), + glm::ivec4(2, 3, 1, 0), + glm::ivec4(3, 0, 1, 2), + glm::ivec4(3, 1, 0, 2), + glm::ivec4(3, 0, 2, 1), + glm::ivec4(3, 1, 2, 0), + glm::ivec4(3, 2, 0, 1), + glm::ivec4(3, 2, 1, 0) // last for D = 4 + }; + + // initial sanity check + if(!vectorEpsilonEqual(refVal, refVal, myEpsilon())) + return failReport(__LINE__); + if(!matrixEpsilonEqual(refVec, refVec, myEpsilon())) + return failReport(__LINE__); + + // Exhaustive search through all permutations + for(int p = 0; p < permutationCount[D]; ++p) + { + glm::vec testVal; + glm::mat testVec; + for(int i = 0; i < D; ++i) + { + testVal[i] = refVal[permutation[p][i]]; + testVec[i] = refVec[permutation[p][i]]; + } + + glm::sortEigenvalues(testVal, testVec); + + if (!vectorEpsilonEqual(testVal, refVal, myEpsilon())) + return failReport(__LINE__); + if (!matrixEpsilonEqual(testVec, refVec, myEpsilon())) + return failReport(__LINE__); + } + + return 0; +} + +// Test covariance matrix creation functions +template +int testCovar( +#if GLM_HAS_CXX11_STL == 1 + glm::length_t dataSize, unsigned int randomEngineSeed +#else // GLM_HAS_CXX11_STL == 1 + glm::length_t, unsigned int +#endif // GLM_HAS_CXX11_STL == 1 +) +{ + typedef glm::vec vec; + typedef glm::mat mat; + + // #1: test expected result with fixed data set + std::vector testData; + _1aga::fillTestData(testData); + + // compute center of gravity + vec center = computeCenter(testData); + + mat covarMat = glm::computeCovarianceMatrix(testData.data(), testData.size(), center); + if(!matrixEpsilonEqual(covarMat, mat(_1aga::expectedCovarData()), myEpsilon())) + { + fprintf(stderr, "Reconstructed covarMat:\n%s\n", glm::to_string(covarMat).c_str()); + return failReport(__LINE__); + } + + // #2: test function variant consitency with random data +#if GLM_HAS_CXX11_STL == 1 + std::default_random_engine rndEng(randomEngineSeed); + std::normal_distribution normalDist; + testData.resize(dataSize); + // some common offset of all data + T offset[D]; + for(glm::length_t d = 0; d < D; ++d) + offset[d] = normalDist(rndEng); + // init data + for(glm::length_t i = 0; i < dataSize; ++i) + for(glm::length_t d = 0; d < D; ++d) + testData[i][d] = offset[d] + normalDist(rndEng); + center = computeCenter(testData); + + std::vector centeredTestData; + centeredTestData.reserve(testData.size()); + typename std::vector::const_iterator e = testData.end(); + for(typename std::vector::const_iterator i = testData.begin(); i != e; ++i) + centeredTestData.push_back((*i) - center); + + mat c1 = glm::computeCovarianceMatrix(centeredTestData.data(), centeredTestData.size()); + mat c2 = glm::computeCovarianceMatrix(centeredTestData.begin(), centeredTestData.end()); + mat c3 = glm::computeCovarianceMatrix(testData.data(), testData.size(), center); + mat c4 = glm::computeCovarianceMatrix(testData.rbegin(), testData.rend(), center); + + if(!matrixEpsilonEqual(c1, c2, myEpsilon())) + return failReport(__LINE__); + if(!matrixEpsilonEqual(c1, c3, myEpsilon())) + return failReport(__LINE__); + if(!matrixEpsilonEqual(c1, c4, myEpsilon())) + return failReport(__LINE__); +#endif // GLM_HAS_CXX11_STL == 1 + return 0; +} + +// Computes eigenvalues and eigenvectors from well-known covariance matrix +template +int testEigenvectors(T epsilon) +{ + typedef glm::vec vec; + typedef glm::mat mat; + + // test expected result with fixed data set + std::vector testData; + mat covarMat(_1aga::expectedCovarData()); + + vec eigenvalues; + mat eigenvectors; + unsigned int c = glm::findEigenvaluesSymReal(covarMat, eigenvalues, eigenvectors); + if(c != D) + return failReport(__LINE__); + glm::sortEigenvalues(eigenvalues, eigenvectors); + + if (!vectorEpsilonEqual(eigenvalues, vec(_1aga::expectedEigenvalues()), epsilon)) + return failReport(__LINE__); + + for (int i = 0; i < D; ++i) + { + vec act = glm::normalize(eigenvectors[i]); + vec exp = glm::normalize(_1aga::expectedEigenvectors()[i]); + if (!sameSign(act[0], exp[0])) exp = -exp; + if (!vectorEpsilonEqual(act, exp, epsilon)) + return failReport(__LINE__); + } + + return 0; +} + +// A simple small smoke test: +// - a uniformly sampled block +// - reconstruct main axes +// - check order of eigenvalues equals order of extends of block in direction of main axes +int smokeTest() +{ + using glm::vec3; + using glm::mat3; + std::vector pts; + pts.reserve(11 * 15 * 7); + + for(int x = -5; x <= 5; ++x) + for(int y = -7; y <= 7; ++y) + for(int z = -3; z <= 3; ++z) + pts.push_back(vec3(x, y, z)); + + mat3 covar = glm::computeCovarianceMatrix(pts.data(), pts.size()); + mat3 eVec; + vec3 eVal; + int eCnt = glm::findEigenvaluesSymReal(covar, eVal, eVec); + if(eCnt != 3) + return failReport(__LINE__); + + // sort eVec by decending eVal + if(eVal[0] < eVal[1]) + { + std::swap(eVal[0], eVal[1]); + std::swap(eVec[0], eVec[1]); + } + if(eVal[0] < eVal[2]) + { + std::swap(eVal[0], eVal[2]); + std::swap(eVec[0], eVec[2]); + } + if(eVal[1] < eVal[2]) + { + std::swap(eVal[1], eVal[2]); + std::swap(eVec[1], eVec[2]); + } + + if(!vectorEpsilonEqual(glm::abs(eVec[0]), vec3(0, 1, 0), myEpsilon())) + return failReport(__LINE__); + if(!vectorEpsilonEqual(glm::abs(eVec[1]), vec3(1, 0, 0), myEpsilon())) + return failReport(__LINE__); + if(!vectorEpsilonEqual(glm::abs(eVec[2]), vec3(0, 0, 1), myEpsilon())) + return failReport(__LINE__); + + return 0; +} + +#if GLM_HAS_CXX11_STL == 1 +int rndTest(unsigned int randomEngineSeed) +{ + std::default_random_engine rndEng(randomEngineSeed); + std::normal_distribution normalDist; + + // construct orthonormal system + glm::dvec3 x(normalDist(rndEng), normalDist(rndEng), normalDist(rndEng)); + double l = glm::length(x); + while(l < myEpsilon()) + x = glm::dvec3(normalDist(rndEng), normalDist(rndEng), normalDist(rndEng)); + x = glm::normalize(x); + glm::dvec3 y(normalDist(rndEng), normalDist(rndEng), normalDist(rndEng)); + l = glm::length(y); + while(l < myEpsilon()) + y = glm::dvec3(normalDist(rndEng), normalDist(rndEng), normalDist(rndEng)); + while(glm::abs(glm::dot(x, y)) < myEpsilon()) + { + y = glm::dvec3(normalDist(rndEng), normalDist(rndEng), normalDist(rndEng)); + while(l < myEpsilon()) + y = glm::dvec3(normalDist(rndEng), normalDist(rndEng), normalDist(rndEng)); + } + y = glm::normalize(y); + glm::dvec3 z = glm::normalize(glm::cross(x, y)); + y = glm::normalize(glm::cross(z, x)); + + // generate input point data + std::vector ptData; + static const int pattern[] = { + 8, 0, 0, + 4, 1, 2, + 0, 2, 0, + 0, 0, 4 + }; + glm::dvec3 offset(normalDist(rndEng), normalDist(rndEng), normalDist(rndEng)); + for(int p = 0; p < 4; ++p) + for(int xs = 1; xs >= -1; xs -= 2) + for(int ys = 1; ys >= -1; ys -= 2) + for(int zs = 1; zs >= -1; zs -= 2) + ptData.push_back( + offset + + x * static_cast(pattern[p * 3 + 0] * xs) + + y * static_cast(pattern[p * 3 + 1] * ys) + + z * static_cast(pattern[p * 3 + 2] * zs)); + + // perform PCA: + glm::dvec3 center = computeCenter(ptData); + glm::dmat3 covarMat = glm::computeCovarianceMatrix(ptData.data(), ptData.size(), center); + glm::dvec3 evals; + glm::dmat3 evecs; + int evcnt = glm::findEigenvaluesSymReal(covarMat, evals, evecs); + if(evcnt != 3) + return failReport(__LINE__); + glm::sortEigenvalues(evals, evecs); + + if (!sameSign(evecs[0][0], x[0])) evecs[0] = -evecs[0]; + if(!vectorEpsilonEqual(x, evecs[0], myEpsilon())) + return failReport(__LINE__); + if (!sameSign(evecs[2][0], y[0])) evecs[2] = -evecs[2]; + if (!vectorEpsilonEqual(y, evecs[2], myEpsilon())) + return failReport(__LINE__); + if (!sameSign(evecs[1][0], z[0])) evecs[1] = -evecs[1]; + if (!vectorEpsilonEqual(z, evecs[1], myEpsilon())) + return failReport(__LINE__); + + return 0; +} +#endif // GLM_HAS_CXX11_STL == 1 + +int main() +{ + int error(0); + + // A small smoke test to fail early with most problems + if(smokeTest()) + return failReport(__LINE__); + + // test sorting utility. + if(testEigenvalueSort<2, float, glm::defaultp>() != 0) + error = failReport(__LINE__); + if(testEigenvalueSort<2, double, glm::defaultp>() != 0) + error = failReport(__LINE__); + if(testEigenvalueSort<3, float, glm::defaultp>() != 0) + error = failReport(__LINE__); + if(testEigenvalueSort<3, double, glm::defaultp>() != 0) + error = failReport(__LINE__); + if(testEigenvalueSort<4, float, glm::defaultp>() != 0) + error = failReport(__LINE__); + if(testEigenvalueSort<4, double, glm::defaultp>() != 0) + error = failReport(__LINE__); + if (error != 0) + return error; + + // Note: the random engine uses a fixed seed to create consistent and reproducible test data + // test covariance matrix computation from different data sources + if(testCovar<2, float, glm::defaultp>(100, 12345) != 0) + error = failReport(__LINE__); + if(testCovar<2, double, glm::defaultp>(100, 42) != 0) + error = failReport(__LINE__); + if(testCovar<3, float, glm::defaultp>(100, 2021) != 0) + error = failReport(__LINE__); + if(testCovar<3, double, glm::defaultp>(100, 815) != 0) + error = failReport(__LINE__); + if(testCovar<4, float, glm::defaultp>(100, 3141) != 0) + error = failReport(__LINE__); + if(testCovar<4, double, glm::defaultp>(100, 174) != 0) + error = failReport(__LINE__); + if (error != 0) + return error; + + // test PCA eigen vector reconstruction + // Expected epsilon precision evaluated separately: + // https://github.com/sgrottel/exp-pca-precision + if(testEigenvectors<2, float, glm::defaultp>(0.002f) != 0) + error = failReport(__LINE__); + if(testEigenvectors<2, double, glm::defaultp>(0.00000000001) != 0) + error = failReport(__LINE__); + if(testEigenvectors<3, float, glm::defaultp>(0.00001f) != 0) + error = failReport(__LINE__); + if(testEigenvectors<3, double, glm::defaultp>(0.0000000001) != 0) + error = failReport(__LINE__); + if(testEigenvectors<4, float, glm::defaultp>(0.0001f) != 0) + error = failReport(__LINE__); + if(testEigenvectors<4, double, glm::defaultp>(0.0000001) != 0) + error = failReport(__LINE__); + if(error != 0) + return error; + + // Final tests with randomized data +#if GLM_HAS_CXX11_STL == 1 + if(rndTest(12345) != 0) + error = failReport(__LINE__); + if(rndTest(42) != 0) + error = failReport(__LINE__); + if (error != 0) + return error; +#endif // GLM_HAS_CXX11_STL == 1 + + return error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_perpendicular.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_perpendicular.cpp new file mode 100644 index 0000000000000000000000000000000000000000..5cb86fe907eec154742675cd29bd7b8982d6a645 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_perpendicular.cpp @@ -0,0 +1,9 @@ +#define GLM_ENABLE_EXPERIMENTAL +#include + +int main() +{ + int Error(0); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_polar_coordinates.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_polar_coordinates.cpp new file mode 100644 index 0000000000000000000000000000000000000000..1d327cb1e672f5e6c325ac48c621a90a525cec96 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_polar_coordinates.cpp @@ -0,0 +1,9 @@ +#define GLM_ENABLE_EXPERIMENTAL +#include + +int main() +{ + int Error(0); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_projection.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_projection.cpp new file mode 100644 index 0000000000000000000000000000000000000000..8f60faef78825805b42da6fbd23bd8798bace6ba --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_projection.cpp @@ -0,0 +1,9 @@ +#define GLM_ENABLE_EXPERIMENTAL +#include + +int main() +{ + int Error(0); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_quaternion.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_quaternion.cpp new file mode 100644 index 0000000000000000000000000000000000000000..f86a16a0637eda4ba537c794ece66d42f90e95cd --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_quaternion.cpp @@ -0,0 +1,107 @@ +#define GLM_ENABLE_EXPERIMENTAL +#include +#include +#include +#include +#include +#include +#include + +int test_quat_fastMix() +{ + int Error = 0; + + glm::quat A = glm::angleAxis(0.0f, glm::vec3(0, 0, 1)); + glm::quat B = glm::angleAxis(glm::pi() * 0.5f, glm::vec3(0, 0, 1)); + glm::quat C = glm::fastMix(A, B, 0.5f); + glm::quat D = glm::angleAxis(glm::pi() * 0.25f, glm::vec3(0, 0, 1)); + + Error += glm::epsilonEqual(C.x, D.x, 0.01f) ? 0 : 1; + Error += glm::epsilonEqual(C.y, D.y, 0.01f) ? 0 : 1; + Error += glm::epsilonEqual(C.z, D.z, 0.01f) ? 0 : 1; + Error += glm::epsilonEqual(C.w, D.w, 0.01f) ? 0 : 1; + + return Error; +} + +int test_quat_shortMix() +{ + int Error(0); + + glm::quat A = glm::angleAxis(0.0f, glm::vec3(0, 0, 1)); + glm::quat B = glm::angleAxis(glm::pi() * 0.5f, glm::vec3(0, 0, 1)); + glm::quat C = glm::shortMix(A, B, 0.5f); + glm::quat D = glm::angleAxis(glm::pi() * 0.25f, glm::vec3(0, 0, 1)); + + Error += glm::epsilonEqual(C.x, D.x, 0.01f) ? 0 : 1; + Error += glm::epsilonEqual(C.y, D.y, 0.01f) ? 0 : 1; + Error += glm::epsilonEqual(C.z, D.z, 0.01f) ? 0 : 1; + Error += glm::epsilonEqual(C.w, D.w, 0.01f) ? 0 : 1; + + return Error; +} + +int test_orientation() +{ + int Error = 0; + + { + glm::quat q(1.0f, 0.0f, 0.0f, 1.0f); + float p = glm::roll(q); + Error += glm::epsilonEqual(p, glm::pi() * 0.5f, 0.0001f) ? 0 : 1; + } + + { + glm::quat q(1.0f, 0.0f, 0.0f, 1.0f); + float p = glm::pitch(q); + Error += glm::epsilonEqual(p, 0.f, 0.0001f) ? 0 : 1; + } + + { + glm::quat q(1.0f, 0.0f, 0.0f, 1.0f); + float p = glm::yaw(q); + Error += glm::epsilonEqual(p, 0.f, 0.0001f) ? 0 : 1; + } + + return Error; +} + +int test_rotation() +{ + int Error(0); + + glm::vec3 v(1, 0, 0); + glm::vec3 u(0, 1, 0); + + glm::quat Rotation = glm::rotation(v, u); + + float Angle = glm::angle(Rotation); + + Error += glm::abs(Angle - glm::pi() * 0.5f) < glm::epsilon() ? 0 : 1; + + return Error; +} + +int test_log() +{ + int Error(0); + + glm::quat q; + glm::quat p = glm::log(q); + glm::quat r = glm::exp(p); + + return Error; +} + +int main() +{ + int Error = 0; + + Error += test_log(); + Error += test_rotation(); + Error += test_orientation(); + Error += test_quat_fastMix(); + Error += test_quat_shortMix(); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_random.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_random.cpp new file mode 100644 index 0000000000000000000000000000000000000000..5e88f181afcc32f5b911b60c19d25bc7f623b579 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_random.cpp @@ -0,0 +1,99 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////// +// OpenGL Mathematics Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Created : 2011-05-31 +// Updated : 2011-05-31 +// Licence : This source is under MIT licence +// File : test/gtx/random.cpp +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#include +#include +#include +#include + +int test_signedRand1() +{ + int Error = 0; + + { + float ResultFloat = 0.0f; + double ResultDouble = 0.0f; + for(std::size_t i = 0; i < 100000; ++i) + { + ResultFloat += glm::signedRand1(); + ResultDouble += glm::signedRand1(); + } + + Error += glm::equalEpsilon(ResultFloat, 0.0f, 0.0001f); + Error += glm::equalEpsilon(ResultDouble, 0.0, 0.0001); + } + + return Error; +} + +int test_normalizedRand2() +{ + int Error = 0; + + { + std::size_t Max = 100000; + float ResultFloat = 0.0f; + double ResultDouble = 0.0f; + for(std::size_t i = 0; i < Max; ++i) + { + ResultFloat += glm::length(glm::normalizedRand2()); + ResultDouble += glm::length(glm::normalizedRand2()); + } + + Error += glm::equalEpsilon(ResultFloat, float(Max), 0.000001f) ? 0 : 1; + Error += glm::equalEpsilon(ResultDouble, double(Max), 0.000001) ? 0 : 1; + assert(!Error); + } + + return Error; +} + +int test_normalizedRand3() +{ + int Error = 0; + + { + std::size_t Max = 100000; + float ResultFloatA = 0.0f; + float ResultFloatB = 0.0f; + float ResultFloatC = 0.0f; + double ResultDoubleA = 0.0f; + double ResultDoubleB = 0.0f; + double ResultDoubleC = 0.0f; + for(std::size_t i = 0; i < Max; ++i) + { + ResultFloatA += glm::length(glm::normalizedRand3()); + ResultDoubleA += glm::length(glm::normalizedRand3()); + ResultFloatB += glm::length(glm::normalizedRand3(2.0f, 2.0f)); + ResultDoubleB += glm::length(glm::normalizedRand3(2.0, 2.0)); + ResultFloatC += glm::length(glm::normalizedRand3(1.0f, 3.0f)); + ResultDoubleC += glm::length(glm::normalizedRand3(1.0, 3.0)); + } + + Error += glm::equalEpsilon(ResultFloatA, float(Max), 0.0001f) ? 0 : 1; + Error += glm::equalEpsilon(ResultDoubleA, double(Max), 0.0001) ? 0 : 1; + Error += glm::equalEpsilon(ResultFloatB, float(Max * 2), 0.0001f) ? 0 : 1; + Error += glm::equalEpsilon(ResultDoubleB, double(Max * 2), 0.0001) ? 0 : 1; + Error += (ResultFloatC >= float(Max) && ResultFloatC <= float(Max * 3)) ? 0 : 1; + Error += (ResultDoubleC >= double(Max) && ResultDoubleC <= double(Max * 3)) ? 0 : 1; + } + + return Error; +} + +int main() +{ + int Error = 0; + + Error += test_signedRand1(); + Error += test_normalizedRand2(); + Error += test_normalizedRand3(); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_range.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_range.cpp new file mode 100644 index 0000000000000000000000000000000000000000..4ec73fec073230aaa5c45218ef1546fdbc32672d --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_range.cpp @@ -0,0 +1,83 @@ +#define GLM_ENABLE_EXPERIMENTAL +#include +#include +#include +#include + +#if GLM_HAS_RANGE_FOR + +#include + +int test_vec() +{ + int Error = 0; + + { + glm::ivec3 const v(1, 2, 3); + + int count = 0; + glm::ivec3 Result(0); + for(int x : v) + { + Result[count] = x; + count++; + } + Error += count == 3 ? 0 : 1; + Error += v == Result ? 0 : 1; + } + + { + glm::ivec3 v(1, 2, 3); + for(int& x : v) + x = 0; + Error += glm::all(glm::equal(v, glm::ivec3(0))) ? 0 : 1; + } + + return Error; +} + +int test_mat() +{ + int Error = 0; + + { + glm::mat4x3 m(1.0f); + + int count = 0; + float Sum = 0.0f; + for(float x : m) + { + count++; + Sum += x; + } + Error += count == 12 ? 0 : 1; + Error += glm::equal(Sum, 3.0f, 0.001f) ? 0 : 1; + } + + { + glm::mat4x3 m(1.0f); + + for (float& x : m) { x = 0; } + glm::vec4 v(1, 1, 1, 1); + Error += glm::all(glm::equal(m*v, glm::vec3(0, 0, 0), glm::epsilon())) ? 0 : 1; + } + + return Error; +} + +int main() +{ + int Error = 0; + Error += test_vec(); + Error += test_mat(); + return Error; +} + +#else + +int main() +{ + return 0; +} + +#endif//GLM_HAS_RANGE_FOR diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_rotate_normalized_axis.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_rotate_normalized_axis.cpp new file mode 100644 index 0000000000000000000000000000000000000000..785f61174a1dd53156549a180948189fda64d746 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_rotate_normalized_axis.cpp @@ -0,0 +1,9 @@ +#define GLM_ENABLE_EXPERIMENTAL +#include + +int main() +{ + int Error(0); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_rotate_vector.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_rotate_vector.cpp new file mode 100644 index 0000000000000000000000000000000000000000..9fe81b3c93cdf9bc0ceeca82c9f9fea0803731ca --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_rotate_vector.cpp @@ -0,0 +1,77 @@ +#define GLM_ENABLE_EXPERIMENTAL +#include +#include +#include + +int test_rotate() +{ + int Error = 0; + + glm::vec2 A = glm::rotate(glm::vec2(1, 0), glm::pi() * 0.5f); + glm::vec3 B = glm::rotate(glm::vec3(1, 0, 0), glm::pi() * 0.5f, glm::vec3(0, 0, 1)); + glm::vec4 C = glm::rotate(glm::vec4(1, 0, 0, 1), glm::pi() * 0.5f, glm::vec3(0, 0, 1)); + glm::vec3 D = glm::rotateX(glm::vec3(1, 0, 0), glm::pi() * 0.5f); + glm::vec4 E = glm::rotateX(glm::vec4(1, 0, 0, 1), glm::pi() * 0.5f); + glm::vec3 F = glm::rotateY(glm::vec3(1, 0, 0), glm::pi() * 0.5f); + glm::vec4 G = glm::rotateY(glm::vec4(1, 0, 0, 1), glm::pi() * 0.5f); + glm::vec3 H = glm::rotateZ(glm::vec3(1, 0, 0), glm::pi() * 0.5f); + glm::vec4 I = glm::rotateZ(glm::vec4(1, 0, 0,1 ), glm::pi() * 0.5f); + glm::mat4 O = glm::orientation(glm::normalize(glm::vec3(1)), glm::vec3(0, 0, 1)); + + return Error; +} + +int test_rotateX() +{ + int Error = 0; + + glm::vec3 D = glm::rotateX(glm::vec3(1, 0, 0), glm::pi() * 0.5f); + glm::vec4 E = glm::rotateX(glm::vec4(1, 0, 0, 1), glm::pi() * 0.5f); + + return Error; +} + +int test_rotateY() +{ + int Error = 0; + + glm::vec3 F = glm::rotateY(glm::vec3(1, 0, 0), glm::pi() * 0.5f); + glm::vec4 G = glm::rotateY(glm::vec4(1, 0, 0, 1), glm::pi() * 0.5f); + + return Error; +} + + +int test_rotateZ() +{ + int Error = 0; + + glm::vec3 H = glm::rotateZ(glm::vec3(1, 0, 0), glm::pi() * 0.5f); + glm::vec4 I = glm::rotateZ(glm::vec4(1, 0, 0,1 ), glm::pi() * 0.5f); + + return Error; +} + +int test_orientation() +{ + int Error = 0; + + glm::mat4 O = glm::orientation(glm::normalize(glm::vec3(1)), glm::vec3(0, 0, 1)); + + return Error; +} + +int main() +{ + int Error = 0; + + Error += test_rotate(); + Error += test_rotateX(); + Error += test_rotateY(); + Error += test_rotateZ(); + Error += test_orientation(); + + return Error; +} + + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_scalar_multiplication.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_scalar_multiplication.cpp new file mode 100644 index 0000000000000000000000000000000000000000..8f60d572be2d55752582685736564dc83951e8d4 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_scalar_multiplication.cpp @@ -0,0 +1,37 @@ +#define GLM_ENABLE_EXPERIMENTAL +#include +#include +#include + +#if GLM_HAS_TEMPLATE_ALIASES && !(GLM_COMPILER & GLM_COMPILER_GCC) +#include + +int main() +{ + int Error(0); + glm::vec3 v(0.5, 3.1, -9.1); + + Error += glm::all(glm::equal(v, 1.0 * v, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(v, 1 * v, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(v, 1u * v, glm::epsilon())) ? 0 : 1; + + glm::mat3 m(1, 2, 3, 4, 5, 6, 7, 8, 9); + glm::vec3 w = 0.5f * m * v; + + Error += glm::all(glm::equal((m*v)/2, w, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(m*(v/2), w, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal((m/2)*v, w, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal((0.5*m)*v, w, glm::epsilon())) ? 0 : 1; + Error += glm::all(glm::equal(0.5*(m*v), w, glm::epsilon())) ? 0 : 1; + + return Error; +} + +#else + +int main() +{ + return 0; +} + +#endif diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_scalar_relational.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_scalar_relational.cpp new file mode 100644 index 0000000000000000000000000000000000000000..0e230ba13cfd99078264d43dfc1201dc628741fe --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_scalar_relational.cpp @@ -0,0 +1,174 @@ +#define GLM_ENABLE_EXPERIMENTAL +#include +#include +#include +#include +#include +#include + +static int test_lessThan() +{ + int Error = 0; + + Error += glm::lessThan(0, 1) ? 0 : 1; + Error += glm::lessThan(1, 0) ? 1 : 0; + Error += glm::lessThan(0, 0) ? 1 : 0; + Error += glm::lessThan(1, 1) ? 1 : 0; + Error += glm::lessThan(0.0f, 1.0f) ? 0 : 1; + Error += glm::lessThan(1.0f, 0.0f) ? 1 : 0; + Error += glm::lessThan(0.0f, 0.0f) ? 1 : 0; + Error += glm::lessThan(1.0f, 1.0f) ? 1 : 0; + Error += glm::lessThan(0.0, 1.0) ? 0 : 1; + Error += glm::lessThan(1.0, 0.0) ? 1 : 0; + Error += glm::lessThan(0.0, 0.0) ? 1 : 0; + Error += glm::lessThan(1.0, 1.0) ? 1 : 0; + + return Error; +} + +static int test_lessThanEqual() +{ + int Error = 0; + + Error += glm::lessThanEqual(0, 1) ? 0 : 1; + Error += glm::lessThanEqual(1, 0) ? 1 : 0; + Error += glm::lessThanEqual(0, 0) ? 0 : 1; + Error += glm::lessThanEqual(1, 1) ? 0 : 1; + Error += glm::lessThanEqual(0.0f, 1.0f) ? 0 : 1; + Error += glm::lessThanEqual(1.0f, 0.0f) ? 1 : 0; + Error += glm::lessThanEqual(0.0f, 0.0f) ? 0 : 1; + Error += glm::lessThanEqual(1.0f, 1.0f) ? 0 : 1; + Error += glm::lessThanEqual(0.0, 1.0) ? 0 : 1; + Error += glm::lessThanEqual(1.0, 0.0) ? 1 : 0; + Error += glm::lessThanEqual(0.0, 0.0) ? 0 : 1; + Error += glm::lessThanEqual(1.0, 1.0) ? 0 : 1; + + return Error; +} + +static int test_greaterThan() +{ + int Error = 0; + + Error += glm::greaterThan(0, 1) ? 1 : 0; + Error += glm::greaterThan(1, 0) ? 0 : 1; + Error += glm::greaterThan(0, 0) ? 1 : 0; + Error += glm::greaterThan(1, 1) ? 1 : 0; + Error += glm::greaterThan(0.0f, 1.0f) ? 1 : 0; + Error += glm::greaterThan(1.0f, 0.0f) ? 0 : 1; + Error += glm::greaterThan(0.0f, 0.0f) ? 1 : 0; + Error += glm::greaterThan(1.0f, 1.0f) ? 1 : 0; + Error += glm::greaterThan(0.0, 1.0) ? 1 : 0; + Error += glm::greaterThan(1.0, 0.0) ? 0 : 1; + Error += glm::greaterThan(0.0, 0.0) ? 1 : 0; + Error += glm::greaterThan(1.0, 1.0) ? 1 : 0; + + return Error; +} + +static int test_greaterThanEqual() +{ + int Error = 0; + + Error += glm::greaterThanEqual(0, 1) ? 1 : 0; + Error += glm::greaterThanEqual(1, 0) ? 0 : 1; + Error += glm::greaterThanEqual(0, 0) ? 0 : 1; + Error += glm::greaterThanEqual(1, 1) ? 0 : 1; + Error += glm::greaterThanEqual(0.0f, 1.0f) ? 1 : 0; + Error += glm::greaterThanEqual(1.0f, 0.0f) ? 0 : 1; + Error += glm::greaterThanEqual(0.0f, 0.0f) ? 0 : 1; + Error += glm::greaterThanEqual(1.0f, 1.0f) ? 0 : 1; + Error += glm::greaterThanEqual(0.0, 1.0) ? 1 : 0; + Error += glm::greaterThanEqual(1.0, 0.0) ? 0 : 1; + Error += glm::greaterThanEqual(0.0, 0.0) ? 0 : 1; + Error += glm::greaterThanEqual(1.0, 1.0) ? 0 : 1; + + return Error; +} + +static int test_equal() +{ + int Error = 0; + + Error += glm::equal(0, 1) ? 1 : 0; + Error += glm::equal(1, 0) ? 1 : 0; + Error += glm::equal(0, 0) ? 0 : 1; + Error += glm::equal(1, 1) ? 0 : 1; + Error += glm::equal(0.0f, 1.0f, glm::epsilon()) ? 1 : 0; + Error += glm::equal(1.0f, 0.0f, glm::epsilon()) ? 1 : 0; + Error += glm::equal(0.0f, 0.0f, glm::epsilon()) ? 0 : 1; + Error += glm::equal(1.0f, 1.0f, glm::epsilon()) ? 0 : 1; + Error += glm::equal(0.0, 1.0, glm::epsilon()) ? 1 : 0; + Error += glm::equal(1.0, 0.0, glm::epsilon()) ? 1 : 0; + Error += glm::equal(0.0, 0.0, glm::epsilon()) ? 0 : 1; + Error += glm::equal(1.0, 1.0, glm::epsilon()) ? 0 : 1; + + return Error; +} + +static int test_notEqual() +{ + int Error = 0; + + Error += glm::notEqual(0, 1) ? 0 : 1; + Error += glm::notEqual(1, 0) ? 0 : 1; + Error += glm::notEqual(0, 0) ? 1 : 0; + Error += glm::notEqual(1, 1) ? 1 : 0; + Error += glm::notEqual(0.0f, 1.0f, glm::epsilon()) ? 0 : 1; + Error += glm::notEqual(1.0f, 0.0f, glm::epsilon()) ? 0 : 1; + Error += glm::notEqual(0.0f, 0.0f, glm::epsilon()) ? 1 : 0; + Error += glm::notEqual(1.0f, 1.0f, glm::epsilon()) ? 1 : 0; + Error += glm::notEqual(0.0, 1.0, glm::epsilon()) ? 0 : 1; + Error += glm::notEqual(1.0, 0.0, glm::epsilon()) ? 0 : 1; + Error += glm::notEqual(0.0, 0.0, glm::epsilon()) ? 1 : 0; + Error += glm::notEqual(1.0, 1.0, glm::epsilon()) ? 1 : 0; + + return Error; +} + +static int test_any() +{ + int Error = 0; + + Error += glm::any(true) ? 0 : 1; + Error += glm::any(false) ? 1 : 0; + + return Error; +} + +static int test_all() +{ + int Error = 0; + + Error += glm::all(true) ? 0 : 1; + Error += glm::all(false) ? 1 : 0; + + return Error; +} + +static int test_not() +{ + int Error = 0; + + Error += glm::not_(true) ? 1 : 0; + Error += glm::not_(false) ? 0 : 1; + + return Error; +} + +int main() +{ + int Error = 0; + + Error += test_lessThan(); + Error += test_lessThanEqual(); + Error += test_greaterThan(); + Error += test_greaterThanEqual(); + Error += test_equal(); + Error += test_notEqual(); + Error += test_any(); + Error += test_all(); + Error += test_not(); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_simd_mat4.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_simd_mat4.cpp new file mode 100644 index 0000000000000000000000000000000000000000..6af5d976a065e670a03c72f5d88b5e8ebb8cedca --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_simd_mat4.cpp @@ -0,0 +1,324 @@ +/////////////////////////////////////////////////////////////////////////////////// +/// OpenGL Mathematics (glm.g-truc.net) +/// +/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) +/// Permission is hereby granted, free of charge, to any person obtaining a copy +/// of this software and associated documentation files (the "Software"), to deal +/// in the Software without restriction, including without limitation the rights +/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +/// copies of the Software, and to permit persons to whom the Software is +/// furnished to do so, subject to the following conditions: +/// +/// The above copyright notice and this permission notice shall be included in +/// all copies or substantial portions of the Software. +/// +/// Restrictions: +/// By making use of the Software for military purposes, you choose to make +/// a Bunny unhappy. +/// +/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +/// THE SOFTWARE. +/// +/// @file test/gtx/gtx_simd_mat4.cpp +/// @date 2010-09-16 / 2014-11-25 +/// @author Christophe Riccio +/////////////////////////////////////////////////////////////////////////////////// + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#if(GLM_ARCH != GLM_ARCH_PURE) + +std::vector test_detA(std::vector const & Data) +{ + std::vector Test(Data.size()); + + std::clock_t TimeStart = clock(); + + for(std::size_t i = 0; i < Test.size() - 1; ++i) + Test[i] = glm::determinant(Data[i]); + + std::clock_t TimeEnd = clock(); + printf("Det A: %ld\n", TimeEnd - TimeStart); + + return Test; +} + +std::vector test_detB(std::vector const & Data) +{ + std::vector Test(Data.size()); + + std::clock_t TimeStart = clock(); + + for(std::size_t i = 0; i < Test.size() - 1; ++i) + { + _mm_prefetch((char*)&Data[i + 1], _MM_HINT_T0); + glm::simdMat4 m(Data[i]); + glm::simdVec4 d(glm::detail::sse_slow_det_ps((__m128 const * const)&m)); + glm::vec4 v;//(d); + Test[i] = v.x; + } + + std::clock_t TimeEnd = clock(); + printf("Det B: %ld\n", TimeEnd - TimeStart); + + return Test; +} + +std::vector test_detC(std::vector const & Data) +{ + std::vector Test(Data.size()); + + std::clock_t TimeStart = clock(); + + for(std::size_t i = 0; i < Test.size() - 1; ++i) + { + _mm_prefetch((char*)&Data[i + 1], _MM_HINT_T0); + glm::simdMat4 m(Data[i]); + glm::simdVec4 d(glm::detail::sse_det_ps((__m128 const * const)&m)); + glm::vec4 v;//(d); + Test[i] = v.x; + } + + std::clock_t TimeEnd = clock(); + printf("Det C: %ld\n", TimeEnd - TimeStart); + + return Test; +} + +std::vector test_detD(std::vector const & Data) +{ + std::vector Test(Data.size()); + + std::clock_t TimeStart = clock(); + + for(std::size_t i = 0; i < Test.size() - 1; ++i) + { + _mm_prefetch((char*)&Data[i + 1], _MM_HINT_T0); + glm::simdMat4 m(Data[i]); + glm::simdVec4 d(glm::detail::sse_detd_ps((__m128 const * const)&m)); + glm::vec4 v;//(d); + Test[i] = v.x; + } + + std::clock_t TimeEnd = clock(); + printf("Det D: %ld\n", TimeEnd - TimeStart); + + return Test; +} + +void test_invA(std::vector const & Data, std::vector & Out) +{ + //std::vector Test(Data.size()); + Out.resize(Data.size()); + + std::clock_t TimeStart = clock(); + + for(std::size_t i = 0; i < Out.size() - 1; ++i) + { + Out[i] = glm::inverse(Data[i]); + } + + std::clock_t TimeEnd = clock(); + printf("Inv A: %ld\n", TimeEnd - TimeStart); +} + +void test_invC(std::vector const & Data, std::vector & Out) +{ + //std::vector Test(Data.size()); + Out.resize(Data.size()); + + std::clock_t TimeStart = clock(); + + for(std::size_t i = 0; i < Out.size() - 1; ++i) + { + _mm_prefetch((char*)&Data[i + 1], _MM_HINT_T0); + glm::simdMat4 m(Data[i]); + glm::simdMat4 o; + glm::detail::sse_inverse_fast_ps((__m128 const * const)&m, (__m128 *)&o); + Out[i] = *(glm::mat4*)&o; + } + + std::clock_t TimeEnd = clock(); + printf("Inv C: %ld\n", TimeEnd - TimeStart); +} + +void test_invD(std::vector const & Data, std::vector & Out) +{ + //std::vector Test(Data.size()); + Out.resize(Data.size()); + + std::clock_t TimeStart = clock(); + + for(std::size_t i = 0; i < Out.size() - 1; ++i) + { + _mm_prefetch((char*)&Data[i + 1], _MM_HINT_T0); + glm::simdMat4 m(Data[i]); + glm::simdMat4 o; + glm::detail::sse_inverse_ps((__m128 const * const)&m, (__m128 *)&o); + Out[i] = *(glm::mat4*)&o; + } + + std::clock_t TimeEnd = clock(); + printf("Inv D: %ld\n", TimeEnd - TimeStart); +} + +void test_mulA(std::vector const & Data, std::vector & Out) +{ + //std::vector Test(Data.size()); + Out.resize(Data.size()); + + std::clock_t TimeStart = clock(); + + for(std::size_t i = 0; i < Out.size() - 1; ++i) + { + Out[i] = Data[i] * Data[i]; + } + + std::clock_t TimeEnd = clock(); + printf("Mul A: %ld\n", TimeEnd - TimeStart); +} + +void test_mulD(std::vector const & Data, std::vector & Out) +{ + //std::vector Test(Data.size()); + Out.resize(Data.size()); + + std::clock_t TimeStart = clock(); + + for(std::size_t i = 0; i < Out.size() - 1; ++i) + { + _mm_prefetch((char*)&Data[i + 1], _MM_HINT_T0); + glm::simdMat4 m(Data[i]); + glm::simdMat4 o; + glm::detail::sse_mul_ps((__m128 const * const)&m, (__m128 const * const)&m, (__m128*)&o); + Out[i] = *(glm::mat4*)&o; + } + + std::clock_t TimeEnd = clock(); + printf("Mul D: %ld\n", TimeEnd - TimeStart); +} + +int test_compute_glm() +{ + return 0; +} + +int test_compute_gtx() +{ + std::vector Output(1000000); + + std::clock_t TimeStart = clock(); + + for(std::size_t k = 0; k < Output.size(); ++k) + { + float i = float(k) / 1000.f + 0.001f; + glm::vec3 A = glm::normalize(glm::vec3(i)); + glm::vec3 B = glm::cross(A, glm::normalize(glm::vec3(1, 1, 2))); + glm::mat4 C = glm::rotate(glm::mat4(1.0f), i, B); + glm::mat4 D = glm::scale(C, glm::vec3(0.8f, 1.0f, 1.2f)); + glm::mat4 E = glm::translate(D, glm::vec3(1.4f, 1.2f, 1.1f)); + glm::mat4 F = glm::perspective(i, 1.5f, 0.1f, 1000.f); + glm::mat4 G = glm::inverse(F * E); + glm::vec3 H = glm::unProject(glm::vec3(i), G, F, E[3]); + glm::vec3 I = glm::any(glm::isnan(glm::project(H, G, F, E[3]))) ? glm::vec3(2) : glm::vec3(1); + glm::mat4 J = glm::lookAt(glm::normalize(glm::max(B, glm::vec3(0.001f))), H, I); + glm::mat4 K = glm::transpose(J); + glm::quat L = glm::normalize(glm::quat_cast(K)); + glm::vec4 M = L * glm::smoothstep(K[3], J[3], glm::vec4(i)); + glm::mat4 N = glm::mat4(glm::normalize(glm::max(M, glm::vec4(0.001f))), K[3], J[3], glm::vec4(i)); + glm::mat4 O = N * glm::inverse(N); + glm::vec4 P = O * glm::reflect(N[3], glm::vec4(A, 1.0f)); + glm::vec4 Q = glm::vec4(glm::dot(M, P)); + glm::vec4 R = glm::quat(Q.w, glm::vec3(Q)) * P; + Output[k] = R; + } + + std::clock_t TimeEnd = clock(); + printf("test_compute_gtx: %ld\n", TimeEnd - TimeStart); + + return 0; +} + +int main() +{ + int Error = 0; + + std::vector Data(64 * 64 * 1); + for(std::size_t i = 0; i < Data.size(); ++i) + Data[i] = glm::mat4( + glm::vec4(glm::linearRand(glm::vec4(-2.0f), glm::vec4(2.0f))), + glm::vec4(glm::linearRand(glm::vec4(-2.0f), glm::vec4(2.0f))), + glm::vec4(glm::linearRand(glm::vec4(-2.0f), glm::vec4(2.0f))), + glm::vec4(glm::linearRand(glm::vec4(-2.0f), glm::vec4(2.0f)))); + + { + std::vector TestInvA; + test_invA(Data, TestInvA); + } + { + std::vector TestInvC; + test_invC(Data, TestInvC); + } + { + std::vector TestInvD; + test_invD(Data, TestInvD); + } + + { + std::vector TestA; + test_mulA(Data, TestA); + } + { + std::vector TestD; + test_mulD(Data, TestD); + } + + { + std::vector TestDetA = test_detA(Data); + std::vector TestDetB = test_detB(Data); + std::vector TestDetD = test_detD(Data); + std::vector TestDetC = test_detC(Data); + + for(std::size_t i = 0; i < TestDetA.size(); ++i) + if(TestDetA[i] != TestDetB[i] && TestDetC[i] != TestDetB[i] && TestDetC[i] != TestDetD[i]) + return 1; + } + + // shuffle test + glm::simdVec4 A(1.0f, 2.0f, 3.0f, 4.0f); + glm::simdVec4 B(5.0f, 6.0f, 7.0f, 8.0f); + //__m128 C = _mm_shuffle_ps(A.Data, B.Data, _MM_SHUFFLE(1, 0, 1, 0)); + + Error += test_compute_glm(); + Error += test_compute_gtx(); + float Det = glm::determinant(glm::simdMat4(1.0)); + Error += Det == 1.0f ? 0 : 1; + + glm::simdMat4 D = glm::matrixCompMult(glm::simdMat4(1.0), glm::simdMat4(1.0)); + + return Error; +} + +#else + +int main() +{ + int Error = 0; + + return Error; +} + +#endif//(GLM_ARCH != GLM_ARCH_PURE) diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_simd_vec4.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_simd_vec4.cpp new file mode 100644 index 0000000000000000000000000000000000000000..07a1c06701d12ecdad6915833edc0dc29f0b514a --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_simd_vec4.cpp @@ -0,0 +1,71 @@ +/////////////////////////////////////////////////////////////////////////////////// +/// OpenGL Mathematics (glm.g-truc.net) +/// +/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) +/// Permission is hereby granted, free of charge, to any person obtaining a copy +/// of this software and associated documentation files (the "Software"), to deal +/// in the Software without restriction, including without limitation the rights +/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +/// copies of the Software, and to permit persons to whom the Software is +/// furnished to do so, subject to the following conditions: +/// +/// The above copyright notice and this permission notice shall be included in +/// all copies or substantial portions of the Software. +/// +/// Restrictions: +/// By making use of the Software for military purposes, you choose to make +/// a Bunny unhappy. +/// +/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +/// THE SOFTWARE. +/// +/// @file test/gtx/gtx_simd_vec4.cpp +/// @date 2010-09-16 / 2014-11-25 +/// @author Christophe Riccio +/////////////////////////////////////////////////////////////////////////////////// + +#include +#include +#include + +#if(GLM_ARCH != GLM_ARCH_PURE) + +int main() +{ + glm::simdVec4 A1(0.0f, 0.1f, 0.2f, 0.3f); + glm::simdVec4 B1(0.4f, 0.5f, 0.6f, 0.7f); + glm::simdVec4 C1 = A1 + B1; + glm::simdVec4 D1 = A1.swizzle(); + glm::simdVec4 E1(glm::vec4(1.0f)); + glm::vec4 F1 = glm::vec4_cast(E1); + //glm::vec4 G1(E1); + + //printf("A1(%2.3f, %2.3f, %2.3f, %2.3f)\n", A1.x, A1.y, A1.z, A1.w); + //printf("B1(%2.3f, %2.3f, %2.3f, %2.3f)\n", B1.x, B1.y, B1.z, B1.w); + //printf("C1(%2.3f, %2.3f, %2.3f, %2.3f)\n", C1.x, C1.y, C1.z, C1.w); + //printf("D1(%2.3f, %2.3f, %2.3f, %2.3f)\n", D1.x, D1.y, D1.z, D1.w); + + __m128 value = _mm_set1_ps(0.0f); + __m128 data = _mm_cmpeq_ps(value, value); + __m128 add0 = _mm_add_ps(data, data); + + glm::simdVec4 GNI(add0); + + return 0; +} + +#else + +int main() +{ + int Error = 0; + + return Error; +} + +#endif//(GLM_ARCH != GLM_ARCH_PURE) diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_spline.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_spline.cpp new file mode 100644 index 0000000000000000000000000000000000000000..7992d766e04c931ccf82d9ac638e4f44a6a90deb --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_spline.cpp @@ -0,0 +1,100 @@ +#define GLM_ENABLE_EXPERIMENTAL +#include +#include +#include +#include + +namespace catmullRom +{ + int test() + { + int Error(0); + + glm::vec2 Result2 = glm::catmullRom( + glm::vec2(0.0f, 0.0f), + glm::vec2(1.0f, 0.0f), + glm::vec2(1.0f, 1.0f), + glm::vec2(0.0f, 1.0f), 0.5f); + + glm::vec3 Result3 = glm::catmullRom( + glm::vec3(0.0f, 0.0f, 0.0f), + glm::vec3(1.0f, 0.0f, 0.0f), + glm::vec3(1.0f, 1.0f, 0.0f), + glm::vec3(0.0f, 1.0f, 0.0f), 0.5f); + + glm::vec4 Result4 = glm::catmullRom( + glm::vec4(0.0f, 0.0f, 0.0f, 1.0f), + glm::vec4(1.0f, 0.0f, 0.0f, 1.0f), + glm::vec4(1.0f, 1.0f, 0.0f, 1.0f), + glm::vec4(0.0f, 1.0f, 0.0f, 1.0f), 0.5f); + + return Error; + } +}//catmullRom + +namespace hermite +{ + int test() + { + int Error(0); + + glm::vec2 Result2 = glm::hermite( + glm::vec2(0.0f, 0.0f), + glm::vec2(1.0f, 0.0f), + glm::vec2(1.0f, 1.0f), + glm::vec2(0.0f, 1.0f), 0.5f); + + glm::vec3 Result3 = glm::hermite( + glm::vec3(0.0f, 0.0f, 0.0f), + glm::vec3(1.0f, 0.0f, 0.0f), + glm::vec3(1.0f, 1.0f, 0.0f), + glm::vec3(0.0f, 1.0f, 0.0f), 0.5f); + + glm::vec4 Result4 = glm::hermite( + glm::vec4(0.0f, 0.0f, 0.0f, 1.0f), + glm::vec4(1.0f, 0.0f, 0.0f, 1.0f), + glm::vec4(1.0f, 1.0f, 0.0f, 1.0f), + glm::vec4(0.0f, 1.0f, 0.0f, 1.0f), 0.5f); + + return Error; + } +}//catmullRom + +namespace cubic +{ + int test() + { + int Error(0); + + glm::vec2 Result2 = glm::cubic( + glm::vec2(0.0f, 0.0f), + glm::vec2(1.0f, 0.0f), + glm::vec2(1.0f, 1.0f), + glm::vec2(0.0f, 1.0f), 0.5f); + + glm::vec3 Result3 = glm::cubic( + glm::vec3(0.0f, 0.0f, 0.0f), + glm::vec3(1.0f, 0.0f, 0.0f), + glm::vec3(1.0f, 1.0f, 0.0f), + glm::vec3(0.0f, 1.0f, 0.0f), 0.5f); + + glm::vec4 Result = glm::cubic( + glm::vec4(0.0f, 0.0f, 0.0f, 1.0f), + glm::vec4(1.0f, 0.0f, 0.0f, 1.0f), + glm::vec4(1.0f, 1.0f, 0.0f, 1.0f), + glm::vec4(0.0f, 1.0f, 0.0f, 1.0f), 0.5f); + + return Error; + } +}//catmullRom + +int main() +{ + int Error(0); + + Error += catmullRom::test(); + Error += hermite::test(); + Error += cubic::test(); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_string_cast.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_string_cast.cpp new file mode 100644 index 0000000000000000000000000000000000000000..a3276845a0132fc43a42bc91fe15286ce3c3f44c --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_string_cast.cpp @@ -0,0 +1,155 @@ +#define GLM_ENABLE_EXPERIMENTAL +#include +#include +#include + +int test_string_cast_vector() +{ + int Error = 0; + + { + glm::vec2 A1(1, 2); + std::string A2 = glm::to_string(A1); + Error += A2 != std::string("vec2(1.000000, 2.000000)") ? 1 : 0; + + glm::vec3 B1(1, 2, 3); + std::string B2 = glm::to_string(B1); + Error += B2 != std::string("vec3(1.000000, 2.000000, 3.000000)") ? 1 : 0; + + glm::vec4 C1(1, 2, 3, 4); + std::string C2 = glm::to_string(C1); + Error += C2 != std::string("vec4(1.000000, 2.000000, 3.000000, 4.000000)") ? 1 : 0; + + glm::dvec2 J1(1, 2); + std::string J2 = glm::to_string(J1); + Error += J2 != std::string("dvec2(1.000000, 2.000000)") ? 1 : 0; + + glm::dvec3 K1(1, 2, 3); + std::string K2 = glm::to_string(K1); + Error += K2 != std::string("dvec3(1.000000, 2.000000, 3.000000)") ? 1 : 0; + + glm::dvec4 L1(1, 2, 3, 4); + std::string L2 = glm::to_string(L1); + Error += L2 != std::string("dvec4(1.000000, 2.000000, 3.000000, 4.000000)") ? 1 : 0; + } + + { + glm::bvec2 M1(false, true); + std::string M2 = glm::to_string(M1); + Error += M2 != std::string("bvec2(false, true)") ? 1 : 0; + + glm::bvec3 O1(false, true, false); + std::string O2 = glm::to_string(O1); + Error += O2 != std::string("bvec3(false, true, false)") ? 1 : 0; + + glm::bvec4 P1(false, true, false, true); + std::string P2 = glm::to_string(P1); + Error += P2 != std::string("bvec4(false, true, false, true)") ? 1 : 0; + } + + { + glm::ivec2 D1(1, 2); + std::string D2 = glm::to_string(D1); + Error += D2 != std::string("ivec2(1, 2)") ? 1 : 0; + + glm::ivec3 E1(1, 2, 3); + std::string E2 = glm::to_string(E1); + Error += E2 != std::string("ivec3(1, 2, 3)") ? 1 : 0; + + glm::ivec4 F1(1, 2, 3, 4); + std::string F2 = glm::to_string(F1); + Error += F2 != std::string("ivec4(1, 2, 3, 4)") ? 1 : 0; + } + + { + glm::i8vec2 D1(1, 2); + std::string D2 = glm::to_string(D1); + Error += D2 != std::string("i8vec2(1, 2)") ? 1 : 0; + + glm::i8vec3 E1(1, 2, 3); + std::string E2 = glm::to_string(E1); + Error += E2 != std::string("i8vec3(1, 2, 3)") ? 1 : 0; + + glm::i8vec4 F1(1, 2, 3, 4); + std::string F2 = glm::to_string(F1); + Error += F2 != std::string("i8vec4(1, 2, 3, 4)") ? 1 : 0; + } + + { + glm::i16vec2 D1(1, 2); + std::string D2 = glm::to_string(D1); + Error += D2 != std::string("i16vec2(1, 2)") ? 1 : 0; + + glm::i16vec3 E1(1, 2, 3); + std::string E2 = glm::to_string(E1); + Error += E2 != std::string("i16vec3(1, 2, 3)") ? 1 : 0; + + glm::i16vec4 F1(1, 2, 3, 4); + std::string F2 = glm::to_string(F1); + Error += F2 != std::string("i16vec4(1, 2, 3, 4)") ? 1 : 0; + } + + { + glm::i64vec2 D1(1, 2); + std::string D2 = glm::to_string(D1); + Error += D2 != std::string("i64vec2(1, 2)") ? 1 : 0; + + glm::i64vec3 E1(1, 2, 3); + std::string E2 = glm::to_string(E1); + Error += E2 != std::string("i64vec3(1, 2, 3)") ? 1 : 0; + + glm::i64vec4 F1(1, 2, 3, 4); + std::string F2 = glm::to_string(F1); + Error += F2 != std::string("i64vec4(1, 2, 3, 4)") ? 1 : 0; + } + + return Error; +} + +int test_string_cast_matrix() +{ + int Error = 0; + + glm::mat2x2 A1(1.000000, 2.000000, 3.000000, 4.000000); + std::string A2 = glm::to_string(A1); + Error += A2 != std::string("mat2x2((1.000000, 2.000000), (3.000000, 4.000000))") ? 1 : 0; + + return Error; +} + +int test_string_cast_quaternion() +{ + int Error = 0; + + glm::quat Q0 = glm::quat(1.0f, 2.0f, 3.0f, 4.0f); + std::string S0 = glm::to_string(Q0); + Error += S0 != std::string("quat(1.000000, {2.000000, 3.000000, 4.000000})") ? 1 : 0; + + return Error; + +} + +int test_string_cast_dual_quaternion() +{ + int Error = 0; + + glm::dualquat Q0 = glm::dualquat(glm::quat(1.0f, 2.0f, 3.0f, 4.0f), glm::quat(5.0f, 6.0f, 7.0f, 8.0f)); + std::string S0 = glm::to_string(Q0); + Error += S0 != std::string("dualquat((1.000000, {2.000000, 3.000000, 4.000000}), (5.000000, {6.000000, 7.000000, 8.000000}))") ? 1 : 0; + + return Error; +} + +int main() +{ + int Error = 0; + + Error += test_string_cast_vector(); + Error += test_string_cast_matrix(); + Error += test_string_cast_quaternion(); + Error += test_string_cast_dual_quaternion(); + + return Error; +} + + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_texture.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_texture.cpp new file mode 100644 index 0000000000000000000000000000000000000000..288bfef72ae7f8cdbaca54e866617e1a889c277c --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_texture.cpp @@ -0,0 +1,22 @@ +#define GLM_ENABLE_EXPERIMENTAL +#include +#include + +int test_levels() +{ + int Error = 0; + + int const Levels = glm::levels(glm::ivec2(3, 2)); + Error += Levels == 2 ? 0 : 1; + + return Error; +} + +int main() +{ + int Error = 0; + + Error += test_levels(); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_type_aligned.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_type_aligned.cpp new file mode 100644 index 0000000000000000000000000000000000000000..f7da227c5dd02a86f55cb90a246ed269d38417e1 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_type_aligned.cpp @@ -0,0 +1,114 @@ +#define GLM_ENABLE_EXPERIMENTAL +#include +#include + +int test_decl() +{ + int Error(0); + + { + struct S1 + { + glm::aligned_vec4 B; + }; + + struct S2 + { + glm::vec4 B; + }; + + std::printf("vec4 - Aligned: %d, unaligned: %d\n", static_cast(sizeof(S1)), static_cast(sizeof(S2))); + + Error += sizeof(S1) >= sizeof(S2) ? 0 : 1; + } + + { + struct S1 + { + bool A; + glm::vec3 B; + }; + + struct S2 + { + bool A; + glm::aligned_vec3 B; + }; + + std::printf("vec3 - Aligned: %d, unaligned: %d\n", static_cast(sizeof(S1)), static_cast(sizeof(S2))); + + Error += sizeof(S1) <= sizeof(S2) ? 0 : 1; + } + + { + struct S1 + { + bool A; + glm::aligned_vec4 B; + }; + + struct S2 + { + bool A; + glm::vec4 B; + }; + + std::printf("vec4 - Aligned: %d, unaligned: %d\n", static_cast(sizeof(S1)), static_cast(sizeof(S2))); + + Error += sizeof(S1) >= sizeof(S2) ? 0 : 1; + } + + { + struct S1 + { + bool A; + glm::aligned_dvec4 B; + }; + + struct S2 + { + bool A; + glm::dvec4 B; + }; + + std::printf("dvec4 - Aligned: %d, unaligned: %d\n", static_cast(sizeof(S1)), static_cast(sizeof(S2))); + + Error += sizeof(S1) >= sizeof(S2) ? 0 : 1; + } + + return Error; +} + +template +void print(genType const& Mat0) +{ + std::printf("mat4(\n"); + std::printf("\tvec4(%2.9f, %2.9f, %2.9f, %2.9f)\n", static_cast(Mat0[0][0]), static_cast(Mat0[0][1]), static_cast(Mat0[0][2]), static_cast(Mat0[0][3])); + std::printf("\tvec4(%2.9f, %2.9f, %2.9f, %2.9f)\n", static_cast(Mat0[1][0]), static_cast(Mat0[1][1]), static_cast(Mat0[1][2]), static_cast(Mat0[1][3])); + std::printf("\tvec4(%2.9f, %2.9f, %2.9f, %2.9f)\n", static_cast(Mat0[2][0]), static_cast(Mat0[2][1]), static_cast(Mat0[2][2]), static_cast(Mat0[2][3])); + std::printf("\tvec4(%2.9f, %2.9f, %2.9f, %2.9f))\n\n", static_cast(Mat0[3][0]), static_cast(Mat0[3][1]), static_cast(Mat0[3][2]), static_cast(Mat0[3][3])); +} + +int perf_mul() +{ + int Error = 0; + + glm::mat4 A(1.0f); + glm::mat4 B(1.0f); + + glm::mat4 C = A * B; + + print(C); + + return Error; +} + +int main() +{ + int Error(0); + + Error += test_decl(); + Error += perf_mul(); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_type_trait.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_type_trait.cpp new file mode 100644 index 0000000000000000000000000000000000000000..dad7fa36ea29d1b84da6e5a776c673f3db9684af --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_type_trait.cpp @@ -0,0 +1,13 @@ +#define GLM_ENABLE_EXPERIMENTAL +#include +#include + +int main() +{ + int Error = 0; + + + + return Error; +} + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_vec_swizzle.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_vec_swizzle.cpp new file mode 100644 index 0000000000000000000000000000000000000000..ecd2f92a6050957b9157494640d39b6ad532c131 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_vec_swizzle.cpp @@ -0,0 +1,11 @@ +#define GLM_ENABLE_EXPERIMENTAL +#include + +int main() +{ + int Error = 0; + + + return Error; +} + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_vector_angle.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_vector_angle.cpp new file mode 100644 index 0000000000000000000000000000000000000000..78c3377240d9ca3c518fa8e8e86037500949e0e5 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_vector_angle.cpp @@ -0,0 +1,59 @@ +#define GLM_ENABLE_EXPERIMENTAL +#include +#include +#include + +int test_angle() +{ + int Error = 0; + + float AngleA = glm::angle(glm::vec2(1, 0), glm::normalize(glm::vec2(1, 1))); + Error += glm::epsilonEqual(AngleA, glm::pi() * 0.25f, 0.01f) ? 0 : 1; + float AngleB = glm::angle(glm::vec3(1, 0, 0), glm::normalize(glm::vec3(1, 1, 0))); + Error += glm::epsilonEqual(AngleB, glm::pi() * 0.25f, 0.01f) ? 0 : 1; + float AngleC = glm::angle(glm::vec4(1, 0, 0, 0), glm::normalize(glm::vec4(1, 1, 0, 0))); + Error += glm::epsilonEqual(AngleC, glm::pi() * 0.25f, 0.01f) ? 0 : 1; + + return Error; +} + +int test_orientedAngle_vec2() +{ + int Error = 0; + + float AngleA = glm::orientedAngle(glm::vec2(1, 0), glm::normalize(glm::vec2(1, 1))); + Error += glm::epsilonEqual(AngleA, glm::pi() * 0.25f, 0.01f) ? 0 : 1; + float AngleB = glm::orientedAngle(glm::vec2(0, 1), glm::normalize(glm::vec2(1, 1))); + Error += glm::epsilonEqual(AngleB, -glm::pi() * 0.25f, 0.01f) ? 0 : 1; + float AngleC = glm::orientedAngle(glm::normalize(glm::vec2(1, 1)), glm::vec2(0, 1)); + Error += glm::epsilonEqual(AngleC, glm::pi() * 0.25f, 0.01f) ? 0 : 1; + + return Error; +} + +int test_orientedAngle_vec3() +{ + int Error = 0; + + float AngleA = glm::orientedAngle(glm::vec3(1, 0, 0), glm::normalize(glm::vec3(1, 1, 0)), glm::vec3(0, 0, 1)); + Error += glm::epsilonEqual(AngleA, glm::pi() * 0.25f, 0.01f) ? 0 : 1; + float AngleB = glm::orientedAngle(glm::vec3(0, 1, 0), glm::normalize(glm::vec3(1, 1, 0)), glm::vec3(0, 0, 1)); + Error += glm::epsilonEqual(AngleB, -glm::pi() * 0.25f, 0.01f) ? 0 : 1; + float AngleC = glm::orientedAngle(glm::normalize(glm::vec3(1, 1, 0)), glm::vec3(0, 1, 0), glm::vec3(0, 0, 1)); + Error += glm::epsilonEqual(AngleC, glm::pi() * 0.25f, 0.01f) ? 0 : 1; + + return Error; +} + +int main() +{ + int Error(0); + + Error += test_angle(); + Error += test_orientedAngle_vec2(); + Error += test_orientedAngle_vec3(); + + return Error; +} + + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_vector_query.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_vector_query.cpp new file mode 100644 index 0000000000000000000000000000000000000000..c072d58cdd31a3a48b6695bf7a8426ac49308621 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_vector_query.cpp @@ -0,0 +1,82 @@ +#define GLM_ENABLE_EXPERIMENTAL +#include +#include +#include +#include + +int test_areCollinear() +{ + int Error(0); + + { + bool TestA = glm::areCollinear(glm::vec2(-1), glm::vec2(1), 0.00001f); + Error += TestA ? 0 : 1; + } + + { + bool TestA = glm::areCollinear(glm::vec3(-1), glm::vec3(1), 0.00001f); + Error += TestA ? 0 : 1; + } + + { + bool TestA = glm::areCollinear(glm::vec4(-1), glm::vec4(1), 0.00001f); + Error += TestA ? 0 : 1; + } + + return Error; +} + +int test_areOrthogonal() +{ + int Error(0); + + bool TestA = glm::areOrthogonal(glm::vec2(1, 0), glm::vec2(0, 1), 0.00001f); + Error += TestA ? 0 : 1; + + return Error; +} + +int test_isNormalized() +{ + int Error(0); + + bool TestA = glm::isNormalized(glm::vec4(1, 0, 0, 0), 0.00001f); + Error += TestA ? 0 : 1; + + return Error; +} + +int test_isNull() +{ + int Error(0); + + bool TestA = glm::isNull(glm::vec4(0), 0.00001f); + Error += TestA ? 0 : 1; + + return Error; +} + +int test_areOrthonormal() +{ + int Error(0); + + bool TestA = glm::areOrthonormal(glm::vec2(1, 0), glm::vec2(0, 1), 0.00001f); + Error += TestA ? 0 : 1; + + return Error; +} + +int main() +{ + int Error(0); + + Error += test_areCollinear(); + Error += test_areOrthogonal(); + Error += test_isNormalized(); + Error += test_isNull(); + Error += test_areOrthonormal(); + + return Error; +} + + diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_wrap.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_wrap.cpp new file mode 100644 index 0000000000000000000000000000000000000000..d67bbad33490b53022f6af12920b1ac9b6c96539 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/gtx/gtx_wrap.cpp @@ -0,0 +1,191 @@ +#define GLM_ENABLE_EXPERIMENTAL +#include +#include +#include + +namespace clamp +{ + int test() + { + int Error(0); + + float A = glm::clamp(0.5f); + Error += glm::equal(A, 0.5f, 0.00001f) ? 0 : 1; + + float B = glm::clamp(0.0f); + Error += glm::equal(B, 0.0f, 0.00001f) ? 0 : 1; + + float C = glm::clamp(1.0f); + Error += glm::equal(C, 1.0f, 0.00001f) ? 0 : 1; + + float D = glm::clamp(-0.5f); + Error += glm::equal(D, 0.0f, 0.00001f) ? 0 : 1; + + float E = glm::clamp(1.5f); + Error += glm::equal(E, 1.0f, 0.00001f) ? 0 : 1; + + glm::vec2 K = glm::clamp(glm::vec2(0.5f)); + Error += glm::all(glm::equal(K, glm::vec2(0.5f), glm::vec2(0.00001f))) ? 0 : 1; + + glm::vec3 L = glm::clamp(glm::vec3(0.5f)); + Error += glm::all(glm::equal(L, glm::vec3(0.5f), glm::vec3(0.00001f))) ? 0 : 1; + + glm::vec4 M = glm::clamp(glm::vec4(0.5f)); + Error += glm::all(glm::equal(M, glm::vec4(0.5f), glm::vec4(0.00001f))) ? 0 : 1; + + glm::vec1 N = glm::clamp(glm::vec1(0.5f)); + Error += glm::all(glm::equal(N, glm::vec1(0.5f), glm::vec1(0.00001f))) ? 0 : 1; + + return Error; + } +}//namespace clamp + +namespace repeat +{ + int test() + { + int Error(0); + + float A = glm::repeat(0.5f); + Error += glm::equal(A, 0.5f, 0.00001f) ? 0 : 1; + + float B = glm::repeat(0.0f); + Error += glm::equal(B, 0.0f, 0.00001f) ? 0 : 1; + + float C = glm::repeat(1.0f); + Error += glm::equal(C, 0.0f, 0.00001f) ? 0 : 1; + + float D = glm::repeat(-0.5f); + Error += glm::equal(D, 0.5f, 0.00001f) ? 0 : 1; + + float E = glm::repeat(1.5f); + Error += glm::equal(E, 0.5f, 0.00001f) ? 0 : 1; + + float F = glm::repeat(0.9f); + Error += glm::equal(F, 0.9f, 0.00001f) ? 0 : 1; + + glm::vec2 K = glm::repeat(glm::vec2(0.5f)); + Error += glm::all(glm::equal(K, glm::vec2(0.5f), glm::vec2(0.00001f))) ? 0 : 1; + + glm::vec3 L = glm::repeat(glm::vec3(0.5f)); + Error += glm::all(glm::equal(L, glm::vec3(0.5f), glm::vec3(0.00001f))) ? 0 : 1; + + glm::vec4 M = glm::repeat(glm::vec4(0.5f)); + Error += glm::all(glm::equal(M, glm::vec4(0.5f), glm::vec4(0.00001f))) ? 0 : 1; + + glm::vec1 N = glm::repeat(glm::vec1(0.5f)); + Error += glm::all(glm::equal(N, glm::vec1(0.5f), glm::vec1(0.00001f))) ? 0 : 1; + + return Error; + } +}//namespace repeat + +namespace mirrorClamp +{ + int test() + { + int Error(0); + + float A = glm::mirrorClamp(0.5f); + Error += glm::equal(A, 0.5f, 0.00001f) ? 0 : 1; + + float B = glm::mirrorClamp(0.0f); + Error += glm::equal(B, 0.0f, 0.00001f) ? 0 : 1; + + float C = glm::mirrorClamp(1.1f); + Error += glm::equal(C, 0.1f, 0.00001f) ? 0 : 1; + + float D = glm::mirrorClamp(-0.5f); + Error += glm::equal(D, 0.5f, 0.00001f) ? 0 : 1; + + float E = glm::mirrorClamp(1.5f); + Error += glm::equal(E, 0.5f, 0.00001f) ? 0 : 1; + + float F = glm::mirrorClamp(0.9f); + Error += glm::equal(F, 0.9f, 0.00001f) ? 0 : 1; + + float G = glm::mirrorClamp(3.1f); + Error += glm::equal(G, 0.1f, 0.00001f) ? 0 : 1; + + float H = glm::mirrorClamp(-3.1f); + Error += glm::equal(H, 0.1f, 0.00001f) ? 0 : 1; + + float I = glm::mirrorClamp(-0.9f); + Error += glm::equal(I, 0.9f, 0.00001f) ? 0 : 1; + + glm::vec2 K = glm::mirrorClamp(glm::vec2(0.5f)); + Error += glm::all(glm::equal(K, glm::vec2(0.5f), glm::vec2(0.00001f))) ? 0 : 1; + + glm::vec3 L = glm::mirrorClamp(glm::vec3(0.5f)); + Error += glm::all(glm::equal(L, glm::vec3(0.5f), glm::vec3(0.00001f))) ? 0 : 1; + + glm::vec4 M = glm::mirrorClamp(glm::vec4(0.5f)); + Error += glm::all(glm::equal(M, glm::vec4(0.5f), glm::vec4(0.00001f))) ? 0 : 1; + + glm::vec1 N = glm::mirrorClamp(glm::vec1(0.5f)); + Error += glm::all(glm::equal(N, glm::vec1(0.5f), glm::vec1(0.00001f))) ? 0 : 1; + + return Error; + } +}//namespace mirrorClamp + +namespace mirrorRepeat +{ + int test() + { + int Error(0); + + float A = glm::mirrorRepeat(0.5f); + Error += glm::equal(A, 0.5f, 0.00001f) ? 0 : 1; + + float B = glm::mirrorRepeat(0.0f); + Error += glm::equal(B, 0.0f, 0.00001f) ? 0 : 1; + + float C = glm::mirrorRepeat(1.0f); + Error += glm::equal(C, 1.0f, 0.00001f) ? 0 : 1; + + float D = glm::mirrorRepeat(-0.5f); + Error += glm::equal(D, 0.5f, 0.00001f) ? 0 : 1; + + float E = glm::mirrorRepeat(1.5f); + Error += glm::equal(E, 0.5f, 0.00001f) ? 0 : 1; + + float F = glm::mirrorRepeat(0.9f); + Error += glm::equal(F, 0.9f, 0.00001f) ? 0 : 1; + + float G = glm::mirrorRepeat(3.0f); + Error += glm::equal(G, 1.0f, 0.00001f) ? 0 : 1; + + float H = glm::mirrorRepeat(-3.0f); + Error += glm::equal(H, 1.0f, 0.00001f) ? 0 : 1; + + float I = glm::mirrorRepeat(-1.0f); + Error += glm::equal(I, 1.0f, 0.00001f) ? 0 : 1; + + glm::vec2 K = glm::mirrorRepeat(glm::vec2(0.5f)); + Error += glm::all(glm::equal(K, glm::vec2(0.5f), glm::vec2(0.00001f))) ? 0 : 1; + + glm::vec3 L = glm::mirrorRepeat(glm::vec3(0.5f)); + Error += glm::all(glm::equal(L, glm::vec3(0.5f), glm::vec3(0.00001f))) ? 0 : 1; + + glm::vec4 M = glm::mirrorRepeat(glm::vec4(0.5f)); + Error += glm::all(glm::equal(M, glm::vec4(0.5f), glm::vec4(0.00001f))) ? 0 : 1; + + glm::vec1 N = glm::mirrorRepeat(glm::vec1(0.5f)); + Error += glm::all(glm::equal(N, glm::vec1(0.5f), glm::vec1(0.00001f))) ? 0 : 1; + + return Error; + } +}//namespace mirrorRepeat + +int main() +{ + int Error(0); + + Error += clamp::test(); + Error += repeat::test(); + Error += mirrorClamp::test(); + Error += mirrorRepeat::test(); + + return Error; +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/perf/CMakeLists.txt b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/perf/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..6650fb07303dabd2e5047960483e97f797bd5a80 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/perf/CMakeLists.txt @@ -0,0 +1,6 @@ +glmCreateTestGTC(perf_matrix_div) +glmCreateTestGTC(perf_matrix_inverse) +glmCreateTestGTC(perf_matrix_mul) +glmCreateTestGTC(perf_matrix_mul_vector) +glmCreateTestGTC(perf_matrix_transpose) +glmCreateTestGTC(perf_vector_mul_matrix) diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/perf/perf_matrix_div.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/perf/perf_matrix_div.cpp new file mode 100644 index 0000000000000000000000000000000000000000..45105c2ec5ccd4a812c496602c4bea9049fd427a --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/perf/perf_matrix_div.cpp @@ -0,0 +1,153 @@ +#define GLM_FORCE_INLINE +#include +#include +#include +#include +#include +#if GLM_CONFIG_SIMD == GLM_ENABLE +#include +#include +#include +#include + +template +static void test_mat_div_mat(matType const& M, std::vector const& I, std::vector& O) +{ + for (std::size_t i = 0, n = I.size(); i < n; ++i) + O[i] = M / I[i]; +} + +template +static int launch_mat_div_mat(std::vector& O, matType const& Transform, matType const& Scale, std::size_t Samples) +{ + typedef typename matType::value_type T; + + std::vector I(Samples); + O.resize(Samples); + + for(std::size_t i = 0; i < Samples; ++i) + I[i] = Scale * static_cast(i) + Scale; + + std::chrono::high_resolution_clock::time_point t1 = std::chrono::high_resolution_clock::now(); + test_mat_div_mat(Transform, I, O); + std::chrono::high_resolution_clock::time_point t2 = std::chrono::high_resolution_clock::now(); + + return static_cast(std::chrono::duration_cast(t2 - t1).count()); +} + +template +static int comp_mat2_div_mat2(std::size_t Samples) +{ + typedef typename packedMatType::value_type T; + + int Error = 0; + + packedMatType const Transform(1, 2, 3, 4); + packedMatType const Scale(0.01, 0.02, 0.03, 0.05); + + std::vector SISD; + std::printf("- SISD: %d us\n", launch_mat_div_mat(SISD, Transform, Scale, Samples)); + + std::vector SIMD; + std::printf("- SIMD: %d us\n", launch_mat_div_mat(SIMD, Transform, Scale, Samples)); + + for(std::size_t i = 0; i < Samples; ++i) + { + packedMatType const A = SISD[i]; + packedMatType const B = SIMD[i]; + Error += glm::all(glm::equal(A, B, static_cast(0.001))) ? 0 : 1; + assert(!Error); + } + + return Error; +} + +template +static int comp_mat3_div_mat3(std::size_t Samples) +{ + typedef typename packedMatType::value_type T; + + int Error = 0; + + packedMatType const Transform(1, 2, 3, 4, 5, 6, 7, 8, 9); + packedMatType const Scale(0.01, 0.02, 0.03, 0.05, 0.01, 0.02, 0.03, 0.05, 0.01); + + std::vector SISD; + std::printf("- SISD: %d us\n", launch_mat_div_mat(SISD, Transform, Scale, Samples)); + + std::vector SIMD; + std::printf("- SIMD: %d us\n", launch_mat_div_mat(SIMD, Transform, Scale, Samples)); + + for(std::size_t i = 0; i < Samples; ++i) + { + packedMatType const A = SISD[i]; + packedMatType const B = SIMD[i]; + Error += glm::all(glm::equal(A, B, static_cast(0.001))) ? 0 : 1; + assert(!Error); + } + + return Error; +} + +template +static int comp_mat4_div_mat4(std::size_t Samples) +{ + typedef typename packedMatType::value_type T; + + int Error = 0; + + packedMatType const Transform(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); + packedMatType const Scale(0.01, 0.02, 0.05, 0.04, 0.02, 0.08, 0.05, 0.01, 0.08, 0.03, 0.05, 0.06, 0.02, 0.03, 0.07, 0.05); + + std::vector SISD; + std::printf("- SISD: %d us\n", launch_mat_div_mat(SISD, Transform, Scale, Samples)); + + std::vector SIMD; + std::printf("- SIMD: %d us\n", launch_mat_div_mat(SIMD, Transform, Scale, Samples)); + + for(std::size_t i = 0; i < Samples; ++i) + { + packedMatType const A = SISD[i]; + packedMatType const B = SIMD[i]; + Error += glm::all(glm::equal(A, B, static_cast(0.001))) ? 0 : 1; + assert(!Error); + } + + return Error; +} + +int main() +{ + std::size_t const Samples = 100000; + + int Error = 0; + + std::printf("mat2 / mat2:\n"); + Error += comp_mat2_div_mat2(Samples); + + std::printf("dmat2 / dmat2:\n"); + Error += comp_mat2_div_mat2(Samples); + + std::printf("mat3 / mat3:\n"); + Error += comp_mat3_div_mat3(Samples); + + std::printf("dmat3 / dmat3:\n"); + Error += comp_mat3_div_mat3(Samples); + + std::printf("mat4 / mat4:\n"); + Error += comp_mat4_div_mat4(Samples); + + std::printf("dmat4 / dmat4:\n"); + Error += comp_mat4_div_mat4(Samples); + + return Error; +} + +#else + +int main() +{ + return 0; +} + +#endif diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/perf/perf_matrix_inverse.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/perf/perf_matrix_inverse.cpp new file mode 100644 index 0000000000000000000000000000000000000000..0ff24ad205108c6d589d548f745210dc6bbf541a --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/perf/perf_matrix_inverse.cpp @@ -0,0 +1,150 @@ +#define GLM_FORCE_INLINE +#include +#include +#include +#include +#include +#if GLM_CONFIG_SIMD == GLM_ENABLE +#include +#include +#include +#include + +template +static void test_mat_inverse(std::vector const& I, std::vector& O) +{ + for (std::size_t i = 0, n = I.size(); i < n; ++i) + O[i] = glm::inverse(I[i]); +} + +template +static int launch_mat_inverse(std::vector& O, matType const& Scale, std::size_t Samples) +{ + typedef typename matType::value_type T; + + std::vector I(Samples); + O.resize(Samples); + + for(std::size_t i = 0; i < Samples; ++i) + I[i] = Scale * static_cast(i) + Scale; + + std::chrono::high_resolution_clock::time_point t1 = std::chrono::high_resolution_clock::now(); + test_mat_inverse(I, O); + std::chrono::high_resolution_clock::time_point t2 = std::chrono::high_resolution_clock::now(); + + return static_cast(std::chrono::duration_cast(t2 - t1).count()); +} + +template +static int comp_mat2_inverse(std::size_t Samples) +{ + typedef typename packedMatType::value_type T; + + int Error = 0; + + packedMatType const Scale(0.01, 0.02, 0.03, 0.05); + + std::vector SISD; + std::printf("- SISD: %d us\n", launch_mat_inverse(SISD, Scale, Samples)); + + std::vector SIMD; + std::printf("- SIMD: %d us\n", launch_mat_inverse(SIMD, Scale, Samples)); + + for(std::size_t i = 0; i < Samples; ++i) + { + packedMatType const A = SISD[i]; + packedMatType const B = SIMD[i]; + Error += glm::all(glm::equal(A, B, static_cast(0.001))) ? 0 : 1; + assert(!Error); + } + + return Error; +} + +template +static int comp_mat3_inverse(std::size_t Samples) +{ + typedef typename packedMatType::value_type T; + + int Error = 0; + + packedMatType const Scale(0.01, 0.02, 0.03, 0.05, 0.01, 0.02, 0.03, 0.05, 0.01); + + std::vector SISD; + std::printf("- SISD: %d us\n", launch_mat_inverse(SISD, Scale, Samples)); + + std::vector SIMD; + std::printf("- SIMD: %d us\n", launch_mat_inverse(SIMD, Scale, Samples)); + + for(std::size_t i = 0; i < Samples; ++i) + { + packedMatType const A = SISD[i]; + packedMatType const B = SIMD[i]; + Error += glm::all(glm::equal(A, B, static_cast(0.001))) ? 0 : 1; + assert(!Error); + } + + return Error; +} + +template +static int comp_mat4_inverse(std::size_t Samples) +{ + typedef typename packedMatType::value_type T; + + int Error = 0; + + packedMatType const Scale(0.01, 0.02, 0.05, 0.04, 0.02, 0.08, 0.05, 0.01, 0.08, 0.03, 0.05, 0.06, 0.02, 0.03, 0.07, 0.05); + + std::vector SISD; + std::printf("- SISD: %d us\n", launch_mat_inverse(SISD, Scale, Samples)); + + std::vector SIMD; + std::printf("- SIMD: %d us\n", launch_mat_inverse(SIMD, Scale, Samples)); + + for(std::size_t i = 0; i < Samples; ++i) + { + packedMatType const A = SISD[i]; + packedMatType const B = SIMD[i]; + Error += glm::all(glm::equal(A, B, static_cast(0.001))) ? 0 : 1; + assert(!Error); + } + + return Error; +} + +int main() +{ + std::size_t const Samples = 100000; + + int Error = 0; + + std::printf("glm::inverse(mat2):\n"); + Error += comp_mat2_inverse(Samples); + + std::printf("glm::inverse(dmat2):\n"); + Error += comp_mat2_inverse(Samples); + + std::printf("glm::inverse(mat3):\n"); + Error += comp_mat3_inverse(Samples); + + std::printf("glm::inverse(dmat3):\n"); + Error += comp_mat3_inverse(Samples); + + std::printf("glm::inverse(mat4):\n"); + Error += comp_mat4_inverse(Samples); + + std::printf("glm::inverse(dmat4):\n"); + Error += comp_mat4_inverse(Samples); + + return Error; +} + +#else + +int main() +{ + return 0; +} + +#endif diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/perf/perf_matrix_mul.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/perf/perf_matrix_mul.cpp new file mode 100644 index 0000000000000000000000000000000000000000..007735e2bc8eefd015bc8f94f7faf2196307d6ce --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/perf/perf_matrix_mul.cpp @@ -0,0 +1,154 @@ +#define GLM_FORCE_INLINE +#include +#include +#include +#include +#include +#include +#include +#include +#include +#if GLM_CONFIG_SIMD == GLM_ENABLE +#include +#include +#include +#include + +template +static void test_mat_mul_mat(matType const& M, std::vector const& I, std::vector& O) +{ + for (std::size_t i = 0, n = I.size(); i < n; ++i) + O[i] = M * I[i]; +} + +template +static int launch_mat_mul_mat(std::vector& O, matType const& Transform, matType const& Scale, std::size_t Samples) +{ + typedef typename matType::value_type T; + + std::vector I(Samples); + O.resize(Samples); + + for(std::size_t i = 0; i < Samples; ++i) + I[i] = Scale * static_cast(i); + + std::chrono::high_resolution_clock::time_point t1 = std::chrono::high_resolution_clock::now(); + test_mat_mul_mat(Transform, I, O); + std::chrono::high_resolution_clock::time_point t2 = std::chrono::high_resolution_clock::now(); + + return static_cast(std::chrono::duration_cast(t2 - t1).count()); +} + +template +static int comp_mat2_mul_mat2(std::size_t Samples) +{ + typedef typename packedMatType::value_type T; + + int Error = 0; + + packedMatType const Transform(1, 2, 3, 4); + packedMatType const Scale(0.01, 0.02, 0.03, 0.05); + + std::vector SISD; + std::printf("- SISD: %d us\n", launch_mat_mul_mat(SISD, Transform, Scale, Samples)); + + std::vector SIMD; + std::printf("- SIMD: %d us\n", launch_mat_mul_mat(SIMD, Transform, Scale, Samples)); + + for(std::size_t i = 0; i < Samples; ++i) + { + packedMatType const A = SISD[i]; + packedMatType const B = SIMD[i]; + Error += glm::all(glm::equal(A, B, static_cast(0.001))) ? 0 : 1; + } + + return Error; +} + +template +static int comp_mat3_mul_mat3(std::size_t Samples) +{ + typedef typename packedMatType::value_type T; + + int Error = 0; + + packedMatType const Transform(1, 2, 3, 4, 5, 6, 7, 8, 9); + packedMatType const Scale(0.01, 0.02, 0.03, 0.05, 0.01, 0.02, 0.03, 0.05, 0.01); + + std::vector SISD; + std::printf("- SISD: %d us\n", launch_mat_mul_mat(SISD, Transform, Scale, Samples)); + + std::vector SIMD; + std::printf("- SIMD: %d us\n", launch_mat_mul_mat(SIMD, Transform, Scale, Samples)); + + for(std::size_t i = 0; i < Samples; ++i) + { + packedMatType const A = SISD[i]; + packedMatType const B = SIMD[i]; + Error += glm::all(glm::equal(A, B, static_cast(0.001))) ? 0 : 1; + } + + return Error; +} + +template +static int comp_mat4_mul_mat4(std::size_t Samples) +{ + typedef typename packedMatType::value_type T; + + int Error = 0; + + packedMatType const Transform(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); + packedMatType const Scale(0.01, 0.02, 0.03, 0.05, 0.01, 0.02, 0.03, 0.05, 0.01, 0.02, 0.03, 0.05, 0.01, 0.02, 0.03, 0.05); + + std::vector SISD; + std::printf("- SISD: %d us\n", launch_mat_mul_mat(SISD, Transform, Scale, Samples)); + + std::vector SIMD; + std::printf("- SIMD: %d us\n", launch_mat_mul_mat(SIMD, Transform, Scale, Samples)); + + for(std::size_t i = 0; i < Samples; ++i) + { + packedMatType const A = SISD[i]; + packedMatType const B = SIMD[i]; + Error += glm::all(glm::equal(A, B, static_cast(0.001))) ? 0 : 1; + } + + return Error; +} + +int main() +{ + std::size_t const Samples = 100000; + + int Error = 0; + + std::printf("mat2 * mat2:\n"); + Error += comp_mat2_mul_mat2(Samples); + + std::printf("dmat2 * dmat2:\n"); + Error += comp_mat2_mul_mat2(Samples); + + std::printf("mat3 * mat3:\n"); + Error += comp_mat3_mul_mat3(Samples); + + std::printf("dmat3 * dmat3:\n"); + Error += comp_mat3_mul_mat3(Samples); + + std::printf("mat4 * mat4:\n"); + Error += comp_mat4_mul_mat4(Samples); + + std::printf("dmat4 * dmat4:\n"); + Error += comp_mat4_mul_mat4(Samples); + + return Error; +} + +#else + +int main() +{ + return 0; +} + +#endif diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/perf/perf_matrix_mul_vector.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/perf/perf_matrix_mul_vector.cpp new file mode 100644 index 0000000000000000000000000000000000000000..eef776cc14bd345dac91a5b34f30a691efa4decc --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/perf/perf_matrix_mul_vector.cpp @@ -0,0 +1,154 @@ +#define GLM_FORCE_INLINE +#include +#include +#include +#include +#include +#include +#include +#include +#include +#if GLM_CONFIG_SIMD == GLM_ENABLE +#include +#include +#include +#include + +template +static void test_mat_mul_vec(matType const& M, std::vector const& I, std::vector& O) +{ + for (std::size_t i = 0, n = I.size(); i < n; ++i) + O[i] = M * I[i]; +} + +template +static int launch_mat_mul_vec(std::vector& O, matType const& Transform, vecType const& Scale, std::size_t Samples) +{ + typedef typename matType::value_type T; + + std::vector I(Samples); + O.resize(Samples); + + for(std::size_t i = 0; i < Samples; ++i) + I[i] = Scale * static_cast(i); + + std::chrono::high_resolution_clock::time_point t1 = std::chrono::high_resolution_clock::now(); + test_mat_mul_vec(Transform, I, O); + std::chrono::high_resolution_clock::time_point t2 = std::chrono::high_resolution_clock::now(); + + return static_cast(std::chrono::duration_cast(t2 - t1).count()); +} + +template +static int comp_mat2_mul_vec2(std::size_t Samples) +{ + typedef typename packedMatType::value_type T; + + int Error = 0; + + packedMatType const Transform(1, 2, 3, 4); + packedVecType const Scale(0.01, 0.02); + + std::vector SISD; + std::printf("- SISD: %d us\n", launch_mat_mul_vec(SISD, Transform, Scale, Samples)); + + std::vector SIMD; + std::printf("- SIMD: %d us\n", launch_mat_mul_vec(SIMD, Transform, Scale, Samples)); + + for(std::size_t i = 0; i < Samples; ++i) + { + packedVecType const A = SISD[i]; + packedVecType const B = packedVecType(SIMD[i]); + Error += glm::all(glm::equal(A, B, static_cast(0.001))) ? 0 : 1; + } + + return Error; +} + +template +static int comp_mat3_mul_vec3(std::size_t Samples) +{ + typedef typename packedMatType::value_type T; + + int Error = 0; + + packedMatType const Transform(1, 2, 3, 4, 5, 6, 7, 8, 9); + packedVecType const Scale(0.01, 0.02, 0.05); + + std::vector SISD; + std::printf("- SISD: %d us\n", launch_mat_mul_vec(SISD, Transform, Scale, Samples)); + + std::vector SIMD; + std::printf("- SIMD: %d us\n", launch_mat_mul_vec(SIMD, Transform, Scale, Samples)); + + for(std::size_t i = 0; i < Samples; ++i) + { + packedVecType const A = SISD[i]; + packedVecType const B = SIMD[i]; + Error += glm::all(glm::equal(A, B, static_cast(0.001))) ? 0 : 1; + } + + return Error; +} + +template +static int comp_mat4_mul_vec4(std::size_t Samples) +{ + typedef typename packedMatType::value_type T; + + int Error = 0; + + packedMatType const Transform(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); + packedVecType const Scale(0.01, 0.02, 0.03, 0.05); + + std::vector SISD; + std::printf("- SISD: %d us\n", launch_mat_mul_vec(SISD, Transform, Scale, Samples)); + + std::vector SIMD; + std::printf("- SIMD: %d us\n", launch_mat_mul_vec(SIMD, Transform, Scale, Samples)); + + for(std::size_t i = 0; i < Samples; ++i) + { + packedVecType const A = SISD[i]; + packedVecType const B = SIMD[i]; + Error += glm::all(glm::equal(A, B, static_cast(0.001))) ? 0 : 1; + } + + return Error; +} + +int main() +{ + std::size_t const Samples = 100000; + + int Error = 0; + + std::printf("mat2 * vec2:\n"); + Error += comp_mat2_mul_vec2(Samples); + + std::printf("dmat2 * dvec2:\n"); + Error += comp_mat2_mul_vec2(Samples); + + std::printf("mat3 * vec3:\n"); + Error += comp_mat3_mul_vec3(Samples); + + std::printf("dmat3 * dvec3:\n"); + Error += comp_mat3_mul_vec3(Samples); + + std::printf("mat4 * vec4:\n"); + Error += comp_mat4_mul_vec4(Samples); + + std::printf("dmat4 * dvec4:\n"); + Error += comp_mat4_mul_vec4(Samples); + + return Error; +} + +#else + +int main() +{ + return 0; +} + +#endif diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/perf/perf_matrix_transpose.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/perf/perf_matrix_transpose.cpp new file mode 100644 index 0000000000000000000000000000000000000000..7d6aaec73ba00084ea99160197ed424a131b115e --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/perf/perf_matrix_transpose.cpp @@ -0,0 +1,150 @@ +#define GLM_FORCE_INLINE +#include +#include +#include +#include +#include +#if GLM_CONFIG_SIMD == GLM_ENABLE +#include +#include +#include +#include + +template +static void test_mat_transpose(std::vector const& I, std::vector& O) +{ + for (std::size_t i = 0, n = I.size(); i < n; ++i) + O[i] = glm::transpose(I[i]); +} + +template +static int launch_mat_transpose(std::vector& O, matType const& Scale, std::size_t Samples) +{ + typedef typename matType::value_type T; + + std::vector I(Samples); + O.resize(Samples); + + for(std::size_t i = 0; i < Samples; ++i) + I[i] = Scale * static_cast(i) + Scale; + + std::chrono::high_resolution_clock::time_point t1 = std::chrono::high_resolution_clock::now(); + test_mat_transpose(I, O); + std::chrono::high_resolution_clock::time_point t2 = std::chrono::high_resolution_clock::now(); + + return static_cast(std::chrono::duration_cast(t2 - t1).count()); +} + +template +static int comp_mat2_transpose(std::size_t Samples) +{ + typedef typename packedMatType::value_type T; + + int Error = 0; + + packedMatType const Scale(0.01, 0.02, 0.03, 0.05); + + std::vector SISD; + std::printf("- SISD: %d us\n", launch_mat_transpose(SISD, Scale, Samples)); + + std::vector SIMD; + std::printf("- SIMD: %d us\n", launch_mat_transpose(SIMD, Scale, Samples)); + + for(std::size_t i = 0; i < Samples; ++i) + { + packedMatType const A = SISD[i]; + packedMatType const B = SIMD[i]; + Error += glm::all(glm::equal(A, B, static_cast(0.001))) ? 0 : 1; + assert(!Error); + } + + return Error; +} + +template +static int comp_mat3_transpose(std::size_t Samples) +{ + typedef typename packedMatType::value_type T; + + int Error = 0; + + packedMatType const Scale(0.01, 0.02, 0.03, 0.05, 0.01, 0.02, 0.03, 0.05, 0.01); + + std::vector SISD; + std::printf("- SISD: %d us\n", launch_mat_transpose(SISD, Scale, Samples)); + + std::vector SIMD; + std::printf("- SIMD: %d us\n", launch_mat_transpose(SIMD, Scale, Samples)); + + for(std::size_t i = 0; i < Samples; ++i) + { + packedMatType const A = SISD[i]; + packedMatType const B = SIMD[i]; + Error += glm::all(glm::equal(A, B, static_cast(0.001))) ? 0 : 1; + assert(!Error); + } + + return Error; +} + +template +static int comp_mat4_transpose(std::size_t Samples) +{ + typedef typename packedMatType::value_type T; + + int Error = 0; + + packedMatType const Scale(0.01, 0.02, 0.05, 0.04, 0.02, 0.08, 0.05, 0.01, 0.08, 0.03, 0.05, 0.06, 0.02, 0.03, 0.07, 0.05); + + std::vector SISD; + std::printf("- SISD: %d us\n", launch_mat_transpose(SISD, Scale, Samples)); + + std::vector SIMD; + std::printf("- SIMD: %d us\n", launch_mat_transpose(SIMD, Scale, Samples)); + + for(std::size_t i = 0; i < Samples; ++i) + { + packedMatType const A = SISD[i]; + packedMatType const B = SIMD[i]; + Error += glm::all(glm::equal(A, B, static_cast(0.001))) ? 0 : 1; + assert(!Error); + } + + return Error; +} + +int main() +{ + std::size_t const Samples = 100000; + + int Error = 0; + + std::printf("glm::transpose(mat2):\n"); + Error += comp_mat2_transpose(Samples); + + std::printf("glm::transpose(dmat2):\n"); + Error += comp_mat2_transpose(Samples); + + std::printf("glm::transpose(mat3):\n"); + Error += comp_mat3_transpose(Samples); + + std::printf("glm::transpose(dmat3):\n"); + Error += comp_mat3_transpose(Samples); + + std::printf("glm::transpose(mat4):\n"); + Error += comp_mat4_transpose(Samples); + + std::printf("glm::transpose(dmat4):\n"); + Error += comp_mat4_transpose(Samples); + + return Error; +} + +#else + +int main() +{ + return 0; +} + +#endif diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/perf/perf_vector_mul_matrix.cpp b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/perf/perf_vector_mul_matrix.cpp new file mode 100644 index 0000000000000000000000000000000000000000..a32cca75f05a108ca98cadcc0b42dfa4d553ce21 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/test/perf/perf_vector_mul_matrix.cpp @@ -0,0 +1,154 @@ +#define GLM_FORCE_INLINE +#include +#include +#include +#include +#include +#include +#include +#include +#include +#if GLM_CONFIG_SIMD == GLM_ENABLE +#include +#include +#include +#include + +template +static void test_vec_mul_mat(matType const& M, std::vector const& I, std::vector& O) +{ + for (std::size_t i = 0, n = I.size(); i < n; ++i) + O[i] = I[i] * M; +} + +template +static int launch_vec_mul_mat(std::vector& O, matType const& Transform, vecType const& Scale, std::size_t Samples) +{ + typedef typename matType::value_type T; + + std::vector I(Samples); + O.resize(Samples); + + for(std::size_t i = 0; i < Samples; ++i) + I[i] = Scale * static_cast(i); + + std::chrono::high_resolution_clock::time_point t1 = std::chrono::high_resolution_clock::now(); + test_vec_mul_mat(Transform, I, O); + std::chrono::high_resolution_clock::time_point t2 = std::chrono::high_resolution_clock::now(); + + return static_cast(std::chrono::duration_cast(t2 - t1).count()); +} + +template +static int comp_vec2_mul_mat2(std::size_t Samples) +{ + typedef typename packedMatType::value_type T; + + int Error = 0; + + packedMatType const Transform(1, 2, 3, 4); + packedVecType const Scale(0.01, 0.02); + + std::vector SISD; + std::printf("- SISD: %d us\n", launch_vec_mul_mat(SISD, Transform, Scale, Samples)); + + std::vector SIMD; + std::printf("- SIMD: %d us\n", launch_vec_mul_mat(SIMD, Transform, Scale, Samples)); + + for(std::size_t i = 0; i < Samples; ++i) + { + packedVecType const A = SISD[i]; + packedVecType const B = packedVecType(SIMD[i]); + Error += glm::all(glm::equal(A, B, static_cast(0.001))) ? 0 : 1; + } + + return Error; +} + +template +static int comp_vec3_mul_mat3(std::size_t Samples) +{ + typedef typename packedMatType::value_type T; + + int Error = 0; + + packedMatType const Transform(1, 2, 3, 4, 5, 6, 7, 8, 9); + packedVecType const Scale(0.01, 0.02, 0.05); + + std::vector SISD; + std::printf("- SISD: %d us\n", launch_vec_mul_mat(SISD, Transform, Scale, Samples)); + + std::vector SIMD; + std::printf("- SIMD: %d us\n", launch_vec_mul_mat(SIMD, Transform, Scale, Samples)); + + for(std::size_t i = 0; i < Samples; ++i) + { + packedVecType const A = SISD[i]; + packedVecType const B = SIMD[i]; + Error += glm::all(glm::equal(A, B, static_cast(0.001))) ? 0 : 1; + } + + return Error; +} + +template +static int comp_vec4_mul_mat4(std::size_t Samples) +{ + typedef typename packedMatType::value_type T; + + int Error = 0; + + packedMatType const Transform(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); + packedVecType const Scale(0.01, 0.02, 0.03, 0.05); + + std::vector SISD; + std::printf("- SISD: %d us\n", launch_vec_mul_mat(SISD, Transform, Scale, Samples)); + + std::vector SIMD; + std::printf("- SIMD: %d us\n", launch_vec_mul_mat(SIMD, Transform, Scale, Samples)); + + for(std::size_t i = 0; i < Samples; ++i) + { + packedVecType const A = SISD[i]; + packedVecType const B = SIMD[i]; + Error += glm::all(glm::equal(A, B, static_cast(0.001))) ? 0 : 1; + } + + return Error; +} + +int main() +{ + std::size_t const Samples = 100000; + + int Error = 0; + + std::printf("vec2 * mat2:\n"); + Error += comp_vec2_mul_mat2(Samples); + + std::printf("dvec2 * dmat2:\n"); + Error += comp_vec2_mul_mat2(Samples); + + std::printf("vec3 * mat3:\n"); + Error += comp_vec3_mul_mat3(Samples); + + std::printf("dvec3 * dmat3:\n"); + Error += comp_vec3_mul_mat3(Samples); + + std::printf("vec4 * mat4:\n"); + Error += comp_vec4_mul_mat4(Samples); + + std::printf("dvec4 * dmat4:\n"); + Error += comp_vec4_mul_mat4(Samples); + + return Error; +} + +#else + +int main() +{ + return 0; +} + +#endif diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/util/autoexp.txt b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/util/autoexp.txt new file mode 100644 index 0000000000000000000000000000000000000000..806976ed4a019c5584bed8f30c686422730435a5 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/util/autoexp.txt @@ -0,0 +1,28 @@ +[Visualizer] + +glm::detail::tvec2<*>{ + preview ( + #(#($c.x,$c.y)) + ) + children ( + #([x]: $c.x,[y]: $c.y) + ) +} + +glm::detail::tvec3<*>{ + preview ( + #($e.x,$e.y,$e.z) + ) + children ( + #([x]: $e.x,[y]: $e.y,[z]: $e.z) + ) +} + +glm::detail::tvec4<*>{ + preview ( + #($c.x,$c.y,$c.z,$c.w) + ) + children ( + #([x]: $e.x,[y]: $e.y,[z]: $e.z, #([w]: $e.w)) + ) +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/util/autoexp.vc2010.dat b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/util/autoexp.vc2010.dat new file mode 100644 index 0000000000000000000000000000000000000000..18c167260fdfa5bdaa4a1931c77c607dd81b43a9 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/util/autoexp.vc2010.dat @@ -0,0 +1,3896 @@ +; AutoExp.Dat - templates for automatically expanding data +; Copyright(c) Microsoft Corporation. All Rights Reserved. +;--------------------------------------------------------------- +; +; While debugging, Data Tips and items in the Watch and Variable +; windows are automatically expanded to show their most important +; elements. The expansion follows the format given by the rules +; in this file. You can add rules for your types or change the +; predefined rules. +; +; For good examples, read the rules in this file. +; +; To find what the debugger considers the type of a variable to +; be, add it to the Watch window and look at the Type column. +; +; An AutoExpand rule is a line with the name of a type, an equals +; sign, and text with replaceable parts in angle brackets. The +; part in angle brackets names a member of the type and an +; optional Watch format specifier. +; +; AutoExpand rules use the following syntax. The equals sign (=), +; angle brackets (<>), and comma are taken literally. Square +; brackets ([]) indicate optional items. +; +; type=[text]... +; +; type Name of the type (may be followed by <*> for template +; types such as the ATL types listed below). +; +; text Any text.Usually the name of the member to display, +; or a shorthand name for the member. +; +; member Name of a member to display. +; +; format Watch format specifier. One of the following: +; +; Letter Description Sample Display +; ------ -------------------------- ------------ ------------- +; d,i Signed decimal integer 0xF000F065,d -268373915 +; u Unsigned decimal integer 0x0065,u 101 +; o Unsigned octal integer 0xF065,o 0170145 +; x,X Hexadecimal integer 61541,X 0X0000F065 +; l,h long or short prefix for 00406042,hx 0x0c22 +; d, i, u, o, x, X +; f Signed floating-point 3./2.,f 1.500000 +; e Signed scientific-notation 3./2.,e 1.500000e+000 +; g Shorter of e and f 3./2.,g 1.5 +; c Single character 0x0065,c 'e' +; s Zero-terminated string pVar,s "Hello world" +; su Unicode string pVar,su "Hello world" +; +; For details of other format specifiers see Help under: +; "format specifiers/watch variable" +; +; The special format <,t> specifies the name of the most-derived +; type of the object. This is especially useful with pointers or +; references to a base class. +; +; If there is no rule for a class, the base classes are checked for +; a matching rule. +; +; There are some special entries allowed in the AutoExpand section: +; $BUILTIN is used to display more complex types that need to do more +; than just show a member variable or two. +; $ADDIN allows external DLLs to be added to display even more complex +; types via the EE Add-in API. The first argument is the DLL name, the +; second argument is the name of the export from the DLL to use. For +; further information on this API see the sample called EEAddIn. +; +; WARNING: if hexadecimal mode is on in the watch window, all numbers here are +; evaluated in hex, e.g. 42 becomes 0x42 + +[AutoExpand] + +; from windef.h +tagPOINT =x= y= +tagRECT =top= bottom= left= right= + +; from winuser.h +tagMSG =msg= wp= lp= + +; intrinsics +__m64 = +__m128=$BUILTIN(M128) +__m128i=$BUILTIN(M128I) +__m128d=$BUILTIN(M128D) + +; from afxwin.h +CDC =hDC= attrib= +CPaintDC =<,t> hWnd= +CPoint =x= y= +CRect =top= bottom= left= right= +CSize =cx= cy= +CWnd =<,t> hWnd= +CWinApp =<,t> +CWinThread =<,t> h= proc= + +; from afxcoll.h +CPtrList =cnt= + +; from afxstat_.h +CProcessLocalObject =<,t> +CThreadLocalObject =<,t> + +; from afx.h +CArchiveException =cause= +CFile =hFile= name= +CFileException =cause= OS Error=m_lOsError +CMemFile =pos= size= +CObject =<,t> +CRuntimeClass = +CStdioFile =FILE*= name= +CTimeSpan =time= +CTime =time= + +; from afxcoll.h +CByteArray =count= +CStringList =count= +; same for all CXXXArray classes +; same for CXXXList +; same for CMapXXToXX + +; various string classes from MFC & ATL + +_com_error= +_bstr_t=m_wstr,su> (m_RefCount,u>) +_com_ptr_t<*>= +_LARGE_INTEGER= +_ULARGE_INTEGER= +ATL::CComPtr<*>=

+ +ATL::CComQIPtr<*>=

+ +tagVARIANT=$BUILTIN(VARIANT) +VARIANT=$BUILTIN(VARIANT) +_GUID=$BUILTIN(GUID) + +; see EEAddIn sample for how to use these +;_SYSTEMTIME=$ADDIN(EEAddIn.dll,AddIn_SystemTime) +;_FILETIME=$ADDIN(EEAddIn.dll,AddIn_FileTime) + +[Visualizer] +; This section contains visualizers for STL and ATL containers +; DO NOT MODIFY +ATL::CStringT|CSimpleStringT|ATL::CSimpleStringT{ + preview ([$e.m_pszData,s]) + stringview ([$e.m_pszData,sb]) +} +ATL::CStringT|CSimpleStringT|ATL::CSimpleStringT|ATL::CStringT|CSimpleStringT|ATL::CSimpleStringT{ + preview ([$e.m_pszData,su]) + stringview ([$e.m_pszData,sub]) +} +ATL::CComBSTR{ + preview ([$e.m_str,su]) + stringview ([$e.m_str,sub]) +} + + +; Many visualizers use nested #()s. +; Why not use #(foo, bar) instead of #(#(foo), #(bar))? +; The former alphabetically sorts its fields, while the latter does not. + +;------------------------------------------------------------------------------ +; std::pair from +;------------------------------------------------------------------------------ +std::pair<*>{ + ; pair is previewed with "(, )". + preview ( + #( + "(", + $e.first, + ", ", + $e.second, + ")" + ) + ) + + ; We gloss over the fact that first and second are actually stored in _Pair_base. + children ( + #( + #(first : $e.first), + #(second : $e.second) + ) + ) +} + +;------------------------------------------------------------------------------ +; std::plus, etc. from +;------------------------------------------------------------------------------ +; STL functors are previewed with their names. +; They have no state, so they have no children. +std::plus<*>{ + preview ( "plus" ) + children ( #array(expr: 0, size: 0) ) +} +std::minus<*>{ + preview ( "minus" ) + children ( #array(expr: 0, size: 0) ) +} +std::multiplies<*>{ + preview ( "multiplies" ) + children ( #array(expr: 0, size: 0) ) +} +std::divides<*>{ + preview ( "divides" ) + children ( #array(expr: 0, size: 0) ) +} +std::modulus<*>{ + preview ( "modulus" ) + children ( #array(expr: 0, size: 0) ) +} +std::negate<*>{ + preview ( "negate" ) + children ( #array(expr: 0, size: 0) ) +} +std::equal_to<*>{ + preview ( "equal_to" ) + children ( #array(expr: 0, size: 0) ) +} +std::not_equal_to<*>{ + preview ( "not_equal_to" ) + children ( #array(expr: 0, size: 0) ) +} +std::greater<*>{ + preview ( "greater" ) + children ( #array(expr: 0, size: 0) ) +} +std::less<*>{ + preview ( "less" ) + children ( #array(expr: 0, size: 0) ) +} +std::greater_equal<*>{ + preview ( "greater_equal" ) + children ( #array(expr: 0, size: 0) ) +} +std::less_equal<*>{ + preview ( "less_equal" ) + children ( #array(expr: 0, size: 0) ) +} +std::logical_and<*>{ + preview ( "logical_and" ) + children ( #array(expr: 0, size: 0) ) +} +std::logical_or<*>{ + preview ( "logical_or" ) + children ( #array(expr: 0, size: 0) ) +} +std::logical_not<*>{ + preview ( "logical_not" ) + children ( #array(expr: 0, size: 0) ) +} + +;------------------------------------------------------------------------------ +; std::not1() from +; std::not2() from +;------------------------------------------------------------------------------ +; STL negators are previewed with "not[12]()". +; They have a child with the fake name of [pred], so that the +; stored functor can be inspected. +std::unary_negate<*>{ + preview ( + #( + "not1(", + $e._Functor, + ")" + ) + ) + + children ( + #([pred] : $e._Functor) + ) +} +std::binary_negate<*>{ + preview ( + #( + "not2(", + $e._Functor, + ")" + ) + ) + + children ( + #([pred] : $e._Functor) + ) +} + +;------------------------------------------------------------------------------ +; std::bind1st() from +; std::bind2nd() from +;------------------------------------------------------------------------------ +; STL binders are previewed with "bind1st(, )" or "bind2nd(, )". +; We gloss over the fact that they derive from unary_function. +std::binder1st<*>{ + preview ( + #( + "bind1st(", + $e.op, + ", ", + $e.value, + ")" + ) + ) + + children ( + #( + #(op : $e.op), + #(value : $e.value) + ) + ) +} +std::binder2nd<*>{ + preview ( + #( + "bind2nd(", + $e.op, + ", ", + $e.value, + ")" + ) + ) + + children ( + #( + #(op : $e.op), + #(value : $e.value) + ) + ) +} + +;------------------------------------------------------------------------------ +; std::ptr_fun() from +;------------------------------------------------------------------------------ +; STL function pointer adaptors are previewed with "ptr_fun()". +; Function pointers have no children, so the adaptors have no children. +std::pointer_to_unary_function<*>|std::pointer_to_binary_function<*>{ + preview ( + #( + "ptr_fun(", + $e._Pfun, + ")" + ) + ) + + children ( #array(expr: 0, size: 0) ) +} + +;------------------------------------------------------------------------------ +; std::mem_fun() from +; std::mem_fun_ref() from +;------------------------------------------------------------------------------ +; See ptr_fun(). +std::mem_fun_t<*>|std::mem_fun1_t<*>|std::const_mem_fun_t<*>|std::const_mem_fun1_t<*>{ + preview ( + #( + "mem_fun(", + $e._Pmemfun, + ")" + ) + ) + + children ( #array(expr: 0, size: 0) ) +} +std::mem_fun_ref_t<*>|std::mem_fun1_ref_t<*>|std::const_mem_fun_ref_t<*>|std::const_mem_fun1_ref_t<*>{ + preview ( + #( + "mem_fun_ref(", + $e._Pmemfun, + ")" + ) + ) + + children ( #array(expr: 0, size: 0) ) +} + +;------------------------------------------------------------------------------ +; std::auto_ptr from +;------------------------------------------------------------------------------ +std::auto_ptr<*>{ + ; An empty auto_ptr is previewed with "empty". + ; Otherwise, it is previewed with "auto_ptr ". + preview ( + #if ($e._Myptr == 0) ( + "empty" + ) #else ( + #( + "auto_ptr ", + *$e._Myptr + ) + ) + ) + + ; An empty auto_ptr has no children. + ; Otherwise, it has a single child, its stored pointer, with a fake name of [ptr]. + children ( + #if ($e._Myptr == 0) ( + #array(expr: 0, size: 0) + ) #else ( + #([ptr] : $e._Myptr) + ) + ) +} + +;------------------------------------------------------------------------------ +; std::basic_string from +;------------------------------------------------------------------------------ +; basic_string is previewed with its stored string. +; It has [size] and [capacity] children, followed by [0], [1], [2], etc. children +; displaying its stored characters. +; The ($e._Myres) < ($e._BUF_SIZE) test determines whether the Small String Optimization +; is in effect. +; NOTE: The parentheses in ($e._Myres) < ($e._BUF_SIZE) are necessary. +std::basic_string{ + preview ( #if (($e._Myres) < ($e._BUF_SIZE)) ( [$e._Bx._Buf,s] ) #else ( [$e._Bx._Ptr,s] )) + stringview ( #if (($e._Myres) < ($e._BUF_SIZE)) ( [$e._Bx._Buf,sb] ) #else ( [$e._Bx._Ptr,sb] )) + + children ( + #( + #([size] : $e._Mysize), + #([capacity] : $e._Myres), + #if (($e._Myres) < ($e._BUF_SIZE)) ( + #array(expr: $e._Bx._Buf[$i], size: $e._Mysize) + ) #else ( + #array(expr: $e._Bx._Ptr[$i], size: $e._Mysize) + ) + ) + ) +} +std::basic_string|std::basic_string{ + preview ( #if (($e._Myres) < ($e._BUF_SIZE)) ( [$e._Bx._Buf,su] ) #else ( [$e._Bx._Ptr,su] )) + stringview ( #if (($e._Myres) < ($e._BUF_SIZE)) ( [$e._Bx._Buf,sub] ) #else ( [$e._Bx._Ptr,sub] )) + + children ( + #( + #([size] : $e._Mysize), + #([capacity] : $e._Myres), + #if (($e._Myres) < ($e._BUF_SIZE)) ( + #array(expr: $e._Bx._Buf[$i], size: $e._Mysize) + ) #else ( + #array(expr: $e._Bx._Ptr[$i], size: $e._Mysize) + ) + ) + ) +} +std::_String_iterator|std::_String_const_iterator{ + preview ( [$e._Ptr,s] ) + stringview ( [$e._Ptr,sb] ) + children ( #([ptr] : $e._Ptr) ) +} +std::_String_iterator|std::_String_const_iterator|std::_String_iterator|std::_String_const_iterator{ + preview ( [$e._Ptr,su] ) + stringview ( [$e._Ptr,sub] ) + children ( #([ptr] : $e._Ptr) ) +} + +;------------------------------------------------------------------------------ +; std::vector from +;------------------------------------------------------------------------------ +; Despite its packed representation, vector is visualized like vector. +std::vector{ + preview ( + #( + "[", + $e._Mysize, + "](", + #array( + expr: (bool)(($e._Myvec._Myfirst[$i / _VBITS] >> ($i % _VBITS)) & 1), + size: $e._Mysize + ), + ")" + ) + ) + + children ( + #( + #([size] : $e._Mysize), + #([capacity] : ($e._Myvec._Myend - $e._Myvec._Myfirst) * _VBITS), + #array( + expr: (bool)(($e._Myvec._Myfirst[$i / _VBITS] >> ($i % _VBITS)) & 1), + size: $e._Mysize + ) + ) + ) +} +std::_Vb_reference<*>|std::_Vb_iterator<*>|std::_Vb_const_iterator<*>{ + preview ( + (bool)((*$e._Myptr >> $e._Myoff) & 1) + ) + + children ( + #( + #([ptr] : $e._Myptr), + #([offset] : $e._Myoff) + ) + ) +} + +;------------------------------------------------------------------------------ +; std::vector from +;------------------------------------------------------------------------------ +; vector is previewed with "[]()". +; It has [size] and [capacity] children, followed by its elements. +; The other containers follow its example. +std::vector<*>{ + preview ( + #( + "[", + $e._Mylast - $e._Myfirst, + "](", + #array( + expr: $e._Myfirst[$i], + size: $e._Mylast - $e._Myfirst + ), + ")" + ) + ) + + children ( + #( + #([size] : $e._Mylast - $e._Myfirst), + #([capacity] : $e._Myend - $e._Myfirst), + #array( + expr: $e._Myfirst[$i], + size: $e._Mylast - $e._Myfirst + ) + ) + ) +} +std::_Vector_iterator<*>|std::_Vector_const_iterator<*>{ + preview ( + *$e._Ptr + ) + + children ( + #([ptr] : $e._Ptr) + ) +} + +;------------------------------------------------------------------------------ +; std::deque from +;------------------------------------------------------------------------------ +std::deque<*>{ + preview ( + #( + "[", + $e._Mysize, + "](", + #array( + expr: $e._Map[(($i + $e._Myoff) / $e._EEN_DS) % $e._Mapsize][($i + $e._Myoff) % $e._EEN_DS], + size: $e._Mysize + ), + ")" + ) + ) + + children ( + #( + #array( + expr: $e._Map[(($i + $e._Myoff) / $e._EEN_DS) % $e._Mapsize][($i + $e._Myoff) % $e._EEN_DS], + size: $e._Mysize + ) + ) + ) +} +std::_Deque_iterator<*,*>|std::_Deque_const_iterator<*,*>{ + preview ( + #if ($e._Myoff >= ((std::deque<$T1,$T2> *)$e._Myproxy->_Mycont)->_Myoff + ((std::deque<$T1,$T2> *)$e._Myproxy->_Mycont)->_Mysize) ( + "end" + ) #else ( + ((std::deque<$T1,$T2> *)$e._Myproxy->_Mycont)->_Map[($e._Myoff / ((std::deque<$T1,$T2> *)$e._Myproxy->_Mycont)->_EEN_DS) % ((std::deque<$T1,$T2> *)$e._Myproxy->_Mycont)->_Mapsize][$e._Myoff % ((std::deque<$T1,$T2> *)$e._Myproxy->_Mycont)->_EEN_DS] + ) + ) + + children ( + #if ($e._Myoff >= ((std::deque<$T1,$T2> *)$e._Myproxy->_Mycont)->_Myoff + ((std::deque<$T1,$T2> *)$e._Myproxy->_Mycont)->_Mysize) ( + #array(expr: 0, size: 0) + ) #else ( + #( + #([index] : $e._Myoff - ((std::deque<$T1,$T2> *)$e._Myproxy->_Mycont)->_Myoff), + #([ptr] : &((std::deque<$T1,$T2> *)$e._Myproxy->_Mycont)->_Map[($e._Myoff / ((std::deque<$T1,$T2> *)$e._Myproxy->_Mycont)->_EEN_DS) % ((std::deque<$T1,$T2> *)$e._Myproxy->_Mycont)->_Mapsize][$e._Myoff % ((std::deque<$T1,$T2> *)$e._Myproxy->_Mycont)->_EEN_DS] ) + ) + ) + ) +} + +;------------------------------------------------------------------------------ +; std::list from +;------------------------------------------------------------------------------ +std::list<*>{ + preview ( + #( + "[", + $e._Mysize, + "](", + #list( + head: $e._Myhead->_Next, + size: $e._Mysize, + next: _Next + ) : $e._Myval, + ")" + ) + ) + + children ( + #list( + head: $e._Myhead->_Next, + size: $e._Mysize, + next: _Next + ) : $e._Myval + ) +} +std::_List_iterator<*>|std::_List_const_iterator<*>{ + preview ( $e._Ptr->_Myval ) + children ( #([ptr] : &$e._Ptr->_Myval) ) +} + +;------------------------------------------------------------------------------ +; std::queue from +; std::stack from +;------------------------------------------------------------------------------ +std::queue<*>|std::stack<*>{ + preview ( $e.c ) + children ( #(c : $e.c) ) +} + +;------------------------------------------------------------------------------ +; std::priority_queue from +;------------------------------------------------------------------------------ +std::priority_queue<*>{ + preview ( $e.c ) + + children ( + #( + #(c [heap]: $e.c), + #(comp : $e.comp) + ) + ) +} + +;------------------------------------------------------------------------------ +; std::map from +; std::multimap from +; std::set from +; std::multiset from +;------------------------------------------------------------------------------ +std::map<*>|std::multimap<*>|std::set<*>|std::multiset<*>{ + preview ( + #( + "[", + $e._Mysize, + "](", + #tree( + head: $e._Myhead->_Parent, + skip: $e._Myhead, + left: _Left, + right: _Right, + size: $e._Mysize + ) : $e._Myval, + ")" + ) + ) + + children ( + #( + #([comp] : $e.comp), + #tree( + head: $e._Myhead->_Parent, + skip: $e._Myhead, + left: _Left, + right: _Right, + size: $e._Mysize + ) : $e._Myval + ) + ) +} +std::_Tree_iterator<*>|std::_Tree_const_iterator<*>{ + preview ( $e._Ptr->_Myval ) + children ( #([ptr] : &$e._Ptr->_Myval) ) +} + +;------------------------------------------------------------------------------ +; std::bitset from +;------------------------------------------------------------------------------ +std::bitset<*>{ + preview ( + #( + "[", + $e._EEN_BITS, + "](", + #array( + expr: [($e._Array[$i / $e._Bitsperword] >> ($i % $e._Bitsperword)) & 1,d], + size: $e._EEN_BITS + ), + ")" + ) + ) + + children ( + #array( + expr: [($e._Array[$i / $e._Bitsperword] >> ($i % $e._Bitsperword)) & 1,d], + size: $e._EEN_BITS + ) + ) +} +std::bitset<*>::reference{ + preview ( + [($e._Pbitset->_Array[$i / $e._Pbitset->_Bitsperword] >> ($e._Mypos % $e._Pbitset->_Bitsperword)) & 1,d] + ) + + children ( + #( + #([bitset] : $e._Pbitset), + #([pos] : $e._Mypos) + ) + ) +} + +;------------------------------------------------------------------------------ +; std::reverse_iterator from +;------------------------------------------------------------------------------ +std::reverse_iterator >|std::reverse_iterator >{ + preview ( + #( + "reverse_iterator to ", + $e.current._Ptr[-1] + ) + ) + + children ( + #( + #([to] : $e.current._Ptr - 1), + #(current : $e.current) + ) + ) +} +std::reverse_iterator >|std::reverse_iterator >{ + preview ( + #( + "reverse_iterator to ", + #if ($e.current._Myoff != 0) ( + (bool)((*$e.current._Myptr >> ($e.current._Myoff - 1)) & 1) + ) #else ( + (bool)(($e.current._Myptr[-1] >> (_VBITS - 1)) & 1) + ) + ) + ) + + children ( + #if ($e.current._Myoff != 0) ( + #( + #([to ptr] : $e.current._Myptr), + #([to offset] : $e.current._Myoff - 1), + #(current : $e.current) + ) + ) #else ( + #( + #([to ptr] : $e.current._Myptr - 1), + #([to offset] : _VBITS - 1), + #(current : $e.current) + ) + ) + ) +} +std::reverse_iterator >|std::reverse_iterator >{ + preview ( + #( + "reverse_iterator to ", + $e.current._Ptr[-1] + ) + ) + + children ( + #( + #([to] : $e.current._Ptr - 1), + #(current : $e.current) + ) + ) +} +std::reverse_iterator >|std::reverse_iterator >{ + preview ( + #( + "reverse_iterator to ", + #if ($e.current._Myoff == ((std::deque<$T1,$T2> *)$e.current._Myproxy->_Mycont)->_Myoff) ( + "end" + ) #else ( + ((std::deque<$T1,$T2> *)$e.current._Myproxy->_Mycont)->_Map[(($e.current._Myoff - 1) / ((std::deque<$T1,$T2> *)$e.current._Myproxy->_Mycont)->_EEN_DS) % ((std::deque<$T1,$T2> *)$e.current._Myproxy->_Mycont)->_Mapsize][($e.current._Myoff - 1) % ((std::deque<$T1,$T2> *)$e.current._Myproxy->_Mycont)->_EEN_DS] + ) + ) + ) + + children ( + #if ($e.current._Myoff == ((std::deque<$T1,$T2> *)$e.current._Myproxy->_Mycont)->_Myoff) ( + #(current : $e.current) + ) #else ( + #( + #([to index] : ($e.current._Myoff - 1) - ((std::deque<$T1,$T2> *)$e.current._Myproxy->_Mycont)->_Myoff), + #([to ptr] : &((std::deque<$T1,$T2> *)$e.current._Myproxy->_Mycont)->_Map[(($e.current._Myoff - 1) / ((std::deque<$T1,$T2> *)$e.current._Myproxy->_Mycont)->_EEN_DS) % ((std::deque<$T1,$T2> *)$e.current._Myproxy->_Mycont)->_Mapsize][($e.current._Myoff - 1) % ((std::deque<$T1,$T2> *)$e.current._Myproxy->_Mycont)->_EEN_DS] ), + #(current : $e.current) + ) + ) + ) +} +std::reverse_iterator >|std::reverse_iterator >{ + preview ( + #( + "reverse_iterator to ", + $e.current._Ptr->_Prev->_Myval + ) + ) + + children ( + #( + #([to] : &$e.current._Ptr->_Prev->_Myval), + #(current : $e.current) + ) + ) +} +std::reverse_iterator >|std::reverse_iterator >{ + preview ( + #( + "reverse_iterator to ", + #if ($e.current._EEN_IDL == 0) ( + $e.current._Ptr[-1] + ) #else ( + #if ($e.current._Idx == 0) ( + "end" + ) #else ( + $e.current._Ptr[$e.current._Idx - 1] + ) + ) + ) + ) + + children ( + #if ($e.current._EEN_IDL == 0) ( + #( + #([to] : $e.current._Ptr - 1), + #(current : $e.current) + ) + ) #else ( + #if ($e.current._Idx == 0) ( + #(current : $e.current) + ) #else ( + #( + #([to] : $e.current._Ptr + $e.current._Idx - 1), + #(current : $e.current) + ) + ) + ) + ) +} +std::reverse_iterator<*>{ + preview ( + #( + "reverse_iterator current ", + $e.current + ) + ) + + children ( + #(current : $e.current) + ) +} + +;------------------------------------------------------------------------------ +; std::complex from +;------------------------------------------------------------------------------ +std::complex<*>{ + preview ( + #if ($e._Val[1] == 0) ( + ; Purely real. + $e._Val[0] + ) #else ( + #if ($e._Val[0] == 0) ( + ; Purely imaginary. + #if ($e._Val[1] < 0) ( + #("-i*", -$e._Val[1]) + ) #else ( + #("i*", $e._Val[1]) + ) + ) #else ( + ; Mixed. + #if ($e._Val[1] < 0) ( + #($e._Val[0], "-i*", -$e._Val[1]) + ) #else ( + #($e._Val[0], "+i*", $e._Val[1]) + ) + ) + ) + ) + + children ( + #( + #(real : $e._Val[0]), + #(imag : $e._Val[1]) + ) + ) +} + +;------------------------------------------------------------------------------ +; std::valarray from +;------------------------------------------------------------------------------ +std::valarray<*>{ + preview ( + #( + "[", + $e._Mysize, + "](", + #array( + expr: $e._Myptr[$i], + size: $e._Mysize + ), + ")" + ) + ) + + children ( + #array( + expr: $e._Myptr[$i], + size: $e._Mysize + ) + ) +} + +;------------------------------------------------------------------------------ +; std::tr1::reference_wrapper from +;------------------------------------------------------------------------------ +std::tr1::reference_wrapper<*>{ + preview ( + #if ($e._Callee._EEN_INDIRECT == 1) ( + ; For ordinary T, reference_wrapper stores a T * _Callee._Ptr + ; which is non-null. Actual references are previewed with what they + ; refer to, so reference_wrapper is previewed with dereferencing its + ; stored pointer. + *$e._Callee._Ptr + ) #else ( + ; When T is a pointer to data member type, reference_wrapper + ; stores a T _Callee._Object directly. + $e._Callee._Object + ) + ) + + children ( + #if ($e._Callee._EEN_INDIRECT == 1) ( + ; Actual references have the same children as what they refer to. + ; Unfortunately, there appears to be no way to imitate this exactly. + ; Therefore, we make reference_wrapper appear to have a single + ; child, its stored pointer, with a fake name of [ptr]. + #([ptr] : $e._Callee._Ptr) + ) #else ( + ; When T is a pointer to data member type, T has no children, + ; so we make reference_wrapper appear to have no children. + #array(expr: 0, size: 0) + ) + ) +} + +;------------------------------------------------------------------------------ +; std::tr1::shared_ptr from +;------------------------------------------------------------------------------ +std::tr1::_Ref_count<*>{ + preview ( "default" ) + children ( #array(expr: 0, size: 0) ) +} +std::tr1::_Ref_count_del<*>{ + preview ( "custom deleter" ) + children ( #([deleter] : $e._Dtor) ) +} +std::tr1::_Ref_count_del_alloc<*>{ + preview ( "custom deleter, custom allocator" ) + children ( + #( + #([deleter] : $e._Dtor), + #([allocator] : $e._Myal) + ) + ) +} +std::tr1::_Ref_count_obj<*>{ + preview ( "make_shared" ) + children ( #array(expr: 0, size: 0) ) +} +std::tr1::_Ref_count_obj_alloc<*>{ + preview ( "allocate_shared" ) + children ( #([allocator] : $e._Myal) ) +} +std::tr1::shared_ptr<*>{ + preview ( + ; shared_ptr stores a T * _Ptr . + #if ($e._Ptr == 0) ( + ; A default-constructed shared_ptr has a null _Ptr and a null _Rep, + ; and is formally said to be empty. + ; A shared_ptr constructed from a null pointer has a null _Ptr + ; and a NON-null _Rep . It is formally said to own the null pointer. + ; We preview both with "empty". + "empty" + ) #else ( + ; Raw pointers are previewed with " ". + ; auto_ptr is previewed with "auto_ptr ". + ; Following these examples, shared_ptr is previewed with + ; "shared_ptr [N strong refs, M weak refs]". + #( + "shared_ptr ", + *$e._Ptr, + " [", + $e._Rep->_Uses, + #if ($e._Rep->_Uses == 1) (" strong ref") #else (" strong refs"), + #if ($e._Rep->_Weaks - 1 > 0) ( + #( + ", ", + $e._Rep->_Weaks - 1, + #if ($e._Rep->_Weaks - 1 == 1) (" weak ref") #else (" weak refs") + ) + ), + "] [", + *$e._Rep, + "]" + ) + ; Note: _Rep->_Uses counts how many shared_ptrs share ownership of the object, + ; so we directly display it as the strong reference count. + ; _Rep->_Weaks counts how many shared_ptrs and weak_ptrs share ownership of + ; the "representation object" (or "control block"). All of the shared_ptrs are + ; counted as a single owner. That is, _Weaks is initialized to 1, and when + ; _Uses falls to 0, _Weaks is decremented. This avoids incrementing and decrementing + ; _Weaks every time that a shared_ptr gains or loses ownership. Therefore, + ; _Weaks - 1 is the weak reference count, the number of weak_ptrs that are observing + ; the shared object. + ) + ) + + children ( + #if ($e._Ptr == 0) ( + ; We make empty shared_ptrs (and shared_ptrs that own + ; the null pointer) appear to have no children. + #array(expr: 0, size: 0) + ) #else ( + #( + ; We make shared_ptr appear to have two children: + + ; Its stored pointer, with a fake name of [ptr]. + #([ptr] : $e._Ptr), + + ; Its deleter and allocator, which may be default or custom. + #([deleter and allocator] : *$e._Rep) + ) + ) + ) +} + +;------------------------------------------------------------------------------ +; std::tr1::weak_ptr from +;------------------------------------------------------------------------------ +std::tr1::weak_ptr<*>{ + preview ( + #if ($e._Ptr == 0) ( + "empty" + ) #elif ($e._Rep->_Uses == 0) ( + ; weak_ptr is just like shared_ptr, except that a weak_ptr can be expired. + #( + "expired [", + *$e._Rep, + "]" + ) + ) #else ( + #( + "weak_ptr ", + *$e._Ptr, + " [", + $e._Rep->_Uses, + #if ($e._Rep->_Uses == 1) (" strong ref") #else (" strong refs"), + #if ($e._Rep->_Weaks - 1 > 0) ( + #( + ", ", + $e._Rep->_Weaks - 1, + #if ($e._Rep->_Weaks - 1 == 1) (" weak ref") #else (" weak refs") + ) + ), + "] [", + *$e._Rep, + "]" + ) + ) + ) + + children ( + #if ($e._Ptr == 0) ( + #array(expr: 0, size: 0) + ) #elif ($e._Rep->_Uses == 0) ( + ; When a weak_ptr is expired, we show its deleter and allocator. + ; The deleter has already been used, but the control block has not yet been deallocated. + #([deleter and allocator] : *$e._Rep) + ) #else ( + #( + #([ptr] : $e._Ptr), + #([deleter and allocator] : *$e._Rep) + ) + ) + ) +} + +;------------------------------------------------------------------------------ +; std::tr1::mem_fn() from +;------------------------------------------------------------------------------ +; Note that when mem_fn() is given a data member pointer, it returns a _Call_wrapper<_Callable_pmd<*> > . +; Data member pointers themselves don't have useful previews, so we don't attempt to visualize this. +; When mem_fn() is given a member function pointer, it returns a _Mem_fn[N], which we can visualize. +std::tr1::_Mem_fn1<*>|std::tr1::_Mem_fn2<*>|std::tr1::_Mem_fn3<*>|std::tr1::_Mem_fn4<*>|std::tr1::_Mem_fn5<*>|std::tr1::_Mem_fn6<*>|std::tr1::_Mem_fn7<*>|std::tr1::_Mem_fn8<*>|std::tr1::_Mem_fn9<*>|std::tr1::_Mem_fn10<*>{ + preview ( + ; We preview the functor returned by mem_fn() with "mem_fn()". + #( + "mem_fn(", + $e._Callee._Object, + ")" + ) + ) + + children ( + ; Member function pointers have no children. + #array(expr: 0, size: 0) + ) +} + +;------------------------------------------------------------------------------ +; std::tr1::bind() from +;------------------------------------------------------------------------------ +; bind() placeholders are previewed with their names. +; They have no state, so they have no children. +std::tr1::_Ph<1>{ + preview ( "_1" ) + children ( #array(expr: 0, size: 0) ) +} +std::tr1::_Ph<2>{ + preview ( "_2" ) + children ( #array(expr: 0, size: 0) ) +} +std::tr1::_Ph<3>{ + preview ( "_3" ) + children ( #array(expr: 0, size: 0) ) +} +std::tr1::_Ph<4>{ + preview ( "_4" ) + children ( #array(expr: 0, size: 0) ) +} +std::tr1::_Ph<5>{ + preview ( "_5" ) + children ( #array(expr: 0, size: 0) ) +} +std::tr1::_Ph<6>{ + preview ( "_6" ) + children ( #array(expr: 0, size: 0) ) +} +std::tr1::_Ph<7>{ + preview ( "_7" ) + children ( #array(expr: 0, size: 0) ) +} +std::tr1::_Ph<8>{ + preview ( "_8" ) + children ( #array(expr: 0, size: 0) ) +} +std::tr1::_Ph<9>{ + preview ( "_9" ) + children ( #array(expr: 0, size: 0) ) +} +std::tr1::_Ph<10>{ + preview ( "_10" ) + children ( #array(expr: 0, size: 0) ) +} + +; The functor returned by bind(f, t1, t2) is previewed with "bind(f, t1, t2)". +; It has children with the fake names of [f], [t1], [t2], etc. +std::tr1::_Bind<*,*,std::tr1::_Bind0<*> >|std::tr1::_Bind_fty<*,*,std::tr1::_Bind0<*> >{ + preview ( + #( + "bind(", $e._Bx._Callee._Object, + ")" + ) + ) + + children ( + #( + #([f] : $e._Bx._Callee._Object) + ) + ) +} +std::tr1::_Bind<*,*,std::tr1::_Bind1<*> >|std::tr1::_Bind_fty<*,*,std::tr1::_Bind1<*> >{ + preview ( + #( + "bind(", $e._Bx._Callee._Object, + ", ", $e._Bx._Vx0, + ")" + ) + ) + + children ( + #( + #([f] : $e._Bx._Callee._Object), + #([t1] : $e._Bx._Vx0) + ) + ) +} +std::tr1::_Bind<*,*,std::tr1::_Bind2<*> >|std::tr1::_Bind_fty<*,*,std::tr1::_Bind2<*> >{ + preview ( + #( + "bind(", $e._Bx._Callee._Object, + ", ", $e._Bx._Vx0, + ", ", $e._Bx._Vx1, + ")" + ) + ) + + children ( + #( + #([f] : $e._Bx._Callee._Object), + #([t1] : $e._Bx._Vx0), + #([t2] : $e._Bx._Vx1) + ) + ) +} +std::tr1::_Bind<*,*,std::tr1::_Bind3<*> >|std::tr1::_Bind_fty<*,*,std::tr1::_Bind3<*> >{ + preview ( + #( + "bind(", $e._Bx._Callee._Object, + ", ", $e._Bx._Vx0, + ", ", $e._Bx._Vx1, + ", ", $e._Bx._Vx2, + ")" + ) + ) + + children ( + #( + #([f] : $e._Bx._Callee._Object), + #([t1] : $e._Bx._Vx0), + #([t2] : $e._Bx._Vx1), + #([t3] : $e._Bx._Vx2) + ) + ) +} +std::tr1::_Bind<*,*,std::tr1::_Bind4<*> >|std::tr1::_Bind_fty<*,*,std::tr1::_Bind4<*> >{ + preview ( + #( + "bind(", $e._Bx._Callee._Object, + ", ", $e._Bx._Vx0, + ", ", $e._Bx._Vx1, + ", ", $e._Bx._Vx2, + ", ", $e._Bx._Vx3, + ")" + ) + ) + + children ( + #( + #([f] : $e._Bx._Callee._Object), + #([t1] : $e._Bx._Vx0), + #([t2] : $e._Bx._Vx1), + #([t3] : $e._Bx._Vx2), + #([t4] : $e._Bx._Vx3) + ) + ) +} +std::tr1::_Bind<*,*,std::tr1::_Bind5<*> >|std::tr1::_Bind_fty<*,*,std::tr1::_Bind5<*> >{ + preview ( + #( + "bind(", $e._Bx._Callee._Object, + ", ", $e._Bx._Vx0, + ", ", $e._Bx._Vx1, + ", ", $e._Bx._Vx2, + ", ", $e._Bx._Vx3, + ", ", $e._Bx._Vx4, + ")" + ) + ) + + children ( + #( + #([f] : $e._Bx._Callee._Object), + #([t1] : $e._Bx._Vx0), + #([t2] : $e._Bx._Vx1), + #([t3] : $e._Bx._Vx2), + #([t4] : $e._Bx._Vx3), + #([t5] : $e._Bx._Vx4) + ) + ) +} +std::tr1::_Bind<*,*,std::tr1::_Bind6<*> >|std::tr1::_Bind_fty<*,*,std::tr1::_Bind6<*> >{ + preview ( + #( + "bind(", $e._Bx._Callee._Object, + ", ", $e._Bx._Vx0, + ", ", $e._Bx._Vx1, + ", ", $e._Bx._Vx2, + ", ", $e._Bx._Vx3, + ", ", $e._Bx._Vx4, + ", ", $e._Bx._Vx5, + ")" + ) + ) + + children ( + #( + #([f] : $e._Bx._Callee._Object), + #([t1] : $e._Bx._Vx0), + #([t2] : $e._Bx._Vx1), + #([t3] : $e._Bx._Vx2), + #([t4] : $e._Bx._Vx3), + #([t5] : $e._Bx._Vx4), + #([t6] : $e._Bx._Vx5) + ) + ) +} +std::tr1::_Bind<*,*,std::tr1::_Bind7<*> >|std::tr1::_Bind_fty<*,*,std::tr1::_Bind7<*> >{ + preview ( + #( + "bind(", $e._Bx._Callee._Object, + ", ", $e._Bx._Vx0, + ", ", $e._Bx._Vx1, + ", ", $e._Bx._Vx2, + ", ", $e._Bx._Vx3, + ", ", $e._Bx._Vx4, + ", ", $e._Bx._Vx5, + ", ", $e._Bx._Vx6, + ")" + ) + ) + + children ( + #( + #([f] : $e._Bx._Callee._Object), + #([t1] : $e._Bx._Vx0), + #([t2] : $e._Bx._Vx1), + #([t3] : $e._Bx._Vx2), + #([t4] : $e._Bx._Vx3), + #([t5] : $e._Bx._Vx4), + #([t6] : $e._Bx._Vx5), + #([t7] : $e._Bx._Vx6) + ) + ) +} +std::tr1::_Bind<*,*,std::tr1::_Bind8<*> >|std::tr1::_Bind_fty<*,*,std::tr1::_Bind8<*> >{ + preview ( + #( + "bind(", $e._Bx._Callee._Object, + ", ", $e._Bx._Vx0, + ", ", $e._Bx._Vx1, + ", ", $e._Bx._Vx2, + ", ", $e._Bx._Vx3, + ", ", $e._Bx._Vx4, + ", ", $e._Bx._Vx5, + ", ", $e._Bx._Vx6, + ", ", $e._Bx._Vx7, + ")" + ) + ) + + children ( + #( + #([f] : $e._Bx._Callee._Object), + #([t1] : $e._Bx._Vx0), + #([t2] : $e._Bx._Vx1), + #([t3] : $e._Bx._Vx2), + #([t4] : $e._Bx._Vx3), + #([t5] : $e._Bx._Vx4), + #([t6] : $e._Bx._Vx5), + #([t7] : $e._Bx._Vx6), + #([t8] : $e._Bx._Vx7) + ) + ) +} +std::tr1::_Bind<*,*,std::tr1::_Bind9<*> >|std::tr1::_Bind_fty<*,*,std::tr1::_Bind9<*> >{ + preview ( + #( + "bind(", $e._Bx._Callee._Object, + ", ", $e._Bx._Vx0, + ", ", $e._Bx._Vx1, + ", ", $e._Bx._Vx2, + ", ", $e._Bx._Vx3, + ", ", $e._Bx._Vx4, + ", ", $e._Bx._Vx5, + ", ", $e._Bx._Vx6, + ", ", $e._Bx._Vx7, + ", ", $e._Bx._Vx8, + ")" + ) + ) + + children ( + #( + #([f] : $e._Bx._Callee._Object), + #([t1] : $e._Bx._Vx0), + #([t2] : $e._Bx._Vx1), + #([t3] : $e._Bx._Vx2), + #([t4] : $e._Bx._Vx3), + #([t5] : $e._Bx._Vx4), + #([t6] : $e._Bx._Vx5), + #([t7] : $e._Bx._Vx6), + #([t8] : $e._Bx._Vx7), + #([t9] : $e._Bx._Vx8) + ) + ) +} +std::tr1::_Bind<*,*,std::tr1::_Bind10<*> >|std::tr1::_Bind_fty<*,*,std::tr1::_Bind10<*> >{ + preview ( + #( + "bind(", $e._Bx._Callee._Object, + ", ", $e._Bx._Vx0, + ", ", $e._Bx._Vx1, + ", ", $e._Bx._Vx2, + ", ", $e._Bx._Vx3, + ", ", $e._Bx._Vx4, + ", ", $e._Bx._Vx5, + ", ", $e._Bx._Vx6, + ", ", $e._Bx._Vx7, + ", ", $e._Bx._Vx8, + ", ", $e._Bx._Vx9, + ")" + ) + ) + + children ( + #( + #([f] : $e._Bx._Callee._Object), + #([t1] : $e._Bx._Vx0), + #([t2] : $e._Bx._Vx1), + #([t3] : $e._Bx._Vx2), + #([t4] : $e._Bx._Vx3), + #([t5] : $e._Bx._Vx4), + #([t6] : $e._Bx._Vx5), + #([t7] : $e._Bx._Vx6), + #([t8] : $e._Bx._Vx7), + #([t9] : $e._Bx._Vx8), + #([t10] : $e._Bx._Vx9) + ) + ) +} + +;------------------------------------------------------------------------------ +; std::tr1::function from +;------------------------------------------------------------------------------ +std::tr1::_Impl_no_alloc0<*>|std::tr1::_Impl_no_alloc1<*>|std::tr1::_Impl_no_alloc2<*>|std::tr1::_Impl_no_alloc3<*>|std::tr1::_Impl_no_alloc4<*>|std::tr1::_Impl_no_alloc5<*>|std::tr1::_Impl_no_alloc6<*>|std::tr1::_Impl_no_alloc7<*>|std::tr1::_Impl_no_alloc8<*>|std::tr1::_Impl_no_alloc9<*>|std::tr1::_Impl_no_alloc10<*>{ + preview ( $e._Callee._Object ) + children ( #([functor] : $e._Callee._Object) ) +} +std::tr1::_Impl0<*>|std::tr1::_Impl1<*>|std::tr1::_Impl2<*>|std::tr1::_Impl3<*>|std::tr1::_Impl4<*>|std::tr1::_Impl5<*>|std::tr1::_Impl6<*>|std::tr1::_Impl7<*>|std::tr1::_Impl8<*>|std::tr1::_Impl9<*>|std::tr1::_Impl10<*>{ + preview ( $e._Callee._Object ) + children ( + #( + #([functor] : $e._Callee._Object), + #([allocator] : $e._Myal) + ) + ) +} +std::tr1::function<*>{ + preview ( + #if ($e._Impl == 0) ( + ; Detecting empty functions is trivial. + "empty" + ) #else ( + *$e._Impl + ) + ) + + children ( + #if ($e._Impl == 0) ( + ; We make empty functions appear to have no children. + #array(expr: 0, size: 0) + ) #else ( + #([functor and allocator] : *$e._Impl) + ) + ) +} + +;------------------------------------------------------------------------------ +; std::tr1::tuple from +;------------------------------------------------------------------------------ +; tuple is visualized like pair, except that we have to give fake names to tuple's children. +std::tr1::tuple{ + preview ( + "()" + ) + + children ( + #array(expr: 0, size: 0) + ) +} +std::tr1::tuple<*,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil>{ + preview ( + #( + "(", $e._Impl._Value, + ")" + ) + ) + + children ( + #( + [0] : $e._Impl._Value + ) + ) +} +std::tr1::tuple<*,*,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil>{ + preview ( + #( + "(", $e._Impl._Value, + ", ", $e._Impl._Tail._Value, + ")" + ) + ) + + children ( + #( + [0] : $e._Impl._Value, + [1] : $e._Impl._Tail._Value + ) + ) +} +std::tr1::tuple<*,*,*,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil>{ + preview ( + #( + "(", $e._Impl._Value, + ", ", $e._Impl._Tail._Value, + ", ", $e._Impl._Tail._Tail._Value, + ")" + ) + ) + + children ( + #( + [0] : $e._Impl._Value, + [1] : $e._Impl._Tail._Value, + [2] : $e._Impl._Tail._Tail._Value + ) + ) +} +std::tr1::tuple<*,*,*,*,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil>{ + preview ( + #( + "(", $e._Impl._Value, + ", ", $e._Impl._Tail._Value, + ", ", $e._Impl._Tail._Tail._Value, + ", ", $e._Impl._Tail._Tail._Tail._Value, + ")" + ) + ) + + children ( + #( + [0] : $e._Impl._Value, + [1] : $e._Impl._Tail._Value, + [2] : $e._Impl._Tail._Tail._Value, + [3] : $e._Impl._Tail._Tail._Tail._Value + ) + ) +} +std::tr1::tuple<*,*,*,*,*,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil>{ + preview ( + #( + "(", $e._Impl._Value, + ", ", $e._Impl._Tail._Value, + ", ", $e._Impl._Tail._Tail._Value, + ", ", $e._Impl._Tail._Tail._Tail._Value, + ", ", $e._Impl._Tail._Tail._Tail._Tail._Value, + ")" + ) + ) + + children ( + #( + [0] : $e._Impl._Value, + [1] : $e._Impl._Tail._Value, + [2] : $e._Impl._Tail._Tail._Value, + [3] : $e._Impl._Tail._Tail._Tail._Value, + [4] : $e._Impl._Tail._Tail._Tail._Tail._Value + ) + ) +} +std::tr1::tuple<*,*,*,*,*,*,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil>{ + preview ( + #( + "(", $e._Impl._Value, + ", ", $e._Impl._Tail._Value, + ", ", $e._Impl._Tail._Tail._Value, + ", ", $e._Impl._Tail._Tail._Tail._Value, + ", ", $e._Impl._Tail._Tail._Tail._Tail._Value, + ", ", $e._Impl._Tail._Tail._Tail._Tail._Tail._Value, + ")" + ) + ) + + children ( + #( + [0] : $e._Impl._Value, + [1] : $e._Impl._Tail._Value, + [2] : $e._Impl._Tail._Tail._Value, + [3] : $e._Impl._Tail._Tail._Tail._Value, + [4] : $e._Impl._Tail._Tail._Tail._Tail._Value, + [5] : $e._Impl._Tail._Tail._Tail._Tail._Tail._Value + ) + ) +} +std::tr1::tuple<*,*,*,*,*,*,*,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil>{ + preview ( + #( + "(", $e._Impl._Value, + ", ", $e._Impl._Tail._Value, + ", ", $e._Impl._Tail._Tail._Value, + ", ", $e._Impl._Tail._Tail._Tail._Value, + ", ", $e._Impl._Tail._Tail._Tail._Tail._Value, + ", ", $e._Impl._Tail._Tail._Tail._Tail._Tail._Value, + ", ", $e._Impl._Tail._Tail._Tail._Tail._Tail._Tail._Value, + ")" + ) + ) + + children ( + #( + [0] : $e._Impl._Value, + [1] : $e._Impl._Tail._Value, + [2] : $e._Impl._Tail._Tail._Value, + [3] : $e._Impl._Tail._Tail._Tail._Value, + [4] : $e._Impl._Tail._Tail._Tail._Tail._Value, + [5] : $e._Impl._Tail._Tail._Tail._Tail._Tail._Value, + [6] : $e._Impl._Tail._Tail._Tail._Tail._Tail._Tail._Value + ) + ) +} +std::tr1::tuple<*,*,*,*,*,*,*,*,std::tr1::_Nil,std::tr1::_Nil>{ + preview ( + #( + "(", $e._Impl._Value, + ", ", $e._Impl._Tail._Value, + ", ", $e._Impl._Tail._Tail._Value, + ", ", $e._Impl._Tail._Tail._Tail._Value, + ", ", $e._Impl._Tail._Tail._Tail._Tail._Value, + ", ", $e._Impl._Tail._Tail._Tail._Tail._Tail._Value, + ", ", $e._Impl._Tail._Tail._Tail._Tail._Tail._Tail._Value, + ", ", $e._Impl._Tail._Tail._Tail._Tail._Tail._Tail._Tail._Value, + ")" + ) + ) + + children ( + #( + [0] : $e._Impl._Value, + [1] : $e._Impl._Tail._Value, + [2] : $e._Impl._Tail._Tail._Value, + [3] : $e._Impl._Tail._Tail._Tail._Value, + [4] : $e._Impl._Tail._Tail._Tail._Tail._Value, + [5] : $e._Impl._Tail._Tail._Tail._Tail._Tail._Value, + [6] : $e._Impl._Tail._Tail._Tail._Tail._Tail._Tail._Value, + [7] : $e._Impl._Tail._Tail._Tail._Tail._Tail._Tail._Tail._Value + ) + ) +} +std::tr1::tuple<*,*,*,*,*,*,*,*,*,std::tr1::_Nil>{ + preview ( + #( + "(", $e._Impl._Value, + ", ", $e._Impl._Tail._Value, + ", ", $e._Impl._Tail._Tail._Value, + ", ", $e._Impl._Tail._Tail._Tail._Value, + ", ", $e._Impl._Tail._Tail._Tail._Tail._Value, + ", ", $e._Impl._Tail._Tail._Tail._Tail._Tail._Value, + ", ", $e._Impl._Tail._Tail._Tail._Tail._Tail._Tail._Value, + ", ", $e._Impl._Tail._Tail._Tail._Tail._Tail._Tail._Tail._Value, + ", ", $e._Impl._Tail._Tail._Tail._Tail._Tail._Tail._Tail._Tail._Value, + ")" + ) + ) + + children ( + #( + [0] : $e._Impl._Value, + [1] : $e._Impl._Tail._Value, + [2] : $e._Impl._Tail._Tail._Value, + [3] : $e._Impl._Tail._Tail._Tail._Value, + [4] : $e._Impl._Tail._Tail._Tail._Tail._Value, + [5] : $e._Impl._Tail._Tail._Tail._Tail._Tail._Value, + [6] : $e._Impl._Tail._Tail._Tail._Tail._Tail._Tail._Value, + [7] : $e._Impl._Tail._Tail._Tail._Tail._Tail._Tail._Tail._Value, + [8] : $e._Impl._Tail._Tail._Tail._Tail._Tail._Tail._Tail._Tail._Value + ) + ) +} +std::tr1::tuple<*,*,*,*,*,*,*,*,*,*>{ + preview ( + #( + "(", $e._Impl._Value, + ", ", $e._Impl._Tail._Value, + ", ", $e._Impl._Tail._Tail._Value, + ", ", $e._Impl._Tail._Tail._Tail._Value, + ", ", $e._Impl._Tail._Tail._Tail._Tail._Value, + ", ", $e._Impl._Tail._Tail._Tail._Tail._Tail._Value, + ", ", $e._Impl._Tail._Tail._Tail._Tail._Tail._Tail._Value, + ", ", $e._Impl._Tail._Tail._Tail._Tail._Tail._Tail._Tail._Value, + ", ", $e._Impl._Tail._Tail._Tail._Tail._Tail._Tail._Tail._Tail._Value, + ", ", $e._Impl._Tail._Tail._Tail._Tail._Tail._Tail._Tail._Tail._Tail._Value, + ")" + ) + ) + + children ( + #( + [0] : $e._Impl._Value, + [1] : $e._Impl._Tail._Value, + [2] : $e._Impl._Tail._Tail._Value, + [3] : $e._Impl._Tail._Tail._Tail._Value, + [4] : $e._Impl._Tail._Tail._Tail._Tail._Value, + [5] : $e._Impl._Tail._Tail._Tail._Tail._Tail._Value, + [6] : $e._Impl._Tail._Tail._Tail._Tail._Tail._Tail._Value, + [7] : $e._Impl._Tail._Tail._Tail._Tail._Tail._Tail._Tail._Value, + [8] : $e._Impl._Tail._Tail._Tail._Tail._Tail._Tail._Tail._Tail._Value, + [9] : $e._Impl._Tail._Tail._Tail._Tail._Tail._Tail._Tail._Tail._Tail._Value + ) + ) +} + +;------------------------------------------------------------------------------ +; std::tr1::array from +;------------------------------------------------------------------------------ +std::tr1::array<*>{ + preview ( + ; An actual array is previewed with its address. + ; array is previewed like vector. + #( + "[", + $e._EEN_SIZE, + "](", + #array(expr: $e._Elems[$i], size: $e._EEN_SIZE), + ")" + ) + ) + + children ( + ; Just like an actual array. + #array(expr: $e._Elems[$i], size: $e._EEN_SIZE) + ) +} +std::_Array_iterator<*>|std::_Array_const_iterator<*>{ + preview ( + #if ($e._EEN_IDL == 0) ( + *$e._Ptr + ) #else ( + #if ($e._Idx == $e._EEN_SIZE) ( + ; array iterators are represented by _Ptr + _Idx, + ; and they know how large their parent arrays are. Therefore, detecting + ; end iterators is trivial. + "end" + ) #else ( + ; Like vector iterators, array iterators are previewed with what they point to. + $e._Ptr[$e._Idx] + ) + ) + ) + + children ( + #if ($e._EEN_IDL == 0) ( + #([ptr] : $e._Ptr) + ) #else ( + #if ($e._Idx == $e._EEN_SIZE) ( + ; We make end iterators appear to have no children. + #array(expr: 0, size: 0) + ) #else ( + ; An array iterator is conceptually a pointer, so we make it appear to store one. + #([ptr] : $e._Ptr + $e._Idx) + ) + ) + ) +} + +;------------------------------------------------------------------------------ +; stdext::hash_map from +; stdext::hash_multimap from +; stdext::hash_set from +; stdext::hash_multiset from +;------------------------------------------------------------------------------ +stdext::hash_map<*>|stdext::hash_multimap<*>|stdext::hash_set<*>|stdext::hash_multiset<*>{ + preview ( + #( + "[", + $e._List._Mysize, + "](", + #list( + head: $e._List._Myhead->_Next, + size: $e._List._Mysize, + next: _Next + ) : $e._Myval, + ")" + ) + ) + + children ( + #list( + head: $e._List._Myhead->_Next, + size: $e._List._Mysize, + next: _Next + ) : $e._Myval + ) +} + +;------------------------------------------------------------------------------ +; std::tr1::unordered_map from +; std::tr1::unordered_multimap from +; std::tr1::unordered_set from +; std::tr1::unordered_multiset from +;------------------------------------------------------------------------------ +std::hash<*>{ + preview ( "hash" ) + children ( #array(expr: 0, size: 0) ) +} +std::tr1::unordered_map<*>|std::tr1::unordered_multimap<*>|std::tr1::unordered_set<*>|std::tr1::unordered_multiset<*>{ + preview ( + #( + "[", + $e._List._Mysize, + "](", + #list( + head: $e._List._Myhead->_Next, + size: $e._List._Mysize, + next: _Next + ) : $e._Myval, + ")" + ) + ) + + children ( + #( + #([hash] : $e.comp._Hashobj), + #([equal] : $e.comp._Keyeqobj), + #list( + head: $e._List._Myhead->_Next, + size: $e._List._Mysize, + next: _Next + ) : $e._Myval + ) + ) +} + +;------------------------------------------------------------------------------ +; std::tr1::basic_regex from +;------------------------------------------------------------------------------ +std::tr1::basic_regex<*>{ + preview ( + #if ($e._Rep == 0) ( + ; Default construction creates an empty basic_regex. + "empty" + ) #elif ($e._EEN_VIS == 1) ( + ; By default, _ENHANCED_REGEX_VISUALIZER is defined to be 1 in debug and 0 in ship. + ; When it is 1, basic_regex stores the string from which it was constructed. + ; When it is 0, basic_regex stores only the resulting finite state machine. + $e._Visualization + ) #else ( + ; basic_regex contains many static const flags, which would be shown in the preview by default. + ; Its actual members are _Rep and _Traits. _Rep holds the finite state machine, so we + ; use it to preview basic_regex. (It does contain some human-readable information.) + *$e._Rep + ) + ) + + children ( + #if ($e._Rep == 0) ( + ; We make empty basic_regexes appear to have no children. + #array(expr: 0, size: 0) + ) #elif ($e._EEN_VIS == 1) ( + ; We want to hide those static const flags. + ; We also want to give _Visualization a fake name. + #( + #([str] : $e._Visualization), + #(_Rep : $e._Rep), + #(_Traits : $e._Traits) + ) + ) #else ( + ; We want to hide those static const flags. + #( + _Rep : $e._Rep, + _Traits : $e._Traits + ) + ) + ) +} + +;------------------------------------------------------------------------------ +; std::tr1::sub_match from +;------------------------------------------------------------------------------ +std::tr1::sub_match|std::tr1::sub_match|std::tr1::sub_match|std::tr1::sub_match|std::tr1::sub_match|std::tr1::sub_match{ + preview ( + ; It would be nice if we could preview sub_match with its str(). + ; However, visualizers cannot handle strings represented by pointer pairs. + ; Therefore, our preview contains more limited information. + #if ($e.matched) ( + ; If this sub_match participated in a match, + ; we preview it with its length(). + $e.second - $e.first + ) #else ( + ; Otherwise, we preview it with its matched bool (i.e. "false"). + ; (Why not length() (i.e. "0")? It's meaningful to have + ; matched == true and length() == 0. + "false" + ) + ) + + children ( + #( + ; sub_match's three data members are public, but we list them here + ; (a) to display matched before first and second, and + ; (b) to gloss over the fact that sub_match derives from std::pair. + #(matched : $e.matched), + #(first : $e.first), + #(second : $e.second) + ) + ) +} +std::tr1::sub_match >|std::tr1::sub_match >{ + preview ( + #if ($e.matched) ( + ; We visualize ssub_match and wssub_match just like csub_match and wcsub_match, + ; except that when determining the length(), we can't subtract iterators. + ; We have to subtract their stored pointers. + $e.second._Ptr - $e.first._Ptr + ) #else ( + "false" + ) + ) + + children ( + #( + #(matched : $e.matched), + #(first : $e.first), + #(second : $e.second) + ) + ) +} + +;------------------------------------------------------------------------------ +; std::tr1::match_results from +;------------------------------------------------------------------------------ +std::tr1::match_results<*>{ + preview ( + ; A match_results object is empty iff its vector _Matches is empty. + #if ($e._Matches._Myfirst == $e._Matches._Mylast) ( + "empty" + ) #else ( + ; We preview a non-empty match_results object with its vector. + $e._Matches + ) + ) + + children ( + #if ($e._Matches._Myfirst == $e._Matches._Mylast) ( + ; We make empty match_results appear to have no children. + #array(expr: 0, size: 0) + ) #else ( + ; As match_results has operator[](), prefix(), and suffix() member functions, + ; we make it appear to directly contain [0], [1], [2], etc. elements, + ; as well as [prefix] and [suffix] elements. + #( + #array(expr: $e._Matches._Myfirst[$i], size: $e._Matches._Mylast - $e._Matches._Myfirst), + #([prefix] : $e._Prefix), + #([suffix] : $e._Suffix) + ) + ) + ) +} + +;------------------------------------------------------------------------------ +; std::tr1::regex_iterator from +;------------------------------------------------------------------------------ +std::tr1::regex_iterator<*>{ + preview ( + #if ($e._MyRe == 0) ( + ; We represent end-of-sequence regex_iterators with null regex pointers. + "end" + ) #else ( + ; Dereferenceable regex_iterators return match_results when dereferenced, + ; so we'll preview them with that. + $e._MyVal + ) + ) + + children ( + #if ($e._MyRe == 0) ( + ; We make end-of-sequence regex_iterators appear to have no children. + #array(expr: 0, size: 0) + ) #else ( + ; For ease of understanding, we make dereferenceable regex_iterators + ; appear to have data members with the "for exposition only" names from TR1. + #( + #([begin] : $e._Begin), + #([end] : $e._End), + #([pregex] : $e._MyRe), + #([flags] : $e._Flags), + #([match] : $e._MyVal) + ) + ) + ) +} + +;------------------------------------------------------------------------------ +; std::tr1::regex_token_iterator from +;------------------------------------------------------------------------------ +std::tr1::regex_token_iterator<*>{ + preview ( + #if ($e._Res == 0) ( + ; We represent end-of-sequence regex_token_iterators with null result pointers. + "end" + ) #else ( + ; Dereferenceable regex_token_iterators return *result when dereferenced, + ; so we'll preview them with that. + *$e._Res + ) + ) + + children ( + #if ($e._Res == 0) ( + ; We make end-of-sequence regex_token_iterators appear to have no children. + #array(expr: 0, size: 0) + ) #else ( + ; For ease of understanding, we make dereferenceable regex_token_iterators + ; appear to have data members with the "for exposition only" names from TR1. + #( + #([position] : $e._Pos), + #([result] : $e._Res), + #([suffix] : $e._Suffix), + #([N] : $e._Cur), + #([subs] : $e._Subs) + ) + ) + ) +} + +;------------------------------------------------------------------------------ +; std::identity, etc. from +;------------------------------------------------------------------------------ +std::identity<*>{ + preview ( "identity" ) + children ( #array(expr: 0, size: 0) ) +} +std::bit_and<*>{ + preview ( "bit_and" ) + children ( #array(expr: 0, size: 0) ) +} +std::bit_or<*>{ + preview ( "bit_or" ) + children ( #array(expr: 0, size: 0) ) +} +std::bit_xor<*>{ + preview ( "bit_xor" ) + children ( #array(expr: 0, size: 0) ) +} + +;------------------------------------------------------------------------------ +; std::unique_ptr from +;------------------------------------------------------------------------------ +std::unique_ptr<*>{ + preview ( + #if ($e._Myptr == 0) ( + "empty" + ) #else ( + #( + "unique_ptr ", + *$e._Myptr + ) + ) + ) + + children ( + #if ($e._Myptr == 0) ( + #array(expr: 0, size: 0) + ) #else ( + #([ptr] : $e._Myptr) + ) + ) +} + +;------------------------------------------------------------------------------ +; std::forward_list from +;------------------------------------------------------------------------------ +std::forward_list<*>{ + preview ( + #( + "(", + #list( + head: $e._Myhead, + next: _Next + ) : $e._Myval, + ")" + ) + ) + + children ( + #list( + head: $e._Myhead, + next: _Next + ) : $e._Myval + ) +} +std::_Flist_iterator<*>|std::_Flist_const_iterator<*>{ + preview ( + #if ($e._Ptr == 0) ( + "end" + ) #else ( + $e._Ptr->_Myval + ) + ) + + children ( + #if ($e._Ptr == 0) ( + #array(expr: 0, size: 0) + ) #else ( + #([ptr] : &$e._Ptr->_Myval) + ) + ) +} + + +;------------------------------------------------------------------------------ +; PROPVARIANT +;------------------------------------------------------------------------------ +; Visualizers for VT_VECTOR C arrays +tagCAC|tagCAUB|tagCAI|tagCAUI|tagCAL|tagCAUL|tagCAFLT|tagCADBL|tagCACY|tagCADATE|tagCABSTR|tagCABSTRBLOB|tagCABOOL|tagCASCODE|tagCAPROPVARIANT|tagCAH|tagCAUH|tagCALPSTR|tagCALPWSTR|tagCAFILETIME|tagCACLIPDATA|tagCACLSID{ + preview( + #( + "[", $e.cElems , "](", + #array + ( + expr : ($e.pElems)[$i], + size : $e.cElems + ), + ")" + ) + ) + children + ( + #array + ( + expr : ($e.pElems)[$i], + size : $e.cElems + ) + ) +} +; Visualizers for SAFE ARRAY +tagSAFEARRAY|SAFEARRAY{ + preview( + #if ($e.fFeatures & 0x0080) ; FADF_HAVEVARTYPE + ( + ; Switch on the variant type field - which is stored 4 bytes + ; before the beginning of the SAFEARRAY type + #switch( ((unsigned *)&($e))[-1] ) + #case 0x2 ; VT_I2 | VT_ARRAY + ( + #( + "safearray of I2 = [", + ; output the rank array + #array( expr: $e.rgsabound[$i].cElements, size: $e.cDims), + "](", + ; output the data elements + #array( + expr: ((signed short *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ), + ")" + ) + ) + #case 0x3 ; VT_I4 | VT_ARRAY + ( + #( + "safearray of I4 = [", + ; output the rank array + #array( expr: $e.rgsabound[$i].cElements, size: $e.cDims), + "](", + ; output the data elements + #array( + expr: ((signed int *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ), + ")" + ) + ) + #case 0x4 ; VT_R4 | VT_ARRAY + ( + #( + "safearray of R4 = [", + ; output the rank array + #array( expr: $e.rgsabound[$i].cElements, size: $e.cDims), + "](", + ; output the data elements + #array( + expr: ((float *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ), + ")" + ) + ) + #case 0x5 ; VT_R8 | VT_ARRAY + ( + #( + "safearray of R8 = [", + ; output the rank array + #array( expr: $e.rgsabound[$i].cElements, size: $e.cDims), + "](", + ; output the data elements + #array( + expr: ((double *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ), + ")" + ) + ) + #case 0x6 ; VT_CY | VT_ARRAY + ( + #( + "safearray of CY = [", + ; output the rank array + #array( expr: $e.rgsabound[$i].cElements, size: $e.cDims), + "](", + ; output the data elements + #array( + expr: ((CY *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ), + ")" + ) + ) + #case 0x7 ; VT_DATE | VT_ARRAY + ( + #( + "safearray of DATE = [", + ; output the rank array + #array( expr: $e.rgsabound[$i].cElements, size: $e.cDims), + "](", + ; output the data elements + #array( + expr: ((DATE *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ), + ")" + ) + ) + #case 0x8 ; VT_BSTR | VT_ARRAY + ( + #( + "safearray of BSTR = [", + ; output the rank array + #array( expr: $e.rgsabound[$i].cElements, size: $e.cDims), + "](", + ; output the data elements + #array( + expr: ((wchar_t **)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ), + ")" + ) + ) + #case 0xa ; VT_ERROR | VT_ARRAY + ( + #( + "safearray of ERROR = [", + ; output the rank array + #array( expr: $e.rgsabound[$i].cElements, size: $e.cDims), + "](", + ; output the data elements + #array( + expr: ((long *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ), + ")" + ) + ) + #case 0xb ; VT_BOOL | VT_ARRAY + ( + #( + "safearray of BOOL = [", + ; output the rank array + #array( expr: $e.rgsabound[$i].cElements, size: $e.cDims), + "](", + ; output the data elements + #array( + expr: ((short *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ), + ")" + ) + ) + #case 0xc ; VT_VARIANT | VT_ARRAY + ( + #( + "safearray of VARIANT = [", + ; output the rank array + #array( expr: $e.rgsabound[$i].cElements, size: $e.cDims), + "](", + ; output the data elements + #array( + expr: ((tagVARIANT *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ), + ")" + ) + ) + #case 0x10 ; VT_I1 | VT_ARRAY + ( + #( + "safearray of I1 = [", + ; output the rank array + #array( expr: $e.rgsabound[$i].cElements, size: $e.cDims), + "](", + ; output the data elements + #array( + expr: ((signed char *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ), + ")" + ) + ) + #case 0x11 ; VT_UI1 | VT_ARRAY + ( + #( + "safearray of UI1 = [", + ; output the rank array + #array( expr: $e.rgsabound[$i].cElements, size: $e.cDims), + "](", + ; output the data elements + #array( + expr: ((unsigned char *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ), + ")" + ) + ) + #case 0x12 ; VT_UI2 | VT_ARRAY + ( + #( + "safearray of UI2 = [", + ; output the rank array + #array( expr: $e.rgsabound[$i].cElements, size: $e.cDims), + "](", + ; output the data elements + #array( + expr: ((unsigned short *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ), + ")" + ) + ) + #case 0x13 ; VT_UI4 | VT_ARRAY + ( + #( + "safearray of UI4 = [", + ; output the rank array + #array( expr: $e.rgsabound[$i].cElements, size: $e.cDims), + "](", + ; output the data elements + #array( + expr: ((unsigned int *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ), + ")" + ) + ) + #case 0x14 ; VT_I8 | VT_ARRAY + ( + #( + "safearray of I8 = [", + ; output the rank array + #array( expr: $e.rgsabound[$i].cElements, size: $e.cDims), + "](", + ; output the data elements + #array( + expr: ((signed __int64 *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ), + ")" + ) + ) + #case 0x15 ; VT_UI8 | VT_ARRAY + ( + #( + "safearray of UI8 = [", + ; output the rank array + #array( expr: $e.rgsabound[$i].cElements, size: $e.cDims), + "](", + ; output the data elements + #array( + expr: ((unsigned __int64 *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ), + ")" + ) + ) + #case 0x16 ; VT_INT | VT_ARRAY + ( + #( + "safearray of INT = [", + ; output the rank array + #array( expr: $e.rgsabound[$i].cElements, size: $e.cDims), + "](", + ; output the data elements + #array( + expr: ((int *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ), + ")" + ) + ) + #case 0x17 ; VT_UINT | VT_ARRAY + ( + #( + "safearray of UINT = [", + ; output the rank array + #array( expr: $e.rgsabound[$i].cElements, size: $e.cDims), + "](", + ; output the data elements + #array( + expr: ((unsigned *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ), + ")" + ) + ) + #case 0x1e ; VT_LPSTR | VT_ARRAY + ( + #( + "safearray of LPSTR = [", + ; output the rank array + #array( expr: $e.rgsabound[$i].cElements, size: $e.cDims), + "](", + ; output the data elements + #array( + expr: ((char **)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ), + ")" + ) + ) + #case 0x1f ; VT_LPWSTR | VT_ARRAY + ( + #( + "safearray of LPWSTR = [", + ; output the rank array + #array( expr: $e.rgsabound[$i].cElements, size: $e.cDims), + "](", + ; output the data elements + #array( + expr: ((wchar_t **)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ), + ")" + ) + ) + #case 0x40 ; VT_FILETIME | VT_ARRAY + ( + #( + "safearray of FILETIME = [", + ; output the rank array + #array( expr: $e.rgsabound[$i].cElements, size: $e.cDims), + "](", + ; output the data elements + #array( + expr: ((FILETIME *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ), + ")" + ) + ) + #case 0x47 ; VT_CLIPDATA | VT_ARRAY + ( + #( + "safearray of CLIPDATA = [", + ; output the rank array + #array( expr: $e.rgsabound[$i].cElements, size: $e.cDims), + "](", + ; output the data elements + #array( + expr: ((CLIPDATA *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ), + ")" + ) + ) + #case 0x48 ; VT_CLSID | VT_ARRAY + ( + #( + "safearray of CLSID = [", + ; output the rank array + #array( expr: $e.rgsabound[$i].cElements, size: $e.cDims), + "](", + ; output the data elements + #array( + expr: ((CLSID *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ), + ")" + ) + ) + ) + #elif ($e.fFeatures & 0x0100) ; FADF_BSTR + ( + #("safearray of BSTR = ",#array(expr: $e.rgsabound[$i].cElements, size: $e.cDims) : #("[",$e,"]"), "(", #array(expr: ((wchar_t * *)$e.pvData)[$i], size: $e.rgsabound[$r].cElements, rank: $e.cDims, base: $e.rgsabound[$r].lLbound ), ")") + ) + #elif ($e.fFeatures & 0x0200) ; FADF_UNKNOWN + ( + #("safearray of IUnknown* = [",#array(expr: $e.rgsabound[$i].cElements, size: $e.cDims), "](", #array(expr: ((IUnknown * *)$e.pvData)[$i], size: $e.rgsabound[$r].cElements, rank: $e.cDims, base: $e.rgsabound[$r].lLbound ), ")") + ) + #elif ($e.fFeatures & 0x0400) ; FADF_DISPATCH + ( + #("safearray of IDispatch* = [",#array(expr: $e.rgsabound[$i].cElements, size: $e.cDims), "](", #array(expr: ((IDispatch * *)$e.pvData)[$i], size: $e.rgsabound[$r].cElements, rank: $e.cDims, base: $e.rgsabound[$r].lLbound ), ")") + ) + #elif ($e.fFeatures & 0x0800) ; FADF_VARIANT + ( + #("safearray of VARIANT = ",#array(expr: $e.rgsabound[$i].cElements, size: $e.cDims) : #("[",$e,"]"), "(", #array(expr: ((tagVARIANT *)$e.pvData)[$i], size: $e.rgsabound[$r].cElements, rank: $e.cDims, base: $e.rgsabound[$r].lLbound ), ")") + ) + ) + children + ( + #( ;[actual members]: [$e,!], + #if ($e.fFeatures & 0x0080) ; FADF_HAVEVARTYPE + ( + #switch( ((unsigned *)&($e))[-1] ) ; for some reason the VT field is before the SAFEARRAY struct + #case 2 ; VT_I2|VT_ARRAY + ( + #array( + expr: ((signed short *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ) + ) + #case 3 ; VT_I4|VT_ARRAY + ( + #array( + expr: ((signed int *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ) + ) + #case 4 ; VT_R4|VT_ARRAY + ( + #array( + expr: ((float *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ) + ) + #case 5 ; VT_R8|VT_ARRAY + ( + #array( + expr: ((double *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ) + ) + #case 0x10 ; VT_I1|VT_ARRAY + ( + #array( + expr: ((signed char *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ) + ) + #case 0x11 ; VT_UI1|VT_ARRAY + ( + #array( + expr: ((unsigned char *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ) + ) + #case 0x12 ; VT_UI2|VT_ARRAY + ( + #array( + expr: ((unsigned short *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ) + ) + #case 0x13 ; VT_UI4|VT_ARRAY + ( + #array( + expr: ((unsigned int *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ) + ) + #case 0x14 ; VT_I8|VT_ARRAY + ( + #array( + expr: ((signed __int64 *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ) + ) + #case 0x15 ; VT_UI8|VT_ARRAY + ( + #array( + expr: ((unsigned __int64 *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ) + ) + #case 0x1e ; VT_LPSTR|VT_ARRAY + ( + #array( + expr: ((char * *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ) + ) + #case 0x1f ; VT_LPWSTR|VT_ARRAY + ( + #array( + expr: ((wchar_t **)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ) + ) + #case 0xc ; VT_VARIANT|VT_ARRAY + ( + #array( + expr: ((tagVARIANT *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ) + ) + #case 0xb ; VT_BOOL|VT_ARRAY + ( + #array( + expr: ((short *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ) + ) + #case 0xa ; VT_ERROR|VT_ARRAY + ( + #array( + expr: ((long *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ) + ) + #case 6 ; VT_CY|VT_ARRAY + ( + #array( + expr: ((CY *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ) + ) + #case 7 ; VT_DATE|VT_ARRAY + ( + #array( + expr: ((DATE *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ) + ) + #case 0x40 ; VT_FILETIME|VT_ARRAY + ( + #array( + expr: ((FILETIME *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ) + ) + #case 0x48 ; VT_CLSID|VT_ARRAY + ( + #array( + expr: ((CLSID *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ) + ) + #case 0x47 ; VT_CF|VT_ARRAY + ( + #array( + expr: ((CLIPDATA *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ) + ) + #case 8 ; VT_BSTR|VT_ARRAY + ( + #array( + expr: ((wchar_t * *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ) + ) + #case 0x16 ; VT_INT|VT_ARRAY + ( + #array( + expr: ((int *)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ) + ) + #case 0x17 ; VT_UINT|VT_ARRAY + ( + #array( + expr: ((unsigned int*)$e.pvData)[$i], + size: $e.rgsabound[$r].cElements, + rank: $e.cDims, + base: $e.rgsabound[$r].lLbound + ) + ) + #default + ( + #([actual members]: [$e,!]) + ) + #except + ( + #([actual members]: [$e,!]) + ) + ) + #elif ($e.fFeatures & 0x0100) ; FADF_BSTR + ( + #array(expr: ((wchar_t * *)$e.pvData)[$i], size: $e.rgsabound[$r].cElements, rank: $e.cDims, base: $e.rgsabound[$r].lLbound ) + ) + #elif ($e.fFeatures & 0x0200) ; FADF_UNKNOWN + ( + #array(expr: ((IUnknown * *)$e.pvData)[$i], size: $e.rgsabound[$r].cElements, rank: $e.cDims, base: $e.rgsabound[$r].lLbound ) + ) + #elif ($e.fFeatures & 0x0400) ; FADF_DISPATCH + ( + #array(expr: ((IDispatch * *)$e.pvData)[$i], size: $e.rgsabound[$r].cElements, rank: $e.cDims, base: $e.rgsabound[$r].lLbound ) + ) + #elif ($e.fFeatures & 0x0800) ; FADF_VARIANT + ( + #array(expr: ((tagVARIANT *)$e.pvData)[$i], size: $e.rgsabound[$r].cElements, rank: $e.cDims, base: $e.rgsabound[$r].lLbound ) + ) + ) + ) +} +tagPROPVARIANT|tagVARIANT|PROPVARIANT|VARIANT{ + preview( + #switch ($e.vt) + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; Base Types ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + #case 0 ( #("Empty") ) ; VT_EMPTY + #case 1 ( #("NULL") ) ; VT_NULL + #case 2 ( #("I2 = ", $e.iVal) ) ; VT_I2 + #case 3 ( #("I4 = ", $e.lVal) ) ; VT_I4 + #case 4 ( #("R4 = ", $e.fltVal) ) ; VT_R4 + #case 5 ( #("R8 = ", $e.dblVal) ) ; VT_R8 + #case 6 ( #("CY = ", $e.cyVal) ) ; VT_CY + #case 7 ( #("DATE = ", $e.date) ) ; VT_DATE + #case 8 ( #("BSTR = ", $e.bstrVal) ) ; VT_BSTR + #case 9 ( #("DISPATCH = ", $e.pdispVal) ) ; VT_DISPATCH + #case 10 ( #("ERROR = ", $e.scode) ) ; VT_ERROR + #case 0xB ( #("BOOL = ", $e.boolVal) ) ; VT_BOOL + #case 0xC ( #("VARIANT ") ) ; VT_VARIANT + #case 0xD ( #("UNKNOWN = ", $e.punkVal) ) ; VT_UNKOWN + #case 0xE ( #("DECIMAL = ", $e.decVal) ) ; VT_DECIMAL + #case 0x10 ( #("I1 = ", $e.cVal) ) ; VT_I1 + #case 0x11 ( #("UI1 = ", $e.bVal) ) ; VT_UI1 + #case 0x12 ( #("UI2 = ", $e.uiVal) ) ; VT_UI2 + #case 0x13 ( #("UI4 = ", $e.ulVal) ) ; VT_UI4 + #case 0x14 ( #("I8 = ", *(__int64*)&$e.dblVal) ) ; VT_I8 + #case 0x15 ( #("UI8 = ", *(unsigned __int64*)&$e.dblVal) ) ; VT_UI8 + #case 0x16 ( #("INT = ", $e.intVal) ) ; VT_INT + #case 0x17 ( #("UINT = ", $e.uintVal) ) ; VT_UINT + #case 0x18 ( #("VOID ") ) ; VT_VOID + #case 0x19 ( #("HRESULT ") ) ; VT_HRESULT + #case 0x1A ( #("PTR ") ) ; VT_PTR + #case 0x1B ( #("SAFEARRAY ") ) ; VT_SAFEARRAY + #case 0x1C ( #("CARRAY ") ) ; VT_CARRAY + #case 0x1D ( #("USERDEFINED ") ) ; VT_USERDEFINED + #case 0x1E ( #("LPSTR = ", $e.pszVal) ) ; VT_LPSTR + #case 0x1F ( #("LPWSTR = ", $e.pwszVal) ) ; VT_LPWSTR + #case 0x24 ( #("RECORD ") ) ; VT_RECORD + #case 0x26 ( #("UINT_PTR ") ) ; VT_UINT_PTR + #case 0x40 ( #("FILETIME = ", $e.filetime) ) ; VT_FILETIME + #case 0x42 ( #("STREAM = ", $e.pStream) ) ; VT_STREAM + #case 0x43 ( #("STORAGE = ", $e.pStorage) ) ; VT_STORAGE + #case 0x44 ( #("STREAMED_OBJECT = ", $e.pStream) ) ; VT_STREAMED_OBJECT + #case 0x45 ( #("STORED_OBJECT = ", $e.pStorage) ) ; VT_STORED_OBJECT + #case 0x46 ( #("BLOB_OBJECT = ", $e.blob ) ) ; VT_BLOB_OBJECT + #case 0x47 ( #("CF = ", $e.pclipdata) ) ; VT_CF + #case 0x48 ( #("CLSID = ", $e.puuid) ) ; VT_CLSID + #case 0x49 ( #("VERSIONED_STREAM = ", $e.pVersionedStream) ) ; VT_VERSIONED_STREAM + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; Vector types ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + #case 0x1002 ( #("vector of I2 = ", $e.cai) ) ; VT_I2|VT_VECTOR + #case 0x1003 ( #("vector of I4 = ", $e.cal) ) ; VT_I4|VT_VECTOR + #case 0x1004 ( #("vector of R4 = ", $e.caflt) ) ; VT_R4|VT_VECTOR + #case 0x1005 ( #("vector of R8 = ", $e.cadbl) ) ; VT_R8|VT_VECTOR + #case 0x1010 ( #("vector of I1 = ", $e.cac) ) ; VT_I1|VT_VECTOR + #case 0x1011 ( #("vector of UI1 = ", $e.caub) ) ; VT_UI1|VT_VECTOR + #case 0x1012 ( #("vector of UI2 = ", $e.caui) ) ; VT_UI2|VT_VECTOR + #case 0x1013 ( #("vector of UI4 = ", $e.caul) ) ; VT_UI4|VT_VECTOR + #case 0x1014 ( #("vector of I8 = ", $e.cah) ) ; VT_I8|VT_VECTOR + #case 0x1015 ( #("vector of UI8 = ", $e.cauh) ) ; VT_UI8|VT_VECTOR + #case 0x101E ( #("vector of LPSTR = ", $e.calpstr) ) ; VT_LPSTR|VT_VECTOR + #case 0x101F ( #("vector of LPWSTR = ", $e.calpwstr) ) ; VT_LPWSTR|VT_VECTOR + #case 0x100C ( #("vector of VARIANT ", $e.capropvar) ) ; VT_VARIANT|VT_VECTOR + #case 0x100B ( #("vector of BOOL = ", $e.cabool) ) ; VT_BOOL|VT_VECTOR + #case 0x100A ( #("vector of ERROR = ", $e.cascode) ) ; VT_ERROR|VT_VECTOR + #case 0x1006 ( #("vector of CY = ", $e.cacy) ) ; VT_CY|VT_VECTOR + #case 0x1007 ( #("vector of DATE = ", $e.cadate) ) ; VT_DATE|VT_VECTOR + #case 0x1040 ( #("vector of FILETIME = ", $e.cafiletime) ) ; VT_FILETIME|VT_VECTOR + #case 0x1048 ( #("vector of CLSID = ", $e.cauuid) ) ; VT_CLSID|VT_VECTOR + #case 0x1047 ( #("vector of CF = ", $e.caclipdata) ) ; VT_CF|VT_VECTOR + #case 0x1008 ( #("vector of BSTR = ", $e.cabstr) ) ; VT_BSTR|VT_VECTOR + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; Byref Types ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + #case 0x4016 ( #("byref of INT = ", $e.pintVal) ) ; VT_INT|VT_BYREF + #case 0x4017 ( #("byref of UINT = ", $e.puintVal) ) ; VT_UINT|VT_BYREF + #case 0x4002 ( #("byref of I2 = ", $e.piVal) ) ; VT_I2|VT_BYREF + #case 0x4003 ( #("byref of I4 = ", $e.plVal) ) ; VT_I4|VT_BYREF + #case 0x4004 ( #("byref of R4 = ", $e.pfltVal) ) ; VT_R4|VT_BYREF + #case 0x4005 ( #("byref of R8 = ", $e.pdblVal) ) ; VT_R8|VT_BYREF + #case 0x4010 ( #("byref of I1 = ", $e.pcVal) ) ; VT_I1|VT_BYREF + #case 0x4011 ( #("byref of UI1 = ", $e.pbVal) ) ; VT_UI1|VT_BYREF + #case 0x4012 ( #("byref of UI2 = ", $e.puiVal) ) ; VT_UI2|VT_BYREF + #case 0x4013 ( #("byref of UI4 = ", $e.pulVal) ) ; VT_UI4|VT_BYREF + #case 0x4014 ( #("byref of I8 = ", (__int64*)$e.pdblVal) ) ; VT_I8|VT_BYREF + #case 0x4015 ( #("byref of UI8 = ", (unsigned __int64*)$e.pudblVal) ) ; VT_UI8|VT_BYREF + #case 0x400C ( #("byref of VARIANT ", $e.pvarVal) ) ; VT_VARIANT|VT_BYREF + #case 0x400B ( #("byref of BOOL = ", $e.pboolVal) ) ; VT_BOOL|VT_BYREF + #case 0x400A ( #("byref of ERROR = ", $e.pscode) ) ; VT_ERROR|VT_BYREF + #case 0x4006 ( #("byref of CY = ", $e.pcyVal) ) ; VT_CY|VT_BYREF + #case 0x4007 ( #("byref of DATE = ", $e.pdate) ) ; VT_DATE|VT_BYREF + #case 0x4008 ( #("byref of BSTR = ", $e.pbstrVal) ) ; VT_BSTR|VT_BYREF + #case 0x400E ( #("byref of DECIMAL = ", $e.pdecVal) ) ; VT_DECIMAL|VT_BYREF + #case 0x400D ( #("byref of UNKNOWN = ", $e.ppunkVal) ) ; VT_UNKOWN|VT_BYREF + #case 0x4009 ( #("byref of DISPATCH = ", $e.ppdispVal) ) ; VT_DISPATCH|VT_BYREF + #case 0x6000 ( #("byref of ARRAY = ", $e.pparray) ) ; VT_ARRAY|VT_BYREF + #default + ( + #if ($e.vt & 0x2000) ( $e.parray) + #else ( #("Unknown vt type = ", $e.vt)) + ) + ) + children( + #( + vt: $e.vt, + #switch ($e.vt) + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; Base Types ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + #case 0x2 ( #(I2 : $e.iVal) ) ; VT_I2 + #case 0x3 ( #(I4 : $e.lVal) ) ; VT_I4 + #case 0x4 ( #(R4 : $e.fltVal) ) ; VT_R4 + #case 0x5 ( #(R8 : $e.dblVal) ) ; VT_R8 + #case 0x6 ( #(CY : $e.cyVal) ) ; VT_CY + #case 0x7 ( #(DATE : $e.date) ) ; VT_DATE + #case 0x8 ( #(BSTR : $e.bstrVal) ) ; VT_BSTR + #case 0x9 ( #(DISPATCH : $e.pdispVal) ) ; VT_DISPATCH + #case 0xA ( #(ERROR : $e.scode) ) ; VT_ERROR + #case 0xB ( #(BOOL : $e.boolVal) ) ; VT_BOOL + #case 0xD ( #(UNKNOWN : $e.punkVal) ) ; VT_UNKOWN + #case 0xE ( #(DECIMAL : $e.decVal) ) ; VT_DECIMAL + #case 0x10 ( #(I1 : $e.cVal) ) ; VT_I1 + #case 0x11 ( #(UI1 : $e.bVal) ) ; VT_UI1 + #case 0x12 ( #(UI2 : $e.uiVal) ) ; VT_UI2 + #case 0x13 ( #(UI4 : $e.ulVal) ) ; VT_UI4 + #case 0x14 ( #(I8 : *(__int64*)&$e.dblVal) ) ; VT_I8 + #case 0x15 ( #(UI8 : *(unsigned __int64*)&$e.dblVal) ) ; VT_UI8 + #case 0x16 ( #(INT : $e.intVal) ) ; VT_INT + #case 0x17 ( #(UINT : $e.uintVal) ) ; VT_UINT + #case 0x1E ( #(LPSTR : $e.pszVal) ) ; VT_LPSTR + #case 0x1F ( #(LPWSTR : $e.pwszVal) ) ; VT_LPWSTR + #case 0x40 ( #(FILETIME : $e.filetime) ) ; VT_FILETIME + #case 0x42 ( #(STREAM : $e.pStream) ) ; VT_STREAM + #case 0x43 ( #(STORAGE : $e.pStorage) ) ; VT_STORAGE + #case 0x44 ( #(STREAMED_OBJECT : $e.pStream) ) ; VT_STREAMED_OBJECT + #case 0x45 ( #(STORED_OBJECT : $e.pStorage) ) ; VT_STORED_OBJECT + #case 0x46 ( #(BLOB_OBJECT : $e.blob ) ) ; VT_BLOB_OBJECT + #case 0x47 ( #(CF : $e.pclipdata) ) ; VT_CF + #case 0x48 ( #(CLSID : $e.puuid) ) ; VT_CLSID + #case 0x49 ( #(VERSIONED_STREAM : $e.pVersionedStream) ) ; VT_VERSIONED_STREAM + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; Vector types ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + #case 0x1002 ( #(vector of I2 : $e.cai) ) ; VT_I2|VT_VECTOR + #case 0x1003 ( #(vector of I4 : $e.cal) ) ; VT_I4|VT_VECTOR + #case 0x1004 ( #(vector of R4 : $e.caflt) ) ; VT_R4|VT_VECTOR + #case 0x1005 ( #(vector of R8 : $e.cadbl) ) ; VT_R8|VT_VECTOR + #case 0x1010 ( #(vector of I1 : $e.cac) ) ; VT_I1|VT_VECTOR + #case 0x1011 ( #(vector of UI1 : $e.caub) ) ; VT_UI1|VT_VECTOR + #case 0x1012 ( #(vector of UI2 : $e.caui) ) ; VT_UI2|VT_VECTOR + #case 0x1013 ( #(vector of UI4 : $e.caul) ) ; VT_UI4|VT_VECTOR + #case 0x1014 ( #(vector of I8 : $e.cah) ) ; VT_I8|VT_VECTOR + #case 0x1015 ( #(vector of UI8 : $e.cauh) ) ; VT_UI8|VT_VECTOR + #case 0x101E ( #(vector of LPSTR : $e.calpstr) ) ; VT_LPSTR|VT_VECTOR + #case 0x101F ( #(vector of LPWSTR : $e.calpwstr) ) ; VT_LPWSTR|VT_VECTOR + #case 0x100C ( #(vector of VARIANT : $e.capropvar) ) ; VT_VARIANT|VT_VECTOR + #case 0x100B ( #(vector of BOOL : $e.cabool) ) ; VT_BOOL|VT_VECTOR + #case 0x100A ( #(vector of ERROR : $e.cascode) ) ; VT_ERROR|VT_VECTOR + #case 0x1006 ( #(vector of CY : $e.cacy) ) ; VT_CY|VT_VECTOR + #case 0x1007 ( #(vector of DATE : $e.cadate) ) ; VT_DATE|VT_VECTOR + #case 0x1040 ( #(vector of FILETIME : $e.cafiletime) ) ; VT_FILETIME|VT_VECTOR + #case 0x1048 ( #(vector of CLSID : $e.cauuid) ) ; VT_CLSID|VT_VECTOR + #case 0x1047 ( #(vector of CF : $e.caclipdata) ) ; VT_CF|VT_VECTOR + #case 0x1008 ( #(vector of BSTR : $e.cabstr) ) ; VT_BSTR|VT_VECTOR + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; Byref Types ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + #case 0x4016 ( #(byref of INT : $e.pintVal) ) ; VT_INT|VT_BYREF + #case 0x4017 ( #(byref of UINT : $e.puintVal) ) ; VT_UINT|VT_BYREF + #case 0x4002 ( #(byref of I2 : $e.piVal) ) ; VT_I2|VT_BYREF + #case 0x4003 ( #(byref of I4 : $e.plVal) ) ; VT_I4|VT_BYREF + #case 0x4004 ( #(byref of R4 : $e.pfltVal) ) ; VT_R4|VT_BYREF + #case 0x4005 ( #(byref of R8 : $e.pdblVal) ) ; VT_R8|VT_BYREF + #case 0x4010 ( #(byref of I1 : $e.pcVal) ) ; VT_I1|VT_BYREF + #case 0x4011 ( #(byref of UI1 : $e.pbVal) ) ; VT_UI1|VT_BYREF + #case 0x4012 ( #(byref of UI2 : $e.puiVal) ) ; VT_UI2|VT_BYREF + #case 0x4013 ( #(byref of UI4 : $e.pulVal) ) ; VT_UI4|VT_BYREF + #case 0x4014 ( #(byref of I8 : (__int64*)$e.pdblVal) ) ; VT_I8|VT_BYREF + #case 0x4015 ( #(byref of UI8 : (unsigned __int64*)$e.pdblVal) ) ; VT_UI8|VT_BYREF + #case 0x400C ( #(byref of VARIANT : $e.pvarVal) ) ; VT_VARIANT|VT_BYREF + #case 0x400B ( #(byref of BOOL : $e.pboolVal) ) ; VT_BOOL|VT_BYREF + #case 0x400A ( #(byref of ERROR : $e.pscode) ) ; VT_ERROR|VT_BYREF + #case 0x4006 ( #(byref of CY : $e.pcyVal) ) ; VT_CY|VT_BYREF + #case 0x4007 ( #(byref of DATE : $e.pdate) ) ; VT_DATE|VT_BYREF + #case 0x4008 ( #(byref of BSTR : $e.pbstrVal) ) ; VT_BSTR|VT_BYREF + #case 0x400E ( #(byref of DECIMAL : $e.pdecVal) ) ; VT_DECIMAL|VT_BYREF + #case 0x400D ( #(byref of UNKNOWN : $e.ppunkVal) ) ; VT_UNKOWN|VT_BYREF + #case 0x4009 ( #(byref of DISPATCH : $e.ppdispVal) ) ; VT_DISPATCH|VT_BYREF + #case 0x6000 ( #(byref of ARRAY : $e.pparray) ) ; VT_ARRAY|VT_BYREF + + ; the following are either empty or invalid vt values for a variant + ; #case 0 ( #(Empty :) ) ; VT_EMPTY + ; #case 0x1 ( #(NULL :) ) ; VT_NULL + ; #case 0xC ( #(VARIANT :) ) ; VT_VARIANT + ; #case 0x18 ( #(VOID :) ) ; VT_VOID + ; #case 0x19 ( #(HRESULT :) ) ; VT_HRESULT + ; #case 0x1A ( #(PTR :) ) ; VT_PTR + ; #case 0x1B ( #(SAFEARRAY :) ) ; VT_SAFEARRAY + ; #case 0x1C ( #(CARRAY :) ) ; VT_CARRAY + ; #case 0x1D ( #(USERDEFINED :) ) ; VT_USERDEFINED + ; #case 0x24 ( #(RECORD :) ) ; VT_RECORD + ; #case 0x26 ( #(UINT_PTR :) ) ; VT_UINT_PTR + #default + ( + #if ($e.vt & 0x2000 ) + ( #(safearray: $e.parray)) + #else + ( + #( + [raw members]: [$e,!] ; unformatted data members + ) + ) + ) + #except + ( + #( + [raw members]: [$e,!] ; unformatted data members + ) + ) + ) + ) +} + +; Visualizers for data structures in namespace Concurrency +;------------------------------------------------------------------------------ +; Concurrency::message from +;------------------------------------------------------------------------------ +Concurrency::message<*>{ + preview ( + #( + $e.payload + ) + ) + + children ( + #( + #(payload: $e.payload), + #([msg_id]: $e._M_id) + ) + ) +} + +;------------------------------------------------------------------------------ +; Concurrency::multi_link_registry from +;------------------------------------------------------------------------------ +Concurrency::multi_link_registry<*>{ + preview ( + #( + "[", + $e._M_vector._M_index, + "](", + #array( + expr: *($e._M_vector._M_array[$i]), + size: $e._M_vector._M_index + ), + ")" + ) + ) + + children ( + #( + #([size]: $e._M_vector._M_index), + #array( + expr: *($e._M_vector._M_array[$i]), + size: $e._M_vector._M_index + ) + ) + ) +} + +;------------------------------------------------------------------------------ +; Concurrency::details::_Queue from +;------------------------------------------------------------------------------ +Concurrency::details::_Queue<*>{ + preview ( + #( + "[", + $e._M_count, + "](", + #list( + head: $e._M_pHead, + next: _M_pNext, + size: _M_count + ), + ")" + ) + ) + + children ( + #( + #([size]: $e._M_count), + #list( + head: $e._M_pHead, + next: _M_pNext, + size: _M_count + ) + ) + ) +} + +;------------------------------------------------------------------------------ +; Concurrency::unbounded_buffer from +;------------------------------------------------------------------------------ +Concurrency::unbounded_buffer<*>{ + preview ( + #( + $e._M_messageBuffer + ) + ) + + children ( + #( + #(unprocessed_messages: $e._M_messageProcessor._M_queuedMessages._M_queue), + #(messages: $e._M_messageBuffer), + #(message_filter: *($e._M_pFilter)), + #(linked_sources: $e._M_connectedSources._M_links), + #(linked_targets: $e._M_connectedTargets), + #(reserving_target: *($e._M_pReservedFor)), + #(Scheduler: *($e._M_messageProcessor._M_pScheduler)), + #(ScheduleGroup: *($e._M_messageProcessor._M_pScheduleGroup)) + ) + ) +} + +;------------------------------------------------------------------------------ +; Concurrency::overwrite_buffer from +;------------------------------------------------------------------------------ +Concurrency::overwrite_buffer<*>{ + preview ( + #( + $e._M_pMessage + ) + ) + + children ( + #( + #(value: *($e._M_pMessage)), + #(unprocessed_messages: $e._M_messageProcessor._M_queuedMessages._M_queue), + #(message_filter: *($e._M_pFilter)), + #(linked_sources: $e._M_connectedSources._M_links), + #(linked_targets: $e._M_connectedTargets), + #(reserving_target: *($e._M_pReservedFor)), + #(reserved_message: *($e._M_pReservedMessage)), + #(Scheduler: *($e._M_messageProcessor._M_pScheduler)), + #(ScheduleGroup: *($e._M_messageProcessor._M_pScheduleGroup)) + ) + ) +} + +;------------------------------------------------------------------------------ +; Concurrency::single_assignment from +;------------------------------------------------------------------------------ +Concurrency::single_assignment<*>{ + preview ( + #( + $e._M_pMessage + ) + ) + + children ( + #( + #(value: *($e._M_pMessage)), + #(unprocessed_messages: $e._M_messageProcessor._M_queuedMessages._M_queue), + #(message_filter: *($e._M_pFilter)), + #(linked_sources: $e._M_connectedSources._M_links), + #(linked_targets: $e._M_connectedTargets), + #(reserving_target: *($e._M_pReservedFor)), + #(Scheduler: *($e._M_messageProcessor._M_pScheduler)), + #(ScheduleGroup: *($e._M_messageProcessor._M_pScheduleGroup)) + ) + ) +} + +;------------------------------------------------------------------------------ +; Concurrency::call from +;------------------------------------------------------------------------------ +Concurrency::call<*>{ + preview ( + #( + $e._M_pFunc + ) + ) + + children ( + #( + #(call_method: $e._M_pFunc), + #(unprocessed_messages: $e._M_messageProcessor._M_queuedMessages._M_queue), + #(message_filter: *($e._M_pFilter)), + #(linked_sources: $e._M_connectedSources._M_links), + #(Scheduler: *($e._M_messageProcessor._M_pScheduler)), + #(ScheduleGroup: *($e._M_messageProcessor._M_pScheduleGroup)) + ) + ) +} + +;------------------------------------------------------------------------------ +; Concurrency::transformer from +;------------------------------------------------------------------------------ +Concurrency::transformer<*>{ + preview ( + #( + $e._M_pFunc + ) + ) + + children ( + #( + #(transform_method: $e._M_pFunc), + #(unprocessed_messages: $e._M_messageProcessor._M_queuedMessages._M_queue), + #(messages: $e._M_messageBuffer), + #(message_filter: *($e._M_pFilter)), + #(linked_sources: $e._M_connectedSources._M_links), + #(linked_target: *($e._M_connectedTargets._M_connectedLink)), + #(reserving_target: *($e._M_pReservedFor)), + #(Scheduler: *($e._M_messageProcessor._M_pScheduler)), + #(ScheduleGroup: *($e._M_messageProcessor._M_pScheduleGroup)) + ) + ) +} + +;------------------------------------------------------------------------------ +; Concurrency::choice from +;------------------------------------------------------------------------------ +Concurrency::choice<*>{ + preview ( + #( + "[", + #if ($e._M_pSingleAssignment->_M_fIsInitialized) ("initialized") + #else ("not_initialized"), + "] ", + $e._M_sourceTuple + ) + ) + + children ( + #( + #([input_count]: $e._M_pSingleAssignment->_M_connectedSources._M_links._M_vector._M_index), + #(index: $e._M_pSingleAssignment->_M_pMessage->payload), + #(source_tuple: $e._M_sourceTuple), + #(linked_sources: $e._M_pSingleAssignment->_M_connectedSources._M_links), + #(linked_targets: $e._M_pSingleAssignment->_M_connectedTargets), + #(reserving_target: *($e._M_pSingleAssignment->_M_pReservedFor)), + #(Scheduler: *($e._M_pScheduler)), + #(ScheduleGroup: *($e._M_pScheduleGroup)), + #([raw _M_pSourceChoices] : $e._M_pSourceChoices) + ) + ) +} + +;------------------------------------------------------------------------------ +; Concurrency::join<*,*>::_MessageArray from +;------------------------------------------------------------------------------ +Concurrency::join<*,*>::_MessageArray{ + preview ( + #( + "[", + $e._M_count, + "](", + #array( + expr: *(((Concurrency::message<$T1>**)$e._M_messages)[$i]), + size: $e._M_count + ), + ")" + ) + ) + + children ( + #( + #([size]: $e._M_count), + #array( + expr: *(((Concurrency::message<$T1>**)$e._M_messages)[$i]), + size: $e._M_count + ) + ) + ) +} + +;------------------------------------------------------------------------------ +; Concurrency::join<*,*>::_SavedMessageIdArray from +;------------------------------------------------------------------------------ +Concurrency::join<*,*>::_SavedMessageIdArray{ + preview ( + #( + "[", + $e._M_count, + "](", + #array( + expr: ((int*)$e._M_savedIds)[$i], + size: $e._M_count + ), + ")" + ) + ) + + children ( + #( + #([size]: $e._M_count), + #array( + expr: ((int*)$e._M_savedIds)[$i], + size: $e._M_count + ) + ) + ) +} + +;------------------------------------------------------------------------------ +; Concurrency::join from +;------------------------------------------------------------------------------ +Concurrency::join<*,*>{ + preview ( + #( + "[", + $e._M_messageArray._M_count - $e._M_messagesRemaining, + "/", + $e._M_messageArray._M_count, + "](", + #array( + expr: *($e._M_connectedSources._M_links._M_vector._M_array[$i]), + size: $e._M_connectedSources._M_links._M_vector._M_index + ), + ")" + ) + ) + + children ( + #( + #([join_type]: (Concurrency::join_type)$T2), + #([offer_count]: $e._M_messageArray._M_count - $e._M_messagesRemaining), + #(offer_IDs: $e._M_savedMessageIdArray), + #([input_count]: $e._M_messageArray._M_count), + #(input_values: $e._M_messageArray), + #(messages: $e._M_messageBuffer), + #(message_filter: *($e._M_pFilter)), + #(linked_sources: $e._M_connectedSources._M_links), + #(linked_target: $e._M_connectedTargets._M_connectedLink), + #(reserving_target: *($e._M_pReservedFor)), + #(Scheduler: *($e._M_messageProcessor._M_pScheduler)), + #(ScheduleGroup: *($e._M_messageProcessor._M_pScheduleGroup)) + ) + ) +} + +;------------------------------------------------------------------------------ +; Concurrency::multitype_join from +;------------------------------------------------------------------------------ +Concurrency::multitype_join<*,*>{ + preview ( + #( + "[", + $e._M_pJoinNode->_M_connectedSources._M_links._M_vector._M_index - $e._M_pJoinNode->_M_counter, + "/", + $e._M_pJoinNode->_M_connectedSources._M_links._M_vector._M_index, + "]", + $e._M_sourceTuple + ) + ) + + children ( + #( + #([join_type]: (Concurrency::join_type)$T2), + #([offer_count]: $e._M_pJoinNode->_M_connectedSources._M_links._M_vector._M_index - $e._M_pJoinNode->_M_counter), + #([input_count]: $e._M_pJoinNode->_M_connectedSources._M_links._M_vector._M_index), + #(source_tuple: $e._M_sourceTuple), + #(messages: $e._M_pJoinNode->_M_messageBuffer), + #(linked_sources: $e._M_pJoinNode->_M_connectedSources._M_links), + #(linked_target: $e._M_pJoinNode->_M_connectedTargets._M_connectedLink), + #(reserving_target: *($e._M_pJoinNode->_M_pReservedFor)), + #(Scheduler: *($e._M_pJoinNode->_M_messageProcessor._M_pScheduler)), + #(ScheduleGroup: *($e._M_pJoinNode->_M_messageProcessor._M_pScheduleGroup)), + #([raw _M_pSourceJoins] : $e._M_pSourceJoins) + ) + ) +} + +;------------------------------------------------------------------------------ +; Concurrency::timer from +;------------------------------------------------------------------------------ +Concurrency::timer<*>{ + preview ( + #( + $e._M_state + ) + ) + + children ( + #( + #(state: $e._M_state), + #(value: $e._M_value), + #(repeating: $e._M_fRepeating), + #(interval_ms: $e._M_ms), + #(linked_target: *($e._M_connectedTargets._M_connectedLink)), + #(reserving_target: *($e._M_pReservedFor)), + #(Scheduler: *($e._M_messageProcessor._M_pScheduler)), + #(ScheduleGroup: *($e._M_messageProcessor._M_pScheduleGroup)) + ) + ) +} + +;------------------------------------------------------------------------------ +; Concurrency::details::SchedulerBase from +; Concurrency::details::ThreadScheduler from +; Concurrency::details::UMSThreadScheduler from +;------------------------------------------------------------------------------ +Concurrency::details::SchedulerBase|Concurrency::details::ThreadScheduler|Concurrency::details::UMSThreadScheduler{ + preview ( + #( + "[", + $e.m_id, + "] ", + #if ($e.m_schedulerKind == 0) ("ThreadScheduler") + #else ("UmsScheduler"), + #if ($e.m_id == $e.s_pDefaultScheduler->m_id) (", default") + #else ("") + ) + ) + + children ( + #( + #(ID: $e.m_id), + #(SchedulerPolicy: $e.m_policy), + #(VirtualProcessorCount: $e.m_virtualProcessorCount), + #(ReferenceCount: $e.m_refCount), + #([isDefaultScheduler]: $e.m_id == $e.s_pDefaultScheduler->m_id) + ) + ) +} + +;------------------------------------------------------------------------------ +; Concurrency::details::ScheduleGroupBase from +; Concurrency::details::CacheLocalScheduleGroup from +; Concurrency::details::FairScheduleGroup from +;------------------------------------------------------------------------------ +Concurrency::details::ScheduleGroupBase|Concurrency::details::CacheLocalScheduleGroup|Concurrency::details::FairScheduleGroup{ + preview ( + #( + "[", + $e.m_id, + "]", + #if ($e.m_kind & 4) (" AnonymousScheduleGroup") + #else ("") + ) + ) + + children ( + #( + #(ID: $e.m_id), + #(Scheduler: *($e.m_pScheduler)) + ) + ) +} + +;------------------------------------------------------------------------------ +; Concurrency::details::ContextBase from +; Concurrency::details::InternalContextBase from +; Concurrency::details::ThreadInternalContext from +; Concurrency::details::UMSThreadInternalContext from +;------------------------------------------------------------------------------ +Concurrency::details::ContextBase|Concurrency::details::InternalContextBase|Concurrency::details::ThreadInternalContext|Concurrency::details::UMSThreadInternalContext{ + preview ( + #( + "[", + $e.m_threadId, + "] ", + #if ($e.m_blockedState == 0) ("not_concrt_blocked") + #elif ($e.m_blockedState == 1) ("concrt_blocked") + #elif ($e.m_blockedState == 2) ("ums_sync_blocked") + #elif ($e.m_blockedState == 4) ("ums_async_blocked") + #else ("") + ) + ) + + children ( + #( + #(ID: $e.m_id), + #(ThreadID: $e.m_threadId), + #(Scheduler: *($e.m_pScheduler)), + #(ScheduleGroup: *($e.m_pGroup)) + ) + ) +} + +;------------------------------------------------------------------------------ +; Concurrency::details::ExternalContextBase from +;------------------------------------------------------------------------------ +Concurrency::details::ExternalContextBase{ + preview ( + #( + "[", + $e.m_threadId, + "] ", + #if ($e.m_contextSwitchingFence == 1) ("concrt_blocked") + #else ("not_concrt_blocked") + ) + ) + + children ( + #( + #(ID: $e.m_id), + #(ThreadID: $e.m_threadId), + #(Scheduler: *($e.m_pScheduler)), + #(ScheduleGroup: *($e.m_pGroup)) + ) + ) +} + +;------------------------------------------------------------------------------ +; Concurrency::SchedulerPolicy from +;------------------------------------------------------------------------------ +Concurrency::SchedulerPolicy{ + preview ( + #( + $e._M_pPolicyBag->_M_values._M_specificValues._M_schedulerKind, + ", Min=", + $e._M_pPolicyBag->_M_values._M_specificValues._M_minConcurrency, + ", Max=", + $e._M_pPolicyBag->_M_values._M_specificValues._M_maxConcurrency + ) + ) + + children ( + #( + #(SchedulerKind: $e._M_pPolicyBag->_M_values._M_specificValues._M_schedulerKind), + #(MinConcurrency: $e._M_pPolicyBag->_M_values._M_specificValues._M_minConcurrency), + #(MaxConcurrency: $e._M_pPolicyBag->_M_values._M_specificValues._M_maxConcurrency), + #(TargetOversubscriptionFactor: $e._M_pPolicyBag->_M_values._M_specificValues._M_targetOversubscriptionFactor), + #(LocalContextCacheSize: $e._M_pPolicyBag->_M_values._M_specificValues._M_localContextCacheSize), + #(ContextStackSize: $e._M_pPolicyBag->_M_values._M_specificValues._M_contextStackSize), + #(ContextPriority: $e._M_pPolicyBag->_M_values._M_specificValues._M_contextPriority), + #(SchedulingProtocol: $e._M_pPolicyBag->_M_values._M_specificValues._M_schedulingProtocol), + #(DynamicProgressFeedback: $e._M_pPolicyBag->_M_values._M_specificValues._M_dynamicProgressFeedback) + ) + ) +} + +;------------------------------------------------------------------------------ +; Concurrency::event from +;------------------------------------------------------------------------------ +Concurrency::event{ + preview ( + #( + #if ($e._M_pWaitChain == 1) ("set") + #else ("not_set") + ) + ) + + children ( + #( + #([is_set]: ($e._M_pWaitChain == 1)), + #([has_waiters]: (($e._M_pWaitChain != 0) && ($e._M_pWaitChain != 1))) + ) + ) +} + +;------------------------------------------------------------------------------ +; Concurrency::critical_section from +;------------------------------------------------------------------------------ +Concurrency::critical_section{ + preview ( + #( + #if ($e._M_pHead != 0) ("locked") + #else ("not_locked") + ) + ) + + children ( + #( + #([is_locked]: ($e._M_pHead != 0)), + #(OwningContext: *((Concurrency::Context*)($e._M_activeNode[0]))) + ) + ) +} + +;------------------------------------------------------------------------------ +; Concurrency::critical_section::scoped_lock from +;------------------------------------------------------------------------------ +Concurrency::critical_section::scoped_lock{ + preview ( + #( + $e._M_critical_section + ) + ) + + children ( + #( + CriticalSection: $e._M_critical_section + ) + ) +} + +;------------------------------------------------------------------------------ +; Concurrency::reader_writer_lock from +;------------------------------------------------------------------------------ +Concurrency::reader_writer_lock{ + preview ( + #( + #if (($e._M_lockState < 8) && ($e._M_lockState & 2)) ("held_by_writer") + #elif ($e._M_lockState >= 8) ( + #( + "held_by_reader(s) [", + ($e._M_lockState / 8), + "]" + ) + ) + #else ("not_held") + ) + ) + + children ( + #( + #([is_reader_lock_held]: ($e._M_lockState >= 8)), + #([num_reader_lock_holders]: ($e._M_lockState / 8)), + #([is_writer_lock_held]: ($e._M_lockState < 8) && ($e._M_lockState & 2)), + #(OwningWriterContext: *((Concurrency::Context*)($e._M_activeWriter[0]))) + ) + ) +} + +;------------------------------------------------------------------------------ +; Concurrency::reader_writer_lock::scoped_lock from +; Concurrency::reader_writer_lock::scoped_lock_read from +;------------------------------------------------------------------------------ +Concurrency::reader_writer_lock::scoped_lock|Concurrency::reader_writer_lock::scoped_lock_read{ + preview ( + #( + $e._M_reader_writer_lock + ) + ) + + children ( + #( + ReaderWriterLock: $e._M_reader_writer_lock + ) + ) +} + +;------------------------------------------------------------------------------ +; Concurrency::details::_TaskCollectionBase from +;------------------------------------------------------------------------------ +Concurrency::details::_TaskCollectionBase{ + preview ( + #( + #if ((((int)$e._M_pException & ~0x3) != 0) && (((int)$e._M_pException & ~0x3) != 0xC)) ("exception") + #else ("no_exception") + ) + ) + + children ( + #( + #([has_exception]: (((int)$e._M_pException & ~0x3) != 0) && (((int)$e._M_pException & ~0x3) != 0xC)), + #(CreatingContext: *((Concurrency::Context*)$e._M_pOwningContext)) + ) + ) +} + +;------------------------------------------------------------------------------ +; Concurrency::task_group from +; Concurrency::structured_task_group from +;------------------------------------------------------------------------------ +Concurrency::task_group|Concurrency::structured_task_group{ + preview ( + #( + #if ((((int)$e._M_task_collection._M_pException & ~0x3) != 0) && (((int)$e._M_task_collection._M_pException & ~0x3) != 0xC)) ("exception") + #else ("no_exception") + ) + ) + + children ( + #( + #([has_exception]: (((int)$e._M_task_collection._M_pException & ~0x3) != 0) && (((int)$e._M_task_collection._M_pException & ~0x3) != 0xC)), + #(CreatingContext: *((Concurrency::Context*)$e._M_task_collection._M_pOwningContext)) + ) + ) +} + +;------------------------------------------------------------------------------ +; Concurrency::task_handle from +;------------------------------------------------------------------------------ +Concurrency::task_handle<*>{ + preview ( + #( + $e._M_function + ) + ) + + children ( + #( + #(Function: $e._M_function), + #(RuntimeOwnsLifetime: $e._M_fRuntimeOwnsLifetime), + #(TaskCollection: *($e._M_pTaskCollection)) + ) + ) +} + +;------------------------------------------------------------------------------ +; Concurrency::combinable from +;------------------------------------------------------------------------------ +Concurrency::combinable<*>{ + preview( + #( + "(", + #array( + expr: *($e._M_buckets[$i]), + size: $e._M_size + ) : #list( + head: $e, + next: _M_chain + ) : $e._M_value, + ")" + ) + ) + children( + #( + #array( + expr: *($e._M_buckets[$i]), + size: $e._M_size + ) : #list( + head: $e, + next: _M_chain + ) : $e._M_value, + #(InitFunction : $e._M_fnInitialize) + ) + ) +} + +;------------------------------------------------------------------------------ +; Concurrency::concurrent_vector from +;------------------------------------------------------------------------------ +Concurrency::concurrent_vector<*,*>{ + preview( + #( + "[", + $e._My_early_size._M_value, + "](", + #array ( + expr: #( + #if (($i >> 1) == 0) ((($T1*)$e._My_segment._M_value[0]._My_array)[$i]) + #else ((($T1*)$e._My_segment._M_value[__log2($i)]._My_array)[$i - (0x1 << __log2($i))]) + ), + size: $e._My_early_size._M_value + ), + ")" + ) + ) + children( + #( + [size] : $e._My_early_size._M_value, + #array ( + expr: #( + #if (($i >> 1) == 0) ((($T1*)$e._My_segment._M_value[0]._My_array)[$i]) + #else ((($T1*)$e._My_segment._M_value[__log2($i)]._My_array)[$i - (0x1 << __log2($i))]) + ), + size: $e._My_early_size._M_value + ) + ) + ) +} + +;------------------------------------------------------------------------------ +; Concurrency::details::_Vector_iterator from +;------------------------------------------------------------------------------ +Concurrency::details::_Vector_iterator,*>{ + preview( + #( + #if (($e._My_index >> 1) == 0) ((($T1*)$e._My_vector->_My_segment._M_value[0]._My_array)[$e._My_index]) + #else ((($T1*)$e._My_vector->_My_segment._M_value[__log2($e._My_index)]._My_array)[$e._My_index - (0x1 << __log2($e._My_index))]) + ) + ) + children( + #( + [ptr]: #if (($e._My_index >> 1) == 0) (&((($T1*)$e._My_vector->_My_segment._M_value[0]._My_array)[$e._My_index])) + #else (&((($T1*)$e._My_vector->_My_segment._M_value[__log2($e._My_index)]._My_array)[$e._My_index - (0x1 << __log2($e._My_index))])) + + ) + ) +} + +;------------------------------------------------------------------------------ +; Concurrency::concurrent_queue from +;------------------------------------------------------------------------------ +Concurrency::concurrent_queue<*,*>{ + preview + ( + #( + "[", + $e._My_rep->_Tail_counter._M_value - $e._My_rep->_Head_counter._M_value, + "](", + #array + ( + expr : #if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 0) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 1) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 2) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 3) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 4) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 5) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 6) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 7) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 8) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 9) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 10) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 11) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 12) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 13) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 14) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 15) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 16) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 17) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 18) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 19) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1])))))))))))))))))))), + size : #if ($e._My_rep->_Tail_counter._M_value-$e._My_rep->_Head_counter._M_value < 20*8*$e._Items_per_page) ($e._My_rep->_Tail_counter._M_value-$e._My_rep->_Head_counter._M_value) + #else (20*8*$e._Items_per_page) + ), + ")" + ) + ) + children + ( + #( + #([unsafe_size]: $e._My_rep->_Tail_counter._M_value-$e._My_rep->_Head_counter._M_value), + #array + ( + expr : #if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 0) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 1) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 2) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 3) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 4) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 5) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 6) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 7) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 8) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 9) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 10) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 11) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 12) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 13) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 14) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 15) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 16) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 17) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 18) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 19) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) + #else ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1])))))))))))))))))))), + size : #if ($e._My_rep->_Tail_counter._M_value-$e._My_rep->_Head_counter._M_value < 20*8*$e._Items_per_page) ($e._My_rep->_Tail_counter._M_value-$e._My_rep->_Head_counter._M_value) + #else (20*8*$e._Items_per_page) + ) + ) + ) +} + +;------------------------------------------------------------------------------ +; Concurrency::details::_Concurrent_queue_iterator from +;------------------------------------------------------------------------------ +Concurrency::details::_Concurrent_queue_iterator,*>{ + preview( + #( + *(($T1*)$e._My_item) + ) + ) + children( + #( + [ptr]: (($T1*)$e._My_item) + + ) + ) +} + +; This section lets you define your own errors for the HRESULT display. +; You need to list the error code in unsigned decimal, followed by the message. +; Changes will take effect the next time you redisplay the variable. + +[hresult] +;1234=my custom error code + +[Visualizer] + +glm::detail::tvec2<*>{ + preview ( + #(#($c.x,$c.y)) + ) + children ( + #([x]: $c.x,[y]: $c.y) + ) +} + +glm::detail::tvec3<*>{ + preview ( + #($e.x,$e.y,$e.z) + ) + children ( + #([x]: $e.x,[y]: $e.y,[z]: $e.z) + ) +} + +glm::detail::tvec4<*>{ + preview ( + #($c.x,$c.y,$c.z,$c.w) + ) + children ( + #([x]: $e.x,[y]: $e.y,[z]: $e.z, #([w]: $e.w)) + ) +} diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/util/glm.natvis b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/util/glm.natvis new file mode 100644 index 0000000000000000000000000000000000000000..4db2418e402bd7eec8a8dd273e14c24c57733353 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/util/glm.natvis @@ -0,0 +1,555 @@ + + + + + + + + [{x,g}] + + x,g + + + + + [{x,g} {y,g}] + + x,g + y,g + + + + + [{x,g} {y,g} {z,g}] + + x,g + y,g + z,g + + + + + [{x,g} {y,g} {z,g} {w,g}] + + x,g + y,g + z,g + w,g + + + + + [{(int)x}] + + x + + + + + [{(int)x} {(int)y}] + + x + y + + + + + [{(int)x,g} {(int)y,g} {(int)z,g}] + + x + y + z + + + + + [{(int)x,g} {(int)y,g} {(int)z,g} {(int)w,g}] + + x + y + z + w + + + + + [{x,g} {y,g}] + + + + + + + + k = *(float *)&i + k = k * (1.5f - (n * k * k)) + k = k * (1.5f - (n * k * k)) + k = k * (1.5f - (n * k * k)) + 1/k,g + + + 0.0f,g + + + x,g + y,g + + + + + [{x,g} {y,g} {z,g}] + + + + + + + + k = *(float *)&i + k = k * (1.5f - (n * k * k)) + k = k * (1.5f - (n * k * k)) + k = k * (1.5f - (n * k * k)) + 1/k,g + + + 0.0f,g + + + + + + #{ + (unsigned((x<0?0:(x>1?1:x))*255.5f) << 24) | + (unsigned((y<0?0:(y>1?1:y))*255.5f) << 16) | + (unsigned((z<0?0:(z>1?1:z))*255.5f) << 8) | 0xFF,Xb + } + + + x,g + y,g + z,g + + + + + [{x,g} {y,g} {z,g} {w,g}] + + + + + + + + k = *(float *)&i + k = k * (1.5f - (n * k * k)) + k = k * (1.5f - (n * k * k)) + k = k * (1.5f - (n * k * k)) + 1/k,g + + + 0.0f,g + + + + + + #{ + (unsigned((x<0?0:(x>1?1:x))*255.5f) << 24) | + (unsigned((y<0?0:(y>1?1:y))*255.5f) << 16) | + (unsigned((z<0?0:(z>1?1:z))*255.5f) << 8) | + (unsigned((w<0?0:(w>1?1:w))*255.5f) << 0),Xb + } + + + x,g + y,g + z,g + w,g + + + + + [{x,g} {y,g}] + + + + + + + + k = *(double *)&i + k = k * (1.5 - (n * k * k)) + k = k * (1.5 - (n * k * k)) + k = k * (1.5 - (n * k * k)) + 1/k,g + + + 0.0,g + + + x,g + y,g + + + + + [{x,g} {y,g} {z,g}] + + + + + + + + k = *(double *)&i + k = k * (1.5 - (n * k * k)) + k = k * (1.5 - (n * k * k)) + k = k * (1.5 - (n * k * k)) + 1/k,g + + + 0.0,g + + + x,g + y,g + z,g + + + + + [{x,g} {y,g} {z,g} {w,g}] + + + + + + + + k = *(double *)&i + k = k * (1.5 - (n * k * k)) + k = k * (1.5 - (n * k * k)) + k = k * (1.5 - (n * k * k)) + 1/k,g + + + 0.0,g + + + x,g + y,g + z,g + w,g + + + + + {w,g} + {x,g}i + {y,g}j + {z,g}k + + x,g + y,g + z,g + w,g + + + + + {w,g} + {x,g}i + {y,g}j + {z,g}k + + + + + + + + k = *(float *)&i + k = k * (1.5f - (n * k * k)) + k = k * (1.5f - (n * k * k)) + k = k * (1.5f - (n * k * k)) + 1/k,g + + + 0.0f,g + + + x,g + y,g + z,g + w,g + + + + + {w,g} + {x,g}i + {y,g}j + {z,g}k + + + + + + + + k = *(double *)&i + k = k * (1.5 - (n * k * k)) + k = k * (1.5 - (n * k * k)) + k = k * (1.5 - (n * k * k)) + 1/k,g + + + 0.0,g + + + x,g + y,g + z,g + w,g + + + + + [{value[0]} {value[1]}] + + + + [{value[0].x,g} {value[1].x,g}] + + + [{value[0].y,g} {value[1].y,g}] + + + + value[0] + value[1] + + + + + + + [{value[0]} {value[1]}] + + + + [{value[0].x,g} {value[1].x,g}] + + + [{value[0].y,g} {value[1].y,g}] + + + [{value[0].z,g} {value[1].z,g}] + + + + value[0] + value[1] + + + + + + + [{value[0]} {value[1]}] + + + + [{value[0].x,g} {value[1].x,g}] + + + [{value[0].y,g} {value[1].y,g}] + + + [{value[0].z,g} {value[1].z,g}] + + + [{value[0].w,g} {value[1].w,g}] + + + + value[0] + value[1] + + + + + + + [{value[0]} {value[1]} {value[2]}] + + + + [{value[0].x,g} {value[1].x,g} {value[2].x,g}] + + + [{value[0].y,g} {value[1].y,g} {value[2].y,g}] + + + + value[0] + value[1] + value[2] + + + + + + + [{value[0]} {value[1]} {value[2]}] + + + + [{value[0].x,g} {value[1].x,g} {value[2].x,g}] + + + [{value[0].y,g} {value[1].y,g} {value[2].y,g}] + + + [{value[0].z,g} {value[1].z,g} {value[2].z,g}] + + + + value[0] + value[1] + value[2] + + + + + + + [{value[0]} {value[1]} {value[2]}] + + + + [{value[0].x,g} {value[1].x,g} {value[2].x,g}] + + + [{value[0].y,g} {value[1].y,g} {value[2].y,g}] + + + [{value[0].z,g} {value[1].z,g} {value[2].z,g}] + + + [{value[0].w,g} {value[1].w,g} {value[2].w,g}] + + + + value[0] + value[1] + value[2] + + + + + + + [{value[0]} {value[1]} {value[2]} {value[3]}] + + + + [{value[0].x,g} {value[1].x,g} {value[2].x,g} {value[3].x,g}] + + + [{value[0].y,g} {value[1].y,g} {value[2].y,g} {value[3].y,g}] + + + + value[0] + value[1] + value[2] + value[3] + + + + + + + [{value[0]} {value[1]} {value[2]} {value[3]}] + + + + [{value[0].x,g} {value[1].x,g} {value[2].x,g} {value[3].x,g}] + + + [{value[0].y,g} {value[1].y,g} {value[2].y,g} {value[3].y,g}] + + + [{value[0].z,g} {value[1].z,g} {value[2].z,g} {value[3].z,g}] + + + + value[0] + value[1] + value[2] + value[3] + + + + + + + [{value[0]} {value[1]} {value[2]} {value[3]}] + + + + [{value[0].x,g} {value[1].x,g} {value[2].x,g} {value[3].x,g}] + + + [{value[0].y,g} {value[1].y,g} {value[2].y,g} {value[3].y,g}] + + + [{value[0].z,g} {value[1].z,g} {value[2].z,g} {value[3].z,g}] + + + [{value[0].w,g} {value[1].w,g} {value[2].w,g} {value[3].w,g}] + + + + value[0] + value[1] + value[2] + value[3] + + + + + + + [r: {real}] [d: {dual}] + + real + dual + + + + \ No newline at end of file diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/util/usertype.dat b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/util/usertype.dat new file mode 100644 index 0000000000000000000000000000000000000000..a614595184d9c9066554a7cf260b42d41485d6cd --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/glm/util/usertype.dat @@ -0,0 +1,407 @@ +attribute +const +uniform +varying +break +continue +do +for +while +if +else +in +out +inout +float +int +void +bool +true +false +discard +return +mat2 +mat3 +mat4 +mat2x2 +mat3x3 +mat4x4 +mat2x3 +mat3x2 +mat2x4 +mat4x2 +mat3x4 +mat4x3 +vec2 +vec3 +vec4 +ivec2 +ivec3 +ivec4 +uvec2 +uvec3 +uvec4 +bvec2 +bvec3 +bvec4 +sampler1D +sampler2D +sampler3D +samplerCube +sampler1DShadow +sampler2DShadow +struct + +asm +class +union +enum +typedef +template +this +packed +goto +switch +default +inline +noinline +volatile +public +static +extern +external +interface +long +short +double +half +fixed +unsigned +input +output +sampler2DRect +sampler3DRect +sampler2DRectShadow +sizeof +cast +namespace +using + +layout +location +smooth +flat +noperspective +centroid +invariant +lowp +mediump +highp +precision +patch +sample +subroutine + +hvec2 +hvec3 +hvec4 +fvec2 +fvec3 +fvec4 +dvec2 +dvec3 +dvec4 + +on + +final +abstract +limited +access +self + +uchar +schar +uint +sint + +int8 +int16 +int32 +int64 + +sint8 +sint16 +sint32 +sint64 + +uint8 +uint16 +uint32 +uint64 + +float16 +float32 +float64 + +quat +hquat +fquat +dquat + +handle +handle8 +handle16 +handle32 +handle64 + +flag +flag8 +flag16 +flag32 +flag64 + +import +export + +hmat2 +hmat3 +hmat4 + +fmat2 +fmat3 +fmat4 + +dmat2 +dmat3 +dmat4 + +hmat2x3 +hmat3x2 +hmat2x4 +hmat4x2 +hmat3x4 +hmat4x3 + +fmat2x3 +fmat3x2 +fmat2x4 +fmat4x2 +fmat3x4 +fmat4x3 + +dmat2x3 +dmat3x2 +dmat2x4 +dmat4x2 +dmat3x4 +dmat4x3 + +null +pi +epsilon +infinite +self + +byte +word +dword +qword + +new_object +new_array +delete_object +delete_array + +int8 +int16 +int32 +int64 + +i8 +i16 +i32 +i64 + +i8vec2 +i8vec3 +i8vec4 + +i16vec2 +i16vec3 +i16vec4 + +i32vec2 +i32vec3 +i32vec4 + +i64vec2 +i64vec3 +i64vec4 + +uint8 +uint16 +uint32 +uint64 + +u8 +u16 +u32 +u64 + +u8vec2 +u8vec3 +u8vec4 + +u16vec2 +u16vec3 +u16vec4 + +u32vec2 +u32vec3 +u32vec4 + +u64vec2 +u64vec3 +u64vec4 + +float16 +float32 +float64 + +f16 +f32 +f64 + +f16vec2 +f16vec3 +f16vec4 + +f32vec2 +f32vec3 +f32vec4 + +f64vec2 +f64vec3 +f64vec4 + +f16mat2 +f16mat3 +f16mat4 + +f16mat2x3 +f16mat2x4 +f16mat3x2 +f16mat3x4 +f16mat4x2 +f16mat4x3 + +f32mat2 +f32mat3 +f32mat4 + +f32mat2x3 +f32mat2x4 +f32mat3x2 +f32mat3x4 +f32mat4x2 +f32mat4x3 + +f64mat2 +f64mat3 +f64mat4 + +f64mat2x3 +f64mat2x4 +f64mat3x2 +f64mat3x4 +f64mat4x2 +f64mat4x3 + +f16quat +f32quat +f64quat + +bool1 +bool2 +bool3 +bool4 + +bool1x1 +bool2x2 +bool3x3 +bool4x4 + +bool2x3 +bool2x4 +bool3x2 +bool3x4 +bool4x2 +bool4x3 + +int1 +int2 +int3 +int4 + +int1x1 +int2x2 +int3x3 +int4x4 + +int2x3 +int2x4 +int3x2 +int3x4 +int4x2 +int4x3 + +half1 +half2 +half3 +half4 + +half2x2 +half3x3 +half4x4 + +half2x3 +half2x4 +half3x2 +half3x4 +half4x2 +half4x3 + +float1 +float2 +float3 +float4 + +float1x1 +float2x2 +float3x3 +float4x4 + +float2x3 +float2x4 +float3x2 +float3x4 +float4x2 +float4x3 + +double1 +double2 +double3 +double4 + +double1x1 +double2x2 +double3x3 +double4x4 + +double2x3 +double2x4 +double3x2 +double3x4 +double4x2 +double4x3 diff --git a/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/stbi_image_write.h b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/stbi_image_write.h new file mode 100644 index 0000000000000000000000000000000000000000..92d7924ef238583a003bc2614f308d9f7cafdcd5 --- /dev/null +++ b/AnimatableGaussians/gaussians/diff_gaussian_rasterization_depth_alpha/third_party/stbi_image_write.h @@ -0,0 +1,1724 @@ +/* stb_image_write - v1.16 - public domain - http://nothings.org/stb + writes out PNG/BMP/TGA/JPEG/HDR images to C stdio - Sean Barrett 2010-2015 + no warranty implied; use at your own risk + + Before #including, + + #define STB_IMAGE_WRITE_IMPLEMENTATION + + in the file that you want to have the implementation. + + Will probably not work correctly with strict-aliasing optimizations. + +ABOUT: + + This header file is a library for writing images to C stdio or a callback. + + The PNG output is not optimal; it is 20-50% larger than the file + written by a decent optimizing implementation; though providing a custom + zlib compress function (see STBIW_ZLIB_COMPRESS) can mitigate that. + This library is designed for source code compactness and simplicity, + not optimal image file size or run-time performance. + +BUILDING: + + You can #define STBIW_ASSERT(x) before the #include to avoid using assert.h. + You can #define STBIW_MALLOC(), STBIW_REALLOC(), and STBIW_FREE() to replace + malloc,realloc,free. + You can #define STBIW_MEMMOVE() to replace memmove() + You can #define STBIW_ZLIB_COMPRESS to use a custom zlib-style compress function + for PNG compression (instead of the builtin one), it must have the following signature: + unsigned char * my_compress(unsigned char *data, int data_len, int *out_len, int quality); + The returned data will be freed with STBIW_FREE() (free() by default), + so it must be heap allocated with STBIW_MALLOC() (malloc() by default), + +UNICODE: + + If compiling for Windows and you wish to use Unicode filenames, compile + with + #define STBIW_WINDOWS_UTF8 + and pass utf8-encoded filenames. Call stbiw_convert_wchar_to_utf8 to convert + Windows wchar_t filenames to utf8. + +USAGE: + + There are five functions, one for each image file format: + + int stbi_write_png(char const *filename, int w, int h, int comp, const void *data, int stride_in_bytes); + int stbi_write_bmp(char const *filename, int w, int h, int comp, const void *data); + int stbi_write_tga(char const *filename, int w, int h, int comp, const void *data); + int stbi_write_jpg(char const *filename, int w, int h, int comp, const void *data, int quality); + int stbi_write_hdr(char const *filename, int w, int h, int comp, const float *data); + + void stbi_flip_vertically_on_write(int flag); // flag is non-zero to flip data vertically + + There are also five equivalent functions that use an arbitrary write function. You are + expected to open/close your file-equivalent before and after calling these: + + int stbi_write_png_to_func(stbi_write_func *func, void *context, int w, int h, int comp, const void *data, int stride_in_bytes); + int stbi_write_bmp_to_func(stbi_write_func *func, void *context, int w, int h, int comp, const void *data); + int stbi_write_tga_to_func(stbi_write_func *func, void *context, int w, int h, int comp, const void *data); + int stbi_write_hdr_to_func(stbi_write_func *func, void *context, int w, int h, int comp, const float *data); + int stbi_write_jpg_to_func(stbi_write_func *func, void *context, int x, int y, int comp, const void *data, int quality); + + where the callback is: + void stbi_write_func(void *context, void *data, int size); + + You can configure it with these global variables: + int stbi_write_tga_with_rle; // defaults to true; set to 0 to disable RLE + int stbi_write_png_compression_level; // defaults to 8; set to higher for more compression + int stbi_write_force_png_filter; // defaults to -1; set to 0..5 to force a filter mode + + + You can define STBI_WRITE_NO_STDIO to disable the file variant of these + functions, so the library will not use stdio.h at all. However, this will + also disable HDR writing, because it requires stdio for formatted output. + + Each function returns 0 on failure and non-0 on success. + + The functions create an image file defined by the parameters. The image + is a rectangle of pixels stored from left-to-right, top-to-bottom. + Each pixel contains 'comp' channels of data stored interleaved with 8-bits + per channel, in the following order: 1=Y, 2=YA, 3=RGB, 4=RGBA. (Y is + monochrome color.) The rectangle is 'w' pixels wide and 'h' pixels tall. + The *data pointer points to the first byte of the top-left-most pixel. + For PNG, "stride_in_bytes" is the distance in bytes from the first byte of + a row of pixels to the first byte of the next row of pixels. + + PNG creates output files with the same number of components as the input. + The BMP format expands Y to RGB in the file format and does not + output alpha. + + PNG supports writing rectangles of data even when the bytes storing rows of + data are not consecutive in memory (e.g. sub-rectangles of a larger image), + by supplying the stride between the beginning of adjacent rows. The other + formats do not. (Thus you cannot write a native-format BMP through the BMP + writer, both because it is in BGR order and because it may have padding + at the end of the line.) + + PNG allows you to set the deflate compression level by setting the global + variable 'stbi_write_png_compression_level' (it defaults to 8). + + HDR expects linear float data. Since the format is always 32-bit rgb(e) + data, alpha (if provided) is discarded, and for monochrome data it is + replicated across all three channels. + + TGA supports RLE or non-RLE compressed data. To use non-RLE-compressed + data, set the global variable 'stbi_write_tga_with_rle' to 0. + + JPEG does ignore alpha channels in input data; quality is between 1 and 100. + Higher quality looks better but results in a bigger image. + JPEG baseline (no JPEG progressive). + +CREDITS: + + + Sean Barrett - PNG/BMP/TGA + Baldur Karlsson - HDR + Jean-Sebastien Guay - TGA monochrome + Tim Kelsey - misc enhancements + Alan Hickman - TGA RLE + Emmanuel Julien - initial file IO callback implementation + Jon Olick - original jo_jpeg.cpp code + Daniel Gibson - integrate JPEG, allow external zlib + Aarni Koskela - allow choosing PNG filter + + bugfixes: + github:Chribba + Guillaume Chereau + github:jry2 + github:romigrou + Sergio Gonzalez + Jonas Karlsson + Filip Wasil + Thatcher Ulrich + github:poppolopoppo + Patrick Boettcher + github:xeekworx + Cap Petschulat + Simon Rodriguez + Ivan Tikhonov + github:ignotion + Adam Schackart + Andrew Kensler + +LICENSE + + See end of file for license information. + +*/ + +#ifndef INCLUDE_STB_IMAGE_WRITE_H +#define INCLUDE_STB_IMAGE_WRITE_H + +#include + +// if STB_IMAGE_WRITE_STATIC causes problems, try defining STBIWDEF to 'inline' or 'static inline' +#ifndef STBIWDEF +#ifdef STB_IMAGE_WRITE_STATIC +#define STBIWDEF static +#else +#ifdef __cplusplus +#define STBIWDEF extern "C" +#else +#define STBIWDEF extern +#endif +#endif +#endif + +#ifndef STB_IMAGE_WRITE_STATIC // C++ forbids static forward declarations +STBIWDEF int stbi_write_tga_with_rle; +STBIWDEF int stbi_write_png_compression_level; +STBIWDEF int stbi_write_force_png_filter; +#endif + +#ifndef STBI_WRITE_NO_STDIO +STBIWDEF int stbi_write_png(char const *filename, int w, int h, int comp, const void *data, int stride_in_bytes); +STBIWDEF int stbi_write_bmp(char const *filename, int w, int h, int comp, const void *data); +STBIWDEF int stbi_write_tga(char const *filename, int w, int h, int comp, const void *data); +STBIWDEF int stbi_write_hdr(char const *filename, int w, int h, int comp, const float *data); +STBIWDEF int stbi_write_jpg(char const *filename, int x, int y, int comp, const void *data, int quality); + +#ifdef STBIW_WINDOWS_UTF8 +STBIWDEF int stbiw_convert_wchar_to_utf8(char *buffer, size_t bufferlen, const wchar_t* input); +#endif +#endif + +typedef void stbi_write_func(void *context, void *data, int size); + +STBIWDEF int stbi_write_png_to_func(stbi_write_func *func, void *context, int w, int h, int comp, const void *data, int stride_in_bytes); +STBIWDEF int stbi_write_bmp_to_func(stbi_write_func *func, void *context, int w, int h, int comp, const void *data); +STBIWDEF int stbi_write_tga_to_func(stbi_write_func *func, void *context, int w, int h, int comp, const void *data); +STBIWDEF int stbi_write_hdr_to_func(stbi_write_func *func, void *context, int w, int h, int comp, const float *data); +STBIWDEF int stbi_write_jpg_to_func(stbi_write_func *func, void *context, int x, int y, int comp, const void *data, int quality); + +STBIWDEF void stbi_flip_vertically_on_write(int flip_boolean); + +#endif//INCLUDE_STB_IMAGE_WRITE_H + +#ifdef STB_IMAGE_WRITE_IMPLEMENTATION + +#ifdef _WIN32 + #ifndef _CRT_SECURE_NO_WARNINGS + #define _CRT_SECURE_NO_WARNINGS + #endif + #ifndef _CRT_NONSTDC_NO_DEPRECATE + #define _CRT_NONSTDC_NO_DEPRECATE + #endif +#endif + +#ifndef STBI_WRITE_NO_STDIO +#include +#endif // STBI_WRITE_NO_STDIO + +#include +#include +#include +#include + +#if defined(STBIW_MALLOC) && defined(STBIW_FREE) && (defined(STBIW_REALLOC) || defined(STBIW_REALLOC_SIZED)) +// ok +#elif !defined(STBIW_MALLOC) && !defined(STBIW_FREE) && !defined(STBIW_REALLOC) && !defined(STBIW_REALLOC_SIZED) +// ok +#else +#error "Must define all or none of STBIW_MALLOC, STBIW_FREE, and STBIW_REALLOC (or STBIW_REALLOC_SIZED)." +#endif + +#ifndef STBIW_MALLOC +#define STBIW_MALLOC(sz) malloc(sz) +#define STBIW_REALLOC(p,newsz) realloc(p,newsz) +#define STBIW_FREE(p) free(p) +#endif + +#ifndef STBIW_REALLOC_SIZED +#define STBIW_REALLOC_SIZED(p,oldsz,newsz) STBIW_REALLOC(p,newsz) +#endif + + +#ifndef STBIW_MEMMOVE +#define STBIW_MEMMOVE(a,b,sz) memmove(a,b,sz) +#endif + + +#ifndef STBIW_ASSERT +#include +#define STBIW_ASSERT(x) assert(x) +#endif + +#define STBIW_UCHAR(x) (unsigned char) ((x) & 0xff) + +#ifdef STB_IMAGE_WRITE_STATIC +static int stbi_write_png_compression_level = 8; +static int stbi_write_tga_with_rle = 1; +static int stbi_write_force_png_filter = -1; +#else +int stbi_write_png_compression_level = 8; +int stbi_write_tga_with_rle = 1; +int stbi_write_force_png_filter = -1; +#endif + +static int stbi__flip_vertically_on_write = 0; + +STBIWDEF void stbi_flip_vertically_on_write(int flag) +{ + stbi__flip_vertically_on_write = flag; +} + +typedef struct +{ + stbi_write_func *func; + void *context; + unsigned char buffer[64]; + int buf_used; +} stbi__write_context; + +// initialize a callback-based context +static void stbi__start_write_callbacks(stbi__write_context *s, stbi_write_func *c, void *context) +{ + s->func = c; + s->context = context; +} + +#ifndef STBI_WRITE_NO_STDIO + +static void stbi__stdio_write(void *context, void *data, int size) +{ + fwrite(data,1,size,(FILE*) context); +} + +#if defined(_WIN32) && defined(STBIW_WINDOWS_UTF8) +#ifdef __cplusplus +#define STBIW_EXTERN extern "C" +#else +#define STBIW_EXTERN extern +#endif +STBIW_EXTERN __declspec(dllimport) int __stdcall MultiByteToWideChar(unsigned int cp, unsigned long flags, const char *str, int cbmb, wchar_t *widestr, int cchwide); +STBIW_EXTERN __declspec(dllimport) int __stdcall WideCharToMultiByte(unsigned int cp, unsigned long flags, const wchar_t *widestr, int cchwide, char *str, int cbmb, const char *defchar, int *used_default); + +STBIWDEF int stbiw_convert_wchar_to_utf8(char *buffer, size_t bufferlen, const wchar_t* input) +{ + return WideCharToMultiByte(65001 /* UTF8 */, 0, input, -1, buffer, (int) bufferlen, NULL, NULL); +} +#endif + +static FILE *stbiw__fopen(char const *filename, char const *mode) +{ + FILE *f; +#if defined(_WIN32) && defined(STBIW_WINDOWS_UTF8) + wchar_t wMode[64]; + wchar_t wFilename[1024]; + if (0 == MultiByteToWideChar(65001 /* UTF8 */, 0, filename, -1, wFilename, sizeof(wFilename)/sizeof(*wFilename))) + return 0; + + if (0 == MultiByteToWideChar(65001 /* UTF8 */, 0, mode, -1, wMode, sizeof(wMode)/sizeof(*wMode))) + return 0; + +#if defined(_MSC_VER) && _MSC_VER >= 1400 + if (0 != _wfopen_s(&f, wFilename, wMode)) + f = 0; +#else + f = _wfopen(wFilename, wMode); +#endif + +#elif defined(_MSC_VER) && _MSC_VER >= 1400 + if (0 != fopen_s(&f, filename, mode)) + f=0; +#else + f = fopen(filename, mode); +#endif + return f; +} + +static int stbi__start_write_file(stbi__write_context *s, const char *filename) +{ + FILE *f = stbiw__fopen(filename, "wb"); + stbi__start_write_callbacks(s, stbi__stdio_write, (void *) f); + return f != NULL; +} + +static void stbi__end_write_file(stbi__write_context *s) +{ + fclose((FILE *)s->context); +} + +#endif // !STBI_WRITE_NO_STDIO + +typedef unsigned int stbiw_uint32; +typedef int stb_image_write_test[sizeof(stbiw_uint32)==4 ? 1 : -1]; + +static void stbiw__writefv(stbi__write_context *s, const char *fmt, va_list v) +{ + while (*fmt) { + switch (*fmt++) { + case ' ': break; + case '1': { unsigned char x = STBIW_UCHAR(va_arg(v, int)); + s->func(s->context,&x,1); + break; } + case '2': { int x = va_arg(v,int); + unsigned char b[2]; + b[0] = STBIW_UCHAR(x); + b[1] = STBIW_UCHAR(x>>8); + s->func(s->context,b,2); + break; } + case '4': { stbiw_uint32 x = va_arg(v,int); + unsigned char b[4]; + b[0]=STBIW_UCHAR(x); + b[1]=STBIW_UCHAR(x>>8); + b[2]=STBIW_UCHAR(x>>16); + b[3]=STBIW_UCHAR(x>>24); + s->func(s->context,b,4); + break; } + default: + STBIW_ASSERT(0); + return; + } + } +} + +static void stbiw__writef(stbi__write_context *s, const char *fmt, ...) +{ + va_list v; + va_start(v, fmt); + stbiw__writefv(s, fmt, v); + va_end(v); +} + +static void stbiw__write_flush(stbi__write_context *s) +{ + if (s->buf_used) { + s->func(s->context, &s->buffer, s->buf_used); + s->buf_used = 0; + } +} + +static void stbiw__putc(stbi__write_context *s, unsigned char c) +{ + s->func(s->context, &c, 1); +} + +static void stbiw__write1(stbi__write_context *s, unsigned char a) +{ + if ((size_t)s->buf_used + 1 > sizeof(s->buffer)) + stbiw__write_flush(s); + s->buffer[s->buf_used++] = a; +} + +static void stbiw__write3(stbi__write_context *s, unsigned char a, unsigned char b, unsigned char c) +{ + int n; + if ((size_t)s->buf_used + 3 > sizeof(s->buffer)) + stbiw__write_flush(s); + n = s->buf_used; + s->buf_used = n+3; + s->buffer[n+0] = a; + s->buffer[n+1] = b; + s->buffer[n+2] = c; +} + +static void stbiw__write_pixel(stbi__write_context *s, int rgb_dir, int comp, int write_alpha, int expand_mono, unsigned char *d) +{ + unsigned char bg[3] = { 255, 0, 255}, px[3]; + int k; + + if (write_alpha < 0) + stbiw__write1(s, d[comp - 1]); + + switch (comp) { + case 2: // 2 pixels = mono + alpha, alpha is written separately, so same as 1-channel case + case 1: + if (expand_mono) + stbiw__write3(s, d[0], d[0], d[0]); // monochrome bmp + else + stbiw__write1(s, d[0]); // monochrome TGA + break; + case 4: + if (!write_alpha) { + // composite against pink background + for (k = 0; k < 3; ++k) + px[k] = bg[k] + ((d[k] - bg[k]) * d[3]) / 255; + stbiw__write3(s, px[1 - rgb_dir], px[1], px[1 + rgb_dir]); + break; + } + /* FALLTHROUGH */ + case 3: + stbiw__write3(s, d[1 - rgb_dir], d[1], d[1 + rgb_dir]); + break; + } + if (write_alpha > 0) + stbiw__write1(s, d[comp - 1]); +} + +static void stbiw__write_pixels(stbi__write_context *s, int rgb_dir, int vdir, int x, int y, int comp, void *data, int write_alpha, int scanline_pad, int expand_mono) +{ + stbiw_uint32 zero = 0; + int i,j, j_end; + + if (y <= 0) + return; + + if (stbi__flip_vertically_on_write) + vdir *= -1; + + if (vdir < 0) { + j_end = -1; j = y-1; + } else { + j_end = y; j = 0; + } + + for (; j != j_end; j += vdir) { + for (i=0; i < x; ++i) { + unsigned char *d = (unsigned char *) data + (j*x+i)*comp; + stbiw__write_pixel(s, rgb_dir, comp, write_alpha, expand_mono, d); + } + stbiw__write_flush(s); + s->func(s->context, &zero, scanline_pad); + } +} + +static int stbiw__outfile(stbi__write_context *s, int rgb_dir, int vdir, int x, int y, int comp, int expand_mono, void *data, int alpha, int pad, const char *fmt, ...) +{ + if (y < 0 || x < 0) { + return 0; + } else { + va_list v; + va_start(v, fmt); + stbiw__writefv(s, fmt, v); + va_end(v); + stbiw__write_pixels(s,rgb_dir,vdir,x,y,comp,data,alpha,pad, expand_mono); + return 1; + } +} + +static int stbi_write_bmp_core(stbi__write_context *s, int x, int y, int comp, const void *data) +{ + if (comp != 4) { + // write RGB bitmap + int pad = (-x*3) & 3; + return stbiw__outfile(s,-1,-1,x,y,comp,1,(void *) data,0,pad, + "11 4 22 4" "4 44 22 444444", + 'B', 'M', 14+40+(x*3+pad)*y, 0,0, 14+40, // file header + 40, x,y, 1,24, 0,0,0,0,0,0); // bitmap header + } else { + // RGBA bitmaps need a v4 header + // use BI_BITFIELDS mode with 32bpp and alpha mask + // (straight BI_RGB with alpha mask doesn't work in most readers) + return stbiw__outfile(s,-1,-1,x,y,comp,1,(void *)data,1,0, + "11 4 22 4" "4 44 22 444444 4444 4 444 444 444 444", + 'B', 'M', 14+108+x*y*4, 0, 0, 14+108, // file header + 108, x,y, 1,32, 3,0,0,0,0,0, 0xff0000,0xff00,0xff,0xff000000u, 0, 0,0,0, 0,0,0, 0,0,0, 0,0,0); // bitmap V4 header + } +} + +STBIWDEF int stbi_write_bmp_to_func(stbi_write_func *func, void *context, int x, int y, int comp, const void *data) +{ + stbi__write_context s = { 0 }; + stbi__start_write_callbacks(&s, func, context); + return stbi_write_bmp_core(&s, x, y, comp, data); +} + +#ifndef STBI_WRITE_NO_STDIO +STBIWDEF int stbi_write_bmp(char const *filename, int x, int y, int comp, const void *data) +{ + stbi__write_context s = { 0 }; + if (stbi__start_write_file(&s,filename)) { + int r = stbi_write_bmp_core(&s, x, y, comp, data); + stbi__end_write_file(&s); + return r; + } else + return 0; +} +#endif //!STBI_WRITE_NO_STDIO + +static int stbi_write_tga_core(stbi__write_context *s, int x, int y, int comp, void *data) +{ + int has_alpha = (comp == 2 || comp == 4); + int colorbytes = has_alpha ? comp-1 : comp; + int format = colorbytes < 2 ? 3 : 2; // 3 color channels (RGB/RGBA) = 2, 1 color channel (Y/YA) = 3 + + if (y < 0 || x < 0) + return 0; + + if (!stbi_write_tga_with_rle) { + return stbiw__outfile(s, -1, -1, x, y, comp, 0, (void *) data, has_alpha, 0, + "111 221 2222 11", 0, 0, format, 0, 0, 0, 0, 0, x, y, (colorbytes + has_alpha) * 8, has_alpha * 8); + } else { + int i,j,k; + int jend, jdir; + + stbiw__writef(s, "111 221 2222 11", 0,0,format+8, 0,0,0, 0,0,x,y, (colorbytes + has_alpha) * 8, has_alpha * 8); + + if (stbi__flip_vertically_on_write) { + j = 0; + jend = y; + jdir = 1; + } else { + j = y-1; + jend = -1; + jdir = -1; + } + for (; j != jend; j += jdir) { + unsigned char *row = (unsigned char *) data + j * x * comp; + int len; + + for (i = 0; i < x; i += len) { + unsigned char *begin = row + i * comp; + int diff = 1; + len = 1; + + if (i < x - 1) { + ++len; + diff = memcmp(begin, row + (i + 1) * comp, comp); + if (diff) { + const unsigned char *prev = begin; + for (k = i + 2; k < x && len < 128; ++k) { + if (memcmp(prev, row + k * comp, comp)) { + prev += comp; + ++len; + } else { + --len; + break; + } + } + } else { + for (k = i + 2; k < x && len < 128; ++k) { + if (!memcmp(begin, row + k * comp, comp)) { + ++len; + } else { + break; + } + } + } + } + + if (diff) { + unsigned char header = STBIW_UCHAR(len - 1); + stbiw__write1(s, header); + for (k = 0; k < len; ++k) { + stbiw__write_pixel(s, -1, comp, has_alpha, 0, begin + k * comp); + } + } else { + unsigned char header = STBIW_UCHAR(len - 129); + stbiw__write1(s, header); + stbiw__write_pixel(s, -1, comp, has_alpha, 0, begin); + } + } + } + stbiw__write_flush(s); + } + return 1; +} + +STBIWDEF int stbi_write_tga_to_func(stbi_write_func *func, void *context, int x, int y, int comp, const void *data) +{ + stbi__write_context s = { 0 }; + stbi__start_write_callbacks(&s, func, context); + return stbi_write_tga_core(&s, x, y, comp, (void *) data); +} + +#ifndef STBI_WRITE_NO_STDIO +STBIWDEF int stbi_write_tga(char const *filename, int x, int y, int comp, const void *data) +{ + stbi__write_context s = { 0 }; + if (stbi__start_write_file(&s,filename)) { + int r = stbi_write_tga_core(&s, x, y, comp, (void *) data); + stbi__end_write_file(&s); + return r; + } else + return 0; +} +#endif + +// ************************************************************************************************* +// Radiance RGBE HDR writer +// by Baldur Karlsson + +#define stbiw__max(a, b) ((a) > (b) ? (a) : (b)) + +#ifndef STBI_WRITE_NO_STDIO + +static void stbiw__linear_to_rgbe(unsigned char *rgbe, float *linear) +{ + int exponent; + float maxcomp = stbiw__max(linear[0], stbiw__max(linear[1], linear[2])); + + if (maxcomp < 1e-32f) { + rgbe[0] = rgbe[1] = rgbe[2] = rgbe[3] = 0; + } else { + float normalize = (float) frexp(maxcomp, &exponent) * 256.0f/maxcomp; + + rgbe[0] = (unsigned char)(linear[0] * normalize); + rgbe[1] = (unsigned char)(linear[1] * normalize); + rgbe[2] = (unsigned char)(linear[2] * normalize); + rgbe[3] = (unsigned char)(exponent + 128); + } +} + +static void stbiw__write_run_data(stbi__write_context *s, int length, unsigned char databyte) +{ + unsigned char lengthbyte = STBIW_UCHAR(length+128); + STBIW_ASSERT(length+128 <= 255); + s->func(s->context, &lengthbyte, 1); + s->func(s->context, &databyte, 1); +} + +static void stbiw__write_dump_data(stbi__write_context *s, int length, unsigned char *data) +{ + unsigned char lengthbyte = STBIW_UCHAR(length); + STBIW_ASSERT(length <= 128); // inconsistent with spec but consistent with official code + s->func(s->context, &lengthbyte, 1); + s->func(s->context, data, length); +} + +static void stbiw__write_hdr_scanline(stbi__write_context *s, int width, int ncomp, unsigned char *scratch, float *scanline) +{ + unsigned char scanlineheader[4] = { 2, 2, 0, 0 }; + unsigned char rgbe[4]; + float linear[3]; + int x; + + scanlineheader[2] = (width&0xff00)>>8; + scanlineheader[3] = (width&0x00ff); + + /* skip RLE for images too small or large */ + if (width < 8 || width >= 32768) { + for (x=0; x < width; x++) { + switch (ncomp) { + case 4: /* fallthrough */ + case 3: linear[2] = scanline[x*ncomp + 2]; + linear[1] = scanline[x*ncomp + 1]; + linear[0] = scanline[x*ncomp + 0]; + break; + default: + linear[0] = linear[1] = linear[2] = scanline[x*ncomp + 0]; + break; + } + stbiw__linear_to_rgbe(rgbe, linear); + s->func(s->context, rgbe, 4); + } + } else { + int c,r; + /* encode into scratch buffer */ + for (x=0; x < width; x++) { + switch(ncomp) { + case 4: /* fallthrough */ + case 3: linear[2] = scanline[x*ncomp + 2]; + linear[1] = scanline[x*ncomp + 1]; + linear[0] = scanline[x*ncomp + 0]; + break; + default: + linear[0] = linear[1] = linear[2] = scanline[x*ncomp + 0]; + break; + } + stbiw__linear_to_rgbe(rgbe, linear); + scratch[x + width*0] = rgbe[0]; + scratch[x + width*1] = rgbe[1]; + scratch[x + width*2] = rgbe[2]; + scratch[x + width*3] = rgbe[3]; + } + + s->func(s->context, scanlineheader, 4); + + /* RLE each component separately */ + for (c=0; c < 4; c++) { + unsigned char *comp = &scratch[width*c]; + + x = 0; + while (x < width) { + // find first run + r = x; + while (r+2 < width) { + if (comp[r] == comp[r+1] && comp[r] == comp[r+2]) + break; + ++r; + } + if (r+2 >= width) + r = width; + // dump up to first run + while (x < r) { + int len = r-x; + if (len > 128) len = 128; + stbiw__write_dump_data(s, len, &comp[x]); + x += len; + } + // if there's a run, output it + if (r+2 < width) { // same test as what we break out of in search loop, so only true if we break'd + // find next byte after run + while (r < width && comp[r] == comp[x]) + ++r; + // output run up to r + while (x < r) { + int len = r-x; + if (len > 127) len = 127; + stbiw__write_run_data(s, len, comp[x]); + x += len; + } + } + } + } + } +} + +static int stbi_write_hdr_core(stbi__write_context *s, int x, int y, int comp, float *data) +{ + if (y <= 0 || x <= 0 || data == NULL) + return 0; + else { + // Each component is stored separately. Allocate scratch space for full output scanline. + unsigned char *scratch = (unsigned char *) STBIW_MALLOC(x*4); + int i, len; + char buffer[128]; + char header[] = "#?RADIANCE\n# Written by stb_image_write.h\nFORMAT=32-bit_rle_rgbe\n"; + s->func(s->context, header, sizeof(header)-1); + +#ifdef __STDC_LIB_EXT1__ + len = sprintf_s(buffer, sizeof(buffer), "EXPOSURE= 1.0000000000000\n\n-Y %d +X %d\n", y, x); +#else + len = sprintf(buffer, "EXPOSURE= 1.0000000000000\n\n-Y %d +X %d\n", y, x); +#endif + s->func(s->context, buffer, len); + + for(i=0; i < y; i++) + stbiw__write_hdr_scanline(s, x, comp, scratch, data + comp*x*(stbi__flip_vertically_on_write ? y-1-i : i)); + STBIW_FREE(scratch); + return 1; + } +} + +STBIWDEF int stbi_write_hdr_to_func(stbi_write_func *func, void *context, int x, int y, int comp, const float *data) +{ + stbi__write_context s = { 0 }; + stbi__start_write_callbacks(&s, func, context); + return stbi_write_hdr_core(&s, x, y, comp, (float *) data); +} + +STBIWDEF int stbi_write_hdr(char const *filename, int x, int y, int comp, const float *data) +{ + stbi__write_context s = { 0 }; + if (stbi__start_write_file(&s,filename)) { + int r = stbi_write_hdr_core(&s, x, y, comp, (float *) data); + stbi__end_write_file(&s); + return r; + } else + return 0; +} +#endif // STBI_WRITE_NO_STDIO + + +////////////////////////////////////////////////////////////////////////////// +// +// PNG writer +// + +#ifndef STBIW_ZLIB_COMPRESS +// stretchy buffer; stbiw__sbpush() == vector<>::push_back() -- stbiw__sbcount() == vector<>::size() +#define stbiw__sbraw(a) ((int *) (void *) (a) - 2) +#define stbiw__sbm(a) stbiw__sbraw(a)[0] +#define stbiw__sbn(a) stbiw__sbraw(a)[1] + +#define stbiw__sbneedgrow(a,n) ((a)==0 || stbiw__sbn(a)+n >= stbiw__sbm(a)) +#define stbiw__sbmaybegrow(a,n) (stbiw__sbneedgrow(a,(n)) ? stbiw__sbgrow(a,n) : 0) +#define stbiw__sbgrow(a,n) stbiw__sbgrowf((void **) &(a), (n), sizeof(*(a))) + +#define stbiw__sbpush(a, v) (stbiw__sbmaybegrow(a,1), (a)[stbiw__sbn(a)++] = (v)) +#define stbiw__sbcount(a) ((a) ? stbiw__sbn(a) : 0) +#define stbiw__sbfree(a) ((a) ? STBIW_FREE(stbiw__sbraw(a)),0 : 0) + +static void *stbiw__sbgrowf(void **arr, int increment, int itemsize) +{ + int m = *arr ? 2*stbiw__sbm(*arr)+increment : increment+1; + void *p = STBIW_REALLOC_SIZED(*arr ? stbiw__sbraw(*arr) : 0, *arr ? (stbiw__sbm(*arr)*itemsize + sizeof(int)*2) : 0, itemsize * m + sizeof(int)*2); + STBIW_ASSERT(p); + if (p) { + if (!*arr) ((int *) p)[1] = 0; + *arr = (void *) ((int *) p + 2); + stbiw__sbm(*arr) = m; + } + return *arr; +} + +static unsigned char *stbiw__zlib_flushf(unsigned char *data, unsigned int *bitbuffer, int *bitcount) +{ + while (*bitcount >= 8) { + stbiw__sbpush(data, STBIW_UCHAR(*bitbuffer)); + *bitbuffer >>= 8; + *bitcount -= 8; + } + return data; +} + +static int stbiw__zlib_bitrev(int code, int codebits) +{ + int res=0; + while (codebits--) { + res = (res << 1) | (code & 1); + code >>= 1; + } + return res; +} + +static unsigned int stbiw__zlib_countm(unsigned char *a, unsigned char *b, int limit) +{ + int i; + for (i=0; i < limit && i < 258; ++i) + if (a[i] != b[i]) break; + return i; +} + +static unsigned int stbiw__zhash(unsigned char *data) +{ + stbiw_uint32 hash = data[0] + (data[1] << 8) + (data[2] << 16); + hash ^= hash << 3; + hash += hash >> 5; + hash ^= hash << 4; + hash += hash >> 17; + hash ^= hash << 25; + hash += hash >> 6; + return hash; +} + +#define stbiw__zlib_flush() (out = stbiw__zlib_flushf(out, &bitbuf, &bitcount)) +#define stbiw__zlib_add(code,codebits) \ + (bitbuf |= (code) << bitcount, bitcount += (codebits), stbiw__zlib_flush()) +#define stbiw__zlib_huffa(b,c) stbiw__zlib_add(stbiw__zlib_bitrev(b,c),c) +// default huffman tables +#define stbiw__zlib_huff1(n) stbiw__zlib_huffa(0x30 + (n), 8) +#define stbiw__zlib_huff2(n) stbiw__zlib_huffa(0x190 + (n)-144, 9) +#define stbiw__zlib_huff3(n) stbiw__zlib_huffa(0 + (n)-256,7) +#define stbiw__zlib_huff4(n) stbiw__zlib_huffa(0xc0 + (n)-280,8) +#define stbiw__zlib_huff(n) ((n) <= 143 ? stbiw__zlib_huff1(n) : (n) <= 255 ? stbiw__zlib_huff2(n) : (n) <= 279 ? stbiw__zlib_huff3(n) : stbiw__zlib_huff4(n)) +#define stbiw__zlib_huffb(n) ((n) <= 143 ? stbiw__zlib_huff1(n) : stbiw__zlib_huff2(n)) + +#define stbiw__ZHASH 16384 + +#endif // STBIW_ZLIB_COMPRESS + +STBIWDEF unsigned char * stbi_zlib_compress(unsigned char *data, int data_len, int *out_len, int quality) +{ +#ifdef STBIW_ZLIB_COMPRESS + // user provided a zlib compress implementation, use that + return STBIW_ZLIB_COMPRESS(data, data_len, out_len, quality); +#else // use builtin + static unsigned short lengthc[] = { 3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258, 259 }; + static unsigned char lengtheb[]= { 0,0,0,0,0,0,0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0 }; + static unsigned short distc[] = { 1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577, 32768 }; + static unsigned char disteb[] = { 0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13 }; + unsigned int bitbuf=0; + int i,j, bitcount=0; + unsigned char *out = NULL; + unsigned char ***hash_table = (unsigned char***) STBIW_MALLOC(stbiw__ZHASH * sizeof(unsigned char**)); + if (hash_table == NULL) + return NULL; + if (quality < 5) quality = 5; + + stbiw__sbpush(out, 0x78); // DEFLATE 32K window + stbiw__sbpush(out, 0x5e); // FLEVEL = 1 + stbiw__zlib_add(1,1); // BFINAL = 1 + stbiw__zlib_add(1,2); // BTYPE = 1 -- fixed huffman + + for (i=0; i < stbiw__ZHASH; ++i) + hash_table[i] = NULL; + + i=0; + while (i < data_len-3) { + // hash next 3 bytes of data to be compressed + int h = stbiw__zhash(data+i)&(stbiw__ZHASH-1), best=3; + unsigned char *bestloc = 0; + unsigned char **hlist = hash_table[h]; + int n = stbiw__sbcount(hlist); + for (j=0; j < n; ++j) { + if (hlist[j]-data > i-32768) { // if entry lies within window + int d = stbiw__zlib_countm(hlist[j], data+i, data_len-i); + if (d >= best) { best=d; bestloc=hlist[j]; } + } + } + // when hash table entry is too long, delete half the entries + if (hash_table[h] && stbiw__sbn(hash_table[h]) == 2*quality) { + STBIW_MEMMOVE(hash_table[h], hash_table[h]+quality, sizeof(hash_table[h][0])*quality); + stbiw__sbn(hash_table[h]) = quality; + } + stbiw__sbpush(hash_table[h],data+i); + + if (bestloc) { + // "lazy matching" - check match at *next* byte, and if it's better, do cur byte as literal + h = stbiw__zhash(data+i+1)&(stbiw__ZHASH-1); + hlist = hash_table[h]; + n = stbiw__sbcount(hlist); + for (j=0; j < n; ++j) { + if (hlist[j]-data > i-32767) { + int e = stbiw__zlib_countm(hlist[j], data+i+1, data_len-i-1); + if (e > best) { // if next match is better, bail on current match + bestloc = NULL; + break; + } + } + } + } + + if (bestloc) { + int d = (int) (data+i - bestloc); // distance back + STBIW_ASSERT(d <= 32767 && best <= 258); + for (j=0; best > lengthc[j+1]-1; ++j); + stbiw__zlib_huff(j+257); + if (lengtheb[j]) stbiw__zlib_add(best - lengthc[j], lengtheb[j]); + for (j=0; d > distc[j+1]-1; ++j); + stbiw__zlib_add(stbiw__zlib_bitrev(j,5),5); + if (disteb[j]) stbiw__zlib_add(d - distc[j], disteb[j]); + i += best; + } else { + stbiw__zlib_huffb(data[i]); + ++i; + } + } + // write out final bytes + for (;i < data_len; ++i) + stbiw__zlib_huffb(data[i]); + stbiw__zlib_huff(256); // end of block + // pad with 0 bits to byte boundary + while (bitcount) + stbiw__zlib_add(0,1); + + for (i=0; i < stbiw__ZHASH; ++i) + (void) stbiw__sbfree(hash_table[i]); + STBIW_FREE(hash_table); + + // store uncompressed instead if compression was worse + if (stbiw__sbn(out) > data_len + 2 + ((data_len+32766)/32767)*5) { + stbiw__sbn(out) = 2; // truncate to DEFLATE 32K window and FLEVEL = 1 + for (j = 0; j < data_len;) { + int blocklen = data_len - j; + if (blocklen > 32767) blocklen = 32767; + stbiw__sbpush(out, data_len - j == blocklen); // BFINAL = ?, BTYPE = 0 -- no compression + stbiw__sbpush(out, STBIW_UCHAR(blocklen)); // LEN + stbiw__sbpush(out, STBIW_UCHAR(blocklen >> 8)); + stbiw__sbpush(out, STBIW_UCHAR(~blocklen)); // NLEN + stbiw__sbpush(out, STBIW_UCHAR(~blocklen >> 8)); + memcpy(out+stbiw__sbn(out), data+j, blocklen); + stbiw__sbn(out) += blocklen; + j += blocklen; + } + } + + { + // compute adler32 on input + unsigned int s1=1, s2=0; + int blocklen = (int) (data_len % 5552); + j=0; + while (j < data_len) { + for (i=0; i < blocklen; ++i) { s1 += data[j+i]; s2 += s1; } + s1 %= 65521; s2 %= 65521; + j += blocklen; + blocklen = 5552; + } + stbiw__sbpush(out, STBIW_UCHAR(s2 >> 8)); + stbiw__sbpush(out, STBIW_UCHAR(s2)); + stbiw__sbpush(out, STBIW_UCHAR(s1 >> 8)); + stbiw__sbpush(out, STBIW_UCHAR(s1)); + } + *out_len = stbiw__sbn(out); + // make returned pointer freeable + STBIW_MEMMOVE(stbiw__sbraw(out), out, *out_len); + return (unsigned char *) stbiw__sbraw(out); +#endif // STBIW_ZLIB_COMPRESS +} + +static unsigned int stbiw__crc32(unsigned char *buffer, int len) +{ +#ifdef STBIW_CRC32 + return STBIW_CRC32(buffer, len); +#else + static unsigned int crc_table[256] = + { + 0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA, 0x076DC419, 0x706AF48F, 0xE963A535, 0x9E6495A3, + 0x0eDB8832, 0x79DCB8A4, 0xE0D5E91E, 0x97D2D988, 0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, 0x90BF1D91, + 0x1DB71064, 0x6AB020F2, 0xF3B97148, 0x84BE41DE, 0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7, + 0x136C9856, 0x646BA8C0, 0xFD62F97A, 0x8A65C9EC, 0x14015C4F, 0x63066CD9, 0xFA0F3D63, 0x8D080DF5, + 0x3B6E20C8, 0x4C69105E, 0xD56041E4, 0xA2677172, 0x3C03E4D1, 0x4B04D447, 0xD20D85FD, 0xA50AB56B, + 0x35B5A8FA, 0x42B2986C, 0xDBBBC9D6, 0xACBCF940, 0x32D86CE3, 0x45DF5C75, 0xDCD60DCF, 0xABD13D59, + 0x26D930AC, 0x51DE003A, 0xC8D75180, 0xBFD06116, 0x21B4F4B5, 0x56B3C423, 0xCFBA9599, 0xB8BDA50F, + 0x2802B89E, 0x5F058808, 0xC60CD9B2, 0xB10BE924, 0x2F6F7C87, 0x58684C11, 0xC1611DAB, 0xB6662D3D, + 0x76DC4190, 0x01DB7106, 0x98D220BC, 0xEFD5102A, 0x71B18589, 0x06B6B51F, 0x9FBFE4A5, 0xE8B8D433, + 0x7807C9A2, 0x0F00F934, 0x9609A88E, 0xE10E9818, 0x7F6A0DBB, 0x086D3D2D, 0x91646C97, 0xE6635C01, + 0x6B6B51F4, 0x1C6C6162, 0x856530D8, 0xF262004E, 0x6C0695ED, 0x1B01A57B, 0x8208F4C1, 0xF50FC457, + 0x65B0D9C6, 0x12B7E950, 0x8BBEB8EA, 0xFCB9887C, 0x62DD1DDF, 0x15DA2D49, 0x8CD37CF3, 0xFBD44C65, + 0x4DB26158, 0x3AB551CE, 0xA3BC0074, 0xD4BB30E2, 0x4ADFA541, 0x3DD895D7, 0xA4D1C46D, 0xD3D6F4FB, + 0x4369E96A, 0x346ED9FC, 0xAD678846, 0xDA60B8D0, 0x44042D73, 0x33031DE5, 0xAA0A4C5F, 0xDD0D7CC9, + 0x5005713C, 0x270241AA, 0xBE0B1010, 0xC90C2086, 0x5768B525, 0x206F85B3, 0xB966D409, 0xCE61E49F, + 0x5EDEF90E, 0x29D9C998, 0xB0D09822, 0xC7D7A8B4, 0x59B33D17, 0x2EB40D81, 0xB7BD5C3B, 0xC0BA6CAD, + 0xEDB88320, 0x9ABFB3B6, 0x03B6E20C, 0x74B1D29A, 0xEAD54739, 0x9DD277AF, 0x04DB2615, 0x73DC1683, + 0xE3630B12, 0x94643B84, 0x0D6D6A3E, 0x7A6A5AA8, 0xE40ECF0B, 0x9309FF9D, 0x0A00AE27, 0x7D079EB1, + 0xF00F9344, 0x8708A3D2, 0x1E01F268, 0x6906C2FE, 0xF762575D, 0x806567CB, 0x196C3671, 0x6E6B06E7, + 0xFED41B76, 0x89D32BE0, 0x10DA7A5A, 0x67DD4ACC, 0xF9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5, + 0xD6D6A3E8, 0xA1D1937E, 0x38D8C2C4, 0x4FDFF252, 0xD1BB67F1, 0xA6BC5767, 0x3FB506DD, 0x48B2364B, + 0xD80D2BDA, 0xAF0A1B4C, 0x36034AF6, 0x41047A60, 0xDF60EFC3, 0xA867DF55, 0x316E8EEF, 0x4669BE79, + 0xCB61B38C, 0xBC66831A, 0x256FD2A0, 0x5268E236, 0xCC0C7795, 0xBB0B4703, 0x220216B9, 0x5505262F, + 0xC5BA3BBE, 0xB2BD0B28, 0x2BB45A92, 0x5CB36A04, 0xC2D7FFA7, 0xB5D0CF31, 0x2CD99E8B, 0x5BDEAE1D, + 0x9B64C2B0, 0xEC63F226, 0x756AA39C, 0x026D930A, 0x9C0906A9, 0xEB0E363F, 0x72076785, 0x05005713, + 0x95BF4A82, 0xE2B87A14, 0x7BB12BAE, 0x0CB61B38, 0x92D28E9B, 0xE5D5BE0D, 0x7CDCEFB7, 0x0BDBDF21, + 0x86D3D2D4, 0xF1D4E242, 0x68DDB3F8, 0x1FDA836E, 0x81BE16CD, 0xF6B9265B, 0x6FB077E1, 0x18B74777, + 0x88085AE6, 0xFF0F6A70, 0x66063BCA, 0x11010B5C, 0x8F659EFF, 0xF862AE69, 0x616BFFD3, 0x166CCF45, + 0xA00AE278, 0xD70DD2EE, 0x4E048354, 0x3903B3C2, 0xA7672661, 0xD06016F7, 0x4969474D, 0x3E6E77DB, + 0xAED16A4A, 0xD9D65ADC, 0x40DF0B66, 0x37D83BF0, 0xA9BCAE53, 0xDEBB9EC5, 0x47B2CF7F, 0x30B5FFE9, + 0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6, 0xBAD03605, 0xCDD70693, 0x54DE5729, 0x23D967BF, + 0xB3667A2E, 0xC4614AB8, 0x5D681B02, 0x2A6F2B94, 0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D + }; + + unsigned int crc = ~0u; + int i; + for (i=0; i < len; ++i) + crc = (crc >> 8) ^ crc_table[buffer[i] ^ (crc & 0xff)]; + return ~crc; +#endif +} + +#define stbiw__wpng4(o,a,b,c,d) ((o)[0]=STBIW_UCHAR(a),(o)[1]=STBIW_UCHAR(b),(o)[2]=STBIW_UCHAR(c),(o)[3]=STBIW_UCHAR(d),(o)+=4) +#define stbiw__wp32(data,v) stbiw__wpng4(data, (v)>>24,(v)>>16,(v)>>8,(v)); +#define stbiw__wptag(data,s) stbiw__wpng4(data, s[0],s[1],s[2],s[3]) + +static void stbiw__wpcrc(unsigned char **data, int len) +{ + unsigned int crc = stbiw__crc32(*data - len - 4, len+4); + stbiw__wp32(*data, crc); +} + +static unsigned char stbiw__paeth(int a, int b, int c) +{ + int p = a + b - c, pa = abs(p-a), pb = abs(p-b), pc = abs(p-c); + if (pa <= pb && pa <= pc) return STBIW_UCHAR(a); + if (pb <= pc) return STBIW_UCHAR(b); + return STBIW_UCHAR(c); +} + +// @OPTIMIZE: provide an option that always forces left-predict or paeth predict +static void stbiw__encode_png_line(unsigned char *pixels, int stride_bytes, int width, int height, int y, int n, int filter_type, signed char *line_buffer) +{ + static int mapping[] = { 0,1,2,3,4 }; + static int firstmap[] = { 0,1,0,5,6 }; + int *mymap = (y != 0) ? mapping : firstmap; + int i; + int type = mymap[filter_type]; + unsigned char *z = pixels + stride_bytes * (stbi__flip_vertically_on_write ? height-1-y : y); + int signed_stride = stbi__flip_vertically_on_write ? -stride_bytes : stride_bytes; + + if (type==0) { + memcpy(line_buffer, z, width*n); + return; + } + + // first loop isn't optimized since it's just one pixel + for (i = 0; i < n; ++i) { + switch (type) { + case 1: line_buffer[i] = z[i]; break; + case 2: line_buffer[i] = z[i] - z[i-signed_stride]; break; + case 3: line_buffer[i] = z[i] - (z[i-signed_stride]>>1); break; + case 4: line_buffer[i] = (signed char) (z[i] - stbiw__paeth(0,z[i-signed_stride],0)); break; + case 5: line_buffer[i] = z[i]; break; + case 6: line_buffer[i] = z[i]; break; + } + } + switch (type) { + case 1: for (i=n; i < width*n; ++i) line_buffer[i] = z[i] - z[i-n]; break; + case 2: for (i=n; i < width*n; ++i) line_buffer[i] = z[i] - z[i-signed_stride]; break; + case 3: for (i=n; i < width*n; ++i) line_buffer[i] = z[i] - ((z[i-n] + z[i-signed_stride])>>1); break; + case 4: for (i=n; i < width*n; ++i) line_buffer[i] = z[i] - stbiw__paeth(z[i-n], z[i-signed_stride], z[i-signed_stride-n]); break; + case 5: for (i=n; i < width*n; ++i) line_buffer[i] = z[i] - (z[i-n]>>1); break; + case 6: for (i=n; i < width*n; ++i) line_buffer[i] = z[i] - stbiw__paeth(z[i-n], 0,0); break; + } +} + +STBIWDEF unsigned char *stbi_write_png_to_mem(const unsigned char *pixels, int stride_bytes, int x, int y, int n, int *out_len) +{ + int force_filter = stbi_write_force_png_filter; + int ctype[5] = { -1, 0, 4, 2, 6 }; + unsigned char sig[8] = { 137,80,78,71,13,10,26,10 }; + unsigned char *out,*o, *filt, *zlib; + signed char *line_buffer; + int j,zlen; + + if (stride_bytes == 0) + stride_bytes = x * n; + + if (force_filter >= 5) { + force_filter = -1; + } + + filt = (unsigned char *) STBIW_MALLOC((x*n+1) * y); if (!filt) return 0; + line_buffer = (signed char *) STBIW_MALLOC(x * n); if (!line_buffer) { STBIW_FREE(filt); return 0; } + for (j=0; j < y; ++j) { + int filter_type; + if (force_filter > -1) { + filter_type = force_filter; + stbiw__encode_png_line((unsigned char*)(pixels), stride_bytes, x, y, j, n, force_filter, line_buffer); + } else { // Estimate the best filter by running through all of them: + int best_filter = 0, best_filter_val = 0x7fffffff, est, i; + for (filter_type = 0; filter_type < 5; filter_type++) { + stbiw__encode_png_line((unsigned char*)(pixels), stride_bytes, x, y, j, n, filter_type, line_buffer); + + // Estimate the entropy of the line using this filter; the less, the better. + est = 0; + for (i = 0; i < x*n; ++i) { + est += abs((signed char) line_buffer[i]); + } + if (est < best_filter_val) { + best_filter_val = est; + best_filter = filter_type; + } + } + if (filter_type != best_filter) { // If the last iteration already got us the best filter, don't redo it + stbiw__encode_png_line((unsigned char*)(pixels), stride_bytes, x, y, j, n, best_filter, line_buffer); + filter_type = best_filter; + } + } + // when we get here, filter_type contains the filter type, and line_buffer contains the data + filt[j*(x*n+1)] = (unsigned char) filter_type; + STBIW_MEMMOVE(filt+j*(x*n+1)+1, line_buffer, x*n); + } + STBIW_FREE(line_buffer); + zlib = stbi_zlib_compress(filt, y*( x*n+1), &zlen, stbi_write_png_compression_level); + STBIW_FREE(filt); + if (!zlib) return 0; + + // each tag requires 12 bytes of overhead + out = (unsigned char *) STBIW_MALLOC(8 + 12+13 + 12+zlen + 12); + if (!out) return 0; + *out_len = 8 + 12+13 + 12+zlen + 12; + + o=out; + STBIW_MEMMOVE(o,sig,8); o+= 8; + stbiw__wp32(o, 13); // header length + stbiw__wptag(o, "IHDR"); + stbiw__wp32(o, x); + stbiw__wp32(o, y); + *o++ = 8; + *o++ = STBIW_UCHAR(ctype[n]); + *o++ = 0; + *o++ = 0; + *o++ = 0; + stbiw__wpcrc(&o,13); + + stbiw__wp32(o, zlen); + stbiw__wptag(o, "IDAT"); + STBIW_MEMMOVE(o, zlib, zlen); + o += zlen; + STBIW_FREE(zlib); + stbiw__wpcrc(&o, zlen); + + stbiw__wp32(o,0); + stbiw__wptag(o, "IEND"); + stbiw__wpcrc(&o,0); + + STBIW_ASSERT(o == out + *out_len); + + return out; +} + +#ifndef STBI_WRITE_NO_STDIO +STBIWDEF int stbi_write_png(char const *filename, int x, int y, int comp, const void *data, int stride_bytes) +{ + FILE *f; + int len; + unsigned char *png = stbi_write_png_to_mem((const unsigned char *) data, stride_bytes, x, y, comp, &len); + if (png == NULL) return 0; + + f = stbiw__fopen(filename, "wb"); + if (!f) { STBIW_FREE(png); return 0; } + fwrite(png, 1, len, f); + fclose(f); + STBIW_FREE(png); + return 1; +} +#endif + +STBIWDEF int stbi_write_png_to_func(stbi_write_func *func, void *context, int x, int y, int comp, const void *data, int stride_bytes) +{ + int len; + unsigned char *png = stbi_write_png_to_mem((const unsigned char *) data, stride_bytes, x, y, comp, &len); + if (png == NULL) return 0; + func(context, png, len); + STBIW_FREE(png); + return 1; +} + + +/* *************************************************************************** + * + * JPEG writer + * + * This is based on Jon Olick's jo_jpeg.cpp: + * public domain Simple, Minimalistic JPEG writer - http://www.jonolick.com/code.html + */ + +static const unsigned char stbiw__jpg_ZigZag[] = { 0,1,5,6,14,15,27,28,2,4,7,13,16,26,29,42,3,8,12,17,25,30,41,43,9,11,18, + 24,31,40,44,53,10,19,23,32,39,45,52,54,20,22,33,38,46,51,55,60,21,34,37,47,50,56,59,61,35,36,48,49,57,58,62,63 }; + +static void stbiw__jpg_writeBits(stbi__write_context *s, int *bitBufP, int *bitCntP, const unsigned short *bs) { + int bitBuf = *bitBufP, bitCnt = *bitCntP; + bitCnt += bs[1]; + bitBuf |= bs[0] << (24 - bitCnt); + while(bitCnt >= 8) { + unsigned char c = (bitBuf >> 16) & 255; + stbiw__putc(s, c); + if(c == 255) { + stbiw__putc(s, 0); + } + bitBuf <<= 8; + bitCnt -= 8; + } + *bitBufP = bitBuf; + *bitCntP = bitCnt; +} + +static void stbiw__jpg_DCT(float *d0p, float *d1p, float *d2p, float *d3p, float *d4p, float *d5p, float *d6p, float *d7p) { + float d0 = *d0p, d1 = *d1p, d2 = *d2p, d3 = *d3p, d4 = *d4p, d5 = *d5p, d6 = *d6p, d7 = *d7p; + float z1, z2, z3, z4, z5, z11, z13; + + float tmp0 = d0 + d7; + float tmp7 = d0 - d7; + float tmp1 = d1 + d6; + float tmp6 = d1 - d6; + float tmp2 = d2 + d5; + float tmp5 = d2 - d5; + float tmp3 = d3 + d4; + float tmp4 = d3 - d4; + + // Even part + float tmp10 = tmp0 + tmp3; // phase 2 + float tmp13 = tmp0 - tmp3; + float tmp11 = tmp1 + tmp2; + float tmp12 = tmp1 - tmp2; + + d0 = tmp10 + tmp11; // phase 3 + d4 = tmp10 - tmp11; + + z1 = (tmp12 + tmp13) * 0.707106781f; // c4 + d2 = tmp13 + z1; // phase 5 + d6 = tmp13 - z1; + + // Odd part + tmp10 = tmp4 + tmp5; // phase 2 + tmp11 = tmp5 + tmp6; + tmp12 = tmp6 + tmp7; + + // The rotator is modified from fig 4-8 to avoid extra negations. + z5 = (tmp10 - tmp12) * 0.382683433f; // c6 + z2 = tmp10 * 0.541196100f + z5; // c2-c6 + z4 = tmp12 * 1.306562965f + z5; // c2+c6 + z3 = tmp11 * 0.707106781f; // c4 + + z11 = tmp7 + z3; // phase 5 + z13 = tmp7 - z3; + + *d5p = z13 + z2; // phase 6 + *d3p = z13 - z2; + *d1p = z11 + z4; + *d7p = z11 - z4; + + *d0p = d0; *d2p = d2; *d4p = d4; *d6p = d6; +} + +static void stbiw__jpg_calcBits(int val, unsigned short bits[2]) { + int tmp1 = val < 0 ? -val : val; + val = val < 0 ? val-1 : val; + bits[1] = 1; + while(tmp1 >>= 1) { + ++bits[1]; + } + bits[0] = val & ((1<0)&&(DU[end0pos]==0); --end0pos) { + } + // end0pos = first element in reverse order !=0 + if(end0pos == 0) { + stbiw__jpg_writeBits(s, bitBuf, bitCnt, EOB); + return DU[0]; + } + for(i = 1; i <= end0pos; ++i) { + int startpos = i; + int nrzeroes; + unsigned short bits[2]; + for (; DU[i]==0 && i<=end0pos; ++i) { + } + nrzeroes = i-startpos; + if ( nrzeroes >= 16 ) { + int lng = nrzeroes>>4; + int nrmarker; + for (nrmarker=1; nrmarker <= lng; ++nrmarker) + stbiw__jpg_writeBits(s, bitBuf, bitCnt, M16zeroes); + nrzeroes &= 15; + } + stbiw__jpg_calcBits(DU[i], bits); + stbiw__jpg_writeBits(s, bitBuf, bitCnt, HTAC[(nrzeroes<<4)+bits[1]]); + stbiw__jpg_writeBits(s, bitBuf, bitCnt, bits); + } + if(end0pos != 63) { + stbiw__jpg_writeBits(s, bitBuf, bitCnt, EOB); + } + return DU[0]; +} + +static int stbi_write_jpg_core(stbi__write_context *s, int width, int height, int comp, const void* data, int quality) { + // Constants that don't pollute global namespace + static const unsigned char std_dc_luminance_nrcodes[] = {0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0}; + static const unsigned char std_dc_luminance_values[] = {0,1,2,3,4,5,6,7,8,9,10,11}; + static const unsigned char std_ac_luminance_nrcodes[] = {0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,0x7d}; + static const unsigned char std_ac_luminance_values[] = { + 0x01,0x02,0x03,0x00,0x04,0x11,0x05,0x12,0x21,0x31,0x41,0x06,0x13,0x51,0x61,0x07,0x22,0x71,0x14,0x32,0x81,0x91,0xa1,0x08, + 0x23,0x42,0xb1,0xc1,0x15,0x52,0xd1,0xf0,0x24,0x33,0x62,0x72,0x82,0x09,0x0a,0x16,0x17,0x18,0x19,0x1a,0x25,0x26,0x27,0x28, + 0x29,0x2a,0x34,0x35,0x36,0x37,0x38,0x39,0x3a,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4a,0x53,0x54,0x55,0x56,0x57,0x58,0x59, + 0x5a,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6a,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7a,0x83,0x84,0x85,0x86,0x87,0x88,0x89, + 0x8a,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9a,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xb2,0xb3,0xb4,0xb5,0xb6, + 0xb7,0xb8,0xb9,0xba,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xd2,0xd3,0xd4,0xd5,0xd6,0xd7,0xd8,0xd9,0xda,0xe1,0xe2, + 0xe3,0xe4,0xe5,0xe6,0xe7,0xe8,0xe9,0xea,0xf1,0xf2,0xf3,0xf4,0xf5,0xf6,0xf7,0xf8,0xf9,0xfa + }; + static const unsigned char std_dc_chrominance_nrcodes[] = {0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0}; + static const unsigned char std_dc_chrominance_values[] = {0,1,2,3,4,5,6,7,8,9,10,11}; + static const unsigned char std_ac_chrominance_nrcodes[] = {0,0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,0x77}; + static const unsigned char std_ac_chrominance_values[] = { + 0x00,0x01,0x02,0x03,0x11,0x04,0x05,0x21,0x31,0x06,0x12,0x41,0x51,0x07,0x61,0x71,0x13,0x22,0x32,0x81,0x08,0x14,0x42,0x91, + 0xa1,0xb1,0xc1,0x09,0x23,0x33,0x52,0xf0,0x15,0x62,0x72,0xd1,0x0a,0x16,0x24,0x34,0xe1,0x25,0xf1,0x17,0x18,0x19,0x1a,0x26, + 0x27,0x28,0x29,0x2a,0x35,0x36,0x37,0x38,0x39,0x3a,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4a,0x53,0x54,0x55,0x56,0x57,0x58, + 0x59,0x5a,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6a,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7a,0x82,0x83,0x84,0x85,0x86,0x87, + 0x88,0x89,0x8a,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9a,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xb2,0xb3,0xb4, + 0xb5,0xb6,0xb7,0xb8,0xb9,0xba,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xd2,0xd3,0xd4,0xd5,0xd6,0xd7,0xd8,0xd9,0xda, + 0xe2,0xe3,0xe4,0xe5,0xe6,0xe7,0xe8,0xe9,0xea,0xf2,0xf3,0xf4,0xf5,0xf6,0xf7,0xf8,0xf9,0xfa + }; + // Huffman tables + static const unsigned short YDC_HT[256][2] = { {0,2},{2,3},{3,3},{4,3},{5,3},{6,3},{14,4},{30,5},{62,6},{126,7},{254,8},{510,9}}; + static const unsigned short UVDC_HT[256][2] = { {0,2},{1,2},{2,2},{6,3},{14,4},{30,5},{62,6},{126,7},{254,8},{510,9},{1022,10},{2046,11}}; + static const unsigned short YAC_HT[256][2] = { + {10,4},{0,2},{1,2},{4,3},{11,4},{26,5},{120,7},{248,8},{1014,10},{65410,16},{65411,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, + {12,4},{27,5},{121,7},{502,9},{2038,11},{65412,16},{65413,16},{65414,16},{65415,16},{65416,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, + {28,5},{249,8},{1015,10},{4084,12},{65417,16},{65418,16},{65419,16},{65420,16},{65421,16},{65422,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, + {58,6},{503,9},{4085,12},{65423,16},{65424,16},{65425,16},{65426,16},{65427,16},{65428,16},{65429,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, + {59,6},{1016,10},{65430,16},{65431,16},{65432,16},{65433,16},{65434,16},{65435,16},{65436,16},{65437,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, + {122,7},{2039,11},{65438,16},{65439,16},{65440,16},{65441,16},{65442,16},{65443,16},{65444,16},{65445,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, + {123,7},{4086,12},{65446,16},{65447,16},{65448,16},{65449,16},{65450,16},{65451,16},{65452,16},{65453,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, + {250,8},{4087,12},{65454,16},{65455,16},{65456,16},{65457,16},{65458,16},{65459,16},{65460,16},{65461,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, + {504,9},{32704,15},{65462,16},{65463,16},{65464,16},{65465,16},{65466,16},{65467,16},{65468,16},{65469,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, + {505,9},{65470,16},{65471,16},{65472,16},{65473,16},{65474,16},{65475,16},{65476,16},{65477,16},{65478,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, + {506,9},{65479,16},{65480,16},{65481,16},{65482,16},{65483,16},{65484,16},{65485,16},{65486,16},{65487,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, + {1017,10},{65488,16},{65489,16},{65490,16},{65491,16},{65492,16},{65493,16},{65494,16},{65495,16},{65496,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, + {1018,10},{65497,16},{65498,16},{65499,16},{65500,16},{65501,16},{65502,16},{65503,16},{65504,16},{65505,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, + {2040,11},{65506,16},{65507,16},{65508,16},{65509,16},{65510,16},{65511,16},{65512,16},{65513,16},{65514,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, + {65515,16},{65516,16},{65517,16},{65518,16},{65519,16},{65520,16},{65521,16},{65522,16},{65523,16},{65524,16},{0,0},{0,0},{0,0},{0,0},{0,0}, + {2041,11},{65525,16},{65526,16},{65527,16},{65528,16},{65529,16},{65530,16},{65531,16},{65532,16},{65533,16},{65534,16},{0,0},{0,0},{0,0},{0,0},{0,0} + }; + static const unsigned short UVAC_HT[256][2] = { + {0,2},{1,2},{4,3},{10,4},{24,5},{25,5},{56,6},{120,7},{500,9},{1014,10},{4084,12},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, + {11,4},{57,6},{246,8},{501,9},{2038,11},{4085,12},{65416,16},{65417,16},{65418,16},{65419,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, + {26,5},{247,8},{1015,10},{4086,12},{32706,15},{65420,16},{65421,16},{65422,16},{65423,16},{65424,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, + {27,5},{248,8},{1016,10},{4087,12},{65425,16},{65426,16},{65427,16},{65428,16},{65429,16},{65430,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, + {58,6},{502,9},{65431,16},{65432,16},{65433,16},{65434,16},{65435,16},{65436,16},{65437,16},{65438,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, + {59,6},{1017,10},{65439,16},{65440,16},{65441,16},{65442,16},{65443,16},{65444,16},{65445,16},{65446,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, + {121,7},{2039,11},{65447,16},{65448,16},{65449,16},{65450,16},{65451,16},{65452,16},{65453,16},{65454,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, + {122,7},{2040,11},{65455,16},{65456,16},{65457,16},{65458,16},{65459,16},{65460,16},{65461,16},{65462,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, + {249,8},{65463,16},{65464,16},{65465,16},{65466,16},{65467,16},{65468,16},{65469,16},{65470,16},{65471,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, + {503,9},{65472,16},{65473,16},{65474,16},{65475,16},{65476,16},{65477,16},{65478,16},{65479,16},{65480,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, + {504,9},{65481,16},{65482,16},{65483,16},{65484,16},{65485,16},{65486,16},{65487,16},{65488,16},{65489,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, + {505,9},{65490,16},{65491,16},{65492,16},{65493,16},{65494,16},{65495,16},{65496,16},{65497,16},{65498,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, + {506,9},{65499,16},{65500,16},{65501,16},{65502,16},{65503,16},{65504,16},{65505,16},{65506,16},{65507,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, + {2041,11},{65508,16},{65509,16},{65510,16},{65511,16},{65512,16},{65513,16},{65514,16},{65515,16},{65516,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0}, + {16352,14},{65517,16},{65518,16},{65519,16},{65520,16},{65521,16},{65522,16},{65523,16},{65524,16},{65525,16},{0,0},{0,0},{0,0},{0,0},{0,0}, + {1018,10},{32707,15},{65526,16},{65527,16},{65528,16},{65529,16},{65530,16},{65531,16},{65532,16},{65533,16},{65534,16},{0,0},{0,0},{0,0},{0,0},{0,0} + }; + static const int YQT[] = {16,11,10,16,24,40,51,61,12,12,14,19,26,58,60,55,14,13,16,24,40,57,69,56,14,17,22,29,51,87,80,62,18,22, + 37,56,68,109,103,77,24,35,55,64,81,104,113,92,49,64,78,87,103,121,120,101,72,92,95,98,112,100,103,99}; + static const int UVQT[] = {17,18,24,47,99,99,99,99,18,21,26,66,99,99,99,99,24,26,56,99,99,99,99,99,47,66,99,99,99,99,99,99, + 99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99}; + static const float aasf[] = { 1.0f * 2.828427125f, 1.387039845f * 2.828427125f, 1.306562965f * 2.828427125f, 1.175875602f * 2.828427125f, + 1.0f * 2.828427125f, 0.785694958f * 2.828427125f, 0.541196100f * 2.828427125f, 0.275899379f * 2.828427125f }; + + int row, col, i, k, subsample; + float fdtbl_Y[64], fdtbl_UV[64]; + unsigned char YTable[64], UVTable[64]; + + if(!data || !width || !height || comp > 4 || comp < 1) { + return 0; + } + + quality = quality ? quality : 90; + subsample = quality <= 90 ? 1 : 0; + quality = quality < 1 ? 1 : quality > 100 ? 100 : quality; + quality = quality < 50 ? 5000 / quality : 200 - quality * 2; + + for(i = 0; i < 64; ++i) { + int uvti, yti = (YQT[i]*quality+50)/100; + YTable[stbiw__jpg_ZigZag[i]] = (unsigned char) (yti < 1 ? 1 : yti > 255 ? 255 : yti); + uvti = (UVQT[i]*quality+50)/100; + UVTable[stbiw__jpg_ZigZag[i]] = (unsigned char) (uvti < 1 ? 1 : uvti > 255 ? 255 : uvti); + } + + for(row = 0, k = 0; row < 8; ++row) { + for(col = 0; col < 8; ++col, ++k) { + fdtbl_Y[k] = 1 / (YTable [stbiw__jpg_ZigZag[k]] * aasf[row] * aasf[col]); + fdtbl_UV[k] = 1 / (UVTable[stbiw__jpg_ZigZag[k]] * aasf[row] * aasf[col]); + } + } + + // Write Headers + { + static const unsigned char head0[] = { 0xFF,0xD8,0xFF,0xE0,0,0x10,'J','F','I','F',0,1,1,0,0,1,0,1,0,0,0xFF,0xDB,0,0x84,0 }; + static const unsigned char head2[] = { 0xFF,0xDA,0,0xC,3,1,0,2,0x11,3,0x11,0,0x3F,0 }; + const unsigned char head1[] = { 0xFF,0xC0,0,0x11,8,(unsigned char)(height>>8),STBIW_UCHAR(height),(unsigned char)(width>>8),STBIW_UCHAR(width), + 3,1,(unsigned char)(subsample?0x22:0x11),0,2,0x11,1,3,0x11,1,0xFF,0xC4,0x01,0xA2,0 }; + s->func(s->context, (void*)head0, sizeof(head0)); + s->func(s->context, (void*)YTable, sizeof(YTable)); + stbiw__putc(s, 1); + s->func(s->context, UVTable, sizeof(UVTable)); + s->func(s->context, (void*)head1, sizeof(head1)); + s->func(s->context, (void*)(std_dc_luminance_nrcodes+1), sizeof(std_dc_luminance_nrcodes)-1); + s->func(s->context, (void*)std_dc_luminance_values, sizeof(std_dc_luminance_values)); + stbiw__putc(s, 0x10); // HTYACinfo + s->func(s->context, (void*)(std_ac_luminance_nrcodes+1), sizeof(std_ac_luminance_nrcodes)-1); + s->func(s->context, (void*)std_ac_luminance_values, sizeof(std_ac_luminance_values)); + stbiw__putc(s, 1); // HTUDCinfo + s->func(s->context, (void*)(std_dc_chrominance_nrcodes+1), sizeof(std_dc_chrominance_nrcodes)-1); + s->func(s->context, (void*)std_dc_chrominance_values, sizeof(std_dc_chrominance_values)); + stbiw__putc(s, 0x11); // HTUACinfo + s->func(s->context, (void*)(std_ac_chrominance_nrcodes+1), sizeof(std_ac_chrominance_nrcodes)-1); + s->func(s->context, (void*)std_ac_chrominance_values, sizeof(std_ac_chrominance_values)); + s->func(s->context, (void*)head2, sizeof(head2)); + } + + // Encode 8x8 macroblocks + { + static const unsigned short fillBits[] = {0x7F, 7}; + int DCY=0, DCU=0, DCV=0; + int bitBuf=0, bitCnt=0; + // comp == 2 is grey+alpha (alpha is ignored) + int ofsG = comp > 2 ? 1 : 0, ofsB = comp > 2 ? 2 : 0; + const unsigned char *dataR = (const unsigned char *)data; + const unsigned char *dataG = dataR + ofsG; + const unsigned char *dataB = dataR + ofsB; + int x, y, pos; + if(subsample) { + for(y = 0; y < height; y += 16) { + for(x = 0; x < width; x += 16) { + float Y[256], U[256], V[256]; + for(row = y, pos = 0; row < y+16; ++row) { + // row >= height => use last input row + int clamped_row = (row < height) ? row : height - 1; + int base_p = (stbi__flip_vertically_on_write ? (height-1-clamped_row) : clamped_row)*width*comp; + for(col = x; col < x+16; ++col, ++pos) { + // if col >= width => use pixel from last input column + int p = base_p + ((col < width) ? col : (width-1))*comp; + float r = dataR[p], g = dataG[p], b = dataB[p]; + Y[pos]= +0.29900f*r + 0.58700f*g + 0.11400f*b - 128; + U[pos]= -0.16874f*r - 0.33126f*g + 0.50000f*b; + V[pos]= +0.50000f*r - 0.41869f*g - 0.08131f*b; + } + } + DCY = stbiw__jpg_processDU(s, &bitBuf, &bitCnt, Y+0, 16, fdtbl_Y, DCY, YDC_HT, YAC_HT); + DCY = stbiw__jpg_processDU(s, &bitBuf, &bitCnt, Y+8, 16, fdtbl_Y, DCY, YDC_HT, YAC_HT); + DCY = stbiw__jpg_processDU(s, &bitBuf, &bitCnt, Y+128, 16, fdtbl_Y, DCY, YDC_HT, YAC_HT); + DCY = stbiw__jpg_processDU(s, &bitBuf, &bitCnt, Y+136, 16, fdtbl_Y, DCY, YDC_HT, YAC_HT); + + // subsample U,V + { + float subU[64], subV[64]; + int yy, xx; + for(yy = 0, pos = 0; yy < 8; ++yy) { + for(xx = 0; xx < 8; ++xx, ++pos) { + int j = yy*32+xx*2; + subU[pos] = (U[j+0] + U[j+1] + U[j+16] + U[j+17]) * 0.25f; + subV[pos] = (V[j+0] + V[j+1] + V[j+16] + V[j+17]) * 0.25f; + } + } + DCU = stbiw__jpg_processDU(s, &bitBuf, &bitCnt, subU, 8, fdtbl_UV, DCU, UVDC_HT, UVAC_HT); + DCV = stbiw__jpg_processDU(s, &bitBuf, &bitCnt, subV, 8, fdtbl_UV, DCV, UVDC_HT, UVAC_HT); + } + } + } + } else { + for(y = 0; y < height; y += 8) { + for(x = 0; x < width; x += 8) { + float Y[64], U[64], V[64]; + for(row = y, pos = 0; row < y+8; ++row) { + // row >= height => use last input row + int clamped_row = (row < height) ? row : height - 1; + int base_p = (stbi__flip_vertically_on_write ? (height-1-clamped_row) : clamped_row)*width*comp; + for(col = x; col < x+8; ++col, ++pos) { + // if col >= width => use pixel from last input column + int p = base_p + ((col < width) ? col : (width-1))*comp; + float r = dataR[p], g = dataG[p], b = dataB[p]; + Y[pos]= +0.29900f*r + 0.58700f*g + 0.11400f*b - 128; + U[pos]= -0.16874f*r - 0.33126f*g + 0.50000f*b; + V[pos]= +0.50000f*r - 0.41869f*g - 0.08131f*b; + } + } + + DCY = stbiw__jpg_processDU(s, &bitBuf, &bitCnt, Y, 8, fdtbl_Y, DCY, YDC_HT, YAC_HT); + DCU = stbiw__jpg_processDU(s, &bitBuf, &bitCnt, U, 8, fdtbl_UV, DCU, UVDC_HT, UVAC_HT); + DCV = stbiw__jpg_processDU(s, &bitBuf, &bitCnt, V, 8, fdtbl_UV, DCV, UVDC_HT, UVAC_HT); + } + } + } + + // Do the bit alignment of the EOI marker + stbiw__jpg_writeBits(s, &bitBuf, &bitCnt, fillBits); + } + + // EOI + stbiw__putc(s, 0xFF); + stbiw__putc(s, 0xD9); + + return 1; +} + +STBIWDEF int stbi_write_jpg_to_func(stbi_write_func *func, void *context, int x, int y, int comp, const void *data, int quality) +{ + stbi__write_context s = { 0 }; + stbi__start_write_callbacks(&s, func, context); + return stbi_write_jpg_core(&s, x, y, comp, (void *) data, quality); +} + + +#ifndef STBI_WRITE_NO_STDIO +STBIWDEF int stbi_write_jpg(char const *filename, int x, int y, int comp, const void *data, int quality) +{ + stbi__write_context s = { 0 }; + if (stbi__start_write_file(&s,filename)) { + int r = stbi_write_jpg_core(&s, x, y, comp, data, quality); + stbi__end_write_file(&s); + return r; + } else + return 0; +} +#endif + +#endif // STB_IMAGE_WRITE_IMPLEMENTATION + +/* Revision history + 1.16 (2021-07-11) + make Deflate code emit uncompressed blocks when it would otherwise expand + support writing BMPs with alpha channel + 1.15 (2020-07-13) unknown + 1.14 (2020-02-02) updated JPEG writer to downsample chroma channels + 1.13 + 1.12 + 1.11 (2019-08-11) + + 1.10 (2019-02-07) + support utf8 filenames in Windows; fix warnings and platform ifdefs + 1.09 (2018-02-11) + fix typo in zlib quality API, improve STB_I_W_STATIC in C++ + 1.08 (2018-01-29) + add stbi__flip_vertically_on_write, external zlib, zlib quality, choose PNG filter + 1.07 (2017-07-24) + doc fix + 1.06 (2017-07-23) + writing JPEG (using Jon Olick's code) + 1.05 ??? + 1.04 (2017-03-03) + monochrome BMP expansion + 1.03 ??? + 1.02 (2016-04-02) + avoid allocating large structures on the stack + 1.01 (2016-01-16) + STBIW_REALLOC_SIZED: support allocators with no realloc support + avoid race-condition in crc initialization + minor compile issues + 1.00 (2015-09-14) + installable file IO function + 0.99 (2015-09-13) + warning fixes; TGA rle support + 0.98 (2015-04-08) + added STBIW_MALLOC, STBIW_ASSERT etc + 0.97 (2015-01-18) + fixed HDR asserts, rewrote HDR rle logic + 0.96 (2015-01-17) + add HDR output + fix monochrome BMP + 0.95 (2014-08-17) + add monochrome TGA output + 0.94 (2014-05-31) + rename private functions to avoid conflicts with stb_image.h + 0.93 (2014-05-27) + warning fixes + 0.92 (2010-08-01) + casts to unsigned char to fix warnings + 0.91 (2010-07-17) + first public release + 0.90 first internal release +*/ + +/* +------------------------------------------------------------------------------ +This software is available under 2 licenses -- choose whichever you prefer. +------------------------------------------------------------------------------ +ALTERNATIVE A - MIT License +Copyright (c) 2017 Sean Barrett +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +------------------------------------------------------------------------------ +ALTERNATIVE B - Public Domain (www.unlicense.org) +This is free and unencumbered software released into the public domain. +Anyone is free to copy, modify, publish, use, compile, sell, or distribute this +software, either in source code form or as a compiled binary, for any purpose, +commercial or non-commercial, and by any means. +In jurisdictions that recognize copyright laws, the author or authors of this +software dedicate any and all copyright interest in the software to the public +domain. We make this dedication for the benefit of the public at large and to +the detriment of our heirs and successors. We intend this dedication to be an +overt act of relinquishment in perpetuity of all present and future rights to +this software under copyright law. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN +ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +------------------------------------------------------------------------------ +*/ \ No newline at end of file diff --git a/AnimatableGaussians/gaussians/gaussian_model.py b/AnimatableGaussians/gaussians/gaussian_model.py new file mode 100644 index 0000000000000000000000000000000000000000..ef0c5af8f2ed21a144cf248d5364ecbc702e1ba2 --- /dev/null +++ b/AnimatableGaussians/gaussians/gaussian_model.py @@ -0,0 +1,443 @@ +# +# Copyright (C) 2023, Inria +# GRAPHDECO research group, https://team.inria.fr/graphdeco +# All rights reserved. +# +# This software is free for non-commercial, research and evaluation use +# under the terms of the LICENSE.md file. +# +# For inquiries contact george.drettakis@inria.fr +# + +import torch +import numpy as np +from AnimatableGaussians.utils.general_utils import inverse_sigmoid, get_expon_lr_func, build_rotation +from torch import nn +import os +from plyfile import PlyData, PlyElement +from pytorch3d.ops import knn_points +from AnimatableGaussians.utils.sh_utils import RGB2SH +# from simple_knn._C import distCUDA2 +from AnimatableGaussians.utils.general_utils import strip_symmetric, build_scaling_rotation + + +class OptimizationParams: + def __init__(self): + self.iterations = 30_000 + self.position_lr_init = 0.00016 + self.position_lr_final = 0.0000016 + self.position_lr_delay_mult = 0.01 + self.position_lr_max_steps = 30_000 + self.feature_lr = 0.0025 + self.opacity_lr = 0.05 + self.scaling_lr = 0.005 + self.rotation_lr = 0.001 + self.percent_dense = 0.01 + self.lambda_dssim = 0.2 + self.densification_interval = 100 + self.opacity_reset_interval = 3000 + self.densify_from_iter = 500 + self.densify_until_iter = 15_000 + self.densify_grad_threshold = 0.0002 + + +class GaussianModel: + + def setup_functions(self): + def build_covariance_from_scaling_rotation(scaling, scaling_modifier, rotation): + L = build_scaling_rotation(scaling_modifier * scaling, rotation) + actual_covariance = L @ L.transpose(1, 2) + symm = strip_symmetric(actual_covariance) + return symm + + self.scaling_activation = torch.exp + self.scaling_inverse_activation = torch.log + + self.covariance_activation = build_covariance_from_scaling_rotation + + self.opacity_activation = torch.sigmoid + self.inverse_opacity_activation = inverse_sigmoid + + self.rotation_activation = torch.nn.functional.normalize + + + def __init__(self, sh_degree : int): + self.active_sh_degree = 0 + self.max_sh_degree = sh_degree + self._xyz = torch.empty(0) + self._features_dc = torch.empty(0) + self._features_rest = torch.empty(0) + self._scaling = torch.empty(0) + self._rotation = torch.empty(0) + self._opacity = torch.empty(0) + self.max_radii2D = torch.empty(0) + self.xyz_gradient_accum = torch.empty(0) + self.denom = torch.empty(0) + self.optimizer = None + self.percent_dense = 0 + self.spatial_lr_scale = 0 + self.setup_functions() + + def capture(self): + return ( + self.active_sh_degree, + self._xyz, + self._features_dc, + self._features_rest, + self._scaling, + self._rotation, + self._opacity, + self.max_radii2D, + self.xyz_gradient_accum, + self.denom, + self.optimizer.state_dict(), + self.spatial_lr_scale, + ) + + def restore(self, model_args, training_args): + (self.active_sh_degree, + self._xyz, + self._features_dc, + self._features_rest, + self._scaling, + self._rotation, + self._opacity, + self.max_radii2D, + xyz_gradient_accum, + denom, + opt_dict, + self.spatial_lr_scale) = model_args + self.training_setup(training_args) + self.xyz_gradient_accum = xyz_gradient_accum + self.denom = denom + self.optimizer.load_state_dict(opt_dict) + + @property + def get_scaling(self): + return self.scaling_activation(self._scaling) + + @property + def get_scaling_raw(self): + return self._scaling + + @property + def get_rotation(self): + return self.rotation_activation(self._rotation) + + @property + def get_rotation_raw(self): + return self._rotation + + @property + def get_xyz(self): + return self._xyz + + @property + def get_features(self): + features_dc = self._features_dc + features_rest = self._features_rest + return torch.cat((features_dc, features_rest), dim=1) + + @property + def get_opacity(self): + return self.opacity_activation(self._opacity) + + @property + def get_opacity_raw(self): + return self._opacity + + def get_covariance(self, scaling_modifier = 1): + return self.covariance_activation(self.get_scaling, scaling_modifier, self._rotation) + + def oneupSHdegree(self): + if self.active_sh_degree < self.max_sh_degree: + self.active_sh_degree += 1 + + def create_from_pcd(self, points, colors, spatial_lr_scale: float): + self.spatial_lr_scale = spatial_lr_scale + if not isinstance(points, torch.Tensor): + points = torch.tensor(np.asarray(points)) + if not isinstance(colors, torch.Tensor): + points = torch.tensor(np.asarray(colors)) + fused_point_cloud = points.float().cuda() + fused_color = RGB2SH(colors.float().cuda()) + features = torch.zeros((fused_color.shape[0], 3, (self.max_sh_degree + 1) ** 2)).float().cuda() + features[:, :3, 0 ] = fused_color + features[:, 3:, 1:] = 0.0 + + # print("Number of points at initialisation : ", fused_point_cloud.shape[0]) + # dist2 = torch.clamp_min(distCUDA2(fused_point_cloud), 0.0000001) + dist2 = torch.clamp_min(knn_points(fused_point_cloud[None], fused_point_cloud[None], K = 4)[0][0, :, 1:].mean(-1), 0.0000001) + scales = torch.log(torch.sqrt(dist2))[...,None].repeat(1, 3) + rots = torch.zeros((fused_point_cloud.shape[0], 4), device="cuda") + rots[:, 0] = 1 + + opacities = inverse_sigmoid(0.1 * torch.ones((fused_point_cloud.shape[0], 1), dtype=torch.float, device="cuda")) + + self._xyz = nn.Parameter(fused_point_cloud.requires_grad_(True)) + self._features_dc = nn.Parameter(features[:,:,0:1].transpose(1, 2).contiguous().requires_grad_(True)) + self._features_rest = nn.Parameter(features[:,:,1:].transpose(1, 2).contiguous().requires_grad_(True)) + self._scaling = nn.Parameter(scales.requires_grad_(True)) + self._rotation = nn.Parameter(rots.requires_grad_(True)) + self._opacity = nn.Parameter(opacities.requires_grad_(True)) + self.max_radii2D = torch.zeros((self.get_xyz.shape[0]), device="cuda") + + def training_setup(self, training_args): + self.percent_dense = training_args.percent_dense + self.xyz_gradient_accum = torch.zeros((self.get_xyz.shape[0], 1), device="cuda") + self.denom = torch.zeros((self.get_xyz.shape[0], 1), device="cuda") + + l = [ + {'params': [self._xyz], 'lr': training_args.position_lr_init * self.spatial_lr_scale, "name": "xyz"}, + {'params': [self._features_dc], 'lr': training_args.feature_lr, "name": "f_dc"}, + {'params': [self._features_rest], 'lr': training_args.feature_lr / 20.0, "name": "f_rest"}, + {'params': [self._opacity], 'lr': training_args.opacity_lr, "name": "opacity"}, + {'params': [self._scaling], 'lr': training_args.scaling_lr, "name": "scaling"}, + {'params': [self._rotation], 'lr': training_args.rotation_lr, "name": "rotation"} + ] + + self.optimizer = torch.optim.Adam(l, lr=0.0, eps=1e-15) + self.xyz_scheduler_args = get_expon_lr_func(lr_init=training_args.position_lr_init*self.spatial_lr_scale, + lr_final=training_args.position_lr_final*self.spatial_lr_scale, + lr_delay_mult=training_args.position_lr_delay_mult, + max_steps=training_args.position_lr_max_steps) + + def update_learning_rate(self, iteration): + ''' Learning rate scheduling per step ''' + for param_group in self.optimizer.param_groups: + if param_group["name"] == "xyz": + lr = self.xyz_scheduler_args(iteration) + param_group['lr'] = lr + return lr + + def construct_list_of_attributes(self): + l = ['x', 'y', 'z', 'nx', 'ny', 'nz'] + # All channels except the 3 DC + for i in range(self._features_dc.shape[1]*self._features_dc.shape[2]): + l.append('f_dc_{}'.format(i)) + for i in range(self._features_rest.shape[1]*self._features_rest.shape[2]): + l.append('f_rest_{}'.format(i)) + l.append('opacity') + for i in range(self._scaling.shape[1]): + l.append('scale_{}'.format(i)) + for i in range(self._rotation.shape[1]): + l.append('rot_{}'.format(i)) + return l + + def save_ply(self, path): + os.makedirs(os.path.dirname(path), exist_ok = True) + + xyz = self._xyz.detach().cpu().numpy() + normals = np.zeros_like(xyz) + f_dc = self._features_dc.detach().transpose(1, 2).flatten(start_dim=1).contiguous().cpu().numpy() + f_rest = self._features_rest.detach().transpose(1, 2).flatten(start_dim=1).contiguous().cpu().numpy() + opacities = self._opacity.detach().cpu().numpy() + scale = self._scaling.detach().cpu().numpy() + rotation = self._rotation.detach().cpu().numpy() + + dtype_full = [(attribute, 'f4') for attribute in self.construct_list_of_attributes()] + + elements = np.empty(xyz.shape[0], dtype=dtype_full) + attributes = np.concatenate((xyz, normals, f_dc, f_rest, opacities, scale, rotation), axis=1) + elements[:] = list(map(tuple, attributes)) + el = PlyElement.describe(elements, 'vertex') + PlyData([el]).write(path) + + def reset_opacity(self): + opacities_new = inverse_sigmoid(torch.min(self.get_opacity, torch.ones_like(self.get_opacity)*0.01)) + optimizable_tensors = self.replace_tensor_to_optimizer(opacities_new, "opacity") + self._opacity = optimizable_tensors["opacity"] + + def load_ply(self, path): + plydata = PlyData.read(path) + + xyz = np.stack((np.asarray(plydata.elements[0]["x"]), + np.asarray(plydata.elements[0]["y"]), + np.asarray(plydata.elements[0]["z"])), axis=1) + opacities = np.asarray(plydata.elements[0]["opacity"])[..., np.newaxis] + + features_dc = np.zeros((xyz.shape[0], 3, 1)) + features_dc[:, 0, 0] = np.asarray(plydata.elements[0]["f_dc_0"]) + features_dc[:, 1, 0] = np.asarray(plydata.elements[0]["f_dc_1"]) + features_dc[:, 2, 0] = np.asarray(plydata.elements[0]["f_dc_2"]) + + extra_f_names = [p.name for p in plydata.elements[0].properties if p.name.startswith("f_rest_")] + extra_f_names = sorted(extra_f_names, key = lambda x: int(x.split('_')[-1])) + assert len(extra_f_names)==3*(self.max_sh_degree + 1) ** 2 - 3 + features_extra = np.zeros((xyz.shape[0], len(extra_f_names))) + for idx, attr_name in enumerate(extra_f_names): + features_extra[:, idx] = np.asarray(plydata.elements[0][attr_name]) + # Reshape (P,F*SH_coeffs) to (P, F, SH_coeffs except DC) + features_extra = features_extra.reshape((features_extra.shape[0], 3, (self.max_sh_degree + 1) ** 2 - 1)) + + scale_names = [p.name for p in plydata.elements[0].properties if p.name.startswith("scale_")] + scale_names = sorted(scale_names, key = lambda x: int(x.split('_')[-1])) + scales = np.zeros((xyz.shape[0], len(scale_names))) + for idx, attr_name in enumerate(scale_names): + scales[:, idx] = np.asarray(plydata.elements[0][attr_name]) + + rot_names = [p.name for p in plydata.elements[0].properties if p.name.startswith("rot")] + rot_names = sorted(rot_names, key = lambda x: int(x.split('_')[-1])) + rots = np.zeros((xyz.shape[0], len(rot_names))) + for idx, attr_name in enumerate(rot_names): + rots[:, idx] = np.asarray(plydata.elements[0][attr_name]) + + self._xyz = nn.Parameter(torch.tensor(xyz, dtype=torch.float, device="cuda").requires_grad_(True)) + self._features_dc = nn.Parameter(torch.tensor(features_dc, dtype=torch.float, device="cuda").transpose(1, 2).contiguous().requires_grad_(True)) + self._features_rest = nn.Parameter(torch.tensor(features_extra, dtype=torch.float, device="cuda").transpose(1, 2).contiguous().requires_grad_(True)) + self._opacity = nn.Parameter(torch.tensor(opacities, dtype=torch.float, device="cuda").requires_grad_(True)) + self._scaling = nn.Parameter(torch.tensor(scales, dtype=torch.float, device="cuda").requires_grad_(True)) + self._rotation = nn.Parameter(torch.tensor(rots, dtype=torch.float, device="cuda").requires_grad_(True)) + + self.active_sh_degree = self.max_sh_degree + + def replace_tensor_to_optimizer(self, tensor, name): + optimizable_tensors = {} + for group in self.optimizer.param_groups: + if group["name"] == name: + stored_state = self.optimizer.state.get(group['params'][0], None) + stored_state["exp_avg"] = torch.zeros_like(tensor) + stored_state["exp_avg_sq"] = torch.zeros_like(tensor) + + del self.optimizer.state[group['params'][0]] + group["params"][0] = nn.Parameter(tensor.requires_grad_(True)) + self.optimizer.state[group['params'][0]] = stored_state + + optimizable_tensors[group["name"]] = group["params"][0] + return optimizable_tensors + + def _prune_optimizer(self, mask): + optimizable_tensors = {} + for group in self.optimizer.param_groups: + stored_state = self.optimizer.state.get(group['params'][0], None) + if stored_state is not None: + stored_state["exp_avg"] = stored_state["exp_avg"][mask] + stored_state["exp_avg_sq"] = stored_state["exp_avg_sq"][mask] + + del self.optimizer.state[group['params'][0]] + group["params"][0] = nn.Parameter((group["params"][0][mask].requires_grad_(True))) + self.optimizer.state[group['params'][0]] = stored_state + + optimizable_tensors[group["name"]] = group["params"][0] + else: + group["params"][0] = nn.Parameter(group["params"][0][mask].requires_grad_(True)) + optimizable_tensors[group["name"]] = group["params"][0] + return optimizable_tensors + + def prune_points(self, mask): + valid_points_mask = ~mask + optimizable_tensors = self._prune_optimizer(valid_points_mask) + + self._xyz = optimizable_tensors["xyz"] + self._features_dc = optimizable_tensors["f_dc"] + self._features_rest = optimizable_tensors["f_rest"] + self._opacity = optimizable_tensors["opacity"] + self._scaling = optimizable_tensors["scaling"] + self._rotation = optimizable_tensors["rotation"] + + self.xyz_gradient_accum = self.xyz_gradient_accum[valid_points_mask] + + self.denom = self.denom[valid_points_mask] + self.max_radii2D = self.max_radii2D[valid_points_mask] + + def cat_tensors_to_optimizer(self, tensors_dict): + optimizable_tensors = {} + for group in self.optimizer.param_groups: + assert len(group["params"]) == 1 + extension_tensor = tensors_dict[group["name"]] + stored_state = self.optimizer.state.get(group['params'][0], None) + if stored_state is not None: + + stored_state["exp_avg"] = torch.cat((stored_state["exp_avg"], torch.zeros_like(extension_tensor)), dim=0) + stored_state["exp_avg_sq"] = torch.cat((stored_state["exp_avg_sq"], torch.zeros_like(extension_tensor)), dim=0) + + del self.optimizer.state[group['params'][0]] + group["params"][0] = nn.Parameter(torch.cat((group["params"][0], extension_tensor), dim=0).requires_grad_(True)) + self.optimizer.state[group['params'][0]] = stored_state + + optimizable_tensors[group["name"]] = group["params"][0] + else: + group["params"][0] = nn.Parameter(torch.cat((group["params"][0], extension_tensor), dim=0).requires_grad_(True)) + optimizable_tensors[group["name"]] = group["params"][0] + + return optimizable_tensors + + def densification_postfix(self, new_xyz, new_features_dc, new_features_rest, new_opacities, new_scaling, new_rotation): + d = {"xyz": new_xyz, + "f_dc": new_features_dc, + "f_rest": new_features_rest, + "opacity": new_opacities, + "scaling" : new_scaling, + "rotation" : new_rotation} + + optimizable_tensors = self.cat_tensors_to_optimizer(d) + self._xyz = optimizable_tensors["xyz"] + self._features_dc = optimizable_tensors["f_dc"] + self._features_rest = optimizable_tensors["f_rest"] + self._opacity = optimizable_tensors["opacity"] + self._scaling = optimizable_tensors["scaling"] + self._rotation = optimizable_tensors["rotation"] + + self.xyz_gradient_accum = torch.zeros((self.get_xyz.shape[0], 1), device="cuda") + self.denom = torch.zeros((self.get_xyz.shape[0], 1), device="cuda") + self.max_radii2D = torch.zeros((self.get_xyz.shape[0]), device="cuda") + + def densify_and_split(self, grads, grad_threshold, scene_extent, N=2): + n_init_points = self.get_xyz.shape[0] + # Extract points that satisfy the gradient condition + padded_grad = torch.zeros((n_init_points), device="cuda") + padded_grad[:grads.shape[0]] = grads.squeeze() + selected_pts_mask = torch.where(padded_grad >= grad_threshold, True, False) + selected_pts_mask = torch.logical_and(selected_pts_mask, + torch.max(self.get_scaling, dim=1).values > self.percent_dense*scene_extent) + + stds = self.get_scaling[selected_pts_mask].repeat(N,1) + means =torch.zeros((stds.size(0), 3),device="cuda") + samples = torch.normal(mean=means, std=stds) + rots = build_rotation(self._rotation[selected_pts_mask]).repeat(N,1,1) + new_xyz = torch.bmm(rots, samples.unsqueeze(-1)).squeeze(-1) + self.get_xyz[selected_pts_mask].repeat(N, 1) + new_scaling = self.scaling_inverse_activation(self.get_scaling[selected_pts_mask].repeat(N,1) / (0.8*N)) + new_rotation = self._rotation[selected_pts_mask].repeat(N,1) + new_features_dc = self._features_dc[selected_pts_mask].repeat(N,1,1) + new_features_rest = self._features_rest[selected_pts_mask].repeat(N,1,1) + new_opacity = self._opacity[selected_pts_mask].repeat(N,1) + + self.densification_postfix(new_xyz, new_features_dc, new_features_rest, new_opacity, new_scaling, new_rotation) + + prune_filter = torch.cat((selected_pts_mask, torch.zeros(N * selected_pts_mask.sum(), device="cuda", dtype=bool))) + self.prune_points(prune_filter) + + def densify_and_clone(self, grads, grad_threshold, scene_extent): + # Extract points that satisfy the gradient condition + selected_pts_mask = torch.where(torch.norm(grads, dim=-1) >= grad_threshold, True, False) + selected_pts_mask = torch.logical_and(selected_pts_mask, + torch.max(self.get_scaling, dim=1).values <= self.percent_dense*scene_extent) + + new_xyz = self._xyz[selected_pts_mask] + new_features_dc = self._features_dc[selected_pts_mask] + new_features_rest = self._features_rest[selected_pts_mask] + new_opacities = self._opacity[selected_pts_mask] + new_scaling = self._scaling[selected_pts_mask] + new_rotation = self._rotation[selected_pts_mask] + + self.densification_postfix(new_xyz, new_features_dc, new_features_rest, new_opacities, new_scaling, new_rotation) + + def densify_and_prune(self, max_grad, min_opacity, extent, max_screen_size): + grads = self.xyz_gradient_accum / self.denom + grads[grads.isnan()] = 0.0 + + self.densify_and_clone(grads, max_grad, extent) + self.densify_and_split(grads, max_grad, extent) + + prune_mask = (self.get_opacity < min_opacity).squeeze() + if max_screen_size: + big_points_vs = self.max_radii2D > max_screen_size + big_points_ws = self.get_scaling.max(dim=1).values > 0.1 * extent + prune_mask = torch.logical_or(torch.logical_or(prune_mask, big_points_vs), big_points_ws) + self.prune_points(prune_mask) + + torch.cuda.empty_cache() + + def add_densification_stats(self, viewspace_point_tensor, update_filter): + self.xyz_gradient_accum[update_filter] += torch.norm(viewspace_point_tensor.grad[update_filter,:2], dim=-1, keepdim=True) + self.denom[update_filter] += 1 \ No newline at end of file diff --git a/AnimatableGaussians/gaussians/gaussian_renderer.py b/AnimatableGaussians/gaussians/gaussian_renderer.py new file mode 100644 index 0000000000000000000000000000000000000000..cfc4826ef56be6ec348e286921173f87640b46f6 --- /dev/null +++ b/AnimatableGaussians/gaussians/gaussian_renderer.py @@ -0,0 +1,107 @@ +# +# Copyright (C) 2023, Inria +# GRAPHDECO research group, https://team.inria.fr/graphdeco +# All rights reserved. +# +# This software is free for non-commercial, research and evaluation use +# under the terms of the LICENSE.md file. +# +# For inquiries contact george.drettakis@inria.fr +# + +import torch +import math +from diff_gaussian_rasterization_depth_alpha import GaussianRasterizationSettings, GaussianRasterizer +from AnimatableGaussians.utils.graphics_utils import focal2fov, getProjectionMatrix +from AnimatableGaussians.utils.sh_utils import eval_sh + + +def render3( + gaussian_vals: dict, + bg_color: torch.Tensor, + extr: torch.Tensor, + intr: torch.Tensor, + img_w: int, + img_h: int, + scaling_modifier = 1.0, +): + means3D = gaussian_vals['positions'] + # Create zero tensor. We will use it to make pytorch return gradients of the 2D (screen-space) means + screenspace_points = torch.zeros_like(means3D, dtype = means3D.dtype, requires_grad = True, device = "cuda") + 0 + try: + screenspace_points.retain_grad() + except: + pass + means2D = screenspace_points + opacity = gaussian_vals['opacity'] + + # If precomputed 3d covariance is provided, use it. If not, then it will be computed from + # scaling / rotation by the rasterizer. + cov3D_precomp = None + scales = gaussian_vals['scales'] + rotations = gaussian_vals['rotations'] + + # Set up rasterization configuration + FoVx = focal2fov(intr[0, 0].item(), img_w) + FoVy = focal2fov(intr[1, 1].item(), img_h) + tanfovx = math.tan(FoVx * 0.5) + tanfovy = math.tan(FoVy * 0.5) + world_view_transform = extr.transpose(1, 0).cuda() + projection_matrix = getProjectionMatrix(znear = 0.1, zfar = 100, fovX = FoVx, fovY = FoVy, K = intr, img_w = img_w, img_h = img_h).transpose(0, 1).cuda() + full_proj_transform = (world_view_transform.unsqueeze(0).bmm(projection_matrix.unsqueeze(0))).squeeze(0) + camera_center = torch.linalg.inv(extr)[:3, 3] + + raster_settings = GaussianRasterizationSettings( + image_height = img_h, + image_width = img_w, + tanfovx = tanfovx, + tanfovy = tanfovy, + bg = bg_color, + scale_modifier = scaling_modifier, + viewmatrix = world_view_transform, + projmatrix = full_proj_transform, + sh_degree = gaussian_vals['max_sh_degree'], + campos = camera_center, + prefiltered = False, + debug = False + ) + + rasterizer = GaussianRasterizer(raster_settings = raster_settings) + + # If precomputed colors are provided, use them. Otherwise, if it is desired to precompute colors + # from SHs in Python, do it. If not, then SH -> RGB conversion will be done by rasterizer. + assert not ('colors' in gaussian_vals and 'shs' in gaussian_vals), "Cannot use both color and SH!" + if 'colors' in gaussian_vals: + colors_precomp = gaussian_vals['colors'] + else: + colors_precomp = None + if 'shs' in gaussian_vals: + shs_view = gaussian_vals['shs'] + dir_pp = (means3D - camera_center.repeat(means3D.shape[0], 1)) + dir_pp_normalized = dir_pp / dir_pp.norm(dim = 1, keepdim = True) + sh2rgb = eval_sh(gaussian_vals['max_sh_degree'], shs_view, dir_pp_normalized) + colors_precomp = torch.clamp_min(sh2rgb + 0.5, 0.0) + shs = None + + # Rasterize visible Gaussians to image, obtain their radii (on screen). + rendered_image, radii, rendered_depth, rendered_alpha = rasterizer( + means3D = means3D, + means2D = means2D, + shs = shs, + colors_precomp = colors_precomp, + opacities = opacity, + scales = scales, + rotations = rotations, + cov3D_precomp = cov3D_precomp) + + # Those Gaussians that were frustum culled or had a radius of 0 were not visible. + # They will be excluded from value updates used in the splitting criteria. + return { + "render": rendered_image, + "depth": rendered_depth, + "mask": rendered_alpha, + "viewspace_points": screenspace_points, + "visibility_filter": radii > 0, + "radii": radii + } + diff --git a/AnimatableGaussians/gaussians/obj_io.py b/AnimatableGaussians/gaussians/obj_io.py new file mode 100644 index 0000000000000000000000000000000000000000..1953807ff3da7ae24c13cfbd50ba237133cc46cc --- /dev/null +++ b/AnimatableGaussians/gaussians/obj_io.py @@ -0,0 +1,99 @@ +import torch +import numpy as np +from AnimatableGaussians.utils.sh_utils import RGB2SH, SH2RGB +from AnimatableGaussians.utils.general_utils import inverse_sigmoid +from plyfile import PlyData, PlyElement +import os + + +def construct_list_of_attributes(_features_dc, _features_rest, _scaling, _rotation): + l = ['x', 'y', 'z', 'nx', 'ny', 'nz'] + # All channels except the 3 DC + for i in range(_features_dc.shape[1] * _features_dc.shape[2]): + l.append('f_dc_{}'.format(i)) + for i in range(_features_rest.shape[1] * _features_rest.shape[2]): + l.append('f_rest_{}'.format(i)) + l.append('opacity') + for i in range(_scaling.shape[1]): + l.append('scale_{}'.format(i)) + for i in range(_rotation.shape[1]): + l.append('rot_{}'.format(i)) + return l + + +def save_gaussians_as_ply(path, gaussian_vals: dict): + os.makedirs(os.path.dirname(path), exist_ok = True) + + xyz = gaussian_vals['positions'].detach().cpu().numpy() + normals = np.zeros_like(xyz) + fused_color = RGB2SH(gaussian_vals['colors'].detach()[:, [2, 1, 0]]) + features = torch.zeros((fused_color.shape[0], 3, (3 + 1) ** 2)) + features[:, :3, 0] = fused_color + features_dc = features[:, :, 0:1].transpose(1, 2) + features_rest = features[:, :, 1:].transpose(1, 2) + f_dc = features_dc.transpose(1, 2).flatten(start_dim = 1).contiguous().cpu().numpy() + f_rest = features_rest.transpose(1, 2).flatten(start_dim = 1).contiguous().cpu().numpy() + opacities = inverse_sigmoid(gaussian_vals['opacity'].detach()).cpu().numpy() + scale = torch.log(gaussian_vals['scales'].detach()).cpu().numpy() + rotation = gaussian_vals['rotations'].detach().cpu().numpy() + + dtype_full = [(attribute, 'f4') for attribute in construct_list_of_attributes(features_dc, features_rest, scale, rotation)] + + elements = np.empty(xyz.shape[0], dtype = dtype_full) + attributes = np.concatenate((xyz, normals, f_dc, f_rest, opacities, scale, rotation), axis = 1) + elements[:] = list(map(tuple, attributes)) + el = PlyElement.describe(elements, 'vertex') + PlyData([el]).write(path) + + +def load_gaussians_from_ply(path): + plydata = PlyData.read(path) + + xyz = np.stack((np.asarray(plydata.elements[0]["x"]), + np.asarray(plydata.elements[0]["y"]), + np.asarray(plydata.elements[0]["z"])), axis = 1) + opacities = np.asarray(plydata.elements[0]["opacity"])[..., np.newaxis] + + features_dc = np.zeros((xyz.shape[0], 3, 1)) + features_dc[:, 0, 0] = np.asarray(plydata.elements[0]["f_dc_0"]) + features_dc[:, 1, 0] = np.asarray(plydata.elements[0]["f_dc_1"]) + features_dc[:, 2, 0] = np.asarray(plydata.elements[0]["f_dc_2"]) + + extra_f_names = [p.name for p in plydata.elements[0].properties if p.name.startswith("f_rest_")] + extra_f_names = sorted(extra_f_names, key = lambda x: int(x.split('_')[-1])) + # assert len(extra_f_names) == 3 * (self.max_sh_degree + 1) ** 2 - 3 + features_extra = np.zeros((xyz.shape[0], len(extra_f_names))) + for idx, attr_name in enumerate(extra_f_names): + features_extra[:, idx] = np.asarray(plydata.elements[0][attr_name]) + # Reshape (P,F*SH_coeffs) to (P, F, SH_coeffs except DC) + features_extra = features_extra.reshape((features_extra.shape[0], 3, (3 + 1) ** 2 - 1)) + + scale_names = [p.name for p in plydata.elements[0].properties if p.name.startswith("scale_")] + scale_names = sorted(scale_names, key = lambda x: int(x.split('_')[-1])) + scales = np.zeros((xyz.shape[0], len(scale_names))) + for idx, attr_name in enumerate(scale_names): + scales[:, idx] = np.asarray(plydata.elements[0][attr_name]) + + rot_names = [p.name for p in plydata.elements[0].properties if p.name.startswith("rot")] + rot_names = sorted(rot_names, key = lambda x: int(x.split('_')[-1])) + rots = np.zeros((xyz.shape[0], len(rot_names))) + for idx, attr_name in enumerate(rot_names): + rots[:, idx] = np.asarray(plydata.elements[0][attr_name]) + + # self._xyz = nn.Parameter(torch.tensor(xyz, dtype = torch.float, device = "cuda").requires_grad_(True)) + # self._features_dc = nn.Parameter(torch.tensor(features_dc, dtype = torch.float, device = "cuda").transpose(1, 2).contiguous().requires_grad_(True)) + # self._features_rest = nn.Parameter(torch.tensor(features_extra, dtype = torch.float, device = "cuda").transpose(1, 2).contiguous().requires_grad_(True)) + # self._opacity = nn.Parameter(torch.tensor(opacities, dtype = torch.float, device = "cuda").requires_grad_(True)) + # self._scaling = nn.Parameter(torch.tensor(scales, dtype = torch.float, device = "cuda").requires_grad_(True)) + # self._rotation = nn.Parameter(torch.tensor(rots, dtype = torch.float, device = "cuda").requires_grad_(True)) + # + # self.active_sh_degree = self.max_sh_degree + + return { + 'positions': torch.tensor(xyz, dtype = torch.float, device = "cuda"), + 'colors': torch.tensor(SH2RGB(features_dc)[:, [2, 1, 0]], dtype = torch.float, device = "cuda").squeeze(-1), + 'opacity': torch.sigmoid(torch.tensor(opacities, dtype = torch.float, device = "cuda")), + 'scales': torch.exp(torch.tensor(scales, dtype = torch.float, device = "cuda")), + 'rotations': torch.nn.functional.normalize(torch.tensor(rots, dtype = torch.float, device = "cuda")), + 'features_extr': torch.tensor(features_extra, dtype = torch.float, device = "cuda") + } diff --git a/AnimatableGaussians/gen_data/GEN_DATA.md b/AnimatableGaussians/gen_data/GEN_DATA.md new file mode 100644 index 0000000000000000000000000000000000000000..ff7728f73a6a50230eb48320be8df706ce52655d --- /dev/null +++ b/AnimatableGaussians/gen_data/GEN_DATA.md @@ -0,0 +1,48 @@ +# Data Organization +We recommend follow [THuman4.0](https://github.com/ZhengZerong/THUman4.0-Dataset) dataset to organize your own data as shown below: +``` +data_dir +├── images +| └── cam00 +│ └── cam01 +├── masks +│ └── cam00 +│ └── cam01 +├── calibration.json +├── smpl_params.npz +``` + + +# Preprocessing + +1. (Optional) Reconstruct a template if the character is wearing loose clothes. +* Install additional libs. +``` +cd ./utils/posevocab_custom_ops +python setup.py install +cd ../.. + +cd ./utils/root_finding +python setup.py install +cd ../.. +``` +* Generate a canonical LBS weight volume. + * **For Windows**: Download [AdaptiveSolvers.x64.zip](https://www.cs.jhu.edu/~misha/Code/PoissonRecon/Version16.01/AdaptiveSolvers.x64.zip) and extract ```PointInterpolant.exe``` to ```./bins``` + * **For Linux**: + * Clone [Adaptive Multigrid Solvers (Version 16.04)](https://github.com/mkazhdan/PoissonRecon.git) to directory of your choice + * ```cd path/to/cloned/repo``` + * ```make pointinterpolant``` + * The resulting executable file is at ```path/to/cloned/repo/Bin/Linux/PointInterpolant```. Copy it to ```./bins``` (you may need to do ```mkdir ./bins``` beforehand) + * Go to ```./gen_data/gen_weight_volume.py line 115```, change ```solve(smpl_model.lbs_weights.shape[-1], ".\\bins\\PointInterpolant.exe")``` to ```solve(smpl_model.lbs_weights.shape[-1], "./bins/PointInterpolant")```. (This is the resulting executable file we previously made.) +``` +python -m gen_data.gen_weight_volume -c configs/***/template.yaml +``` +* Run the following script to reconstruct a template. +``` +python main_template.py -c configs/***/template.yaml +``` + +2. Generate position maps. +``` +python -m gen_data.gen_pos_maps -c configs/***/avatar.yaml +``` diff --git a/AnimatableGaussians/gen_data/__pycache__/gen_pos_maps.cpython-310.pyc b/AnimatableGaussians/gen_data/__pycache__/gen_pos_maps.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4724ea4e3d481f69ee0486555c760499b1a1413d Binary files /dev/null and b/AnimatableGaussians/gen_data/__pycache__/gen_pos_maps.cpython-310.pyc differ diff --git a/AnimatableGaussians/gen_data/__pycache__/gen_pos_maps.cpython-38.pyc b/AnimatableGaussians/gen_data/__pycache__/gen_pos_maps.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..21340e75aa25878aaaad23e72eb08385137d6df2 Binary files /dev/null and b/AnimatableGaussians/gen_data/__pycache__/gen_pos_maps.cpython-38.pyc differ diff --git a/AnimatableGaussians/gen_data/gen_pos_maps.py b/AnimatableGaussians/gen_data/gen_pos_maps.py new file mode 100644 index 0000000000000000000000000000000000000000..5dadec429cd8bb1af80c8bfd3811302db3c7016e --- /dev/null +++ b/AnimatableGaussians/gen_data/gen_pos_maps.py @@ -0,0 +1,162 @@ +import os +import numpy as np +import torch +import torch.nn.functional as F +import cv2 as cv +import trimesh +import yaml +import tqdm + +import smplx +from network.volume import CanoBlendWeightVolume +from utils.renderer import Renderer +import config +os.environ["OPENCV_IO_ENABLE_OPENEXR"]="1" + +def save_pos_map(pos_map, path): + mask = np.linalg.norm(pos_map, axis = -1) > 0. + positions = pos_map[mask] + print('Point nums %d' % positions.shape[0]) + pc = trimesh.PointCloud(positions) + pc.export(path) + + +def interpolate_lbs(pts, vertices, faces, vertex_lbs): + from utils.posevocab_custom_ops.nearest_face import nearest_face_pytorch3d + from utils.geo_util import barycentric_interpolate + dists, indices, bc_coords = nearest_face_pytorch3d( + torch.from_numpy(pts).to(torch.float32).cuda()[None], + torch.from_numpy(vertices).to(torch.float32).cuda()[None], + torch.from_numpy(faces).to(torch.int64).cuda() + ) + # print(dists.mean()) + lbs = barycentric_interpolate( + vert_attris = vertex_lbs[None].to(torch.float32).cuda(), + faces = torch.from_numpy(faces).to(torch.int64).cuda()[None], + face_ids = indices, + bc_coords = bc_coords + ) + return lbs[0].cpu().numpy() + + +map_size = 1024 + + +if __name__ == '__main__': + from argparse import ArgumentParser + import importlib + + arg_parser = ArgumentParser() + arg_parser.add_argument('-c', '--config_path', type = str, help = 'Configuration file path.') + args = arg_parser.parse_args() + + opt = yaml.load(open(args.config_path, encoding = 'UTF-8'), Loader = yaml.FullLoader) + dataset_module = opt['train'].get('dataset', 'MvRgbDatasetAvatarReX') + MvRgbDataset = importlib.import_module('dataset.dataset_mv_rgb').__getattribute__(dataset_module) + dataset = MvRgbDataset(**opt['train']['data']) + data_dir, frame_list = dataset.data_dir, dataset.pose_list + + os.makedirs(data_dir + '/smpl_pos_map', exist_ok = True) + + cano_renderer = Renderer(map_size, map_size, shader_name = 'vertex_attribute') + + smpl_model = smplx.SMPLX(config.PROJ_DIR + '/smpl_files/smplx', gender = 'neutral', use_pca = False, num_pca_comps = 45, flat_hand_mean = True, batch_size = 1) + smpl_data = np.load(data_dir + '/smpl_params.npz') + smpl_data = {k: torch.from_numpy(v.astype(np.float32)) for k, v in smpl_data.items()} + + with torch.no_grad(): + cano_smpl = smpl_model.forward( + betas = smpl_data['betas'], + global_orient = config.cano_smpl_global_orient[None], + transl = config.cano_smpl_transl[None], + body_pose = config.cano_smpl_body_pose[None] + ) + cano_smpl_v = cano_smpl.vertices[0].cpu().numpy() + cano_center = 0.5 * (cano_smpl_v.min(0) + cano_smpl_v.max(0)) + cano_smpl_v_min = cano_smpl_v.min() + smpl_faces = smpl_model.faces.astype(np.int64) + + if os.path.exists(data_dir + '/template.ply'): + print('# Loading template from %s' % (data_dir + '/template.ply')) + template = trimesh.load(data_dir + '/template.ply', process = False) + using_template = True + else: + print(f'# Cannot find template.ply from {data_dir}, using SMPL-X as template') + template = trimesh.Trimesh(cano_smpl_v, smpl_faces, process = False) + using_template = False + + cano_smpl_v = template.vertices.astype(np.float32) + smpl_faces = template.faces.astype(np.int64) + cano_smpl_v_dup = cano_smpl_v[smpl_faces.reshape(-1)] + cano_smpl_n_dup = template.vertex_normals.astype(np.float32)[smpl_faces.reshape(-1)] + + # define front & back view matrices + front_mv = np.identity(4, np.float32) + front_mv[:3, 3] = -cano_center + np.array([0, 0, -10], np.float32) + front_mv[1:3] *= -1 + + back_mv = np.identity(4, np.float32) + rot_y = cv.Rodrigues(np.array([0, np.pi, 0], np.float32))[0] + back_mv[:3, :3] = rot_y + back_mv[:3, 3] = -rot_y @ cano_center + np.array([0, 0, -10], np.float32) + back_mv[1:3] *= -1 + + # render canonical smpl position maps + cano_renderer.set_model(cano_smpl_v_dup, cano_smpl_v_dup) + cano_renderer.set_camera(front_mv) + front_cano_pos_map = cano_renderer.render()[:, :, :3] + + cano_renderer.set_camera(back_mv) + back_cano_pos_map = cano_renderer.render()[:, :, :3] + back_cano_pos_map = cv.flip(back_cano_pos_map, 1) + cano_pos_map = np.concatenate([front_cano_pos_map, back_cano_pos_map], 1) + cv.imwrite(data_dir + '/smpl_pos_map/cano_smpl_pos_map.exr', cano_pos_map) + + # render canonical smpl normal maps + cano_renderer.set_model(cano_smpl_v_dup, cano_smpl_n_dup) + cano_renderer.set_camera(front_mv) + front_cano_nml_map = cano_renderer.render()[:, :, :3] + + cano_renderer.set_camera(back_mv) + back_cano_nml_map = cano_renderer.render()[:, :, :3] + back_cano_nml_map = cv.flip(back_cano_nml_map, 1) + cano_nml_map = np.concatenate([front_cano_nml_map, back_cano_nml_map], 1) + cv.imwrite(data_dir + '/smpl_pos_map/cano_smpl_nml_map.exr', cano_nml_map) + + body_mask = np.linalg.norm(cano_pos_map, axis = -1) > 0. + cano_pts = cano_pos_map[body_mask] + if using_template: + weight_volume = CanoBlendWeightVolume(data_dir + '/cano_weight_volume.npz') + pts_lbs = weight_volume.forward_weight(torch.from_numpy(cano_pts)[None].cuda())[0] + else: + pts_lbs = interpolate_lbs(cano_pts, cano_smpl_v, smpl_faces, smpl_model.lbs_weights) + pts_lbs = torch.from_numpy(pts_lbs).cuda() + np.save(data_dir + '/smpl_pos_map/init_pts_lbs.npy', pts_lbs.cpu().numpy()) + + inv_cano_smpl_A = torch.linalg.inv(cano_smpl.A).cuda() + body_mask = torch.from_numpy(body_mask).cuda() + cano_pts = torch.from_numpy(cano_pts).cuda() + pts_lbs = pts_lbs.cuda() + + for pose_idx in tqdm.tqdm(frame_list, desc = 'Generating positional maps...'): + with torch.no_grad(): + live_smpl_woRoot = smpl_model.forward( + betas = smpl_data['betas'], + # global_orient = smpl_data['global_orient'][pose_idx][None], + # transl = smpl_data['transl'][pose_idx][None], + body_pose = smpl_data['body_pose'][pose_idx][None], + jaw_pose = smpl_data['jaw_pose'][pose_idx][None], + expression = smpl_data['expression'][pose_idx][None], + # left_hand_pose = smpl_data['left_hand_pose'][pose_idx][None], + # right_hand_pose = smpl_data['right_hand_pose'][pose_idx][None] + ) + + cano2live_jnt_mats_woRoot = torch.matmul(live_smpl_woRoot.A.cuda(), inv_cano_smpl_A)[0] + pt_mats = torch.einsum('nj,jxy->nxy', pts_lbs, cano2live_jnt_mats_woRoot) + live_pts = torch.einsum('nxy,ny->nx', pt_mats[..., :3, :3], cano_pts) + pt_mats[..., :3, 3] + live_pos_map = torch.zeros((map_size, 2 * map_size, 3)).to(live_pts) + live_pos_map[body_mask] = live_pts + live_pos_map = F.interpolate(live_pos_map.permute(2, 0, 1)[None], None, [0.5, 0.5], mode = 'nearest')[0] + live_pos_map = live_pos_map.permute(1, 2, 0).cpu().numpy() + + cv.imwrite(data_dir + '/smpl_pos_map/%08d.exr' % pose_idx, live_pos_map) diff --git a/AnimatableGaussians/gen_data/gen_weight_volume.py b/AnimatableGaussians/gen_data/gen_weight_volume.py new file mode 100644 index 0000000000000000000000000000000000000000..14514160d6f5db9046504859bccaffb2afb07a20 --- /dev/null +++ b/AnimatableGaussians/gen_data/gen_weight_volume.py @@ -0,0 +1,221 @@ +import os +import glob +import numpy as np +import igl +import pytorch3d.ops +import tqdm + +import smplx +import torch +import trimesh +import config + + +tmp_dir = './debug/tmp' +os.makedirs(tmp_dir, exist_ok = True) +depth = 7 + + +def compute_lbs_grad(cano_smpl: trimesh.Trimesh, vertex_lbs: np.ndarray): + vertices = cano_smpl.vertices.astype(np.float32) + normals = cano_smpl.vertex_normals.copy().astype(np.float32) + faces = cano_smpl.faces.astype(np.int64) + + normals /= np.linalg.norm(normals, axis = 1, keepdims = True) + tx = np.cross(normals, np.array([[0, 0, 1]], np.float32)) + tx /= np.linalg.norm(tx, axis = 1, keepdims = True) + ty = np.cross(normals, tx) + + vnum = vertices.shape[0] + fnum = faces.shape[0] + jnum = vertex_lbs.shape[1] + lbs_grad_tx = np.zeros((vnum, jnum), np.float32) + lbs_grad_ty = np.zeros((vnum, jnum), np.float32) + for vidx in tqdm.tqdm(range(vnum)): + v = vertices[vidx] + for jidx in range(jnum): + for neighbor_vidx in cano_smpl.vertex_neighbors[vidx]: + vn = vertices[neighbor_vidx] + pos_diff = vn - v + pos_diff_norm = np.linalg.norm(pos_diff) + val_diff = vertex_lbs[neighbor_vidx, jidx] - vertex_lbs[vidx, jidx] + val_diff /= pos_diff_norm + pos_diff /= pos_diff_norm + + lbs_grad_tx[vidx, jidx] += val_diff * np.dot(pos_diff, tx[vidx]) + lbs_grad_ty[vidx, jidx] += val_diff * np.dot(pos_diff, ty[vidx]) + + lbs_grad_tx[vidx, jidx] /= float(len(cano_smpl.vertex_neighbors[vidx])) + lbs_grad_ty[vidx, jidx] /= float(len(cano_smpl.vertex_neighbors[vidx])) + + # print(lbs_grad_ty) + # print(lbs_grad_tx) + lbs_grad = lbs_grad_tx[:, :, None] * tx[:, None] + lbs_grad_ty[:, :, None] * ty[:, None] # (V, J, 3) + for jid in tqdm.tqdm(range(jnum)): + out_fn_grad = os.path.join(tmp_dir, f"cano_data_lbs_grad_{jid:02d}.xyz") + out_fn_val = os.path.join(tmp_dir, f"cano_data_lbs_val_{jid:02d}.xyz") + + out_data_grad = np.concatenate([vertices, lbs_grad[:, jid]], 1) + out_data_val = np.concatenate([vertices, vertex_lbs[:, jid:jid+1]], 1) + np.savetxt(out_fn_grad, out_data_grad, fmt="%.8f") + np.savetxt(out_fn_val, out_data_val, fmt="%.8f") + + +def solve(num_joints, point_interpolant_exe): + for jid in range(num_joints): + print('Solving joint %d' % jid) + cmd = f'{point_interpolant_exe} ' + \ + f'--inValues {os.path.join(tmp_dir, f"cano_data_lbs_val_{jid:02d}.xyz")} ' + \ + f'--inGradients {os.path.join(tmp_dir, f"cano_data_lbs_grad_{jid:02d}.xyz")} ' + \ + f'--gradientWeight 0.05 --dim 3 --verbose ' + \ + f'--grid {os.path.join(tmp_dir, f"grid_{jid:02d}.grd")} ' + \ + f'--depth {depth} ' + + os.system(cmd) + + +@torch.no_grad() +def calc_cano_weight_volume(data_dir, gender = 'neutral'): + smpl_params = np.load(data_dir + '/smpl_params.npz') + smpl_shape = torch.from_numpy(smpl_params['betas'][0]).to(torch.float32) + smpl_model = smplx.SMPLX(model_path = config.PROJ_DIR + '/smpl_files/smplx', gender = gender, use_pca = False, num_pca_comps = 45, flat_hand_mean = True, batch_size = 1) + + def get_grid_points(bounds, res): + # voxel_size = (bounds[1] - bounds[0]) / (np.array(res, np.float32) - 1) + # x = np.arange(bounds[0, 0], bounds[1, 0] + voxel_size[0], voxel_size[0]) + # y = np.arange(bounds[0, 1], bounds[1, 1] + voxel_size[1], voxel_size[1]) + # z = np.arange(bounds[0, 2], bounds[1, 2] + voxel_size[2], voxel_size[2]) + x = np.linspace(bounds[0, 0], bounds[1, 0], res[0]) + y = np.linspace(bounds[0, 1], bounds[1, 1], res[1]) + z = np.linspace(bounds[0, 2], bounds[1, 2], res[2]) + + pts = np.stack(np.meshgrid(x, y, z, indexing = 'ij'), axis = -1) + return pts + + if isinstance(smpl_model, smplx.SMPLX): + cano_smpl = smpl_model.forward(betas = smpl_shape[None], + global_orient = config.cano_smpl_global_orient[None], + transl = config.cano_smpl_transl[None], + body_pose = config.cano_smpl_body_pose[None]) + elif isinstance(smpl_model, smplx.SMPL): + cano_smpl = smpl_model.forward(betas = smpl_shape[None], + global_orient = config.cano_smpl_global_orient[None], + transl = config.cano_smpl_transl[None], + body_pose = config.cano_smpl_pose[6:][None]) + else: + raise TypeError('Not support this SMPL type.') + + cano_smpl_trimesh = trimesh.Trimesh( + cano_smpl.vertices[0].cpu().numpy(), + smpl_model.faces, + process = False + ) + + compute_lbs_grad(cano_smpl_trimesh, smpl_model.lbs_weights.cpu().numpy()) + solve(smpl_model.lbs_weights.shape[-1], ".\\bins\\PointInterpolant.exe") + + ### NOTE concatenate all grids + fn_list = sorted(list(glob.glob(os.path.join(tmp_dir, 'grid_*.grd')))) + + grids = [] + import array + for fn in fn_list: + with open(fn, 'rb') as f: + bytes = f.read() + grid_res = 2 ** depth + grid_header_len = len(bytes) - grid_res ** 3 * 8 + grid_np = np.array(array.array('d', bytes[grid_header_len:])).reshape(grid_res, grid_res, grid_res) + grids.append(grid_np) + + grids_all = np.stack(grids, 0) + grids_all = np.clip(grids_all, 0.0, 1.0) + grids_all = grids_all / grids_all.sum(0)[None] + # print(grids_all.shape) + # np.save(join(data_templates_path, subject, subject + '_cano_lbs_weights_grid_float32.npy'), grids_all.astype(np.float32)) + diff_weights = grids_all.transpose((3, 2, 1, 0)) # convert to xyz + min_xyz = cano_smpl_trimesh.vertices.min(0).astype(np.float32) + max_xyz = cano_smpl_trimesh.vertices.max(0).astype(np.float32) + max_len = 1.1 * (max_xyz - min_xyz).max() + center = 0.5 * (min_xyz + max_xyz) + volume_bounds = np.stack( + [center - 0.5 * max_len, center + 0.5 * max_len], 0 + ) + + min_xyz[:2] -= 0.05 + max_xyz[:2] += 0.05 + min_xyz[2] -= 0.15 + max_xyz[2] += 0.15 + smpl_bounds = np.stack( + [min_xyz, max_xyz], 0 + ) + + res = diff_weights.shape[:3] + pts = get_grid_points(volume_bounds, res) + pts = pts.reshape(-1, 3) + dists, face_id, closest_pts = igl.signed_distance(pts, cano_smpl_trimesh.vertices, smpl_model.faces.astype(np.int32)) + triangles = cano_smpl_trimesh.vertices[smpl_model.faces[face_id]] + weights = smpl_model.lbs_weights.numpy()[smpl_model.faces[face_id]] + barycentric_weight = trimesh.triangles.points_to_barycentric(triangles, closest_pts) + ori_weights = (barycentric_weight[:, :, None] * weights).sum(1) + # weights[dists > 0.08] = 0. + dists = dists.reshape(res).astype(np.float32) + ori_weights = ori_weights.reshape(list(res) + [-1]).astype(np.float32) + + np.savez(data_dir + '/cano_weight_volume.npz', + diff_weight_volume = diff_weights.astype(np.float32), + ori_weight_volume = ori_weights.astype(np.float32), + sdf_volume = -dists, + volume_bounds = volume_bounds, + smpl_bounds = smpl_bounds, + center = center) + + # # debug + # from network.volume import CanoBlendWeightVolume + # from utils.smpl_util import skinning + # weight_volume = CanoBlendWeightVolume(data_dir + '/cano_weight_volume.npz') + # pts_w = weight_volume.forward_weight(torch.from_numpy(cano_smpl_trimesh.vertices).to(torch.float32).to(config.device)) + # pts_w = pts_w[0].cpu().numpy() + # np.savetxt('../debug/pts_w_query.txt', pts_w, fmt = '%.8f') + # np.savetxt('../debug/pts_w_val.txt', smpl_model.lbs_weights.cpu().numpy(), fmt = '%.8f') + # + # # smpl_data = np.load(data_dir + '/smpl_params.npz') + # smpl_data = np.load('F:/pose/thuman4/pose_01.npz') + # smpl_data = {k: torch.from_numpy(v).to(torch.float32) for k, v in smpl_data.items()} + # frame_idx = 61 + # posed_smpl = smpl_model.forward( + # betas = smpl_data['betas'], + # global_orient = smpl_data['global_orient'][frame_idx: frame_idx+1], + # transl = smpl_data['transl'][frame_idx: frame_idx+1], + # body_pose = smpl_data['body_pose'][frame_idx: frame_idx+1] + # ) + # jnt_mats = torch.matmul(posed_smpl.A, cano_smpl.A.inverse()) + # pts_w = torch.from_numpy(pts_w).to(torch.float32) + # cano_verts = torch.from_numpy(cano_smpl_trimesh.vertices).to(torch.float32) + # posed_v_query = skinning(cano_verts[None], pts_w[None], jnt_mats) + # posed_v_ori = skinning(cano_verts[None], smpl_model.lbs_weights[None], jnt_mats) + # posed_smpl_query = trimesh.Trimesh(posed_v_query.cpu().numpy()[0], smpl_model.faces, process = False) + # posed_smpl_ori = trimesh.Trimesh(posed_v_ori.cpu().numpy()[0], smpl_model.faces, process = False) + # posed_smpl_query.export('../debug/posed_smpl_query.obj') + # posed_smpl_ori.export('../debug/posed_smpl_ori.obj') + # cano_smpl_trimesh.export('../debug/cano_smpl.obj') + # + # cano_mesh = trimesh.load('../debug/cano_mesh.ply', process = False) + # cano_mesh_v = torch.from_numpy(cano_mesh.vertices).to(torch.float32) + # cano_mesh_lbs = weight_volume.forward_weight(cano_mesh_v.to(config.device)).cpu()[0] + # posed_mesh_v_query = skinning(cano_mesh_v[None], cano_mesh_lbs[None], jnt_mats) + # posed_mesh_query = trimesh.Trimesh(posed_mesh_v_query[0].cpu().numpy(), cano_mesh.faces, process = False) + # posed_mesh_query.export('../debug/posed_mesh_query.obj') + + +if __name__ == '__main__': + from argparse import ArgumentParser + import yaml + + arg_parser = ArgumentParser() + arg_parser.add_argument('-c', '--config_path', type = str, help = 'Configuration file path.') + args = arg_parser.parse_args() + + opt = yaml.load(open(args.config_path, encoding = 'UTF-8'), Loader = yaml.FullLoader) + data_dir = opt['train']['data']['data_dir'] + + calc_cano_weight_volume(data_dir, gender = 'neutral') diff --git a/AnimatableGaussians/main_avatar.py b/AnimatableGaussians/main_avatar.py new file mode 100644 index 0000000000000000000000000000000000000000..969367c9ed4f97290ca5dea74d563c93f5538059 --- /dev/null +++ b/AnimatableGaussians/main_avatar.py @@ -0,0 +1,1140 @@ +from ast import dump +import os +from turtle import left +# os.environ['CUDA_LAUNCH_BLOCKING'] = '1' +# os.environ['TORCH_USE_CUDA_DSA'] = '1' +os.environ['OPENCV_IO_ENABLE_OPENEXR'] = '1' +# from inflection import camelize +import yaml +import shutil +import collections +import torch +import torch.utils.data +import torch.nn.functional as F +import numpy as np +import cv2 as cv +import glob +import datetime +import trimesh +from torch.utils.tensorboard import SummaryWriter +from tqdm import tqdm +import importlib +import json + +import config +from network.lpips import LPIPS +from dataset.dataset_pose import PoseDataset +import utils.net_util as net_util +import utils.visualize_util as visualize_util +from utils.renderer import Renderer +from utils.net_util import to_cuda +from utils.obj_io import save_mesh_as_ply +from gaussians.obj_io import save_gaussians_as_ply + + +def safe_exists(path): + if path is None: + return False + return os.path.exists(path) + + +class AvatarTrainer: + def __init__(self, opt): + self.opt = opt + self.patch_size = 512 + self.iter_idx = 0 + self.iter_num = 800000 + self.lr_init = float(self.opt['train'].get('lr_init', 5e-4)) + + avatar_module = self.opt['model'].get('module', 'network.avatar') + print('Import AvatarNet from %s' % avatar_module) + AvatarNet = importlib.import_module(avatar_module).AvatarNet + self.avatar_net = AvatarNet(self.opt['model']).to(config.device) + self.optm = torch.optim.Adam( + self.avatar_net.parameters(), lr = self.lr_init + ) + + self.random_bg_color = self.opt['train'].get('random_bg_color', True) + self.bg_color = (1., 1., 1.) + self.bg_color_cuda = torch.from_numpy(np.asarray(self.bg_color)).to(torch.float32).to(config.device) + self.loss_weight = self.opt['train']['loss_weight'] + self.finetune_color = self.opt['train']['finetune_color'] + + print('# Parameter number of AvatarNet is %d' % (sum([p.numel() for p in self.avatar_net.parameters()]))) + + def update_lr(self): + alpha = 0.05 + progress = self.iter_idx / self.iter_num + learning_factor = (np.cos(np.pi * progress) + 1.0) * 0.5 * (1 - alpha) + alpha + lr = self.lr_init * learning_factor + for param_group in self.optm.param_groups: + param_group['lr'] = lr + return lr + + @staticmethod + def requires_net_grad(net: torch.nn.Module, flag = True): + for p in net.parameters(): + p.requires_grad = flag + + def crop_image(self, gt_mask, patch_size, randomly, *args): + """ + :param gt_mask: (H, W) + :param patch_size: resize the cropped patch to the given patch_size + :param randomly: whether to randomly sample the patch + :param args: input images with shape of (C, H, W) + """ + mask_uv = torch.argwhere(gt_mask > 0.) + min_v, min_u = mask_uv.min(0)[0] + max_v, max_u = mask_uv.max(0)[0] + len_v = max_v - min_v + len_u = max_u - min_u + max_size = max(len_v, len_u) + + cropped_images = [] + if randomly and max_size > patch_size: + random_v = torch.randint(0, max_size - patch_size + 1, (1,)).to(max_size) + random_u = torch.randint(0, max_size - patch_size + 1, (1,)).to(max_size) + for image in args: + cropped_image = self.bg_color_cuda[:, None, None] * torch.ones((3, max_size, max_size), dtype = image.dtype, device = image.device) + if len_v > len_u: + start_u = (max_size - len_u) // 2 + cropped_image[:, :, start_u: start_u + len_u] = image[:, min_v: max_v, min_u: max_u] + else: + start_v = (max_size - len_v) // 2 + cropped_image[:, start_v: start_v + len_v, :] = image[:, min_v: max_v, min_u: max_u] + + if randomly and max_size > patch_size: + cropped_image = cropped_image[:, random_v: random_v + patch_size, random_u: random_u + patch_size] + else: + cropped_image = F.interpolate(cropped_image[None], size = (patch_size, patch_size), mode = 'bilinear')[0] + cropped_images.append(cropped_image) + + # cv.imshow('cropped_image', cropped_image.detach().cpu().numpy().transpose(1, 2, 0)) + # cv.imshow('cropped_gt_image', cropped_gt_image.detach().cpu().numpy().transpose(1, 2, 0)) + # cv.waitKey(0) + + if len(cropped_images) > 1: + return cropped_images + else: + return cropped_images[0] + + def compute_lpips_loss(self, image, gt_image): + assert image.shape[1] == image.shape[2] and gt_image.shape[1] == gt_image.shape[2] + lpips_loss = self.lpips.forward( + image[None, [2, 1, 0]], + gt_image[None, [2, 1, 0]], + normalize = True + ).mean() + return lpips_loss + + def forward_one_pass_pretrain(self, items): + total_loss = 0 + batch_losses = {} + l1_loss = torch.nn.L1Loss() + + items = net_util.delete_batch_idx(items) + pose_map = items['smpl_pos_map'][:3] + + position_loss = l1_loss(self.avatar_net.get_positions(pose_map), self.avatar_net.cano_gaussian_model.get_xyz) + total_loss += position_loss + batch_losses.update({ + 'position': position_loss.item() + }) + + opacity, scales, rotations = self.avatar_net.get_others(pose_map) + opacity_loss = l1_loss(opacity, self.avatar_net.cano_gaussian_model.get_opacity) + total_loss += opacity_loss + batch_losses.update({ + 'opacity': opacity_loss.item() + }) + + scale_loss = l1_loss(scales, self.avatar_net.cano_gaussian_model.get_scaling) + total_loss += scale_loss + batch_losses.update({ + 'scale': scale_loss.item() + }) + + rotation_loss = l1_loss(rotations, self.avatar_net.cano_gaussian_model.get_rotation) + total_loss += rotation_loss + batch_losses.update({ + 'rotation': rotation_loss.item() + }) + + total_loss.backward() + + self.optm.step() + self.optm.zero_grad() + + return total_loss, batch_losses + + def forward_one_pass(self, items): + # forward_start = torch.cuda.Event(enable_timing = True) + # forward_end = torch.cuda.Event(enable_timing = True) + # backward_start = torch.cuda.Event(enable_timing = True) + # backward_end = torch.cuda.Event(enable_timing = True) + # step_start = torch.cuda.Event(enable_timing = True) + # step_end = torch.cuda.Event(enable_timing = True) + + if self.random_bg_color: + self.bg_color = np.random.rand(3) + self.bg_color_cuda = torch.from_numpy(np.asarray(self.bg_color)).to(torch.float32).to(config.device) + + total_loss = 0 + batch_losses = {} + + items = net_util.delete_batch_idx(items) + + """ Optimize generator """ + if self.finetune_color: + self.requires_net_grad(self.avatar_net.color_net, True) + self.requires_net_grad(self.avatar_net.position_net, False) + self.requires_net_grad(self.avatar_net.other_net, True) + else: + self.requires_net_grad(self.avatar_net, True) + + # forward_start.record() + render_output = self.avatar_net.render(items, self.bg_color) + image = render_output['rgb_map'].permute(2, 0, 1) + offset = render_output['offset'] + + # mask image & set bg color + items['color_img'][~items['mask_img']] = self.bg_color_cuda + gt_image = items['color_img'].permute(2, 0, 1) + mask_img = items['mask_img'].to(torch.float32) + boundary_mask_img = 1. - items['boundary_mask_img'].to(torch.float32) + image = image * boundary_mask_img[None] + (1. - boundary_mask_img[None]) * self.bg_color_cuda[:, None, None] + gt_image = gt_image * boundary_mask_img[None] + (1. - boundary_mask_img[None]) * self.bg_color_cuda[:, None, None] + # cv.imshow('image', image.detach().permute(1, 2, 0).cpu().numpy()) + # cv.imshow('gt_image', gt_image.permute(1, 2, 0).cpu().numpy()) + # cv.waitKey(0) + + if self.loss_weight['l1'] > 0.: + l1_loss = torch.abs(image - gt_image).mean() + total_loss += self.loss_weight['l1'] * l1_loss + batch_losses.update({ + 'l1_loss': l1_loss.item() + }) + + if self.loss_weight.get('mask', 0.) and 'mask_map' in render_output: + rendered_mask = render_output['mask_map'].squeeze(-1) * boundary_mask_img + gt_mask = mask_img * boundary_mask_img + # cv.imshow('rendered_mask', rendered_mask.detach().cpu().numpy()) + # cv.imshow('gt_mask', gt_mask.detach().cpu().numpy()) + # cv.waitKey(0) + mask_loss = torch.abs(rendered_mask - gt_mask).mean() + # mask_loss = torch.nn.BCELoss()(rendered_mask, gt_mask) + total_loss += self.loss_weight.get('mask', 0.) * mask_loss + batch_losses.update({ + 'mask_loss': mask_loss.item() + }) + + if self.loss_weight['lpips'] > 0.: + # crop images + random_patch_flag = False if self.iter_idx < 300000 else True + image, gt_image = self.crop_image(mask_img, self.patch_size, random_patch_flag, image, gt_image) + # cv.imshow('image', image.detach().permute(1, 2, 0).cpu().numpy()) + # cv.imshow('gt_image', gt_image.permute(1, 2, 0).cpu().numpy()) + # cv.waitKey(0) + lpips_loss = self.compute_lpips_loss(image, gt_image) + total_loss += self.loss_weight['lpips'] * lpips_loss + batch_losses.update({ + 'lpips_loss': lpips_loss.item() + }) + + # if self.loss_weight['offset'] > 0.: + if True: + offset_loss = torch.linalg.norm(offset, dim = -1).mean() + total_loss += self.loss_weight['offset'] * offset_loss + batch_losses.update({ + 'offset_loss': offset_loss.item() + }) + + # forward_end.record() + + # backward_start.record() + total_loss.backward() + # backward_end.record() + + # step_start.record() + self.optm.step() + self.optm.zero_grad() + # step_end.record() + + # torch.cuda.synchronize() + # print(f'Forward costs: {forward_start.elapsed_time(forward_end) / 1000.}, ', + # f'Backward costs: {backward_start.elapsed_time(backward_end) / 1000.}, ', + # f'Step costs: {step_start.elapsed_time(step_end) / 1000.}') + + return total_loss, batch_losses + + def pretrain(self): + dataset_module = self.opt['train'].get('dataset', 'MvRgbDatasetAvatarReX') + MvRgbDataset = importlib.import_module('dataset.dataset_mv_rgb').__getattribute__(dataset_module) + self.dataset = MvRgbDataset(**self.opt['train']['data']) + batch_size = self.opt['train']['batch_size'] + num_workers = self.opt['train']['num_workers'] + batch_num = len(self.dataset) // batch_size + dataloader = torch.utils.data.DataLoader(self.dataset, + batch_size = batch_size, + shuffle = True, + num_workers = num_workers, + drop_last = True) + + # tb writer + log_dir = self.opt['train']['net_ckpt_dir'] + '/' + datetime.datetime.now().strftime('pretrain_%Y_%m_%d_%H_%M_%S') + writer = SummaryWriter(log_dir) + smooth_interval = 10 + smooth_count = 0 + smooth_losses = {} + + for epoch_idx in range(0, 9999999): + self.epoch_idx = epoch_idx + for batch_idx, items in enumerate(dataloader): + self.iter_idx = batch_idx + epoch_idx * batch_num + items = to_cuda(items) + + # one_step_start.record() + total_loss, batch_losses = self.forward_one_pass_pretrain(items) + # one_step_end.record() + # torch.cuda.synchronize() + # print('One step costs %f secs' % (one_step_start.elapsed_time(one_step_end) / 1000.)) + + # record batch loss + for key, loss in batch_losses.items(): + if key in smooth_losses: + smooth_losses[key] += loss + else: + smooth_losses[key] = loss + smooth_count += 1 + + if self.iter_idx % smooth_interval == 0: + log_info = 'epoch %d, batch %d, iter %d, ' % (epoch_idx, batch_idx, self.iter_idx) + for key in smooth_losses.keys(): + smooth_losses[key] /= smooth_count + writer.add_scalar('%s/Iter' % key, smooth_losses[key], self.iter_idx) + log_info = log_info + ('%s: %f, ' % (key, smooth_losses[key])) + smooth_losses[key] = 0. + smooth_count = 0 + print(log_info) + with open(os.path.join(log_dir, 'loss.txt'), 'a') as fp: + fp.write(log_info + '\n') + + if self.iter_idx % 200 == 0 and self.iter_idx != 0: + self.mini_test(pretraining = True) + + if self.iter_idx == 5000: + model_folder = self.opt['train']['net_ckpt_dir'] + '/pretrained' + os.makedirs(model_folder, exist_ok = True) + self.save_ckpt(model_folder, save_optm = True) + self.iter_idx = 0 + return + + def train(self): + dataset_module = self.opt['train'].get('dataset', 'MvRgbDatasetAvatarReX') + MvRgbDataset = importlib.import_module('dataset.dataset_mv_rgb').__getattribute__(dataset_module) + self.dataset = MvRgbDataset(**self.opt['train']['data']) + batch_size = self.opt['train']['batch_size'] + num_workers = self.opt['train']['num_workers'] + batch_num = len(self.dataset) // batch_size + dataloader = torch.utils.data.DataLoader(self.dataset, + batch_size = batch_size, + shuffle = True, + num_workers = num_workers, + drop_last = True) + + if 'lpips' in self.opt['train']['loss_weight']: + self.lpips = LPIPS(net = 'vgg').to(config.device) + for p in self.lpips.parameters(): + p.requires_grad = False + + if self.opt['train']['prev_ckpt'] is not None: + start_epoch, self.iter_idx = self.load_ckpt(self.opt['train']['prev_ckpt'], load_optm = True) + start_epoch += 1 + self.iter_idx += 1 + else: + prev_ckpt_path = self.opt['train']['net_ckpt_dir'] + '/epoch_latest' + if safe_exists(prev_ckpt_path): + start_epoch, self.iter_idx = self.load_ckpt(prev_ckpt_path, load_optm = True) + start_epoch += 1 + self.iter_idx += 1 + else: + if safe_exists(self.opt['train']['pretrained_dir']): + self.load_ckpt(self.opt['train']['pretrained_dir'], load_optm = False) + elif safe_exists(self.opt['train']['net_ckpt_dir'] + '/pretrained'): + self.load_ckpt(self.opt['train']['net_ckpt_dir'] + '/pretrained', load_optm = False) + else: + raise FileNotFoundError('Cannot find pretrained checkpoint!') + + self.optm.state = collections.defaultdict(dict) + start_epoch = 0 + self.iter_idx = 0 + + # one_step_start = torch.cuda.Event(enable_timing = True) + # one_step_end = torch.cuda.Event(enable_timing = True) + + # tb writer + log_dir = self.opt['train']['net_ckpt_dir'] + '/' + datetime.datetime.now().strftime('%Y_%m_%d_%H_%M_%S') + writer = SummaryWriter(log_dir) + yaml.dump(self.opt, open(log_dir + '/config_bk.yaml', 'w'), sort_keys = False) + smooth_interval = 10 + smooth_count = 0 + smooth_losses = {} + + for epoch_idx in range(start_epoch, 9999999): + self.epoch_idx = epoch_idx + for batch_idx, items in enumerate(dataloader): + lr = self.update_lr() + + items = to_cuda(items) + + # one_step_start.record() + total_loss, batch_losses = self.forward_one_pass(items) + # one_step_end.record() + # torch.cuda.synchronize() + # print('One step costs %f secs' % (one_step_start.elapsed_time(one_step_end) / 1000.)) + + # record batch loss + for key, loss in batch_losses.items(): + if key in smooth_losses: + smooth_losses[key] += loss + else: + smooth_losses[key] = loss + smooth_count += 1 + + if self.iter_idx % smooth_interval == 0: + log_info = 'epoch %d, batch %d, iter %d, lr %e, ' % (epoch_idx, batch_idx, self.iter_idx, lr) + for key in smooth_losses.keys(): + smooth_losses[key] /= smooth_count + writer.add_scalar('%s/Iter' % key, smooth_losses[key], self.iter_idx) + log_info = log_info + ('%s: %f, ' % (key, smooth_losses[key])) + smooth_losses[key] = 0. + smooth_count = 0 + print(log_info) + with open(os.path.join(log_dir, 'loss.txt'), 'a') as fp: + fp.write(log_info + '\n') + torch.cuda.empty_cache() + + if self.iter_idx % self.opt['train']['eval_interval'] == 0 and self.iter_idx != 0: + if self.iter_idx % (10 * self.opt['train']['eval_interval']) == 0: + eval_cano_pts = True + else: + eval_cano_pts = False + self.mini_test(eval_cano_pts = eval_cano_pts) + + if self.iter_idx % self.opt['train']['ckpt_interval']['batch'] == 0 and self.iter_idx != 0: + for folder in glob.glob(self.opt['train']['net_ckpt_dir'] + '/batch_*'): + shutil.rmtree(folder) + model_folder = self.opt['train']['net_ckpt_dir'] + '/batch_%d' % self.iter_idx + os.makedirs(model_folder, exist_ok = True) + self.save_ckpt(model_folder, save_optm = True) + + if self.iter_idx == self.iter_num: + print('# Training is done.') + return + + self.iter_idx += 1 + + """ End of epoch """ + if epoch_idx % self.opt['train']['ckpt_interval']['epoch'] == 0 and epoch_idx != 0: + model_folder = self.opt['train']['net_ckpt_dir'] + '/epoch_%d' % epoch_idx + os.makedirs(model_folder, exist_ok = True) + self.save_ckpt(model_folder) + + if batch_num > 50: + latest_folder = self.opt['train']['net_ckpt_dir'] + '/epoch_latest' + os.makedirs(latest_folder, exist_ok = True) + self.save_ckpt(latest_folder) + + @torch.no_grad() + def mini_test(self, pretraining = False, eval_cano_pts = False): + self.avatar_net.eval() + + img_factor = self.opt['train'].get('eval_img_factor', 1.0) + # training data + pose_idx, view_idx = self.opt['train'].get('eval_training_ids', (310, 19)) + intr = self.dataset.intr_mats[view_idx].copy() + intr[:2] *= img_factor + item = self.dataset.getitem(0, + pose_idx = pose_idx, + view_idx = view_idx, + training = False, + eval = True, + img_h = int(self.dataset.img_heights[view_idx] * img_factor), + img_w = int(self.dataset.img_widths[view_idx] * img_factor), + extr = self.dataset.extr_mats[view_idx], + intr = intr, + exact_hand_pose = True) + items = net_util.to_cuda(item, add_batch = False) + + gs_render = self.avatar_net.render(items, self.bg_color) + # gs_render = self.avatar_net.render_debug(items) + rgb_map = gs_render['rgb_map'] + rgb_map.clip_(0., 1.) + rgb_map = (rgb_map.cpu().numpy() * 255).astype(np.uint8) + # cv.imshow('rgb_map', rgb_map.cpu().numpy()) + # cv.waitKey(0) + if not pretraining: + output_dir = self.opt['train']['net_ckpt_dir'] + '/eval/training' + else: + output_dir = self.opt['train']['net_ckpt_dir'] + '/eval_pretrain/training' + gt_image, _ = self.dataset.load_color_mask_images(pose_idx, view_idx) + if gt_image is not None: + gt_image = cv.resize(gt_image, (0, 0), fx = img_factor, fy = img_factor) + rgb_map = np.concatenate([rgb_map, gt_image], 1) + os.makedirs(output_dir, exist_ok = True) + cv.imwrite(output_dir + '/iter_%d.jpg' % self.iter_idx, rgb_map) + if eval_cano_pts: + os.makedirs(output_dir + '/cano_pts', exist_ok = True) + save_mesh_as_ply(output_dir + '/cano_pts/iter_%d.ply' % self.iter_idx, (self.avatar_net.init_points + gs_render['offset']).cpu().numpy()) + + # training data + pose_idx, view_idx = self.opt['train'].get('eval_testing_ids', (310, 19)) + intr = self.dataset.intr_mats[view_idx].copy() + intr[:2] *= img_factor + item = self.dataset.getitem(0, + pose_idx = pose_idx, + view_idx = view_idx, + training = False, + eval = True, + img_h = int(self.dataset.img_heights[view_idx] * img_factor), + img_w = int(self.dataset.img_widths[view_idx] * img_factor), + extr = self.dataset.extr_mats[view_idx], + intr = intr, + exact_hand_pose = True) + items = net_util.to_cuda(item, add_batch = False) + + gs_render = self.avatar_net.render(items, bg_color = self.bg_color) + # gs_render = self.avatar_net.render_debug(items) + rgb_map = gs_render['rgb_map'] + rgb_map.clip_(0., 1.) + rgb_map = (rgb_map.cpu().numpy() * 255).astype(np.uint8) + # cv.imshow('rgb_map', rgb_map.cpu().numpy()) + # cv.waitKey(0) + if not pretraining: + output_dir = self.opt['train']['net_ckpt_dir'] + '/eval/testing' + else: + output_dir = self.opt['train']['net_ckpt_dir'] + '/eval_pretrain/testing' + gt_image, _ = self.dataset.load_color_mask_images(pose_idx, view_idx) + if gt_image is not None: + gt_image = cv.resize(gt_image, (0, 0), fx = img_factor, fy = img_factor) + rgb_map = np.concatenate([rgb_map, gt_image], 1) + os.makedirs(output_dir, exist_ok = True) + cv.imwrite(output_dir + '/iter_%d.jpg' % self.iter_idx, rgb_map) + if eval_cano_pts: + os.makedirs(output_dir + '/cano_pts', exist_ok = True) + save_mesh_as_ply(output_dir + '/cano_pts/iter_%d.ply' % self.iter_idx, (self.avatar_net.init_points + gs_render['offset']).cpu().numpy()) + + self.avatar_net.train() + + def dump_renderer_info(self, dump_dir, extrs, intrs, img_heights, img_widths): + with open(os.path.join(dump_dir, 'cfg_args'), 'w') as fp: + outstr = "Namespace(sh_degree=%d, source_path='%s', model_path='%s', images='images', resolution=-1, " \ + "white_background=False, data_device='cuda', eval=False)" % ( + 3, self.opt['train']['data']['data_dir'], dump_dir) + fp.write(outstr) + with open(os.path.join(dump_dir, 'cameras.json'), 'w') as fp: + cam_jsons = [] + for ci in range(len(extrs)): + extr, intr = extrs[ci], intrs[ci] + img_h, img_w = img_heights[ci], img_widths[ci] + + w2c = extr + c2w = np.linalg.inv(w2c) + pos = c2w[:3, 3] + rot = c2w[:3, :3] + serializable_array_2d = [x.tolist() for x in rot] + camera_entry = { + 'id': ci, + 'img_name': '%08d' % ci, + 'width': int(img_w), + 'height': int(img_h), + 'position': pos.tolist(), + 'rotation': serializable_array_2d, + 'fy': float(intr[1, 1]), + 'fx': float(intr[0, 0]), + } + cam_jsons.append(camera_entry) + json.dump(cam_jsons, fp) + return + + @torch.no_grad() + def test(self): + self.avatar_net.eval() + # ipdb.set_trace() + + dataset_module = self.opt['train'].get('dataset', 'MvRgbDatasetAvatarReX') + MvRgbDataset = importlib.import_module('dataset.dataset_mv_rgb').__getattribute__(dataset_module) + training_dataset = MvRgbDataset(**self.opt['train']['data'], training = False) + if self.opt['test'].get('n_pca', -1) >= 1: + training_dataset.compute_pca(n_components = self.opt['test']['n_pca']) + if 'pose_data' in self.opt['test']: + testing_dataset = PoseDataset(**self.opt['test']['pose_data'], smpl_shape = training_dataset.smpl_data['betas'][0]) + dataset_name = testing_dataset.dataset_name + seq_name = testing_dataset.seq_name + else: + testing_dataset = MvRgbDataset(**self.opt['test']['data'], training = False) + dataset_name = 'training' + seq_name = '' + + # print('come here') + self.dataset = testing_dataset + iter_idx = self.load_ckpt(self.opt['test']['prev_ckpt'], False)[1] + + output_dir = self.opt['test'].get('output_dir', None) + if output_dir is None: + view_setting = config.opt['test'].get('view_setting', 'free') + if view_setting == 'camera': + view_folder = 'cam_%03d' % config.opt['test']['render_view_idx'] + else: + view_folder = view_setting + '_view' + exp_name = os.path.basename(os.path.dirname(self.opt['test']['prev_ckpt'])) + output_dir = f'./test_results/{training_dataset.subject_name}/{exp_name}/{dataset_name}_{seq_name}_{view_folder}' + '/batch_%06d' % iter_idx + + use_pca = self.opt['test'].get('n_pca', -1) >= 1 + if use_pca: + output_dir += '/pca_%d_sigma_%.2f' % (self.opt['test'].get('n_pca', -1), float(self.opt['test'].get('sigma_pca', 1.))) + else: + output_dir += '/vanilla' + print('# Output dir: \033[1;31m%s\033[0m' % output_dir) + + os.makedirs(output_dir + '/live_skeleton', exist_ok = True) + os.makedirs(output_dir + '/rgb_map', exist_ok = True) + os.makedirs(output_dir + '/rgb_map_wo_hand', exist_ok = True) + os.makedirs(output_dir + '/torso_map', exist_ok = True) + os.makedirs(output_dir + '/mask_map', exist_ok = True) + os.makedirs(output_dir + '/posed_gaussians', exist_ok = True) + os.makedirs(output_dir + '/posed_params', exist_ok = True) + os.makedirs(output_dir + '/full_body_mask', exist_ok = True) + os.makedirs(output_dir + '/hand_only_mask', exist_ok = True) + + geo_renderer = None + item_0 = self.dataset.getitem(0, training = False) + object_center = item_0['live_bounds'].mean(0) + global_orient = item_0['global_orient'].cpu().numpy() if isinstance(item_0['global_orient'], torch.Tensor) else item_0['global_orient'] + + # set x and z to 0 + global_orient[0] = 0 + global_orient[2] = 0 + + global_orient = cv.Rodrigues(global_orient)[0] + # print('object_center: ', object_center.tolist()) + # print('global_orient: ', global_orient.tolist()) + # exit(1) + + time_start = torch.cuda.Event(enable_timing = True) + time_start_all = torch.cuda.Event(enable_timing = True) + time_end = torch.cuda.Event(enable_timing = True) + + data_num = len(self.dataset) + if self.opt['test'].get('fix_hand', False): + self.avatar_net.generate_mean_hands() + log_time = False + + # extr = visualize_util.calc_free_mv(object_center, + # tar_pos = np.array([0, 0, 2.5]), + # rot_Y = 0., + # rot_X = 0., + # global_orient = global_orient if self.opt['test'].get('global_orient', False) else None) + # intr = np.array([[1100, 0, 512], [0, 1100, 512], [0, 0, 1]], np.float32) + # img_scale = self.opt['test'].get('img_scale', 1.0) + # intr[:2] *= img_scale + # img_h = int(1024 * img_scale) + # img_w = int(1024 * img_scale) + # self.dump_renderer_info(output_dir, [extr], [intr], [img_h], [img_w]) + extr_list = [] + intr_list = [] + img_h_list = [] + img_w_list = [] + + + for idx in tqdm(range(data_num), desc = 'Rendering avatars...'): + if log_time: + time_start.record() + time_start_all.record() + + img_scale = self.opt['test'].get('img_scale', 1.0) + view_setting = config.opt['test'].get('view_setting', 'free') + if view_setting == 'camera': + # training view setting + cam_id = config.opt['test']['render_view_idx'] + intr = self.dataset.intr_mats[cam_id].copy() + intr[:2] *= img_scale + extr = self.dataset.extr_mats[cam_id].copy() + img_h, img_w = int(self.dataset.img_heights[cam_id] * img_scale), int(self.dataset.img_widths[cam_id] * img_scale) + elif view_setting.startswith('free'): + # free view setting + # frame_num_per_circle = 360 + print(self.opt['test'].get('global_orient', False)) + frame_num_per_circle = 360 + rot_Y = (idx % frame_num_per_circle) / float(frame_num_per_circle) * 2 * np.pi + + extr = visualize_util.calc_free_mv(object_center, + tar_pos = np.array([0, 0, 2.5]), + rot_Y = rot_Y, + rot_X = 0.3 if view_setting.endswith('bird') else 0., + global_orient = global_orient if self.opt['test'].get('global_orient', False) else None) + intr = np.array([[1100, 0, 512], [0, 1100, 512], [0, 0, 1]], np.float32) + intr[:2] *= img_scale + img_h = int(1024 * img_scale) + img_w = int(1024 * img_scale) + + extr_list.append(extr) + intr_list.append(intr) + img_h_list.append(img_h) + img_w_list.append(img_w) + + elif view_setting.startswith('degree120'): + print('we render 120 degree') + # +- 60 degree + frame_per_cycle = 480 + max_degree = 60 + frame_half_cycle = frame_per_cycle // 2 + if idx%frame_per_cycle < frame_per_cycle/2: + rot_Y = -max_degree + (2 * max_degree / frame_half_cycle) * (idx%frame_half_cycle) + # rot_Y = (idx % frame_per_60) / float(frame_per_60) * 2 * np.pi + else: + rot_Y = max_degree - (2 * max_degree / frame_half_cycle) * (idx%frame_half_cycle) + + # to radian + rot_Y = rot_Y * np.pi / 180 + if rot_Y<0: + rot_Y = rot_Y + 2 * np.pi + # print('rot_Y: ', rot_Y) + extr = visualize_util.calc_free_mv(object_center, + tar_pos = np.array([0, 0, 2.5]), + rot_Y = rot_Y, + rot_X = 0.3 if view_setting.endswith('bird') else 0., + global_orient = global_orient if self.opt['test'].get('global_orient', False) else None) + intr = np.array([[1100, 0, 512], [0, 1100, 512], [0, 0, 1]], np.float32) + intr[:2] *= img_scale + img_h = int(1024 * img_scale) + img_w = int(1024 * img_scale) + + extr_list.append(extr) + intr_list.append(intr) + img_h_list.append(img_h) + img_w_list.append(img_w) + + elif view_setting.startswith('degree90'): + print('we render 90 degree') + # +- 60 degree + frame_per_cycle = 360 + max_degree = 45 + frame_half_cycle = frame_per_cycle // 2 + if idx%frame_per_cycle < frame_per_cycle/2: + rot_Y = -max_degree + (2 * max_degree / frame_half_cycle) * (idx%frame_half_cycle) + # rot_Y = (idx % frame_per_60) / float(frame_per_60) * 2 * np.pi + else: + rot_Y = max_degree - (2 * max_degree / frame_half_cycle) * (idx%frame_half_cycle) + + # to radian + rot_Y = rot_Y * np.pi / 180 + if rot_Y<0: + rot_Y = rot_Y + 2 * np.pi + # print('rot_Y: ', rot_Y) + extr = visualize_util.calc_free_mv(object_center, + tar_pos = np.array([0, 0, 2.5]), + rot_Y = rot_Y, + rot_X = 0.3 if view_setting.endswith('bird') else 0., + global_orient = global_orient if self.opt['test'].get('global_orient', False) else None) + intr = np.array([[1100, 0, 512], [0, 1100, 512], [0, 0, 1]], np.float32) + intr[:2] *= img_scale + img_h = int(1024 * img_scale) + img_w = int(1024 * img_scale) + + extr_list.append(extr) + intr_list.append(intr) + img_h_list.append(img_h) + img_w_list.append(img_w) + + + elif view_setting.startswith('front'): + # front view setting + extr = visualize_util.calc_free_mv(object_center, + tar_pos = np.array([0, 0, 2.5]), + rot_Y = 0., + rot_X = 0.3 if view_setting.endswith('bird') else 0., + global_orient = global_orient if self.opt['test'].get('global_orient', False) else None) + intr = np.array([[1100, 0, 512], [0, 1100, 512], [0, 0, 1]], np.float32) + intr[:2] *= img_scale + img_h = int(1024 * img_scale) + img_w = int(1024 * img_scale) + + extr_list.append(extr) + intr_list.append(intr) + img_h_list.append(img_h) + img_w_list.append(img_w) + + # print('extr: ', extr) + # print('intr: ', intr) + # print('img_h: ', img_h) + # print('img_w: ', img_w) + # exit() + + + + elif view_setting.startswith('back'): + # back view setting + extr = visualize_util.calc_free_mv(object_center, + tar_pos = np.array([0, 0, 2.5]), + rot_Y = np.pi, + rot_X = 0.5 * np.pi / 4. if view_setting.endswith('bird') else 0., + global_orient = global_orient if self.opt['test'].get('global_orient', False) else None) + intr = np.array([[1100, 0, 512], [0, 1100, 512], [0, 0, 1]], np.float32) + intr[:2] *= img_scale + img_h = int(1024 * img_scale) + img_w = int(1024 * img_scale) + elif view_setting.startswith('moving'): + # moving camera setting + extr = visualize_util.calc_free_mv(object_center, + # tar_pos = np.array([0, 0, 3.0]), + # rot_Y = -0.3, + tar_pos = np.array([0, 0, 2.5]), + rot_Y = 0., + rot_X = 0.3 if view_setting.endswith('bird') else 0., + global_orient = global_orient if self.opt['test'].get('global_orient', False) else None) + intr = np.array([[1100, 0, 512], [0, 1100, 512], [0, 0, 1]], np.float32) + intr[:2] *= img_scale + img_h = int(1024 * img_scale) + img_w = int(1024 * img_scale) + elif view_setting.startswith('cano'): + cano_center = self.dataset.cano_bounds.mean(0) + extr = np.identity(4, np.float32) + extr[:3, 3] = -cano_center + rot_x = np.identity(4, np.float32) + rot_x[:3, :3] = cv.Rodrigues(np.array([np.pi, 0, 0], np.float32))[0] + extr = rot_x @ extr + f_len = 5000 + extr[2, 3] += f_len / 512 + intr = np.array([[f_len, 0, 512], [0, f_len, 512], [0, 0, 1]], np.float32) + # item = self.dataset.getitem(idx, + # training = False, + # extr = extr, + # intr = intr, + # img_w = 1024, + # img_h = 1024) + img_w, img_h = 1024, 1024 + # item['live_smpl_v'] = item['cano_smpl_v'] + # item['cano2live_jnt_mats'] = torch.eye(4, dtype = torch.float32)[None].expand(item['cano2live_jnt_mats'].shape[0], -1, -1) + # item['live_bounds'] = item['cano_bounds'] + else: + raise ValueError('Invalid view setting for animation!') + + + self.dump_renderer_info(output_dir, extr_list, intr_list, img_h_list, img_w_list) + # also save the extr and intr and img_h and img_w to json + camera_info = [] + for i in range(len(extr_list)): + camera = {} + camera['extr'] = extr_list[i].tolist() + camera['intr'] = intr_list[i].tolist() + camera['img_h'] = img_h_list[i] + camera['img_w'] = img_w_list[i] + camera_info.append(camera) + with open(os.path.join(output_dir, 'camera_info.json'), 'w') as fp: + json.dump(camera_info, fp) + + + getitem_func = self.dataset.getitem_fast if hasattr(self.dataset, 'getitem_fast') else self.dataset.getitem + item = getitem_func( + idx, + training = False, + extr = extr, + intr = intr, + img_w = img_w, + img_h = img_h + ) + items = to_cuda(item, add_batch = False) + + if view_setting.startswith('moving') or view_setting == 'free_moving': + current_center = items['live_bounds'].cpu().numpy().mean(0) + delta = current_center - object_center + + object_center[0] += delta[0] + # object_center[1] += delta[1] + # object_center[2] += delta[2] + + if log_time: + time_end.record() + torch.cuda.synchronize() + print('Loading data costs %.4f secs' % (time_start.elapsed_time(time_end) / 1000.)) + time_start.record() + + if self.opt['test'].get('render_skeleton', False): + from utils.visualize_skeletons import construct_skeletons + skel_vertices, skel_faces = construct_skeletons(item['joints'].cpu().numpy(), item['kin_parent'].cpu().numpy()) + skel_mesh = trimesh.Trimesh(skel_vertices, skel_faces, process = False) + + if geo_renderer is None: + geo_renderer = Renderer(item['img_w'], item['img_h'], shader_name = 'phong_geometry', bg_color = (1, 1, 1)) + extr, intr = item['extr'], item['intr'] + geo_renderer.set_camera(extr, intr) + geo_renderer.set_model(skel_vertices[skel_faces.reshape(-1)], skel_mesh.vertex_normals.astype(np.float32)[skel_faces.reshape(-1)]) + skel_img = geo_renderer.render()[:, :, :3] + skel_img = (skel_img * 255).astype(np.uint8) + cv.imwrite(output_dir + '/live_skeleton/%08d.jpg' % item['data_idx'], skel_img) + + if log_time: + time_end.record() + torch.cuda.synchronize() + print('Rendering skeletons costs %.4f secs' % (time_start.elapsed_time(time_end) / 1000.)) + time_start.record() + + if 'smpl_pos_map' not in items: + self.avatar_net.get_pose_map(items) + + # pca + if use_pca: + mask = training_dataset.pos_map_mask + live_pos_map = items['smpl_pos_map'].permute(1, 2, 0).cpu().numpy() + front_live_pos_map, back_live_pos_map = np.split(live_pos_map, [3], 2) + pose_conds = front_live_pos_map[mask] + new_pose_conds = training_dataset.transform_pca(pose_conds, sigma_pca = float(self.opt['test'].get('sigma_pca', 2.))) + front_live_pos_map[mask] = new_pose_conds + live_pos_map = np.concatenate([front_live_pos_map, back_live_pos_map], 2) + items.update({ + 'smpl_pos_map_pca': torch.from_numpy(live_pos_map).to(config.device).permute(2, 0, 1) + }) + + if log_time: + time_end.record() + torch.cuda.synchronize() + print('Rendering pose conditions costs %.4f secs' % (time_start.elapsed_time(time_end) / 1000.)) + time_start.record() + + output = self.avatar_net.render(items, bg_color = self.bg_color, use_pca = use_pca) + output_wo_hand = self.avatar_net.render_wo_hand(items, bg_color = self.bg_color, use_pca = use_pca) + mask_output = self.avatar_net.render_mask(items, bg_color = self.bg_color, use_pca = use_pca) + + if log_time: + time_end.record() + torch.cuda.synchronize() + print('Rendering avatar costs %.4f secs' % (time_start.elapsed_time(time_end) / 1000.)) + time_start.record() + + if 'rgb_map' in output_wo_hand: + rgb_map_wo_hand = output_wo_hand['rgb_map'] + + if 'full_body_rgb_map' in mask_output: + os.makedirs(output_dir + '/full_body_mask', exist_ok = True) + full_body_mask = mask_output['full_body_rgb_map'] + full_body_mask.clip_(0., 1.) + full_body_mask = (full_body_mask * 255).to(torch.uint8) + cv.imwrite(output_dir + '/full_body_mask/%08d.png' % item['data_idx'], full_body_mask.cpu().numpy()) + + if 'hand_only_rgb_map' in mask_output: + os.makedirs(output_dir + '/hand_only_mask', exist_ok = True) + hand_only_mask = mask_output['hand_only_rgb_map'] + hand_only_mask.clip_(0., 1.) + hand_only_mask = (hand_only_mask * 255).to(torch.uint8) + cv.imwrite(output_dir + '/hand_only_mask/%08d.png' % item['data_idx'], hand_only_mask.cpu().numpy()) + + if 'full_body_rgb_map' in mask_output and 'hand_only_rgb_map' in mask_output: + # mask only covers hand + body_red_mask = (mask_output['full_body_rgb_map'] - torch.tensor([1., 0., 0.], device = mask_output['full_body_rgb_map'].device)) + body_red_mask = (body_red_mask*body_red_mask).sum(dim=2) < 0.01 # need save + + hand_red_mask = (mask_output['hand_only_rgb_map'] - torch.tensor([1., 0., 0.], device = mask_output['hand_only_rgb_map'].device)) + hand_red_mask = (hand_red_mask*hand_red_mask).sum(dim=2) < 0.01 + + if_mask_r_hand = abs(body_red_mask.sum() - hand_red_mask.sum()) / hand_red_mask.sum() > 0.95 + if_mask_r_hand = if_mask_r_hand.cpu().numpy() + + body_blue_mask = (mask_output['full_body_rgb_map'] - torch.tensor([0., 0., 1.], device = mask_output['full_body_rgb_map'].device)) + body_blue_mask = (body_blue_mask*body_blue_mask).sum(dim=2) < 0.01 # need save + + hand_blue_mask = (mask_output['hand_only_rgb_map'] - torch.tensor([0., 0., 1.], device = mask_output['hand_only_rgb_map'].device)) + hand_blue_mask = (hand_blue_mask*hand_blue_mask).sum(dim=2) < 0.01 + + if_mask_l_hand = abs(body_blue_mask.sum() - hand_blue_mask.sum()) / hand_blue_mask.sum() > 0.95 + if_mask_l_hand = if_mask_l_hand.cpu().numpy() + + # 保存左右手被遮挡部分的mask + red_mask = hand_red_mask ^ (hand_red_mask & body_red_mask) + blue_mask = hand_blue_mask ^ (hand_blue_mask & body_blue_mask) + all_mask = red_mask | blue_mask + + # now save 3 mask to 3 folders + os.makedirs(output_dir + '/hand_mask', exist_ok = True) + os.makedirs(output_dir + '/r_hand_mask', exist_ok = True) + os.makedirs(output_dir + '/l_hand_mask', exist_ok = True) + os.makedirs(output_dir + '/hand_visual', exist_ok = True) + + all_mask = (all_mask * 255).to(torch.uint8) + cv.imwrite(output_dir + '/hand_mask/%08d.png' % item['data_idx'], all_mask.cpu().numpy()) + r_hand_mask = (body_red_mask * 255).to(torch.uint8) + cv.imwrite(output_dir + '/r_hand_mask/%08d.png' % item['data_idx'], r_hand_mask.cpu().numpy()) + l_hand_mask = (body_blue_mask * 255).to(torch.uint8) + cv.imwrite(output_dir + '/l_hand_mask/%08d.png' % item['data_idx'], l_hand_mask.cpu().numpy()) + hand_visual = [if_mask_r_hand, if_mask_l_hand] + # save to npy + with open(output_dir + '/hand_visual/%08d.npy' % item['data_idx'], 'wb') as f: + np.save(f, hand_visual) + + + # now build sleeve_mask + if 'left_hand_rgb_map' in mask_output and 'right_hand_rgb_map' in mask_output: + os.makedirs(output_dir + '/left_sleeve_mask', exist_ok = True) + os.makedirs(output_dir + '/right_sleeve_mask', exist_ok = True) + + mask = (r_hand_mask>128) | (l_hand_mask>128)| (all_mask>128) + mask = mask.cpu().numpy().astype(np.uint8) + # 定义一个结构元素,可以调整其大小以改变膨胀的程度 + kernel = np.ones((5, 5), np.uint8) + # 应用膨胀操作 + mask = cv.dilate(mask, kernel, iterations=3) + mask = torch.tensor(mask).to(config.device) + + left_hand_mask = mask_output['left_hand_rgb_map'] + left_hand_mask.clip_(0., 1.) + # non white part is mask + left_hand_mask = (torch.tensor([1., 1., 1.], device = left_hand_mask.device) - left_hand_mask) + left_hand_mask = (left_hand_mask*left_hand_mask).sum(dim=2) > 0.01 + # dele two hand mask + left_hand_mask = left_hand_mask & ~mask + + right_hand_mask = mask_output['right_hand_rgb_map'] + right_hand_mask.clip_(0., 1.) + right_hand_mask = (torch.tensor([1., 1., 1.], device = right_hand_mask.device) - right_hand_mask) + right_hand_mask = (right_hand_mask*right_hand_mask).sum(dim=2) > 0.01 + right_hand_mask = right_hand_mask & ~mask + + # save + left_hand_mask = (left_hand_mask * 255).to(torch.uint8) + cv.imwrite(output_dir + '/left_sleeve_mask/%08d.png' % item['data_idx'], left_hand_mask.cpu().numpy()) + right_hand_mask = (right_hand_mask * 255).to(torch.uint8) + cv.imwrite(output_dir + '/right_sleeve_mask/%08d.png' % item['data_idx'], right_hand_mask.cpu().numpy()) + + rgb_map = output['rgb_map'] + rgb_map.clip_(0., 1.) + rgb_map = (rgb_map * 255).to(torch.uint8).cpu().numpy() + cv.imwrite(output_dir + '/rgb_map/%08d.jpg' % item['data_idx'], rgb_map) + + # 利用 r_hand_mask 和 l_hand_mask,将wo_hand图像中的mask部分覆盖rgb_map + if 'rgb_map' in output_wo_hand and 'full_body_rgb_map' in mask_output and 'hand_only_rgb_map' in mask_output: + rgb_map_wo_hand = output_wo_hand['rgb_map'] + rgb_map_wo_hand.clip_(0., 1.) + rgb_map_wo_hand = (rgb_map_wo_hand * 255).to(torch.uint8).cpu().numpy() + + r_mask = (r_hand_mask>128).cpu().numpy() + l_mask = (l_hand_mask>128).cpu().numpy() + mask = r_mask | l_mask + mask = mask.astype(np.uint8) + # 定义一个结构元素,可以调整其大小以改变膨胀的程度 + kernel = np.ones((5, 5), np.uint8) + # 应用膨胀操作 + mask = cv.dilate(mask, kernel, iterations=3) + mask = mask.astype(np.bool_) + mask = np.expand_dims(mask, axis=2) + # print('mask shape: ', mask.shape) + import ipdb + # ipdb.set_trace() + mix = rgb_map_wo_hand.copy() * mask + rgb_map * ~mask + cv.imwrite(output_dir + '/rgb_map_wo_hand/%08d.jpg' % item['data_idx'], mix) + + if 'torso_map' in output: + os.makedirs(output_dir + '/torso_map', exist_ok = True) + torso_map = output['torso_map'][:, :, 0] + torso_map.clip_(0., 1.) + torso_map = (torso_map * 255).to(torch.uint8) + cv.imwrite(output_dir + '/torso_map/%08d.png' % item['data_idx'], torso_map.cpu().numpy()) + + if 'mask_map' in output: + os.makedirs(output_dir + '/mask_map', exist_ok = True) + mask_map = output['mask_map'][:, :, 0] + mask_map.clip_(0., 1.) + mask_map = (mask_map * 255).to(torch.uint8) + cv.imwrite(output_dir + '/mask_map/%08d.png' % item['data_idx'], mask_map.cpu().numpy()) + + if self.opt['test'].get('save_tex_map', False): + os.makedirs(output_dir + '/cano_tex_map', exist_ok = True) + cano_tex_map = output['cano_tex_map'] + cano_tex_map.clip_(0., 1.) + cano_tex_map = (cano_tex_map * 255).to(torch.uint8) + cv.imwrite(output_dir + '/cano_tex_map/%08d.jpg' % item['data_idx'], cano_tex_map.cpu().numpy()) + + if self.opt['test'].get('save_ply', False): + if item['data_idx'] == 0: + save_gaussians_as_ply(output_dir + '/posed_gaussians/%08d.ply' % item['data_idx'], output['posed_gaussians']) + for k in output['posed_gaussians'].keys(): + if isinstance(output['posed_gaussians'][k], torch.Tensor): + output['posed_gaussians'][k] = output['posed_gaussians'][k].detach().cpu().numpy() + np.savez(output_dir + '/posed_gaussians/%08d.npz' % item['data_idx'], **output['posed_gaussians']) + np.savez(output_dir + ('/posed_params/%08d.npz' % item['data_idx']), + betas=training_dataset.smpl_data['betas'].reshape([-1]).detach().cpu().numpy(), + global_orient=item['global_orient'].reshape([-1]).detach().cpu().numpy(), + transl=item['transl'].reshape([-1]).detach().cpu().numpy(), + body_pose=item['body_pose'].reshape([-1]).detach().cpu().numpy()) + + if log_time: + time_end.record() + torch.cuda.synchronize() + print('Saving images costs %.4f secs' % (time_start.elapsed_time(time_end) / 1000.)) + print('Animating one frame costs %.4f secs' % (time_start_all.elapsed_time(time_end) / 1000.)) + + torch.cuda.empty_cache() + + def save_ckpt(self, path, save_optm = True): + os.makedirs(path, exist_ok = True) + net_dict = { + 'epoch_idx': self.epoch_idx, + 'iter_idx': self.iter_idx, + 'avatar_net': self.avatar_net.state_dict(), + } + print('Saving networks to ', path + '/net.pt') + torch.save(net_dict, path + '/net.pt') + + if save_optm: + optm_dict = { + 'avatar_net': self.optm.state_dict(), + } + print('Saving optimizers to ', path + '/optm.pt') + torch.save(optm_dict, path + '/optm.pt') + + def load_ckpt(self, path, load_optm = True): + print('Loading networks from ', path + '/net.pt') + net_dict = torch.load(path + '/net.pt') + if 'avatar_net' in net_dict: + self.avatar_net.load_state_dict(net_dict['avatar_net']) + else: + print('[WARNING] Cannot find "avatar_net" from the network checkpoint!') + epoch_idx = net_dict['epoch_idx'] + iter_idx = net_dict['iter_idx'] + + if load_optm and os.path.exists(path + '/optm.pt'): + print('Loading optimizers from ', path + '/optm.pt') + optm_dict = torch.load(path + '/optm.pt') + if 'avatar_net' in optm_dict: + self.optm.load_state_dict(optm_dict['avatar_net']) + else: + print('[WARNING] Cannot find "avatar_net" from the optimizer checkpoint!') + + return epoch_idx, iter_idx + + +if __name__ == '__main__': + torch.manual_seed(31359) + np.random.seed(31359) + # torch.autograd.set_detect_anomaly(True) + from argparse import ArgumentParser + + arg_parser = ArgumentParser() + arg_parser.add_argument('-c', '--config_path', type = str, help = 'Configuration file path.') + arg_parser.add_argument('-m', '--mode', type = str, help = 'Running mode.', default = 'train') + args = arg_parser.parse_args() + + config.load_global_opt(args.config_path) + if args.mode is not None: + config.opt['mode'] = args.mode + + trainer = AvatarTrainer(config.opt) + if config.opt['mode'] == 'train': + if not safe_exists(config.opt['train']['net_ckpt_dir'] + '/pretrained') \ + and not safe_exists(config.opt['train']['pretrained_dir'])\ + and not safe_exists(config.opt['train']['prev_ckpt']): + trainer.pretrain() + trainer.train() + elif config.opt['mode'] == 'test': + trainer.test() + else: + raise NotImplementedError('Invalid running mode!') diff --git a/AnimatableGaussians/main_template.py b/AnimatableGaussians/main_template.py new file mode 100644 index 0000000000000000000000000000000000000000..dbdeb25f07e68ec8502492bc9ec769c6730f59a5 --- /dev/null +++ b/AnimatableGaussians/main_template.py @@ -0,0 +1,162 @@ +import os +import torch +import numpy as np +import pytorch3d.ops +import importlib + +from base_trainer import BaseTrainer +import config +from network.template import TemplateNet +from network.lpips import LPIPS +import utils.lr_schedule as lr_schedule +import utils.net_util as net_util +import utils.recon_util as recon_util +from utils.net_util import to_cuda +from utils.obj_io import save_mesh_as_ply + + +class TemplateTrainer(BaseTrainer): + def __init__(self, opt): + super(TemplateTrainer, self).__init__(opt) + self.iter_num = 15_0000 + + def update_config_before_epoch(self, epoch_idx): + self.iter_idx = epoch_idx * self.batch_num + + print('# Optimizable variable number in network: %d' % sum(p.numel() for p in self.network.parameters() if p.requires_grad)) + + def forward_one_pass(self, items): + total_loss = 0 + batch_losses = {} + + """ random sampling """ + if 'nerf_random' in items: + items.update(items['nerf_random']) + render_output = self.network.render(items, depth_guided_sampling = self.opt['train']['depth_guided_sampling']) + + # color loss + if 'rgb_map' in render_output: + color_loss = torch.nn.L1Loss()(render_output['rgb_map'], items['color_gt']) + total_loss += self.loss_weight['color'] * color_loss + batch_losses.update({ + 'color_loss_random': color_loss.item() + }) + + # mask loss + if 'acc_map' in render_output: + mask_loss = torch.nn.L1Loss()(render_output['acc_map'], items['mask_gt']) + total_loss += self.loss_weight['mask'] * mask_loss + batch_losses.update({ + 'mask_loss_random': mask_loss.item() + }) + + # eikonal loss + if 'normal' in render_output: + eikonal_loss = ((torch.linalg.norm(render_output['normal'], dim = -1) - 1.) ** 2).mean() + total_loss += self.loss_weight['eikonal'] * eikonal_loss + batch_losses.update({ + 'eikonal_loss': eikonal_loss.item() + }) + + self.zero_grad() + total_loss.backward() + self.step() + + return total_loss, batch_losses + + def run(self): + dataset_module = self.opt['train'].get('dataset', 'MvRgbDatasetAvatarReX') + MvRgbDataset = importlib.import_module('dataset.dataset_mv_rgb').__getattribute__(dataset_module) + self.set_dataset(MvRgbDataset(**self.opt['train']['data'])) + self.set_network(TemplateNet(self.opt['model']).to(config.device)) + self.set_net_dict({ + 'network': self.network + }) + self.set_optm_dict({ + 'network': torch.optim.Adam(self.network.parameters(), lr = 1e-3) + }) + self.set_lr_schedule_dict({ + 'network': lr_schedule.get_learning_rate_schedules(**self.opt['train']['lr']['network']) + }) + self.set_update_keys(['network']) + if self.opt['train'].get('finetune_hand', False): + print('# Finetune hand') + for n, p in self.network.named_parameters(): + if not (n.startswith('left_hand') or n.startswith('right_hand')): + p.requires_grad_(False) + + if 'lpips' in self.opt['train']['loss_weight']: + self.lpips = LPIPS(net = 'vgg').to(config.device) + for p in self.lpips.parameters(): + p.requires_grad = False + + self.train() + + # output final cano geometry + items = to_cuda(self.dataset.getitem(0, training = False), add_batch = True) + with torch.no_grad(): + self.network.eval() + vertices, faces, normals = self.test_geometry(items, space = 'cano', testing_res = (256, 256, 128)) + save_mesh_as_ply(self.opt['train']['data']['data_dir'] + '/template.ply', + vertices, faces, normals) + + def test_geometry(self, items, space = 'live', testing_res = (128, 128, 128)): + if space == 'live': + bounds = items['live_bounds'][0] + else: + bounds = items['cano_bounds'][0] + vol_pts = net_util.generate_volume_points(bounds, testing_res) + chunk_size = 256 * 256 * 4 + # chunk_size = 256 * 32 + sdf_list = [] + for i in range(0, vol_pts.shape[0], chunk_size): + vol_pts_chunk = vol_pts[i: i + chunk_size][None] + sdf_chunk = torch.zeros(vol_pts_chunk.shape[1]).to(vol_pts_chunk) + if space == 'live': + cano_pts_chunk, near_flag = self.network.transform_live2cano(vol_pts_chunk, items, near_thres = 0.1) + else: + cano_pts_chunk = vol_pts_chunk + dists, _, _ = pytorch3d.ops.knn_points(cano_pts_chunk, items['cano_smpl_v'], K = 1) + near_flag = dists[:, :, 0] < (0.1**2) # (1, N) + near_flag.fill_(True) + if (~near_flag).sum() > 0: + sdf_chunk[~near_flag[0]] = self.network.cano_weight_volume.forward_sdf(cano_pts_chunk[~near_flag][None])[0, :, 0] + if near_flag.sum() > 0: + ret = self.network.forward_cano_radiance_field(cano_pts_chunk[near_flag][None], None, items) + if self.network.with_hand: + self.network.fuse_hands(ret, vol_pts_chunk[near_flag][None], None, items, space) + sdf_chunk[near_flag[0]] = ret['sdf'][0, :, 0] + # sdf_chunk = self.network.forward_cano_radiance_field(cano_pts_chunk, None, items['pose'])['sdf'] + sdf_list.append(sdf_chunk) + sdf_list = torch.cat(sdf_list, 0) + vertices, faces, normals = recon_util.recon_mesh(sdf_list, testing_res, bounds, iso_value = 0.) + return vertices, faces, normals + + @torch.no_grad() + def mini_test(self): + self.network.eval() + + item = self.dataset.getitem(0, training = False) + items = to_cuda(item, add_batch = True) + vertices, faces, normals = self.test_geometry(items, space = 'cano', testing_res = (256, 256, 128)) + output_dir = self.opt['train']['net_ckpt_dir'] + '/eval' + os.makedirs(output_dir, exist_ok = True) + save_mesh_as_ply(output_dir + '/batch_%d.ply' % self.iter_idx, vertices, faces, normals) + + self.network.train() + + +if __name__ == '__main__': + torch.manual_seed(31359) + np.random.seed(31359) + + from argparse import ArgumentParser + + arg_parser = ArgumentParser() + arg_parser.add_argument('-c', '--config_path', type = str, help = 'Configuration file path.') + args = arg_parser.parse_args() + + config.load_global_opt(args.config_path) + + trainer = TemplateTrainer(config.opt) + trainer.run() diff --git a/AnimatableGaussians/network/__pycache__/avatar.cpython-310.pyc b/AnimatableGaussians/network/__pycache__/avatar.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f3d37f4f92bba4be52316c4867a182f11a8bf5a5 Binary files /dev/null and b/AnimatableGaussians/network/__pycache__/avatar.cpython-310.pyc differ diff --git a/AnimatableGaussians/network/__pycache__/avatar.cpython-38.pyc b/AnimatableGaussians/network/__pycache__/avatar.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..26435cfebb8baac65fd8cd5155c1ec37c981399f Binary files /dev/null and b/AnimatableGaussians/network/__pycache__/avatar.cpython-38.pyc differ diff --git a/AnimatableGaussians/network/__pycache__/volume.cpython-310.pyc b/AnimatableGaussians/network/__pycache__/volume.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..007e8ff10fdafe9faeac62dfd1d8b546cc99b8d5 Binary files /dev/null and b/AnimatableGaussians/network/__pycache__/volume.cpython-310.pyc differ diff --git a/AnimatableGaussians/network/__pycache__/volume.cpython-38.pyc b/AnimatableGaussians/network/__pycache__/volume.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fb2e5b50281338765cf4509fa15048b5a0f16730 Binary files /dev/null and b/AnimatableGaussians/network/__pycache__/volume.cpython-38.pyc differ diff --git a/AnimatableGaussians/network/avatar.py b/AnimatableGaussians/network/avatar.py new file mode 100644 index 0000000000000000000000000000000000000000..c394b706873e69bad8733d0b82dd7c2bacfaf5a1 --- /dev/null +++ b/AnimatableGaussians/network/avatar.py @@ -0,0 +1,497 @@ +import platform +from turtle import left, right +from networkx import full_join +import torch +import torch.nn as nn +import torch.nn.functional as F +import numpy as np +import pytorch3d.ops +import pytorch3d.transforms +import cv2 as cv + +import AnimatableGaussians.config as config +from AnimatableGaussians.network.styleunet.dual_styleunet import DualStyleUNet +from AnimatableGaussians.gaussians.gaussian_model import GaussianModel +from AnimatableGaussians.gaussians.gaussian_renderer import render3 + + +class AvatarNet(nn.Module): + def __init__(self, opt): + super(AvatarNet, self).__init__() + self.opt = opt + + self.random_style = opt.get('random_style', False) + self.with_viewdirs = opt.get('with_viewdirs', True) + + # init canonical gausssian model + self.max_sh_degree = 0 + self.cano_gaussian_model = GaussianModel(sh_degree = self.max_sh_degree) + cano_smpl_map = cv.imread(config.opt['train']['data']['data_dir'] + '/smpl_pos_map/cano_smpl_pos_map.exr', cv.IMREAD_UNCHANGED) + self.cano_smpl_map = torch.from_numpy(cano_smpl_map).to(torch.float32).to(config.device) + self.cano_smpl_mask = torch.linalg.norm(self.cano_smpl_map, dim = -1) > 0. + self.init_points = self.cano_smpl_map[self.cano_smpl_mask] + self.lbs = torch.from_numpy(np.load(config.opt['train']['data']['data_dir'] + '/smpl_pos_map/init_pts_lbs.npy')).to(torch.float32).to(config.device) + self.cano_gaussian_model.create_from_pcd(self.init_points, torch.rand_like(self.init_points), spatial_lr_scale = 2.5) + + self.color_net = DualStyleUNet(inp_size = 512, inp_ch = 3, out_ch = 3, out_size = 1024, style_dim = 512, n_mlp = 2) + self.position_net = DualStyleUNet(inp_size = 512, inp_ch = 3, out_ch = 3, out_size = 1024, style_dim = 512, n_mlp = 2) + self.other_net = DualStyleUNet(inp_size = 512, inp_ch = 3, out_ch = 8, out_size = 1024, style_dim = 512, n_mlp = 2) + + self.color_style = torch.ones([1, self.color_net.style_dim], dtype=torch.float32, device=config.device) / np.sqrt(self.color_net.style_dim) + self.position_style = torch.ones([1, self.position_net.style_dim], dtype=torch.float32, device=config.device) / np.sqrt(self.position_net.style_dim) + self.other_style = torch.ones([1, self.other_net.style_dim], dtype=torch.float32, device=config.device) / np.sqrt(self.other_net.style_dim) + + if self.with_viewdirs: + cano_nml_map = cv.imread(config.opt['train']['data']['data_dir'] + '/smpl_pos_map/cano_smpl_nml_map.exr', cv.IMREAD_UNCHANGED) + self.cano_nml_map = torch.from_numpy(cano_nml_map).to(torch.float32).to(config.device) + self.cano_nmls = self.cano_nml_map[self.cano_smpl_mask] + self.viewdir_net = nn.Sequential( + nn.Conv2d(1, 64, 4, 2, 1), + nn.LeakyReLU(0.2, inplace = True), + nn.Conv2d(64, 128, 4, 2, 1) + ) + + def generate_mean_hands(self): + # print('# Generating mean hands ...') + import glob + # get hand mask + lbs_argmax = self.lbs.argmax(1) + self.hand_mask = lbs_argmax == 20 + self.hand_mask = torch.logical_or(self.hand_mask, lbs_argmax == 21) + self.hand_mask = torch.logical_or(self.hand_mask, lbs_argmax >= 25) + + pose_map_paths = sorted(glob.glob(config.opt['train']['data']['data_dir'] + '/smpl_pos_map/%08d.exr' % config.opt['test']['fix_hand_id'])) + smpl_pos_map = cv.imread(pose_map_paths[0], cv.IMREAD_UNCHANGED) + pos_map_size = smpl_pos_map.shape[1] // 2 + smpl_pos_map = np.concatenate([smpl_pos_map[:, :pos_map_size], smpl_pos_map[:, pos_map_size:]], 2) + smpl_pos_map = smpl_pos_map.transpose((2, 0, 1)) + pose_map = torch.from_numpy(smpl_pos_map).to(torch.float32).to(config.device) + pose_map = pose_map[:3] + + cano_pts = self.get_positions(pose_map) + opacity, scales, rotations = self.get_others(pose_map) + colors, color_map = self.get_colors(pose_map) + + self.hand_positions = cano_pts#[self.hand_mask] + self.hand_opacity = opacity#[self.hand_mask] + self.hand_scales = scales#[self.hand_mask] + self.hand_rotations = rotations#[self.hand_mask] + self.hand_colors = colors#[self.hand_mask] + + # # debug + # hand_pts = trimesh.PointCloud(self.hand_positions.detach().cpu().numpy()) + # hand_pts.export('./debug/hand_template.obj') + # exit(1) + + def transform_cano2live(self, gaussian_vals, items): + pt_mats = torch.einsum('nj,jxy->nxy', self.lbs, items['cano2live_jnt_mats']) + gaussian_vals['positions'] = torch.einsum('nxy,ny->nx', pt_mats[..., :3, :3], gaussian_vals['positions']) + pt_mats[..., :3, 3] + rot_mats = pytorch3d.transforms.quaternion_to_matrix(gaussian_vals['rotations']) + rot_mats = torch.einsum('nxy,nyz->nxz', pt_mats[..., :3, :3], rot_mats) + gaussian_vals['rotations'] = pytorch3d.transforms.matrix_to_quaternion(rot_mats) + + return gaussian_vals + + def get_positions(self, pose_map, return_map = False): + position_map, _ = self.position_net([self.position_style], pose_map[None], randomize_noise = False) + front_position_map, back_position_map = torch.split(position_map, [3, 3], 1) + position_map = torch.cat([front_position_map, back_position_map], 3)[0].permute(1, 2, 0) + delta_position = 0.05 * position_map[self.cano_smpl_mask] + # delta_position = position_map[self.cano_smpl_mask] + + positions = delta_position + self.cano_gaussian_model.get_xyz + if return_map: + return positions, position_map + else: + return positions + + def get_others(self, pose_map): + other_map, _ = self.other_net([self.other_style], pose_map[None], randomize_noise = False) + front_map, back_map = torch.split(other_map, [8, 8], 1) + other_map = torch.cat([front_map, back_map], 3)[0].permute(1, 2, 0) + others = other_map[self.cano_smpl_mask] # (N, 8) + opacity, scales, rotations = torch.split(others, [1, 3, 4], 1) + opacity = self.cano_gaussian_model.opacity_activation(opacity + self.cano_gaussian_model.get_opacity_raw) + scales = self.cano_gaussian_model.scaling_activation(scales + self.cano_gaussian_model.get_scaling_raw) + rotations = self.cano_gaussian_model.rotation_activation(rotations + self.cano_gaussian_model.get_rotation_raw) + + return opacity, scales, rotations + + def get_colors(self, pose_map, front_viewdirs = None, back_viewdirs = None): + color_style = torch.rand_like(self.color_style) if self.random_style and self.training else self.color_style + color_map, _ = self.color_net([color_style], pose_map[None], randomize_noise = False, view_feature1 = front_viewdirs, view_feature2 = back_viewdirs) + front_color_map, back_color_map = torch.split(color_map, [3, 3], 1) + color_map = torch.cat([front_color_map, back_color_map], 3)[0].permute(1, 2, 0) + colors = color_map[self.cano_smpl_mask] + return colors, color_map + + def get_viewdir_feat(self, items): + with torch.no_grad(): + pt_mats = torch.einsum('nj,jxy->nxy', self.lbs, items['cano2live_jnt_mats']) + live_pts = torch.einsum('nxy,ny->nx', pt_mats[..., :3, :3], self.init_points) + pt_mats[..., :3, 3] + live_nmls = torch.einsum('nxy,ny->nx', pt_mats[..., :3, :3], self.cano_nmls) + cam_pos = -torch.matmul(torch.linalg.inv(items['extr'][:3, :3]), items['extr'][:3, 3]) + viewdirs = F.normalize(cam_pos[None] - live_pts, dim = -1, eps = 1e-3) + if self.training: + viewdirs += torch.randn(*viewdirs.shape).to(viewdirs) * 0.1 + viewdirs = F.normalize(viewdirs, dim = -1, eps = 1e-3) + viewdirs = (live_nmls * viewdirs).sum(-1) + + viewdirs_map = torch.zeros(*self.cano_nml_map.shape[:2]).to(viewdirs) + viewdirs_map[self.cano_smpl_mask] = viewdirs + + viewdirs_map = viewdirs_map[None, None] + viewdirs_map = F.interpolate(viewdirs_map, None, 0.5, 'nearest') + front_viewdirs, back_viewdirs = torch.split(viewdirs_map, [512, 512], -1) + + front_viewdirs = self.opt.get('weight_viewdirs', 1.) * self.viewdir_net(front_viewdirs) + back_viewdirs = self.opt.get('weight_viewdirs', 1.) * self.viewdir_net(back_viewdirs) + return front_viewdirs, back_viewdirs + + def get_pose_map(self, items): + pt_mats = torch.einsum('nj,jxy->nxy', self.lbs, items['cano2live_jnt_mats_woRoot']) + live_pts = torch.einsum('nxy,ny->nx', pt_mats[..., :3, :3], self.init_points) + pt_mats[..., :3, 3] + live_pos_map = torch.zeros_like(self.cano_smpl_map) + live_pos_map[self.cano_smpl_mask] = live_pts + live_pos_map = F.interpolate(live_pos_map.permute(2, 0, 1)[None], None, [0.5, 0.5], mode = 'nearest')[0] + live_pos_map = torch.cat(torch.split(live_pos_map, [512, 512], 2), 0) + items.update({ + 'smpl_pos_map': live_pos_map + }) + return live_pos_map + + def render(self, items, bg_color = (0., 0., 0.), use_pca = False, use_vae = False): + """ + Note that no batch index in items. + """ + bg_color = torch.from_numpy(np.asarray(bg_color)).to(torch.float32).to(config.device) + pose_map = items['smpl_pos_map'][:3] + assert not (use_pca and use_vae), "Cannot use both PCA and VAE!" + if use_pca: + pose_map = items['smpl_pos_map_pca'][:3] + if use_vae: + pose_map = items['smpl_pos_map_vae'][:3] + + cano_pts, pos_map = self.get_positions(pose_map, return_map = True) + opacity, scales, rotations = self.get_others(pose_map) + # if not self.training: + # scales = torch.clip(scales, 0., 0.03) + if self.with_viewdirs: + front_viewdirs, back_viewdirs = self.get_viewdir_feat(items) + else: + front_viewdirs, back_viewdirs = None, None + colors, color_map = self.get_colors(pose_map, front_viewdirs, back_viewdirs) + + if not self.training and config.opt['test'].get('fix_hand', False) and config.opt['mode'] == 'test': + # print('# fuse hands ...') + import ipdb + import AnimatableGaussians.utils.geo_util as geo_util + cano_xyz = self.init_points + wl = torch.sigmoid(2.5 * (geo_util.normalize_vert_bbox(items['left_cano_mano_v'], attris = cano_xyz, dim = 0, per_axis = True)[..., 0:1] + 2.0)) + wr = torch.sigmoid(-2.5 * (geo_util.normalize_vert_bbox(items['right_cano_mano_v'], attris = cano_xyz, dim = 0, per_axis = True)[..., 0:1] - 2.0)) + wl[cano_xyz[..., 1] < items['cano_smpl_center'][1]] = 0. + wr[cano_xyz[..., 1] < items['cano_smpl_center'][1]] = 0. + + s = torch.maximum(wl + wr, torch.ones_like(wl)) + wl, wr = wl / s, wr / s + + w = wl + wr + # ipdb.set_trace() + cano_pts = w * self.hand_positions + (1.0 - w) * cano_pts + # new_opacity = torch.zeros_like(opacity) + opacity = w * self.hand_opacity + (1.0 - w) * opacity + # opacity = w * self.hand_opacity * 0 + (1.0 - w) * opacity + # opacity = opacity * 0 + scales = w * self.hand_scales + (1.0 - w) * scales + rotations = w * self.hand_rotations + (1.0 - w) * rotations + # colors = w * self.hand_colors + (1.0 - w) * colors + # new_hand_colors = torch.ones_like(colors) * 0.5 + # colors = w * new_hand_colors + (1.0 - w) * colors + + gaussian_vals = { + 'positions': cano_pts, + 'opacity': opacity, + 'scales': scales, + 'rotations': rotations, + 'colors': colors, + 'max_sh_degree': self.max_sh_degree + } + + # ipdb.set_trace() + + + nonrigid_offset = gaussian_vals['positions'] - self.init_points + + gaussian_vals = self.transform_cano2live(gaussian_vals, items) + + render_ret = render3( + gaussian_vals, + bg_color, + items['extr'], + items['intr'], + items['img_w'], + items['img_h'] + ) + rgb_map = render_ret['render'].permute(1, 2, 0) + mask_map = render_ret['mask'].permute(1, 2, 0) + + torso_flag = 1 - (self.lbs[:, 12] + self.lbs[:, 15] + self.lbs[:, 22] + self.lbs[:, 23] + self.lbs[:, 24]) + torso_weight = torch.stack([torso_flag, torso_flag, torso_flag], dim=-1) + orig_color, gaussian_vals['colors'] = gaussian_vals['colors'], torso_weight + render_ret = render3( + gaussian_vals, + torch.zeros_like(bg_color), + items['extr'], + items['intr'], + items['img_w'], + items['img_h'] + ) + torso_map = render_ret['render'].permute(1, 2, 0) + gaussian_vals['colors'] = orig_color + + ret = { + 'rgb_map': rgb_map, + 'torso_map': torso_map, + 'mask_map': mask_map, + 'offset': nonrigid_offset, + 'pos_map': pos_map + } + + if not self.training: + ret.update({ + 'cano_tex_map': color_map, + 'posed_gaussians': gaussian_vals + }) + + return ret + + def render_wo_hand(self, items, bg_color = (0., 0., 0.), use_pca = False, use_vae = False): + """ + Note that no batch index in items. + """ + bg_color = torch.from_numpy(np.asarray(bg_color)).to(torch.float32).to(config.device) + pose_map = items['smpl_pos_map'][:3] + assert not (use_pca and use_vae), "Cannot use both PCA and VAE!" + if use_pca: + pose_map = items['smpl_pos_map_pca'][:3] + if use_vae: + pose_map = items['smpl_pos_map_vae'][:3] + + cano_pts, pos_map = self.get_positions(pose_map, return_map = True) + opacity, scales, rotations = self.get_others(pose_map) + # if not self.training: + # scales = torch.clip(scales, 0., 0.03) + if self.with_viewdirs: + front_viewdirs, back_viewdirs = self.get_viewdir_feat(items) + else: + front_viewdirs, back_viewdirs = None, None + colors, color_map = self.get_colors(pose_map, front_viewdirs, back_viewdirs) + + if not self.training and config.opt['test'].get('fix_hand', False) and config.opt['mode'] == 'test': + import AnimatableGaussians.utils.geo_util as geo_util + cano_xyz = self.init_points + wl = torch.sigmoid(2.5 * (geo_util.normalize_vert_bbox(items['left_cano_mano_v'], attris = cano_xyz, dim = 0, per_axis = True)[..., 0:1] + 2.0)) + wr = torch.sigmoid(-2.5 * (geo_util.normalize_vert_bbox(items['right_cano_mano_v'], attris = cano_xyz, dim = 0, per_axis = True)[..., 0:1] - 2.0)) + wl[cano_xyz[..., 1] < items['cano_smpl_center'][1]] = 0. + wr[cano_xyz[..., 1] < items['cano_smpl_center'][1]] = 0. + + s = torch.maximum(wl + wr, torch.ones_like(wl)) + wl, wr = wl / s, wr / s + + w = wl + wr + # ipdb.set_trace() + cano_pts = w * self.hand_positions + (1.0 - w) * cano_pts + # new_opacity = torch.zeros_like(opacity) + # opacity = w * self.hand_opacity + (1.0 - w) * opacity + opacity = w * self.hand_opacity * 0 + (1.0 - w) * opacity + # opacity = opacity * 0 + scales = w * self.hand_scales + (1.0 - w) * scales + rotations = w * self.hand_rotations + (1.0 - w) * rotations + # colors = w * self.hand_colors + (1.0 - w) * colors + # new_hand_colors = torch.ones_like(colors) * 0.5 + # colors = w * new_hand_colors + (1.0 - w) * colors + + gaussian_vals = { + 'positions': cano_pts, + 'opacity': opacity, + 'scales': scales, + 'rotations': rotations, + 'colors': colors, + 'max_sh_degree': self.max_sh_degree + } + + # ipdb.set_trace() + + + nonrigid_offset = gaussian_vals['positions'] - self.init_points + + gaussian_vals = self.transform_cano2live(gaussian_vals, items) + + render_ret = render3( + gaussian_vals, + bg_color, + items['extr'], + items['intr'], + items['img_w'], + items['img_h'] + ) + rgb_map = render_ret['render'].permute(1, 2, 0) + + ret = { + 'rgb_map': rgb_map, + } + + return ret + + def render_mask(self, items, bg_color = (0., 0., 0.), use_pca = False, use_vae = False): + """ + Note that no batch index in items. + """ + bg_color = torch.from_numpy(np.asarray(bg_color)).to(torch.float32).to(config.device) + pose_map = items['smpl_pos_map'][:3] + assert not (use_pca and use_vae), "Cannot use both PCA and VAE!" + if use_pca: + pose_map = items['smpl_pos_map_pca'][:3] + if use_vae: + pose_map = items['smpl_pos_map_vae'][:3] + + cano_pts, pos_map = self.get_positions(pose_map, return_map = True) + opacity, scales, rotations = self.get_others(pose_map) + # if not self.training: + # scales = torch.clip(scales, 0., 0.03) + if self.with_viewdirs: + front_viewdirs, back_viewdirs = self.get_viewdir_feat(items) + else: + front_viewdirs, back_viewdirs = None, None + colors, color_map = self.get_colors(pose_map, front_viewdirs, back_viewdirs) + + if not self.training and config.opt['test'].get('fix_hand', False) and config.opt['mode'] == 'test': + # print('# fuse hands ...') + import ipdb + import AnimatableGaussians.utils.geo_util as geo_util + cano_xyz = self.init_points + wl = torch.sigmoid(2.5 * (geo_util.normalize_vert_bbox(items['left_cano_mano_v'], attris = cano_xyz, dim = 0, per_axis = True)[..., 0:1] + 2.0)) + wr = torch.sigmoid(-2.5 * (geo_util.normalize_vert_bbox(items['right_cano_mano_v'], attris = cano_xyz, dim = 0, per_axis = True)[..., 0:1] - 2.0)) + wl[cano_xyz[..., 1] < items['cano_smpl_center'][1]] = 0. + wr[cano_xyz[..., 1] < items['cano_smpl_center'][1]] = 0. + + s = torch.maximum(wl + wr, torch.ones_like(wl)) + wl, wr = wl / s, wr / s + + w = wl + wr + # ipdb.set_trace() + cano_pts = w * self.hand_positions + (1.0 - w) * cano_pts + # opacity = w * self.hand_opacity + (1.0 - w) * opacity + body_opacity = torch.zeros_like(opacity) + no_body_opacity = w * self.hand_opacity * 0 + (1.0 - w) * body_opacity + only_hand_opacity = w * self.hand_opacity + (1.0 - w) * body_opacity + left_hand_opacity = wl * self.hand_opacity + (1.0 - wl) * body_opacity + right_hand_opacity = wr * self.hand_opacity + (1.0 - wr) * body_opacity + opacity = w * self.hand_opacity + (1.0 - w) * opacity + + # opacity = opacity * 0 + scales = w * self.hand_scales + (1.0 - w) * scales + rotations = w * self.hand_rotations + (1.0 - w) * rotations + # colors = w * self.hand_colors + (1.0 - w) * colors + + r_hand_color = torch.ones_like(colors) * torch.tensor([1., 0., 0.]).to(config.device) + l_hand_color = torch.ones_like(colors) * torch.tensor([0., 0., 1.]).to(config.device) + body_color = torch.ones_like(colors) * torch.tensor([0, 1, 0]).to(config.device) + full_colors = wr * r_hand_color + wl * l_hand_color + (1.0 - w) * body_color + + full_gaussian_vals = { + 'positions': cano_pts, + 'opacity': opacity, + 'scales': scales, + 'rotations': rotations, + 'colors': full_colors, + 'max_sh_degree': self.max_sh_degree + } + + hand_only_gaussian_vals = { + 'positions': cano_pts, + 'opacity': only_hand_opacity, + 'scales': scales, + 'rotations': rotations, + 'colors': full_colors, + 'max_sh_degree': self.max_sh_degree + } + + left_hand_gaussian_vals = { + 'positions': cano_pts, + 'opacity': left_hand_opacity, + 'scales': scales, + 'rotations': rotations, + 'colors': l_hand_color, + 'max_sh_degree': self.max_sh_degree + } + + right_hand_gaussian_vals = { + 'positions': cano_pts, + 'opacity': right_hand_opacity, + 'scales': scales, + 'rotations': rotations, + 'colors': r_hand_color, + 'max_sh_degree': self.max_sh_degree + } + + full_gaussian_vals = self.transform_cano2live(full_gaussian_vals, items) + hand_only_gaussian_vals = self.transform_cano2live(hand_only_gaussian_vals, items) + left_hand_gaussian_vals = self.transform_cano2live(left_hand_gaussian_vals, items) + right_hand_gaussian_vals = self.transform_cano2live(right_hand_gaussian_vals, items) + + + full_render_ret = render3( + full_gaussian_vals, + bg_color, + items['extr'], + items['intr'], + items['img_w'], + items['img_h'] + ) + + hand_only_render_ret = render3( + hand_only_gaussian_vals, + bg_color, + items['extr'], + items['intr'], + items['img_w'], + items['img_h'] + ) + + left_hand_render_ret = render3( + left_hand_gaussian_vals, + bg_color, + items['extr'], + items['intr'], + items['img_w'], + items['img_h'] + ) + + right_hand_render_ret = render3( + right_hand_gaussian_vals, + bg_color, + items['extr'], + items['intr'], + items['img_w'], + items['img_h'] + ) + + + full_rgb_map = full_render_ret['render'].permute(1, 2, 0) + hand_only_rgb_map = hand_only_render_ret['render'].permute(1, 2, 0) + left_hand_rgb_map = left_hand_render_ret['render'].permute(1, 2, 0) + right_hand_rgb_map = right_hand_render_ret['render'].permute(1, 2, 0) + + + + + ret = { + 'full_body_rgb_map': full_rgb_map, + 'hand_only_rgb_map': hand_only_rgb_map, + 'left_hand_rgb_map': left_hand_rgb_map, + 'right_hand_rgb_map': right_hand_rgb_map, + } + + return ret + diff --git a/AnimatableGaussians/network/density.py b/AnimatableGaussians/network/density.py new file mode 100644 index 0000000000000000000000000000000000000000..b60f520050bb9fad8456fae414a14dbf88609001 --- /dev/null +++ b/AnimatableGaussians/network/density.py @@ -0,0 +1,53 @@ +""" +Borrowed from https://github.com/lioryariv/volsdf/blob/main/code/model/density.py +""" + +import torch.nn as nn +import torch + +import config + + +class Density(nn.Module): + def __init__(self, params_init={}): + super().__init__() + for p in params_init: + param = nn.Parameter(torch.tensor(params_init[p])) + setattr(self, p, param) + + def forward(self, sdf, beta=None): + return self.density_func(sdf, beta=beta) + + +class LaplaceDensity(Density): # alpha * Laplace(loc=0, scale=beta).cdf(-sdf) + def __init__(self, params_init={}, beta_min=0.0001): + super().__init__(params_init=params_init) + self.beta_min = torch.tensor(beta_min).to(config.device) + + def density_func(self, sdf, beta=None): + if beta is None: + beta = self.get_beta() + + alpha = 1 / beta + return alpha * (0.5 + 0.5 * sdf.sign() * torch.expm1(-sdf.abs() / beta)) + + def get_beta(self): + beta = self.beta.abs() + self.beta_min + return beta + + +class AbsDensity(Density): # like NeRF++ + def density_func(self, sdf, beta=None): + return torch.abs(sdf) + + +class SimpleDensity(Density): # like NeRF + def __init__(self, params_init={}, noise_std=1.0): + super().__init__(params_init=params_init) + self.noise_std = noise_std + + def density_func(self, sdf, beta=None): + if self.training and self.noise_std > 0.0: + noise = torch.randn(sdf.shape).cuda() * self.noise_std + sdf = sdf + noise + return torch.relu(sdf) diff --git a/AnimatableGaussians/network/hand_avatar.py b/AnimatableGaussians/network/hand_avatar.py new file mode 100644 index 0000000000000000000000000000000000000000..ec6d6241f465d664f9fe977650dc27d973856744 --- /dev/null +++ b/AnimatableGaussians/network/hand_avatar.py @@ -0,0 +1,36 @@ +import torch +import torch.nn as nn +from pytorch3d.transforms import axis_angle_to_quaternion + +from network.mlp import MLPLinear +from utils.embedder import get_embedder + + +class HandAvatar(nn.Module): + def __init__(self, + multires = 4, + view_multires = -1, + pose_dim = 15*4): + super(HandAvatar, self).__init__() + self.pos_embedder, self.pos_dim = get_embedder(multires, 3) + if view_multires == -1: + self.view_embedder, self.view_dim = None, 0 + else: + self.view_embedder, self.view_dim = get_embedder(view_multires, 3) + self.pose_dim = pose_dim + self.tex_mlp = MLPLinear( + in_channels = self.pos_dim + 1 + self.view_dim + pose_dim, + inter_channels = [64, 64, 64, 64, 64], + out_channels = 3, + last_op = nn.Sigmoid() + ) + + def forward(self, cano_xyz, sdf, view_dir, hand_pose): + batch_size, n_pts = cano_xyz.shape[:2] + in_feat = torch.cat([self.pos_embedder(cano_xyz), sdf], -1) + hand_pose = axis_angle_to_quaternion(hand_pose.reshape(batch_size, -1, 3)).reshape(batch_size, -1) + if self.view_embedder is not None: + in_feat = torch.cat([in_feat, self.view_embedder(view_dir)], -1) + in_feat = torch.cat([in_feat, hand_pose[:, None].expand(-1, n_pts, -1)], -1) + color = self.tex_mlp(in_feat) + return color diff --git a/AnimatableGaussians/network/lpips/LICENSE b/AnimatableGaussians/network/lpips/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..335c81aaeea4213f6ed9a7785b767c9690def588 --- /dev/null +++ b/AnimatableGaussians/network/lpips/LICENSE @@ -0,0 +1,23 @@ +Copyright (c) 2018, Richard Zhang, Phillip Isola, Alexei A. Efros, Eli Shechtman, Oliver Wang +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/AnimatableGaussians/network/lpips/__init__.py b/AnimatableGaussians/network/lpips/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..f467a47be82ce0f70f99052192092fda096fc9bd --- /dev/null +++ b/AnimatableGaussians/network/lpips/__init__.py @@ -0,0 +1,176 @@ + +from __future__ import absolute_import +from __future__ import division +from __future__ import print_function + +import numpy as np +import torch + +from AnimatableGaussians.network.lpips.lpips import * + +# class PerceptualLoss(torch.nn.Module): +# def __init__(self, model='lpips', net='alex', spatial=False, use_gpu=False, gpu_ids=[0], version='0.1'): # VGG using our perceptually-learned weights (LPIPS metric) +# # def __init__(self, model='net', net='vgg', use_gpu=True): # "default" way of using VGG as a perceptual loss +# super(PerceptualLoss, self).__init__() +# print('Setting up Perceptual loss...') +# self.use_gpu = use_gpu +# self.spatial = spatial +# self.gpu_ids = gpu_ids +# self.model = dist_model.DistModel() +# self.model.initialize(model=model, net=net, use_gpu=use_gpu, spatial=self.spatial, gpu_ids=gpu_ids, version=version) +# print('...[%s] initialized'%self.model.name()) +# print('...Done') + +# def forward(self, pred, target, normalize=False): +# """ +# Pred and target are Variables. +# If normalize is True, assumes the images are between [0,1] and then scales them between [-1,+1] +# If normalize is False, assumes the images are already between [-1,+1] + +# Inputs pred and target are Nx3xHxW +# Output pytorch Variable N long +# """ + +# if normalize: +# target = 2 * target - 1 +# pred = 2 * pred - 1 + +# return self.model.forward(target, pred) + +def normalize_tensor(in_feat,eps=1e-10): + norm_factor = torch.sqrt(torch.sum(in_feat**2,dim=1,keepdim=True)+eps) + return in_feat/(norm_factor+eps) + +def l2(p0, p1, range=255.): + return .5*np.mean((p0 / range - p1 / range)**2) + +def psnr(p0, p1, peak=255.): + return 10*np.log10(peak**2/np.mean((1.*p0-1.*p1)**2)) + +def dssim(p0, p1, range=255.): + from skimage.measure import compare_ssim + return (1 - compare_ssim(p0, p1, data_range=range, multichannel=True)) / 2. + +def rgb2lab(in_img,mean_cent=False): + from skimage import color + img_lab = color.rgb2lab(in_img) + if(mean_cent): + img_lab[:,:,0] = img_lab[:,:,0]-50 + return img_lab + +def tensor2np(tensor_obj): + # change dimension of a tensor object into a numpy array + return tensor_obj[0].cpu().float().numpy().transpose((1,2,0)) + +def np2tensor(np_obj): + # change dimenion of np array into tensor array + return torch.Tensor(np_obj[:, :, :, np.newaxis].transpose((3, 2, 0, 1))) + +def tensor2tensorlab(image_tensor,to_norm=True,mc_only=False): + # image tensor to lab tensor + from skimage import color + + img = tensor2im(image_tensor) + img_lab = color.rgb2lab(img) + if(mc_only): + img_lab[:,:,0] = img_lab[:,:,0]-50 + if(to_norm and not mc_only): + img_lab[:,:,0] = img_lab[:,:,0]-50 + img_lab = img_lab/100. + + return np2tensor(img_lab) + +def tensorlab2tensor(lab_tensor,return_inbnd=False): + from skimage import color + import warnings + warnings.filterwarnings("ignore") + + lab = tensor2np(lab_tensor)*100. + lab[:,:,0] = lab[:,:,0]+50 + + rgb_back = 255.*np.clip(color.lab2rgb(lab.astype('float')),0,1) + if(return_inbnd): + # convert back to lab, see if we match + lab_back = color.rgb2lab(rgb_back.astype('uint8')) + mask = 1.*np.isclose(lab_back,lab,atol=2.) + mask = np2tensor(np.prod(mask,axis=2)[:,:,np.newaxis]) + return (im2tensor(rgb_back),mask) + else: + return im2tensor(rgb_back) + +def load_image(path): + if(path[-3:] == 'dng'): + import rawpy + with rawpy.imread(path) as raw: + img = raw.postprocess() + elif(path[-3:]=='bmp' or path[-3:]=='jpg' or path[-3:]=='png' or path[-4:]=='jpeg'): + import cv2 + return cv2.imread(path)[:,:,::-1] + else: + img = (255*plt.imread(path)[:,:,:3]).astype('uint8') + + return img + +def rgb2lab(input): + from skimage import color + return color.rgb2lab(input / 255.) + +def tensor2im(image_tensor, imtype=np.uint8, cent=1., factor=255./2.): + image_numpy = image_tensor[0].cpu().float().numpy() + image_numpy = (np.transpose(image_numpy, (1, 2, 0)) + cent) * factor + return image_numpy.astype(imtype) + +def im2tensor(image, imtype=np.uint8, cent=1., factor=255./2.): + return torch.Tensor((image / factor - cent) + [:, :, :, np.newaxis].transpose((3, 2, 0, 1))) + +def tensor2vec(vector_tensor): + return vector_tensor.data.cpu().numpy()[:, :, 0, 0] + + +def tensor2im(image_tensor, imtype=np.uint8, cent=1., factor=255./2.): +# def tensor2im(image_tensor, imtype=np.uint8, cent=1., factor=1.): + image_numpy = image_tensor[0].cpu().float().numpy() + image_numpy = (np.transpose(image_numpy, (1, 2, 0)) + cent) * factor + return image_numpy.astype(imtype) + +def im2tensor(image, imtype=np.uint8, cent=1., factor=255./2.): +# def im2tensor(image, imtype=np.uint8, cent=1., factor=1.): + return torch.Tensor((image / factor - cent) + [:, :, :, np.newaxis].transpose((3, 2, 0, 1))) + + + +def voc_ap(rec, prec, use_07_metric=False): + """ ap = voc_ap(rec, prec, [use_07_metric]) + Compute VOC AP given precision and recall. + If use_07_metric is true, uses the + VOC 07 11 point method (default:False). + """ + if use_07_metric: + # 11 point metric + ap = 0. + for t in np.arange(0., 1.1, 0.1): + if np.sum(rec >= t) == 0: + p = 0 + else: + p = np.max(prec[rec >= t]) + ap = ap + p / 11. + else: + # correct AP calculation + # first append sentinel values at the end + mrec = np.concatenate(([0.], rec, [1.])) + mpre = np.concatenate(([0.], prec, [0.])) + + # compute the precision envelope + for i in range(mpre.size - 1, 0, -1): + mpre[i - 1] = np.maximum(mpre[i - 1], mpre[i]) + + # to calculate area under PR curve, look for points + # where X axis (recall) changes value + i = np.where(mrec[1:] != mrec[:-1])[0] + + # and sum (\Delta recall) * prec + ap = np.sum((mrec[i + 1] - mrec[i]) * mpre[i + 1]) + return ap + diff --git a/AnimatableGaussians/network/lpips/__pycache__/__init__.cpython-310.pyc b/AnimatableGaussians/network/lpips/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a6227fd1a6c6b363e1f5b1b9e10f6ee264b92bff Binary files /dev/null and b/AnimatableGaussians/network/lpips/__pycache__/__init__.cpython-310.pyc differ diff --git a/AnimatableGaussians/network/lpips/__pycache__/__init__.cpython-38.pyc b/AnimatableGaussians/network/lpips/__pycache__/__init__.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f79e6f2b46be32db834a890a6758c8120685f7d7 Binary files /dev/null and b/AnimatableGaussians/network/lpips/__pycache__/__init__.cpython-38.pyc differ diff --git a/AnimatableGaussians/network/lpips/__pycache__/lpips.cpython-310.pyc b/AnimatableGaussians/network/lpips/__pycache__/lpips.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7e663cf0025391bf1e74a7c47fcd2e062e37d276 Binary files /dev/null and b/AnimatableGaussians/network/lpips/__pycache__/lpips.cpython-310.pyc differ diff --git a/AnimatableGaussians/network/lpips/__pycache__/lpips.cpython-38.pyc b/AnimatableGaussians/network/lpips/__pycache__/lpips.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7de49c3cd7635f90e0744bea5f5d9f6186c2fb94 Binary files /dev/null and b/AnimatableGaussians/network/lpips/__pycache__/lpips.cpython-38.pyc differ diff --git a/AnimatableGaussians/network/lpips/__pycache__/pretrained_networks.cpython-310.pyc b/AnimatableGaussians/network/lpips/__pycache__/pretrained_networks.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8b25402848e8f6167a6d1823b55701b6bf1563cb Binary files /dev/null and b/AnimatableGaussians/network/lpips/__pycache__/pretrained_networks.cpython-310.pyc differ diff --git a/AnimatableGaussians/network/lpips/__pycache__/pretrained_networks.cpython-38.pyc b/AnimatableGaussians/network/lpips/__pycache__/pretrained_networks.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4be605c39e2595a9110afa37af62aec7ab12c3bf Binary files /dev/null and b/AnimatableGaussians/network/lpips/__pycache__/pretrained_networks.cpython-38.pyc differ diff --git a/AnimatableGaussians/network/lpips/lpips.py b/AnimatableGaussians/network/lpips/lpips.py new file mode 100644 index 0000000000000000000000000000000000000000..ddb5600ffe151f1bfeb29c2447b844d5bfc575a4 --- /dev/null +++ b/AnimatableGaussians/network/lpips/lpips.py @@ -0,0 +1,220 @@ + +from __future__ import absolute_import + +import torch +import torch.nn as nn +import torch.nn.init as init +from torch.autograd import Variable +import numpy as np +from . import pretrained_networks as pn +import torch.nn + +from AnimatableGaussians.network import lpips + + +def spatial_average(in_tens, keepdim=True): + return in_tens.mean([2,3],keepdim=keepdim) + +def upsample(in_tens, out_HW=(64,64)): # assumes scale factor is same for H and W + in_H, in_W = in_tens.shape[2], in_tens.shape[3] + return nn.Upsample(size=out_HW, mode='bilinear', align_corners=False)(in_tens) + +# Learned perceptual metric +class LPIPS(nn.Module): + def __init__(self, pretrained=True, net='alex', version='0.1', lpips=True, spatial=False, + pnet_rand=False, pnet_tune=False, use_dropout=True, model_path=None, eval_mode=True, verbose=True): + # lpips - [True] means with linear calibration on top of base network + # pretrained - [True] means load linear weights + + super(LPIPS, self).__init__() + if(verbose): + print('Setting up [%s] perceptual loss: trunk [%s], v[%s], spatial [%s]'% + ('LPIPS' if lpips else 'baseline', net, version, 'on' if spatial else 'off')) + + self.pnet_type = net + self.pnet_tune = pnet_tune + self.pnet_rand = pnet_rand + self.spatial = spatial + self.lpips = lpips # false means baseline of just averaging all layers + self.version = version + self.scaling_layer = ScalingLayer() + + if(self.pnet_type in ['vgg','vgg16']): + net_type = pn.vgg16 + self.chns = [64,128,256,512,512] + elif(self.pnet_type=='alex'): + net_type = pn.alexnet + self.chns = [64,192,384,256,256] + elif(self.pnet_type=='squeeze'): + net_type = pn.squeezenet + self.chns = [64,128,256,384,384,512,512] + self.L = len(self.chns) + + self.net = net_type(pretrained=not self.pnet_rand, requires_grad=self.pnet_tune) + + if(lpips): + self.lin0 = NetLinLayer(self.chns[0], use_dropout=use_dropout) + self.lin1 = NetLinLayer(self.chns[1], use_dropout=use_dropout) + self.lin2 = NetLinLayer(self.chns[2], use_dropout=use_dropout) + self.lin3 = NetLinLayer(self.chns[3], use_dropout=use_dropout) + self.lin4 = NetLinLayer(self.chns[4], use_dropout=use_dropout) + self.lins = [self.lin0,self.lin1,self.lin2,self.lin3,self.lin4] + if(self.pnet_type=='squeeze'): # 7 layers for squeezenet + self.lin5 = NetLinLayer(self.chns[5], use_dropout=use_dropout) + self.lin6 = NetLinLayer(self.chns[6], use_dropout=use_dropout) + self.lins+=[self.lin5,self.lin6] + self.lins = nn.ModuleList(self.lins) + + if(pretrained): + if(model_path is None): + import inspect + import os + model_path = os.path.abspath(os.path.join(inspect.getfile(self.__init__), '..', 'weights/v%s/%s.pth'%(version,net))) + + if(verbose): + print('Loading model from: %s'%model_path) + self.load_state_dict(torch.load(model_path, map_location='cpu'), strict=False) + + if(eval_mode): + self.eval() + + def forward(self, in0, in1, retPerLayer=False, normalize=False): + if normalize: # turn on this flag if input is [0,1] so it can be adjusted to [-1, +1] + in0 = 2 * in0 - 1 + in1 = 2 * in1 - 1 + + # v0.0 - original release had a bug, where input was not scaled + in0_input, in1_input = (self.scaling_layer(in0), self.scaling_layer(in1)) if self.version=='0.1' else (in0, in1) + outs0, outs1 = self.net.forward(in0_input), self.net.forward(in1_input) + feats0, feats1, diffs = {}, {}, {} + + for kk in range(self.L): + feats0[kk], feats1[kk] = lpips.normalize_tensor(outs0[kk]), lpips.normalize_tensor(outs1[kk]) + diffs[kk] = (feats0[kk]-feats1[kk])**2 + + if(self.lpips): + if(self.spatial): + res = [upsample(self.lins[kk](diffs[kk]), out_HW=in0.shape[2:]) for kk in range(self.L)] + else: + res = [spatial_average(self.lins[kk](diffs[kk]), keepdim=True) for kk in range(self.L)] + else: + if(self.spatial): + res = [upsample(diffs[kk].sum(dim=1,keepdim=True), out_HW=in0.shape[2:]) for kk in range(self.L)] + else: + res = [spatial_average(diffs[kk].sum(dim=1,keepdim=True), keepdim=True) for kk in range(self.L)] + + val = res[0] + for l in range(1,self.L): + val += res[l] + + # a = spatial_average(self.lins[kk](diffs[kk]), keepdim=True) + # b = torch.max(self.lins[kk](feats0[kk]**2)) + # for kk in range(self.L): + # a += spatial_average(self.lins[kk](diffs[kk]), keepdim=True) + # b = torch.max(b,torch.max(self.lins[kk](feats0[kk]**2))) + # a = a/self.L + # from IPython import embed + # embed() + # return 10*torch.log10(b/a) + + if(retPerLayer): + return (val, res) + else: + return val + + +class ScalingLayer(nn.Module): + def __init__(self): + super(ScalingLayer, self).__init__() + self.register_buffer('shift', torch.Tensor([-.030,-.088,-.188])[None,:,None,None]) + self.register_buffer('scale', torch.Tensor([.458,.448,.450])[None,:,None,None]) + + def forward(self, inp): + return (inp - self.shift) / self.scale + + +class NetLinLayer(nn.Module): + ''' A single linear layer which does a 1x1 conv ''' + def __init__(self, chn_in, chn_out=1, use_dropout=False): + super(NetLinLayer, self).__init__() + + layers = [nn.Dropout(),] if(use_dropout) else [] + layers += [nn.Conv2d(chn_in, chn_out, 1, stride=1, padding=0, bias=False),] + self.model = nn.Sequential(*layers) + + def forward(self, x): + return self.model(x) + +class Dist2LogitLayer(nn.Module): + ''' takes 2 distances, puts through fc layers, spits out value between [0,1] (if use_sigmoid is True) ''' + def __init__(self, chn_mid=32, use_sigmoid=True): + super(Dist2LogitLayer, self).__init__() + + layers = [nn.Conv2d(5, chn_mid, 1, stride=1, padding=0, bias=True),] + layers += [nn.LeakyReLU(0.2,True),] + layers += [nn.Conv2d(chn_mid, chn_mid, 1, stride=1, padding=0, bias=True),] + layers += [nn.LeakyReLU(0.2,True),] + layers += [nn.Conv2d(chn_mid, 1, 1, stride=1, padding=0, bias=True),] + if(use_sigmoid): + layers += [nn.Sigmoid(),] + self.model = nn.Sequential(*layers) + + def forward(self,d0,d1,eps=0.1): + return self.model.forward(torch.cat((d0,d1,d0-d1,d0/(d1+eps),d1/(d0+eps)),dim=1)) + +class BCERankingLoss(nn.Module): + def __init__(self, chn_mid=32): + super(BCERankingLoss, self).__init__() + self.net = Dist2LogitLayer(chn_mid=chn_mid) + # self.parameters = list(self.net.parameters()) + self.loss = torch.nn.BCELoss() + + def forward(self, d0, d1, judge): + per = (judge+1.)/2. + self.logit = self.net.forward(d0,d1) + return self.loss(self.logit, per) + +# L2, DSSIM metrics +class FakeNet(nn.Module): + def __init__(self, use_gpu=True, colorspace='Lab'): + super(FakeNet, self).__init__() + self.use_gpu = use_gpu + self.colorspace = colorspace + +class L2(FakeNet): + def forward(self, in0, in1, retPerLayer=None): + assert(in0.size()[0]==1) # currently only supports batchSize 1 + + if(self.colorspace=='RGB'): + (N,C,X,Y) = in0.size() + value = torch.mean(torch.mean(torch.mean((in0-in1)**2,dim=1).view(N,1,X,Y),dim=2).view(N,1,1,Y),dim=3).view(N) + return value + elif(self.colorspace=='Lab'): + value = lpips.l2(lpips.tensor2np(lpips.tensor2tensorlab(in0.data,to_norm=False)), + lpips.tensor2np(lpips.tensor2tensorlab(in1.data,to_norm=False)), range=100.).astype('float') + ret_var = Variable( torch.Tensor((value,) ) ) + if(self.use_gpu): + ret_var = ret_var.cuda() + return ret_var + +class DSSIM(FakeNet): + + def forward(self, in0, in1, retPerLayer=None): + assert(in0.size()[0]==1) # currently only supports batchSize 1 + + if(self.colorspace=='RGB'): + value = lpips.dssim(1.*lpips.tensor2im(in0.data), 1.*lpips.tensor2im(in1.data), range=255.).astype('float') + elif(self.colorspace=='Lab'): + value = lpips.dssim(lpips.tensor2np(lpips.tensor2tensorlab(in0.data,to_norm=False)), + lpips.tensor2np(lpips.tensor2tensorlab(in1.data,to_norm=False)), range=100.).astype('float') + ret_var = Variable( torch.Tensor((value,) ) ) + if(self.use_gpu): + ret_var = ret_var.cuda() + return ret_var + +def print_network(net): + num_params = 0 + for param in net.parameters(): + num_params += param.numel() + print('Network',net) + print('Total number of parameters: %d' % num_params) diff --git a/AnimatableGaussians/network/lpips/pretrained_networks.py b/AnimatableGaussians/network/lpips/pretrained_networks.py new file mode 100644 index 0000000000000000000000000000000000000000..82f14e206e7b395ac9d989cb2536e17b17e65184 --- /dev/null +++ b/AnimatableGaussians/network/lpips/pretrained_networks.py @@ -0,0 +1,180 @@ +from collections import namedtuple +import torch +from torchvision import models as tv + +class squeezenet(torch.nn.Module): + def __init__(self, requires_grad=False, pretrained=True): + super(squeezenet, self).__init__() + pretrained_features = tv.squeezenet1_1(pretrained=pretrained).features + self.slice1 = torch.nn.Sequential() + self.slice2 = torch.nn.Sequential() + self.slice3 = torch.nn.Sequential() + self.slice4 = torch.nn.Sequential() + self.slice5 = torch.nn.Sequential() + self.slice6 = torch.nn.Sequential() + self.slice7 = torch.nn.Sequential() + self.N_slices = 7 + for x in range(2): + self.slice1.add_module(str(x), pretrained_features[x]) + for x in range(2,5): + self.slice2.add_module(str(x), pretrained_features[x]) + for x in range(5, 8): + self.slice3.add_module(str(x), pretrained_features[x]) + for x in range(8, 10): + self.slice4.add_module(str(x), pretrained_features[x]) + for x in range(10, 11): + self.slice5.add_module(str(x), pretrained_features[x]) + for x in range(11, 12): + self.slice6.add_module(str(x), pretrained_features[x]) + for x in range(12, 13): + self.slice7.add_module(str(x), pretrained_features[x]) + if not requires_grad: + for param in self.parameters(): + param.requires_grad = False + + def forward(self, X): + h = self.slice1(X) + h_relu1 = h + h = self.slice2(h) + h_relu2 = h + h = self.slice3(h) + h_relu3 = h + h = self.slice4(h) + h_relu4 = h + h = self.slice5(h) + h_relu5 = h + h = self.slice6(h) + h_relu6 = h + h = self.slice7(h) + h_relu7 = h + vgg_outputs = namedtuple("SqueezeOutputs", ['relu1','relu2','relu3','relu4','relu5','relu6','relu7']) + out = vgg_outputs(h_relu1,h_relu2,h_relu3,h_relu4,h_relu5,h_relu6,h_relu7) + + return out + + +class alexnet(torch.nn.Module): + def __init__(self, requires_grad=False, pretrained=True): + super(alexnet, self).__init__() + alexnet_pretrained_features = tv.alexnet(pretrained=pretrained).features + self.slice1 = torch.nn.Sequential() + self.slice2 = torch.nn.Sequential() + self.slice3 = torch.nn.Sequential() + self.slice4 = torch.nn.Sequential() + self.slice5 = torch.nn.Sequential() + self.N_slices = 5 + for x in range(2): + self.slice1.add_module(str(x), alexnet_pretrained_features[x]) + for x in range(2, 5): + self.slice2.add_module(str(x), alexnet_pretrained_features[x]) + for x in range(5, 8): + self.slice3.add_module(str(x), alexnet_pretrained_features[x]) + for x in range(8, 10): + self.slice4.add_module(str(x), alexnet_pretrained_features[x]) + for x in range(10, 12): + self.slice5.add_module(str(x), alexnet_pretrained_features[x]) + if not requires_grad: + for param in self.parameters(): + param.requires_grad = False + + def forward(self, X): + h = self.slice1(X) + h_relu1 = h + h = self.slice2(h) + h_relu2 = h + h = self.slice3(h) + h_relu3 = h + h = self.slice4(h) + h_relu4 = h + h = self.slice5(h) + h_relu5 = h + alexnet_outputs = namedtuple("AlexnetOutputs", ['relu1', 'relu2', 'relu3', 'relu4', 'relu5']) + out = alexnet_outputs(h_relu1, h_relu2, h_relu3, h_relu4, h_relu5) + + return out + +class vgg16(torch.nn.Module): + def __init__(self, requires_grad=False, pretrained=True): + super(vgg16, self).__init__() + vgg_pretrained_features = tv.vgg16(pretrained=pretrained).features + self.slice1 = torch.nn.Sequential() + self.slice2 = torch.nn.Sequential() + self.slice3 = torch.nn.Sequential() + self.slice4 = torch.nn.Sequential() + self.slice5 = torch.nn.Sequential() + self.N_slices = 5 + for x in range(4): + self.slice1.add_module(str(x), vgg_pretrained_features[x]) + for x in range(4, 9): + self.slice2.add_module(str(x), vgg_pretrained_features[x]) + for x in range(9, 16): + self.slice3.add_module(str(x), vgg_pretrained_features[x]) + for x in range(16, 23): + self.slice4.add_module(str(x), vgg_pretrained_features[x]) + for x in range(23, 30): + self.slice5.add_module(str(x), vgg_pretrained_features[x]) + if not requires_grad: + for param in self.parameters(): + param.requires_grad = False + + def forward(self, X): + h = self.slice1(X) + h_relu1_2 = h + h = self.slice2(h) + h_relu2_2 = h + h = self.slice3(h) + h_relu3_3 = h + h = self.slice4(h) + h_relu4_3 = h + h = self.slice5(h) + h_relu5_3 = h + vgg_outputs = namedtuple("VggOutputs", ['relu1_2', 'relu2_2', 'relu3_3', 'relu4_3', 'relu5_3']) + out = vgg_outputs(h_relu1_2, h_relu2_2, h_relu3_3, h_relu4_3, h_relu5_3) + + return out + + + +class resnet(torch.nn.Module): + def __init__(self, requires_grad=False, pretrained=True, num=18): + super(resnet, self).__init__() + if(num==18): + self.net = tv.resnet18(pretrained=pretrained) + elif(num==34): + self.net = tv.resnet34(pretrained=pretrained) + elif(num==50): + self.net = tv.resnet50(pretrained=pretrained) + elif(num==101): + self.net = tv.resnet101(pretrained=pretrained) + elif(num==152): + self.net = tv.resnet152(pretrained=pretrained) + self.N_slices = 5 + + self.conv1 = self.net.conv1 + self.bn1 = self.net.bn1 + self.relu = self.net.relu + self.maxpool = self.net.maxpool + self.layer1 = self.net.layer1 + self.layer2 = self.net.layer2 + self.layer3 = self.net.layer3 + self.layer4 = self.net.layer4 + + def forward(self, X): + h = self.conv1(X) + h = self.bn1(h) + h = self.relu(h) + h_relu1 = h + h = self.maxpool(h) + h = self.layer1(h) + h_conv2 = h + h = self.layer2(h) + h_conv3 = h + h = self.layer3(h) + h_conv4 = h + h = self.layer4(h) + h_conv5 = h + + outputs = namedtuple("Outputs", ['relu1','conv2','conv3','conv4','conv5']) + out = outputs(h_relu1, h_conv2, h_conv3, h_conv4, h_conv5) + + return out diff --git a/AnimatableGaussians/network/lpips/weights/v0.1/vgg.pth b/AnimatableGaussians/network/lpips/weights/v0.1/vgg.pth new file mode 100644 index 0000000000000000000000000000000000000000..f57dcf5cc764d61c8a460365847fb2137ff0a62d --- /dev/null +++ b/AnimatableGaussians/network/lpips/weights/v0.1/vgg.pth @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a78928a0af1e5f0fcb1f3b9e8f8c3a2a5a3de244d830ad5c1feddc79b8432868 +size 7289 diff --git a/AnimatableGaussians/network/mlp.py b/AnimatableGaussians/network/mlp.py new file mode 100644 index 0000000000000000000000000000000000000000..67fa97dc7715e30017fe7eadaff5d58395e7c752 --- /dev/null +++ b/AnimatableGaussians/network/mlp.py @@ -0,0 +1,504 @@ +import torch.nn as nn +import torch +import torch.nn.functional as F +import numpy as np + + +def init_out_weights(self): + for m in self.modules(): + for name, param in m.named_parameters(): + if 'weight' in name: + nn.init.uniform_(param.data, -1e-5, 1e-5) + elif 'bias' in name: + nn.init.constant_(param.data, 0.0) + + +class MLP(nn.Module): + def __init__(self, in_channels, out_channels, inter_channels = [512, 512, 512, 343, 512, 512], + res_layers = [], nlactv = nn.ReLU(), last_op=None, norm = None, init_last_layer = False): + super(MLP, self).__init__() + + self.nlactv = nlactv + + self.fc_list = nn.ModuleList() + self.res_layers = res_layers + if self.res_layers is None: + self.res_layers = [] + + self.all_channels = [in_channels] + inter_channels + [out_channels] + for l in range(0, len(self.all_channels) - 2): + if l in self.res_layers: + if norm == 'weight': + # print('layer %d weight normalization in fusion mlp' % l) + self.fc_list.append(nn.Sequential( + nn.utils.weight_norm(nn.Conv1d(self.all_channels[l] + self.all_channels[0], self.all_channels[l + 1], 1)), + self.nlactv + )) + else: + self.fc_list.append(nn.Sequential( + nn.Conv1d(self.all_channels[l] + self.all_channels[0], self.all_channels[l + 1], 1), + self.nlactv + )) + self.all_channels[l] += self.all_channels[0] + else: + if norm == 'weight': + # print('layer %d weight normalization in fusion mlp' % l) + self.fc_list.append(nn.Sequential( + nn.utils.weight_norm(nn.Conv1d(self.all_channels[l], self.all_channels[l + 1], 1)), + self.nlactv + )) + else: + self.fc_list.append(nn.Sequential( + nn.Conv1d(self.all_channels[l], self.all_channels[l + 1], 1), + self.nlactv + )) + + self.fc_list.append(nn.Conv1d(self.all_channels[-2], out_channels, 1)) + + if init_last_layer: + self.fc_list[-1].apply(init_out_weights) + + if last_op == 'sigmoid': + self.last_op = nn.Sigmoid() + elif last_op == 'tanh': + self.last_op = nn.Tanh() + else: + self.last_op = None + + def forward(self, x, return_inter_layer = []): + tmpx = x + inter_feat_list = [] + for i, fc in enumerate(self.fc_list): + if i in self.res_layers: + x = fc(torch.cat([x, tmpx], dim = 1)) + else: + x = fc(x) + if i == len(self.fc_list) - 1 and self.last_op is not None: # last layer + x = self.last_op(x) + if i in return_inter_layer: + inter_feat_list.append(x.clone()) + + if len(return_inter_layer) > 0: + return x, inter_feat_list + else: + return x + + +class MLPLinear(nn.Module): + def __init__(self, + in_channels, + out_channels, + inter_channels, + res_layers = [], + nlactv = nn.ReLU(), + last_op = None): + super(MLPLinear, self).__init__() + + self.fc_list = nn.ModuleList() + self.all_channels = [in_channels] + inter_channels + [out_channels] + self.res_layers = res_layers + self.nlactv = nlactv + self.last_op = last_op + + for l in range(0, len(self.all_channels) - 2): + if l in self.res_layers: + self.all_channels[l] += in_channels + self.fc_list.append( + nn.Sequential( + nn.Linear(self.all_channels[l], self.all_channels[l + 1]), + self.nlactv + ) + ) + self.fc_list.append(nn.Linear(self.all_channels[-2], self.all_channels[-1])) + + def forward(self, x): + tmpx = x + for i, layer in enumerate(self.fc_list): + if i in self.res_layers: + x = torch.cat([x, tmpx], dim = -1) + x = layer(x) + if self.last_op is not None: + x = self.last_op(x) + return x + + +def parallel_concat(tensors: list, n_parallel_group: int): + """ + :param tensors: list of tensors, each of which has a shape of [B, G*C, N] + :param n_parallel_group: + :return: [B, G*C', N] + """ + batch_size = tensors[0].shape[0] + point_num = tensors[0].shape[-1] + assert all([t.shape[0] == batch_size for t in tensors]), 'All tensors should have the same batch size' + assert all([t.shape[2] == point_num for t in tensors]), 'All tensors should have the same point num' + assert all([t.shape[1] % n_parallel_group==0 for t in tensors]), 'Invalid tensor channels' + + tensors_ = [ + t.reshape(batch_size, n_parallel_group, -1, point_num) for t in tensors + ] + concated = torch.cat(tensors_, dim=2) + concated = concated.reshape(batch_size, -1, point_num) + return concated + + +class ParallelMLP(nn.Module): + def __init__(self, + in_channels, + out_channels, + group_num, + inter_channels, + res_layers = [], + nlactv = nn.ReLU(), + last_op = None): + super(ParallelMLP, self).__init__() + + self.fc_list = nn.ModuleList() + self.all_channels = [in_channels] + inter_channels + [out_channels] + self.group_num = group_num + self.res_layers = res_layers + self.nlactv = nlactv + self.last_op = last_op + + for l in range(0, len(self.all_channels) - 2): + if l in self.res_layers: + self.all_channels[l] += in_channels + self.fc_list.append( + nn.Sequential( + nn.Conv1d(self.all_channels[l] * self.group_num, self.all_channels[l + 1] * self.group_num, 1, groups = self.group_num), + self.nlactv + ) + ) + self.fc_list.append(nn.Conv1d(self.all_channels[-2] * self.group_num, self.all_channels[-1] * self.group_num, 1, groups = self.group_num)) + + def forward(self, x): + """ + :param x: (batch_size, group_num, point_num, in_channels) + :return: (batch_size, group_num, point_num, out_channels) + """ + assert len(x.shape) == 4, 'input tensor should be a shape of [B, G, N, C]' + assert x.shape[1] == self.group_num, 'input tensor should have %d parallel groups, but it has %s' % (self.group_num, x.shape[1]) + + B, G, N, C = x.shape + x = x.permute(0, 1, 3, 2).reshape(B, G * C, N) + tmpx = x + for i, layer in enumerate(self.fc_list): + if i in self.res_layers: + x = parallel_concat([x, tmpx], G) + x = layer(x) + if self.last_op is not None: + x = self.last_op(x) + x = x.view(B, G, -1, N).permute(0, 1, 3, 2) + return x + + +class SdfMLP(MLPLinear): + def __init__(self, + in_channels, + out_channels, + inter_channels, + res_layers = [], + nlactv = nn.Softplus(beta = 100), + geometric_init = True, + bias = 0.5, + weight_norm = True + ): + super(SdfMLP, self).__init__(in_channels, + out_channels, + inter_channels, + res_layers, + nlactv, + None) + + for l, layer in enumerate(self.fc_list): + if isinstance(layer, nn.Sequential): + lin = layer[0] + elif isinstance(layer, nn.Linear): + lin = layer + else: + raise TypeError('Invalid %d layer' % l) + if geometric_init: + in_dim, out_dim = lin.in_features, lin.out_features + if l == len(self.fc_list) - 1: + torch.nn.init.normal_(lin.weight, mean = np.sqrt(np.pi) / np.sqrt(in_dim), std = 0.0001) + torch.nn.init.constant_(lin.bias, -bias) + elif l == 0: + torch.nn.init.constant_(lin.bias, 0.0) + torch.nn.init.constant_(lin.weight[:, 3:], 0.0) + torch.nn.init.normal_(lin.weight[:, :3], 0.0, np.sqrt(2) / np.sqrt(out_dim)) + elif l in self.res_layers: + torch.nn.init.constant_(lin.bias, 0.0) + torch.nn.init.normal_(lin.weight, 0.0, np.sqrt(2) / np.sqrt(out_dim)) + torch.nn.init.constant_(lin.weight[:, -(in_channels - 3):], 0.0) + else: + torch.nn.init.constant_(lin.bias, 0.0) + torch.nn.init.normal_(lin.weight, 0.0, np.sqrt(2) / np.sqrt(out_dim)) + + if weight_norm: + if isinstance(layer, nn.Sequential): + layer[0] = nn.utils.weight_norm(lin) + elif isinstance(layer, nn.Linear): + layer = nn.utils.weight_norm(lin) + + +class OffsetDecoder(nn.Module): + """ + Same architecture with ShapeDecoder in POP (https://github.com/qianlim/POP). + """ + def __init__(self, in_size, hsize = 256, actv_fn='softplus'): + self.hsize = hsize + super(OffsetDecoder, self).__init__() + self.conv1 = torch.nn.Conv1d(in_size, self.hsize, 1) + self.conv2 = torch.nn.Conv1d(self.hsize, self.hsize, 1) + self.conv3 = torch.nn.Conv1d(self.hsize, self.hsize, 1) + self.conv4 = torch.nn.Conv1d(self.hsize, self.hsize, 1) + self.conv5 = torch.nn.Conv1d(self.hsize+in_size, self.hsize, 1) + self.conv6 = torch.nn.Conv1d(self.hsize, self.hsize, 1) + self.conv7 = torch.nn.Conv1d(self.hsize, self.hsize, 1) + self.conv8 = torch.nn.Conv1d(self.hsize, 3, 1) + nn.init.uniform_(self.conv8.weight, -1e-5, 1e-5) + nn.init.constant_(self.conv8.bias, 0.) + + self.bn1 = torch.nn.BatchNorm1d(self.hsize) + self.bn2 = torch.nn.BatchNorm1d(self.hsize) + self.bn3 = torch.nn.BatchNorm1d(self.hsize) + self.bn4 = torch.nn.BatchNorm1d(self.hsize) + + self.bn5 = torch.nn.BatchNorm1d(self.hsize) + self.bn6 = torch.nn.BatchNorm1d(self.hsize) + self.bn7 = torch.nn.BatchNorm1d(self.hsize) + + self.actv_fn = nn.ReLU() if actv_fn=='relu' else nn.Softplus() + + def forward(self, x): + x1 = self.actv_fn(self.bn1(self.conv1(x))) + x2 = self.actv_fn(self.bn2(self.conv2(x1))) + x3 = self.actv_fn(self.bn3(self.conv3(x2))) + x4 = self.actv_fn(self.bn4(self.conv4(x3))) + x5 = self.actv_fn(self.bn5(self.conv5(torch.cat([x,x4],dim=1)))) + + # position pred + x6 = self.actv_fn(self.bn6(self.conv6(x5))) + x7 = self.actv_fn(self.bn7(self.conv7(x6))) + x8 = self.conv8(x7) + + return x8 + + def forward_wo_bn(self, x): + x1 = self.actv_fn(self.conv1(x)) + x2 = self.actv_fn(self.conv2(x1)) + x3 = self.actv_fn(self.conv3(x2)) + x4 = self.actv_fn(self.conv4(x3)) + x5 = self.actv_fn(self.conv5(torch.cat([x,x4],dim=1))) + + # position pred + x6 = self.actv_fn(self.conv6(x5)) + x7 = self.actv_fn(self.conv7(x6)) + x8 = self.conv8(x7) + + return x8 + + +class ShapeDecoder(nn.Module): + ''' + The "Shape Decoder" in the POP paper Fig. 2. The same as the "shared MLP" in the SCALE paper. + - with skip connection from the input features to the 4th layer's output features (like DeepSDF) + - branches out at the second-to-last layer, one branch for position pred, one for normal pred + ''' + def __init__(self, in_size, hsize = 256, actv_fn='softplus'): + self.hsize = hsize + super(ShapeDecoder, self).__init__() + self.conv1 = torch.nn.Conv1d(in_size, self.hsize, 1) + self.conv2 = torch.nn.Conv1d(self.hsize, self.hsize, 1) + self.conv3 = torch.nn.Conv1d(self.hsize, self.hsize, 1) + self.conv4 = torch.nn.Conv1d(self.hsize, self.hsize, 1) + self.conv5 = torch.nn.Conv1d(self.hsize+in_size, self.hsize, 1) + self.conv6 = torch.nn.Conv1d(self.hsize, self.hsize, 1) + self.conv7 = torch.nn.Conv1d(self.hsize, self.hsize, 1) + self.conv8 = torch.nn.Conv1d(self.hsize, 3, 1) + + self.conv6N = torch.nn.Conv1d(self.hsize, self.hsize, 1) + self.conv7N = torch.nn.Conv1d(self.hsize, self.hsize, 1) + self.conv8N = torch.nn.Conv1d(self.hsize, 3, 1) + + self.bn1 = torch.nn.BatchNorm1d(self.hsize) + self.bn2 = torch.nn.BatchNorm1d(self.hsize) + self.bn3 = torch.nn.BatchNorm1d(self.hsize) + self.bn4 = torch.nn.BatchNorm1d(self.hsize) + + self.bn5 = torch.nn.BatchNorm1d(self.hsize) + self.bn6 = torch.nn.BatchNorm1d(self.hsize) + self.bn7 = torch.nn.BatchNorm1d(self.hsize) + + self.bn6N = torch.nn.BatchNorm1d(self.hsize) + self.bn7N = torch.nn.BatchNorm1d(self.hsize) + + self.actv_fn = nn.ReLU() if actv_fn=='relu' else nn.Softplus() + + # init last layer + nn.init.uniform_(self.conv8.weight, -1e-5, 1e-5) + nn.init.constant_(self.conv8.bias, 0) + + def forward(self, x): + x1 = self.actv_fn(self.bn1(self.conv1(x))) + x2 = self.actv_fn(self.bn2(self.conv2(x1))) + x3 = self.actv_fn(self.bn3(self.conv3(x2))) + x4 = self.actv_fn(self.bn4(self.conv4(x3))) + x5 = self.actv_fn(self.bn5(self.conv5(torch.cat([x,x4],dim=1)))) + + # position pred + x6 = self.actv_fn(self.bn6(self.conv6(x5))) + x7 = self.actv_fn(self.bn7(self.conv7(x6))) + x8 = self.conv8(x7) + + # normals pred + xN6 = self.actv_fn(self.bn6N(self.conv6N(x5))) + xN7 = self.actv_fn(self.bn7N(self.conv7N(xN6))) + xN8 = self.conv8N(xN7) + + return x8, xN8 + + +class MLPwoWeight(object): + def __init__(self, + in_channels, + out_channels, + inter_channels, + res_layers = [], + nlactv = nn.ReLU(), + last_op = None): + super(MLPwoWeight, self).__init__() + + self.in_channels = in_channels + self.out_channels = out_channels + self.all_channels = [in_channels] + inter_channels + [out_channels] + self.res_layers = res_layers + + self.nlactv = nlactv + self.last_op = last_op + + self.param_num = 0 + for i in range(len(self.all_channels) - 1): + in_ch = self.all_channels[i] + if i in self.res_layers: + in_ch += self.in_channels + out_ch = self.all_channels[i + 1] + self.param_num += (in_ch * out_ch + out_ch) + self.param_num_per_group = self.param_num + + def forward(self, x, params): + """ + :param x: (batch_size, point_num, in_channels) + :param params: (param_num, ) + :return: (batch_size, point_num, out_channels) + """ + x = x.permute(0, 2, 1) # (B, C, N) + tmpx = x + + param_id = 0 + for i in range(len(self.all_channels) - 1): + in_ch = self.all_channels[i] + if i in self.res_layers: + in_ch += self.in_channels + x = torch.cat([x, tmpx], 1) + out_ch = self.all_channels[i + 1] + + weight_len = out_ch * in_ch + weight = params[param_id: param_id + weight_len].reshape(out_ch, in_ch, 1) + param_id += weight_len + + bias_len = out_ch + bias = params[param_id: param_id + bias_len] + param_id += bias_len + + x = F.conv1d(x, weight, bias) + if i < len(self.all_channels) - 2: + x = self.nlactv(x) + + if self.last_op is not None: + x = self.last_op(x) + return x.permute(0, 2, 1) + + def __repr__(self): + main_str = self.__class__.__name__ + '(\n' + for i in range(len(self.all_channels) - 1): + main_str += '\tF.conv1d(in_features=%d, out_features=%d, bias=True)\n' % (self.all_channels[i], self.all_channels[i + 1]) + main_str += '\tnlactv: %s\n' % self.nlactv.__repr__() + main_str += ')' + return main_str + + +class ParallelMLPwoWeight(object): + def __init__(self, + in_channels, + out_channels, + inter_channels, + group_num = 1, + res_layers = [], + nlactv = nn.ReLU(), + last_op = None): + super(ParallelMLPwoWeight, self).__init__() + + self.in_channels = in_channels + self.out_channels = out_channels + self.all_channels = [in_channels] + inter_channels + [out_channels] + self.res_layers = res_layers + self.group_num = group_num + + self.nlactv = nlactv + self.last_op = last_op + + self.param_num = 0 + for i in range(len(self.all_channels) - 1): + in_ch = self.all_channels[i] + if i in self.res_layers: + in_ch += self.in_channels + out_ch = self.all_channels[i + 1] + self.param_num += (in_ch * out_ch + out_ch) * self.group_num + self.param_num_per_group = self.param_num // self.group_num + + def forward(self, x, params): + """ + :param x: (batch_size, group_num, point_num, in_channels) + :param params: (group_num, param_num) + :return: (batch_size, group_num, point_num, out_channels) + """ + batch_size, group_num, point_num, in_channels = x.shape + assert group_num == self.group_num and in_channels == self.in_channels + x = x.permute(0, 1, 3, 2) # (B, G, C, N) + x = x.reshape(batch_size, group_num * in_channels, point_num) + tmpx = x + + param_id = 0 + for i in range(len(self.all_channels) - 1): + in_ch = self.all_channels[i] + if i in self.res_layers: + in_ch += self.in_channels + x = parallel_concat([x, tmpx], group_num) + out_ch = self.all_channels[i + 1] + + weight_len = out_ch * in_ch + weight = params[:, param_id: param_id + weight_len].reshape(group_num * out_ch, in_ch, 1) + param_id += weight_len + + bias_len = out_ch + bias = params[:, param_id: param_id + bias_len].reshape(group_num * out_ch) + param_id += bias_len + + x = F.conv1d(x, weight, bias, groups = group_num) + if i < len(self.all_channels) - 2: + x = self.nlactv(x) + + if self.last_op is not None: + x = self.last_op(x) + x = x.reshape(batch_size, group_num, self.out_channels, point_num) + return x.permute(0, 1, 3, 2) + + def __repr__(self): + main_str = self.__class__.__name__ + '(\n' + main_str += '\tgroup_num: %d\n' % self.group_num + for i in range(len(self.all_channels) - 1): + main_str += '\tF.conv1d(in_features=%d, out_features=%d, bias=True)\n' % (self.all_channels[i], self.all_channels[i + 1]) + main_str += '\tnlactv: %s\n' % self.nlactv.__repr__() + main_str += ')' + return main_str diff --git a/AnimatableGaussians/network/styleunet/__init__.py b/AnimatableGaussians/network/styleunet/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/AnimatableGaussians/network/styleunet/__pycache__/__init__.cpython-310.pyc b/AnimatableGaussians/network/styleunet/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2de8157a1a8204947c61bc8a5206ea5199c6a157 Binary files /dev/null and b/AnimatableGaussians/network/styleunet/__pycache__/__init__.cpython-310.pyc differ diff --git a/AnimatableGaussians/network/styleunet/__pycache__/__init__.cpython-38.pyc b/AnimatableGaussians/network/styleunet/__pycache__/__init__.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..dd05a2f0b33d1ff80e2f894bdc695d19114f1667 Binary files /dev/null and b/AnimatableGaussians/network/styleunet/__pycache__/__init__.cpython-38.pyc differ diff --git a/AnimatableGaussians/network/styleunet/__pycache__/conv2d_gradfix.cpython-310.pyc b/AnimatableGaussians/network/styleunet/__pycache__/conv2d_gradfix.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..941a4afdfe6db2b3c9230c4a4916dec15f0a4295 Binary files /dev/null and b/AnimatableGaussians/network/styleunet/__pycache__/conv2d_gradfix.cpython-310.pyc differ diff --git a/AnimatableGaussians/network/styleunet/__pycache__/conv2d_gradfix.cpython-38.pyc b/AnimatableGaussians/network/styleunet/__pycache__/conv2d_gradfix.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ceffa8714aba9d9337e9e4a6ddfc855084e5814d Binary files /dev/null and b/AnimatableGaussians/network/styleunet/__pycache__/conv2d_gradfix.cpython-38.pyc differ diff --git a/AnimatableGaussians/network/styleunet/__pycache__/dual_styleunet.cpython-310.pyc b/AnimatableGaussians/network/styleunet/__pycache__/dual_styleunet.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..710793555c188f046efc681e67a3cd573172f107 Binary files /dev/null and b/AnimatableGaussians/network/styleunet/__pycache__/dual_styleunet.cpython-310.pyc differ diff --git a/AnimatableGaussians/network/styleunet/__pycache__/dual_styleunet.cpython-38.pyc b/AnimatableGaussians/network/styleunet/__pycache__/dual_styleunet.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2c20cc57f5c5748150798eded8d70c07a5f9b2ba Binary files /dev/null and b/AnimatableGaussians/network/styleunet/__pycache__/dual_styleunet.cpython-38.pyc differ diff --git a/AnimatableGaussians/network/styleunet/__pycache__/fused_act.cpython-310.pyc b/AnimatableGaussians/network/styleunet/__pycache__/fused_act.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..297970850c8e7f3549aa0e0fe841c60a4d8d2632 Binary files /dev/null and b/AnimatableGaussians/network/styleunet/__pycache__/fused_act.cpython-310.pyc differ diff --git a/AnimatableGaussians/network/styleunet/__pycache__/fused_act.cpython-38.pyc b/AnimatableGaussians/network/styleunet/__pycache__/fused_act.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c1041ead4450e187e33369b911e117b41527aa8b Binary files /dev/null and b/AnimatableGaussians/network/styleunet/__pycache__/fused_act.cpython-38.pyc differ diff --git a/AnimatableGaussians/network/styleunet/__pycache__/upfirdn2d.cpython-310.pyc b/AnimatableGaussians/network/styleunet/__pycache__/upfirdn2d.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fe0db9f2cbe6790217eb851ad17aca9cd1c6f340 Binary files /dev/null and b/AnimatableGaussians/network/styleunet/__pycache__/upfirdn2d.cpython-310.pyc differ diff --git a/AnimatableGaussians/network/styleunet/__pycache__/upfirdn2d.cpython-38.pyc b/AnimatableGaussians/network/styleunet/__pycache__/upfirdn2d.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f0222d37fd285d7b0249ff044563dd5a185a9898 Binary files /dev/null and b/AnimatableGaussians/network/styleunet/__pycache__/upfirdn2d.cpython-38.pyc differ diff --git a/AnimatableGaussians/network/styleunet/build/lib.linux-x86_64-cpython-310/fused.cpython-310-x86_64-linux-gnu.so b/AnimatableGaussians/network/styleunet/build/lib.linux-x86_64-cpython-310/fused.cpython-310-x86_64-linux-gnu.so new file mode 100644 index 0000000000000000000000000000000000000000..f13d12db90ae22514b9dd4b7925fa0801ad5f0c1 --- /dev/null +++ b/AnimatableGaussians/network/styleunet/build/lib.linux-x86_64-cpython-310/fused.cpython-310-x86_64-linux-gnu.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:64a4e3411f6d100081056d36f1022cf75b377cb59438cbee404912c25d294d4e +size 12046360 diff --git a/AnimatableGaussians/network/styleunet/build/lib.linux-x86_64-cpython-310/upfirdn2d.cpython-310-x86_64-linux-gnu.so b/AnimatableGaussians/network/styleunet/build/lib.linux-x86_64-cpython-310/upfirdn2d.cpython-310-x86_64-linux-gnu.so new file mode 100644 index 0000000000000000000000000000000000000000..1187db33796e6ab1b2804adf05c00be7d8a3e27c --- /dev/null +++ b/AnimatableGaussians/network/styleunet/build/lib.linux-x86_64-cpython-310/upfirdn2d.cpython-310-x86_64-linux-gnu.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:46e4716356cdc403f441d18dad14516b32d45aa51152f799d2bdc3fd4d8d3766 +size 12143752 diff --git a/AnimatableGaussians/network/styleunet/build/lib.win-amd64-cpython-38/fused.cp38-win_amd64.pyd b/AnimatableGaussians/network/styleunet/build/lib.win-amd64-cpython-38/fused.cp38-win_amd64.pyd new file mode 100644 index 0000000000000000000000000000000000000000..b81a0a58c5ece01b6692fb49d08b96af9554733a Binary files /dev/null and b/AnimatableGaussians/network/styleunet/build/lib.win-amd64-cpython-38/fused.cp38-win_amd64.pyd differ diff --git a/AnimatableGaussians/network/styleunet/build/lib.win-amd64-cpython-38/upfirdn2d.cp38-win_amd64.pyd b/AnimatableGaussians/network/styleunet/build/lib.win-amd64-cpython-38/upfirdn2d.cp38-win_amd64.pyd new file mode 100644 index 0000000000000000000000000000000000000000..706e64eae70a9e03b539f0261f7cf7623d8fb69e Binary files /dev/null and b/AnimatableGaussians/network/styleunet/build/lib.win-amd64-cpython-38/upfirdn2d.cp38-win_amd64.pyd differ diff --git a/AnimatableGaussians/network/styleunet/build/temp.linux-x86_64-cpython-310/.ninja_deps b/AnimatableGaussians/network/styleunet/build/temp.linux-x86_64-cpython-310/.ninja_deps new file mode 100644 index 0000000000000000000000000000000000000000..722f7f6f2a3bc812b948d1573688bb8b663e3abb Binary files /dev/null and b/AnimatableGaussians/network/styleunet/build/temp.linux-x86_64-cpython-310/.ninja_deps differ diff --git a/AnimatableGaussians/network/styleunet/build/temp.linux-x86_64-cpython-310/.ninja_log b/AnimatableGaussians/network/styleunet/build/temp.linux-x86_64-cpython-310/.ninja_log new file mode 100644 index 0000000000000000000000000000000000000000..90ad84a44e0b572a776c6b764c91bcef115f7a7d --- /dev/null +++ b/AnimatableGaussians/network/styleunet/build/temp.linux-x86_64-cpython-310/.ninja_log @@ -0,0 +1,13 @@ +# ninja log v5 +1 19388 1724919132309176275 /home/pengc02/pengcheng/projects/gaussian_avatar/ag_gha/AnimatableGaussians/network/styleunet/build/temp.linux-x86_64-cpython-310/upfirdn2d_kernel.o 1bd060b0529a315a +0 21879 1724919134781127230 /home/pengc02/pengcheng/projects/gaussian_avatar/ag_gha/AnimatableGaussians/network/styleunet/build/temp.linux-x86_64-cpython-310/upfirdn2d.o 36b0a058a066e35 +1 19200 1724919155000726494 /home/pengc02/pengcheng/projects/gaussian_avatar/ag_gha/AnimatableGaussians/network/styleunet/build/temp.linux-x86_64-cpython-310/fused_bias_act_kernel.o 461a35c101eff8c2 +0 21698 1724919157500677002 /home/pengc02/pengcheng/projects/gaussian_avatar/ag_gha/AnimatableGaussians/network/styleunet/build/temp.linux-x86_64-cpython-310/fused_bias_act.o 358eb3e9ca47c1a7 +0 15173 1728122469711358682 /home/pengc02/pengcheng/projects/gaussian_avatar/avatar_final/AnimatableGaussians/network/styleunet/build/temp.linux-x86_64-cpython-310/upfirdn2d_kernel.o 67a32656922742c3 +0 16357 1728122470883331785 /home/pengc02/pengcheng/projects/gaussian_avatar/avatar_final/AnimatableGaussians/network/styleunet/build/temp.linux-x86_64-cpython-310/upfirdn2d.o 95d558bfdb32e18b +0 14921 1728122487258956132 /home/pengc02/pengcheng/projects/gaussian_avatar/avatar_final/AnimatableGaussians/network/styleunet/build/temp.linux-x86_64-cpython-310/fused_bias_act_kernel.o 357b3a013165c590 +0 16645 1728122488966916969 /home/pengc02/pengcheng/projects/gaussian_avatar/avatar_final/AnimatableGaussians/network/styleunet/build/temp.linux-x86_64-cpython-310/fused_bias_act.o e1993a5772e6e083 +19 17220 1728123422445173009 /home/pengc02/pengcheng/projects/gaussian_avatar/avatar_final/AnimatableGaussians/network/styleunet/build/temp.linux-x86_64-cpython-310/upfirdn2d_kernel.o b9ff736abe93fa28 +19 22273 1728123427469122699 /home/pengc02/pengcheng/projects/gaussian_avatar/avatar_final/AnimatableGaussians/network/styleunet/build/temp.linux-x86_64-cpython-310/upfirdn2d.o 5057bebcc65d4cc0 +19 16890 1728123445664936836 /home/pengc02/pengcheng/projects/gaussian_avatar/avatar_final/AnimatableGaussians/network/styleunet/build/temp.linux-x86_64-cpython-310/fused_bias_act_kernel.o 4e8b18513f7fa350 +18 21955 1728123450708884321 /home/pengc02/pengcheng/projects/gaussian_avatar/avatar_final/AnimatableGaussians/network/styleunet/build/temp.linux-x86_64-cpython-310/fused_bias_act.o 5b9827a959b72242 diff --git a/AnimatableGaussians/network/styleunet/build/temp.linux-x86_64-cpython-310/build.ninja b/AnimatableGaussians/network/styleunet/build/temp.linux-x86_64-cpython-310/build.ninja new file mode 100644 index 0000000000000000000000000000000000000000..f7bc71d5f5fb8dce9bf3a51b4fdf83b55a84c57c --- /dev/null +++ b/AnimatableGaussians/network/styleunet/build/temp.linux-x86_64-cpython-310/build.ninja @@ -0,0 +1,34 @@ +ninja_required_version = 1.3 +cxx = c++ +nvcc = /usr/local/cuda-11.3/bin/nvcc + +cflags = -pthread -B /home/pengc02/anaconda3/envs/ag/compiler_compat -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -fPIC -O2 -isystem /home/pengc02/anaconda3/envs/ag/include -fPIC -O2 -isystem /home/pengc02/anaconda3/envs/ag/include -fPIC -I/home/pengc02/anaconda3/envs/ag/lib/python3.10/site-packages/torch/include -I/home/pengc02/anaconda3/envs/ag/lib/python3.10/site-packages/torch/include/torch/csrc/api/include -I/home/pengc02/anaconda3/envs/ag/lib/python3.10/site-packages/torch/include/TH -I/home/pengc02/anaconda3/envs/ag/lib/python3.10/site-packages/torch/include/THC -I/usr/local/cuda-11.3/include -I/home/pengc02/anaconda3/envs/ag/include/python3.10 -c +post_cflags = -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=fused -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++17 +cuda_cflags = -I/home/pengc02/anaconda3/envs/ag/lib/python3.10/site-packages/torch/include -I/home/pengc02/anaconda3/envs/ag/lib/python3.10/site-packages/torch/include/torch/csrc/api/include -I/home/pengc02/anaconda3/envs/ag/lib/python3.10/site-packages/torch/include/TH -I/home/pengc02/anaconda3/envs/ag/lib/python3.10/site-packages/torch/include/THC -I/usr/local/cuda-11.3/include -I/home/pengc02/anaconda3/envs/ag/include/python3.10 -c +cuda_post_cflags = -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_BFLOAT16_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr --compiler-options ''"'"'-fPIC'"'"'' -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=fused -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_86,code=compute_86 -gencode=arch=compute_86,code=sm_86 -std=c++17 +cuda_dlink_post_cflags = +ldflags = + +rule compile + command = $cxx -MMD -MF $out.d $cflags -c $in -o $out $post_cflags + depfile = $out.d + deps = gcc + +rule cuda_compile + depfile = $out.d + deps = gcc + command = $nvcc $cuda_cflags -c $in -o $out $cuda_post_cflags + + + + + +build /home/pengc02/pengcheng/projects/gaussian_avatar/avatar_final/AnimatableGaussians/network/styleunet/build/temp.linux-x86_64-cpython-310/fused_bias_act.o: compile /home/pengc02/pengcheng/projects/gaussian_avatar/avatar_final/AnimatableGaussians/network/styleunet/fused_bias_act.cpp +build /home/pengc02/pengcheng/projects/gaussian_avatar/avatar_final/AnimatableGaussians/network/styleunet/build/temp.linux-x86_64-cpython-310/fused_bias_act_kernel.o: cuda_compile /home/pengc02/pengcheng/projects/gaussian_avatar/avatar_final/AnimatableGaussians/network/styleunet/fused_bias_act_kernel.cu + + + + + + + diff --git a/AnimatableGaussians/network/styleunet/build/temp.linux-x86_64-cpython-310/fused_bias_act.o b/AnimatableGaussians/network/styleunet/build/temp.linux-x86_64-cpython-310/fused_bias_act.o new file mode 100644 index 0000000000000000000000000000000000000000..68f35bded0dea34133089e206bc8ef1d5fea1a79 --- /dev/null +++ b/AnimatableGaussians/network/styleunet/build/temp.linux-x86_64-cpython-310/fused_bias_act.o @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8a63a040c90361f4852d7972dab2df22d7881be73c9470466fd63b33d3584a5b +size 18355224 diff --git a/AnimatableGaussians/network/styleunet/build/temp.linux-x86_64-cpython-310/fused_bias_act_kernel.o b/AnimatableGaussians/network/styleunet/build/temp.linux-x86_64-cpython-310/fused_bias_act_kernel.o new file mode 100644 index 0000000000000000000000000000000000000000..ff5ab7ffeaf6f4cc8efb7bc27a204e5680e305ce Binary files /dev/null and b/AnimatableGaussians/network/styleunet/build/temp.linux-x86_64-cpython-310/fused_bias_act_kernel.o differ diff --git a/AnimatableGaussians/network/styleunet/build/temp.linux-x86_64-cpython-310/upfirdn2d.o b/AnimatableGaussians/network/styleunet/build/temp.linux-x86_64-cpython-310/upfirdn2d.o new file mode 100644 index 0000000000000000000000000000000000000000..044ce0bcc487185effd77442fdd18aec7bf07a37 --- /dev/null +++ b/AnimatableGaussians/network/styleunet/build/temp.linux-x86_64-cpython-310/upfirdn2d.o @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8faddae26b38071085853c46ce0a71dad3a7cfa7b02e4e2476968767e2488da8 +size 18370096 diff --git a/AnimatableGaussians/network/styleunet/build/temp.linux-x86_64-cpython-310/upfirdn2d_kernel.o b/AnimatableGaussians/network/styleunet/build/temp.linux-x86_64-cpython-310/upfirdn2d_kernel.o new file mode 100644 index 0000000000000000000000000000000000000000..82a31c03850495ddddfd226819846b553c7cb41e Binary files /dev/null and b/AnimatableGaussians/network/styleunet/build/temp.linux-x86_64-cpython-310/upfirdn2d_kernel.o differ diff --git a/AnimatableGaussians/network/styleunet/build/temp.win-amd64-cpython-38/Release/.ninja_deps b/AnimatableGaussians/network/styleunet/build/temp.win-amd64-cpython-38/Release/.ninja_deps new file mode 100644 index 0000000000000000000000000000000000000000..bf992aefda36bb54a23971b54df1fb322ca98fa9 Binary files /dev/null and b/AnimatableGaussians/network/styleunet/build/temp.win-amd64-cpython-38/Release/.ninja_deps differ diff --git a/AnimatableGaussians/network/styleunet/build/temp.win-amd64-cpython-38/Release/.ninja_log b/AnimatableGaussians/network/styleunet/build/temp.win-amd64-cpython-38/Release/.ninja_log new file mode 100644 index 0000000000000000000000000000000000000000..d98ba15fa373d2334408da3d4ce382c1e4953e49 --- /dev/null +++ b/AnimatableGaussians/network/styleunet/build/temp.win-amd64-cpython-38/Release/.ninja_log @@ -0,0 +1,5 @@ +# ninja log v5 +9 13895 7406531192106109 D:/GaussianSplatting/code_huawei/AnimatableGaussians/network/styleunet/build/temp.win-amd64-cpython-38/Release/upfirdn2d.obj 6b8a10bfff744f98 +14 21740 7406531270320712 D:/GaussianSplatting/code_huawei/AnimatableGaussians/network/styleunet/build/temp.win-amd64-cpython-38/Release/upfirdn2d_kernel.obj 1b3b5be09ab30ba5 +23 11891 7406531443407986 D:/GaussianSplatting/code_huawei/AnimatableGaussians/network/styleunet/build/temp.win-amd64-cpython-38/Release/fused_bias_act.obj 8c9ba14879f0d8c2 +27 18741 7406531511669820 D:/GaussianSplatting/code_huawei/AnimatableGaussians/network/styleunet/build/temp.win-amd64-cpython-38/Release/fused_bias_act_kernel.obj 4c3c0b07ae009474 diff --git a/AnimatableGaussians/network/styleunet/build/temp.win-amd64-cpython-38/Release/build.ninja b/AnimatableGaussians/network/styleunet/build/temp.win-amd64-cpython-38/Release/build.ninja new file mode 100644 index 0000000000000000000000000000000000000000..cdaa1edcf642e39daa99eb2d2464f8f87bf3c922 --- /dev/null +++ b/AnimatableGaussians/network/styleunet/build/temp.win-amd64-cpython-38/Release/build.ninja @@ -0,0 +1,32 @@ +ninja_required_version = 1.3 +cxx = cl +nvcc = C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\bin\nvcc + +cflags = /nologo /O2 /W3 /GL /DNDEBUG /MD /MD /wd4819 /wd4251 /wd4244 /wd4267 /wd4275 /wd4018 /wd4190 /wd4624 /wd4067 /wd4068 /EHsc -IC:\Users\Admin\anaconda3\envs\gaussian_huawei\lib\site-packages\torch\include -IC:\Users\Admin\anaconda3\envs\gaussian_huawei\lib\site-packages\torch\include\torch\csrc\api\include -IC:\Users\Admin\anaconda3\envs\gaussian_huawei\lib\site-packages\torch\include\TH -IC:\Users\Admin\anaconda3\envs\gaussian_huawei\lib\site-packages\torch\include\THC "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\include" -IC:\Users\Admin\anaconda3\envs\gaussian_huawei\include -IC:\Users\Admin\anaconda3\envs\gaussian_huawei\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\cppwinrt" +post_cflags = -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=fused -D_GLIBCXX_USE_CXX11_ABI=0 /std:c++17 +cuda_cflags = -std=c++17 --use-local-env -Xcompiler /MD -Xcompiler /wd4819 -Xcompiler /wd4251 -Xcompiler /wd4244 -Xcompiler /wd4267 -Xcompiler /wd4275 -Xcompiler /wd4018 -Xcompiler /wd4190 -Xcompiler /wd4624 -Xcompiler /wd4067 -Xcompiler /wd4068 -Xcompiler /EHsc -Xcudafe --diag_suppress=base_class_has_different_dll_interface -Xcudafe --diag_suppress=field_without_dll_interface -Xcudafe --diag_suppress=dll_interface_conflict_none_assumed -Xcudafe --diag_suppress=dll_interface_conflict_dllexport_assumed -IC:\Users\Admin\anaconda3\envs\gaussian_huawei\lib\site-packages\torch\include -IC:\Users\Admin\anaconda3\envs\gaussian_huawei\lib\site-packages\torch\include\torch\csrc\api\include -IC:\Users\Admin\anaconda3\envs\gaussian_huawei\lib\site-packages\torch\include\TH -IC:\Users\Admin\anaconda3\envs\gaussian_huawei\lib\site-packages\torch\include\THC "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\include" -IC:\Users\Admin\anaconda3\envs\gaussian_huawei\include -IC:\Users\Admin\anaconda3\envs\gaussian_huawei\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\cppwinrt" +cuda_post_cflags = -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_BFLOAT16_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=fused -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_89,code=compute_89 -gencode=arch=compute_89,code=sm_89 +cuda_dlink_post_cflags = +ldflags = + +rule compile + command = cl /showIncludes $cflags -c $in /Fo$out $post_cflags + deps = msvc + +rule cuda_compile + depfile = $out.d + deps = gcc + command = $nvcc --generate-dependencies-with-compile --dependency-output $out.d $cuda_cflags -c $in -o $out $cuda_post_cflags + + + + + +build D$:\GaussianSplatting\code_huawei\AnimatableGaussians\network\styleunet\build\temp.win-amd64-cpython-38\Release\fused_bias_act.obj: compile D$:\GaussianSplatting\code_huawei\AnimatableGaussians\network\styleunet\fused_bias_act.cpp +build D$:\GaussianSplatting\code_huawei\AnimatableGaussians\network\styleunet\build\temp.win-amd64-cpython-38\Release\fused_bias_act_kernel.obj: cuda_compile D$:\GaussianSplatting\code_huawei\AnimatableGaussians\network\styleunet\fused_bias_act_kernel.cu + + + + + + diff --git a/AnimatableGaussians/network/styleunet/build/temp.win-amd64-cpython-38/Release/fused.cp38-win_amd64.exp b/AnimatableGaussians/network/styleunet/build/temp.win-amd64-cpython-38/Release/fused.cp38-win_amd64.exp new file mode 100644 index 0000000000000000000000000000000000000000..f90188a871d00f153d9b0079864cd6b76754cb52 Binary files /dev/null and b/AnimatableGaussians/network/styleunet/build/temp.win-amd64-cpython-38/Release/fused.cp38-win_amd64.exp differ diff --git a/AnimatableGaussians/network/styleunet/build/temp.win-amd64-cpython-38/Release/fused.cp38-win_amd64.lib b/AnimatableGaussians/network/styleunet/build/temp.win-amd64-cpython-38/Release/fused.cp38-win_amd64.lib new file mode 100644 index 0000000000000000000000000000000000000000..7e06f27b89b37d49e11759d5d18c2dec251823d0 Binary files /dev/null and b/AnimatableGaussians/network/styleunet/build/temp.win-amd64-cpython-38/Release/fused.cp38-win_amd64.lib differ diff --git a/AnimatableGaussians/network/styleunet/build/temp.win-amd64-cpython-38/Release/fused_bias_act.obj b/AnimatableGaussians/network/styleunet/build/temp.win-amd64-cpython-38/Release/fused_bias_act.obj new file mode 100644 index 0000000000000000000000000000000000000000..3524d72b0ff3faf8b9c2de240b4e071451576c68 --- /dev/null +++ b/AnimatableGaussians/network/styleunet/build/temp.win-amd64-cpython-38/Release/fused_bias_act.obj @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:745e162817db55ee0a19cb2354cda1eae72189204fe6d2996dd5aae9a0d532a1 +size 42069025 diff --git a/AnimatableGaussians/network/styleunet/build/temp.win-amd64-cpython-38/Release/fused_bias_act_kernel.obj b/AnimatableGaussians/network/styleunet/build/temp.win-amd64-cpython-38/Release/fused_bias_act_kernel.obj new file mode 100644 index 0000000000000000000000000000000000000000..473a601d10c4e74db60f7b5bffeb670815a66383 --- /dev/null +++ b/AnimatableGaussians/network/styleunet/build/temp.win-amd64-cpython-38/Release/fused_bias_act_kernel.obj @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7ee634180e71fbcdff409caa081ec735676b26701f2382561d65ac5cc2a7a222 +size 1267845 diff --git a/AnimatableGaussians/network/styleunet/build/temp.win-amd64-cpython-38/Release/upfirdn2d.cp38-win_amd64.exp b/AnimatableGaussians/network/styleunet/build/temp.win-amd64-cpython-38/Release/upfirdn2d.cp38-win_amd64.exp new file mode 100644 index 0000000000000000000000000000000000000000..43f6944f8f321ac898f7e28441eecb4d9f762e0c Binary files /dev/null and b/AnimatableGaussians/network/styleunet/build/temp.win-amd64-cpython-38/Release/upfirdn2d.cp38-win_amd64.exp differ diff --git a/AnimatableGaussians/network/styleunet/build/temp.win-amd64-cpython-38/Release/upfirdn2d.cp38-win_amd64.lib b/AnimatableGaussians/network/styleunet/build/temp.win-amd64-cpython-38/Release/upfirdn2d.cp38-win_amd64.lib new file mode 100644 index 0000000000000000000000000000000000000000..af792188074b34fe82a7736a0dca5f4944f3b5fa Binary files /dev/null and b/AnimatableGaussians/network/styleunet/build/temp.win-amd64-cpython-38/Release/upfirdn2d.cp38-win_amd64.lib differ diff --git a/AnimatableGaussians/network/styleunet/build/temp.win-amd64-cpython-38/Release/upfirdn2d.obj b/AnimatableGaussians/network/styleunet/build/temp.win-amd64-cpython-38/Release/upfirdn2d.obj new file mode 100644 index 0000000000000000000000000000000000000000..c693b48074661be77c79d139bebf040080c6470f --- /dev/null +++ b/AnimatableGaussians/network/styleunet/build/temp.win-amd64-cpython-38/Release/upfirdn2d.obj @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:021d77da2715c9c01c038522a918cd8c8217748cb904ce83d9b56b830a7049b5 +size 42145025 diff --git a/AnimatableGaussians/network/styleunet/build/temp.win-amd64-cpython-38/Release/upfirdn2d_kernel.obj b/AnimatableGaussians/network/styleunet/build/temp.win-amd64-cpython-38/Release/upfirdn2d_kernel.obj new file mode 100644 index 0000000000000000000000000000000000000000..b204f897c29059aecad71059d9b2f0d36248531d --- /dev/null +++ b/AnimatableGaussians/network/styleunet/build/temp.win-amd64-cpython-38/Release/upfirdn2d_kernel.obj @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:afd1c77a250c0ccdf8f3a52b52c3546cb8755c4cda538b7adc25f86123cae920 +size 1420438 diff --git a/AnimatableGaussians/network/styleunet/conv2d_gradfix.py b/AnimatableGaussians/network/styleunet/conv2d_gradfix.py new file mode 100644 index 0000000000000000000000000000000000000000..90dac1fbd1338f885ad70e56df9851216366bcb1 --- /dev/null +++ b/AnimatableGaussians/network/styleunet/conv2d_gradfix.py @@ -0,0 +1,227 @@ +import contextlib +import warnings + +import torch +from torch import autograd +from torch.nn import functional as F + +enabled = True +weight_gradients_disabled = False + + +@contextlib.contextmanager +def no_weight_gradients(): + global weight_gradients_disabled + + old = weight_gradients_disabled + weight_gradients_disabled = True + yield + weight_gradients_disabled = old + + +def conv2d(input, weight, bias=None, stride=1, padding=0, dilation=1, groups=1): + if could_use_op(input): + return conv2d_gradfix( + transpose=False, + weight_shape=weight.shape, + stride=stride, + padding=padding, + output_padding=0, + dilation=dilation, + groups=groups, + ).apply(input, weight, bias) + + return F.conv2d( + input=input, + weight=weight, + bias=bias, + stride=stride, + padding=padding, + dilation=dilation, + groups=groups, + ) + + +def conv_transpose2d( + input, + weight, + bias=None, + stride=1, + padding=0, + output_padding=0, + groups=1, + dilation=1, +): + if could_use_op(input): + return conv2d_gradfix( + transpose=True, + weight_shape=weight.shape, + stride=stride, + padding=padding, + output_padding=output_padding, + groups=groups, + dilation=dilation, + ).apply(input, weight, bias) + + return F.conv_transpose2d( + input=input, + weight=weight, + bias=bias, + stride=stride, + padding=padding, + output_padding=output_padding, + dilation=dilation, + groups=groups, + ) + + +def could_use_op(input): + if (not enabled) or (not torch.backends.cudnn.enabled): + return False + + if input.device.type != "cuda": + return False + + if any(torch.__version__.startswith(x) for x in ["1.7.", "1.8.", "1.9.", "1.12."]): + return True + + # warnings.warn( + # f"conv2d_gradfix not supported on PyTorch {torch.__version__}. Falling back to torch.nn.functional.conv2d()." + # ) + + return False + + +def ensure_tuple(xs, ndim): + xs = tuple(xs) if isinstance(xs, (tuple, list)) else (xs,) * ndim + + return xs + + +conv2d_gradfix_cache = dict() + + +def conv2d_gradfix( + transpose, weight_shape, stride, padding, output_padding, dilation, groups +): + ndim = 2 + weight_shape = tuple(weight_shape) + stride = ensure_tuple(stride, ndim) + padding = ensure_tuple(padding, ndim) + output_padding = ensure_tuple(output_padding, ndim) + dilation = ensure_tuple(dilation, ndim) + + key = (transpose, weight_shape, stride, padding, output_padding, dilation, groups) + if key in conv2d_gradfix_cache: + return conv2d_gradfix_cache[key] + + common_kwargs = dict( + stride=stride, padding=padding, dilation=dilation, groups=groups + ) + + def calc_output_padding(input_shape, output_shape): + if transpose: + return [0, 0] + + return [ + input_shape[i + 2] + - (output_shape[i + 2] - 1) * stride[i] + - (1 - 2 * padding[i]) + - dilation[i] * (weight_shape[i + 2] - 1) + for i in range(ndim) + ] + + class Conv2d(autograd.Function): + @staticmethod + def forward(ctx, input, weight, bias): + if not transpose: + out = F.conv2d(input=input, weight=weight, bias=bias, **common_kwargs) + + else: + out = F.conv_transpose2d( + input=input, + weight=weight, + bias=bias, + output_padding=output_padding, + **common_kwargs, + ) + + ctx.save_for_backward(input, weight) + + return out + + @staticmethod + def backward(ctx, grad_output): + input, weight = ctx.saved_tensors + grad_input, grad_weight, grad_bias = None, None, None + + if ctx.needs_input_grad[0]: + p = calc_output_padding( + input_shape=input.shape, output_shape=grad_output.shape + ) + grad_input = conv2d_gradfix( + transpose=(not transpose), + weight_shape=weight_shape, + output_padding=p, + **common_kwargs, + ).apply(grad_output, weight, None) + + if ctx.needs_input_grad[1] and not weight_gradients_disabled: + grad_weight = Conv2dGradWeight.apply(grad_output, input) + + if ctx.needs_input_grad[2]: + grad_bias = grad_output.sum((0, 2, 3)) + + return grad_input, grad_weight, grad_bias + + class Conv2dGradWeight(autograd.Function): + @staticmethod + def forward(ctx, grad_output, input): + op = torch._C._jit_get_operation( + "aten::cudnn_convolution_backward_weight" + if not transpose + else "aten::cudnn_convolution_transpose_backward_weight" + ) + flags = [ + torch.backends.cudnn.benchmark, + torch.backends.cudnn.deterministic, + torch.backends.cudnn.allow_tf32, + ] + grad_weight = op( + weight_shape, + grad_output, + input, + padding, + stride, + dilation, + groups, + *flags, + ) + ctx.save_for_backward(grad_output, input) + + return grad_weight + + @staticmethod + def backward(ctx, grad_grad_weight): + grad_output, input = ctx.saved_tensors + grad_grad_output, grad_grad_input = None, None + + if ctx.needs_input_grad[0]: + grad_grad_output = Conv2d.apply(input, grad_grad_weight, None) + + if ctx.needs_input_grad[1]: + p = calc_output_padding( + input_shape=input.shape, output_shape=grad_output.shape + ) + grad_grad_input = conv2d_gradfix( + transpose=(not transpose), + weight_shape=weight_shape, + output_padding=p, + **common_kwargs, + ).apply(grad_output, grad_grad_weight, None) + + return grad_grad_output, grad_grad_input + + conv2d_gradfix_cache[key] = Conv2d + + return Conv2d diff --git a/AnimatableGaussians/network/styleunet/dist/fused-0.0.0-py3.10-linux-x86_64.egg b/AnimatableGaussians/network/styleunet/dist/fused-0.0.0-py3.10-linux-x86_64.egg new file mode 100644 index 0000000000000000000000000000000000000000..900558e9356eeccbabde0d4440f61b09bb511e2d --- /dev/null +++ b/AnimatableGaussians/network/styleunet/dist/fused-0.0.0-py3.10-linux-x86_64.egg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ebad0db1fd8653d9ba18e8ed59e62581aac2e9aca6f9e19a342f41fed28f49d7 +size 6717374 diff --git a/AnimatableGaussians/network/styleunet/dist/fused-0.0.0-py3.8-win-amd64.egg b/AnimatableGaussians/network/styleunet/dist/fused-0.0.0-py3.8-win-amd64.egg new file mode 100644 index 0000000000000000000000000000000000000000..d0490d8096475b6fa2c73bba47247a4043f3c421 Binary files /dev/null and b/AnimatableGaussians/network/styleunet/dist/fused-0.0.0-py3.8-win-amd64.egg differ diff --git a/AnimatableGaussians/network/styleunet/dist/upfirdn2d-0.0.0-py3.10-linux-x86_64.egg b/AnimatableGaussians/network/styleunet/dist/upfirdn2d-0.0.0-py3.10-linux-x86_64.egg new file mode 100644 index 0000000000000000000000000000000000000000..dd034d3c1f35c17cf8c9b527abafdb7af9163490 --- /dev/null +++ b/AnimatableGaussians/network/styleunet/dist/upfirdn2d-0.0.0-py3.10-linux-x86_64.egg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:393754c2bccabe47752fcd9d6a7a3d68d85e649875615493e04e8569036d855b +size 6717393 diff --git a/AnimatableGaussians/network/styleunet/dist/upfirdn2d-0.0.0-py3.8-win-amd64.egg b/AnimatableGaussians/network/styleunet/dist/upfirdn2d-0.0.0-py3.8-win-amd64.egg new file mode 100644 index 0000000000000000000000000000000000000000..65b5a372ebdcbdd56ab6d953cb99fa93c195c190 Binary files /dev/null and b/AnimatableGaussians/network/styleunet/dist/upfirdn2d-0.0.0-py3.8-win-amd64.egg differ diff --git a/AnimatableGaussians/network/styleunet/dual_styleunet.py b/AnimatableGaussians/network/styleunet/dual_styleunet.py new file mode 100644 index 0000000000000000000000000000000000000000..3227c9468d5c48137e52d7a2a76ee0e29398d4d1 --- /dev/null +++ b/AnimatableGaussians/network/styleunet/dual_styleunet.py @@ -0,0 +1,911 @@ +import math +import random +import numpy as np +import torch +from torch import nn +from torch.nn import functional as F + +from .fused_act import FusedLeakyReLU, fused_leaky_relu +from .upfirdn2d import upfirdn2d +from . import conv2d_gradfix + + +class PixelNorm(nn.Module): + def __init__(self): + super().__init__() + + def forward(self, input): + return input * torch.rsqrt(torch.mean(input ** 2, dim=1, keepdim=True) + 1e-8) + + +def make_kernel(k): + k = torch.tensor(k, dtype=torch.float32) + + if k.ndim == 1: + k = k[None, :] * k[:, None] + + k /= k.sum() + + return k + + +class Upsample(nn.Module): + def __init__(self, kernel, factor=2): + super().__init__() + + self.factor = factor + kernel = make_kernel(kernel) * (factor ** 2) + self.register_buffer("kernel", kernel) + + p = kernel.shape[0] - factor + + pad0 = (p + 1) // 2 + factor - 1 + pad1 = p // 2 + + self.pad = (pad0, pad1) + + def forward(self, input): + out = upfirdn2d(input, self.kernel, up=self.factor, down=1, pad=self.pad) + + return out + + +class Downsample(nn.Module): + def __init__(self, kernel, factor=2): + super().__init__() + + self.factor = factor + kernel = make_kernel(kernel) + self.register_buffer("kernel", kernel) + + p = kernel.shape[0] - factor + + pad0 = (p + 1) // 2 + pad1 = p // 2 + + self.pad = (pad0, pad1) + + def forward(self, input): + out = upfirdn2d(input, self.kernel, up=1, down=self.factor, pad=self.pad) + + return out + + +class Blur(nn.Module): + def __init__(self, kernel, pad, upsample_factor=1): + super().__init__() + + kernel = make_kernel(kernel) + + if upsample_factor > 1: + kernel = kernel * (upsample_factor ** 2) + + self.register_buffer("kernel", kernel) + + self.pad = pad + + def forward(self, input): + out = upfirdn2d(input, self.kernel, pad=self.pad) + + return out + + +class EqualConv2d(nn.Module): + def __init__( + self, in_channel, out_channel, kernel_size, stride=1, padding=0, bias=True + ): + super().__init__() + + self.weight = nn.Parameter( + torch.randn(out_channel, in_channel, kernel_size, kernel_size) + ) + self.scale = 1 / math.sqrt(in_channel * kernel_size ** 2) + + self.stride = stride + self.padding = padding + + if bias: + self.bias = nn.Parameter(torch.zeros(out_channel)) + + else: + self.bias = None + + def forward(self, input): + out = conv2d_gradfix.conv2d( + input, + self.weight * self.scale, + bias=self.bias, + stride=self.stride, + padding=self.padding, + ) + + return out + + def __repr__(self): + return ( + f"{self.__class__.__name__}({self.weight.shape[1]}, {self.weight.shape[0]}," + f" {self.weight.shape[2]}, stride={self.stride}, padding={self.padding})" + ) + + +class EqualLinear(nn.Module): + def __init__( + self, in_dim, out_dim, bias=True, bias_init=0.0, lr_mul=1.0, activation=None + ): + super().__init__() + + self.weight = nn.Parameter(torch.randn(out_dim, in_dim).div_(lr_mul)) + + if bias: + self.bias = nn.Parameter(torch.zeros(out_dim).fill_(bias_init)) + + else: + self.bias = None + + self.activation = activation + + self.scale = (1 / math.sqrt(in_dim)) * lr_mul + self.lr_mul = lr_mul + + def forward(self, input): + if self.activation: + out = F.linear(input, self.weight * self.scale) + out = fused_leaky_relu(out, self.bias * self.lr_mul) + + else: + out = F.linear( + input, self.weight * self.scale, bias=self.bias * self.lr_mul + ) + + return out + + def __repr__(self): + return ( + f"{self.__class__.__name__}({self.weight.shape[1]}, {self.weight.shape[0]})" + ) + + +class ModulatedConv2d(nn.Module): + def __init__( + self, + in_channel, + out_channel, + kernel_size, + style_dim, + demodulate=True, + upsample=False, + downsample=False, + blur_kernel=[1, 3, 3, 1], + fused=True, + ): + super().__init__() + + self.eps = 1e-8 + self.kernel_size = kernel_size + self.in_channel = in_channel + self.out_channel = out_channel + self.upsample = upsample + self.downsample = downsample + + if upsample: + factor = 2 + p = (len(blur_kernel) - factor) - (kernel_size - 1) + pad0 = (p + 1) // 2 + factor - 1 + pad1 = p // 2 + 1 + + self.blur = Blur(blur_kernel, pad=(pad0, pad1), upsample_factor=factor) + + if downsample: + factor = 2 + p = (len(blur_kernel) - factor) + (kernel_size - 1) + pad0 = (p + 1) // 2 + pad1 = p // 2 + + self.blur = Blur(blur_kernel, pad=(pad0, pad1)) + + fan_in = in_channel * kernel_size ** 2 + self.scale = 1 / math.sqrt(fan_in) + self.padding = kernel_size // 2 + + self.weight = nn.Parameter( + torch.randn(1, out_channel, in_channel, kernel_size, kernel_size) + ) + + self.modulation = EqualLinear(style_dim, in_channel, bias_init=1) + + self.demodulate = demodulate + self.fused = fused + + def __repr__(self): + return ( + f"{self.__class__.__name__}({self.in_channel}, {self.out_channel}, {self.kernel_size}, " + f"upsample={self.upsample}, downsample={self.downsample})" + ) + + def forward(self, input, style): + batch, in_channel, height, width = input.shape + + if not self.fused: + weight = self.scale * self.weight.squeeze(0) + style = self.modulation(style) + if self.demodulate: + w = weight.unsqueeze(0) * style.view(batch, 1, in_channel, 1, 1) + dcoefs = (w.square().sum((2, 3, 4)) + 1e-8).rsqrt() + + input = input * style.reshape(batch, in_channel, 1, 1) + + if self.upsample: + weight = weight.transpose(0, 1) + out = conv2d_gradfix.conv_transpose2d( + input, weight, padding=0, stride=2 + ) + out = self.blur(out) + + elif self.downsample: + input = self.blur(input) + out = conv2d_gradfix.conv2d(input, weight, padding=0, stride=2) + + else: + out = conv2d_gradfix.conv2d(input, weight, padding=self.padding) + + if self.demodulate: + out = out * dcoefs.view(batch, -1, 1, 1) + + return out + + style = self.modulation(style).view(batch, 1, in_channel, 1, 1) + weight = self.scale * self.weight * style + + if self.demodulate: + demod = torch.rsqrt(weight.pow(2).sum([2, 3, 4]) + 1e-8) + weight = weight * demod.view(batch, self.out_channel, 1, 1, 1) + + weight = weight.view( + batch * self.out_channel, in_channel, self.kernel_size, self.kernel_size + ) + + if self.upsample: + input = input.view(1, batch * in_channel, height, width) + weight = weight.view( + batch, self.out_channel, in_channel, self.kernel_size, self.kernel_size + ) + weight = weight.transpose(1, 2).reshape( + batch * in_channel, self.out_channel, self.kernel_size, self.kernel_size + ) + out = conv2d_gradfix.conv_transpose2d( + input, weight, padding=0, stride=2, groups=batch + ) + _, _, height, width = out.shape + out = out.view(batch, self.out_channel, height, width) + out = self.blur(out) + + elif self.downsample: + input = self.blur(input) + _, _, height, width = input.shape + input = input.view(1, batch * in_channel, height, width) + out = conv2d_gradfix.conv2d( + input, weight, padding=0, stride=2, groups=batch + ) + _, _, height, width = out.shape + out = out.view(batch, self.out_channel, height, width) + + else: + input = input.view(1, batch * in_channel, height, width) + out = conv2d_gradfix.conv2d( + input, weight, padding=self.padding, groups=batch + ) + _, _, height, width = out.shape + out = out.view(batch, self.out_channel, height, width) + + return out + + +class NoiseInjection(nn.Module): + def __init__(self): + super().__init__() + + self.weight = nn.Parameter(torch.zeros(1)) + + def forward(self, image, noise=None): + if noise is None: + batch, _, height, width = image.shape + noise = image.new_empty(batch, 1, height, width).normal_() + return image + self.weight * noise + + +class ConstantInput(nn.Module): + def __init__(self, channel, size=4): + super().__init__() + + self.input = nn.Parameter(torch.randn(1, channel, size, size)) + + def forward(self, input): + batch = input.shape[0] + out = self.input.repeat(batch, 1, 1, 1) + + return out + + +class ConvLayer(nn.Sequential): + def __init__( + self, + in_channel, + out_channel, + kernel_size, + downsample=False, + blur_kernel=[1, 3, 3, 1], + bias=True, + activate=True, + ): + layers = [] + + if downsample: + factor = 2 + p = (len(blur_kernel) - factor) + (kernel_size - 1) + pad0 = (p + 1) // 2 + pad1 = p // 2 + + layers.append(Blur(blur_kernel, pad=(pad0, pad1))) + + stride = 2 + self.padding = 0 + + else: + stride = 1 + self.padding = kernel_size // 2 + + layers.append( + EqualConv2d( + in_channel, + out_channel, + kernel_size, + padding=self.padding, + stride=stride, + bias=bias and not activate, + ) + ) + + if activate: + layers.append(FusedLeakyReLU(out_channel, bias=bias)) + + super().__init__(*layers) + + +def get_haar_wavelet(in_channels): + haar_wav_l = 1 / (2 ** 0.5) * torch.ones(1, 2) + haar_wav_h = 1 / (2 ** 0.5) * torch.ones(1, 2) + haar_wav_h[0, 0] = -1 * haar_wav_h[0, 0] + + haar_wav_ll = haar_wav_l.T * haar_wav_l + haar_wav_lh = haar_wav_h.T * haar_wav_l + haar_wav_hl = haar_wav_l.T * haar_wav_h + haar_wav_hh = haar_wav_h.T * haar_wav_h + + return haar_wav_ll, haar_wav_lh, haar_wav_hl, haar_wav_hh + + +class HaarTransform(nn.Module): + def __init__(self, in_channels): + super().__init__() + + ll, lh, hl, hh = get_haar_wavelet(in_channels) + + self.register_buffer('ll', ll) + self.register_buffer('lh', lh) + self.register_buffer('hl', hl) + self.register_buffer('hh', hh) + + def forward(self, input): + ll = upfirdn2d(input, self.ll, down=2) + lh = upfirdn2d(input, self.lh, down=2) + hl = upfirdn2d(input, self.hl, down=2) + hh = upfirdn2d(input, self.hh, down=2) + + return torch.cat((ll, lh, hl, hh), 1) + + +class InverseHaarTransform(nn.Module): + def __init__(self, in_channels): + super().__init__() + + ll, lh, hl, hh = get_haar_wavelet(in_channels) + + self.register_buffer('ll', ll) + self.register_buffer('lh', -lh) + self.register_buffer('hl', -hl) + self.register_buffer('hh', hh) + + def forward(self, input): + ll, lh, hl, hh = input.chunk(4, 1) + ll = upfirdn2d(ll, self.ll, up=2, pad=(1, 0, 1, 0)) + lh = upfirdn2d(lh, self.lh, up=2, pad=(1, 0, 1, 0)) + hl = upfirdn2d(hl, self.hl, up=2, pad=(1, 0, 1, 0)) + hh = upfirdn2d(hh, self.hh, up=2, pad=(1, 0, 1, 0)) + + return ll + lh + hl + hh + + +class ConvBlock(nn.Module): + def __init__(self, in_channel, out_channel, blur_kernel=[1, 3, 3, 1], downsample=True): + super().__init__() + + self.conv1 = ConvLayer(in_channel, in_channel, 3) + self.conv2 = ConvLayer(in_channel, out_channel, 3, downsample=downsample) + + def forward(self, input): + out = self.conv1(input) + out = self.conv2(out) + + return out + + +class FromRGB(nn.Module): + def __init__(self, out_channel, in_channel, downsample=True, blur_kernel=[1, 3, 3, 1], use_wt=True): + super().__init__() + + self.downsample = downsample + self.use_wt = use_wt + if downsample: + self.downsample = Downsample(blur_kernel) + if use_wt: + self.iwt = InverseHaarTransform(in_channel) + self.dwt = HaarTransform(in_channel) + self.in_channel = in_channel * 4 if self.use_wt else in_channel + self.conv = ConvLayer(self.in_channel, out_channel, 1) + + def forward(self, input, skip=None): + if self.downsample: + if self.use_wt: + input = self.iwt(input) # [1024, 3] + input = self.downsample(input) # [512, 3] + input = self.dwt(input) # [256, 12] + else: + input = self.downsample(input) # [512, 3] + + out = self.conv(input) # [256, out_channel] + + if skip is not None: + out = out + skip + + return input, out + + +class Discriminator(nn.Module): + def __init__(self, size, img_channel=6, channel_multiplier=2, blur_kernel=[1, 3, 3, 1], c_dim=0): + super().__init__() + + channels = { + 4: 512, + 8: 512, + 16: 512, + 32: 512, + 64: 256 * channel_multiplier, + 128: 128 * channel_multiplier, + 256: 64 * channel_multiplier, + 512: 32 * channel_multiplier, + 1024: 16 * channel_multiplier, + 2048: 16 * channel_multiplier, + 4096: 16 * channel_multiplier + } + + self.dwt = HaarTransform(img_channel) + + self.from_rgbs = nn.ModuleList() + self.convs = nn.ModuleList() + + log_size = int(math.log(size, 2)) - 1 + + in_channel = channels[size] + + for i in range(log_size, 2, -1): + out_channel = channels[2 ** (i - 1)] + + self.from_rgbs.append(FromRGB(in_channel, img_channel, downsample=i != log_size)) + self.convs.append(ConvBlock(in_channel, out_channel, blur_kernel)) + + in_channel = out_channel + + self.from_rgbs.append(FromRGB(channels[4], img_channel)) + + self.stddev_group = 4 + self.stddev_feat = 1 + + self.final_conv = ConvLayer(in_channel + 1, channels[4], 3) + self.final_linear = nn.Sequential( + EqualLinear(channels[4] * 4 * 4, channels[4], activation="fused_lrelu"), + EqualLinear(channels[4], 1), + ) + + self.c_dim = c_dim + if c_dim > 0: + style_dim = 64 + lr_mlp = 0.01 + layers = [] + layers.append( + EqualLinear( + c_dim, style_dim, lr_mul=lr_mlp, activation="fused_lrelu" + ) + ) + for i in range(3): + layers.append( + EqualLinear( + style_dim, style_dim, lr_mul=lr_mlp, activation="fused_lrelu" + ) + ) + self.mapping = nn.Sequential(*layers) + + def forward(self, input, flat_pose=None): + input = self.dwt(input) + out = None + + for from_rgb, conv in zip(self.from_rgbs, self.convs): + input, out = from_rgb(input, out) + out = conv(out) + + _, out = self.from_rgbs[-1](input, out) + + batch, channel, height, width = out.shape + group = min(batch, self.stddev_group) + stddev = out.view(group, -1, self.stddev_feat, channel // self.stddev_feat, height, width) + stddev = torch.sqrt(stddev.var(0, unbiased=False) + 1e-8) + stddev = stddev.mean([2, 3, 4], keepdims=True).squeeze(2) + stddev = stddev.repeat(group, 1, height, width) + out = torch.cat([out, stddev], 1) + + out = self.final_conv(out) + + out = out.view(batch, -1) + out = self.final_linear(out) + if self.c_dim > 0: + pose_embed = self.mapping(flat_pose) + pose_embed = self.normalize_2nd_moment(pose_embed) + out = (out * pose_embed).sum(dim=1, keepdim=True) * (1 / np.sqrt(self.c_dim)) + + return out + + def normalize_2nd_moment(self, x, dim=1, eps=1e-8): + return x * (x.square().mean(dim=dim, keepdim=True) + eps).rsqrt() + + +class StyledConv(nn.Module): + def __init__( + self, + in_channel, + out_channel, + kernel_size, + style_dim, + upsample=False, + blur_kernel=[1, 3, 3, 1], + demodulate=True, + ): + super().__init__() + + self.conv = ModulatedConv2d( + in_channel, + out_channel, + kernel_size, + style_dim, + upsample=upsample, + blur_kernel=blur_kernel, + demodulate=demodulate, + ) + + self.noise = NoiseInjection() + # self.bias = nn.Parameter(torch.zeros(1, out_channel, 1, 1)) + # self.activate = ScaledLeakyReLU(0.2) + self.activate = FusedLeakyReLU(out_channel) + + def forward(self, input, style, noise=None): + out = self.conv(input, style) + out = self.noise(out, noise=noise) + # out = out + self.bias + out = self.activate(out) + + return out + + +class ToRGB(nn.Module): + def __init__(self, in_channel, style_dim, out_channel=12, upsample=True, blur_kernel=[1, 3, 3, 1], use_wt=True): + super().__init__() + self.use_wt = use_wt + if upsample: + self.upsample = Upsample(blur_kernel) + if use_wt: + self.iwt = InverseHaarTransform(3) + self.dwt = HaarTransform(3) + self.out_channel = out_channel if self.use_wt else out_channel // 4 + self.conv = ModulatedConv2d(in_channel, self.out_channel, 1, style_dim, demodulate=False) + self.bias = nn.Parameter(torch.zeros(1, self.out_channel, 1, 1)) + + def forward(self, input, style, skip=None): + out = self.conv(input, style) + out = out + self.bias + + if skip is not None: + if self.use_wt: + skip = self.iwt(skip) + skip = self.upsample(skip) + skip = self.dwt(skip) + else: + skip = self.upsample(skip) + out = out + skip + + return out + + +class DualStyleUNet(nn.Module): + def __init__(self, inp_size, inp_ch, out_ch, out_size, style_dim, n_mlp, middle_size=8, c_dim=0, + channel_multiplier=2, blur_kernel=[1, 3, 3, 1], lr_mlp=0.01): + super().__init__() + + self.inp_size = inp_size + + self.style_dim = style_dim + self.middle_log_size = int(math.log(middle_size, 2)) + + layers = [PixelNorm()] + if c_dim == 0: + layers.append(EqualLinear( + style_dim, style_dim, lr_mul=lr_mlp, activation="fused_lrelu" + )) + else: + layers.append(EqualLinear( + style_dim + c_dim, style_dim, lr_mul=lr_mlp, activation="fused_lrelu" + )) + for i in range(n_mlp-1): + layers.append( + EqualLinear( + style_dim, style_dim, lr_mul=lr_mlp, activation="fused_lrelu" + ) + ) + + self.style = nn.Sequential(*layers) # mapping network + + self.channels = { + 4: 512, + 8: 512, + 16: 512, + 32: 512, + 64: 256 * channel_multiplier, + 128: 128 * channel_multiplier, + 256: 64 * channel_multiplier, + 512: 32 * channel_multiplier, + 1024: 16 * channel_multiplier, + 2048: 16 * channel_multiplier, + 4096: 16 * channel_multiplier + } + + self.log_size = int(math.log(out_size, 2)) - 1 + + # add new layer here + # self.dwt = HaarTransform(3) + # self.from_rgbs = nn.ModuleList() + # self.cond_convs = nn.ModuleList() + self.comb_convs = nn.ModuleList() + + in_channel = self.channels[inp_size // 2] # 64 + self.from_rgbs = nn.ModuleList() + self.cond_convs = nn.ModuleList() + self.comb_convs = nn.ModuleList() # 64, 32, 16 + self.comb_convs.append(ConvLayer(in_channel * 2, in_channel, 3)) + self.conv_in = ConvLayer(inp_ch, in_channel, 3, downsample=True) + for i in range(int(math.log(inp_size, 2)) - 2, self.middle_log_size - 1, -1): # 32, 16, 8 + out_channel = self.channels[2 ** i] # (inp_size/2)->->(8*512) + self.from_rgbs.append(FromRGB(in_channel, inp_ch, downsample=True, use_wt=False)) # //2 + # self.from_rgbs.append(FromRGB(in_channel, inp_ch, downsample=(i + 1)!=int(math.log(inp_size, 2)), use_wt=False)) + self.cond_convs.append(ConvBlock(in_channel, out_channel, blur_kernel)) # //2 + if i > self.middle_log_size: + self.comb_convs.append(ConvLayer(out_channel * 2, out_channel, 3)) + else: + self.comb_convs.append(ConvLayer(out_channel, out_channel, 3)) # 最后一层 (8*512) + in_channel = out_channel + + # self.input = ConstantInput(self.channels[middle_size], size=middle_size) + # self.conv1 = StyledConv( + # self.channels[middle_size], self.channels[middle_size], 3, style_dim, blur_kernel=blur_kernel + # ) + # self.to_rgb1 = ToRGB(self.channels[middle_size], style_dim, upsample=False) + + self.convs1 = nn.ModuleList() + self.convs2 = nn.ModuleList() + self.to_rgbs1 = nn.ModuleList() + self.to_rgbs2 = nn.ModuleList() + self.noises = nn.Module() + + in_channel = self.channels[middle_size] + + self.num_layers = (self.log_size - self.middle_log_size) * 2 + for layer_idx in range(self.num_layers): + res = (layer_idx + 8) // 2 + shape = [1, 1, 2 ** res, 2 ** res] + self.noises.register_buffer(f"noise_{layer_idx}", torch.randn(*shape)) + + for i in range(self.middle_log_size + 1, self.log_size + 1): # 4, 5, 6, 7, 8, 9 + out_channel = self.channels[2 ** i] # (16*512)->(32*512)->(64*512)->(128*256)->(256*128)->(512*64) + + self.convs1.append( + StyledConv( + in_channel, + out_channel, + 3, + style_dim, + upsample=True, + blur_kernel=blur_kernel, + ) + ) + + self.convs1.append( + StyledConv( + out_channel, out_channel, 3, style_dim, blur_kernel=blur_kernel + ) + ) + + self.to_rgbs1.append(ToRGB(in_channel=out_channel, style_dim=style_dim, out_channel=out_ch * 4)) + + self.convs2.append( + StyledConv( + in_channel, + out_channel, + 3, + style_dim, + upsample = True, + blur_kernel = blur_kernel, + ) + ) + + self.convs2.append( + StyledConv( + out_channel, out_channel, 3, style_dim, blur_kernel = blur_kernel + ) + ) + + self.to_rgbs2.append(ToRGB(in_channel = out_channel, style_dim = style_dim, out_channel = out_ch * 4)) + + in_channel = out_channel + self.iwt = InverseHaarTransform(out_ch) + + self.n_latent = self.log_size * 2 - (self.middle_log_size * 2 - 1) + 1 + + def make_noise(self, device, zero_noise=False): + noises = [] + func = torch.zeros if zero_noise else torch.randn + for i in range(self.middle_log_size + 1, self.log_size + 1): + for _ in range(2): + noises.append(func(1, 1, 2 ** i, 2 ** i, device=device)) + # if zero_noise: + # for i in range(len(noises)): + # if i < len(noises) - 2: + # noises[i] = None + return noises + + def mean_latent(self, n_latent): + latent_in = torch.randn( + n_latent, self.style_dim, device=self.input.input.device + ) + latent = self.style(latent_in).mean(0, keepdim=True) + + return latent + + def get_latent(self, input): + return self.style(input) + + def forward( + self, + styles, + condition_img, + cond=None, + return_latents=False, + inject_index=None, + truncation=1, + truncation_latent=None, + input_is_latent=False, + noise=None, + randomize_noise=True, + view_feature1 = None, + view_feature2 = None + ): + """ + :param randomize_noise: False, use fixed noise + """ + if not input_is_latent: + if cond is None: + styles = [self.style(s) for s in styles] + else: + styles = [self.style(torch.cat([s, cond], dim=-1)) for s in styles] + + if noise is None: + if randomize_noise: + noise = [None] * self.num_layers + else: + noise = [ + getattr(self.noises, f"noise_{i}") for i in range(self.num_layers) + ] + + if truncation < 1: + style_t = [] + + for style in styles: + style_t.append( + truncation_latent + truncation * (style - truncation_latent) + ) + + styles = style_t + + if len(styles) < 2: + inject_index = self.n_latent + + if styles[0].ndim < 3: + latent = styles[0].unsqueeze(1).repeat(1, inject_index, 1) + + else: + latent = styles[0] + + else: + if inject_index is None: + inject_index = random.randint(1, self.n_latent - 1) + + latent = styles[0].unsqueeze(1).repeat(1, inject_index, 1) + latent2 = styles[1].unsqueeze(1).repeat(1, self.n_latent - inject_index, 1) + + latent = torch.cat([latent, latent2], 1) + + # cond_list = self.img_unet(condition_img) + cond_img = condition_img + cond_out = self.conv_in(cond_img) ### None + cond_list = [cond_out] ### [] + cond_num = 0 + for from_rgb, cond_conv in zip(self.from_rgbs, self.cond_convs): + cond_img, cond_out = from_rgb(cond_img, cond_out) + cond_out = cond_conv(cond_out) + # print('Down', cond_img.shape, cond_out.shape) + cond_list.append(cond_out) + cond_num += 1 + + # out = self.input(latent) + # out = self.conv1(out, latent[:, 0], noise=noise[0]) + # skip = self.to_rgb1(out, latent[:, 1]) + i = 0 + skip = None + for conv1, conv2, noise1, noise2, to_rgb in zip( + self.convs1[::2], self.convs1[1::2], noise[::2], noise[1::2], self.to_rgbs1 + ): + if i == 0: + out = self.comb_convs[-1](cond_list[-1]) + elif i < 2 * len(self.comb_convs): + out = torch.cat([out, cond_list[-1 - (i // 2)]], dim=1) + out = self.comb_convs[-1 - (i // 2)](out) + out = conv1(out, latent[:, i], noise=noise1) + out = conv2(out, latent[:, i + 1], noise=noise2) + skip = to_rgb(out, latent[:, i + 2], skip) + # print(i, out.shape, skip.shape) + if view_feature1 is not None and i == 8: + view_feature1 = F.interpolate(view_feature1, out.shape[-2:], mode = 'bilinear') # (B, 128, 256. 256) + out = out + view_feature1 + i += 2 + image1 = self.iwt(skip) + + i = 0 + skip = None + for conv1, conv2, noise1, noise2, to_rgb in zip( + self.convs2[::2], self.convs2[1::2], noise[::2], noise[1::2], self.to_rgbs2 + ): + if i == 0: + out = self.comb_convs[-1](cond_list[-1]) + elif i < 2 * len(self.comb_convs): + out = torch.cat([out, cond_list[-1 - (i // 2)]], dim=1) + out = self.comb_convs[-1 - (i // 2)](out) + out = conv1(out, latent[:, i], noise=noise1) + out = conv2(out, latent[:, i + 1], noise=noise2) + skip = to_rgb(out, latent[:, i + 2], skip) + if view_feature2 is not None and i == 8: + view_feature2 = F.interpolate(view_feature2, out.shape[-2:], mode = 'bilinear') # (B, 128, 256. 256) + out = out + view_feature2 + i += 2 + image2 = self.iwt(skip) + + images = torch.cat([image1, image2], 1) + + if return_latents: + return images, latent + else: + return images, None \ No newline at end of file diff --git a/AnimatableGaussians/network/styleunet/dual_styleunet_v2.py b/AnimatableGaussians/network/styleunet/dual_styleunet_v2.py new file mode 100644 index 0000000000000000000000000000000000000000..faa3904e119c770014d71ca4742d727288747730 --- /dev/null +++ b/AnimatableGaussians/network/styleunet/dual_styleunet_v2.py @@ -0,0 +1,1452 @@ +import math +import random +import numpy as np +import torch +from torch import nn +from torch.nn import functional as F + +from .fused_act import FusedLeakyReLU, fused_leaky_relu +from .upfirdn2d import upfirdn2d +from . import conv2d_gradfix + + +class PixelNorm(nn.Module): + def __init__(self): + super().__init__() + + def forward(self, input): + return input * torch.rsqrt(torch.mean(input ** 2, dim=1, keepdim=True) + 1e-8) + + +def make_kernel(k): + k = torch.tensor(k, dtype=torch.float32) + + if k.ndim == 1: + k = k[None, :] * k[:, None] + + k /= k.sum() + + return k + + +class Upsample(nn.Module): + def __init__(self, kernel, factor=2): + super().__init__() + + self.factor = factor + kernel = make_kernel(kernel) * (factor ** 2) + self.register_buffer("kernel", kernel) + + p = kernel.shape[0] - factor + + pad0 = (p + 1) // 2 + factor - 1 + pad1 = p // 2 + + self.pad = (pad0, pad1) + + def forward(self, input): + out = upfirdn2d(input, self.kernel, up=self.factor, down=1, pad=self.pad) + + return out + + +class Downsample(nn.Module): + def __init__(self, kernel, factor=2): + super().__init__() + + self.factor = factor + kernel = make_kernel(kernel) + self.register_buffer("kernel", kernel) + + p = kernel.shape[0] - factor + + pad0 = (p + 1) // 2 + pad1 = p // 2 + + self.pad = (pad0, pad1) + + def forward(self, input): + out = upfirdn2d(input, self.kernel, up=1, down=self.factor, pad=self.pad) + + return out + + +class Blur(nn.Module): + def __init__(self, kernel, pad, upsample_factor=1): + super().__init__() + + kernel = make_kernel(kernel) + + if upsample_factor > 1: + kernel = kernel * (upsample_factor ** 2) + + self.register_buffer("kernel", kernel) + + self.pad = pad + + def forward(self, input): + out = upfirdn2d(input, self.kernel, pad=self.pad) + + return out + + +class EqualConv2d(nn.Module): + def __init__( + self, in_channel, out_channel, kernel_size, stride=1, padding=0, bias=True + ): + super().__init__() + + self.weight = nn.Parameter( + torch.randn(out_channel, in_channel, kernel_size, kernel_size) + ) + self.scale = 1 / math.sqrt(in_channel * kernel_size ** 2) + + self.stride = stride + self.padding = padding + + if bias: + self.bias = nn.Parameter(torch.zeros(out_channel)) + + else: + self.bias = None + + def forward(self, input): + out = conv2d_gradfix.conv2d( + input, + self.weight * self.scale, + bias=self.bias, + stride=self.stride, + padding=self.padding, + ) + + return out + + def __repr__(self): + return ( + f"{self.__class__.__name__}({self.weight.shape[1]}, {self.weight.shape[0]}," + f" {self.weight.shape[2]}, stride={self.stride}, padding={self.padding})" + ) + + +class EqualLinear(nn.Module): + def __init__( + self, in_dim, out_dim, bias=True, bias_init=0.0, lr_mul=1.0, activation=None + ): + super().__init__() + + self.weight = nn.Parameter(torch.randn(out_dim, in_dim).div_(lr_mul)) + + if bias: + self.bias = nn.Parameter(torch.zeros(out_dim).fill_(bias_init)) + + else: + self.bias = None + + self.activation = activation + + self.scale = (1 / math.sqrt(in_dim)) * lr_mul + self.lr_mul = lr_mul + + def forward(self, input): + if self.activation: + out = F.linear(input, self.weight * self.scale) + out = fused_leaky_relu(out, self.bias * self.lr_mul) + + else: + out = F.linear( + input, self.weight * self.scale, bias=self.bias * self.lr_mul + ) + + return out + + def __repr__(self): + return ( + f"{self.__class__.__name__}({self.weight.shape[1]}, {self.weight.shape[0]})" + ) + + +class ModulatedConv2d(nn.Module): + def __init__( + self, + in_channel, + out_channel, + kernel_size, + style_dim, + demodulate=True, + upsample=False, + downsample=False, + blur_kernel=[1, 3, 3, 1], + fused=True, + ): + super().__init__() + + self.eps = 1e-8 + self.kernel_size = kernel_size + self.in_channel = in_channel + self.out_channel = out_channel + self.upsample = upsample + self.downsample = downsample + + if upsample: + factor = 2 + p = (len(blur_kernel) - factor) - (kernel_size - 1) + pad0 = (p + 1) // 2 + factor - 1 + pad1 = p // 2 + 1 + + self.blur = Blur(blur_kernel, pad=(pad0, pad1), upsample_factor=factor) + + if downsample: + factor = 2 + p = (len(blur_kernel) - factor) + (kernel_size - 1) + pad0 = (p + 1) // 2 + pad1 = p // 2 + + self.blur = Blur(blur_kernel, pad=(pad0, pad1)) + + fan_in = in_channel * kernel_size ** 2 + self.scale = 1 / math.sqrt(fan_in) + self.padding = kernel_size // 2 + + self.weight = nn.Parameter( + torch.randn(1, out_channel, in_channel, kernel_size, kernel_size) + ) + + self.modulation = EqualLinear(style_dim, in_channel, bias_init=1) + + self.demodulate = demodulate + self.fused = fused + + def __repr__(self): + return ( + f"{self.__class__.__name__}({self.in_channel}, {self.out_channel}, {self.kernel_size}, " + f"upsample={self.upsample}, downsample={self.downsample})" + ) + + def forward(self, input, style): + batch, in_channel, height, width = input.shape + + if not self.fused: + weight = self.scale * self.weight.squeeze(0) + style = self.modulation(style) + if self.demodulate: + w = weight.unsqueeze(0) * style.view(batch, 1, in_channel, 1, 1) + dcoefs = (w.square().sum((2, 3, 4)) + 1e-8).rsqrt() + + input = input * style.reshape(batch, in_channel, 1, 1) + + if self.upsample: + weight = weight.transpose(0, 1) + out = conv2d_gradfix.conv_transpose2d( + input, weight, padding=0, stride=2 + ) + out = self.blur(out) + + elif self.downsample: + input = self.blur(input) + out = conv2d_gradfix.conv2d(input, weight, padding=0, stride=2) + + else: + out = conv2d_gradfix.conv2d(input, weight, padding=self.padding) + + if self.demodulate: + out = out * dcoefs.view(batch, -1, 1, 1) + + return out + + style = self.modulation(style).view(batch, 1, in_channel, 1, 1) + weight = self.scale * self.weight * style + + if self.demodulate: + demod = torch.rsqrt(weight.pow(2).sum([2, 3, 4]) + 1e-8) + weight = weight * demod.view(batch, self.out_channel, 1, 1, 1) + + weight = weight.view( + batch * self.out_channel, in_channel, self.kernel_size, self.kernel_size + ) + + if self.upsample: + input = input.view(1, batch * in_channel, height, width) + weight = weight.view( + batch, self.out_channel, in_channel, self.kernel_size, self.kernel_size + ) + weight = weight.transpose(1, 2).reshape( + batch * in_channel, self.out_channel, self.kernel_size, self.kernel_size + ) + out = conv2d_gradfix.conv_transpose2d( + input, weight, padding=0, stride=2, groups=batch + ) + _, _, height, width = out.shape + out = out.view(batch, self.out_channel, height, width) + out = self.blur(out) + + elif self.downsample: + input = self.blur(input) + _, _, height, width = input.shape + input = input.view(1, batch * in_channel, height, width) + out = conv2d_gradfix.conv2d( + input, weight, padding=0, stride=2, groups=batch + ) + _, _, height, width = out.shape + out = out.view(batch, self.out_channel, height, width) + + else: + input = input.view(1, batch * in_channel, height, width) + out = conv2d_gradfix.conv2d( + input, weight, padding=self.padding, groups=batch + ) + _, _, height, width = out.shape + out = out.view(batch, self.out_channel, height, width) + + return out + + +class NoiseInjection(nn.Module): + def __init__(self): + super().__init__() + + self.weight = nn.Parameter(torch.zeros(1)) + + def forward(self, image, noise=None): + if noise is None: + batch, _, height, width = image.shape + noise = image.new_empty(batch, 1, height, width).normal_() + return image + self.weight * noise + + +class ConstantInput(nn.Module): + def __init__(self, channel, size=4): + super().__init__() + + self.input = nn.Parameter(torch.randn(1, channel, size, size)) + + def forward(self, input): + batch = input.shape[0] + out = self.input.repeat(batch, 1, 1, 1) + + return out + + +class ConvLayer(nn.Sequential): + def __init__( + self, + in_channel, + out_channel, + kernel_size, + downsample=False, + blur_kernel=[1, 3, 3, 1], + bias=True, + activate=True, + ): + layers = [] + + if downsample: + factor = 2 + p = (len(blur_kernel) - factor) + (kernel_size - 1) + pad0 = (p + 1) // 2 + pad1 = p // 2 + + layers.append(Blur(blur_kernel, pad=(pad0, pad1))) + + stride = 2 + self.padding = 0 + + else: + stride = 1 + self.padding = kernel_size // 2 + + layers.append( + EqualConv2d( + in_channel, + out_channel, + kernel_size, + padding=self.padding, + stride=stride, + bias=bias and not activate, + ) + ) + + if activate: + layers.append(FusedLeakyReLU(out_channel, bias=bias)) + + super().__init__(*layers) + + +def get_haar_wavelet(in_channels): + haar_wav_l = 1 / (2 ** 0.5) * torch.ones(1, 2) + haar_wav_h = 1 / (2 ** 0.5) * torch.ones(1, 2) + haar_wav_h[0, 0] = -1 * haar_wav_h[0, 0] + + haar_wav_ll = haar_wav_l.T * haar_wav_l + haar_wav_lh = haar_wav_h.T * haar_wav_l + haar_wav_hl = haar_wav_l.T * haar_wav_h + haar_wav_hh = haar_wav_h.T * haar_wav_h + + return haar_wav_ll, haar_wav_lh, haar_wav_hl, haar_wav_hh + + +class HaarTransform(nn.Module): + def __init__(self, in_channels): + super().__init__() + + ll, lh, hl, hh = get_haar_wavelet(in_channels) + + self.register_buffer('ll', ll) + self.register_buffer('lh', lh) + self.register_buffer('hl', hl) + self.register_buffer('hh', hh) + + def forward(self, input): + ll = upfirdn2d(input, self.ll, down=2) + lh = upfirdn2d(input, self.lh, down=2) + hl = upfirdn2d(input, self.hl, down=2) + hh = upfirdn2d(input, self.hh, down=2) + + return torch.cat((ll, lh, hl, hh), 1) + + +class InverseHaarTransform(nn.Module): + def __init__(self, in_channels): + super().__init__() + + ll, lh, hl, hh = get_haar_wavelet(in_channels) + + self.register_buffer('ll', ll) + self.register_buffer('lh', -lh) + self.register_buffer('hl', -hl) + self.register_buffer('hh', hh) + + def forward(self, input): + ll, lh, hl, hh = input.chunk(4, 1) + ll = upfirdn2d(ll, self.ll, up=2, pad=(1, 0, 1, 0)) + lh = upfirdn2d(lh, self.lh, up=2, pad=(1, 0, 1, 0)) + hl = upfirdn2d(hl, self.hl, up=2, pad=(1, 0, 1, 0)) + hh = upfirdn2d(hh, self.hh, up=2, pad=(1, 0, 1, 0)) + + return ll + lh + hl + hh + + +class ConvBlock(nn.Module): + def __init__(self, in_channel, out_channel, blur_kernel=[1, 3, 3, 1], downsample=True): + super().__init__() + + self.conv1 = ConvLayer(in_channel, in_channel, 3) + self.conv2 = ConvLayer(in_channel, out_channel, 3, downsample=downsample) + + def forward(self, input): + out = self.conv1(input) + out = self.conv2(out) + + return out + + +class FromRGB(nn.Module): + def __init__(self, out_channel, in_channel, downsample=True, blur_kernel=[1, 3, 3, 1], use_wt=True): + super().__init__() + + self.downsample = downsample + self.use_wt = use_wt + if downsample: + self.downsample = Downsample(blur_kernel) + if use_wt: + self.iwt = InverseHaarTransform(in_channel) + self.dwt = HaarTransform(in_channel) + self.in_channel = in_channel * 4 if self.use_wt else in_channel + self.conv = ConvLayer(self.in_channel, out_channel, 1) + + def forward(self, input, skip=None): + if self.downsample: + if self.use_wt: + input = self.iwt(input) # [1024, 3] + input = self.downsample(input) # [512, 3] + input = self.dwt(input) # [256, 12] + else: + input = self.downsample(input) # [512, 3] + + out = self.conv(input) # [256, out_channel] + + if skip is not None: + out = out + skip + + return input, out + + +class Discriminator(nn.Module): + def __init__(self, size, img_channel=6, channel_multiplier=2, blur_kernel=[1, 3, 3, 1], c_dim=0): + super().__init__() + + channels = { + 4: 512, + 8: 512, + 16: 512, + 32: 512, + 64: 256 * channel_multiplier, + 128: 128 * channel_multiplier, + 256: 64 * channel_multiplier, + 512: 32 * channel_multiplier, + 1024: 16 * channel_multiplier, + } + + self.dwt = HaarTransform(img_channel) + + self.from_rgbs = nn.ModuleList() + self.convs = nn.ModuleList() + + log_size = int(math.log(size, 2)) - 1 + + in_channel = channels[size] + + for i in range(log_size, 2, -1): + out_channel = channels[2 ** (i - 1)] + + self.from_rgbs.append(FromRGB(in_channel, img_channel, downsample=i != log_size)) + self.convs.append(ConvBlock(in_channel, out_channel, blur_kernel)) + + in_channel = out_channel + + self.from_rgbs.append(FromRGB(channels[4], img_channel)) + + self.stddev_group = 4 + self.stddev_feat = 1 + + self.final_conv = ConvLayer(in_channel + 1, channels[4], 3) + self.final_linear = nn.Sequential( + EqualLinear(channels[4] * 4 * 4, channels[4], activation="fused_lrelu"), + EqualLinear(channels[4], 1), + ) + + self.c_dim = c_dim + if c_dim > 0: + style_dim = 64 + lr_mlp = 0.01 + layers = [] + layers.append( + EqualLinear( + c_dim, style_dim, lr_mul=lr_mlp, activation="fused_lrelu" + ) + ) + for i in range(3): + layers.append( + EqualLinear( + style_dim, style_dim, lr_mul=lr_mlp, activation="fused_lrelu" + ) + ) + self.mapping = nn.Sequential(*layers) + + def forward(self, input, flat_pose=None): + input = self.dwt(input) + out = None + + for from_rgb, conv in zip(self.from_rgbs, self.convs): + input, out = from_rgb(input, out) + out = conv(out) + + _, out = self.from_rgbs[-1](input, out) + + batch, channel, height, width = out.shape + group = min(batch, self.stddev_group) + stddev = out.view(group, -1, self.stddev_feat, channel // self.stddev_feat, height, width) + stddev = torch.sqrt(stddev.var(0, unbiased=False) + 1e-8) + stddev = stddev.mean([2, 3, 4], keepdims=True).squeeze(2) + stddev = stddev.repeat(group, 1, height, width) + out = torch.cat([out, stddev], 1) + + out = self.final_conv(out) + + out = out.view(batch, -1) + out = self.final_linear(out) + if self.c_dim > 0: + pose_embed = self.mapping(flat_pose) + pose_embed = self.normalize_2nd_moment(pose_embed) + out = (out * pose_embed).sum(dim=1, keepdim=True) * (1 / np.sqrt(self.c_dim)) + + return out + + def normalize_2nd_moment(self, x, dim=1, eps=1e-8): + return x * (x.square().mean(dim=dim, keepdim=True) + eps).rsqrt() + + +class StyledConv(nn.Module): + def __init__( + self, + in_channel, + out_channel, + kernel_size, + style_dim, + upsample=False, + blur_kernel=[1, 3, 3, 1], + demodulate=True, + ): + super().__init__() + + self.conv = ModulatedConv2d( + in_channel, + out_channel, + kernel_size, + style_dim, + upsample=upsample, + blur_kernel=blur_kernel, + demodulate=demodulate, + ) + + self.noise = NoiseInjection() + # self.bias = nn.Parameter(torch.zeros(1, out_channel, 1, 1)) + # self.activate = ScaledLeakyReLU(0.2) + self.activate = FusedLeakyReLU(out_channel) + + def forward(self, input, style, noise=None): + out = self.conv(input, style) + out = self.noise(out, noise=noise) + # out = out + self.bias + out = self.activate(out) + + return out + + +class ToRGB(nn.Module): + def __init__(self, in_channel, style_dim, out_channel=12, upsample=True, blur_kernel=[1, 3, 3, 1], use_wt=True): + super().__init__() + self.use_wt = use_wt + if upsample: + self.upsample = Upsample(blur_kernel) + if use_wt: + self.iwt = InverseHaarTransform(3) + self.dwt = HaarTransform(3) + self.out_channel = out_channel if self.use_wt else out_channel // 4 + self.conv = ModulatedConv2d(in_channel, self.out_channel, 1, style_dim, demodulate=False) + self.bias = nn.Parameter(torch.zeros(1, self.out_channel, 1, 1)) + + def forward(self, input, style, skip=None): + out = self.conv(input, style) + out = out + self.bias + + if skip is not None: + if self.use_wt: + skip = self.iwt(skip) + skip = self.upsample(skip) + skip = self.dwt(skip) + else: + skip = self.upsample(skip) + out = out + skip + + return out + + +class DualStyleUNet(nn.Module): + def __init__(self, inp_size, inp_ch, out_ch, out_size, style_dim, n_mlp, middle_size=8, c_dim=0, + channel_multiplier=2, blur_kernel=[1, 3, 3, 1], lr_mlp=0.01): + super().__init__() + + self.inp_size = inp_size + + self.style_dim = style_dim + self.middle_log_size = int(math.log(middle_size, 2)) + + layers = [PixelNorm()] + if c_dim == 0: + layers.append(EqualLinear( + style_dim, style_dim, lr_mul=lr_mlp, activation="fused_lrelu" + )) + else: + layers.append(EqualLinear( + style_dim + c_dim, style_dim, lr_mul=lr_mlp, activation="fused_lrelu" + )) + for i in range(n_mlp-1): + layers.append( + EqualLinear( + style_dim, style_dim, lr_mul=lr_mlp, activation="fused_lrelu" + ) + ) + + self.style = nn.Sequential(*layers) # mapping network + + self.channels = { + 4: 512, + 8: 512, + 16: 512, + 32: 512, + 64: 256 * channel_multiplier, + 128: 128 * channel_multiplier, + 256: 64 * channel_multiplier, + 512: 32 * channel_multiplier, + 1024: 16 * channel_multiplier, + } + + self.log_size = int(math.log(out_size, 2)) - 1 + + # add new layer here + # self.dwt = HaarTransform(3) + # self.from_rgbs = nn.ModuleList() + # self.cond_convs = nn.ModuleList() + self.comb_convs = nn.ModuleList() + + in_channel = self.channels[inp_size // 2] # 64 + self.from_rgbs = nn.ModuleList() + self.cond_convs = nn.ModuleList() + self.comb_convs = nn.ModuleList() # 64, 32, 16 + self.comb_convs.append(ConvLayer(in_channel * 2, in_channel, 3)) + self.conv_in = ConvLayer(inp_ch, in_channel, 3, downsample=True) + for i in range(int(math.log(inp_size, 2)) - 2, self.middle_log_size - 1, -1): # 32, 16, 8 + out_channel = self.channels[2 ** i] # (inp_size/2)->->(8*512) + self.from_rgbs.append(FromRGB(in_channel, inp_ch, downsample=True, use_wt=False)) # //2 + # self.from_rgbs.append(FromRGB(in_channel, inp_ch, downsample=(i + 1)!=int(math.log(inp_size, 2)), use_wt=False)) + self.cond_convs.append(ConvBlock(in_channel, out_channel, blur_kernel)) # //2 + if i > self.middle_log_size: + self.comb_convs.append(ConvLayer(out_channel * 2, out_channel, 3)) + else: + self.comb_convs.append(ConvLayer(out_channel, out_channel, 3)) # 最后一层 (8*512) + in_channel = out_channel + + # self.input = ConstantInput(self.channels[middle_size], size=middle_size) + # self.conv1 = StyledConv( + # self.channels[middle_size], self.channels[middle_size], 3, style_dim, blur_kernel=blur_kernel + # ) + # self.to_rgb1 = ToRGB(self.channels[middle_size], style_dim, upsample=False) + + self.convs1 = nn.ModuleList() + self.convs2 = nn.ModuleList() + self.to_rgbs1 = nn.ModuleList() + self.to_rgbs2 = nn.ModuleList() + self.noises = nn.Module() + + in_channel = self.channels[middle_size] + + self.num_layers = (self.log_size - self.middle_log_size) * 2 + for layer_idx in range(self.num_layers): + res = (layer_idx + 8) // 2 + shape = [1, 1, 2 ** res, 2 ** res] + self.noises.register_buffer(f"noise_{layer_idx}", torch.randn(*shape)) + + for i in range(self.middle_log_size + 1, self.log_size + 1): # 4, 5, 6, 7, 8, 9 + out_channel = self.channels[2 ** i] # (16*512)->(32*512)->(64*512)->(128*256)->(256*128)->(512*64) + + self.convs1.append( + StyledConv( + in_channel, + out_channel, + 3, + style_dim, + upsample=True, + blur_kernel=blur_kernel, + ) + ) + + self.convs1.append( + StyledConv( + out_channel, out_channel, 3, style_dim, blur_kernel=blur_kernel + ) + ) + + self.to_rgbs1.append(ToRGB(in_channel=out_channel, style_dim=style_dim, out_channel=out_ch * 4)) + + self.convs2.append( + StyledConv( + in_channel, + out_channel, + 3, + style_dim, + upsample = True, + blur_kernel = blur_kernel, + ) + ) + + self.convs2.append( + StyledConv( + out_channel, out_channel, 3, style_dim, blur_kernel = blur_kernel + ) + ) + + self.to_rgbs2.append(ToRGB(in_channel = out_channel, style_dim = style_dim, out_channel = out_ch * 4)) + + in_channel = out_channel + self.dwt = HaarTransform(inp_ch) + self.iwt = InverseHaarTransform(out_ch) + + self.n_latent = self.log_size * 2 - (self.middle_log_size * 2 - 1) + 1 + + def make_noise(self, device, zero_noise=False): + noises = [] + func = torch.zeros if zero_noise else torch.randn + for i in range(self.middle_log_size + 1, self.log_size + 1): + for _ in range(2): + noises.append(func(1, 1, 2 ** i, 2 ** i, device=device)) + # if zero_noise: + # for i in range(len(noises)): + # if i < len(noises) - 2: + # noises[i] = None + return noises + + def mean_latent(self, n_latent): + latent_in = torch.randn( + n_latent, self.style_dim, device=self.input.input.device + ) + latent = self.style(latent_in).mean(0, keepdim=True) + + return latent + + def get_latent(self, input): + return self.style(input) + + def forward( + self, + styles, + condition_img, + cond=None, + return_latents=False, + inject_index=None, + truncation=1, + truncation_latent=None, + input_is_latent=False, + noise=None, + randomize_noise=True): + """ + :param randomize_noise: False, use fixed noise + """ + if not input_is_latent: + if cond is None: + styles = [self.style(s) for s in styles] + else: + styles = [self.style(torch.cat([s, cond], dim=-1)) for s in styles] + + if noise is None: + if randomize_noise: + noise = [None] * self.num_layers + else: + noise = [ + getattr(self.noises, f"noise_{i}") for i in range(self.num_layers) + ] + + if truncation < 1: + style_t = [] + + for style in styles: + style_t.append( + truncation_latent + truncation * (style - truncation_latent) + ) + + styles = style_t + + if len(styles) < 2: + inject_index = self.n_latent + + if styles[0].ndim < 3: + latent = styles[0].unsqueeze(1).repeat(1, inject_index, 1) + + else: + latent = styles[0] + + else: + if inject_index is None: + inject_index = random.randint(1, self.n_latent - 1) + + latent = styles[0].unsqueeze(1).repeat(1, inject_index, 1) + latent2 = styles[1].unsqueeze(1).repeat(1, self.n_latent - inject_index, 1) + + latent = torch.cat([latent, latent2], 1) + + # cond_list = self.img_unet(condition_img) + cond_img = condition_img + cond_out = self.conv_in(cond_img) ### None + cond_list = [cond_out] ### [] + cond_num = 0 + for from_rgb, cond_conv in zip(self.from_rgbs, self.cond_convs): + cond_img, cond_out = from_rgb(cond_img, cond_out) + cond_out = cond_conv(cond_out) + # print('Down', cond_img.shape, cond_out.shape) + cond_list.append(cond_out) + cond_num += 1 + + # out = self.input(latent) + # out = self.conv1(out, latent[:, 0], noise=noise[0]) + # skip = self.to_rgb1(out, latent[:, 1]) + i = 0 + skip = None + for conv1, conv2, noise1, noise2, to_rgb in zip( + self.convs1[::2], self.convs1[1::2], noise[::2], noise[1::2], self.to_rgbs1 + ): + if i == 0: + out = self.comb_convs[-1](cond_list[-1]) + elif i < 2 * len(self.comb_convs): + out = torch.cat([out, cond_list[-1 - (i // 2)]], dim=1) + out = self.comb_convs[-1 - (i // 2)](out) + out = conv1(out, latent[:, i], noise=noise1) + out = conv2(out, latent[:, i + 1], noise=noise2) + skip = to_rgb(out, latent[:, i + 2], skip) + # print('Up', out.shape, skip.shape) + i += 2 + image1 = self.iwt(skip) + + i = 0 + skip = None + for conv1, conv2, noise1, noise2, to_rgb in zip( + self.convs2[::2], self.convs2[1::2], noise[::2], noise[1::2], self.to_rgbs2 + ): + if i == 0: + out = self.comb_convs[-1](cond_list[-1]) + elif i < 2 * len(self.comb_convs): + out = torch.cat([out, cond_list[-1 - (i // 2)]], dim=1) + out = self.comb_convs[-1 - (i // 2)](out) + out = conv1(out, latent[:, i], noise=noise1) + out = conv2(out, latent[:, i + 1], noise=noise2) + skip = to_rgb(out, latent[:, i + 2], skip) + # print('Up', out.shape, skip.shape) + i += 2 + image2 = self.iwt(skip) + + images = torch.cat([image1, image2], 1) + + if return_latents: + return images, latent + else: + return images, None + + +class DualStyleUNet_add_dwt(nn.Module): + def __init__(self, inp_size, inp_ch, out_ch, out_size, style_dim, n_mlp, middle_size=8, c_dim=0, + channel_multiplier=2, blur_kernel=[1, 3, 3, 1], lr_mlp=0.01, debug=False): + super().__init__() + + self.debug = debug + + self.inp_size = inp_size + + self.style_dim = style_dim + self.middle_log_size = int(math.log(middle_size, 2)) + + layers = [PixelNorm()] + if c_dim == 0: + layers.append(EqualLinear( + style_dim, style_dim, lr_mul=lr_mlp, activation="fused_lrelu" + )) + else: + layers.append(EqualLinear( + style_dim + c_dim, style_dim, lr_mul=lr_mlp, activation="fused_lrelu" + )) + for i in range(n_mlp-1): + layers.append( + EqualLinear( + style_dim, style_dim, lr_mul=lr_mlp, activation="fused_lrelu" + ) + ) + + self.style = nn.Sequential(*layers) # mapping network + + self.channels = { + 4: 512, + 8: 512, + 16: 512, + 32: 512, + 64: 256 * channel_multiplier, + 128: 128 * channel_multiplier, + 256: 64 * channel_multiplier, + 512: 32 * channel_multiplier, + 1024: 16 * channel_multiplier, + } + + self.log_size = int(math.log(out_size, 2)) - 1 + + # add new layer here + # self.dwt = HaarTransform(3) + # self.from_rgbs = nn.ModuleList() + # self.cond_convs = nn.ModuleList() + self.comb_convs = nn.ModuleList() + + in_channel = self.channels[inp_size // 4] # 64 + self.from_rgbs = nn.ModuleList() + self.cond_convs = nn.ModuleList() + self.comb_convs = nn.ModuleList() # 64, 32, 16 + self.comb_convs.append(ConvLayer(in_channel * 2, in_channel, 3)) + + self.conv_in = ConvLayer(inp_ch * 4, in_channel, 3, downsample=True) + for i in range(int(math.log(inp_size, 2)) - 3, self.middle_log_size - 1, -1): # 32, 16, 8 + out_channel = self.channels[2 ** i] # (inp_size/2)->->(8*512) + self.from_rgbs.append(FromRGB(in_channel, inp_ch, downsample=True, use_wt=True)) # //2 + # self.from_rgbs.append(FromRGB(in_channel, inp_ch, downsample=(i + 1)!=int(math.log(inp_size, 2)), use_wt=False)) + self.cond_convs.append(ConvBlock(in_channel, out_channel, blur_kernel)) # //2 + if i > self.middle_log_size: + self.comb_convs.append(ConvLayer(out_channel * 2, out_channel, 3)) + else: + self.comb_convs.append(ConvLayer(out_channel, out_channel, 3)) # 最后一层 (8*512) + in_channel = out_channel + + # self.input = ConstantInput(self.channels[middle_size], size=middle_size) + # self.conv1 = StyledConv( + # self.channels[middle_size], self.channels[middle_size], 3, style_dim, blur_kernel=blur_kernel + # ) + # self.to_rgb1 = ToRGB(self.channels[middle_size], style_dim, upsample=False) + + self.convs1 = nn.ModuleList() + self.convs2 = nn.ModuleList() + self.to_rgbs1 = nn.ModuleList() + self.to_rgbs2 = nn.ModuleList() + self.noises = nn.Module() + + in_channel = self.channels[middle_size] + + self.num_layers = (self.log_size - self.middle_log_size) * 2 + for layer_idx in range(self.num_layers): + res = (layer_idx + 8) // 2 + shape = [1, 1, 2 ** res, 2 ** res] + self.noises.register_buffer(f"noise_{layer_idx}", torch.randn(*shape)) + + for i in range(self.middle_log_size + 1, self.log_size + 1): # 4, 5, 6, 7, 8, 9 + out_channel = self.channels[2 ** i] # (16*512)->(32*512)->(64*512)->(128*256)->(256*128)->(512*64) + + self.convs1.append( + StyledConv( + in_channel, + out_channel, + 3, + style_dim, + upsample=True, + blur_kernel=blur_kernel, + ) + ) + + self.convs1.append( + StyledConv( + out_channel, out_channel, 3, style_dim, blur_kernel=blur_kernel + ) + ) + + self.to_rgbs1.append(ToRGB(in_channel=out_channel, style_dim=style_dim, out_channel=out_ch * 4)) + + self.convs2.append( + StyledConv( + in_channel, + out_channel, + 3, + style_dim, + upsample = True, + blur_kernel = blur_kernel, + ) + ) + + self.convs2.append( + StyledConv( + out_channel, out_channel, 3, style_dim, blur_kernel = blur_kernel + ) + ) + + self.to_rgbs2.append(ToRGB(in_channel = out_channel, style_dim = style_dim, out_channel = out_ch * 4)) + + in_channel = out_channel + self.dwt = HaarTransform(inp_ch) + self.iwt = InverseHaarTransform(out_ch) + + self.n_latent = self.log_size * 2 - (self.middle_log_size * 2 - 1) + 1 + + def make_noise(self, device, zero_noise=False): + noises = [] + func = torch.zeros if zero_noise else torch.randn + for i in range(self.middle_log_size + 1, self.log_size + 1): + for _ in range(2): + noises.append(func(1, 1, 2 ** i, 2 ** i, device=device)) + # if zero_noise: + # for i in range(len(noises)): + # if i < len(noises) - 2: + # noises[i] = None + return noises + + def mean_latent(self, n_latent): + latent_in = torch.randn( + n_latent, self.style_dim, device=self.input.input.device + ) + latent = self.style(latent_in).mean(0, keepdim=True) + + return latent + + def get_latent(self, input): + return self.style(input) + + def forward( + self, + styles, + condition_img, + cond=None, + return_latents=False, + inject_index=None, + truncation=1, + truncation_latent=None, + input_is_latent=False, + noise=None, + randomize_noise=True): + """ + :param randomize_noise: False, use fixed noise + """ + if not input_is_latent: + if cond is None: + styles = [self.style(s) for s in styles] + else: + styles = [self.style(torch.cat([s, cond], dim=-1)) for s in styles] + + if noise is None: + if randomize_noise: + noise = [None] * self.num_layers + else: + noise = [ + getattr(self.noises, f"noise_{i}") for i in range(self.num_layers) + ] + + if truncation < 1: + style_t = [] + + for style in styles: + style_t.append( + truncation_latent + truncation * (style - truncation_latent) + ) + + styles = style_t + + if len(styles) < 2: + inject_index = self.n_latent + + if styles[0].ndim < 3: + latent = styles[0].unsqueeze(1).repeat(1, inject_index, 1) + + else: + latent = styles[0] + + else: + if inject_index is None: + inject_index = random.randint(1, self.n_latent - 1) + + latent = styles[0].unsqueeze(1).repeat(1, inject_index, 1) + latent2 = styles[1].unsqueeze(1).repeat(1, self.n_latent - inject_index, 1) + + latent = torch.cat([latent, latent2], 1) + + # cond_list = self.img_unet(condition_img) + if self.debug: + print(f'[DEBUG] condition_img: {condition_img.shape}') + cond_img = self.dwt(condition_img) + if self.debug: + print(f'[DEBUG] cond_img (after dwt): {cond_img.shape}') + cond_out = self.conv_in(cond_img) ### None + if self.debug: + print(f'[DEBUG] cond_out (after dwt): {cond_out.shape}') + + cond_list = [cond_out] ### [] + cond_num = 0 + for cond_conv_id, (from_rgb, cond_conv) in enumerate(zip(self.from_rgbs, self.cond_convs)): + cond_img, cond_out = from_rgb(cond_img, cond_out) + cond_out = cond_conv(cond_out) + # print('Down', cond_img.shape, cond_out.shape) + cond_list.append(cond_out) + cond_num += 1 + if self.debug: + print(f'[DEBUG] cond_conv_{cond_conv_id:05d} cond_img: {cond_img.shape}, cond_out: {cond_out.shape}') + + + + # out = self.input(latent) + # out = self.conv1(out, latent[:, 0], noise=noise[0]) + # skip = self.to_rgb1(out, latent[:, 1]) + i = 0 + skip = None + for conv1, conv2, noise1, noise2, to_rgb in zip( + self.convs1[::2], self.convs1[1::2], noise[::2], noise[1::2], self.to_rgbs1 + ): + if i == 0: + out = self.comb_convs[-1](cond_list[-1]) + elif i < 2 * len(self.comb_convs): + out = torch.cat([out, cond_list[-1 - (i // 2)]], dim=1) + out = self.comb_convs[-1 - (i // 2)](out) + out = conv1(out, latent[:, i], noise=noise1) + out = conv2(out, latent[:, i + 1], noise=noise2) + skip = to_rgb(out, latent[:, i + 2], skip) + # print('Up', out.shape, skip.shape) + i += 2 + image1 = self.iwt(skip) + + i = 0 + skip = None + for conv1, conv2, noise1, noise2, to_rgb in zip( + self.convs2[::2], self.convs2[1::2], noise[::2], noise[1::2], self.to_rgbs2 + ): + if i == 0: + out = self.comb_convs[-1](cond_list[-1]) + elif i < 2 * len(self.comb_convs): + out = torch.cat([out, cond_list[-1 - (i // 2)]], dim=1) + out = self.comb_convs[-1 - (i // 2)](out) + out = conv1(out, latent[:, i], noise=noise1) + out = conv2(out, latent[:, i + 1], noise=noise2) + skip = to_rgb(out, latent[:, i + 2], skip) + # print('Up', out.shape, skip.shape) + i += 2 + image2 = self.iwt(skip) + + images = torch.cat([image1, image2], 1) + + if return_latents: + return images, latent + else: + return images, None + + +class DualStyleUNet_wo_dwt(nn.Module): + def __init__(self, inp_size, inp_ch, out_ch, out_size, style_dim, n_mlp, middle_size=8, c_dim=0, + channel_multiplier=2, blur_kernel=[1, 3, 3, 1], lr_mlp=0.01): + super().__init__() + + self.inp_size = inp_size + + self.style_dim = style_dim + self.middle_log_size = int(math.log(middle_size, 2)) + + layers = [PixelNorm()] + if c_dim == 0: + layers.append(EqualLinear( + style_dim, style_dim, lr_mul=lr_mlp, activation="fused_lrelu" + )) + else: + layers.append(EqualLinear( + style_dim + c_dim, style_dim, lr_mul=lr_mlp, activation="fused_lrelu" + )) + for i in range(n_mlp-1): + layers.append( + EqualLinear( + style_dim, style_dim, lr_mul=lr_mlp, activation="fused_lrelu" + ) + ) + + self.style = nn.Sequential(*layers) # mapping network + + self.channels = { + 4: 512, + 8: 512, + 16: 512, + 32: 512, + 64: 256 * channel_multiplier, + 128: 128 * channel_multiplier, + 256: 64 * channel_multiplier, + 512: 32 * channel_multiplier, + 1024: 16 * channel_multiplier, + } + + self.log_size = int(math.log(out_size, 2)) - 1 + + # add new layer here + # self.dwt = HaarTransform(3) + # self.from_rgbs = nn.ModuleList() + # self.cond_convs = nn.ModuleList() + self.comb_convs = nn.ModuleList() + + in_channel = self.channels[inp_size // 2] # 64 + self.from_rgbs = nn.ModuleList() + self.cond_convs = nn.ModuleList() + self.comb_convs = nn.ModuleList() # 64, 32, 16 + self.comb_convs.append(ConvLayer(in_channel * 2, in_channel, 3)) + + self.conv_in = ConvLayer(inp_ch, in_channel, 3, downsample=True) + for i in range(int(math.log(inp_size, 2)) - 2, self.middle_log_size - 1, -1): # 32, 16, 8 + out_channel = self.channels[2 ** i] # (inp_size/2)->->(8*512) + self.from_rgbs.append(FromRGB(in_channel, inp_ch, downsample=True, use_wt=False)) # //2 + # self.from_rgbs.append(FromRGB(in_channel, inp_ch, downsample=(i + 1)!=int(math.log(inp_size, 2)), use_wt=False)) + self.cond_convs.append(ConvBlock(in_channel, out_channel, blur_kernel)) # //2 + if i > self.middle_log_size: + self.comb_convs.append(ConvLayer(out_channel * 2, out_channel, 3)) + else: + self.comb_convs.append(ConvLayer(out_channel, out_channel, 3)) # 最后一层 (8*512) + in_channel = out_channel + + # self.input = ConstantInput(self.channels[middle_size], size=middle_size) + # self.conv1 = StyledConv( + # self.channels[middle_size], self.channels[middle_size], 3, style_dim, blur_kernel=blur_kernel + # ) + # self.to_rgb1 = ToRGB(self.channels[middle_size], style_dim, upsample=False) + + self.convs1 = nn.ModuleList() + self.convs2 = nn.ModuleList() + self.to_rgbs1 = nn.ModuleList() + self.to_rgbs2 = nn.ModuleList() + self.noises = nn.Module() + + in_channel = self.channels[middle_size] + + self.num_layers = (self.log_size - self.middle_log_size + 1) * 2 + for layer_idx in range(self.num_layers): + res = (layer_idx + 8) // 2 + shape = [1, 1, 2 ** res, 2 ** res] + self.noises.register_buffer(f"noise_{layer_idx}", torch.randn(*shape)) + + for i in range(self.middle_log_size + 1, self.log_size + 2): # 4, 5, 6, 7, 8, 9 + out_channel = self.channels[2 ** i] # (16*512)->(32*512)->(64*512)->(128*256)->(256*128)->(512*64) + + self.convs1.append( + StyledConv( + in_channel, + out_channel, + 3, + style_dim, + upsample=True, + blur_kernel=blur_kernel, + ) + ) + + self.convs1.append( + StyledConv( + out_channel, out_channel, 3, style_dim, blur_kernel=blur_kernel + ) + ) + + self.to_rgbs1.append(ToRGB(in_channel=out_channel, style_dim=style_dim, out_channel=out_ch * 4, use_wt=False)) + + self.convs2.append( + StyledConv( + in_channel, + out_channel, + 3, + style_dim, + upsample = True, + blur_kernel = blur_kernel, + ) + ) + + self.convs2.append( + StyledConv( + out_channel, out_channel, 3, style_dim, blur_kernel = blur_kernel + ) + ) + + self.to_rgbs2.append(ToRGB(in_channel = out_channel, style_dim = style_dim, out_channel = out_ch * 4, use_wt=False)) + + in_channel = out_channel + + self.n_latent = self.log_size * 2 - (self.middle_log_size * 2 - 1) + 1 + 3 + + def make_noise(self, device, zero_noise=False): + noises = [] + func = torch.zeros if zero_noise else torch.randn + for i in range(self.middle_log_size + 1, self.log_size + 1): + for _ in range(2): + noises.append(func(1, 1, 2 ** i, 2 ** i, device=device)) + # if zero_noise: + # for i in range(len(noises)): + # if i < len(noises) - 2: + # noises[i] = None + return noises + + def mean_latent(self, n_latent): + latent_in = torch.randn( + n_latent, self.style_dim, device=self.input.input.device + ) + latent = self.style(latent_in).mean(0, keepdim=True) + + return latent + + def get_latent(self, input): + return self.style(input) + + def forward( + self, + styles, + condition_img, + cond=None, + return_latents=False, + inject_index=None, + truncation=1, + truncation_latent=None, + input_is_latent=False, + noise=None, + randomize_noise=True): + """ + :param randomize_noise: False, use fixed noise + """ + if not input_is_latent: + if cond is None: + styles = [self.style(s) for s in styles] + else: + styles = [self.style(torch.cat([s, cond], dim=-1)) for s in styles] + + if noise is None: + if randomize_noise: + noise = [None] * self.num_layers + else: + noise = [ + getattr(self.noises, f"noise_{i}") for i in range(self.num_layers) + ] + + if truncation < 1: + style_t = [] + + for style in styles: + style_t.append( + truncation_latent + truncation * (style - truncation_latent) + ) + + styles = style_t + + if len(styles) < 2: + inject_index = self.n_latent + + if styles[0].ndim < 3: + latent = styles[0].unsqueeze(1).repeat(1, inject_index, 1) + + else: + latent = styles[0] + + else: + if inject_index is None: + inject_index = random.randint(1, self.n_latent - 1) + + latent = styles[0].unsqueeze(1).repeat(1, inject_index, 1) + latent2 = styles[1].unsqueeze(1).repeat(1, self.n_latent - inject_index, 1) + + latent = torch.cat([latent, latent2], 1) + + # cond_list = self.img_unet(condition_img) + cond_img = condition_img#self.dwt(condition_img) + cond_out = self.conv_in(cond_img) ### None + cond_list = [cond_out] ### [] + cond_num = 0 + for from_rgb, cond_conv in zip(self.from_rgbs, self.cond_convs): + cond_img, cond_out = from_rgb(cond_img, cond_out) + cond_out = cond_conv(cond_out) + # print('Down', cond_img.shape, cond_out.shape) + cond_list.append(cond_out) + cond_num += 1 + + # out = self.input(latent) + # out = self.conv1(out, latent[:, 0], noise=noise[0]) + # skip = self.to_rgb1(out, latent[:, 1]) + i = 0 + skip = None + for conv1, conv2, noise1, noise2, to_rgb in zip( + self.convs1[::2], self.convs1[1::2], noise[::2], noise[1::2], self.to_rgbs1 + ): + if i == 0: + out = self.comb_convs[-1](cond_list[-1]) + elif i < 2 * len(self.comb_convs): + out = torch.cat([out, cond_list[-1 - (i // 2)]], dim=1) + out = self.comb_convs[-1 - (i // 2)](out) + out = conv1(out, latent[:, i], noise=noise1) + out = conv2(out, latent[:, i + 1], noise=noise2) + skip = to_rgb(out, latent[:, i + 2], skip) + # print('Up', out.shape, skip.shape) + i += 2 + image1 = skip + + i = 0 + skip = None + for conv1, conv2, noise1, noise2, to_rgb in zip( + self.convs2[::2], self.convs2[1::2], noise[::2], noise[1::2], self.to_rgbs2 + ): + if i == 0: + out = self.comb_convs[-1](cond_list[-1]) + elif i < 2 * len(self.comb_convs): + out = torch.cat([out, cond_list[-1 - (i // 2)]], dim=1) + out = self.comb_convs[-1 - (i // 2)](out) + out = conv1(out, latent[:, i], noise=noise1) + out = conv2(out, latent[:, i + 1], noise=noise2) + skip = to_rgb(out, latent[:, i + 2], skip) + # print('Up', out.shape, skip.shape) + i += 2 + image2 = skip + + images = torch.cat([image1, image2], 1) + #print(images.shape, skip.shape) + + if return_latents: + return images, latent + else: + return images, None \ No newline at end of file diff --git a/AnimatableGaussians/network/styleunet/fused.egg-info/PKG-INFO b/AnimatableGaussians/network/styleunet/fused.egg-info/PKG-INFO new file mode 100644 index 0000000000000000000000000000000000000000..14ce0297943721b5ffe5d1142ae4e122830cc7be --- /dev/null +++ b/AnimatableGaussians/network/styleunet/fused.egg-info/PKG-INFO @@ -0,0 +1,3 @@ +Metadata-Version: 2.1 +Name: fused +Version: 0.0.0 diff --git a/AnimatableGaussians/network/styleunet/fused.egg-info/SOURCES.txt b/AnimatableGaussians/network/styleunet/fused.egg-info/SOURCES.txt new file mode 100644 index 0000000000000000000000000000000000000000..545bdc6d34d6ef2d1a2606d63560c9568cb617f5 --- /dev/null +++ b/AnimatableGaussians/network/styleunet/fused.egg-info/SOURCES.txt @@ -0,0 +1,7 @@ +fused_bias_act.cpp +fused_bias_act_kernel.cu +setup.py +fused.egg-info/PKG-INFO +fused.egg-info/SOURCES.txt +fused.egg-info/dependency_links.txt +fused.egg-info/top_level.txt \ No newline at end of file diff --git a/AnimatableGaussians/network/styleunet/fused.egg-info/dependency_links.txt b/AnimatableGaussians/network/styleunet/fused.egg-info/dependency_links.txt new file mode 100644 index 0000000000000000000000000000000000000000..8b137891791fe96927ad78e64b0aad7bded08bdc --- /dev/null +++ b/AnimatableGaussians/network/styleunet/fused.egg-info/dependency_links.txt @@ -0,0 +1 @@ + diff --git a/AnimatableGaussians/network/styleunet/fused.egg-info/top_level.txt b/AnimatableGaussians/network/styleunet/fused.egg-info/top_level.txt new file mode 100644 index 0000000000000000000000000000000000000000..73459f94d3ff47718e34155bc675ccd94cae5e76 --- /dev/null +++ b/AnimatableGaussians/network/styleunet/fused.egg-info/top_level.txt @@ -0,0 +1 @@ +fused diff --git a/AnimatableGaussians/network/styleunet/fused_act.py b/AnimatableGaussians/network/styleunet/fused_act.py new file mode 100644 index 0000000000000000000000000000000000000000..67bac7c360c28a9079eb137f946e4616a53c2bec --- /dev/null +++ b/AnimatableGaussians/network/styleunet/fused_act.py @@ -0,0 +1,132 @@ +import os + +import torch +from torch import nn +from torch.nn import functional as F +from torch.autograd import Function +from torch.utils.cpp_extension import load + + +# module_path = os.path.dirname(__file__) +# ext_path = os.path.join(module_path, "_ext", 'fused') +# os.makedirs(ext_path, exist_ok=True) +# +# extra_cuda_cflags = [ +# "-DCUDA_HAS_FP16=1", +# "-D__CUDA_NO_HALF_OPERATORS__", +# "-D__CUDA_NO_HALF_CONVERSIONS__", +# "-D__CUDA_NO_HALF2_OPERATORS__", +# ] +# fused = load( +# "fused", +# sources=[ +# os.path.join(module_path, "fused_bias_act.cpp"), +# os.path.join(module_path, "fused_bias_act_kernel.cu"), +# ], +# extra_cflags=["-O2"], +# extra_cuda_cflags=extra_cuda_cflags, +# build_directory=ext_path, +# verbose=True) +import fused + + +class FusedLeakyReLUFunctionBackward(Function): + @staticmethod + def forward(ctx, grad_output, out, bias, negative_slope, scale): + ctx.save_for_backward(out) + ctx.negative_slope = negative_slope + ctx.scale = scale + + empty = grad_output.new_empty(0) + + grad_input = fused.fused_bias_act( + grad_output.contiguous(), empty, out, 3, 1, negative_slope, scale + ) + + dim = [0] + + if grad_input.ndim > 2: + dim += list(range(2, grad_input.ndim)) + + if bias: + grad_bias = grad_input.sum(dim).detach() + + else: + grad_bias = empty + + return grad_input, grad_bias + + @staticmethod + def backward(ctx, gradgrad_input, gradgrad_bias): + out, = ctx.saved_tensors + gradgrad_out = fused.fused_bias_act( + gradgrad_input.contiguous(), gradgrad_bias, out, 3, 1, ctx.negative_slope, ctx.scale + ) + + return gradgrad_out, None, None, None, None + + +class FusedLeakyReLUFunction(Function): + @staticmethod + def forward(ctx, input, bias, negative_slope, scale): + empty = input.new_empty(0) + + ctx.bias = bias is not None + + if bias is None: + bias = empty + + out = fused.fused_bias_act(input, bias, empty, 3, 0, negative_slope, scale) + ctx.save_for_backward(out) + ctx.negative_slope = negative_slope + ctx.scale = scale + + return out + + @staticmethod + def backward(ctx, grad_output): + out, = ctx.saved_tensors + + grad_input, grad_bias = FusedLeakyReLUFunctionBackward.apply( + grad_output, out, ctx.bias, ctx.negative_slope, ctx.scale + ) + + if not ctx.bias: + grad_bias = None + + return grad_input, grad_bias, None, None + + +class FusedLeakyReLU(nn.Module): + def __init__(self, channel, bias=True, negative_slope=0.2, scale=2 ** 0.5): + super().__init__() + + if bias: + self.bias = nn.Parameter(torch.zeros(channel)) + + else: + self.bias = None + + self.negative_slope = negative_slope + self.scale = scale + + def forward(self, input): + return fused_leaky_relu(input, self.bias, self.negative_slope, self.scale) + + +def fused_leaky_relu(input, bias=None, negative_slope=0.2, scale=2 ** 0.5): + if input.device.type == "cpu": + if bias is not None: + rest_dim = [1] * (input.ndim - bias.ndim - 1) + return ( + F.leaky_relu( + input + bias.view(1, bias.shape[0], *rest_dim), negative_slope=0.2 + ) + * scale + ) + + else: + return F.leaky_relu(input, negative_slope=0.2) * scale + + else: + return FusedLeakyReLUFunction.apply(input.contiguous(), bias, negative_slope, scale) diff --git a/AnimatableGaussians/network/styleunet/fused_bias_act.cpp b/AnimatableGaussians/network/styleunet/fused_bias_act.cpp new file mode 100644 index 0000000000000000000000000000000000000000..e8466aa15b2a36d501eda423ccb31b7b9cbd03e5 --- /dev/null +++ b/AnimatableGaussians/network/styleunet/fused_bias_act.cpp @@ -0,0 +1,32 @@ + +#include +#include + +torch::Tensor fused_bias_act_op(const torch::Tensor &input, + const torch::Tensor &bias, + const torch::Tensor &refer, int act, int grad, + float alpha, float scale); + +#define CHECK_CUDA(x) \ + TORCH_CHECK(x.type().is_cuda(), #x " must be a CUDA tensor") +#define CHECK_CONTIGUOUS(x) \ + TORCH_CHECK(x.is_contiguous(), #x " must be contiguous") +#define CHECK_INPUT(x) \ + CHECK_CUDA(x); \ + CHECK_CONTIGUOUS(x) + +torch::Tensor fused_bias_act(const torch::Tensor &input, + const torch::Tensor &bias, + const torch::Tensor &refer, int act, int grad, + float alpha, float scale) { + CHECK_INPUT(input); + CHECK_INPUT(bias); + + at::DeviceGuard guard(input.device()); + + return fused_bias_act_op(input, bias, refer, act, grad, alpha, scale); +} + +PYBIND11_MODULE(TORCH_EXTENSION_NAME, m) { + m.def("fused_bias_act", &fused_bias_act, "fused bias act (CUDA)"); +} \ No newline at end of file diff --git a/AnimatableGaussians/network/styleunet/fused_bias_act_kernel.cu b/AnimatableGaussians/network/styleunet/fused_bias_act_kernel.cu new file mode 100644 index 0000000000000000000000000000000000000000..65427d333b8a615d1cea5765de22318623706134 --- /dev/null +++ b/AnimatableGaussians/network/styleunet/fused_bias_act_kernel.cu @@ -0,0 +1,105 @@ +// Copyright (c) 2019, NVIDIA Corporation. All rights reserved. +// +// This work is made available under the Nvidia Source Code License-NC. +// To view a copy of this license, visit +// https://nvlabs.github.io/stylegan2/license.html + +#include + +#include +#include +#include +#include + + +#include +#include + +template +static __global__ void +fused_bias_act_kernel(scalar_t *out, const scalar_t *p_x, const scalar_t *p_b, + const scalar_t *p_ref, int act, int grad, scalar_t alpha, + scalar_t scale, int loop_x, int size_x, int step_b, + int size_b, int use_bias, int use_ref) { + int xi = blockIdx.x * loop_x * blockDim.x + threadIdx.x; + + scalar_t zero = 0.0; + + for (int loop_idx = 0; loop_idx < loop_x && xi < size_x; + loop_idx++, xi += blockDim.x) { + scalar_t x = p_x[xi]; + + if (use_bias) { + x += p_b[(xi / step_b) % size_b]; + } + + scalar_t ref = use_ref ? p_ref[xi] : zero; + + scalar_t y; + + switch (act * 10 + grad) { + default: + case 10: + y = x; + break; + case 11: + y = x; + break; + case 12: + y = 0.0; + break; + + case 30: + y = (x > 0.0) ? x : x * alpha; + break; + case 31: + y = (ref > 0.0) ? x : x * alpha; + break; + case 32: + y = 0.0; + break; + } + + out[xi] = y * scale; + } +} + +torch::Tensor fused_bias_act_op(const torch::Tensor &input, + const torch::Tensor &bias, + const torch::Tensor &refer, int act, int grad, + float alpha, float scale) { + int curDevice = -1; + cudaGetDevice(&curDevice); + cudaStream_t stream = at::cuda::getCurrentCUDAStream(); + + auto x = input.contiguous(); + auto b = bias.contiguous(); + auto ref = refer.contiguous(); + + int use_bias = b.numel() ? 1 : 0; + int use_ref = ref.numel() ? 1 : 0; + + int size_x = x.numel(); + int size_b = b.numel(); + int step_b = 1; + + for (int i = 1 + 1; i < x.dim(); i++) { + step_b *= x.size(i); + } + + int loop_x = 4; + int block_size = 4 * 32; + int grid_size = (size_x - 1) / (loop_x * block_size) + 1; + + auto y = torch::empty_like(x); + + AT_DISPATCH_FLOATING_TYPES_AND_HALF( + x.scalar_type(), "fused_bias_act_kernel", [&] { + fused_bias_act_kernel<<>>( + y.data_ptr(), x.data_ptr(), + b.data_ptr(), ref.data_ptr(), act, grad, alpha, + scale, loop_x, size_x, step_b, size_b, use_bias, use_ref); + }); + + return y; +} \ No newline at end of file diff --git a/AnimatableGaussians/network/styleunet/setup.py b/AnimatableGaussians/network/styleunet/setup.py new file mode 100644 index 0000000000000000000000000000000000000000..7dc6a4793f853d110ee68ef2cac5038a86fe9855 --- /dev/null +++ b/AnimatableGaussians/network/styleunet/setup.py @@ -0,0 +1,15 @@ +from setuptools import setup, Extension +from torch.utils import cpp_extension +import os + +setup(name='upfirdn2d', + ext_modules=[cpp_extension.CUDAExtension('upfirdn2d', [ + os.path.join("upfirdn2d.cpp"), + os.path.join("upfirdn2d_kernel.cu")])], + cmdclass={'build_ext': cpp_extension.BuildExtension}) + +setup(name='fused', + ext_modules=[cpp_extension.CUDAExtension('fused', [ + os.path.join("fused_bias_act.cpp"), + os.path.join("fused_bias_act_kernel.cu")])], + cmdclass={'build_ext': cpp_extension.BuildExtension}) diff --git a/AnimatableGaussians/network/styleunet/stylegan.py b/AnimatableGaussians/network/styleunet/stylegan.py new file mode 100644 index 0000000000000000000000000000000000000000..11030b86035f1cb073aa22d234a1c79b006be23b --- /dev/null +++ b/AnimatableGaussians/network/styleunet/stylegan.py @@ -0,0 +1,443 @@ +import math +import random +import functools +import operator + +import torch +from torch import nn +from torch.nn import functional as F +from torch.autograd import Function + +from .fused_act import FusedLeakyReLU, fused_leaky_relu +from .upfirdn2d import upfirdn2d +from . import conv2d_gradfix + +from .styleunet import ( + ModulatedConv2d, + StyledConv, + ConstantInput, + PixelNorm, + Upsample, + Downsample, + Blur, + EqualLinear, + ConvLayer, +) + + +def get_haar_wavelet(in_channels): + haar_wav_l = 1 / (2 ** 0.5) * torch.ones(1, 2) + haar_wav_h = 1 / (2 ** 0.5) * torch.ones(1, 2) + haar_wav_h[0, 0] = -1 * haar_wav_h[0, 0] + + haar_wav_ll = haar_wav_l.T * haar_wav_l + haar_wav_lh = haar_wav_h.T * haar_wav_l + haar_wav_hl = haar_wav_l.T * haar_wav_h + haar_wav_hh = haar_wav_h.T * haar_wav_h + + return haar_wav_ll, haar_wav_lh, haar_wav_hl, haar_wav_hh + + +def dwt_init(x): + x01 = x[:, :, 0::2, :] / 2 + x02 = x[:, :, 1::2, :] / 2 + x1 = x01[:, :, :, 0::2] + x2 = x02[:, :, :, 0::2] + x3 = x01[:, :, :, 1::2] + x4 = x02[:, :, :, 1::2] + x_LL = x1 + x2 + x3 + x4 + x_HL = -x1 - x2 + x3 + x4 + x_LH = -x1 + x2 - x3 + x4 + x_HH = x1 - x2 - x3 + x4 + + return torch.cat((x_LL, x_HL, x_LH, x_HH), 1) + + +def iwt_init(x): + r = 2 + in_batch, in_channel, in_height, in_width = x.size() + # print([in_batch, in_channel, in_height, in_width]) + out_batch, out_channel, out_height, out_width = ( + in_batch, + int(in_channel / (r ** 2)), + r * in_height, + r * in_width, + ) + x1 = x[:, 0:out_channel, :, :] / 2 + x2 = x[:, out_channel : out_channel * 2, :, :] / 2 + x3 = x[:, out_channel * 2 : out_channel * 3, :, :] / 2 + x4 = x[:, out_channel * 3 : out_channel * 4, :, :] / 2 + + h = torch.zeros([out_batch, out_channel, out_height, out_width]).float().cuda() + + h[:, :, 0::2, 0::2] = x1 - x2 - x3 + x4 + h[:, :, 1::2, 0::2] = x1 - x2 + x3 - x4 + h[:, :, 0::2, 1::2] = x1 + x2 - x3 - x4 + h[:, :, 1::2, 1::2] = x1 + x2 + x3 + x4 + + return h + + +class HaarTransform(nn.Module): + def __init__(self, in_channels): + super().__init__() + + ll, lh, hl, hh = get_haar_wavelet(in_channels) + + self.register_buffer("ll", ll) + self.register_buffer("lh", lh) + self.register_buffer("hl", hl) + self.register_buffer("hh", hh) + + def forward(self, input): + ll = upfirdn2d(input, self.ll, down=2) + lh = upfirdn2d(input, self.lh, down=2) + hl = upfirdn2d(input, self.hl, down=2) + hh = upfirdn2d(input, self.hh, down=2) + + return torch.cat((ll, lh, hl, hh), 1) + + +class InverseHaarTransform(nn.Module): + def __init__(self, in_channels): + super().__init__() + + ll, lh, hl, hh = get_haar_wavelet(in_channels) + + self.register_buffer("ll", ll) + self.register_buffer("lh", -lh) + self.register_buffer("hl", -hl) + self.register_buffer("hh", hh) + + def forward(self, input): + ll, lh, hl, hh = input.chunk(4, 1) + ll = upfirdn2d(ll, self.ll, up=2, pad=(1, 0, 1, 0)) + lh = upfirdn2d(lh, self.lh, up=2, pad=(1, 0, 1, 0)) + hl = upfirdn2d(hl, self.hl, up=2, pad=(1, 0, 1, 0)) + hh = upfirdn2d(hh, self.hh, up=2, pad=(1, 0, 1, 0)) + + return ll + lh + hl + hh + + +class ToRGB(nn.Module): + def __init__(self, in_channel, style_dim, out_channel=3, upsample=True, blur_kernel=[1, 3, 3, 1]): + super().__init__() + + if upsample: + self.iwt = InverseHaarTransform(3) + self.upsample = Upsample(blur_kernel) + self.dwt = HaarTransform(3) + + self.conv = ModulatedConv2d(in_channel, out_channel * 4, 1, style_dim, demodulate=False) + self.bias = nn.Parameter(torch.zeros(1, out_channel * 4, 1, 1)) + + def forward(self, input, style, skip=None): + out = self.conv(input, style) + out = out + self.bias + + if skip is not None: + skip = self.iwt(skip) + skip = self.upsample(skip) + skip = self.dwt(skip) + + out = out + skip + + return out + + +class StyleGenerator(nn.Module): + def __init__( + self, + size, + out_ch, + style_dim, + n_mlp, + channel_multiplier=2, + blur_kernel=[1, 3, 3, 1], + lr_mlp=0.01, + ): + super().__init__() + + self.size = size + + self.style_dim = style_dim + + layers = [PixelNorm()] + + for i in range(n_mlp): + layers.append( + EqualLinear( + style_dim, style_dim, lr_mul=lr_mlp, activation="fused_lrelu" + ) + ) + + self.style = nn.Sequential(*layers) + + self.channels = { + 4: 512, + 8: 512, + 16: 512, + 32: 512, + 64: 256 * channel_multiplier, + 128: 128 * channel_multiplier, + 256: 64 * channel_multiplier, + 512: 32 * channel_multiplier, + 1024: 16 * channel_multiplier, + } + + self.input = ConstantInput(self.channels[4]) + self.conv1 = StyledConv( + self.channels[4], self.channels[4], 3, style_dim, blur_kernel=blur_kernel + ) + self.to_rgb1 = ToRGB(self.channels[4], style_dim, out_channel = out_ch, upsample=False) + + self.log_size = int(math.log(size, 2)) - 1 + self.num_layers = (self.log_size - 2) * 2 + 1 + + self.convs = nn.ModuleList() + self.upsamples = nn.ModuleList() + self.to_rgbs = nn.ModuleList() + self.noises = nn.Module() + + in_channel = self.channels[4] + + for layer_idx in range(self.num_layers): + res = (layer_idx + 5) // 2 + shape = [1, 1, 2 ** res, 2 ** res] + self.noises.register_buffer(f"noise_{layer_idx}", torch.randn(*shape)) + + for i in range(3, self.log_size + 1): + out_channel = self.channels[2 ** i] + + self.convs.append( + StyledConv( + in_channel, + out_channel, + 3, + style_dim, + upsample=True, + blur_kernel=blur_kernel, + ) + ) + + self.convs.append( + StyledConv( + out_channel, out_channel, 3, style_dim, blur_kernel=blur_kernel + ) + ) + + self.to_rgbs.append(ToRGB(out_channel, style_dim, out_channel = out_ch)) + + in_channel = out_channel + + self.iwt = InverseHaarTransform(3) + + self.n_latent = self.log_size * 2 - 2 + + def make_noise(self): + device = self.input.input.device + + noises = [torch.randn(1, 1, 2 ** 2, 2 ** 2, device=device)] + + for i in range(3, self.log_size + 1): + for _ in range(2): + noises.append(torch.randn(1, 1, 2 ** i, 2 ** i, device=device)) + + return noises + + def mean_latent(self, n_latent): + latent_in = torch.randn( + n_latent, self.style_dim, device=self.input.input.device + ) + latent = self.style(latent_in).mean(0, keepdim=True) + + return latent + + def get_latent(self, input): + return self.style(input) + + def forward( + self, + styles, + return_latents=False, + inject_index=None, + truncation=1, + truncation_latent=None, + input_is_latent=False, + noise=None, + randomize_noise=True, + ): + if not input_is_latent: + styles = [self.style(s) for s in styles] + + if noise is None: + if randomize_noise: + noise = [None] * self.num_layers + else: + noise = [ + getattr(self.noises, f"noise_{i}") for i in range(self.num_layers) + ] + + if truncation < 1: + style_t = [] + + for style in styles: + style_t.append( + truncation_latent + truncation * (style - truncation_latent) + ) + + styles = style_t + + if len(styles) < 2: + inject_index = self.n_latent + + if styles[0].ndim < 3: + latent = styles[0].unsqueeze(1).repeat(1, inject_index, 1) + + else: + latent = styles[0] + + else: + if inject_index is None: + inject_index = random.randint(1, self.n_latent - 1) + + latent = styles[0].unsqueeze(1).repeat(1, inject_index, 1) + latent2 = styles[1].unsqueeze(1).repeat(1, self.n_latent - inject_index, 1) + + latent = torch.cat([latent, latent2], 1) + + out = self.input(latent) + out = self.conv1(out, latent[:, 0], noise=noise[0]) + + skip = self.to_rgb1(out, latent[:, 1]) + + i = 1 + for conv1, conv2, noise1, noise2, to_rgb in zip( + self.convs[::2], self.convs[1::2], noise[1::2], noise[2::2], self.to_rgbs + ): + out = conv1(out, latent[:, i], noise=noise1) + out = conv2(out, latent[:, i + 1], noise=noise2) + skip = to_rgb(out, latent[:, i + 2], skip) + + i += 2 + + image = self.iwt(skip) + + if return_latents: + return image, latent + + else: + return image, None + + +class ConvBlock(nn.Module): + def __init__(self, in_channel, out_channel, blur_kernel=[1, 3, 3, 1]): + super().__init__() + + self.conv1 = ConvLayer(in_channel, in_channel, 3) + self.conv2 = ConvLayer(in_channel, out_channel, 3, downsample=True) + + def forward(self, input): + out = self.conv1(input) + out = self.conv2(out) + + return out + + +class FromRGB(nn.Module): + def __init__(self, out_channel, downsample=True, blur_kernel=[1, 3, 3, 1]): + super().__init__() + + self.downsample = downsample + + if downsample: + self.iwt = InverseHaarTransform(3) + self.downsample = Downsample(blur_kernel) + self.dwt = HaarTransform(3) + + self.conv = ConvLayer(3 * 4, out_channel, 3) + + def forward(self, input, skip=None): + if self.downsample: + input = self.iwt(input) + input = self.downsample(input) + input = self.dwt(input) + + out = self.conv(input) + + if skip is not None: + out = out + skip + + return input, out + + +class Discriminator(nn.Module): + def __init__(self, size, channel_multiplier=2, blur_kernel=[1, 3, 3, 1]): + super().__init__() + + channels = { + 4: 512, + 8: 512, + 16: 512, + 32: 512, + 64: 256 * channel_multiplier, + 128: 128 * channel_multiplier, + 256: 64 * channel_multiplier, + 512: 32 * channel_multiplier, + 1024: 16 * channel_multiplier, + } + + self.dwt = HaarTransform(3) + + self.from_rgbs = nn.ModuleList() + self.convs = nn.ModuleList() + + log_size = int(math.log(size, 2)) - 1 + + in_channel = channels[size] + + for i in range(log_size, 2, -1): + out_channel = channels[2 ** (i - 1)] + + self.from_rgbs.append(FromRGB(in_channel, downsample=i != log_size)) + self.convs.append(ConvBlock(in_channel, out_channel, blur_kernel)) + + in_channel = out_channel + + self.from_rgbs.append(FromRGB(channels[4])) + + self.stddev_group = 4 + self.stddev_feat = 1 + + self.final_conv = ConvLayer(in_channel + 1, channels[4], 3) + self.final_linear = nn.Sequential( + EqualLinear(channels[4] * 4 * 4, channels[4], activation="fused_lrelu"), + EqualLinear(channels[4], 1), + ) + + def forward(self, input): + input = self.dwt(input) + out = None + + for from_rgb, conv in zip(self.from_rgbs, self.convs): + input, out = from_rgb(input, out) + out = conv(out) + + _, out = self.from_rgbs[-1](input, out) + + batch, channel, height, width = out.shape + group = min(batch, self.stddev_group) + stddev = out.view( + group, -1, self.stddev_feat, channel // self.stddev_feat, height, width + ) + stddev = torch.sqrt(stddev.var(0, unbiased=False) + 1e-8) + stddev = stddev.mean([2, 3, 4], keepdims=True).squeeze(2) + stddev = stddev.repeat(group, 1, height, width) + out = torch.cat([out, stddev], 1) + + out = self.final_conv(out) + + out = out.view(batch, -1) + out = self.final_linear(out) + + return out diff --git a/AnimatableGaussians/network/styleunet/styleunet.py b/AnimatableGaussians/network/styleunet/styleunet.py new file mode 100644 index 0000000000000000000000000000000000000000..5dbcdecc4d22a05d3ec1061936f858f0f40cdd56 --- /dev/null +++ b/AnimatableGaussians/network/styleunet/styleunet.py @@ -0,0 +1,861 @@ +import math +import random +import numpy as np +import torch +from torch import nn +from torch.nn import functional as F + +from .fused_act import FusedLeakyReLU, fused_leaky_relu +from .upfirdn2d import upfirdn2d +from . import conv2d_gradfix + + +class PixelNorm(nn.Module): + def __init__(self): + super().__init__() + + def forward(self, input): + return input * torch.rsqrt(torch.mean(input ** 2, dim=1, keepdim=True) + 1e-8) + + +def make_kernel(k): + k = torch.tensor(k, dtype=torch.float32) + + if k.ndim == 1: + k = k[None, :] * k[:, None] + + k /= k.sum() + + return k + + +class Upsample(nn.Module): + def __init__(self, kernel, factor=2): + super().__init__() + + self.factor = factor + kernel = make_kernel(kernel) * (factor ** 2) + self.register_buffer("kernel", kernel) + + p = kernel.shape[0] - factor + + pad0 = (p + 1) // 2 + factor - 1 + pad1 = p // 2 + + self.pad = (pad0, pad1) + + def forward(self, input): + out = upfirdn2d(input, self.kernel, up=self.factor, down=1, pad=self.pad) + + return out + + +class Downsample(nn.Module): + def __init__(self, kernel, factor=2): + super().__init__() + + self.factor = factor + kernel = make_kernel(kernel) + self.register_buffer("kernel", kernel) + + p = kernel.shape[0] - factor + + pad0 = (p + 1) // 2 + pad1 = p // 2 + + self.pad = (pad0, pad1) + + def forward(self, input): + out = upfirdn2d(input, self.kernel, up=1, down=self.factor, pad=self.pad) + + return out + + +class Blur(nn.Module): + def __init__(self, kernel, pad, upsample_factor=1): + super().__init__() + + kernel = make_kernel(kernel) + + if upsample_factor > 1: + kernel = kernel * (upsample_factor ** 2) + + self.register_buffer("kernel", kernel) + + self.pad = pad + + def forward(self, input): + out = upfirdn2d(input, self.kernel, pad=self.pad) + + return out + + +class EqualConv2d(nn.Module): + def __init__( + self, in_channel, out_channel, kernel_size, stride=1, padding=0, bias=True + ): + super().__init__() + + self.weight = nn.Parameter( + torch.randn(out_channel, in_channel, kernel_size, kernel_size) + ) + self.scale = 1 / math.sqrt(in_channel * kernel_size ** 2) + + self.stride = stride + self.padding = padding + + if bias: + self.bias = nn.Parameter(torch.zeros(out_channel)) + + else: + self.bias = None + + def forward(self, input): + out = conv2d_gradfix.conv2d( + input, + self.weight * self.scale, + bias=self.bias, + stride=self.stride, + padding=self.padding, + ) + + return out + + def __repr__(self): + return ( + f"{self.__class__.__name__}({self.weight.shape[1]}, {self.weight.shape[0]}," + f" {self.weight.shape[2]}, stride={self.stride}, padding={self.padding})" + ) + + +class EqualLinear(nn.Module): + def __init__( + self, in_dim, out_dim, bias=True, bias_init=0.0, lr_mul=1.0, activation=None + ): + super().__init__() + + self.weight = nn.Parameter(torch.randn(out_dim, in_dim).div_(lr_mul)) + + if bias: + self.bias = nn.Parameter(torch.zeros(out_dim).fill_(bias_init)) + + else: + self.bias = None + + self.activation = activation + + self.scale = (1 / math.sqrt(in_dim)) * lr_mul + self.lr_mul = lr_mul + + def forward(self, input): + if self.activation: + out = F.linear(input, self.weight * self.scale) + out = fused_leaky_relu(out, self.bias * self.lr_mul) + + else: + out = F.linear( + input, self.weight * self.scale, bias=self.bias * self.lr_mul + ) + + return out + + def __repr__(self): + return ( + f"{self.__class__.__name__}({self.weight.shape[1]}, {self.weight.shape[0]})" + ) + + +class ModulatedConv2d(nn.Module): + def __init__( + self, + in_channel, + out_channel, + kernel_size, + style_dim, + demodulate=True, + upsample=False, + downsample=False, + blur_kernel=[1, 3, 3, 1], + fused=True, + ): + super().__init__() + + self.eps = 1e-8 + self.kernel_size = kernel_size + self.in_channel = in_channel + self.out_channel = out_channel + self.upsample = upsample + self.downsample = downsample + + if upsample: + factor = 2 + p = (len(blur_kernel) - factor) - (kernel_size - 1) + pad0 = (p + 1) // 2 + factor - 1 + pad1 = p // 2 + 1 + + self.blur = Blur(blur_kernel, pad=(pad0, pad1), upsample_factor=factor) + + if downsample: + factor = 2 + p = (len(blur_kernel) - factor) + (kernel_size - 1) + pad0 = (p + 1) // 2 + pad1 = p // 2 + + self.blur = Blur(blur_kernel, pad=(pad0, pad1)) + + fan_in = in_channel * kernel_size ** 2 + self.scale = 1 / math.sqrt(fan_in) + self.padding = kernel_size // 2 + + self.weight = nn.Parameter( + torch.randn(1, out_channel, in_channel, kernel_size, kernel_size) + ) + + self.modulation = EqualLinear(style_dim, in_channel, bias_init=1) + + self.demodulate = demodulate + self.fused = fused + + def __repr__(self): + return ( + f"{self.__class__.__name__}({self.in_channel}, {self.out_channel}, {self.kernel_size}, " + f"upsample={self.upsample}, downsample={self.downsample})" + ) + + def forward(self, input, style): + batch, in_channel, height, width = input.shape + + if not self.fused: + weight = self.scale * self.weight.squeeze(0) + style = self.modulation(style) + if self.demodulate: + w = weight.unsqueeze(0) * style.view(batch, 1, in_channel, 1, 1) + dcoefs = (w.square().sum((2, 3, 4)) + 1e-8).rsqrt() + + input = input * style.reshape(batch, in_channel, 1, 1) + + if self.upsample: + weight = weight.transpose(0, 1) + out = conv2d_gradfix.conv_transpose2d( + input, weight, padding=0, stride=2 + ) + out = self.blur(out) + + elif self.downsample: + input = self.blur(input) + out = conv2d_gradfix.conv2d(input, weight, padding=0, stride=2) + + else: + out = conv2d_gradfix.conv2d(input, weight, padding=self.padding) + + if self.demodulate: + out = out * dcoefs.view(batch, -1, 1, 1) + + return out + + style = self.modulation(style).view(batch, 1, in_channel, 1, 1) + weight = self.scale * self.weight * style + + if self.demodulate: + demod = torch.rsqrt(weight.pow(2).sum([2, 3, 4]) + 1e-8) + weight = weight * demod.view(batch, self.out_channel, 1, 1, 1) + + weight = weight.view( + batch * self.out_channel, in_channel, self.kernel_size, self.kernel_size + ) + + if self.upsample: + input = input.view(1, batch * in_channel, height, width) + weight = weight.view( + batch, self.out_channel, in_channel, self.kernel_size, self.kernel_size + ) + weight = weight.transpose(1, 2).reshape( + batch * in_channel, self.out_channel, self.kernel_size, self.kernel_size + ) + out = conv2d_gradfix.conv_transpose2d( + input, weight, padding=0, stride=2, groups=batch + ) + _, _, height, width = out.shape + out = out.view(batch, self.out_channel, height, width) + out = self.blur(out) + + elif self.downsample: + input = self.blur(input) + _, _, height, width = input.shape + input = input.view(1, batch * in_channel, height, width) + out = conv2d_gradfix.conv2d( + input, weight, padding=0, stride=2, groups=batch + ) + _, _, height, width = out.shape + out = out.view(batch, self.out_channel, height, width) + + else: + input = input.view(1, batch * in_channel, height, width) + out = conv2d_gradfix.conv2d( + input, weight, padding=self.padding, groups=batch + ) + _, _, height, width = out.shape + out = out.view(batch, self.out_channel, height, width) + + return out + + +class NoiseInjection(nn.Module): + def __init__(self): + super().__init__() + + self.weight = nn.Parameter(torch.zeros(1)) + + def forward(self, image, noise=None): + if noise is None: + batch, _, height, width = image.shape + noise = image.new_empty(batch, 1, height, width).normal_() + return image + self.weight * noise + + +class ConstantInput(nn.Module): + def __init__(self, channel, size=4): + super().__init__() + + self.input = nn.Parameter(torch.randn(1, channel, size, size)) + + def forward(self, input): + batch = input.shape[0] + out = self.input.repeat(batch, 1, 1, 1) + + return out + + +class ConvLayer(nn.Sequential): + def __init__( + self, + in_channel, + out_channel, + kernel_size, + downsample=False, + blur_kernel=[1, 3, 3, 1], + bias=True, + activate=True, + ): + layers = [] + + if downsample: + factor = 2 + p = (len(blur_kernel) - factor) + (kernel_size - 1) + pad0 = (p + 1) // 2 + pad1 = p // 2 + + layers.append(Blur(blur_kernel, pad=(pad0, pad1))) + + stride = 2 + self.padding = 0 + + else: + stride = 1 + self.padding = kernel_size // 2 + + layers.append( + EqualConv2d( + in_channel, + out_channel, + kernel_size, + padding=self.padding, + stride=stride, + bias=bias and not activate, + ) + ) + + if activate: + layers.append(FusedLeakyReLU(out_channel, bias=bias)) + + super().__init__(*layers) + + +def get_haar_wavelet(in_channels): + haar_wav_l = 1 / (2 ** 0.5) * torch.ones(1, 2) + haar_wav_h = 1 / (2 ** 0.5) * torch.ones(1, 2) + haar_wav_h[0, 0] = -1 * haar_wav_h[0, 0] + + haar_wav_ll = haar_wav_l.T * haar_wav_l + haar_wav_lh = haar_wav_h.T * haar_wav_l + haar_wav_hl = haar_wav_l.T * haar_wav_h + haar_wav_hh = haar_wav_h.T * haar_wav_h + + return haar_wav_ll, haar_wav_lh, haar_wav_hl, haar_wav_hh + + +class HaarTransform(nn.Module): + def __init__(self, in_channels): + super().__init__() + + ll, lh, hl, hh = get_haar_wavelet(in_channels) + + self.register_buffer('ll', ll) + self.register_buffer('lh', lh) + self.register_buffer('hl', hl) + self.register_buffer('hh', hh) + + def forward(self, input): + ll = upfirdn2d(input, self.ll, down=2) + lh = upfirdn2d(input, self.lh, down=2) + hl = upfirdn2d(input, self.hl, down=2) + hh = upfirdn2d(input, self.hh, down=2) + + return torch.cat((ll, lh, hl, hh), 1) + + +class InverseHaarTransform(nn.Module): + def __init__(self, in_channels): + super().__init__() + + ll, lh, hl, hh = get_haar_wavelet(in_channels) + + self.register_buffer('ll', ll) + self.register_buffer('lh', -lh) + self.register_buffer('hl', -hl) + self.register_buffer('hh', hh) + + def forward(self, input): + ll, lh, hl, hh = input.chunk(4, 1) + ll = upfirdn2d(ll, self.ll, up=2, pad=(1, 0, 1, 0)) + lh = upfirdn2d(lh, self.lh, up=2, pad=(1, 0, 1, 0)) + hl = upfirdn2d(hl, self.hl, up=2, pad=(1, 0, 1, 0)) + hh = upfirdn2d(hh, self.hh, up=2, pad=(1, 0, 1, 0)) + + return ll + lh + hl + hh + + +class ConvBlock(nn.Module): + def __init__(self, in_channel, out_channel, blur_kernel=[1, 3, 3, 1], downsample=True): + super().__init__() + + self.conv1 = ConvLayer(in_channel, in_channel, 3) + self.conv2 = ConvLayer(in_channel, out_channel, 3, downsample=downsample) + + def forward(self, input): + out = self.conv1(input) + out = self.conv2(out) + + return out + + +class FromRGB(nn.Module): + def __init__(self, out_channel, in_channel, downsample=True, blur_kernel=[1, 3, 3, 1], use_wt=True): + super().__init__() + + self.downsample = downsample + self.use_wt = use_wt + if downsample: + self.downsample = Downsample(blur_kernel) + if use_wt: + self.iwt = InverseHaarTransform(in_channel) + self.dwt = HaarTransform(in_channel) + self.in_channel = in_channel * 4 if self.use_wt else in_channel + self.conv = ConvLayer(self.in_channel, out_channel, 1) + + def forward(self, input, skip=None): + if self.downsample: + if self.use_wt: + input = self.iwt(input) # [1024, 3] + input = self.downsample(input) # [512, 3] + input = self.dwt(input) # [256, 12] + else: + input = self.downsample(input) # [512, 3] + + out = self.conv(input) # [256, out_channel] + + if skip is not None: + out = out + skip + + return input, out + + +class Discriminator(nn.Module): + def __init__(self, size, img_channel=6, channel_multiplier=2, blur_kernel=[1, 3, 3, 1], c_dim=0): + super().__init__() + + channels = { + 4: 512, + 8: 512, + 16: 512, + 32: 512, + 64: 256 * channel_multiplier, + 128: 128 * channel_multiplier, + 256: 64 * channel_multiplier, + 512: 32 * channel_multiplier, + 1024: 16 * channel_multiplier, + } + + self.dwt = HaarTransform(img_channel) + + self.from_rgbs = nn.ModuleList() + self.convs = nn.ModuleList() + + log_size = int(math.log(size, 2)) - 1 + + in_channel = channels[size] + + for i in range(log_size, 2, -1): + out_channel = channels[2 ** (i - 1)] + + self.from_rgbs.append(FromRGB(in_channel, img_channel, downsample=i != log_size)) + self.convs.append(ConvBlock(in_channel, out_channel, blur_kernel)) + + in_channel = out_channel + + self.from_rgbs.append(FromRGB(channels[4], img_channel)) + + self.stddev_group = 4 + self.stddev_feat = 1 + + self.final_conv = ConvLayer(in_channel + 1, channels[4], 3) + self.final_linear = nn.Sequential( + EqualLinear(channels[4] * 4 * 4, channels[4], activation="fused_lrelu"), + EqualLinear(channels[4], 1), + ) + + self.c_dim = c_dim + if c_dim > 0: + style_dim = 64 + lr_mlp = 0.01 + layers = [] + layers.append( + EqualLinear( + c_dim, style_dim, lr_mul=lr_mlp, activation="fused_lrelu" + ) + ) + for i in range(3): + layers.append( + EqualLinear( + style_dim, style_dim, lr_mul=lr_mlp, activation="fused_lrelu" + ) + ) + self.mapping = nn.Sequential(*layers) + + def forward(self, input, flat_pose=None): + input = self.dwt(input) + out = None + + for from_rgb, conv in zip(self.from_rgbs, self.convs): + input, out = from_rgb(input, out) + out = conv(out) + + _, out = self.from_rgbs[-1](input, out) + + batch, channel, height, width = out.shape + group = min(batch, self.stddev_group) + stddev = out.view(group, -1, self.stddev_feat, channel // self.stddev_feat, height, width) + stddev = torch.sqrt(stddev.var(0, unbiased=False) + 1e-8) + stddev = stddev.mean([2, 3, 4], keepdims=True).squeeze(2) + stddev = stddev.repeat(group, 1, height, width) + out = torch.cat([out, stddev], 1) + + out = self.final_conv(out) + + out = out.view(batch, -1) + out = self.final_linear(out) + if self.c_dim > 0: + pose_embed = self.mapping(flat_pose) + pose_embed = self.normalize_2nd_moment(pose_embed) + out = (out * pose_embed).sum(dim=1, keepdim=True) * (1 / np.sqrt(self.c_dim)) + + return out + + def normalize_2nd_moment(self, x, dim=1, eps=1e-8): + return x * (x.square().mean(dim=dim, keepdim=True) + eps).rsqrt() + + +class StyledConv(nn.Module): + def __init__( + self, + in_channel, + out_channel, + kernel_size, + style_dim, + upsample=False, + blur_kernel=[1, 3, 3, 1], + demodulate=True, + ): + super().__init__() + + self.conv = ModulatedConv2d( + in_channel, + out_channel, + kernel_size, + style_dim, + upsample=upsample, + blur_kernel=blur_kernel, + demodulate=demodulate, + ) + + self.noise = NoiseInjection() + # self.bias = nn.Parameter(torch.zeros(1, out_channel, 1, 1)) + # self.activate = ScaledLeakyReLU(0.2) + self.activate = FusedLeakyReLU(out_channel) + + def forward(self, input, style, noise=None): + out = self.conv(input, style) + out = self.noise(out, noise=noise) + # out = out + self.bias + out = self.activate(out) + + return out + + +class ToRGB(nn.Module): + def __init__(self, in_channel, style_dim, out_channel=12, upsample=True, blur_kernel=[1, 3, 3, 1], use_wt=True): + super().__init__() + self.use_wt = use_wt + if upsample: + self.upsample = Upsample(blur_kernel) + if use_wt: + self.iwt = InverseHaarTransform(3) + self.dwt = HaarTransform(3) + self.out_channel = out_channel if self.use_wt else out_channel // 4 + self.conv = ModulatedConv2d(in_channel, self.out_channel, 1, style_dim, demodulate=False) + self.bias = nn.Parameter(torch.zeros(1, self.out_channel, 1, 1)) + + def forward(self, input, style, skip=None): + out = self.conv(input, style) + out = out + self.bias + + if skip is not None: + if self.use_wt: + skip = self.iwt(skip) + skip = self.upsample(skip) + skip = self.dwt(skip) + else: + skip = self.upsample(skip) + out = out + skip + + return out + + +class SWGAN_unet(nn.Module): + def __init__(self, inp_size, inp_ch, out_ch, out_size, style_dim, n_mlp, middle_size=8, c_dim=0, + channel_multiplier=2, blur_kernel=[1, 3, 3, 1], lr_mlp=0.01): + super().__init__() + + self.inp_size = inp_size + + self.style_dim = style_dim + self.middle_log_size = int(math.log(middle_size, 2)) + + layers = [PixelNorm()] + if c_dim == 0: + layers.append(EqualLinear( + style_dim, style_dim, lr_mul=lr_mlp, activation="fused_lrelu" + )) + else: + layers.append(EqualLinear( + style_dim + c_dim, style_dim, lr_mul=lr_mlp, activation="fused_lrelu" + )) + for i in range(n_mlp-1): + layers.append( + EqualLinear( + style_dim, style_dim, lr_mul=lr_mlp, activation="fused_lrelu" + ) + ) + + self.style = nn.Sequential(*layers) # mapping network + + self.channels = { + 4: 512, + 8: 512, + 16: 512, + 32: 512, + 64: 256 * channel_multiplier, + 128: 128 * channel_multiplier, + 256: 64 * channel_multiplier, + 512: 32 * channel_multiplier, + 1024: 16 * channel_multiplier, + } + + self.log_size = int(math.log(out_size, 2)) - 1 + + # add new layer here + # self.dwt = HaarTransform(3) + # self.from_rgbs = nn.ModuleList() + # self.cond_convs = nn.ModuleList() + self.comb_convs = nn.ModuleList() + + in_channel = self.channels[inp_size // 2] # 64 + self.from_rgbs = nn.ModuleList() + self.cond_convs = nn.ModuleList() + self.comb_convs = nn.ModuleList() # 64, 32, 16 + self.comb_convs.append(ConvLayer(in_channel * 2, in_channel, 3)) + self.conv_in = ConvLayer(inp_ch, in_channel, 3, downsample=True) + for i in range(int(math.log(inp_size, 2)) - 2, self.middle_log_size - 1, -1): # 32, 16, 8 + out_channel = self.channels[2 ** i] # (inp_size/2)->->(8*512) + self.from_rgbs.append(FromRGB(in_channel, inp_ch, downsample=True, use_wt=False)) # //2 + # self.from_rgbs.append(FromRGB(in_channel, inp_ch, downsample=(i + 1)!=int(math.log(inp_size, 2)), use_wt=False)) + self.cond_convs.append(ConvBlock(in_channel, out_channel, blur_kernel)) # //2 + if i > self.middle_log_size: + self.comb_convs.append(ConvLayer(out_channel * 2, out_channel, 3)) + else: + self.comb_convs.append(ConvLayer(out_channel, out_channel, 3)) # 最后一层 (8*512) + in_channel = out_channel + + # self.input = ConstantInput(self.channels[middle_size], size=middle_size) + # self.conv1 = StyledConv( + # self.channels[middle_size], self.channels[middle_size], 3, style_dim, blur_kernel=blur_kernel + # ) + # self.to_rgb1 = ToRGB(self.channels[middle_size], style_dim, upsample=False) + + self.convs = nn.ModuleList() + self.to_rgbs = nn.ModuleList() + self.noises = nn.Module() + + in_channel = self.channels[middle_size] + + self.num_layers = (self.log_size - self.middle_log_size) * 2 + for layer_idx in range(self.num_layers): + res = (layer_idx + 8) // 2 + shape = [1, 1, 2 ** res, 2 ** res] + self.noises.register_buffer(f"noise_{layer_idx}", torch.randn(*shape)) + + for i in range(self.middle_log_size + 1, self.log_size + 1): # 4, 5, 6, 7, 8, 9 + out_channel = self.channels[2 ** i] # (16*512)->(32*512)->(64*512)->(128*256)->(256*128)->(512*64) + + self.convs.append( + StyledConv( + in_channel, + out_channel, + 3, + style_dim, + upsample=True, + blur_kernel=blur_kernel, + ) + ) + + self.convs.append( + StyledConv( + out_channel, out_channel, 3, style_dim, blur_kernel=blur_kernel + ) + ) + + self.to_rgbs.append(ToRGB(in_channel=out_channel, style_dim=style_dim, out_channel=out_ch * 4)) + + in_channel = out_channel + self.iwt = InverseHaarTransform(out_ch) + + self.n_latent = self.log_size * 2 - (self.middle_log_size * 2 - 1) + 1 + + def make_noise(self, device, zero_noise=False): + noises = [] + func = torch.zeros if zero_noise else torch.randn + for i in range(self.middle_log_size + 1, self.log_size + 1): + for _ in range(2): + noises.append(func(1, 1, 2 ** i, 2 ** i, device=device)) + # if zero_noise: + # for i in range(len(noises)): + # if i < len(noises) - 2: + # noises[i] = None + return noises + + def mean_latent(self, n_latent): + latent_in = torch.randn( + n_latent, self.style_dim, device=self.input.input.device + ) + latent = self.style(latent_in).mean(0, keepdim=True) + + return latent + + def get_latent(self, input): + return self.style(input) + + def forward( + self, + styles, + condition_img, + cond=None, + return_latents=False, + inject_index=None, + truncation=1, + truncation_latent=None, + input_is_latent=False, + noise=None, + randomize_noise=True): + """ + + :param randomize_noise: False, use fixed noise + """ + if not input_is_latent: + if cond is None: + styles = [self.style(s) for s in styles] + else: + styles = [self.style(torch.cat([s, cond], dim=-1)) for s in styles] + + if noise is None: + if randomize_noise: + noise = [None] * self.num_layers + else: + noise = [ + getattr(self.noises, f"noise_{i}") for i in range(self.num_layers) + ] + + if truncation < 1: + style_t = [] + + for style in styles: + style_t.append( + truncation_latent + truncation * (style - truncation_latent) + ) + + styles = style_t + + if len(styles) < 2: + inject_index = self.n_latent + + if styles[0].ndim < 3: + latent = styles[0].unsqueeze(1).repeat(1, inject_index, 1) + + else: + latent = styles[0] + + else: + if inject_index is None: + inject_index = random.randint(1, self.n_latent - 1) + + latent = styles[0].unsqueeze(1).repeat(1, inject_index, 1) + latent2 = styles[1].unsqueeze(1).repeat(1, self.n_latent - inject_index, 1) + + latent = torch.cat([latent, latent2], 1) + + # cond_list = self.img_unet(condition_img) + cond_img = condition_img + cond_out = self.conv_in(cond_img) ### None + cond_list = [cond_out] ### [] + cond_num = 0 + for from_rgb, cond_conv in zip(self.from_rgbs, self.cond_convs): + cond_img, cond_out = from_rgb(cond_img, cond_out) + cond_out = cond_conv(cond_out) + # print('Down', cond_img.shape, cond_out.shape) + cond_list.append(cond_out) + cond_num += 1 + + # out = self.input(latent) + # out = self.conv1(out, latent[:, 0], noise=noise[0]) + # skip = self.to_rgb1(out, latent[:, 1]) + i = 0 + skip = None + for conv1, conv2, noise1, noise2, to_rgb in zip( + self.convs[::2], self.convs[1::2], noise[::2], noise[1::2], self.to_rgbs + ): + if i == 0: + out = self.comb_convs[-1](cond_list[-1]) + elif i < 2 * len(self.comb_convs): + out = torch.cat([out, cond_list[-1 - (i // 2)]], dim=1) + out = self.comb_convs[-1 - (i // 2)](out) + out = conv1(out, latent[:, i], noise=noise1) + out = conv2(out, latent[:, i + 1], noise=noise2) + skip = to_rgb(out, latent[:, i + 2], skip) + # print('Up', out.shape, skip.shape) + i += 2 + + image = self.iwt(skip) + if return_latents: + return image, latent + + else: + return image, None \ No newline at end of file diff --git a/AnimatableGaussians/network/styleunet/upfirdn2d.cpp b/AnimatableGaussians/network/styleunet/upfirdn2d.cpp new file mode 100644 index 0000000000000000000000000000000000000000..d667b2cfcb2eb129b6582dea58dc0dda31e4bc45 --- /dev/null +++ b/AnimatableGaussians/network/styleunet/upfirdn2d.cpp @@ -0,0 +1,31 @@ +#include +#include + +torch::Tensor upfirdn2d_op(const torch::Tensor &input, + const torch::Tensor &kernel, int up_x, int up_y, + int down_x, int down_y, int pad_x0, int pad_x1, + int pad_y0, int pad_y1); + +#define CHECK_CUDA(x) \ + TORCH_CHECK(x.type().is_cuda(), #x " must be a CUDA tensor") +#define CHECK_CONTIGUOUS(x) \ + TORCH_CHECK(x.is_contiguous(), #x " must be contiguous") +#define CHECK_INPUT(x) \ + CHECK_CUDA(x); \ + CHECK_CONTIGUOUS(x) + +torch::Tensor upfirdn2d(const torch::Tensor &input, const torch::Tensor &kernel, + int up_x, int up_y, int down_x, int down_y, int pad_x0, + int pad_x1, int pad_y0, int pad_y1) { + CHECK_INPUT(input); + CHECK_INPUT(kernel); + + at::DeviceGuard guard(input.device()); + + return upfirdn2d_op(input, kernel, up_x, up_y, down_x, down_y, pad_x0, pad_x1, + pad_y0, pad_y1); +} + +PYBIND11_MODULE(TORCH_EXTENSION_NAME, m) { + m.def("upfirdn2d", &upfirdn2d, "upfirdn2d (CUDA)"); +} \ No newline at end of file diff --git a/AnimatableGaussians/network/styleunet/upfirdn2d.egg-info/PKG-INFO b/AnimatableGaussians/network/styleunet/upfirdn2d.egg-info/PKG-INFO new file mode 100644 index 0000000000000000000000000000000000000000..fbb424f7ec73b3a2fd86e9e8d98f4e725cad3c95 --- /dev/null +++ b/AnimatableGaussians/network/styleunet/upfirdn2d.egg-info/PKG-INFO @@ -0,0 +1,3 @@ +Metadata-Version: 2.1 +Name: upfirdn2d +Version: 0.0.0 diff --git a/AnimatableGaussians/network/styleunet/upfirdn2d.egg-info/SOURCES.txt b/AnimatableGaussians/network/styleunet/upfirdn2d.egg-info/SOURCES.txt new file mode 100644 index 0000000000000000000000000000000000000000..5d34ab3e7ab4710ff2df91986cabbe57165dda44 --- /dev/null +++ b/AnimatableGaussians/network/styleunet/upfirdn2d.egg-info/SOURCES.txt @@ -0,0 +1,7 @@ +setup.py +upfirdn2d.cpp +upfirdn2d_kernel.cu +upfirdn2d.egg-info/PKG-INFO +upfirdn2d.egg-info/SOURCES.txt +upfirdn2d.egg-info/dependency_links.txt +upfirdn2d.egg-info/top_level.txt \ No newline at end of file diff --git a/AnimatableGaussians/network/styleunet/upfirdn2d.egg-info/dependency_links.txt b/AnimatableGaussians/network/styleunet/upfirdn2d.egg-info/dependency_links.txt new file mode 100644 index 0000000000000000000000000000000000000000..8b137891791fe96927ad78e64b0aad7bded08bdc --- /dev/null +++ b/AnimatableGaussians/network/styleunet/upfirdn2d.egg-info/dependency_links.txt @@ -0,0 +1 @@ + diff --git a/AnimatableGaussians/network/styleunet/upfirdn2d.egg-info/top_level.txt b/AnimatableGaussians/network/styleunet/upfirdn2d.egg-info/top_level.txt new file mode 100644 index 0000000000000000000000000000000000000000..f0d0804fbf8b75bddd62b64829de90a6bd97939a --- /dev/null +++ b/AnimatableGaussians/network/styleunet/upfirdn2d.egg-info/top_level.txt @@ -0,0 +1 @@ +upfirdn2d diff --git a/AnimatableGaussians/network/styleunet/upfirdn2d.py b/AnimatableGaussians/network/styleunet/upfirdn2d.py new file mode 100644 index 0000000000000000000000000000000000000000..a566686dbad74b3e91cf74fb069549d634996e09 --- /dev/null +++ b/AnimatableGaussians/network/styleunet/upfirdn2d.py @@ -0,0 +1,227 @@ +from collections import abc +import os + +import torch +from torch.nn import functional as F +from torch.autograd import Function + +# from torch.utils.cpp_extension import load +# +# module_path = os.path.dirname(__file__) +# ext_path = os.path.join(module_path, "_ext", 'upfirdn2d') +# os.makedirs(ext_path, exist_ok=True) +# +# extra_cuda_cflags = [ +# "-DCUDA_HAS_FP16=1", +# "-D__CUDA_NO_HALF_OPERATORS__", +# "-D__CUDA_NO_HALF_CONVERSIONS__", +# "-D__CUDA_NO_HALF2_OPERATORS__", +# ] +# upfirdn2d_op = load( +# "upfirdn2d", +# sources=[ +# os.path.join(module_path, "upfirdn2d.cpp"), +# os.path.join(module_path, "upfirdn2d_kernel.cu"), +# ], +# extra_cflags=["-O2"], +# extra_cuda_cflags=extra_cuda_cflags, +# build_directory=ext_path, +# verbose=True) +import upfirdn2d as upfirdn2d_op + + +class UpFirDn2dBackward(Function): + @staticmethod + def forward( + ctx, grad_output, kernel, grad_kernel, up, down, pad, g_pad, in_size, out_size + ): + + up_x, up_y = up + down_x, down_y = down + g_pad_x0, g_pad_x1, g_pad_y0, g_pad_y1 = g_pad + + grad_output = grad_output.reshape(-1, out_size[0], out_size[1], 1) + + if not grad_output.is_contiguous(): + grad_output = grad_output.contiguous() + + grad_input = upfirdn2d_op.upfirdn2d( + grad_output, + grad_kernel, + down_x, + down_y, + up_x, + up_y, + g_pad_x0, + g_pad_x1, + g_pad_y0, + g_pad_y1, + ) + grad_input = grad_input.view(in_size[0], in_size[1], in_size[2], in_size[3]) + + ctx.save_for_backward(kernel) + + pad_x0, pad_x1, pad_y0, pad_y1 = pad + + ctx.up_x = up_x + ctx.up_y = up_y + ctx.down_x = down_x + ctx.down_y = down_y + ctx.pad_x0 = pad_x0 + ctx.pad_x1 = pad_x1 + ctx.pad_y0 = pad_y0 + ctx.pad_y1 = pad_y1 + ctx.in_size = in_size + ctx.out_size = out_size + + return grad_input + + @staticmethod + def backward(ctx, gradgrad_input): + kernel, = ctx.saved_tensors + + gradgrad_input = gradgrad_input.reshape(-1, ctx.in_size[2], ctx.in_size[3], 1) + + gradgrad_out = upfirdn2d_op.upfirdn2d( + gradgrad_input, + kernel, + ctx.up_x, + ctx.up_y, + ctx.down_x, + ctx.down_y, + ctx.pad_x0, + ctx.pad_x1, + ctx.pad_y0, + ctx.pad_y1, + ) + # gradgrad_out = gradgrad_out.view(ctx.in_size[0], ctx.out_size[0], ctx.out_size[1], ctx.in_size[3]) + gradgrad_out = gradgrad_out.view( + ctx.in_size[0], ctx.in_size[1], ctx.out_size[0], ctx.out_size[1] + ) + + return gradgrad_out, None, None, None, None, None, None, None, None + + +class UpFirDn2d(Function): + @staticmethod + def forward(ctx, input, kernel, up, down, pad): + up_x, up_y = up + down_x, down_y = down + pad_x0, pad_x1, pad_y0, pad_y1 = pad + + kernel_h, kernel_w = kernel.shape + batch, channel, in_h, in_w = input.shape + ctx.in_size = input.shape + + input = input.reshape(-1, in_h, in_w, 1) + if not input.is_contiguous(): #此处主要是处理偶尔出现的reshape之后也不contiguous的问题 + input = input.contiguous() + + ctx.save_for_backward(kernel, torch.flip(kernel, [0, 1])) + + out_h = (in_h * up_y + pad_y0 + pad_y1 - kernel_h + down_y) // down_y + out_w = (in_w * up_x + pad_x0 + pad_x1 - kernel_w + down_x) // down_x + ctx.out_size = (out_h, out_w) + + ctx.up = (up_x, up_y) + ctx.down = (down_x, down_y) + ctx.pad = (pad_x0, pad_x1, pad_y0, pad_y1) + + g_pad_x0 = kernel_w - pad_x0 - 1 + g_pad_y0 = kernel_h - pad_y0 - 1 + g_pad_x1 = in_w * up_x - out_w * down_x + pad_x0 - up_x + 1 + g_pad_y1 = in_h * up_y - out_h * down_y + pad_y0 - up_y + 1 + + ctx.g_pad = (g_pad_x0, g_pad_x1, g_pad_y0, g_pad_y1) + + out = upfirdn2d_op.upfirdn2d( + input, kernel, up_x, up_y, down_x, down_y, pad_x0, pad_x1, pad_y0, pad_y1 + ) + # out = out.view(major, out_h, out_w, minor) + out = out.view(-1, channel, out_h, out_w) + + return out + + @staticmethod + def backward(ctx, grad_output): + kernel, grad_kernel = ctx.saved_tensors + + grad_input = None + + if ctx.needs_input_grad[0]: + grad_input = UpFirDn2dBackward.apply( + grad_output, + kernel, + grad_kernel, + ctx.up, + ctx.down, + ctx.pad, + ctx.g_pad, + ctx.in_size, + ctx.out_size, + ) + + return grad_input, None, None, None, None + + +def upfirdn2d(input, kernel, up=1, down=1, pad=(0, 0)): + if not isinstance(up, abc.Iterable): + up = (up, up) + + if not isinstance(down, abc.Iterable): + down = (down, down) + + if len(pad) == 2: + pad = (pad[0], pad[1], pad[0], pad[1]) + + if input.device.type == "cpu": + out = upfirdn2d_native(input, kernel, *up, *down, *pad) + + else: + out = UpFirDn2d.apply(input, kernel, up, down, pad) + + return out + + +def upfirdn2d_native( + input, kernel, up_x, up_y, down_x, down_y, pad_x0, pad_x1, pad_y0, pad_y1 +): + _, channel, in_h, in_w = input.shape + input = input.reshape(-1, in_h, in_w, 1) + + _, in_h, in_w, minor = input.shape + kernel_h, kernel_w = kernel.shape + + out = input.view(-1, in_h, 1, in_w, 1, minor) + out = F.pad(out, [0, 0, 0, up_x - 1, 0, 0, 0, up_y - 1]) + out = out.view(-1, in_h * up_y, in_w * up_x, minor) + + out = F.pad( + out, [0, 0, max(pad_x0, 0), max(pad_x1, 0), max(pad_y0, 0), max(pad_y1, 0)] + ) + out = out[ + :, + max(-pad_y0, 0) : out.shape[1] - max(-pad_y1, 0), + max(-pad_x0, 0) : out.shape[2] - max(-pad_x1, 0), + :, + ] + + out = out.permute(0, 3, 1, 2) + out = out.reshape( + [-1, 1, in_h * up_y + pad_y0 + pad_y1, in_w * up_x + pad_x0 + pad_x1] + ) + w = torch.flip(kernel, [0, 1]).view(1, 1, kernel_h, kernel_w) + out = F.conv2d(out, w) + out = out.reshape( + -1, + minor, + in_h * up_y + pad_y0 + pad_y1 - kernel_h + 1, + in_w * up_x + pad_x0 + pad_x1 - kernel_w + 1, + ) + out = out.permute(0, 2, 3, 1) + out = out[:, ::down_y, ::down_x, :] + + out_h = (in_h * up_y + pad_y0 + pad_y1 - kernel_h + down_y) // down_y + out_w = (in_w * up_x + pad_x0 + pad_x1 - kernel_w + down_x) // down_x + + return out.view(-1, channel, out_h, out_w) diff --git a/AnimatableGaussians/network/styleunet/upfirdn2d_kernel.cu b/AnimatableGaussians/network/styleunet/upfirdn2d_kernel.cu new file mode 100644 index 0000000000000000000000000000000000000000..61d3dc413041738bb6885e33da7b3ed8fbfa2496 --- /dev/null +++ b/AnimatableGaussians/network/styleunet/upfirdn2d_kernel.cu @@ -0,0 +1,369 @@ +// Copyright (c) 2019, NVIDIA Corporation. All rights reserved. +// +// This work is made available under the Nvidia Source Code License-NC. +// To view a copy of this license, visit +// https://nvlabs.github.io/stylegan2/license.html + +#include + +#include +#include +#include +#include + +#include +#include + +static __host__ __device__ __forceinline__ int floor_div(int a, int b) { + int c = a / b; + + if (c * b > a) { + c--; + } + + return c; +} + +struct UpFirDn2DKernelParams { + int up_x; + int up_y; + int down_x; + int down_y; + int pad_x0; + int pad_x1; + int pad_y0; + int pad_y1; + + int major_dim; + int in_h; + int in_w; + int minor_dim; + int kernel_h; + int kernel_w; + int out_h; + int out_w; + int loop_major; + int loop_x; +}; + +template +__global__ void upfirdn2d_kernel_large(scalar_t *out, const scalar_t *input, + const scalar_t *kernel, + const UpFirDn2DKernelParams p) { + int minor_idx = blockIdx.x * blockDim.x + threadIdx.x; + int out_y = minor_idx / p.minor_dim; + minor_idx -= out_y * p.minor_dim; + int out_x_base = blockIdx.y * p.loop_x * blockDim.y + threadIdx.y; + int major_idx_base = blockIdx.z * p.loop_major; + + if (out_x_base >= p.out_w || out_y >= p.out_h || + major_idx_base >= p.major_dim) { + return; + } + + int mid_y = out_y * p.down_y + p.up_y - 1 - p.pad_y0; + int in_y = min(max(floor_div(mid_y, p.up_y), 0), p.in_h); + int h = min(max(floor_div(mid_y + p.kernel_h, p.up_y), 0), p.in_h) - in_y; + int kernel_y = mid_y + p.kernel_h - (in_y + 1) * p.up_y; + + for (int loop_major = 0, major_idx = major_idx_base; + loop_major < p.loop_major && major_idx < p.major_dim; + loop_major++, major_idx++) { + for (int loop_x = 0, out_x = out_x_base; + loop_x < p.loop_x && out_x < p.out_w; loop_x++, out_x += blockDim.y) { + int mid_x = out_x * p.down_x + p.up_x - 1 - p.pad_x0; + int in_x = min(max(floor_div(mid_x, p.up_x), 0), p.in_w); + int w = min(max(floor_div(mid_x + p.kernel_w, p.up_x), 0), p.in_w) - in_x; + int kernel_x = mid_x + p.kernel_w - (in_x + 1) * p.up_x; + + const scalar_t *x_p = + &input[((major_idx * p.in_h + in_y) * p.in_w + in_x) * p.minor_dim + + minor_idx]; + const scalar_t *k_p = &kernel[kernel_y * p.kernel_w + kernel_x]; + int x_px = p.minor_dim; + int k_px = -p.up_x; + int x_py = p.in_w * p.minor_dim; + int k_py = -p.up_y * p.kernel_w; + + scalar_t v = 0.0f; + + for (int y = 0; y < h; y++) { + for (int x = 0; x < w; x++) { + v += static_cast(*x_p) * static_cast(*k_p); + x_p += x_px; + k_p += k_px; + } + + x_p += x_py - w * x_px; + k_p += k_py - w * k_px; + } + + out[((major_idx * p.out_h + out_y) * p.out_w + out_x) * p.minor_dim + + minor_idx] = v; + } + } +} + +template +__global__ void upfirdn2d_kernel(scalar_t *out, const scalar_t *input, + const scalar_t *kernel, + const UpFirDn2DKernelParams p) { + const int tile_in_h = ((tile_out_h - 1) * down_y + kernel_h - 1) / up_y + 1; + const int tile_in_w = ((tile_out_w - 1) * down_x + kernel_w - 1) / up_x + 1; + + __shared__ volatile float sk[kernel_h][kernel_w]; + __shared__ volatile float sx[tile_in_h][tile_in_w]; + + int minor_idx = blockIdx.x; + int tile_out_y = minor_idx / p.minor_dim; + minor_idx -= tile_out_y * p.minor_dim; + tile_out_y *= tile_out_h; + int tile_out_x_base = blockIdx.y * p.loop_x * tile_out_w; + int major_idx_base = blockIdx.z * p.loop_major; + + if (tile_out_x_base >= p.out_w | tile_out_y >= p.out_h | + major_idx_base >= p.major_dim) { + return; + } + + for (int tap_idx = threadIdx.x; tap_idx < kernel_h * kernel_w; + tap_idx += blockDim.x) { + int ky = tap_idx / kernel_w; + int kx = tap_idx - ky * kernel_w; + scalar_t v = 0.0; + + if (kx < p.kernel_w & ky < p.kernel_h) { + v = kernel[(p.kernel_h - 1 - ky) * p.kernel_w + (p.kernel_w - 1 - kx)]; + } + + sk[ky][kx] = v; + } + + for (int loop_major = 0, major_idx = major_idx_base; + loop_major < p.loop_major & major_idx < p.major_dim; + loop_major++, major_idx++) { + for (int loop_x = 0, tile_out_x = tile_out_x_base; + loop_x < p.loop_x & tile_out_x < p.out_w; + loop_x++, tile_out_x += tile_out_w) { + int tile_mid_x = tile_out_x * down_x + up_x - 1 - p.pad_x0; + int tile_mid_y = tile_out_y * down_y + up_y - 1 - p.pad_y0; + int tile_in_x = floor_div(tile_mid_x, up_x); + int tile_in_y = floor_div(tile_mid_y, up_y); + + __syncthreads(); + + for (int in_idx = threadIdx.x; in_idx < tile_in_h * tile_in_w; + in_idx += blockDim.x) { + int rel_in_y = in_idx / tile_in_w; + int rel_in_x = in_idx - rel_in_y * tile_in_w; + int in_x = rel_in_x + tile_in_x; + int in_y = rel_in_y + tile_in_y; + + scalar_t v = 0.0; + + if (in_x >= 0 & in_y >= 0 & in_x < p.in_w & in_y < p.in_h) { + v = input[((major_idx * p.in_h + in_y) * p.in_w + in_x) * + p.minor_dim + + minor_idx]; + } + + sx[rel_in_y][rel_in_x] = v; + } + + __syncthreads(); + for (int out_idx = threadIdx.x; out_idx < tile_out_h * tile_out_w; + out_idx += blockDim.x) { + int rel_out_y = out_idx / tile_out_w; + int rel_out_x = out_idx - rel_out_y * tile_out_w; + int out_x = rel_out_x + tile_out_x; + int out_y = rel_out_y + tile_out_y; + + int mid_x = tile_mid_x + rel_out_x * down_x; + int mid_y = tile_mid_y + rel_out_y * down_y; + int in_x = floor_div(mid_x, up_x); + int in_y = floor_div(mid_y, up_y); + int rel_in_x = in_x - tile_in_x; + int rel_in_y = in_y - tile_in_y; + int kernel_x = (in_x + 1) * up_x - mid_x - 1; + int kernel_y = (in_y + 1) * up_y - mid_y - 1; + + scalar_t v = 0.0; + +#pragma unroll + for (int y = 0; y < kernel_h / up_y; y++) +#pragma unroll + for (int x = 0; x < kernel_w / up_x; x++) + v += sx[rel_in_y + y][rel_in_x + x] * + sk[kernel_y + y * up_y][kernel_x + x * up_x]; + + if (out_x < p.out_w & out_y < p.out_h) { + out[((major_idx * p.out_h + out_y) * p.out_w + out_x) * p.minor_dim + + minor_idx] = v; + } + } + } + } +} + +torch::Tensor upfirdn2d_op(const torch::Tensor &input, + const torch::Tensor &kernel, int up_x, int up_y, + int down_x, int down_y, int pad_x0, int pad_x1, + int pad_y0, int pad_y1) { + int curDevice = -1; + cudaGetDevice(&curDevice); + cudaStream_t stream = at::cuda::getCurrentCUDAStream(); + + UpFirDn2DKernelParams p; + + auto x = input.contiguous(); + auto k = kernel.contiguous(); + + p.major_dim = x.size(0); + p.in_h = x.size(1); + p.in_w = x.size(2); + p.minor_dim = x.size(3); + p.kernel_h = k.size(0); + p.kernel_w = k.size(1); + p.up_x = up_x; + p.up_y = up_y; + p.down_x = down_x; + p.down_y = down_y; + p.pad_x0 = pad_x0; + p.pad_x1 = pad_x1; + p.pad_y0 = pad_y0; + p.pad_y1 = pad_y1; + + p.out_h = (p.in_h * p.up_y + p.pad_y0 + p.pad_y1 - p.kernel_h + p.down_y) / + p.down_y; + p.out_w = (p.in_w * p.up_x + p.pad_x0 + p.pad_x1 - p.kernel_w + p.down_x) / + p.down_x; + + auto out = + at::empty({p.major_dim, p.out_h, p.out_w, p.minor_dim}, x.options()); + + int mode = -1; + + int tile_out_h = -1; + int tile_out_w = -1; + + if (p.up_x == 1 && p.up_y == 1 && p.down_x == 1 && p.down_y == 1 && + p.kernel_h <= 4 && p.kernel_w <= 4) { + mode = 1; + tile_out_h = 16; + tile_out_w = 64; + } + + if (p.up_x == 1 && p.up_y == 1 && p.down_x == 1 && p.down_y == 1 && + p.kernel_h <= 3 && p.kernel_w <= 3) { + mode = 2; + tile_out_h = 16; + tile_out_w = 64; + } + + if (p.up_x == 2 && p.up_y == 2 && p.down_x == 1 && p.down_y == 1 && + p.kernel_h <= 4 && p.kernel_w <= 4) { + mode = 3; + tile_out_h = 16; + tile_out_w = 64; + } + + if (p.up_x == 2 && p.up_y == 2 && p.down_x == 1 && p.down_y == 1 && + p.kernel_h <= 2 && p.kernel_w <= 2) { + mode = 4; + tile_out_h = 16; + tile_out_w = 64; + } + + if (p.up_x == 1 && p.up_y == 1 && p.down_x == 2 && p.down_y == 2 && + p.kernel_h <= 4 && p.kernel_w <= 4) { + mode = 5; + tile_out_h = 8; + tile_out_w = 32; + } + + if (p.up_x == 1 && p.up_y == 1 && p.down_x == 2 && p.down_y == 2 && + p.kernel_h <= 2 && p.kernel_w <= 2) { + mode = 6; + tile_out_h = 8; + tile_out_w = 32; + } + + dim3 block_size; + dim3 grid_size; + + if (tile_out_h > 0 && tile_out_w > 0) { + p.loop_major = (p.major_dim - 1) / 16384 + 1; + p.loop_x = 1; + block_size = dim3(32 * 8, 1, 1); + grid_size = dim3(((p.out_h - 1) / tile_out_h + 1) * p.minor_dim, + (p.out_w - 1) / (p.loop_x * tile_out_w) + 1, + (p.major_dim - 1) / p.loop_major + 1); + } else { + p.loop_major = (p.major_dim - 1) / 16384 + 1; + p.loop_x = 4; + block_size = dim3(4, 32, 1); + grid_size = dim3((p.out_h * p.minor_dim - 1) / block_size.x + 1, + (p.out_w - 1) / (p.loop_x * block_size.y) + 1, + (p.major_dim - 1) / p.loop_major + 1); + } + + AT_DISPATCH_FLOATING_TYPES_AND_HALF(x.scalar_type(), "upfirdn2d_cuda", [&] { + switch (mode) { + case 1: + upfirdn2d_kernel + <<>>(out.data_ptr(), + x.data_ptr(), + k.data_ptr(), p); + + break; + + case 2: + upfirdn2d_kernel + <<>>(out.data_ptr(), + x.data_ptr(), + k.data_ptr(), p); + + break; + + case 3: + upfirdn2d_kernel + <<>>(out.data_ptr(), + x.data_ptr(), + k.data_ptr(), p); + + break; + + case 4: + upfirdn2d_kernel + <<>>(out.data_ptr(), + x.data_ptr(), + k.data_ptr(), p); + + break; + + case 5: + upfirdn2d_kernel + <<>>(out.data_ptr(), + x.data_ptr(), + k.data_ptr(), p); + + break; + + case 6: + upfirdn2d_kernel + <<>>(out.data_ptr(), + x.data_ptr(), + k.data_ptr(), p); + + break; + + default: + upfirdn2d_kernel_large<<>>( + out.data_ptr(), x.data_ptr(), + k.data_ptr(), p); + } + }); + + return out; +} \ No newline at end of file diff --git a/AnimatableGaussians/network/template.py b/AnimatableGaussians/network/template.py new file mode 100644 index 0000000000000000000000000000000000000000..937c3f6b77f3548d7af9680c3a89a08cc1d2c79a --- /dev/null +++ b/AnimatableGaussians/network/template.py @@ -0,0 +1,405 @@ +import torch +import torch.nn as nn +import numpy as np +import pytorch3d.ops +import pytorch3d.transforms +import trimesh + +import config +from network.mlp import MLPLinear, SdfMLP +from network.density import LaplaceDensity +from network.volume import CanoBlendWeightVolume +from network.hand_avatar import HandAvatar +from utils.embedder import get_embedder +import utils.nerf_util as nerf_util +import utils.smpl_util as smpl_util +import utils.geo_util as geo_util +from utils.posevocab_custom_ops.near_far_smpl import near_far_smpl +from utils.posevocab_custom_ops.nearest_face import nearest_face_pytorch3d +from utils.knn import knn_gather +import root_finding + + +class TemplateNet(nn.Module): + def __init__(self, opt): + super(TemplateNet, self).__init__() + self.opt = opt + + self.pos_embedder, self.pos_dim = get_embedder(opt['multires'], 3) + + # canonical blend weight volume + self.cano_weight_volume = CanoBlendWeightVolume(config.opt['train']['data']['data_dir'] + '/cano_weight_volume.npz') + + self.pose_feat_dim = 0 + + """ geometry networks """ + geo_mlp_opt = { + 'in_channels': self.pos_dim + self.pose_feat_dim, + 'out_channels': 256 + 1, + 'inter_channels': [512, 256, 256, 256, 256, 256], + 'nlactv': nn.Softplus(beta = 100), + 'res_layers': [4], + 'geometric_init': True, + 'bias': 0.7, + 'weight_norm': True + } + self.geo_mlp = SdfMLP(**geo_mlp_opt) + + """ texture networks """ + if self.opt['use_viewdir']: + self.viewdir_embedder, self.viewdir_dim = get_embedder(self.opt['multires_viewdir'], 3) + else: + self.viewdir_embedder, self.viewdir_dim = None, 0 + tex_mlp_opt = { + 'in_channels': 256 + self.viewdir_dim, + 'out_channels': 3, + 'inter_channels': [256, 256, 256], + 'nlactv': nn.ReLU(), + 'last_op': nn.Sigmoid() + } + self.tex_mlp = MLPLinear(**tex_mlp_opt) + + print('# MLPs: ') + print(self.geo_mlp) + print(self.tex_mlp) + + # sdf2density + self.density_func = LaplaceDensity(params_init = {'beta': 0.01}) + + # hand avatars + self.with_hand = self.opt.get('with_hand', False) + self.left_hand = HandAvatar() + self.right_hand = HandAvatar() + + # for root finding + from network.volume import compute_gradient_volume + if self.opt.get('volume_type', 'diff') == 'diff': + self.weight_volume = self.cano_weight_volume.diff_weight_volume[0].permute(1, 2, 3, 0).contiguous() + else: + self.weight_volume = self.cano_weight_volume.ori_weight_volume[0].permute(1, 2, 3, 0).contiguous() + self.grad_volume = compute_gradient_volume(self.weight_volume.permute(3, 0, 1, 2), self.cano_weight_volume.voxel_size).permute(2, 3, 4, 0, 1)\ + .reshape(self.cano_weight_volume.res_x, self.cano_weight_volume.res_y, self.cano_weight_volume.res_z, -1).contiguous() + self.res = torch.tensor([self.cano_weight_volume.res_x, self.cano_weight_volume.res_y, self.cano_weight_volume.res_z], dtype = torch.int32, device = config.device) + + self._initialize_hands() + + def _initialize_hands(self): + smplx_lhand_to_mano_rhand_data = np.load(config.PROJ_DIR + '/smpl_files/mano/smplx_lhand_to_mano_rhand.npz', allow_pickle = True) + smplx_rhand_to_mano_rhand_data = np.load(config.PROJ_DIR + '/smpl_files/mano/smplx_rhand_to_mano_rhand.npz', allow_pickle = True) + smpl_lhand_vert_id = np.copy(smplx_lhand_to_mano_rhand_data['smpl_vert_id_to_mano']) + smpl_rhand_vert_id = np.copy(smplx_rhand_to_mano_rhand_data['smpl_vert_id_to_mano']) + self.smpl_lhand_vert_id = torch.from_numpy(smpl_lhand_vert_id).to(config.device) + self.smpl_rhand_vert_id = torch.from_numpy(smpl_rhand_vert_id).to(config.device) + self.smpl_hands_vert_id = torch.cat([self.smpl_lhand_vert_id, self.smpl_rhand_vert_id], 0) + mano_face_closed = np.loadtxt(config.PROJ_DIR + '/smpl_files/mano/mano_face_close.txt').astype(np.int64) + self.mano_face_closed = torch.from_numpy(mano_face_closed).to(config.device) + self.mano_face_closed_2hand = torch.cat([self.mano_face_closed[:, [2, 1, 0]], self.mano_face_closed + self.smpl_lhand_vert_id.shape[0]], 0) + + def forward_cano_body_nerf(self, xyz, viewdirs, pose, compute_grad = False): + """ + :param xyz: (B, N, 3) + :param viewdirs: (B, N, 3) + :param pose: (B, pose_dim) + :param compute_grad: whether computing gradient w.r.t xyz + :return: + """ + if compute_grad: + xyz.requires_grad_() + # pose_feat = self.pose_feat[None, None].expand(xyz.shape[0], xyz.shape[1], -1) + # pose_feat = torch.cat([self.pos_embedder(xyz), pose_feat], -1) + pose_feat = self.pos_embedder(xyz) + geo_feat = self.geo_mlp(pose_feat) + sdf, geo_feat = torch.split(geo_feat, [1, geo_feat.shape[-1] - 1], -1) + + if self.viewdir_embedder is not None: + if viewdirs is None: + viewdirs = torch.zeros_like(xyz) + geo_feat = torch.cat([geo_feat, self.viewdir_embedder(viewdirs)], -1) + color = self.tex_mlp(geo_feat) + + density = self.density_func(sdf) + + ret = { + 'sdf': -sdf, # assume outside is negative, inside is positive + 'density': density, + 'color': color, + 'cano_xyz': xyz.detach() + } + + if compute_grad: + d_output = torch.ones_like(sdf, requires_grad = False, device = sdf.device) + normal = torch.autograd.grad(outputs = sdf, + inputs = xyz, + grad_outputs = d_output, + create_graph = self.training, + retain_graph = self.training, + only_inputs = True)[0] + ret.update({ + 'normal': normal + }) + return ret + + def forward_cano_hand_nerf(self, xyz, sdf, viewdirs, hand_pose, module = 'left_hand'): + net = self.__getattr__(module) + return net(xyz, sdf, viewdirs, hand_pose) + + def fuse_hands(self, body_ret, posed_xyz, view_dirs, batch, space = 'live'): + # get hand correspondences + batch_size, n_pts = posed_xyz.shape[:2] + + def process_one_hand(side = 'left'): + hand_v = batch['%s_live_mano_v' % side] if space == 'live' else batch['%s_cano_mano_v' % side] + hand_n = batch['%s_live_mano_n' % side] if space == 'live' else batch['%s_cano_mano_n' % side] + hand_f = self.mano_face_closed[:, [2, 1, 0]] if side == 'left' else self.mano_face_closed + + dists, face_indices, bc_coords = nearest_face_pytorch3d(posed_xyz, hand_v, hand_f) + face_vertex_ids = torch.gather(hand_f[None].expand(batch_size, -1, -1), 1, face_indices[:, :, None].long().expand(-1, -1, 3)) # (B, N, 3) + + cano_hand_v = geo_util.normalize_vert_bbox(batch['%s_cano_mano_v' % side], dim = 1, per_axis = True) + + face_cano_mano_v = knn_gather(cano_hand_v, face_vertex_ids) + pts_cano_mano_v = (bc_coords[..., None] * face_cano_mano_v).sum(2) + + face_live_mano_v = knn_gather(hand_v, face_vertex_ids) + pts_live_mano_v = (bc_coords[..., None] * face_live_mano_v).sum(2) + + # face_normal = torch.cross(face_live_smpl_v[:, :, 1] - face_live_smpl_v[:, :, 0], face_live_smpl_v[:, :, 2] - face_live_smpl_v[:, :, 0]) + face_live_mano_n = knn_gather(hand_n, face_vertex_ids) + pts_live_mano_n = (bc_coords[..., None] * face_live_mano_n).sum(2) + + pts_smpl_sdf = -torch.sign(torch.einsum('bni,bni->bn', pts_live_mano_n, posed_xyz - pts_live_mano_v)) * dists + + return pts_cano_mano_v, pts_smpl_sdf.unsqueeze(-1) + + left_cano_mano_v, left_mano_sdf = process_one_hand('left') + right_cano_mano_v, right_mano_sdf = process_one_hand('right') + + # fuse + zero_hand_pose = torch.zeros((1, 15*3)).to(left_cano_mano_v) + color_lhand = self.forward_cano_hand_nerf(left_cano_mano_v, left_mano_sdf, view_dirs, zero_hand_pose, module = 'left_hand') + color_rhand = self.forward_cano_hand_nerf(right_cano_mano_v, right_mano_sdf, view_dirs, zero_hand_pose, module = 'right_hand') + + # calculate the blending weights for blending the outputs of body network and hand networks + # wl = torch.sigmoid(1000 * (left_mano_sdf + 0.1)) * torch.sigmoid(25 * (left_cano_mano_v[..., 0:1] + 0.8)) + # wr = torch.sigmoid(1000 * (right_mano_sdf + 0.1)) * torch.sigmoid(-25 * (right_cano_mano_v[..., 0:1] - 0.8)) + cano_xyz = body_ret['cano_xyz'] + wl = torch.sigmoid(25 * (geo_util.normalize_vert_bbox(batch['left_cano_mano_v'], attris = cano_xyz, dim = 1, per_axis = True)[..., 0:1] + 0.8)) + wr = torch.sigmoid(-25 * (geo_util.normalize_vert_bbox(batch['right_cano_mano_v'], attris = cano_xyz, dim = 1, per_axis = True)[..., 0:1] - 0.8)) + wl[cano_xyz[..., 1] < batch['cano_smpl_center'][0, 1]] = 0. + wr[cano_xyz[..., 1] < batch['cano_smpl_center'][0, 1]] = 0. + + s = torch.maximum(wl + wr, torch.ones_like(wl)) + wl, wr = wl / s, wr / s + + # blend the outputs of body network and hand networks + w = wl + wr + # factor = 10 + # left_mano_sdf *= factor + # right_mano_sdf *= factor + body_ret['sdf'] = wl * left_mano_sdf + wr * right_mano_sdf + (1.0 - w) * body_ret['sdf'] + body_ret['color'] = wl * color_lhand + wr * color_rhand + (1.0 - w) * body_ret['color'] + + body_ret['density'] = self.density_func(-body_ret['sdf']) + + def forward_cano_radiance_field(self, xyz, view_dirs, batch): + body_ret = self.forward_cano_body_nerf(xyz, view_dirs, None, compute_grad = self.training) + + return body_ret + + def transform_cano2live(self, cano_pts, batch, normals = None, near_thres = 0.08): + cano2live_jnt_mats = batch['cano2live_jnt_mats'].clone() + if not self.with_hand: + # make sure the hand transformation is totally rigid + cano2live_jnt_mats[:, 25: 40] = cano2live_jnt_mats[:, 20: 21] + cano2live_jnt_mats[:, 40: 55] = cano2live_jnt_mats[:, 21: 22] + + pts_w = self.cano_weight_volume.forward_weight(cano_pts) + pt_mats = torch.einsum('bnj,bjxy->bnxy', pts_w, cano2live_jnt_mats) + posed_pts = torch.einsum('bnxy,bny->bnx', pt_mats[..., :3, :3], cano_pts) + pt_mats[..., :3, 3] + + if normals is None: + return posed_pts + else: + posed_normals = torch.einsum('bnxy,bny->bnx', pt_mats[..., :3, :3], normals) + return posed_pts, posed_normals + + def transform_live2cano(self, posed_pts, batch, normals = None, near_thres = 0.08): + cano2live_jnt_mats = batch['cano2live_jnt_mats'].clone() + if not self.with_hand: + cano2live_jnt_mats[:, 25: 40] = cano2live_jnt_mats[:, 20: 21] + cano2live_jnt_mats[:, 40: 55] = cano2live_jnt_mats[:, 21: 22] + + """ live_pts -> cano_pts """ + batch_size, n_pts = posed_pts.shape[:2] + with torch.no_grad(): + if 'live_mesh_v' in batch: + # if False: + tar_v = batch['live_mesh_v'] + tar_f = batch['live_mesh_f'] + tar_lbs = batch['live_mesh_lbs'] + pts_w, near_flag = smpl_util.calc_blending_weight(posed_pts, tar_v, tar_f, tar_lbs, near_thres, method = 'NN') + else: + tar_v = batch['live_smpl_v'] + tar_f = batch['smpl_faces'] + tar_lbs = None + pts_w, near_flag = smpl_util.calc_blending_weight(posed_pts, tar_v, tar_f, tar_lbs, near_thres, method = 'barycentric') + + pt_mats = torch.einsum('bnj,bjxy->bnxy', pts_w, cano2live_jnt_mats) + pt_mats = torch.linalg.inv(pt_mats) + cano_pts = torch.einsum('bnxy,bny->bnx', pt_mats[..., :3, :3], posed_pts) + pt_mats[..., :3, 3] + # cano_pts_bk = cano_pts.detach().clone() + + if normals is not None: + cano_normals = torch.einsum('bnxy,bny->bnx', pt_mats[..., :3, :3], normals) + + if self.opt['use_root_finding']: + argmax_lbs = torch.argmax(pts_w, -1) + nonopt_bone_ids = [7, 8, 10, 11] + nonopt_pts_flag = torch.zeros((batch_size, n_pts), dtype = torch.bool).to(argmax_lbs.device) + for i in nonopt_bone_ids: + nonopt_pts_flag = torch.logical_or(nonopt_pts_flag, argmax_lbs == i) + root_finding_flag = torch.logical_not(nonopt_pts_flag) + if root_finding_flag.any(): + cano_pts_ = cano_pts[root_finding_flag].unsqueeze(0) + posed_pts_ = posed_pts[root_finding_flag].unsqueeze(0) + if not cano_pts_.is_contiguous(): + cano_pts_ = cano_pts_.contiguous() + if not posed_pts_.is_contiguous(): + posed_pts_ = posed_pts_.contiguous() + root_finding.root_finding( + self.weight_volume, + self.grad_volume, + posed_pts_, + cano_pts_, + cano2live_jnt_mats, + self.cano_weight_volume.volume_bounds, + self.res, + cano_pts_, + 0.1, + 10 + ) + cano_pts[root_finding_flag] = cano_pts_[0] + + if normals is None: + return cano_pts, near_flag + else: + return cano_pts, cano_normals, near_flag + + def render(self, batch, chunk_size = 2048, depth_guided_sampling = None, space = 'live', white_bkgd = False): + ray_o = batch['ray_o'] + ray_d = batch['ray_d'] + near = batch['near'] + far = batch['far'] + + if depth_guided_sampling['flag']: + print('# depth-guided sampling') + valid_dist_flag = batch['dist'] > 1e-6 + dist = batch['dist'][valid_dist_flag] + near_dist = depth_guided_sampling['near_sur_dist'] + far_dist = depth_guided_sampling['near_sur_dist'] + near[valid_dist_flag] = dist - near_dist + far[valid_dist_flag] = dist + far_dist + N_ray_samples = depth_guided_sampling['N_ray_samples'] + else: + if depth_guided_sampling.get('type', 'smpl') == 'smpl': + print('# smpl-guided sampling') + valid_dist_flag = torch.ones_like(near, dtype = bool) + near, far, intersect_flag = near_far_smpl(batch['live_smpl_v'][0], ray_o[0], ray_d[0]) + near[~intersect_flag] = batch['near'][0][~intersect_flag] + far[~intersect_flag] = batch['far'][0][~intersect_flag] + near = near.unsqueeze(0) + far = far.unsqueeze(0) + N_ray_samples = 64 + elif depth_guided_sampling.get('type', 'smpl') == 'uniform': + print('# uniform sampling') + valid_dist_flag = torch.ones_like(near, dtype = bool) + N_ray_samples = 64 + + if self.training: + chunk_size = batch['ray_o'].shape[1] + + batch_size, n_pixels = ray_o.shape[:2] + output_list = [] + for i in range(0, n_pixels, chunk_size): + near_chunk = near[:, i: i + chunk_size] + far_chunk = far[:, i: i + chunk_size] + ray_o_chunk = ray_o[:, i: i + chunk_size] + ray_d_chunk = ray_d[:, i: i + chunk_size] + valid_dist_flag_chunk = valid_dist_flag[:, i: i + chunk_size] + + # sample points on each ray + pts, z_vals = nerf_util.sample_pts_on_rays(ray_o_chunk, ray_d_chunk, near_chunk, far_chunk, + N_samples = N_ray_samples, + perturb = self.training, + depth_guided_mask = valid_dist_flag_chunk) + + # # debug: visualize pts + # import trimesh + # pts_trimesh = trimesh.PointCloud(pts[0].cpu().numpy().reshape(-1, 3)) + # pts_trimesh.export('./debug/sampled_pts_%s.obj' % 'training' if self.training else 'testing') + # exit(1) + + # flat + _, n_pixels_chunk, n_samples = pts.shape[:3] + pts = pts.view(batch_size, n_pixels_chunk * n_samples, -1) + dists = z_vals[..., 1:] - z_vals[..., :-1] + dists = torch.cat([dists, dists[..., -1:]], -1) + + # query + if space == 'live': + cano_pts, near_flag = self.transform_live2cano(pts, batch) + elif space == 'cano': + cano_pts = pts + else: + raise ValueError('Invalid rendering space!') + viewdirs = ray_d_chunk / torch.norm(ray_d_chunk, dim = -1, keepdim = True) + viewdirs = viewdirs[:, :, None, :].expand(-1, -1, n_samples, -1).reshape(batch_size, n_pixels_chunk * n_samples, -1) + # apply gaussian noise to avoid overfitting + if self.training: + with torch.no_grad(): + noise = torch.randn_like(viewdirs) * 0.1 + viewdirs = viewdirs + noise + viewdirs = viewdirs / torch.norm(viewdirs, dim = -1, keepdim = True) + + ret = self.forward_cano_radiance_field(cano_pts, viewdirs, batch) + if self.with_hand: + self.fuse_hands(ret, pts, viewdirs, batch, space) + + ret['color'] = ret['color'].view(batch_size, n_pixels_chunk, n_samples, -1) + ret['density'] = ret['density'].view(batch_size, n_pixels_chunk, n_samples, -1) + + # integration + alpha = 1. - torch.exp(-ret['density'] * dists[..., None]) + raw = torch.cat([ret['color'], alpha], dim = -1) + rgb_map, disp_map, acc_map, weights, depth_map = nerf_util.raw2outputs(raw, z_vals, white_bkgd = white_bkgd) + + output_chunk = { + 'rgb_map': rgb_map, # (batch_size, n_pixel_chunk, 3) + 'acc_map': acc_map + } + if 'normal' in ret: + output_chunk.update({ + 'normal': ret['normal'].view(batch_size, n_pixels_chunk, -1, 3) + }) + if 'tv_loss' in ret: + output_chunk.update({ + 'tv_loss': ret['tv_loss'].view(1, 1, -1) + }) + output_list.append(output_chunk) + + keys = output_list[0].keys() + output_list = {k: torch.cat([r[k] for r in output_list], dim = 1) for k in keys} + + # processing for patch-based ray sampling + if 'mask_within_patch' in batch: + _, ray_num = batch['mask_within_patch'].shape + rgb_map = torch.zeros((batch_size, ray_num, 3), dtype = torch.float32, device = config.device) + acc_map = torch.zeros((batch_size, ray_num), dtype = torch.float32, device = config.device) + rgb_map[batch['mask_within_patch']] = output_list['rgb_map'].reshape(-1, 3) + acc_map[batch['mask_within_patch']] = output_list['acc_map'].reshape(-1) + batch['color_gt'][~batch['mask_within_patch']] = 0. + batch['mask_gt'][~batch['mask_within_patch']] = 0. + output_list['rgb_map'] = rgb_map + output_list['acc_map'] = acc_map + + return output_list diff --git a/AnimatableGaussians/network/volume.py b/AnimatableGaussians/network/volume.py new file mode 100644 index 0000000000000000000000000000000000000000..5b56ff991051bc0265ed9f4b3ab8ac766f1e3135 --- /dev/null +++ b/AnimatableGaussians/network/volume.py @@ -0,0 +1,130 @@ +import os +import numpy as np +import torch +import torch.nn.functional as F + +import config + + +def compute_gradient_volume(weight_volume, voxel_size): + """ + :param weight_volume: (C, X, Y, Z) + """ + sobel_x = torch.zeros((3, 3, 3), dtype = torch.float32, device = config.device) + sobel_x[0] = torch.tensor([[-1,-2,-1], [-2,-4,-2], [-1,-2,-1]], dtype = torch.float32) + sobel_x[2] = -sobel_x[0] + sobel_z = sobel_x.permute((1, 2, 0)) + sobel_y = sobel_x.permute((2, 0, 1)) + + # normalize + sobel_x = sobel_x / (16 * 2 * voxel_size[0]) + sobel_y = sobel_y / (16 * 2 * voxel_size[1]) + sobel_z = sobel_z / (16 * 2 * voxel_size[2]) + + # sobel_x = torch.zeros((3, 3, 3), dtype = torch.float32, device = config.device) + # sobel_x[0] = torch.tensor([[0, 0, 0], [0, -1, 0], [0, 0, 0]], dtype = torch.float32) + # sobel_x[2] = -sobel_x[0] + # sobel_z = sobel_x.permute((1, 2, 0)) + # sobel_y = sobel_x.permute((2, 0, 1)) + # + # # normalize + # sobel_x = sobel_x / (2 * voxel_size[0]) + # sobel_y = sobel_y / (2 * voxel_size[1]) + # sobel_z = sobel_z / (2 * voxel_size[2]) + + sobel_filter = torch.cat((sobel_x.unsqueeze(0), sobel_y.unsqueeze(0), sobel_z.unsqueeze(0)), dim = 0) + sobel_filter = sobel_filter.unsqueeze(1) + + grad_volume = F.conv3d(input = weight_volume.unsqueeze(1), weight = sobel_filter, padding = 1) + return grad_volume # [J, 3, X, Y, Z] + + +class CanoBlendWeightVolume: + def __init__(self, data_path): + if not os.path.exists(data_path): + raise FileNotFoundError('# CanoBlendWeightVolume is not found from %s' % data_path) + data = np.load(data_path) + + diff_weight_volume = data['diff_weight_volume'] + diff_weight_volume = diff_weight_volume.transpose((3, 0, 1, 2))[None] + # base_weight_volume = base_weight_volume.transpose((3, 2, 1, 0))[None] + self.diff_weight_volume = torch.from_numpy(diff_weight_volume).to(torch.float32).to(config.device) + self.res_x, self.res_y, self.res_z = self.diff_weight_volume.shape[2:] + self.joint_num = self.diff_weight_volume.shape[1] + + self.ori_weight_volume = torch.from_numpy(data['ori_weight_volume'].transpose((3, 0, 1, 2))[None]).to(torch.float32).to(config.device) + + if 'sdf_volume' in data: + smpl_sdf_volume = data['sdf_volume'] + if len(smpl_sdf_volume.shape) == 3: + smpl_sdf_volume = smpl_sdf_volume[..., None] + smpl_sdf_volume = smpl_sdf_volume.transpose((3, 0, 1, 2))[None] + self.smpl_sdf_volume = torch.from_numpy(smpl_sdf_volume).to(torch.float32).to(config.device) + + self.volume_bounds = torch.from_numpy(data['volume_bounds']).to(torch.float32).to(config.device) + self.center = torch.from_numpy(data['center']).to(torch.float32).to(config.device) + self.smpl_bounds = torch.from_numpy(data['smpl_bounds']).to(torch.float32).to(config.device) + + volume_len = self.volume_bounds[1] - self.volume_bounds[0] + self.voxel_size = volume_len / torch.tensor([self.res_x-1, self.res_y-1, self.res_z-1]).to(volume_len) + # self.base_gradient_volume = compute_gradient_volume(self.diff_weight_volume[0], self.voxel_size) # [joint_num, 3, X, Y, Z] + + def forward_weight(self, pts, requires_scale = True, volume_type = 'diff'): + """ + :param pts: (B, N, 3) + :param requires_scale: bool, scale pts to [0, 1] + :return: (B, N, 24) + """ + if requires_scale: + pts = (pts - self.volume_bounds[None, None, 0]) / (self.volume_bounds[1] - self.volume_bounds[0])[None, None] + B, N, _ = pts.shape + grid = 2 * pts - 1 + grid = grid[..., [2, 1, 0]] + grid = grid[:, :, None, None] + + weight_volume = self.diff_weight_volume if volume_type == 'diff' else self.ori_weight_volume + + base_w = F.grid_sample(weight_volume.expand(B, -1, -1, -1, -1), + grid, + mode = 'bilinear', + padding_mode = 'border', + align_corners = True) + base_w = base_w[:, :, :, 0, 0].permute(0, 2, 1) + return base_w + + def forward_weight_grad(self, pts, requires_scale = True): + """ + :param pts: (B, N, 3) + :param requires_scale: bool, scale pts to [0, 1] + :return: (B, N, 24) + """ + if requires_scale: + pts = (pts - self.volume_bounds[None, None, 0]) / (self.volume_bounds[1] - self.volume_bounds[0])[None, None] + B, N, _ = pts.shape + grid = 2 * pts - 1 + grid = grid.reshape(-1, 3)[:, [2, 1, 0]] + grid = grid[None, :, None, None] + + base_g = F.grid_sample(self.base_gradient_volume.view(self.joint_num * 3, self.res_x, self.res_y, self.res_z)[None].expand(B, -1, -1, -1, -1), + grid, + mode = 'nearest', + padding_mode = 'border', + align_corners = True) + base_g = base_g[:, :, :, 0, 0].permute(0, 2, 1).reshape(B, N, -1, 3) + return base_g + + def forward_sdf(self, pts, requires_scale = True): + if requires_scale: + pts = (pts - self.volume_bounds[None, None, 0]) / (self.volume_bounds[1] - self.volume_bounds[0])[None, None] + B, N, _ = pts.shape + grid = 2 * pts - 1 + grid = grid.reshape(-1, 3)[:, [2, 1, 0]] + grid = grid[None, :, None, None] + + sdf = F.grid_sample(self.smpl_sdf_volume.expand(B, -1, -1, -1, -1), + grid, + padding_mode = 'border', + align_corners = True) + sdf = sdf[:, :, :, 0, 0].permute(0, 2, 1) + + return sdf diff --git a/AnimatableGaussians/requirements.txt b/AnimatableGaussians/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..fb03189df80a71d033a1f218a0a4ff8e6b54e792 --- /dev/null +++ b/AnimatableGaussians/requirements.txt @@ -0,0 +1,18 @@ +glfw==2.4.0 +libigl +joblib==0.17.0 +numpy==1.21.6 +opencv-python==4.5.5.64 +plyfile==1.0.2 +PyOpenGL==3.1.0 +pyrender==0.1.45 +pytorch3d==0.7.4 +pyyaml==5.3.1 +scikit-image==0.17.2 +scikit-learn==0.23.2 +screeninfo==0.8.1 +setuptools==50.3.1.post20201107 +torch==2.0.1+cu117 +torchvision==0.15.2+cu117 +tqdm==4.50.2 +trimesh==3.9.15 diff --git a/AnimatableGaussians/run.sh b/AnimatableGaussians/run.sh new file mode 100644 index 0000000000000000000000000000000000000000..c831d93625ab8081a81931e1219bc4916af2785a --- /dev/null +++ b/AnimatableGaussians/run.sh @@ -0,0 +1 @@ +python main_avatar.py -c ./configs/pengcheng/1007_slow10.yaml --mode test \ No newline at end of file diff --git a/AnimatableGaussians/smpl_files/FLAME2019/FLAME_FEMALE.pkl b/AnimatableGaussians/smpl_files/FLAME2019/FLAME_FEMALE.pkl new file mode 100644 index 0000000000000000000000000000000000000000..c4a96e38048992fba597edc5d1274fdf38f9d8bc --- /dev/null +++ b/AnimatableGaussians/smpl_files/FLAME2019/FLAME_FEMALE.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:636d059d059eb343315d369cd81fd8bbc9c43f6043073c469b666241c4bf2b5e +size 53023637 diff --git a/AnimatableGaussians/smpl_files/FLAME2019/FLAME_MALE.pkl b/AnimatableGaussians/smpl_files/FLAME2019/FLAME_MALE.pkl new file mode 100644 index 0000000000000000000000000000000000000000..7d624b5bfc78426e3660bdd3c819a75dc4d35d05 --- /dev/null +++ b/AnimatableGaussians/smpl_files/FLAME2019/FLAME_MALE.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:07fe6dc7df346973e7d6f0568bd9c2cbf69514a74f119551ee4d53a116f238c4 +size 53023637 diff --git a/AnimatableGaussians/smpl_files/FLAME2019/FLAME_NEUTRAL.pkl b/AnimatableGaussians/smpl_files/FLAME2019/FLAME_NEUTRAL.pkl new file mode 100644 index 0000000000000000000000000000000000000000..b0e745d87a9883de12686627d4f8be61687ba195 --- /dev/null +++ b/AnimatableGaussians/smpl_files/FLAME2019/FLAME_NEUTRAL.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:27ccb8573c593e3975a7cbf33e7426a6d70ed4b441d64cb541b074c55d71839c +size 53023637 diff --git a/AnimatableGaussians/smpl_files/FLAME2019/Readme.pdf b/AnimatableGaussians/smpl_files/FLAME2019/Readme.pdf new file mode 100644 index 0000000000000000000000000000000000000000..abb8e1800f6c0c82260768f50de03b9f852e7e6e Binary files /dev/null and b/AnimatableGaussians/smpl_files/FLAME2019/Readme.pdf differ diff --git a/AnimatableGaussians/smpl_files/FLAME2019/flame_dynamic_embedding.npy b/AnimatableGaussians/smpl_files/FLAME2019/flame_dynamic_embedding.npy new file mode 100644 index 0000000000000000000000000000000000000000..a30cd12cd5fef9f836ab5722ee6105bba8d031c0 --- /dev/null +++ b/AnimatableGaussians/smpl_files/FLAME2019/flame_dynamic_embedding.npy @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fd046a4740f5e6837e65622d0e050273bb71bbcb1ad6ab322474013a2a23de37 +size 42639 diff --git a/AnimatableGaussians/smpl_files/FLAME2019/flame_static_embedding.pkl b/AnimatableGaussians/smpl_files/FLAME2019/flame_static_embedding.pkl new file mode 100644 index 0000000000000000000000000000000000000000..fbf1b6acc13c06db97aca532843f6e7fc527fa0e --- /dev/null +++ b/AnimatableGaussians/smpl_files/FLAME2019/flame_static_embedding.pkl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2881bdad8e61e87aad83a3df2e04655c534694089f68ca7144e7350da9e8ad62 +size 4380 diff --git a/AnimatableGaussians/smpl_files/mano/mano_face_close.txt b/AnimatableGaussians/smpl_files/mano/mano_face_close.txt new file mode 100644 index 0000000000000000000000000000000000000000..be285d4b5c6f813ce05524950e87757f04838012 --- /dev/null +++ b/AnimatableGaussians/smpl_files/mano/mano_face_close.txt @@ -0,0 +1,1552 @@ +1 2 0 +0 2 3 +4 5 7 +7 5 6 +8 3 9 +9 3 2 +11 12 10 +10 12 8 +13 11 15 +15 11 14 +17 18 16 +16 18 19 +21 22 20 +20 22 23 +25 26 24 +24 26 27 +29 30 28 +28 30 31 +32 33 35 +35 33 34 +36 37 39 +39 37 38 +40 41 5 +5 41 42 +5 42 6 +6 42 43 +44 33 45 +45 33 32 +47 48 46 +46 48 49 +51 52 50 +50 52 53 +55 51 54 +54 51 50 +57 58 56 +56 58 59 +60 61 3 +3 61 0 +63 64 62 +62 64 65 +67 68 66 +66 68 69 +71 72 70 +70 72 73 +75 76 74 +74 76 77 +52 78 53 +53 78 79 +81 82 80 +80 82 83 +84 85 51 +51 85 52 +56 59 86 +86 59 87 +88 89 42 +42 89 43 +42 41 88 +88 41 90 +39 38 91 +91 38 92 +93 69 63 +63 69 68 +12 60 8 +8 60 3 +24 27 68 +68 27 94 +95 24 67 +67 24 68 +97 98 96 +96 98 99 +100 101 103 +103 101 102 +105 29 104 +104 29 28 +50 53 106 +106 53 107 +53 79 107 +107 79 108 +110 111 109 +109 111 112 +114 4 113 +113 4 115 +114 40 4 +4 40 5 +35 34 110 +110 34 116 +34 117 116 +116 117 118 +33 119 34 +34 119 117 +33 44 119 +119 44 120 +124 125 123 +123 125 126 +127 128 13 +13 128 129 +32 130 45 +45 130 131 +132 93 62 +62 93 63 +133 134 136 +136 134 135 +138 139 137 +137 139 140 +76 141 77 +77 141 142 +143 144 19 +19 144 145 +147 148 146 +146 148 71 +150 151 149 +149 151 152 +81 100 82 +82 100 103 +100 81 154 +154 81 153 +155 156 57 +57 156 58 +157 67 146 +146 67 66 +158 145 14 +14 145 15 +67 157 95 +95 157 159 +128 65 129 +129 65 64 +161 162 160 +160 162 163 +165 166 164 +164 166 167 +169 170 168 +168 170 171 +173 170 172 +172 170 169 +175 176 174 +174 176 177 +179 180 178 +178 180 23 +181 182 20 +20 182 183 +80 184 81 +81 184 153 +185 186 187 +187 186 143 +157 70 159 +159 70 188 +189 134 156 +156 134 58 +168 171 138 +138 171 139 +146 71 157 +157 71 70 +191 192 190 +190 192 193 +166 165 48 +48 165 194 +195 189 49 +49 189 156 +196 197 199 +199 197 198 +20 23 181 +181 23 180 +145 158 19 +19 158 16 +181 180 80 +80 180 184 +200 184 179 +179 184 180 +201 202 82 +82 202 83 +204 205 203 +203 205 84 +206 21 183 +183 21 20 +178 23 207 +207 23 22 +207 208 178 +178 208 204 +208 209 204 +204 209 205 +211 205 210 +210 205 209 +178 204 179 +179 204 203 +212 175 87 +87 175 213 +85 84 211 +211 84 205 +192 216 217 +216 218 217 +217 218 219 +218 17 219 +219 17 16 +18 220 19 +19 220 143 +221 222 224 +224 222 223 +174 225 175 +175 225 213 +226 86 213 +213 86 87 +219 16 227 +227 16 158 +133 212 59 +59 212 87 +137 228 150 +150 228 151 +192 191 209 +209 191 210 +229 193 217 +217 193 192 +230 231 227 +227 231 229 +232 233 90 +90 233 88 +234 235 92 +92 235 91 +229 231 233 +233 231 236 +46 237 47 +47 237 238 +239 190 234 +234 190 235 +4 7 115 +115 7 240 +241 242 188 +188 242 159 +243 244 97 +97 244 98 +155 245 46 +46 245 237 +75 246 76 +76 246 247 +249 124 248 +248 124 123 +251 252 250 +250 252 253 +110 109 35 +35 109 254 +255 32 254 +254 32 35 +256 257 153 +153 257 154 +62 168 132 +132 168 138 +65 169 62 +62 169 168 +172 169 128 +128 169 65 +128 127 172 +172 127 258 +127 259 258 +258 259 260 +212 133 261 +261 133 136 +262 263 185 +185 263 186 +111 264 112 +112 264 265 +10 266 267 +233 232 229 +229 232 193 +152 268 69 +69 268 66 +174 177 164 +164 177 140 +149 152 93 +93 152 69 +270 220 269 +269 220 206 +268 152 271 +271 152 151 +120 44 108 +108 44 107 +46 49 155 +155 49 156 +56 272 57 +57 272 273 +144 274 259 +259 274 260 +275 148 142 +142 148 77 +147 268 74 +74 268 271 +206 276 269 +269 276 277 +194 195 48 +48 195 49 +58 134 59 +59 134 133 +82 103 201 +201 103 278 +148 147 77 +77 147 74 +246 277 247 +247 277 276 +182 181 83 +83 181 80 +47 238 280 +280 238 281 +226 222 282 +282 222 221 +222 225 223 +223 225 167 +280 281 223 +223 281 224 +164 167 174 +174 167 225 +263 262 137 +137 262 228 +13 15 127 +127 15 259 +219 227 217 +217 227 229 +86 226 283 +283 226 282 +259 15 144 +144 15 145 +243 97 257 +257 97 154 +57 273 155 +155 273 245 +106 284 50 +50 284 54 +242 285 159 +159 285 95 +233 236 88 +88 236 89 +45 131 106 +106 131 284 +252 251 248 +248 251 249 +285 25 95 +95 25 24 +105 104 286 +286 104 287 +271 151 288 +288 151 228 +137 150 138 +138 150 132 +182 289 160 +160 289 161 +290 291 276 +276 291 292 +150 149 132 +132 149 93 +261 274 176 +176 274 186 +143 186 144 +144 186 274 +272 56 283 +283 56 86 +173 135 189 +189 135 134 +110 116 111 +111 116 37 +116 118 37 +37 118 122 +111 37 264 +264 37 36 +286 287 253 +253 287 250 +227 158 230 +230 158 14 +222 226 225 +225 226 213 +146 66 147 +147 66 268 +223 167 280 +280 167 166 +198 162 199 +199 162 161 +44 45 107 +107 45 106 +280 166 47 +47 166 48 +160 163 290 +290 163 291 +37 122 38 +292 293 276 +276 293 247 +283 282 295 +295 282 294 +283 295 272 +272 295 296 +273 272 297 +297 272 296 +245 273 298 +298 273 297 +282 221 294 +294 221 299 +221 224 299 +299 224 300 +300 224 301 +301 224 281 +302 303 299 +299 303 294 +305 306 304 +304 306 307 +308 309 307 +307 309 304 +307 306 311 +311 306 310 +312 313 311 +311 313 314 +310 315 311 +311 315 312 +316 303 310 +310 303 315 +314 308 311 +311 308 307 +317 318 320 +320 318 319 +318 317 308 +308 317 309 +310 306 316 +316 306 305 +305 296 316 +316 296 295 +305 321 296 +296 321 297 +304 322 305 +305 322 321 +322 304 323 +323 304 309 +303 316 294 +294 316 295 +317 324 309 +309 324 323 +322 323 325 +325 323 326 +323 324 326 +326 324 327 +325 326 328 +328 326 329 +328 330 325 +325 330 331 +332 329 327 +327 329 326 +322 325 321 +321 325 331 +321 331 297 +297 331 298 +324 317 333 +333 317 320 +312 315 334 +334 315 303 +334 335 312 +312 335 313 +303 302 334 +334 302 336 +335 334 337 +337 334 336 +335 338 313 +313 338 339 +245 298 237 +237 298 340 +238 341 281 +281 341 301 +341 238 340 +340 238 237 +340 330 341 +341 330 342 +330 328 342 +342 328 343 +341 342 301 +301 342 344 +340 298 330 +330 298 331 +345 300 344 +344 300 301 +345 302 300 +300 302 299 +346 336 345 +345 336 302 +346 345 347 +347 345 344 +348 346 349 +349 346 347 +342 343 344 +344 343 347 +343 350 347 +347 350 349 +336 346 337 +337 346 348 +352 337 351 +351 337 348 +351 354 353 +353 354 355 +351 348 354 +354 348 349 +351 353 352 +352 353 333 +352 333 338 +338 333 320 +338 335 352 +352 335 337 +328 329 343 +343 329 350 +355 350 332 +332 350 329 +355 354 350 +350 354 349 +353 355 327 +327 355 332 +327 324 353 +353 324 333 +308 314 318 +318 314 319 +319 339 320 +320 339 338 +319 314 339 +339 314 313 +136 135 260 +260 135 258 +139 165 140 +140 165 164 +171 170 194 +194 170 195 +170 173 195 +195 173 189 +177 176 263 +263 176 186 +171 194 139 +139 194 165 +136 260 261 +261 260 274 +177 263 140 +140 263 137 +261 176 212 +212 176 175 +135 173 258 +258 173 172 +357 358 356 +356 358 359 +361 362 360 +360 362 363 +360 363 364 +364 363 365 +366 367 369 +369 367 368 +75 370 246 +246 370 371 +372 373 361 +361 373 362 +375 376 374 +374 376 377 +288 228 379 +379 228 378 +380 378 262 +262 378 228 +382 383 381 +381 383 384 +385 367 373 +373 367 362 +75 288 370 +370 288 379 +376 375 358 +358 375 386 +387 385 359 +359 385 373 +388 382 365 +365 382 389 +391 392 390 +390 392 393 +382 381 389 +389 381 394 +395 364 389 +389 364 365 +388 365 366 +366 365 363 +356 396 357 +357 396 397 +372 398 356 +356 398 396 +388 366 399 +399 366 369 +381 384 374 +374 384 371 +356 359 372 +372 359 373 +360 400 361 +361 400 401 +386 387 358 +358 387 359 +362 367 363 +363 367 366 +357 397 402 +402 397 403 +395 391 404 +404 391 390 +391 394 392 +392 394 377 +392 402 393 +393 402 403 +374 377 381 +381 377 394 +364 395 405 +405 395 404 +361 401 372 +372 401 398 +270 269 399 +399 269 383 +400 360 405 +405 360 364 +380 368 385 +385 368 367 +391 395 394 +394 395 389 +392 377 402 +402 377 376 +402 376 357 +357 376 358 +405 404 407 +407 404 406 +405 407 400 +400 407 408 +400 408 401 +401 408 409 +401 409 398 +398 409 410 +404 390 406 +406 390 411 +390 393 411 +411 393 412 +393 403 412 +412 403 413 +414 415 411 +411 415 406 +417 418 416 +416 418 419 +420 421 417 +417 421 418 +418 421 423 +423 421 422 +424 425 423 +423 425 426 +422 427 423 +423 427 424 +426 419 423 +423 419 418 +419 428 416 +416 428 429 +422 421 430 +430 421 420 +420 408 430 +430 408 407 +420 431 408 +408 431 409 +417 432 420 +420 432 431 +433 432 416 +416 432 417 +430 415 422 +422 415 427 +415 430 406 +406 430 407 +434 433 429 +429 433 416 +432 433 435 +435 433 436 +433 434 436 +436 434 437 +435 436 438 +438 436 439 +438 440 435 +435 440 441 +437 442 436 +436 442 439 +435 441 432 +432 441 431 +431 441 409 +409 441 410 +434 429 444 +444 429 443 +429 428 443 +443 428 445 +424 427 446 +446 427 415 +425 424 447 +447 424 446 +415 414 446 +446 414 448 +446 448 447 +447 448 449 +450 451 447 +447 451 425 +445 451 443 +443 451 450 +398 410 396 +396 410 452 +397 453 403 +403 453 413 +453 397 452 +452 397 396 +452 440 453 +453 440 454 +440 438 454 +454 438 455 +453 454 413 +413 454 456 +440 452 441 +441 452 410 +457 412 456 +456 412 413 +457 414 412 +412 414 411 +457 458 414 +414 458 448 +458 457 459 +459 457 456 +460 458 461 +461 458 459 +454 455 456 +456 455 459 +455 462 459 +459 462 461 +458 460 448 +448 460 449 +464 449 463 +463 449 460 +463 466 465 +465 466 467 +463 460 466 +466 460 461 +463 465 464 +464 465 444 +464 444 450 +450 444 443 +450 447 464 +464 447 449 +438 439 455 +455 439 462 +467 462 442 +442 462 439 +467 466 462 +462 466 461 +465 467 437 +437 467 442 +437 434 465 +465 434 444 +419 426 428 +428 426 445 +445 426 451 +451 426 425 +369 368 187 +187 368 185 +370 375 371 +371 375 374 +379 378 386 +386 378 387 +378 380 387 +387 380 385 +384 383 277 +277 383 269 +379 386 370 +370 386 375 +399 369 270 +270 369 187 +384 277 371 +371 277 246 +399 383 388 +388 383 382 +368 380 185 +185 380 262 +220 270 143 +143 270 187 +220 18 206 +206 18 21 +18 17 21 +21 17 22 +17 218 22 +22 218 207 +468 469 471 +471 469 470 +473 474 472 +472 474 475 +472 475 476 +476 475 477 +479 480 478 +478 480 481 +482 483 473 +473 483 474 +485 486 484 +484 486 487 +488 489 76 +76 489 141 +490 488 247 +247 488 76 +492 493 491 +491 493 494 +495 479 483 +483 479 474 +485 496 486 +486 496 470 +497 495 471 +471 495 483 +498 492 477 +477 492 499 +500 501 503 +503 501 502 +492 491 499 +499 491 504 +505 476 499 +499 476 477 +498 477 478 +478 477 475 +468 506 469 +469 506 507 +482 508 468 +468 508 506 +478 481 498 +498 481 509 +491 494 484 +484 494 510 +482 468 483 +483 468 471 +472 511 473 +473 511 512 +496 497 470 +470 497 471 +474 479 475 +475 479 478 +469 507 513 +513 507 514 +505 501 515 +515 501 500 +502 501 487 +487 501 504 +513 514 502 +502 514 503 +484 487 491 +491 487 504 +476 505 516 +516 505 515 +473 512 482 +482 512 508 +509 291 493 +493 291 163 +511 472 516 +516 472 476 +490 480 495 +495 480 479 +501 505 504 +504 505 499 +502 487 513 +513 487 486 +513 486 469 +469 486 470 +516 515 518 +518 515 517 +516 518 511 +511 518 519 +511 519 512 +512 519 520 +512 520 508 +508 520 521 +515 500 517 +517 500 522 +500 503 522 +522 503 523 +523 503 524 +524 503 514 +525 526 522 +522 526 517 +528 529 527 +527 529 530 +531 532 528 +528 532 529 +529 532 534 +534 532 533 +535 536 534 +534 536 537 +533 538 534 +534 538 535 +537 530 534 +534 530 529 +539 540 530 +530 540 527 +532 531 533 +533 531 541 +531 519 541 +541 519 518 +531 542 519 +519 542 520 +528 543 531 +531 543 542 +543 528 544 +544 528 527 +533 541 538 +538 541 526 +526 541 517 +517 541 518 +540 545 527 +527 545 544 +546 543 547 +547 543 544 +545 548 544 +544 548 547 +549 546 550 +550 546 547 +546 549 552 +552 549 551 +548 553 547 +547 553 550 +543 546 542 +542 546 552 +542 552 520 +520 552 521 +545 540 555 +555 540 554 +540 539 554 +554 539 556 +535 538 557 +557 538 526 +536 535 558 +558 535 557 +526 525 557 +557 525 559 +558 557 560 +560 557 559 +558 561 536 +536 561 562 +556 562 554 +554 562 561 +508 521 506 +506 521 563 +507 564 514 +514 564 524 +564 507 563 +563 507 506 +563 551 564 +564 551 565 +551 549 565 +565 549 566 +564 565 524 +524 565 567 +563 521 551 +551 521 552 +568 523 567 +567 523 524 +568 525 523 +523 525 522 +569 559 568 +568 559 525 +569 568 570 +570 568 567 +571 569 572 +572 569 570 +565 566 567 +567 566 570 +566 573 570 +570 573 572 +569 571 559 +559 571 560 +575 560 574 +574 560 571 +574 577 576 +576 577 578 +574 571 577 +577 571 572 +574 576 575 +575 576 555 +575 555 561 +561 555 554 +561 558 575 +575 558 560 +549 550 566 +566 550 573 +578 573 553 +553 573 550 +578 577 573 +573 577 572 +578 553 576 +576 553 548 +548 545 576 +576 545 555 +530 537 539 +539 537 556 +556 537 562 +562 537 536 +480 293 481 +481 293 292 +579 485 510 +510 485 484 +489 488 496 +496 488 497 +488 490 497 +497 490 495 +162 494 163 +163 494 493 +579 489 485 +485 489 496 +481 292 509 +509 292 291 +494 162 510 +510 162 198 +493 492 509 +509 492 498 +480 490 293 +293 490 247 +581 582 580 +580 582 583 +585 586 584 +584 586 587 +584 587 588 +588 587 589 +591 592 590 +590 592 593 +594 595 597 +597 595 596 +598 599 585 +585 599 586 +600 601 603 +603 601 602 +604 605 607 +607 605 606 +608 606 199 +199 606 605 +609 610 612 +612 610 611 +599 613 586 +586 613 591 +595 604 596 +596 604 607 +601 614 602 +602 614 582 +615 613 583 +583 613 599 +610 617 616 +616 617 589 +619 620 618 +618 620 621 +609 622 610 +610 622 617 +623 588 617 +617 588 589 +616 589 590 +590 589 587 +580 624 581 +581 624 625 +598 626 580 +580 626 624 +590 593 616 +616 593 627 +600 609 597 +597 609 612 +580 583 598 +598 583 599 +584 628 585 +585 628 629 +614 615 582 +582 615 583 +586 591 587 +587 591 590 +581 625 630 +630 625 631 +623 619 632 +632 619 618 +620 619 603 +603 619 622 +630 631 620 +620 631 621 +609 600 622 +622 600 603 +588 623 633 +633 623 632 +585 629 598 +598 629 626 +202 201 627 +627 201 611 +628 584 633 +633 584 588 +608 592 613 +613 592 591 +619 623 622 +622 623 617 +630 620 602 +602 620 603 +581 630 582 +582 630 602 +633 632 635 +635 632 634 +633 635 628 +628 635 636 +628 636 629 +629 636 637 +629 637 626 +626 637 638 +632 618 634 +634 618 639 +618 621 639 +639 621 640 +640 621 641 +641 621 631 +643 634 642 +642 634 639 +644 645 647 +647 645 646 +648 649 645 +645 649 646 +646 649 651 +651 649 650 +651 652 654 +654 652 653 +650 655 651 +651 655 652 +654 647 651 +651 647 646 +647 656 644 +644 656 657 +649 648 650 +650 648 658 +648 636 658 +658 636 635 +648 659 636 +636 659 637 +660 659 645 +645 659 648 +661 660 644 +644 660 645 +650 658 655 +655 658 643 +643 658 634 +634 658 635 +662 661 657 +657 661 644 +663 660 664 +664 660 661 +662 665 661 +661 665 664 +666 663 667 +667 663 664 +663 666 669 +669 666 668 +665 670 664 +664 670 667 +660 663 659 +659 663 669 +659 669 637 +637 669 638 +657 671 662 +662 671 672 +657 656 671 +671 656 673 +652 655 674 +674 655 643 +652 674 653 +653 674 675 +674 643 676 +676 643 642 +675 674 677 +677 674 676 +678 679 675 +675 679 653 +673 679 671 +671 679 678 +626 638 624 +624 638 680 +625 681 631 +631 681 641 +680 681 624 +624 681 625 +668 682 680 +680 682 681 +666 683 668 +668 683 682 +681 682 641 +641 682 684 +680 638 668 +668 638 669 +685 640 684 +684 640 641 +640 685 639 +639 685 642 +685 686 642 +642 686 676 +686 685 687 +687 685 684 +688 686 689 +689 686 687 +682 683 684 +684 683 687 +683 690 687 +687 690 689 +686 688 676 +676 688 677 +692 677 691 +691 677 688 +691 694 693 +693 694 695 +691 688 694 +694 688 689 +691 693 692 +692 693 672 +692 672 678 +678 672 671 +678 675 692 +692 675 677 +683 666 690 +690 666 667 +695 690 670 +670 690 667 +695 694 690 +690 694 689 +693 695 665 +665 695 670 +665 662 693 +693 662 672 +647 654 656 +656 654 673 +673 654 679 +679 654 653 +592 161 593 +593 161 289 +597 596 600 +600 596 601 +614 607 615 +615 607 606 +606 608 615 +615 608 613 +696 594 612 +612 594 597 +596 607 601 +601 607 614 +593 289 627 +627 289 202 +627 611 616 +616 611 610 +592 608 161 +161 608 199 +104 28 697 +697 28 698 +267 125 700 +700 125 699 +125 124 699 +699 124 701 +251 702 249 +249 702 703 +31 267 704 +704 267 700 +287 104 705 +705 104 697 +28 31 698 +698 31 704 +706 250 705 +705 250 287 +249 703 124 +124 703 701 +702 251 706 +706 251 250 +705 707 706 +706 707 708 +706 708 702 +702 708 709 +702 709 703 +703 709 710 +703 710 701 +701 710 711 +705 697 707 +707 697 712 +697 698 712 +712 698 713 +698 704 713 +713 704 714 +716 707 715 +715 707 712 +718 719 717 +717 719 720 +721 722 718 +718 722 719 +723 724 722 +722 724 719 +723 725 724 +724 725 726 +727 720 724 +724 720 719 +720 727 728 +728 727 729 +728 730 720 +720 730 717 +723 722 731 +731 722 721 +721 709 731 +731 709 708 +721 732 709 +709 732 710 +718 733 721 +721 733 732 +733 718 734 +734 718 717 +723 731 725 +725 731 716 +716 731 707 +707 731 708 +730 735 717 +717 735 734 +736 733 737 +737 733 734 +735 738 734 +734 738 737 +739 736 740 +740 736 737 +736 739 742 +742 739 741 +738 743 737 +737 743 740 +733 736 732 +732 736 742 +732 742 710 +710 742 711 +735 730 745 +745 730 744 +730 728 744 +744 728 729 +726 725 746 +746 725 716 +747 726 748 +748 726 746 +746 716 749 +749 716 715 +748 746 750 +750 746 749 +748 751 747 +747 751 752 +729 752 744 +744 752 751 +727 724 747 +747 724 726 +729 727 752 +752 727 747 +699 701 753 +753 701 711 +704 700 714 +714 700 754 +753 754 699 +699 754 700 +741 755 753 +753 755 754 +739 756 741 +741 756 755 +754 755 714 +714 755 757 +753 711 741 +741 711 742 +758 713 757 +757 713 714 +713 758 712 +712 758 715 +758 759 715 +715 759 749 +759 758 760 +760 758 757 +761 759 762 +762 759 760 +755 756 757 +757 756 760 +756 763 760 +760 763 762 +759 761 749 +749 761 750 +765 750 764 +764 750 761 +766 764 768 +768 764 767 +764 761 767 +767 761 762 +764 766 765 +765 766 745 +765 745 751 +751 745 744 +751 748 765 +765 748 750 +756 739 763 +763 739 740 +768 763 743 +743 763 740 +768 767 763 +763 767 762 +766 768 738 +738 768 743 +738 735 766 +766 735 745 +218 216 207 +207 216 208 +208 216 209 +209 216 192 +197 579 198 +198 579 510 +75 74 288 +288 74 271 +276 206 290 +290 206 183 +289 182 202 +202 182 83 +489 579 141 +141 579 197 +141 197 142 +142 197 196 +148 275 71 +71 275 72 +103 102 278 +278 102 769 +769 595 278 +278 595 594 +604 595 770 +770 595 769 +770 769 771 +771 769 102 +771 102 772 +772 102 101 +154 773 100 +100 773 101 +772 101 96 +96 101 773 +774 772 99 +99 772 96 +772 774 771 +771 774 775 +771 775 770 +770 775 776 +199 605 196 +196 605 776 +188 70 777 +777 70 73 +96 773 97 +97 773 154 +182 160 183 +183 160 290 +776 275 196 +196 275 142 +776 605 770 +770 605 604 +612 611 696 +696 611 201 +594 696 278 +278 696 201 +72 275 775 +775 275 776 +775 774 72 +72 774 73 +99 777 774 +774 777 73 +777 99 188 +188 99 98 +244 241 98 +98 241 188 +130 32 255 +27 0 94 +94 0 61 +26 1 27 +27 1 0 +264 114 265 +265 114 113 +94 61 68 +68 61 63 +61 60 63 +63 60 64 +60 12 64 +64 12 129 +12 11 129 +129 11 13 +30 10 31 +31 10 267 +14 11 30 +30 11 10 +30 29 14 +14 29 230 +29 105 230 +230 105 231 +286 236 105 +105 236 231 +253 89 286 +286 89 236 +252 43 253 +253 43 89 +252 248 43 +43 248 6 +266 126 267 +267 126 125 +9 2 240 +240 2 115 +2 1 115 +115 1 113 +1 26 113 +113 26 265 +26 25 265 +265 25 112 +25 285 112 +112 285 109 +285 242 109 +109 242 254 +242 241 254 +254 241 255 +241 244 255 +255 244 130 +244 243 130 +130 243 131 +264 36 114 +114 36 40 +40 36 41 +41 36 39 +91 90 39 +39 90 41 +235 232 91 +91 232 90 +190 193 235 +235 193 232 +257 284 243 +243 284 131 +256 54 257 +257 54 284 +256 153 200 +200 153 184 +55 200 203 +203 200 179 +54 256 55 +55 256 200 +203 84 55 +55 84 51 +85 121 52 +52 121 78 +211 214 85 +85 214 121 +210 215 211 +211 215 214 +191 279 210 +210 279 215 +190 239 191 +191 239 279 +248 123 6 +6 123 7 +123 126 7 +7 126 240 +126 266 240 +240 266 9 +9 266 8 +8 266 10 +78 121 79 +79 121 108 +121 214 108 +108 214 120 +214 215 120 +120 215 119 +215 279 119 +119 279 117 +279 239 117 +117 239 118 +239 234 118 +118 234 122 +234 92 122 +122 92 38 diff --git a/AnimatableGaussians/smpl_files/mano/mano_face_open.txt b/AnimatableGaussians/smpl_files/mano/mano_face_open.txt new file mode 100644 index 0000000000000000000000000000000000000000..f2530e088b0e3fbee851c88e7a202b3d8200996e --- /dev/null +++ b/AnimatableGaussians/smpl_files/mano/mano_face_open.txt @@ -0,0 +1,1538 @@ +1 2 0 +0 2 3 +4 5 7 +7 5 6 +8 3 9 +9 3 2 +11 12 10 +10 12 8 +13 11 15 +15 11 14 +17 18 16 +16 18 19 +21 22 20 +20 22 23 +25 26 24 +24 26 27 +29 30 28 +28 30 31 +32 33 35 +35 33 34 +36 37 39 +39 37 38 +40 41 5 +5 41 42 +5 42 6 +6 42 43 +44 33 45 +45 33 32 +47 48 46 +46 48 49 +51 52 50 +50 52 53 +55 51 54 +54 51 50 +57 58 56 +56 58 59 +60 61 3 +3 61 0 +63 64 62 +62 64 65 +67 68 66 +66 68 69 +71 72 70 +70 72 73 +75 76 74 +74 76 77 +52 78 53 +53 78 79 +81 82 80 +80 82 83 +84 85 51 +51 85 52 +56 59 86 +86 59 87 +88 89 42 +42 89 43 +42 41 88 +88 41 90 +39 38 91 +91 38 92 +93 69 63 +63 69 68 +12 60 8 +8 60 3 +24 27 68 +68 27 94 +95 24 67 +67 24 68 +97 98 96 +96 98 99 +100 101 103 +103 101 102 +105 29 104 +104 29 28 +50 53 106 +106 53 107 +53 79 107 +107 79 108 +110 111 109 +109 111 112 +114 4 113 +113 4 115 +114 40 4 +4 40 5 +35 34 110 +110 34 116 +34 117 116 +116 117 118 +33 119 34 +34 119 117 +33 44 119 +119 44 120 +124 125 123 +123 125 126 +127 128 13 +13 128 129 +32 130 45 +45 130 131 +132 93 62 +62 93 63 +133 134 136 +136 134 135 +138 139 137 +137 139 140 +76 141 77 +77 141 142 +143 144 19 +19 144 145 +147 148 146 +146 148 71 +150 151 149 +149 151 152 +81 100 82 +82 100 103 +100 81 154 +154 81 153 +155 156 57 +57 156 58 +157 67 146 +146 67 66 +158 145 14 +14 145 15 +67 157 95 +95 157 159 +128 65 129 +129 65 64 +161 162 160 +160 162 163 +165 166 164 +164 166 167 +169 170 168 +168 170 171 +173 170 172 +172 170 169 +175 176 174 +174 176 177 +179 180 178 +178 180 23 +181 182 20 +20 182 183 +80 184 81 +81 184 153 +185 186 187 +187 186 143 +157 70 159 +159 70 188 +189 134 156 +156 134 58 +168 171 138 +138 171 139 +146 71 157 +157 71 70 +191 192 190 +190 192 193 +166 165 48 +48 165 194 +195 189 49 +49 189 156 +196 197 199 +199 197 198 +20 23 181 +181 23 180 +145 158 19 +19 158 16 +181 180 80 +80 180 184 +200 184 179 +179 184 180 +201 202 82 +82 202 83 +204 205 203 +203 205 84 +206 21 183 +183 21 20 +178 23 207 +207 23 22 +207 208 178 +178 208 204 +208 209 204 +204 209 205 +211 205 210 +210 205 209 +178 204 179 +179 204 203 +212 175 87 +87 175 213 +85 84 211 +211 84 205 +192 216 217 +216 218 217 +217 218 219 +218 17 219 +219 17 16 +18 220 19 +19 220 143 +221 222 224 +224 222 223 +174 225 175 +175 225 213 +226 86 213 +213 86 87 +219 16 227 +227 16 158 +133 212 59 +59 212 87 +137 228 150 +150 228 151 +192 191 209 +209 191 210 +229 193 217 +217 193 192 +230 231 227 +227 231 229 +232 233 90 +90 233 88 +234 235 92 +92 235 91 +229 231 233 +233 231 236 +46 237 47 +47 237 238 +239 190 234 +234 190 235 +4 7 115 +115 7 240 +241 242 188 +188 242 159 +243 244 97 +97 244 98 +155 245 46 +46 245 237 +75 246 76 +76 246 247 +249 124 248 +248 124 123 +251 252 250 +250 252 253 +110 109 35 +35 109 254 +255 32 254 +254 32 35 +256 257 153 +153 257 154 +62 168 132 +132 168 138 +65 169 62 +62 169 168 +172 169 128 +128 169 65 +128 127 172 +172 127 258 +127 259 258 +258 259 260 +212 133 261 +261 133 136 +262 263 185 +185 263 186 +111 264 112 +112 264 265 +10 266 267 +233 232 229 +229 232 193 +152 268 69 +69 268 66 +174 177 164 +164 177 140 +149 152 93 +93 152 69 +270 220 269 +269 220 206 +268 152 271 +271 152 151 +120 44 108 +108 44 107 +46 49 155 +155 49 156 +56 272 57 +57 272 273 +144 274 259 +259 274 260 +275 148 142 +142 148 77 +147 268 74 +74 268 271 +206 276 269 +269 276 277 +194 195 48 +48 195 49 +58 134 59 +59 134 133 +82 103 201 +201 103 278 +148 147 77 +77 147 74 +246 277 247 +247 277 276 +182 181 83 +83 181 80 +47 238 280 +280 238 281 +226 222 282 +282 222 221 +222 225 223 +223 225 167 +280 281 223 +223 281 224 +164 167 174 +174 167 225 +263 262 137 +137 262 228 +13 15 127 +127 15 259 +219 227 217 +217 227 229 +86 226 283 +283 226 282 +259 15 144 +144 15 145 +243 97 257 +257 97 154 +57 273 155 +155 273 245 +106 284 50 +50 284 54 +242 285 159 +159 285 95 +233 236 88 +88 236 89 +45 131 106 +106 131 284 +252 251 248 +248 251 249 +285 25 95 +95 25 24 +105 104 286 +286 104 287 +271 151 288 +288 151 228 +137 150 138 +138 150 132 +182 289 160 +160 289 161 +290 291 276 +276 291 292 +150 149 132 +132 149 93 +261 274 176 +176 274 186 +143 186 144 +144 186 274 +272 56 283 +283 56 86 +173 135 189 +189 135 134 +110 116 111 +111 116 37 +116 118 37 +37 118 122 +111 37 264 +264 37 36 +286 287 253 +253 287 250 +227 158 230 +230 158 14 +222 226 225 +225 226 213 +146 66 147 +147 66 268 +223 167 280 +280 167 166 +198 162 199 +199 162 161 +44 45 107 +107 45 106 +280 166 47 +47 166 48 +160 163 290 +290 163 291 +37 122 38 +292 293 276 +276 293 247 +283 282 295 +295 282 294 +283 295 272 +272 295 296 +273 272 297 +297 272 296 +245 273 298 +298 273 297 +282 221 294 +294 221 299 +221 224 299 +299 224 300 +300 224 301 +301 224 281 +302 303 299 +299 303 294 +305 306 304 +304 306 307 +308 309 307 +307 309 304 +307 306 311 +311 306 310 +312 313 311 +311 313 314 +310 315 311 +311 315 312 +316 303 310 +310 303 315 +314 308 311 +311 308 307 +317 318 320 +320 318 319 +318 317 308 +308 317 309 +310 306 316 +316 306 305 +305 296 316 +316 296 295 +305 321 296 +296 321 297 +304 322 305 +305 322 321 +322 304 323 +323 304 309 +303 316 294 +294 316 295 +317 324 309 +309 324 323 +322 323 325 +325 323 326 +323 324 326 +326 324 327 +325 326 328 +328 326 329 +328 330 325 +325 330 331 +332 329 327 +327 329 326 +322 325 321 +321 325 331 +321 331 297 +297 331 298 +324 317 333 +333 317 320 +312 315 334 +334 315 303 +334 335 312 +312 335 313 +303 302 334 +334 302 336 +335 334 337 +337 334 336 +335 338 313 +313 338 339 +245 298 237 +237 298 340 +238 341 281 +281 341 301 +341 238 340 +340 238 237 +340 330 341 +341 330 342 +330 328 342 +342 328 343 +341 342 301 +301 342 344 +340 298 330 +330 298 331 +345 300 344 +344 300 301 +345 302 300 +300 302 299 +346 336 345 +345 336 302 +346 345 347 +347 345 344 +348 346 349 +349 346 347 +342 343 344 +344 343 347 +343 350 347 +347 350 349 +336 346 337 +337 346 348 +352 337 351 +351 337 348 +351 354 353 +353 354 355 +351 348 354 +354 348 349 +351 353 352 +352 353 333 +352 333 338 +338 333 320 +338 335 352 +352 335 337 +328 329 343 +343 329 350 +355 350 332 +332 350 329 +355 354 350 +350 354 349 +353 355 327 +327 355 332 +327 324 353 +353 324 333 +308 314 318 +318 314 319 +319 339 320 +320 339 338 +319 314 339 +339 314 313 +136 135 260 +260 135 258 +139 165 140 +140 165 164 +171 170 194 +194 170 195 +170 173 195 +195 173 189 +177 176 263 +263 176 186 +171 194 139 +139 194 165 +136 260 261 +261 260 274 +177 263 140 +140 263 137 +261 176 212 +212 176 175 +135 173 258 +258 173 172 +357 358 356 +356 358 359 +361 362 360 +360 362 363 +360 363 364 +364 363 365 +366 367 369 +369 367 368 +75 370 246 +246 370 371 +372 373 361 +361 373 362 +375 376 374 +374 376 377 +288 228 379 +379 228 378 +380 378 262 +262 378 228 +382 383 381 +381 383 384 +385 367 373 +373 367 362 +75 288 370 +370 288 379 +376 375 358 +358 375 386 +387 385 359 +359 385 373 +388 382 365 +365 382 389 +391 392 390 +390 392 393 +382 381 389 +389 381 394 +395 364 389 +389 364 365 +388 365 366 +366 365 363 +356 396 357 +357 396 397 +372 398 356 +356 398 396 +388 366 399 +399 366 369 +381 384 374 +374 384 371 +356 359 372 +372 359 373 +360 400 361 +361 400 401 +386 387 358 +358 387 359 +362 367 363 +363 367 366 +357 397 402 +402 397 403 +395 391 404 +404 391 390 +391 394 392 +392 394 377 +392 402 393 +393 402 403 +374 377 381 +381 377 394 +364 395 405 +405 395 404 +361 401 372 +372 401 398 +270 269 399 +399 269 383 +400 360 405 +405 360 364 +380 368 385 +385 368 367 +391 395 394 +394 395 389 +392 377 402 +402 377 376 +402 376 357 +357 376 358 +405 404 407 +407 404 406 +405 407 400 +400 407 408 +400 408 401 +401 408 409 +401 409 398 +398 409 410 +404 390 406 +406 390 411 +390 393 411 +411 393 412 +393 403 412 +412 403 413 +414 415 411 +411 415 406 +417 418 416 +416 418 419 +420 421 417 +417 421 418 +418 421 423 +423 421 422 +424 425 423 +423 425 426 +422 427 423 +423 427 424 +426 419 423 +423 419 418 +419 428 416 +416 428 429 +422 421 430 +430 421 420 +420 408 430 +430 408 407 +420 431 408 +408 431 409 +417 432 420 +420 432 431 +433 432 416 +416 432 417 +430 415 422 +422 415 427 +415 430 406 +406 430 407 +434 433 429 +429 433 416 +432 433 435 +435 433 436 +433 434 436 +436 434 437 +435 436 438 +438 436 439 +438 440 435 +435 440 441 +437 442 436 +436 442 439 +435 441 432 +432 441 431 +431 441 409 +409 441 410 +434 429 444 +444 429 443 +429 428 443 +443 428 445 +424 427 446 +446 427 415 +425 424 447 +447 424 446 +415 414 446 +446 414 448 +446 448 447 +447 448 449 +450 451 447 +447 451 425 +445 451 443 +443 451 450 +398 410 396 +396 410 452 +397 453 403 +403 453 413 +453 397 452 +452 397 396 +452 440 453 +453 440 454 +440 438 454 +454 438 455 +453 454 413 +413 454 456 +440 452 441 +441 452 410 +457 412 456 +456 412 413 +457 414 412 +412 414 411 +457 458 414 +414 458 448 +458 457 459 +459 457 456 +460 458 461 +461 458 459 +454 455 456 +456 455 459 +455 462 459 +459 462 461 +458 460 448 +448 460 449 +464 449 463 +463 449 460 +463 466 465 +465 466 467 +463 460 466 +466 460 461 +463 465 464 +464 465 444 +464 444 450 +450 444 443 +450 447 464 +464 447 449 +438 439 455 +455 439 462 +467 462 442 +442 462 439 +467 466 462 +462 466 461 +465 467 437 +437 467 442 +437 434 465 +465 434 444 +419 426 428 +428 426 445 +445 426 451 +451 426 425 +369 368 187 +187 368 185 +370 375 371 +371 375 374 +379 378 386 +386 378 387 +378 380 387 +387 380 385 +384 383 277 +277 383 269 +379 386 370 +370 386 375 +399 369 270 +270 369 187 +384 277 371 +371 277 246 +399 383 388 +388 383 382 +368 380 185 +185 380 262 +220 270 143 +143 270 187 +220 18 206 +206 18 21 +18 17 21 +21 17 22 +17 218 22 +22 218 207 +468 469 471 +471 469 470 +473 474 472 +472 474 475 +472 475 476 +476 475 477 +479 480 478 +478 480 481 +482 483 473 +473 483 474 +485 486 484 +484 486 487 +488 489 76 +76 489 141 +490 488 247 +247 488 76 +492 493 491 +491 493 494 +495 479 483 +483 479 474 +485 496 486 +486 496 470 +497 495 471 +471 495 483 +498 492 477 +477 492 499 +500 501 503 +503 501 502 +492 491 499 +499 491 504 +505 476 499 +499 476 477 +498 477 478 +478 477 475 +468 506 469 +469 506 507 +482 508 468 +468 508 506 +478 481 498 +498 481 509 +491 494 484 +484 494 510 +482 468 483 +483 468 471 +472 511 473 +473 511 512 +496 497 470 +470 497 471 +474 479 475 +475 479 478 +469 507 513 +513 507 514 +505 501 515 +515 501 500 +502 501 487 +487 501 504 +513 514 502 +502 514 503 +484 487 491 +491 487 504 +476 505 516 +516 505 515 +473 512 482 +482 512 508 +509 291 493 +493 291 163 +511 472 516 +516 472 476 +490 480 495 +495 480 479 +501 505 504 +504 505 499 +502 487 513 +513 487 486 +513 486 469 +469 486 470 +516 515 518 +518 515 517 +516 518 511 +511 518 519 +511 519 512 +512 519 520 +512 520 508 +508 520 521 +515 500 517 +517 500 522 +500 503 522 +522 503 523 +523 503 524 +524 503 514 +525 526 522 +522 526 517 +528 529 527 +527 529 530 +531 532 528 +528 532 529 +529 532 534 +534 532 533 +535 536 534 +534 536 537 +533 538 534 +534 538 535 +537 530 534 +534 530 529 +539 540 530 +530 540 527 +532 531 533 +533 531 541 +531 519 541 +541 519 518 +531 542 519 +519 542 520 +528 543 531 +531 543 542 +543 528 544 +544 528 527 +533 541 538 +538 541 526 +526 541 517 +517 541 518 +540 545 527 +527 545 544 +546 543 547 +547 543 544 +545 548 544 +544 548 547 +549 546 550 +550 546 547 +546 549 552 +552 549 551 +548 553 547 +547 553 550 +543 546 542 +542 546 552 +542 552 520 +520 552 521 +545 540 555 +555 540 554 +540 539 554 +554 539 556 +535 538 557 +557 538 526 +536 535 558 +558 535 557 +526 525 557 +557 525 559 +558 557 560 +560 557 559 +558 561 536 +536 561 562 +556 562 554 +554 562 561 +508 521 506 +506 521 563 +507 564 514 +514 564 524 +564 507 563 +563 507 506 +563 551 564 +564 551 565 +551 549 565 +565 549 566 +564 565 524 +524 565 567 +563 521 551 +551 521 552 +568 523 567 +567 523 524 +568 525 523 +523 525 522 +569 559 568 +568 559 525 +569 568 570 +570 568 567 +571 569 572 +572 569 570 +565 566 567 +567 566 570 +566 573 570 +570 573 572 +569 571 559 +559 571 560 +575 560 574 +574 560 571 +574 577 576 +576 577 578 +574 571 577 +577 571 572 +574 576 575 +575 576 555 +575 555 561 +561 555 554 +561 558 575 +575 558 560 +549 550 566 +566 550 573 +578 573 553 +553 573 550 +578 577 573 +573 577 572 +578 553 576 +576 553 548 +548 545 576 +576 545 555 +530 537 539 +539 537 556 +556 537 562 +562 537 536 +480 293 481 +481 293 292 +579 485 510 +510 485 484 +489 488 496 +496 488 497 +488 490 497 +497 490 495 +162 494 163 +163 494 493 +579 489 485 +485 489 496 +481 292 509 +509 292 291 +494 162 510 +510 162 198 +493 492 509 +509 492 498 +480 490 293 +293 490 247 +581 582 580 +580 582 583 +585 586 584 +584 586 587 +584 587 588 +588 587 589 +591 592 590 +590 592 593 +594 595 597 +597 595 596 +598 599 585 +585 599 586 +600 601 603 +603 601 602 +604 605 607 +607 605 606 +608 606 199 +199 606 605 +609 610 612 +612 610 611 +599 613 586 +586 613 591 +595 604 596 +596 604 607 +601 614 602 +602 614 582 +615 613 583 +583 613 599 +610 617 616 +616 617 589 +619 620 618 +618 620 621 +609 622 610 +610 622 617 +623 588 617 +617 588 589 +616 589 590 +590 589 587 +580 624 581 +581 624 625 +598 626 580 +580 626 624 +590 593 616 +616 593 627 +600 609 597 +597 609 612 +580 583 598 +598 583 599 +584 628 585 +585 628 629 +614 615 582 +582 615 583 +586 591 587 +587 591 590 +581 625 630 +630 625 631 +623 619 632 +632 619 618 +620 619 603 +603 619 622 +630 631 620 +620 631 621 +609 600 622 +622 600 603 +588 623 633 +633 623 632 +585 629 598 +598 629 626 +202 201 627 +627 201 611 +628 584 633 +633 584 588 +608 592 613 +613 592 591 +619 623 622 +622 623 617 +630 620 602 +602 620 603 +581 630 582 +582 630 602 +633 632 635 +635 632 634 +633 635 628 +628 635 636 +628 636 629 +629 636 637 +629 637 626 +626 637 638 +632 618 634 +634 618 639 +618 621 639 +639 621 640 +640 621 641 +641 621 631 +643 634 642 +642 634 639 +644 645 647 +647 645 646 +648 649 645 +645 649 646 +646 649 651 +651 649 650 +651 652 654 +654 652 653 +650 655 651 +651 655 652 +654 647 651 +651 647 646 +647 656 644 +644 656 657 +649 648 650 +650 648 658 +648 636 658 +658 636 635 +648 659 636 +636 659 637 +660 659 645 +645 659 648 +661 660 644 +644 660 645 +650 658 655 +655 658 643 +643 658 634 +634 658 635 +662 661 657 +657 661 644 +663 660 664 +664 660 661 +662 665 661 +661 665 664 +666 663 667 +667 663 664 +663 666 669 +669 666 668 +665 670 664 +664 670 667 +660 663 659 +659 663 669 +659 669 637 +637 669 638 +657 671 662 +662 671 672 +657 656 671 +671 656 673 +652 655 674 +674 655 643 +652 674 653 +653 674 675 +674 643 676 +676 643 642 +675 674 677 +677 674 676 +678 679 675 +675 679 653 +673 679 671 +671 679 678 +626 638 624 +624 638 680 +625 681 631 +631 681 641 +680 681 624 +624 681 625 +668 682 680 +680 682 681 +666 683 668 +668 683 682 +681 682 641 +641 682 684 +680 638 668 +668 638 669 +685 640 684 +684 640 641 +640 685 639 +639 685 642 +685 686 642 +642 686 676 +686 685 687 +687 685 684 +688 686 689 +689 686 687 +682 683 684 +684 683 687 +683 690 687 +687 690 689 +686 688 676 +676 688 677 +692 677 691 +691 677 688 +691 694 693 +693 694 695 +691 688 694 +694 688 689 +691 693 692 +692 693 672 +692 672 678 +678 672 671 +678 675 692 +692 675 677 +683 666 690 +690 666 667 +695 690 670 +670 690 667 +695 694 690 +690 694 689 +693 695 665 +665 695 670 +665 662 693 +693 662 672 +647 654 656 +656 654 673 +673 654 679 +679 654 653 +592 161 593 +593 161 289 +597 596 600 +600 596 601 +614 607 615 +615 607 606 +606 608 615 +615 608 613 +696 594 612 +612 594 597 +596 607 601 +601 607 614 +593 289 627 +627 289 202 +627 611 616 +616 611 610 +592 608 161 +161 608 199 +104 28 697 +697 28 698 +267 125 700 +700 125 699 +125 124 699 +699 124 701 +251 702 249 +249 702 703 +31 267 704 +704 267 700 +287 104 705 +705 104 697 +28 31 698 +698 31 704 +706 250 705 +705 250 287 +249 703 124 +124 703 701 +702 251 706 +706 251 250 +705 707 706 +706 707 708 +706 708 702 +702 708 709 +702 709 703 +703 709 710 +703 710 701 +701 710 711 +705 697 707 +707 697 712 +697 698 712 +712 698 713 +698 704 713 +713 704 714 +716 707 715 +715 707 712 +718 719 717 +717 719 720 +721 722 718 +718 722 719 +723 724 722 +722 724 719 +723 725 724 +724 725 726 +727 720 724 +724 720 719 +720 727 728 +728 727 729 +728 730 720 +720 730 717 +723 722 731 +731 722 721 +721 709 731 +731 709 708 +721 732 709 +709 732 710 +718 733 721 +721 733 732 +733 718 734 +734 718 717 +723 731 725 +725 731 716 +716 731 707 +707 731 708 +730 735 717 +717 735 734 +736 733 737 +737 733 734 +735 738 734 +734 738 737 +739 736 740 +740 736 737 +736 739 742 +742 739 741 +738 743 737 +737 743 740 +733 736 732 +732 736 742 +732 742 710 +710 742 711 +735 730 745 +745 730 744 +730 728 744 +744 728 729 +726 725 746 +746 725 716 +747 726 748 +748 726 746 +746 716 749 +749 716 715 +748 746 750 +750 746 749 +748 751 747 +747 751 752 +729 752 744 +744 752 751 +727 724 747 +747 724 726 +729 727 752 +752 727 747 +699 701 753 +753 701 711 +704 700 714 +714 700 754 +753 754 699 +699 754 700 +741 755 753 +753 755 754 +739 756 741 +741 756 755 +754 755 714 +714 755 757 +753 711 741 +741 711 742 +758 713 757 +757 713 714 +713 758 712 +712 758 715 +758 759 715 +715 759 749 +759 758 760 +760 758 757 +761 759 762 +762 759 760 +755 756 757 +757 756 760 +756 763 760 +760 763 762 +759 761 749 +749 761 750 +765 750 764 +764 750 761 +766 764 768 +768 764 767 +764 761 767 +767 761 762 +764 766 765 +765 766 745 +765 745 751 +751 745 744 +751 748 765 +765 748 750 +756 739 763 +763 739 740 +768 763 743 +743 763 740 +768 767 763 +763 767 762 +766 768 738 +738 768 743 +738 735 766 +766 735 745 +218 216 207 +207 216 208 +208 216 209 +209 216 192 +197 579 198 +198 579 510 +75 74 288 +288 74 271 +276 206 290 +290 206 183 +289 182 202 +202 182 83 +489 579 141 +141 579 197 +141 197 142 +142 197 196 +148 275 71 +71 275 72 +103 102 278 +278 102 769 +769 595 278 +278 595 594 +604 595 770 +770 595 769 +770 769 771 +771 769 102 +771 102 772 +772 102 101 +154 773 100 +100 773 101 +772 101 96 +96 101 773 +774 772 99 +99 772 96 +772 774 771 +771 774 775 +771 775 770 +770 775 776 +199 605 196 +196 605 776 +188 70 777 +777 70 73 +96 773 97 +97 773 154 +182 160 183 +183 160 290 +776 275 196 +196 275 142 +776 605 770 +770 605 604 +612 611 696 +696 611 201 +594 696 278 +278 696 201 +72 275 775 +775 275 776 +775 774 72 +72 774 73 +99 777 774 +774 777 73 +777 99 188 +188 99 98 +244 241 98 +98 241 188 +130 32 255 +27 0 94 +94 0 61 +26 1 27 +27 1 0 +264 114 265 +265 114 113 +94 61 68 +68 61 63 +61 60 63 +63 60 64 +60 12 64 +64 12 129 +12 11 129 +129 11 13 +30 10 31 +31 10 267 +14 11 30 +30 11 10 +30 29 14 +14 29 230 +29 105 230 +230 105 231 +286 236 105 +105 236 231 +253 89 286 +286 89 236 +252 43 253 +253 43 89 +252 248 43 +43 248 6 +266 126 267 +267 126 125 +9 2 240 +240 2 115 +2 1 115 +115 1 113 +1 26 113 +113 26 265 +26 25 265 +265 25 112 +25 285 112 +112 285 109 +285 242 109 +109 242 254 +242 241 254 +254 241 255 +241 244 255 +255 244 130 +244 243 130 +130 243 131 +264 36 114 +114 36 40 +40 36 41 +41 36 39 +91 90 39 +39 90 41 +235 232 91 +91 232 90 +190 193 235 +235 193 232 +257 284 243 +243 284 131 +256 54 257 +257 54 284 +256 153 200 +200 153 184 +55 200 203 +203 200 179 +54 256 55 +55 256 200 +203 84 55 +55 84 51 +85 121 52 +52 121 78 +211 214 85 +85 214 121 +210 215 211 +211 215 214 +191 279 210 +210 279 215 +190 239 191 +191 239 279 +248 123 6 +6 123 7 +123 126 7 +7 126 240 +126 266 240 +240 266 9 +9 266 8 +8 266 10 diff --git a/AnimatableGaussians/smpl_files/mano/smplx_lhand_to_mano_rhand.npz b/AnimatableGaussians/smpl_files/mano/smplx_lhand_to_mano_rhand.npz new file mode 100644 index 0000000000000000000000000000000000000000..4f80fd6df6fb2a4c8ca27d9eb09d1679d22a51e2 --- /dev/null +++ b/AnimatableGaussians/smpl_files/mano/smplx_lhand_to_mano_rhand.npz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4b31d8091daef9b617b9be2ba82dc623c1faa2cfe7d40e64dd06ac4436a5ffae +size 8131 diff --git a/AnimatableGaussians/smpl_files/mano/smplx_rhand_to_mano_rhand.npz b/AnimatableGaussians/smpl_files/mano/smplx_rhand_to_mano_rhand.npz new file mode 100644 index 0000000000000000000000000000000000000000..4efc965bfeb645b5c54d85b9c7177880582e417f --- /dev/null +++ b/AnimatableGaussians/smpl_files/mano/smplx_rhand_to_mano_rhand.npz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d9ea2a4dea902e1e97b2fa947ce053e701445097408f7d61511babf904b4c166 +size 8131 diff --git a/AnimatableGaussians/smpl_files/smplx/SMPLX_NEUTRAL.npz b/AnimatableGaussians/smpl_files/smplx/SMPLX_NEUTRAL.npz new file mode 100644 index 0000000000000000000000000000000000000000..205f1283b3a4bca6caced2188cfe294aeebbca26 --- /dev/null +++ b/AnimatableGaussians/smpl_files/smplx/SMPLX_NEUTRAL.npz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4ad1ce5a5a854401ee98410ccecac5bb72dc7c2767ec0f975ce83923c15532d4 +size 30304063 diff --git a/AnimatableGaussians/smplx/__init__.py b/AnimatableGaussians/smplx/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..7b176876d97f14cab61c57be50f4c7d1809d5d97 --- /dev/null +++ b/AnimatableGaussians/smplx/__init__.py @@ -0,0 +1,30 @@ +# -*- coding: utf-8 -*- + +# Max-Planck-Gesellschaft zur Förderung der Wissenschaften e.V. (MPG) is +# holder of all proprietary rights on this computer program. +# You can only use this computer program if you have closed +# a license agreement with MPG or you get the right to use the computer +# program from someone who is authorized to grant you that right. +# Any use of the computer program without a valid license is prohibited and +# liable to prosecution. +# +# Copyright©2019 Max-Planck-Gesellschaft zur Förderung +# der Wissenschaften e.V. (MPG). acting on behalf of its Max Planck Institute +# for Intelligent Systems. All rights reserved. +# +# Contact: ps-license@tuebingen.mpg.de + +from .body_models import ( + create, + SMPL, + SMPLH, + SMPLX, + MANO, + FLAME, + build_layer, + SMPLLayer, + SMPLHLayer, + SMPLXLayer, + MANOLayer, + FLAMELayer, +) diff --git a/AnimatableGaussians/smplx/__pycache__/__init__.cpython-310.pyc b/AnimatableGaussians/smplx/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2a5cefdde6ffbedf31ef0fc72b723b99fd90774a Binary files /dev/null and b/AnimatableGaussians/smplx/__pycache__/__init__.cpython-310.pyc differ diff --git a/AnimatableGaussians/smplx/__pycache__/__init__.cpython-38.pyc b/AnimatableGaussians/smplx/__pycache__/__init__.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3c8515804dbcd90c1b6ef640e198fde512584b8e Binary files /dev/null and b/AnimatableGaussians/smplx/__pycache__/__init__.cpython-38.pyc differ diff --git a/AnimatableGaussians/smplx/__pycache__/body_models.cpython-310.pyc b/AnimatableGaussians/smplx/__pycache__/body_models.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..bbdebfff845ed911e1a6c1f4eaee4b22c51d903d Binary files /dev/null and b/AnimatableGaussians/smplx/__pycache__/body_models.cpython-310.pyc differ diff --git a/AnimatableGaussians/smplx/__pycache__/body_models.cpython-38.pyc b/AnimatableGaussians/smplx/__pycache__/body_models.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..faf9253bdc1bafb0f214c331183b8e4545593e26 Binary files /dev/null and b/AnimatableGaussians/smplx/__pycache__/body_models.cpython-38.pyc differ diff --git a/AnimatableGaussians/smplx/__pycache__/lbs.cpython-310.pyc b/AnimatableGaussians/smplx/__pycache__/lbs.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..05d86a1096b6e8f4ac7177b14ffeff5fb2b89d24 Binary files /dev/null and b/AnimatableGaussians/smplx/__pycache__/lbs.cpython-310.pyc differ diff --git a/AnimatableGaussians/smplx/__pycache__/lbs.cpython-38.pyc b/AnimatableGaussians/smplx/__pycache__/lbs.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..46c9fcec0e41a707e41c9de39288198a460042f1 Binary files /dev/null and b/AnimatableGaussians/smplx/__pycache__/lbs.cpython-38.pyc differ diff --git a/AnimatableGaussians/smplx/__pycache__/utils.cpython-310.pyc b/AnimatableGaussians/smplx/__pycache__/utils.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..89caba53e464b8f887e6dca14c7e98afda787677 Binary files /dev/null and b/AnimatableGaussians/smplx/__pycache__/utils.cpython-310.pyc differ diff --git a/AnimatableGaussians/smplx/__pycache__/utils.cpython-38.pyc b/AnimatableGaussians/smplx/__pycache__/utils.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..bffeb63a567a59aa2e84a77019d6b2ce490d6e44 Binary files /dev/null and b/AnimatableGaussians/smplx/__pycache__/utils.cpython-38.pyc differ diff --git a/AnimatableGaussians/smplx/__pycache__/vertex_ids.cpython-310.pyc b/AnimatableGaussians/smplx/__pycache__/vertex_ids.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..58af9be2fa3d29c0c756c4265c991ef7d61db028 Binary files /dev/null and b/AnimatableGaussians/smplx/__pycache__/vertex_ids.cpython-310.pyc differ diff --git a/AnimatableGaussians/smplx/__pycache__/vertex_ids.cpython-38.pyc b/AnimatableGaussians/smplx/__pycache__/vertex_ids.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3c1d76c43e03efb5139a96cdf612af0920a262ec Binary files /dev/null and b/AnimatableGaussians/smplx/__pycache__/vertex_ids.cpython-38.pyc differ diff --git a/AnimatableGaussians/smplx/__pycache__/vertex_joint_selector.cpython-310.pyc b/AnimatableGaussians/smplx/__pycache__/vertex_joint_selector.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..75b667dde242f3278029ecc6f9d70f0e10a9a3ef Binary files /dev/null and b/AnimatableGaussians/smplx/__pycache__/vertex_joint_selector.cpython-310.pyc differ diff --git a/AnimatableGaussians/smplx/__pycache__/vertex_joint_selector.cpython-38.pyc b/AnimatableGaussians/smplx/__pycache__/vertex_joint_selector.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2f1253c19d1d010003ef48414b34b09b8674a9b2 Binary files /dev/null and b/AnimatableGaussians/smplx/__pycache__/vertex_joint_selector.cpython-38.pyc differ diff --git a/AnimatableGaussians/smplx/body_models.py b/AnimatableGaussians/smplx/body_models.py new file mode 100644 index 0000000000000000000000000000000000000000..502c4958306f17a30217d548f2e7839a9cf83210 --- /dev/null +++ b/AnimatableGaussians/smplx/body_models.py @@ -0,0 +1,2415 @@ +# -*- coding: utf-8 -*- + +# Max-Planck-Gesellschaft zur Förderung der Wissenschaften e.V. (MPG) is +# holder of all proprietary rights on this computer program. +# You can only use this computer program if you have closed +# a license agreement with MPG or you get the right to use the computer +# program from someone who is authorized to grant you that right. +# Any use of the computer program without a valid license is prohibited and +# liable to prosecution. +# +# Copyright©2019 Max-Planck-Gesellschaft zur Förderung +# der Wissenschaften e.V. (MPG). acting on behalf of its Max Planck Institute +# for Intelligent Systems. All rights reserved. +# +# Contact: ps-license@tuebingen.mpg.de + +from typing import Optional, Dict, Union +import os +import os.path as osp + +import pickle + +import numpy as np + +import torch +import torch.nn as nn + +from .lbs import ( + lbs, vertices2landmarks, find_dynamic_lmk_idx_and_bcoords, blend_shapes) + +from .vertex_ids import vertex_ids as VERTEX_IDS +from .utils import ( + Struct, to_np, to_tensor, Tensor, Array, + SMPLOutput, + SMPLHOutput, + SMPLXOutput, + MANOOutput, + FLAMEOutput, + find_joint_kin_chain) +from .vertex_joint_selector import VertexJointSelector + + +class SMPL(nn.Module): + + NUM_JOINTS = 23 + NUM_BODY_JOINTS = 23 + SHAPE_SPACE_DIM = 300 + + def __init__( + self, model_path: str, + kid_template_path: str = '', + data_struct: Optional[Struct] = None, + create_betas: bool = True, + betas: Optional[Tensor] = None, + num_betas: int = 10, + create_global_orient: bool = True, + global_orient: Optional[Tensor] = None, + create_body_pose: bool = True, + body_pose: Optional[Tensor] = None, + create_transl: bool = True, + transl: Optional[Tensor] = None, + dtype=torch.float32, + batch_size: int = 1, + joint_mapper=None, + gender: str = 'neutral', + age: str = 'adult', + vertex_ids: Dict[str, int] = None, + v_template: Optional[Union[Tensor, Array]] = None, + **kwargs + ) -> None: + ''' SMPL model constructor + + Parameters + ---------- + model_path: str + The path to the folder or to the file where the model + parameters are stored + data_struct: Strct + A struct object. If given, then the parameters of the model are + read from the object. Otherwise, the model tries to read the + parameters from the given `model_path`. (default = None) + create_global_orient: bool, optional + Flag for creating a member variable for the global orientation + of the body. (default = True) + global_orient: torch.tensor, optional, Bx3 + The default value for the global orientation variable. + (default = None) + create_body_pose: bool, optional + Flag for creating a member variable for the pose of the body. + (default = True) + body_pose: torch.tensor, optional, Bx(Body Joints * 3) + The default value for the body pose variable. + (default = None) + num_betas: int, optional + Number of shape components to use + (default = 10). + create_betas: bool, optional + Flag for creating a member variable for the shape space + (default = True). + betas: torch.tensor, optional, Bx10 + The default value for the shape member variable. + (default = None) + create_transl: bool, optional + Flag for creating a member variable for the translation + of the body. (default = True) + transl: torch.tensor, optional, Bx3 + The default value for the transl variable. + (default = None) + dtype: torch.dtype, optional + The data type for the created variables + batch_size: int, optional + The batch size used for creating the member variables + joint_mapper: object, optional + An object that re-maps the joints. Useful if one wants to + re-order the SMPL joints to some other convention (e.g. MSCOCO) + (default = None) + gender: str, optional + Which gender to load + vertex_ids: dict, optional + A dictionary containing the indices of the extra vertices that + will be selected + ''' + + self.gender = gender + self.age = age + + if data_struct is None: + if osp.isdir(model_path): + model_fn = 'SMPL_{}.{ext}'.format(gender.upper(), ext='pkl') + smpl_path = os.path.join(model_path, model_fn) + else: + smpl_path = model_path + assert osp.exists(smpl_path), 'Path {} does not exist!'.format( + smpl_path) + + with open(smpl_path, 'rb') as smpl_file: + data_struct = Struct(**pickle.load(smpl_file, + encoding='latin1')) + + super(SMPL, self).__init__() + self.batch_size = batch_size + shapedirs = data_struct.shapedirs + if (shapedirs.shape[-1] < self.SHAPE_SPACE_DIM): + print(f'WARNING: You are using a {self.name()} model, with only' + ' 10 shape coefficients.') + num_betas = min(num_betas, 10) + else: + num_betas = min(num_betas, self.SHAPE_SPACE_DIM) + + if self.age=='kid': + v_template_smil = np.load(kid_template_path) + v_template_smil -= np.mean(v_template_smil, axis=0) + v_template_diff = np.expand_dims(v_template_smil - data_struct.v_template, axis=2) + shapedirs = np.concatenate((shapedirs[:, :, :num_betas], v_template_diff), axis=2) + num_betas = num_betas + 1 + + self._num_betas = num_betas + shapedirs = shapedirs[:, :, :num_betas] + # The shape components + self.register_buffer( + 'shapedirs', + to_tensor(to_np(shapedirs), dtype=dtype)) + + if vertex_ids is None: + # SMPL and SMPL-H share the same topology, so any extra joints can + # be drawn from the same place + vertex_ids = VERTEX_IDS['smplh'] + + self.dtype = dtype + + self.joint_mapper = joint_mapper + + self.vertex_joint_selector = VertexJointSelector( + vertex_ids=vertex_ids, **kwargs) + + self.faces = data_struct.f + self.register_buffer('faces_tensor', + to_tensor(to_np(self.faces, dtype=np.int64), + dtype=torch.long)) + + if create_betas: + if betas is None: + default_betas = torch.zeros( + [batch_size, self.num_betas], dtype=dtype) + else: + if torch.is_tensor(betas): + default_betas = betas.clone().detach() + else: + default_betas = torch.tensor(betas, dtype=dtype) + + self.register_parameter( + 'betas', nn.Parameter(default_betas, requires_grad=True)) + + # The tensor that contains the global rotation of the model + # It is separated from the pose of the joints in case we wish to + # optimize only over one of them + if create_global_orient: + if global_orient is None: + default_global_orient = torch.zeros( + [batch_size, 3], dtype=dtype) + else: + if torch.is_tensor(global_orient): + default_global_orient = global_orient.clone().detach() + else: + default_global_orient = torch.tensor( + global_orient, dtype=dtype) + + global_orient = nn.Parameter(default_global_orient, + requires_grad=True) + self.register_parameter('global_orient', global_orient) + + if create_body_pose: + if body_pose is None: + default_body_pose = torch.zeros( + [batch_size, self.NUM_BODY_JOINTS * 3], dtype=dtype) + else: + if torch.is_tensor(body_pose): + default_body_pose = body_pose.clone().detach() + else: + default_body_pose = torch.tensor(body_pose, + dtype=dtype) + self.register_parameter( + 'body_pose', + nn.Parameter(default_body_pose, requires_grad=True)) + + if create_transl: + if transl is None: + default_transl = torch.zeros([batch_size, 3], + dtype=dtype, + requires_grad=True) + else: + default_transl = torch.tensor(transl, dtype=dtype) + self.register_parameter( + 'transl', nn.Parameter(default_transl, requires_grad=True)) + + if v_template is None: + v_template = data_struct.v_template + if not torch.is_tensor(v_template): + v_template = to_tensor(to_np(v_template), dtype=dtype) + # The vertices of the template model + self.register_buffer('v_template', v_template) + + j_regressor = to_tensor(to_np( + data_struct.J_regressor), dtype=dtype) + self.register_buffer('J_regressor', j_regressor) + + # Pose blend shape basis: 6890 x 3 x 207, reshaped to 6890*3 x 207 + num_pose_basis = data_struct.posedirs.shape[-1] + # 207 x 20670 + posedirs = np.reshape(data_struct.posedirs, [-1, num_pose_basis]).T + self.register_buffer('posedirs', + to_tensor(to_np(posedirs), dtype=dtype)) + + # indices of parents for each joints + parents = to_tensor(to_np(data_struct.kintree_table[0])).long() + parents[0] = -1 + self.register_buffer('parents', parents) + + lbs_weights = to_tensor(to_np(data_struct.weights), dtype=dtype) + self.register_buffer('lbs_weights', lbs_weights) + + @property + def num_betas(self): + return self._num_betas + + @property + def num_expression_coeffs(self): + return 0 + + def create_mean_pose(self, data_struct) -> Tensor: + pass + + def name(self) -> str: + return 'SMPL' + + @torch.no_grad() + def reset_params(self, **params_dict) -> None: + for param_name, param in self.named_parameters(): + if param_name in params_dict: + param[:] = torch.tensor(params_dict[param_name]) + else: + param.fill_(0) + + def get_num_verts(self) -> int: + return self.v_template.shape[0] + + def get_num_faces(self) -> int: + return self.faces.shape[0] + + def extra_repr(self) -> str: + msg = [ + f'Gender: {self.gender.upper()}', + f'Number of joints: {self.J_regressor.shape[0]}', + f'Betas: {self.num_betas}', + ] + return '\n'.join(msg) + + def forward_shape( + self, + betas: Optional[Tensor] = None, + ) -> SMPLOutput: + betas = betas if betas is not None else self.betas + v_shaped = self.v_template + blend_shapes(betas, self.shapedirs) + return SMPLOutput(vertices=v_shaped, betas=betas, v_shaped=v_shaped) + + def forward( + self, + betas: Optional[Tensor] = None, + body_pose: Optional[Tensor] = None, + global_orient: Optional[Tensor] = None, + transl: Optional[Tensor] = None, + return_verts=True, + return_full_pose: bool = False, + pose2rot: bool = True, + **kwargs + ) -> SMPLOutput: + ''' Forward pass for the SMPL model + + Parameters + ---------- + global_orient: torch.tensor, optional, shape Bx3 + If given, ignore the member variable and use it as the global + rotation of the body. Useful if someone wishes to predicts this + with an external model. (default=None) + betas: torch.tensor, optional, shape BxN_b + If given, ignore the member variable `betas` and use it + instead. For example, it can used if shape parameters + `betas` are predicted from some external model. + (default=None) + body_pose: torch.tensor, optional, shape Bx(J*3) + If given, ignore the member variable `body_pose` and use it + instead. For example, it can used if someone predicts the + pose of the body joints are predicted from some external model. + It should be a tensor that contains joint rotations in + axis-angle format. (default=None) + transl: torch.tensor, optional, shape Bx3 + If given, ignore the member variable `transl` and use it + instead. For example, it can used if the translation + `transl` is predicted from some external model. + (default=None) + return_verts: bool, optional + Return the vertices. (default=True) + return_full_pose: bool, optional + Returns the full axis-angle pose vector (default=False) + + Returns + ------- + ''' + # If no shape and pose parameters are passed along, then use the + # ones from the module + global_orient = (global_orient if global_orient is not None else + self.global_orient) + body_pose = body_pose if body_pose is not None else self.body_pose + betas = betas if betas is not None else self.betas + + apply_trans = transl is not None or hasattr(self, 'transl') + if transl is None and hasattr(self, 'transl'): + transl = self.transl + + full_pose = torch.cat([global_orient, body_pose], dim=1) + + batch_size = max(betas.shape[0], global_orient.shape[0], + body_pose.shape[0]) + + if betas.shape[0] != batch_size: + num_repeats = int(batch_size / betas.shape[0]) + betas = betas.expand(num_repeats, -1) + + vertices, joints, A = lbs(betas, full_pose, self.v_template, + self.shapedirs, self.posedirs, + self.J_regressor, self.parents, + self.lbs_weights, pose2rot=pose2rot, + return_affine_mat = True) + + joints = self.vertex_joint_selector(vertices, joints) + # Map the joints to the current dataset + if self.joint_mapper is not None: + joints = self.joint_mapper(joints) + + if apply_trans: + joints += transl.unsqueeze(dim=1) + vertices += transl.unsqueeze(dim=1) + A[:, :, :3, 3] += transl.unsqueeze(dim=1) + + output = SMPLOutput(vertices=vertices if return_verts else None, + global_orient=global_orient, + body_pose=body_pose, + joints=joints, + betas=betas, + full_pose=full_pose if return_full_pose else None, + A = A) + + return output + + +class SMPLLayer(SMPL): + def __init__( + self, + *args, + **kwargs + ) -> None: + # Just create a SMPL module without any member variables + super(SMPLLayer, self).__init__( + create_body_pose=False, + create_betas=False, + create_global_orient=False, + create_transl=False, + *args, + **kwargs, + ) + + def forward( + self, + betas: Optional[Tensor] = None, + body_pose: Optional[Tensor] = None, + global_orient: Optional[Tensor] = None, + transl: Optional[Tensor] = None, + return_verts=True, + return_full_pose: bool = False, + pose2rot: bool = True, + **kwargs + ) -> SMPLOutput: + ''' Forward pass for the SMPL model + + Parameters + ---------- + global_orient: torch.tensor, optional, shape Bx3x3 + Global rotation of the body. Useful if someone wishes to + predicts this with an external model. It is expected to be in + rotation matrix format. (default=None) + betas: torch.tensor, optional, shape BxN_b + Shape parameters. For example, it can used if shape parameters + `betas` are predicted from some external model. + (default=None) + body_pose: torch.tensor, optional, shape BxJx3x3 + Body pose. For example, it can used if someone predicts the + pose of the body joints are predicted from some external model. + It should be a tensor that contains joint rotations in + rotation matrix format. (default=None) + transl: torch.tensor, optional, shape Bx3 + Translation vector of the body. + For example, it can used if the translation + `transl` is predicted from some external model. + (default=None) + return_verts: bool, optional + Return the vertices. (default=True) + return_full_pose: bool, optional + Returns the full axis-angle pose vector (default=False) + + Returns + ------- + ''' + model_vars = [betas, global_orient, body_pose, transl] + batch_size = 1 + for var in model_vars: + if var is None: + continue + batch_size = max(batch_size, len(var)) + device, dtype = self.shapedirs.device, self.shapedirs.dtype + if global_orient is None: + global_orient = torch.eye(3, device=device, dtype=dtype).view( + 1, 1, 3, 3).expand(batch_size, -1, -1, -1).contiguous() + if body_pose is None: + body_pose = torch.eye(3, device=device, dtype=dtype).view( + 1, 1, 3, 3).expand( + batch_size, self.NUM_BODY_JOINTS, -1, -1).contiguous() + if betas is None: + betas = torch.zeros([batch_size, self.num_betas], + dtype=dtype, device=device) + if transl is None: + transl = torch.zeros([batch_size, 3], dtype=dtype, device=device) + full_pose = torch.cat( + [global_orient.reshape(-1, 1, 3, 3), + body_pose.reshape(-1, self.NUM_BODY_JOINTS, 3, 3)], + dim=1) + + vertices, joints = lbs(betas, full_pose, self.v_template, + self.shapedirs, self.posedirs, + self.J_regressor, self.parents, + self.lbs_weights, + pose2rot=False) + + joints = self.vertex_joint_selector(vertices, joints) + # Map the joints to the current dataset + if self.joint_mapper is not None: + joints = self.joint_mapper(joints) + + if transl is not None: + joints += transl.unsqueeze(dim=1) + vertices += transl.unsqueeze(dim=1) + + output = SMPLOutput(vertices=vertices if return_verts else None, + global_orient=global_orient, + body_pose=body_pose, + joints=joints, + betas=betas, + full_pose=full_pose if return_full_pose else None) + + return output + + +class SMPLH(SMPL): + + # The hand joints are replaced by MANO + NUM_BODY_JOINTS = SMPL.NUM_JOINTS - 2 + NUM_HAND_JOINTS = 15 + NUM_JOINTS = NUM_BODY_JOINTS + 2 * NUM_HAND_JOINTS + + def __init__( + self, model_path, + kid_template_path: str = '', + data_struct: Optional[Struct] = None, + create_left_hand_pose: bool = True, + left_hand_pose: Optional[Tensor] = None, + create_right_hand_pose: bool = True, + right_hand_pose: Optional[Tensor] = None, + use_pca: bool = True, + num_pca_comps: int = 6, + flat_hand_mean: bool = False, + batch_size: int = 1, + gender: str = 'neutral', + age: str = 'adult', + dtype=torch.float32, + vertex_ids=None, + use_compressed: bool = True, + ext: str = 'pkl', + **kwargs + ) -> None: + ''' SMPLH model constructor + + Parameters + ---------- + model_path: str + The path to the folder or to the file where the model + parameters are stored + data_struct: Strct + A struct object. If given, then the parameters of the model are + read from the object. Otherwise, the model tries to read the + parameters from the given `model_path`. (default = None) + create_left_hand_pose: bool, optional + Flag for creating a member variable for the pose of the left + hand. (default = True) + left_hand_pose: torch.tensor, optional, BxP + The default value for the left hand pose member variable. + (default = None) + create_right_hand_pose: bool, optional + Flag for creating a member variable for the pose of the right + hand. (default = True) + right_hand_pose: torch.tensor, optional, BxP + The default value for the right hand pose member variable. + (default = None) + num_pca_comps: int, optional + The number of PCA components to use for each hand. + (default = 6) + flat_hand_mean: bool, optional + If False, then the pose of the hand is initialized to False. + batch_size: int, optional + The batch size used for creating the member variables + gender: str, optional + Which gender to load + dtype: torch.dtype, optional + The data type for the created variables + vertex_ids: dict, optional + A dictionary containing the indices of the extra vertices that + will be selected + ''' + + self.num_pca_comps = num_pca_comps + # If no data structure is passed, then load the data from the given + # model folder + if data_struct is None: + # Load the model + if osp.isdir(model_path): + model_fn = 'SMPLH_{}.{ext}'.format(gender.upper(), ext=ext) + smplh_path = os.path.join(model_path, model_fn) + else: + smplh_path = model_path + assert osp.exists(smplh_path), 'Path {} does not exist!'.format( + smplh_path) + + if ext == 'pkl': + with open(smplh_path, 'rb') as smplh_file: + model_data = pickle.load(smplh_file, encoding='latin1') + elif ext == 'npz': + model_data = np.load(smplh_path, allow_pickle=True) + else: + raise ValueError('Unknown extension: {}'.format(ext)) + data_struct = Struct(**model_data) + + if vertex_ids is None: + vertex_ids = VERTEX_IDS['smplh'] + + super(SMPLH, self).__init__( + model_path=model_path, + kid_template_path=kid_template_path, + data_struct=data_struct, + batch_size=batch_size, vertex_ids=vertex_ids, gender=gender, age=age, + use_compressed=use_compressed, dtype=dtype, ext=ext, **kwargs) + + self.use_pca = use_pca + self.num_pca_comps = num_pca_comps + self.flat_hand_mean = flat_hand_mean + + left_hand_components = data_struct.hands_componentsl[:num_pca_comps] + right_hand_components = data_struct.hands_componentsr[:num_pca_comps] + + self.np_left_hand_components = left_hand_components + self.np_right_hand_components = right_hand_components + if self.use_pca: + self.register_buffer( + 'left_hand_components', + torch.tensor(left_hand_components, dtype=dtype)) + self.register_buffer( + 'right_hand_components', + torch.tensor(right_hand_components, dtype=dtype)) + + if self.flat_hand_mean: + left_hand_mean = np.zeros_like(data_struct.hands_meanl) + else: + left_hand_mean = data_struct.hands_meanl + + if self.flat_hand_mean: + right_hand_mean = np.zeros_like(data_struct.hands_meanr) + else: + right_hand_mean = data_struct.hands_meanr + + self.register_buffer('left_hand_mean', + to_tensor(left_hand_mean, dtype=self.dtype)) + self.register_buffer('right_hand_mean', + to_tensor(right_hand_mean, dtype=self.dtype)) + + # Create the buffers for the pose of the left hand + hand_pose_dim = num_pca_comps if use_pca else 3 * self.NUM_HAND_JOINTS + if create_left_hand_pose: + if left_hand_pose is None: + default_lhand_pose = torch.zeros([batch_size, hand_pose_dim], + dtype=dtype) + else: + default_lhand_pose = torch.tensor(left_hand_pose, dtype=dtype) + + left_hand_pose_param = nn.Parameter(default_lhand_pose, + requires_grad=True) + self.register_parameter('left_hand_pose', + left_hand_pose_param) + + if create_right_hand_pose: + if right_hand_pose is None: + default_rhand_pose = torch.zeros([batch_size, hand_pose_dim], + dtype=dtype) + else: + default_rhand_pose = torch.tensor(right_hand_pose, dtype=dtype) + + right_hand_pose_param = nn.Parameter(default_rhand_pose, + requires_grad=True) + self.register_parameter('right_hand_pose', + right_hand_pose_param) + + # Create the buffer for the mean pose. + pose_mean_tensor = self.create_mean_pose( + data_struct, flat_hand_mean=flat_hand_mean) + if not torch.is_tensor(pose_mean_tensor): + pose_mean_tensor = torch.tensor(pose_mean_tensor, dtype=dtype) + self.register_buffer('pose_mean', pose_mean_tensor) + + def create_mean_pose(self, data_struct, flat_hand_mean=False): + # Create the array for the mean pose. If flat_hand is false, then use + # the mean that is given by the data, rather than the flat open hand + global_orient_mean = torch.zeros([3], dtype=self.dtype) + body_pose_mean = torch.zeros([self.NUM_BODY_JOINTS * 3], + dtype=self.dtype) + + pose_mean = torch.cat([global_orient_mean, body_pose_mean, + self.left_hand_mean, + self.right_hand_mean], dim=0) + return pose_mean + + def name(self) -> str: + return 'SMPL+H' + + def extra_repr(self): + msg = super(SMPLH, self).extra_repr() + msg = [msg] + if self.use_pca: + msg.append(f'Number of PCA components: {self.num_pca_comps}') + msg.append(f'Flat hand mean: {self.flat_hand_mean}') + return '\n'.join(msg) + + def forward( + self, + betas: Optional[Tensor] = None, + global_orient: Optional[Tensor] = None, + body_pose: Optional[Tensor] = None, + left_hand_pose: Optional[Tensor] = None, + right_hand_pose: Optional[Tensor] = None, + transl: Optional[Tensor] = None, + return_verts: bool = True, + return_full_pose: bool = False, + pose2rot: bool = True, + **kwargs + ) -> SMPLHOutput: + ''' + ''' + + # If no shape and pose parameters are passed along, then use the + # ones from the module + global_orient = (global_orient if global_orient is not None else + self.global_orient) + body_pose = body_pose if body_pose is not None else self.body_pose + betas = betas if betas is not None else self.betas + left_hand_pose = (left_hand_pose if left_hand_pose is not None else + self.left_hand_pose) + right_hand_pose = (right_hand_pose if right_hand_pose is not None else + self.right_hand_pose) + + apply_trans = transl is not None or hasattr(self, 'transl') + if transl is None: + if hasattr(self, 'transl'): + transl = self.transl + + if self.use_pca: + left_hand_pose = torch.einsum( + 'bi,ij->bj', [left_hand_pose, self.left_hand_components]) + right_hand_pose = torch.einsum( + 'bi,ij->bj', [right_hand_pose, self.right_hand_components]) + + full_pose = torch.cat([global_orient, body_pose, + left_hand_pose, + right_hand_pose], dim=1) + full_pose += self.pose_mean + + vertices, joints = lbs(betas, full_pose, self.v_template, + self.shapedirs, self.posedirs, + self.J_regressor, self.parents, + self.lbs_weights, pose2rot=pose2rot) + + # Add any extra joints that might be needed + joints = self.vertex_joint_selector(vertices, joints) + if self.joint_mapper is not None: + joints = self.joint_mapper(joints) + + if apply_trans: + joints += transl.unsqueeze(dim=1) + vertices += transl.unsqueeze(dim=1) + + output = SMPLHOutput(vertices=vertices if return_verts else None, + joints=joints, + betas=betas, + global_orient=global_orient, + body_pose=body_pose, + left_hand_pose=left_hand_pose, + right_hand_pose=right_hand_pose, + full_pose=full_pose if return_full_pose else None) + + return output + + +class SMPLHLayer(SMPLH): + + def __init__( + self, *args, **kwargs + ) -> None: + ''' SMPL+H as a layer model constructor + ''' + super(SMPLHLayer, self).__init__( + create_global_orient=False, + create_body_pose=False, + create_left_hand_pose=False, + create_right_hand_pose=False, + create_betas=False, + create_transl=False, + *args, + **kwargs) + + def forward( + self, + betas: Optional[Tensor] = None, + global_orient: Optional[Tensor] = None, + body_pose: Optional[Tensor] = None, + left_hand_pose: Optional[Tensor] = None, + right_hand_pose: Optional[Tensor] = None, + transl: Optional[Tensor] = None, + return_verts: bool = True, + return_full_pose: bool = False, + pose2rot: bool = True, + **kwargs + ) -> SMPLHOutput: + ''' Forward pass for the SMPL+H model + + Parameters + ---------- + global_orient: torch.tensor, optional, shape Bx3x3 + Global rotation of the body. Useful if someone wishes to + predicts this with an external model. It is expected to be in + rotation matrix format. (default=None) + betas: torch.tensor, optional, shape BxN_b + Shape parameters. For example, it can used if shape parameters + `betas` are predicted from some external model. + (default=None) + body_pose: torch.tensor, optional, shape BxJx3x3 + If given, ignore the member variable `body_pose` and use it + instead. For example, it can used if someone predicts the + pose of the body joints are predicted from some external model. + It should be a tensor that contains joint rotations in + rotation matrix format. (default=None) + left_hand_pose: torch.tensor, optional, shape Bx15x3x3 + If given, contains the pose of the left hand. + It should be a tensor that contains joint rotations in + rotation matrix format. (default=None) + right_hand_pose: torch.tensor, optional, shape Bx15x3x3 + If given, contains the pose of the right hand. + It should be a tensor that contains joint rotations in + rotation matrix format. (default=None) + transl: torch.tensor, optional, shape Bx3 + Translation vector of the body. + For example, it can used if the translation + `transl` is predicted from some external model. + (default=None) + return_verts: bool, optional + Return the vertices. (default=True) + return_full_pose: bool, optional + Returns the full axis-angle pose vector (default=False) + + Returns + ------- + ''' + model_vars = [betas, global_orient, body_pose, transl, left_hand_pose, + right_hand_pose] + batch_size = 1 + for var in model_vars: + if var is None: + continue + batch_size = max(batch_size, len(var)) + device, dtype = self.shapedirs.device, self.shapedirs.dtype + if global_orient is None: + global_orient = torch.eye(3, device=device, dtype=dtype).view( + 1, 1, 3, 3).expand(batch_size, -1, -1, -1).contiguous() + if body_pose is None: + body_pose = torch.eye(3, device=device, dtype=dtype).view( + 1, 1, 3, 3).expand(batch_size, 21, -1, -1).contiguous() + if left_hand_pose is None: + left_hand_pose = torch.eye(3, device=device, dtype=dtype).view( + 1, 1, 3, 3).expand(batch_size, 15, -1, -1).contiguous() + if right_hand_pose is None: + right_hand_pose = torch.eye(3, device=device, dtype=dtype).view( + 1, 1, 3, 3).expand(batch_size, 15, -1, -1).contiguous() + if betas is None: + betas = torch.zeros([batch_size, self.num_betas], + dtype=dtype, device=device) + if transl is None: + transl = torch.zeros([batch_size, 3], dtype=dtype, device=device) + + # Concatenate all pose vectors + full_pose = torch.cat( + [global_orient.reshape(-1, 1, 3, 3), + body_pose.reshape(-1, self.NUM_BODY_JOINTS, 3, 3), + left_hand_pose.reshape(-1, self.NUM_HAND_JOINTS, 3, 3), + right_hand_pose.reshape(-1, self.NUM_HAND_JOINTS, 3, 3)], + dim=1) + + vertices, joints = lbs(betas, full_pose, self.v_template, + self.shapedirs, self.posedirs, + self.J_regressor, self.parents, + self.lbs_weights, pose2rot=False) + + # Add any extra joints that might be needed + joints = self.vertex_joint_selector(vertices, joints) + if self.joint_mapper is not None: + joints = self.joint_mapper(joints) + + if transl is not None: + joints += transl.unsqueeze(dim=1) + vertices += transl.unsqueeze(dim=1) + + output = SMPLHOutput(vertices=vertices if return_verts else None, + joints=joints, + betas=betas, + global_orient=global_orient, + body_pose=body_pose, + left_hand_pose=left_hand_pose, + right_hand_pose=right_hand_pose, + full_pose=full_pose if return_full_pose else None) + + return output + + +class SMPLX(SMPLH): + ''' + SMPL-X (SMPL eXpressive) is a unified body model, with shape parameters + trained jointly for the face, hands and body. + SMPL-X uses standard vertex based linear blend skinning with learned + corrective blend shapes, has N=10475 vertices and K=54 joints, + which includes joints for the neck, jaw, eyeballs and fingers. + ''' + + NUM_BODY_JOINTS = SMPLH.NUM_BODY_JOINTS + NUM_HAND_JOINTS = 15 + NUM_FACE_JOINTS = 3 + NUM_JOINTS = NUM_BODY_JOINTS + 2 * NUM_HAND_JOINTS + NUM_FACE_JOINTS + EXPRESSION_SPACE_DIM = 100 + NECK_IDX = 12 + + def __init__( + self, model_path: str, + kid_template_path: str = '', + num_expression_coeffs: int = 10, + create_expression: bool = True, + expression: Optional[Tensor] = None, + create_jaw_pose: bool = True, + jaw_pose: Optional[Tensor] = None, + create_leye_pose: bool = True, + leye_pose: Optional[Tensor] = None, + create_reye_pose=True, + reye_pose: Optional[Tensor] = None, + use_face_contour: bool = False, + batch_size: int = 1, + gender: str = 'neutral', + age: str = 'adult', + dtype=torch.float32, + ext: str = 'npz', + **kwargs + ) -> None: + ''' SMPLX model constructor + + Parameters + ---------- + model_path: str + The path to the folder or to the file where the model + parameters are stored + num_expression_coeffs: int, optional + Number of expression components to use + (default = 10). + create_expression: bool, optional + Flag for creating a member variable for the expression space + (default = True). + expression: torch.tensor, optional, Bx10 + The default value for the expression member variable. + (default = None) + create_jaw_pose: bool, optional + Flag for creating a member variable for the jaw pose. + (default = False) + jaw_pose: torch.tensor, optional, Bx3 + The default value for the jaw pose variable. + (default = None) + create_leye_pose: bool, optional + Flag for creating a member variable for the left eye pose. + (default = False) + leye_pose: torch.tensor, optional, Bx10 + The default value for the left eye pose variable. + (default = None) + create_reye_pose: bool, optional + Flag for creating a member variable for the right eye pose. + (default = False) + reye_pose: torch.tensor, optional, Bx10 + The default value for the right eye pose variable. + (default = None) + use_face_contour: bool, optional + Whether to compute the keypoints that form the facial contour + batch_size: int, optional + The batch size used for creating the member variables + gender: str, optional + Which gender to load + dtype: torch.dtype + The data type for the created variables + ''' + + # Load the model + if osp.isdir(model_path): + model_fn = 'SMPLX_{}.{ext}'.format(gender.upper(), ext=ext) + smplx_path = os.path.join(model_path, model_fn) + else: + smplx_path = model_path + assert osp.exists(smplx_path), 'Path {} does not exist!'.format( + smplx_path) + + if ext == 'pkl': + with open(smplx_path, 'rb') as smplx_file: + model_data = pickle.load(smplx_file, encoding='latin1') + elif ext == 'npz': + model_data = np.load(smplx_path, allow_pickle=True) + else: + raise ValueError('Unknown extension: {}'.format(ext)) + + data_struct = Struct(**model_data) + + super(SMPLX, self).__init__( + model_path=model_path, + kid_template_path=kid_template_path, + data_struct=data_struct, + dtype=dtype, + batch_size=batch_size, + vertex_ids=VERTEX_IDS['smplx'], + gender=gender, age=age, ext=ext, + **kwargs) + + lmk_faces_idx = data_struct.lmk_faces_idx + self.register_buffer('lmk_faces_idx', + torch.tensor(lmk_faces_idx, dtype=torch.long)) + lmk_bary_coords = data_struct.lmk_bary_coords + self.register_buffer('lmk_bary_coords', + torch.tensor(lmk_bary_coords, dtype=dtype)) + + self.use_face_contour = use_face_contour + if self.use_face_contour: + dynamic_lmk_faces_idx = data_struct.dynamic_lmk_faces_idx + dynamic_lmk_faces_idx = torch.tensor( + dynamic_lmk_faces_idx, + dtype=torch.long) + self.register_buffer('dynamic_lmk_faces_idx', + dynamic_lmk_faces_idx) + + dynamic_lmk_bary_coords = data_struct.dynamic_lmk_bary_coords + dynamic_lmk_bary_coords = torch.tensor( + dynamic_lmk_bary_coords, dtype=dtype) + self.register_buffer('dynamic_lmk_bary_coords', + dynamic_lmk_bary_coords) + + neck_kin_chain = find_joint_kin_chain(self.NECK_IDX, self.parents) + self.register_buffer( + 'neck_kin_chain', + torch.tensor(neck_kin_chain, dtype=torch.long)) + + if create_jaw_pose: + if jaw_pose is None: + default_jaw_pose = torch.zeros([batch_size, 3], dtype=dtype) + else: + default_jaw_pose = torch.tensor(jaw_pose, dtype=dtype) + jaw_pose_param = nn.Parameter(default_jaw_pose, + requires_grad=True) + self.register_parameter('jaw_pose', jaw_pose_param) + + if create_leye_pose: + if leye_pose is None: + default_leye_pose = torch.zeros([batch_size, 3], dtype=dtype) + else: + default_leye_pose = torch.tensor(leye_pose, dtype=dtype) + leye_pose_param = nn.Parameter(default_leye_pose, + requires_grad=True) + self.register_parameter('leye_pose', leye_pose_param) + + if create_reye_pose: + if reye_pose is None: + default_reye_pose = torch.zeros([batch_size, 3], dtype=dtype) + else: + default_reye_pose = torch.tensor(reye_pose, dtype=dtype) + reye_pose_param = nn.Parameter(default_reye_pose, + requires_grad=True) + self.register_parameter('reye_pose', reye_pose_param) + + shapedirs = data_struct.shapedirs + if len(shapedirs.shape) < 3: + shapedirs = shapedirs[:, :, None] + if (shapedirs.shape[-1] < self.SHAPE_SPACE_DIM + + self.EXPRESSION_SPACE_DIM): + print(f'WARNING: You are using a {self.name()} model, with only' + ' 10 shape and 10 expression coefficients.') + expr_start_idx = 10 + expr_end_idx = 20 + num_expression_coeffs = min(num_expression_coeffs, 10) + else: + expr_start_idx = self.SHAPE_SPACE_DIM + expr_end_idx = self.SHAPE_SPACE_DIM + num_expression_coeffs + num_expression_coeffs = min( + num_expression_coeffs, self.EXPRESSION_SPACE_DIM) + + self._num_expression_coeffs = num_expression_coeffs + + expr_dirs = shapedirs[:, :, expr_start_idx:expr_end_idx] + self.register_buffer( + 'expr_dirs', to_tensor(to_np(expr_dirs), dtype=dtype)) + + if create_expression: + if expression is None: + default_expression = torch.zeros( + [batch_size, self.num_expression_coeffs], dtype=dtype) + else: + default_expression = torch.tensor(expression, dtype=dtype) + expression_param = nn.Parameter(default_expression, + requires_grad=True) + self.register_parameter('expression', expression_param) + + def name(self) -> str: + return 'SMPL-X' + + @property + def num_expression_coeffs(self): + return self._num_expression_coeffs + + def create_mean_pose(self, data_struct, flat_hand_mean=False): + # Create the array for the mean pose. If flat_hand is false, then use + # the mean that is given by the data, rather than the flat open hand + global_orient_mean = torch.zeros([3], dtype=self.dtype) + body_pose_mean = torch.zeros([self.NUM_BODY_JOINTS * 3], + dtype=self.dtype) + jaw_pose_mean = torch.zeros([3], dtype=self.dtype) + leye_pose_mean = torch.zeros([3], dtype=self.dtype) + reye_pose_mean = torch.zeros([3], dtype=self.dtype) + + pose_mean = np.concatenate([global_orient_mean, body_pose_mean, + jaw_pose_mean, + leye_pose_mean, reye_pose_mean, + self.left_hand_mean, self.right_hand_mean], + axis=0) + + return pose_mean + + def extra_repr(self): + msg = super(SMPLX, self).extra_repr() + msg = [ + msg, + f'Number of Expression Coefficients: {self.num_expression_coeffs}' + ] + return '\n'.join(msg) + + def forward( + self, + betas: Optional[Tensor] = None, + global_orient: Optional[Tensor] = None, + body_pose: Optional[Tensor] = None, + left_hand_pose: Optional[Tensor] = None, + right_hand_pose: Optional[Tensor] = None, + transl: Optional[Tensor] = None, + expression: Optional[Tensor] = None, + jaw_pose: Optional[Tensor] = None, + leye_pose: Optional[Tensor] = None, + reye_pose: Optional[Tensor] = None, + return_verts: bool = True, + return_full_pose: bool = False, + pose2rot: bool = True, + return_shaped: bool = True, + **kwargs + ) -> SMPLXOutput: + ''' + Forward pass for the SMPLX model + + Parameters + ---------- + global_orient: torch.tensor, optional, shape Bx3 + If given, ignore the member variable and use it as the global + rotation of the body. Useful if someone wishes to predicts this + with an external model. (default=None) + betas: torch.tensor, optional, shape BxN_b + If given, ignore the member variable `betas` and use it + instead. For example, it can used if shape parameters + `betas` are predicted from some external model. + (default=None) + expression: torch.tensor, optional, shape BxN_e + If given, ignore the member variable `expression` and use it + instead. For example, it can used if expression parameters + `expression` are predicted from some external model. + body_pose: torch.tensor, optional, shape Bx(J*3) + If given, ignore the member variable `body_pose` and use it + instead. For example, it can used if someone predicts the + pose of the body joints are predicted from some external model. + It should be a tensor that contains joint rotations in + axis-angle format. (default=None) + left_hand_pose: torch.tensor, optional, shape BxP + If given, ignore the member variable `left_hand_pose` and + use this instead. It should either contain PCA coefficients or + joint rotations in axis-angle format. + right_hand_pose: torch.tensor, optional, shape BxP + If given, ignore the member variable `right_hand_pose` and + use this instead. It should either contain PCA coefficients or + joint rotations in axis-angle format. + jaw_pose: torch.tensor, optional, shape Bx3 + If given, ignore the member variable `jaw_pose` and + use this instead. It should either joint rotations in + axis-angle format. + transl: torch.tensor, optional, shape Bx3 + If given, ignore the member variable `transl` and use it + instead. For example, it can used if the translation + `transl` is predicted from some external model. + (default=None) + return_verts: bool, optional + Return the vertices. (default=True) + return_full_pose: bool, optional + Returns the full axis-angle pose vector (default=False) + + Returns + ------- + output: ModelOutput + A named tuple of type `ModelOutput` + ''' + + # If no shape and pose parameters are passed along, then use the + # ones from the module + global_orient = (global_orient if global_orient is not None else + self.global_orient) + body_pose = body_pose if body_pose is not None else self.body_pose + betas = betas if betas is not None else self.betas + + left_hand_pose = (left_hand_pose if left_hand_pose is not None else + self.left_hand_pose) + right_hand_pose = (right_hand_pose if right_hand_pose is not None else + self.right_hand_pose) + jaw_pose = jaw_pose if jaw_pose is not None else self.jaw_pose + leye_pose = leye_pose if leye_pose is not None else self.leye_pose + reye_pose = reye_pose if reye_pose is not None else self.reye_pose + expression = expression if expression is not None else self.expression + + apply_trans = transl is not None or hasattr(self, 'transl') + if transl is None: + if hasattr(self, 'transl'): + transl = self.transl + + if self.use_pca: + left_hand_pose = torch.einsum( + 'bi,ij->bj', [left_hand_pose, self.left_hand_components]) + right_hand_pose = torch.einsum( + 'bi,ij->bj', [right_hand_pose, self.right_hand_components]) + + full_pose = torch.cat([global_orient.reshape(-1, 1, 3), + body_pose.reshape(-1, self.NUM_BODY_JOINTS, 3), + jaw_pose.reshape(-1, 1, 3), + leye_pose.reshape(-1, 1, 3), + reye_pose.reshape(-1, 1, 3), + left_hand_pose.reshape(-1, 15, 3), + right_hand_pose.reshape(-1, 15, 3)], + dim=1).reshape(-1, 165) + + # Add the mean pose of the model. Does not affect the body, only the + # hands when flat_hand_mean == False + full_pose += self.pose_mean + + batch_size = max(betas.shape[0], global_orient.shape[0], + body_pose.shape[0]) + # Concatenate the shape and expression coefficients + scale = int(batch_size / betas.shape[0]) + if scale > 1: + betas = betas.expand(scale, -1) + shape_components = torch.cat([betas, expression], dim=-1) + + shapedirs = torch.cat([self.shapedirs, self.expr_dirs], dim=-1) + + vertices, joints, A = lbs(shape_components, full_pose, self.v_template, + shapedirs, self.posedirs, + self.J_regressor, self.parents, + self.lbs_weights, pose2rot=pose2rot, + return_affine_mat = True) + + lmk_faces_idx = self.lmk_faces_idx.unsqueeze( + dim=0).expand(batch_size, -1).contiguous() + lmk_bary_coords = self.lmk_bary_coords.unsqueeze(dim=0).repeat( + self.batch_size, 1, 1) + if self.use_face_contour: + lmk_idx_and_bcoords = find_dynamic_lmk_idx_and_bcoords( + vertices, full_pose, self.dynamic_lmk_faces_idx, + self.dynamic_lmk_bary_coords, + self.neck_kin_chain, + pose2rot=True, + ) + dyn_lmk_faces_idx, dyn_lmk_bary_coords = lmk_idx_and_bcoords + + lmk_faces_idx = torch.cat([lmk_faces_idx, + dyn_lmk_faces_idx], 1) + lmk_bary_coords = torch.cat( + [lmk_bary_coords.expand(batch_size, -1, -1), + dyn_lmk_bary_coords], 1) + + landmarks = vertices2landmarks(vertices, self.faces_tensor, + lmk_faces_idx, + lmk_bary_coords) + + # Add any extra joints that might be needed + joints = self.vertex_joint_selector(vertices, joints) + # Add the landmarks to the joints + joints = torch.cat([joints, landmarks], dim=1) + # Map the joints to the current dataset + + if self.joint_mapper is not None: + joints = self.joint_mapper(joints=joints, vertices=vertices) + + if apply_trans: + joints += transl.unsqueeze(dim=1) + vertices += transl.unsqueeze(dim=1) + A[:, :, :3, 3] += transl.unsqueeze(dim=1) + + v_shaped = None + if return_shaped: + v_shaped = self.v_template + blend_shapes(betas, self.shapedirs) + output = SMPLXOutput(vertices=vertices if return_verts else None, + joints=joints, + betas=betas, + expression=expression, + global_orient=global_orient, + body_pose=body_pose, + left_hand_pose=left_hand_pose, + right_hand_pose=right_hand_pose, + jaw_pose=jaw_pose, + v_shaped=v_shaped, + full_pose=full_pose if return_full_pose else None, + A = A) + return output + + +class SMPLXLayer(SMPLX): + def __init__( + self, + *args, + **kwargs + ) -> None: + # Just create a SMPLX module without any member variables + super(SMPLXLayer, self).__init__( + create_global_orient=False, + create_body_pose=False, + create_left_hand_pose=False, + create_right_hand_pose=False, + create_jaw_pose=False, + create_leye_pose=False, + create_reye_pose=False, + create_betas=False, + create_expression=False, + create_transl=False, + *args, **kwargs, + ) + + def forward( + self, + betas: Optional[Tensor] = None, + global_orient: Optional[Tensor] = None, + body_pose: Optional[Tensor] = None, + left_hand_pose: Optional[Tensor] = None, + right_hand_pose: Optional[Tensor] = None, + transl: Optional[Tensor] = None, + expression: Optional[Tensor] = None, + jaw_pose: Optional[Tensor] = None, + leye_pose: Optional[Tensor] = None, + reye_pose: Optional[Tensor] = None, + return_verts: bool = True, + return_full_pose: bool = False, + **kwargs + ) -> SMPLXOutput: + ''' + Forward pass for the SMPLX model + + Parameters + ---------- + global_orient: torch.tensor, optional, shape Bx3x3 + If given, ignore the member variable and use it as the global + rotation of the body. Useful if someone wishes to predicts this + with an external model. It is expected to be in rotation matrix + format. (default=None) + betas: torch.tensor, optional, shape BxN_b + If given, ignore the member variable `betas` and use it + instead. For example, it can used if shape parameters + `betas` are predicted from some external model. + (default=None) + expression: torch.tensor, optional, shape BxN_e + Expression coefficients. + For example, it can used if expression parameters + `expression` are predicted from some external model. + body_pose: torch.tensor, optional, shape BxJx3x3 + If given, ignore the member variable `body_pose` and use it + instead. For example, it can used if someone predicts the + pose of the body joints are predicted from some external model. + It should be a tensor that contains joint rotations in + rotation matrix format. (default=None) + left_hand_pose: torch.tensor, optional, shape Bx15x3x3 + If given, contains the pose of the left hand. + It should be a tensor that contains joint rotations in + rotation matrix format. (default=None) + right_hand_pose: torch.tensor, optional, shape Bx15x3x3 + If given, contains the pose of the right hand. + It should be a tensor that contains joint rotations in + rotation matrix format. (default=None) + jaw_pose: torch.tensor, optional, shape Bx3x3 + Jaw pose. It should either joint rotations in + rotation matrix format. + transl: torch.tensor, optional, shape Bx3 + Translation vector of the body. + For example, it can used if the translation + `transl` is predicted from some external model. + (default=None) + return_verts: bool, optional + Return the vertices. (default=True) + return_full_pose: bool, optional + Returns the full pose vector (default=False) + Returns + ------- + output: ModelOutput + A data class that contains the posed vertices and joints + ''' + device, dtype = self.shapedirs.device, self.shapedirs.dtype + + model_vars = [betas, global_orient, body_pose, transl, + expression, left_hand_pose, right_hand_pose, jaw_pose] + batch_size = 1 + for var in model_vars: + if var is None: + continue + batch_size = max(batch_size, len(var)) + + if global_orient is None: + global_orient = torch.eye(3, device=device, dtype=dtype).view( + 1, 1, 3, 3).expand(batch_size, -1, -1, -1).contiguous() + if body_pose is None: + body_pose = torch.eye(3, device=device, dtype=dtype).view( + 1, 1, 3, 3).expand( + batch_size, self.NUM_BODY_JOINTS, -1, -1).contiguous() + if left_hand_pose is None: + left_hand_pose = torch.eye(3, device=device, dtype=dtype).view( + 1, 1, 3, 3).expand(batch_size, 15, -1, -1).contiguous() + if right_hand_pose is None: + right_hand_pose = torch.eye(3, device=device, dtype=dtype).view( + 1, 1, 3, 3).expand(batch_size, 15, -1, -1).contiguous() + if jaw_pose is None: + jaw_pose = torch.eye(3, device=device, dtype=dtype).view( + 1, 1, 3, 3).expand(batch_size, -1, -1, -1).contiguous() + if leye_pose is None: + leye_pose = torch.eye(3, device=device, dtype=dtype).view( + 1, 1, 3, 3).expand(batch_size, -1, -1, -1).contiguous() + if reye_pose is None: + reye_pose = torch.eye(3, device=device, dtype=dtype).view( + 1, 1, 3, 3).expand(batch_size, -1, -1, -1).contiguous() + if expression is None: + expression = torch.zeros([batch_size, self.num_expression_coeffs], + dtype=dtype, device=device) + if betas is None: + betas = torch.zeros([batch_size, self.num_betas], + dtype=dtype, device=device) + if transl is None: + transl = torch.zeros([batch_size, 3], dtype=dtype, device=device) + + # Concatenate all pose vectors + full_pose = torch.cat( + [global_orient.reshape(-1, 1, 3, 3), + body_pose.reshape(-1, self.NUM_BODY_JOINTS, 3, 3), + jaw_pose.reshape(-1, 1, 3, 3), + leye_pose.reshape(-1, 1, 3, 3), + reye_pose.reshape(-1, 1, 3, 3), + left_hand_pose.reshape(-1, self.NUM_HAND_JOINTS, 3, 3), + right_hand_pose.reshape(-1, self.NUM_HAND_JOINTS, 3, 3)], + dim=1) + shape_components = torch.cat([betas, expression], dim=-1) + + shapedirs = torch.cat([self.shapedirs, self.expr_dirs], dim=-1) + + vertices, joints = lbs(shape_components, full_pose, self.v_template, + shapedirs, self.posedirs, + self.J_regressor, self.parents, + self.lbs_weights, + pose2rot=False, + ) + + lmk_faces_idx = self.lmk_faces_idx.unsqueeze( + dim=0).expand(batch_size, -1).contiguous() + lmk_bary_coords = self.lmk_bary_coords.unsqueeze(dim=0).repeat( + batch_size, 1, 1) + if self.use_face_contour: + lmk_idx_and_bcoords = find_dynamic_lmk_idx_and_bcoords( + vertices, full_pose, + self.dynamic_lmk_faces_idx, + self.dynamic_lmk_bary_coords, + self.neck_kin_chain, + pose2rot=False, + ) + dyn_lmk_faces_idx, dyn_lmk_bary_coords = lmk_idx_and_bcoords + + lmk_faces_idx = torch.cat([lmk_faces_idx, dyn_lmk_faces_idx], 1) + lmk_bary_coords = torch.cat( + [lmk_bary_coords.expand(batch_size, -1, -1), + dyn_lmk_bary_coords], 1) + + landmarks = vertices2landmarks(vertices, self.faces_tensor, + lmk_faces_idx, + lmk_bary_coords) + + # Add any extra joints that might be needed + joints = self.vertex_joint_selector(vertices, joints) + # Add the landmarks to the joints + joints = torch.cat([joints, landmarks], dim=1) + # Map the joints to the current dataset + + if self.joint_mapper is not None: + joints = self.joint_mapper(joints=joints, vertices=vertices) + + if transl is not None: + joints += transl.unsqueeze(dim=1) + vertices += transl.unsqueeze(dim=1) + + output = SMPLXOutput(vertices=vertices if return_verts else None, + joints=joints, + betas=betas, + expression=expression, + global_orient=global_orient, + body_pose=body_pose, + left_hand_pose=left_hand_pose, + right_hand_pose=right_hand_pose, + jaw_pose=jaw_pose, + transl=transl, + full_pose=full_pose if return_full_pose else None) + return output + + +class MANO(SMPL): + # The hand joints are replaced by MANO + NUM_BODY_JOINTS = 1 + NUM_HAND_JOINTS = 15 + NUM_JOINTS = NUM_BODY_JOINTS + NUM_HAND_JOINTS + + def __init__( + self, + model_path: str, + is_rhand: bool = True, + data_struct: Optional[Struct] = None, + create_hand_pose: bool = True, + hand_pose: Optional[Tensor] = None, + use_pca: bool = True, + num_pca_comps: int = 6, + flat_hand_mean: bool = False, + batch_size: int = 1, + dtype=torch.float32, + vertex_ids=None, + use_compressed: bool = True, + ext: str = 'pkl', + **kwargs + ) -> None: + ''' MANO model constructor + + Parameters + ---------- + model_path: str + The path to the folder or to the file where the model + parameters are stored + data_struct: Strct + A struct object. If given, then the parameters of the model are + read from the object. Otherwise, the model tries to read the + parameters from the given `model_path`. (default = None) + create_hand_pose: bool, optional + Flag for creating a member variable for the pose of the right + hand. (default = True) + hand_pose: torch.tensor, optional, BxP + The default value for the right hand pose member variable. + (default = None) + num_pca_comps: int, optional + The number of PCA components to use for each hand. + (default = 6) + flat_hand_mean: bool, optional + If False, then the pose of the hand is initialized to False. + batch_size: int, optional + The batch size used for creating the member variables + dtype: torch.dtype, optional + The data type for the created variables + vertex_ids: dict, optional + A dictionary containing the indices of the extra vertices that + will be selected + ''' + + self.num_pca_comps = num_pca_comps + self.is_rhand = is_rhand + # If no data structure is passed, then load the data from the given + # model folder + if data_struct is None: + # Load the model + if osp.isdir(model_path): + model_fn = 'MANO_{}.{ext}'.format( + 'RIGHT' if is_rhand else 'LEFT', ext=ext) + mano_path = os.path.join(model_path, model_fn) + else: + mano_path = model_path + self.is_rhand = True if 'RIGHT' in os.path.basename( + model_path) else False + assert osp.exists(mano_path), 'Path {} does not exist!'.format( + mano_path) + + if ext == 'pkl': + with open(mano_path, 'rb') as mano_file: + model_data = pickle.load(mano_file, encoding='latin1') + elif ext == 'npz': + model_data = np.load(mano_path, allow_pickle=True) + else: + raise ValueError('Unknown extension: {}'.format(ext)) + data_struct = Struct(**model_data) + + if vertex_ids is None: + vertex_ids = VERTEX_IDS['smplh'] + + super(MANO, self).__init__( + model_path=model_path, data_struct=data_struct, + batch_size=batch_size, vertex_ids=vertex_ids, + use_compressed=use_compressed, dtype=dtype, ext=ext, **kwargs) + + # add only MANO tips to the extra joints + self.vertex_joint_selector.extra_joints_idxs = to_tensor( + list(VERTEX_IDS['mano'].values()), dtype=torch.long) + + self.use_pca = use_pca + self.num_pca_comps = num_pca_comps + if self.num_pca_comps == 45: + self.use_pca = False + self.flat_hand_mean = flat_hand_mean + + hand_components = data_struct.hands_components[:num_pca_comps] + + self.np_hand_components = hand_components + + if self.use_pca: + self.register_buffer( + 'hand_components', + torch.tensor(hand_components, dtype=dtype)) + + if self.flat_hand_mean: + hand_mean = np.zeros_like(data_struct.hands_mean) + else: + hand_mean = data_struct.hands_mean + + self.register_buffer('hand_mean', + to_tensor(hand_mean, dtype=self.dtype)) + + # Create the buffers for the pose of the left hand + hand_pose_dim = num_pca_comps if use_pca else 3 * self.NUM_HAND_JOINTS + if create_hand_pose: + if hand_pose is None: + default_hand_pose = torch.zeros([batch_size, hand_pose_dim], + dtype=dtype) + else: + default_hand_pose = torch.tensor(hand_pose, dtype=dtype) + + hand_pose_param = nn.Parameter(default_hand_pose, + requires_grad=True) + self.register_parameter('hand_pose', + hand_pose_param) + + # Create the buffer for the mean pose. + pose_mean = self.create_mean_pose( + data_struct, flat_hand_mean=flat_hand_mean) + pose_mean_tensor = pose_mean.clone().to(dtype) + # pose_mean_tensor = torch.tensor(pose_mean, dtype=dtype) + self.register_buffer('pose_mean', pose_mean_tensor) + + def name(self) -> str: + return 'MANO' + + def create_mean_pose(self, data_struct, flat_hand_mean=False): + # Create the array for the mean pose. If flat_hand is false, then use + # the mean that is given by the data, rather than the flat open hand + global_orient_mean = torch.zeros([3], dtype=self.dtype) + pose_mean = torch.cat([global_orient_mean, self.hand_mean], dim=0) + return pose_mean + + def extra_repr(self): + msg = [super(MANO, self).extra_repr()] + if self.use_pca: + msg.append(f'Number of PCA components: {self.num_pca_comps}') + msg.append(f'Flat hand mean: {self.flat_hand_mean}') + return '\n'.join(msg) + + def forward( + self, + betas: Optional[Tensor] = None, + global_orient: Optional[Tensor] = None, + hand_pose: Optional[Tensor] = None, + transl: Optional[Tensor] = None, + return_verts: bool = True, + return_full_pose: bool = False, + **kwargs + ) -> MANOOutput: + ''' Forward pass for the MANO model + ''' + # If no shape and pose parameters are passed along, then use the + # ones from the module + global_orient = (global_orient if global_orient is not None else + self.global_orient) + betas = betas if betas is not None else self.betas + hand_pose = (hand_pose if hand_pose is not None else + self.hand_pose) + + apply_trans = transl is not None or hasattr(self, 'transl') + if transl is None: + if hasattr(self, 'transl'): + transl = self.transl + + if self.use_pca: + hand_pose = torch.einsum( + 'bi,ij->bj', [hand_pose, self.hand_components]) + + full_pose = torch.cat([global_orient, hand_pose], dim=1) + full_pose += self.pose_mean + + vertices, joints = lbs(betas, full_pose, self.v_template, + self.shapedirs, self.posedirs, + self.J_regressor, self.parents, + self.lbs_weights, pose2rot=True, + ) + + # # Add pre-selected extra joints that might be needed + # joints = self.vertex_joint_selector(vertices, joints) + + if self.joint_mapper is not None: + joints = self.joint_mapper(joints) + + if apply_trans: + joints = joints + transl.unsqueeze(dim=1) + vertices = vertices + transl.unsqueeze(dim=1) + + output = MANOOutput(vertices=vertices if return_verts else None, + joints=joints if return_verts else None, + betas=betas, + global_orient=global_orient, + hand_pose=hand_pose, + full_pose=full_pose if return_full_pose else None) + + return output + + +class MANOLayer(MANO): + def __init__(self, *args, **kwargs) -> None: + ''' MANO as a layer model constructor + ''' + super(MANOLayer, self).__init__( + create_global_orient=False, + create_hand_pose=False, + create_betas=False, + create_transl=False, + *args, **kwargs) + + def name(self) -> str: + return 'MANO' + + def forward( + self, + betas: Optional[Tensor] = None, + global_orient: Optional[Tensor] = None, + hand_pose: Optional[Tensor] = None, + transl: Optional[Tensor] = None, + return_verts: bool = True, + return_full_pose: bool = False, + **kwargs + ) -> MANOOutput: + ''' Forward pass for the MANO model + ''' + device, dtype = self.shapedirs.device, self.shapedirs.dtype + if global_orient is None: + batch_size = 1 + global_orient = torch.eye(3, device=device, dtype=dtype).view( + 1, 1, 3, 3).expand(batch_size, -1, -1, -1).contiguous() + else: + batch_size = global_orient.shape[0] + if hand_pose is None: + hand_pose = torch.eye(3, device=device, dtype=dtype).view( + 1, 1, 3, 3).expand(batch_size, 15, -1, -1).contiguous() + if betas is None: + betas = torch.zeros( + [batch_size, self.num_betas], dtype=dtype, device=device) + if transl is None: + transl = torch.zeros([batch_size, 3], dtype=dtype, device=device) + + full_pose = torch.cat([global_orient, hand_pose], dim=1) + vertices, joints = lbs(betas, full_pose, self.v_template, + self.shapedirs, self.posedirs, + self.J_regressor, self.parents, + self.lbs_weights, pose2rot=False) + + if self.joint_mapper is not None: + joints = self.joint_mapper(joints) + + if transl is not None: + joints = joints + transl.unsqueeze(dim=1) + vertices = vertices + transl.unsqueeze(dim=1) + + output = MANOOutput( + vertices=vertices if return_verts else None, + joints=joints if return_verts else None, + betas=betas, + global_orient=global_orient, + hand_pose=hand_pose, + full_pose=full_pose if return_full_pose else None) + + return output + + +class FLAME(SMPL): + NUM_JOINTS = 5 + SHAPE_SPACE_DIM = 300 + EXPRESSION_SPACE_DIM = 100 + NECK_IDX = 0 + + def __init__( + self, + model_path: str, + data_struct=None, + num_expression_coeffs=10, + create_expression: bool = True, + expression: Optional[Tensor] = None, + create_neck_pose: bool = True, + neck_pose: Optional[Tensor] = None, + create_jaw_pose: bool = True, + jaw_pose: Optional[Tensor] = None, + create_leye_pose: bool = True, + leye_pose: Optional[Tensor] = None, + create_reye_pose=True, + reye_pose: Optional[Tensor] = None, + use_face_contour=False, + batch_size: int = 1, + gender: str = 'neutral', + dtype: torch.dtype = torch.float32, + ext='pkl', + **kwargs + ) -> None: + ''' FLAME model constructor + + Parameters + ---------- + model_path: str + The path to the folder or to the file where the model + parameters are stored + num_expression_coeffs: int, optional + Number of expression components to use + (default = 10). + create_expression: bool, optional + Flag for creating a member variable for the expression space + (default = True). + expression: torch.tensor, optional, Bx10 + The default value for the expression member variable. + (default = None) + create_neck_pose: bool, optional + Flag for creating a member variable for the neck pose. + (default = False) + neck_pose: torch.tensor, optional, Bx3 + The default value for the neck pose variable. + (default = None) + create_jaw_pose: bool, optional + Flag for creating a member variable for the jaw pose. + (default = False) + jaw_pose: torch.tensor, optional, Bx3 + The default value for the jaw pose variable. + (default = None) + create_leye_pose: bool, optional + Flag for creating a member variable for the left eye pose. + (default = False) + leye_pose: torch.tensor, optional, Bx10 + The default value for the left eye pose variable. + (default = None) + create_reye_pose: bool, optional + Flag for creating a member variable for the right eye pose. + (default = False) + reye_pose: torch.tensor, optional, Bx10 + The default value for the right eye pose variable. + (default = None) + use_face_contour: bool, optional + Whether to compute the keypoints that form the facial contour + batch_size: int, optional + The batch size used for creating the member variables + gender: str, optional + Which gender to load + dtype: torch.dtype + The data type for the created variables + ''' + model_fn = f'FLAME_{gender.upper()}.{ext}' + flame_path = os.path.join(model_path, model_fn) + assert osp.exists(flame_path), 'Path {} does not exist!'.format( + flame_path) + if ext == 'npz': + file_data = np.load(flame_path, allow_pickle=True) + elif ext == 'pkl': + with open(flame_path, 'rb') as smpl_file: + file_data = pickle.load(smpl_file, encoding='latin1') + else: + raise ValueError('Unknown extension: {}'.format(ext)) + data_struct = Struct(**file_data) + + super(FLAME, self).__init__( + model_path=model_path, + data_struct=data_struct, + dtype=dtype, + batch_size=batch_size, + gender=gender, + ext=ext, + **kwargs) + + self.use_face_contour = use_face_contour + + self.vertex_joint_selector.extra_joints_idxs = to_tensor( + [], dtype=torch.long) + + if create_neck_pose: + if neck_pose is None: + default_neck_pose = torch.zeros([batch_size, 3], dtype=dtype) + else: + default_neck_pose = torch.tensor(neck_pose, dtype=dtype) + neck_pose_param = nn.Parameter( + default_neck_pose, requires_grad=True) + self.register_parameter('neck_pose', neck_pose_param) + + if create_jaw_pose: + if jaw_pose is None: + default_jaw_pose = torch.zeros([batch_size, 3], dtype=dtype) + else: + default_jaw_pose = torch.tensor(jaw_pose, dtype=dtype) + jaw_pose_param = nn.Parameter(default_jaw_pose, + requires_grad=True) + self.register_parameter('jaw_pose', jaw_pose_param) + + if create_leye_pose: + if leye_pose is None: + default_leye_pose = torch.zeros([batch_size, 3], dtype=dtype) + else: + default_leye_pose = torch.tensor(leye_pose, dtype=dtype) + leye_pose_param = nn.Parameter(default_leye_pose, + requires_grad=True) + self.register_parameter('leye_pose', leye_pose_param) + + if create_reye_pose: + if reye_pose is None: + default_reye_pose = torch.zeros([batch_size, 3], dtype=dtype) + else: + default_reye_pose = torch.tensor(reye_pose, dtype=dtype) + reye_pose_param = nn.Parameter(default_reye_pose, + requires_grad=True) + self.register_parameter('reye_pose', reye_pose_param) + + shapedirs = data_struct.shapedirs + if len(shapedirs.shape) < 3: + shapedirs = shapedirs[:, :, None] + if (shapedirs.shape[-1] < self.SHAPE_SPACE_DIM + + self.EXPRESSION_SPACE_DIM): + print(f'WARNING: You are using a {self.name()} model, with only' + ' 10 shape and 10 expression coefficients.') + expr_start_idx = 10 + expr_end_idx = 20 + num_expression_coeffs = min(num_expression_coeffs, 10) + else: + expr_start_idx = self.SHAPE_SPACE_DIM + expr_end_idx = self.SHAPE_SPACE_DIM + num_expression_coeffs + num_expression_coeffs = min( + num_expression_coeffs, self.EXPRESSION_SPACE_DIM) + + self._num_expression_coeffs = num_expression_coeffs + + expr_dirs = shapedirs[:, :, expr_start_idx:expr_end_idx] + self.register_buffer( + 'expr_dirs', to_tensor(to_np(expr_dirs), dtype=dtype)) + + if create_expression: + if expression is None: + default_expression = torch.zeros( + [batch_size, self.num_expression_coeffs], dtype=dtype) + else: + default_expression = torch.tensor(expression, dtype=dtype) + expression_param = nn.Parameter(default_expression, + requires_grad=True) + self.register_parameter('expression', expression_param) + + # The pickle file that contains the barycentric coordinates for + # regressing the landmarks + landmark_bcoord_filename = osp.join( + model_path, 'flame_static_embedding.pkl') + + with open(landmark_bcoord_filename, 'rb') as fp: + landmarks_data = pickle.load(fp, encoding='latin1') + + lmk_faces_idx = landmarks_data['lmk_face_idx'].astype(np.int64) + self.register_buffer('lmk_faces_idx', + torch.tensor(lmk_faces_idx, dtype=torch.long)) + lmk_bary_coords = landmarks_data['lmk_b_coords'] + self.register_buffer('lmk_bary_coords', + torch.tensor(lmk_bary_coords, dtype=dtype)) + if self.use_face_contour: + face_contour_path = os.path.join( + model_path, 'flame_dynamic_embedding.npy') + contour_embeddings = np.load(face_contour_path, + allow_pickle=True, + encoding='latin1')[()] + + dynamic_lmk_faces_idx = np.array( + contour_embeddings['lmk_face_idx'], dtype=np.int64) + dynamic_lmk_faces_idx = torch.tensor( + dynamic_lmk_faces_idx, + dtype=torch.long) + self.register_buffer('dynamic_lmk_faces_idx', + dynamic_lmk_faces_idx) + + dynamic_lmk_b_coords = torch.tensor( + contour_embeddings['lmk_b_coords'], dtype=dtype) + self.register_buffer( + 'dynamic_lmk_bary_coords', dynamic_lmk_b_coords) + + neck_kin_chain = find_joint_kin_chain(self.NECK_IDX, self.parents) + self.register_buffer( + 'neck_kin_chain', + torch.tensor(neck_kin_chain, dtype=torch.long)) + + @property + def num_expression_coeffs(self): + return self._num_expression_coeffs + + def name(self) -> str: + return 'FLAME' + + def extra_repr(self): + msg = [ + super(FLAME, self).extra_repr(), + f'Number of Expression Coefficients: {self.num_expression_coeffs}', + f'Use face contour: {self.use_face_contour}', + ] + return '\n'.join(msg) + + def forward( + self, + betas: Optional[Tensor] = None, + global_orient: Optional[Tensor] = None, + neck_pose: Optional[Tensor] = None, + transl: Optional[Tensor] = None, + expression: Optional[Tensor] = None, + jaw_pose: Optional[Tensor] = None, + leye_pose: Optional[Tensor] = None, + reye_pose: Optional[Tensor] = None, + return_verts: bool = True, + return_full_pose: bool = False, + pose2rot: bool = True, + **kwargs + ) -> FLAMEOutput: + ''' + Forward pass for the SMPLX model + + Parameters + ---------- + global_orient: torch.tensor, optional, shape Bx3 + If given, ignore the member variable and use it as the global + rotation of the body. Useful if someone wishes to predicts this + with an external model. (default=None) + betas: torch.tensor, optional, shape Bx10 + If given, ignore the member variable `betas` and use it + instead. For example, it can used if shape parameters + `betas` are predicted from some external model. + (default=None) + expression: torch.tensor, optional, shape Bx10 + If given, ignore the member variable `expression` and use it + instead. For example, it can used if expression parameters + `expression` are predicted from some external model. + jaw_pose: torch.tensor, optional, shape Bx3 + If given, ignore the member variable `jaw_pose` and + use this instead. It should either joint rotations in + axis-angle format. + jaw_pose: torch.tensor, optional, shape Bx3 + If given, ignore the member variable `jaw_pose` and + use this instead. It should either joint rotations in + axis-angle format. + transl: torch.tensor, optional, shape Bx3 + If given, ignore the member variable `transl` and use it + instead. For example, it can used if the translation + `transl` is predicted from some external model. + (default=None) + return_verts: bool, optional + Return the vertices. (default=True) + return_full_pose: bool, optional + Returns the full axis-angle pose vector (default=False) + + Returns + ------- + output: ModelOutput + A named tuple of type `ModelOutput` + ''' + + # If no shape and pose parameters are passed along, then use the + # ones from the module + global_orient = (global_orient if global_orient is not None else + self.global_orient) + jaw_pose = jaw_pose if jaw_pose is not None else self.jaw_pose + neck_pose = neck_pose if neck_pose is not None else self.neck_pose + + leye_pose = leye_pose if leye_pose is not None else self.leye_pose + reye_pose = reye_pose if reye_pose is not None else self.reye_pose + + betas = betas if betas is not None else self.betas + expression = expression if expression is not None else self.expression + + apply_trans = transl is not None or hasattr(self, 'transl') + if transl is None: + if hasattr(self, 'transl'): + transl = self.transl + + full_pose = torch.cat( + [global_orient, neck_pose, jaw_pose, leye_pose, reye_pose], dim=1) + + batch_size = max(betas.shape[0], global_orient.shape[0], + jaw_pose.shape[0]) + # Concatenate the shape and expression coefficients + scale = int(batch_size / betas.shape[0]) + if scale > 1: + betas = betas.expand(scale, -1) + shape_components = torch.cat([betas, expression], dim=-1) + shapedirs = torch.cat([self.shapedirs, self.expr_dirs], dim=-1) + + vertices, joints = lbs(shape_components, full_pose, self.v_template, + shapedirs, self.posedirs, + self.J_regressor, self.parents, + self.lbs_weights, pose2rot=pose2rot, + ) + + lmk_faces_idx = self.lmk_faces_idx.unsqueeze( + dim=0).expand(batch_size, -1).contiguous() + lmk_bary_coords = self.lmk_bary_coords.unsqueeze(dim=0).repeat( + batch_size, 1, 1) + if self.use_face_contour: + lmk_idx_and_bcoords = find_dynamic_lmk_idx_and_bcoords( + vertices, full_pose, self.dynamic_lmk_faces_idx, + self.dynamic_lmk_bary_coords, + self.neck_kin_chain, + pose2rot=True, + ) + dyn_lmk_faces_idx, dyn_lmk_bary_coords = lmk_idx_and_bcoords + lmk_faces_idx = torch.cat([lmk_faces_idx, + dyn_lmk_faces_idx], 1) + lmk_bary_coords = torch.cat( + [lmk_bary_coords.expand(batch_size, -1, -1), + dyn_lmk_bary_coords], 1) + + landmarks = vertices2landmarks(vertices, self.faces_tensor, + lmk_faces_idx, + lmk_bary_coords) + + # Add any extra joints that might be needed + joints = self.vertex_joint_selector(vertices, joints) + # Add the landmarks to the joints + joints = torch.cat([joints, landmarks], dim=1) + + # Map the joints to the current dataset + if self.joint_mapper is not None: + joints = self.joint_mapper(joints=joints, vertices=vertices) + + if apply_trans: + joints += transl.unsqueeze(dim=1) + vertices += transl.unsqueeze(dim=1) + + output = FLAMEOutput(vertices=vertices if return_verts else None, + joints=joints, + betas=betas, + expression=expression, + global_orient=global_orient, + neck_pose=neck_pose, + jaw_pose=jaw_pose, + full_pose=full_pose if return_full_pose else None) + return output + + +class FLAMELayer(FLAME): + def __init__(self, *args, **kwargs) -> None: + ''' FLAME as a layer model constructor ''' + super(FLAMELayer, self).__init__( + create_betas=False, + create_expression=False, + create_global_orient=False, + create_neck_pose=False, + create_jaw_pose=False, + create_leye_pose=False, + create_reye_pose=False, + *args, + **kwargs) + + def forward( + self, + betas: Optional[Tensor] = None, + global_orient: Optional[Tensor] = None, + neck_pose: Optional[Tensor] = None, + transl: Optional[Tensor] = None, + expression: Optional[Tensor] = None, + jaw_pose: Optional[Tensor] = None, + leye_pose: Optional[Tensor] = None, + reye_pose: Optional[Tensor] = None, + return_verts: bool = True, + return_full_pose: bool = False, + pose2rot: bool = True, + **kwargs + ) -> FLAMEOutput: + ''' + Forward pass for the SMPLX model + + Parameters + ---------- + global_orient: torch.tensor, optional, shape Bx3x3 + Global rotation of the body. Useful if someone wishes to + predicts this with an external model. It is expected to be in + rotation matrix format. (default=None) + betas: torch.tensor, optional, shape BxN_b + Shape parameters. For example, it can used if shape parameters + `betas` are predicted from some external model. + (default=None) + expression: torch.tensor, optional, shape BxN_e + If given, ignore the member variable `expression` and use it + instead. For example, it can used if expression parameters + `expression` are predicted from some external model. + jaw_pose: torch.tensor, optional, shape Bx3x3 + Jaw pose. It should either joint rotations in + rotation matrix format. + transl: torch.tensor, optional, shape Bx3 + Translation vector of the body. + For example, it can used if the translation + `transl` is predicted from some external model. + (default=None) + return_verts: bool, optional + Return the vertices. (default=True) + return_full_pose: bool, optional + Returns the full axis-angle pose vector (default=False) + + Returns + ------- + output: ModelOutput + A named tuple of type `ModelOutput` + ''' + device, dtype = self.shapedirs.device, self.shapedirs.dtype + if global_orient is None: + batch_size = 1 + global_orient = torch.eye(3, device=device, dtype=dtype).view( + 1, 1, 3, 3).expand(batch_size, -1, -1, -1).contiguous() + else: + batch_size = global_orient.shape[0] + if neck_pose is None: + neck_pose = torch.eye(3, device=device, dtype=dtype).view( + 1, 1, 3, 3).expand(batch_size, 1, -1, -1).contiguous() + if jaw_pose is None: + jaw_pose = torch.eye(3, device=device, dtype=dtype).view( + 1, 1, 3, 3).expand(batch_size, -1, -1, -1).contiguous() + if leye_pose is None: + leye_pose = torch.eye(3, device=device, dtype=dtype).view( + 1, 1, 3, 3).expand(batch_size, -1, -1, -1).contiguous() + if reye_pose is None: + reye_pose = torch.eye(3, device=device, dtype=dtype).view( + 1, 1, 3, 3).expand(batch_size, -1, -1, -1).contiguous() + if betas is None: + betas = torch.zeros([batch_size, self.num_betas], + dtype=dtype, device=device) + if expression is None: + expression = torch.zeros([batch_size, self.num_expression_coeffs], + dtype=dtype, device=device) + if transl is None: + transl = torch.zeros([batch_size, 3], dtype=dtype, device=device) + + full_pose = torch.cat( + [global_orient, neck_pose, jaw_pose, leye_pose, reye_pose], dim=1) + + shape_components = torch.cat([betas, expression], dim=-1) + shapedirs = torch.cat([self.shapedirs, self.expr_dirs], dim=-1) + + vertices, joints = lbs(shape_components, full_pose, self.v_template, + shapedirs, self.posedirs, + self.J_regressor, self.parents, + self.lbs_weights, pose2rot=False, + ) + + lmk_faces_idx = self.lmk_faces_idx.unsqueeze( + dim=0).expand(batch_size, -1).contiguous() + lmk_bary_coords = self.lmk_bary_coords.unsqueeze(dim=0).repeat( + batch_size, 1, 1) + if self.use_face_contour: + lmk_idx_and_bcoords = find_dynamic_lmk_idx_and_bcoords( + vertices, full_pose, self.dynamic_lmk_faces_idx, + self.dynamic_lmk_bary_coords, + self.neck_kin_chain, + pose2rot=False, + ) + dyn_lmk_faces_idx, dyn_lmk_bary_coords = lmk_idx_and_bcoords + lmk_faces_idx = torch.cat([lmk_faces_idx, + dyn_lmk_faces_idx], 1) + lmk_bary_coords = torch.cat( + [lmk_bary_coords.expand(batch_size, -1, -1), + dyn_lmk_bary_coords], 1) + + landmarks = vertices2landmarks(vertices, self.faces_tensor, + lmk_faces_idx, + lmk_bary_coords) + + # Add any extra joints that might be needed + joints = self.vertex_joint_selector(vertices, joints) + # Add the landmarks to the joints + joints = torch.cat([joints, landmarks], dim=1) + + # Map the joints to the current dataset + if self.joint_mapper is not None: + joints = self.joint_mapper(joints=joints, vertices=vertices) + + joints += transl.unsqueeze(dim=1) + vertices += transl.unsqueeze(dim=1) + + output = FLAMEOutput(vertices=vertices if return_verts else None, + joints=joints, + betas=betas, + expression=expression, + global_orient=global_orient, + neck_pose=neck_pose, + jaw_pose=jaw_pose, + full_pose=full_pose if return_full_pose else None) + return output + + +def build_layer( + model_path: str, + model_type: str = 'smpl', + **kwargs +) -> Union[SMPLLayer, SMPLHLayer, SMPLXLayer, MANOLayer, FLAMELayer]: + ''' Method for creating a model from a path and a model type + + Parameters + ---------- + model_path: str + Either the path to the model you wish to load or a folder, + where each subfolder contains the differents types, i.e.: + model_path: + | + |-- smpl + |-- SMPL_FEMALE + |-- SMPL_NEUTRAL + |-- SMPL_MALE + |-- smplh + |-- SMPLH_FEMALE + |-- SMPLH_MALE + |-- smplx + |-- SMPLX_FEMALE + |-- SMPLX_NEUTRAL + |-- SMPLX_MALE + |-- mano + |-- MANO RIGHT + |-- MANO LEFT + |-- flame + |-- FLAME_FEMALE + |-- FLAME_MALE + |-- FLAME_NEUTRAL + + model_type: str, optional + When model_path is a folder, then this parameter specifies the + type of model to be loaded + **kwargs: dict + Keyword arguments + + Returns + ------- + body_model: nn.Module + The PyTorch module that implements the corresponding body model + Raises + ------ + ValueError: In case the model type is not one of SMPL, SMPLH, + SMPLX, MANO or FLAME + ''' + + if osp.isdir(model_path): + model_path = os.path.join(model_path, model_type) + else: + model_type = osp.basename(model_path).split('_')[0].lower() + + if model_type.lower() == 'smpl': + return SMPLLayer(model_path, **kwargs) + elif model_type.lower() == 'smplh': + return SMPLHLayer(model_path, **kwargs) + elif model_type.lower() == 'smplx': + return SMPLXLayer(model_path, **kwargs) + elif 'mano' in model_type.lower(): + return MANOLayer(model_path, **kwargs) + elif 'flame' in model_type.lower(): + return FLAMELayer(model_path, **kwargs) + else: + raise ValueError(f'Unknown model type {model_type}, exiting!') + + +def create( + model_path: str, + model_type: str = 'smpl', + **kwargs +) -> Union[SMPL, SMPLH, SMPLX, MANO, FLAME]: + ''' Method for creating a model from a path and a model type + + Parameters + ---------- + model_path: str + Either the path to the model you wish to load or a folder, + where each subfolder contains the differents types, i.e.: + model_path: + | + |-- smpl + |-- SMPL_FEMALE + |-- SMPL_NEUTRAL + |-- SMPL_MALE + |-- smplh + |-- SMPLH_FEMALE + |-- SMPLH_MALE + |-- smplx + |-- SMPLX_FEMALE + |-- SMPLX_NEUTRAL + |-- SMPLX_MALE + |-- mano + |-- MANO RIGHT + |-- MANO LEFT + + model_type: str, optional + When model_path is a folder, then this parameter specifies the + type of model to be loaded + **kwargs: dict + Keyword arguments + + Returns + ------- + body_model: nn.Module + The PyTorch module that implements the corresponding body model + Raises + ------ + ValueError: In case the model type is not one of SMPL, SMPLH, + SMPLX, MANO or FLAME + ''' + + # If it's a folder, assume + if osp.isdir(model_path): + model_path = os.path.join(model_path, model_type) + else: + model_type = osp.basename(model_path).split('_')[0].lower() + + if model_type.lower() == 'smpl': + return SMPL(model_path, **kwargs) + elif model_type.lower() == 'smplh': + return SMPLH(model_path, **kwargs) + elif model_type.lower() == 'smplx': + return SMPLX(model_path, **kwargs) + elif 'mano' in model_type.lower(): + return MANO(model_path, **kwargs) + elif 'flame' in model_type.lower(): + return FLAME(model_path, **kwargs) + else: + raise ValueError(f'Unknown model type {model_type}, exiting!') diff --git a/AnimatableGaussians/smplx/joint_names.py b/AnimatableGaussians/smplx/joint_names.py new file mode 100644 index 0000000000000000000000000000000000000000..cfbb37094ea8fcc679da1e816abdce2676c8b969 --- /dev/null +++ b/AnimatableGaussians/smplx/joint_names.py @@ -0,0 +1,240 @@ +# -*- coding: utf-8 -*- + +# Max-Planck-Gesellschaft zur Förderung der Wissenschaften e.V. (MPG) is +# holder of all proprietary rights on this computer program. +# You can only use this computer program if you have closed +# a license agreement with MPG or you get the right to use the computer +# program from someone who is authorized to grant you that right. +# Any use of the computer program without a valid license is prohibited and +# liable to prosecution. +# +# Copyright©2019 Max-Planck-Gesellschaft zur Förderung +# der Wissenschaften e.V. (MPG). acting on behalf of its Max Planck Institute +# for Intelligent Systems. All rights reserved. +# +# Contact: ps-license@tuebingen.mpg.de + +JOINT_NAMES = [ + 'pelvis', + 'left_hip', + 'right_hip', + 'spine1', + 'left_knee', + 'right_knee', + 'spine2', + 'left_ankle', + 'right_ankle', + 'spine3', + 'left_foot', + 'right_foot', + 'neck', + 'left_collar', + 'right_collar', + 'head', + 'left_shoulder', + 'right_shoulder', + 'left_elbow', + 'right_elbow', + 'left_wrist', + 'right_wrist', + 'jaw', + 'left_eye_smplhf', + 'right_eye_smplhf', + 'left_index1', + 'left_index2', + 'left_index3', + 'left_middle1', + 'left_middle2', + 'left_middle3', + 'left_pinky1', + 'left_pinky2', + 'left_pinky3', + 'left_ring1', + 'left_ring2', + 'left_ring3', + 'left_thumb1', + 'left_thumb2', + 'left_thumb3', + 'right_index1', + 'right_index2', + 'right_index3', + 'right_middle1', + 'right_middle2', + 'right_middle3', + 'right_pinky1', + 'right_pinky2', + 'right_pinky3', + 'right_ring1', + 'right_ring2', + 'right_ring3', + 'right_thumb1', + 'right_thumb2', + 'right_thumb3', + 'nose', + 'right_eye', + 'left_eye', + 'right_ear', + 'left_ear', + 'left_big_toe', + 'left_small_toe', + 'left_heel', + 'right_big_toe', + 'right_small_toe', + 'right_heel', + 'left_thumb', + 'left_index', + 'left_middle', + 'left_ring', + 'left_pinky', + 'right_thumb', + 'right_index', + 'right_middle', + 'right_ring', + 'right_pinky', + 'right_eye_brow1', + 'right_eye_brow2', + 'right_eye_brow3', + 'right_eye_brow4', + 'right_eye_brow5', + 'left_eye_brow5', + 'left_eye_brow4', + 'left_eye_brow3', + 'left_eye_brow2', + 'left_eye_brow1', + 'nose1', + 'nose2', + 'nose3', + 'nose4', + 'right_nose_2', + 'right_nose_1', + 'nose_middle', + 'left_nose_1', + 'left_nose_2', + 'right_eye1', + 'right_eye2', + 'right_eye3', + 'right_eye4', + 'right_eye5', + 'right_eye6', + 'left_eye4', + 'left_eye3', + 'left_eye2', + 'left_eye1', + 'left_eye6', + 'left_eye5', + 'right_mouth_1', + 'right_mouth_2', + 'right_mouth_3', + 'mouth_top', + 'left_mouth_3', + 'left_mouth_2', + 'left_mouth_1', + 'left_mouth_5', # 59 in OpenPose output + 'left_mouth_4', # 58 in OpenPose output + 'mouth_bottom', + 'right_mouth_4', + 'right_mouth_5', + 'right_lip_1', + 'right_lip_2', + 'lip_top', + 'left_lip_2', + 'left_lip_1', + 'left_lip_3', + 'lip_bottom', + 'right_lip_3', + # Face contour + 'right_contour_1', + 'right_contour_2', + 'right_contour_3', + 'right_contour_4', + 'right_contour_5', + 'right_contour_6', + 'right_contour_7', + 'right_contour_8', + 'contour_middle', + 'left_contour_8', + 'left_contour_7', + 'left_contour_6', + 'left_contour_5', + 'left_contour_4', + 'left_contour_3', + 'left_contour_2', + 'left_contour_1', +] + + +SMPLH_JOINT_NAMES = [ + 'pelvis', + 'left_hip', + 'right_hip', + 'spine1', + 'left_knee', + 'right_knee', + 'spine2', + 'left_ankle', + 'right_ankle', + 'spine3', + 'left_foot', + 'right_foot', + 'neck', + 'left_collar', + 'right_collar', + 'head', + 'left_shoulder', + 'right_shoulder', + 'left_elbow', + 'right_elbow', + 'left_wrist', + 'right_wrist', + 'left_index1', + 'left_index2', + 'left_index3', + 'left_middle1', + 'left_middle2', + 'left_middle3', + 'left_pinky1', + 'left_pinky2', + 'left_pinky3', + 'left_ring1', + 'left_ring2', + 'left_ring3', + 'left_thumb1', + 'left_thumb2', + 'left_thumb3', + 'right_index1', + 'right_index2', + 'right_index3', + 'right_middle1', + 'right_middle2', + 'right_middle3', + 'right_pinky1', + 'right_pinky2', + 'right_pinky3', + 'right_ring1', + 'right_ring2', + 'right_ring3', + 'right_thumb1', + 'right_thumb2', + 'right_thumb3', + 'nose', + 'right_eye', + 'left_eye', + 'right_ear', + 'left_ear', + 'left_big_toe', + 'left_small_toe', + 'left_heel', + 'right_big_toe', + 'right_small_toe', + 'right_heel', + 'left_thumb', + 'left_index', + 'left_middle', + 'left_ring', + 'left_pinky', + 'right_thumb', + 'right_index', + 'right_middle', + 'right_ring', + 'right_pinky', +] diff --git a/AnimatableGaussians/smplx/lbs.py b/AnimatableGaussians/smplx/lbs.py new file mode 100644 index 0000000000000000000000000000000000000000..c0372d50caeb2598e3ffac73a601213e0b50e0f1 --- /dev/null +++ b/AnimatableGaussians/smplx/lbs.py @@ -0,0 +1,405 @@ +# -*- coding: utf-8 -*- + +# Max-Planck-Gesellschaft zur Förderung der Wissenschaften e.V. (MPG) is +# holder of all proprietary rights on this computer program. +# You can only use this computer program if you have closed +# a license agreement with MPG or you get the right to use the computer +# program from someone who is authorized to grant you that right. +# Any use of the computer program without a valid license is prohibited and +# liable to prosecution. +# +# Copyright©2019 Max-Planck-Gesellschaft zur Förderung +# der Wissenschaften e.V. (MPG). acting on behalf of its Max Planck Institute +# for Intelligent Systems. All rights reserved. +# +# Contact: ps-license@tuebingen.mpg.de + +from __future__ import absolute_import +from __future__ import print_function +from __future__ import division + +from typing import Tuple, List +import numpy as np + +import torch +import torch.nn.functional as F + +from .utils import rot_mat_to_euler, Tensor + + +def find_dynamic_lmk_idx_and_bcoords( + vertices: Tensor, + pose: Tensor, + dynamic_lmk_faces_idx: Tensor, + dynamic_lmk_b_coords: Tensor, + neck_kin_chain: List[int], + pose2rot: bool = True, +) -> Tuple[Tensor, Tensor]: + ''' Compute the faces, barycentric coordinates for the dynamic landmarks + + + To do so, we first compute the rotation of the neck around the y-axis + and then use a pre-computed look-up table to find the faces and the + barycentric coordinates that will be used. + + Special thanks to Soubhik Sanyal (soubhik.sanyal@tuebingen.mpg.de) + for providing the original TensorFlow implementation and for the LUT. + + Parameters + ---------- + vertices: torch.tensor BxVx3, dtype = torch.float32 + The tensor of input vertices + pose: torch.tensor Bx(Jx3), dtype = torch.float32 + The current pose of the body model + dynamic_lmk_faces_idx: torch.tensor L, dtype = torch.long + The look-up table from neck rotation to faces + dynamic_lmk_b_coords: torch.tensor Lx3, dtype = torch.float32 + The look-up table from neck rotation to barycentric coordinates + neck_kin_chain: list + A python list that contains the indices of the joints that form the + kinematic chain of the neck. + dtype: torch.dtype, optional + + Returns + ------- + dyn_lmk_faces_idx: torch.tensor, dtype = torch.long + A tensor of size BxL that contains the indices of the faces that + will be used to compute the current dynamic landmarks. + dyn_lmk_b_coords: torch.tensor, dtype = torch.float32 + A tensor of size BxL that contains the indices of the faces that + will be used to compute the current dynamic landmarks. + ''' + + dtype = vertices.dtype + batch_size = vertices.shape[0] + + if pose2rot: + aa_pose = torch.index_select(pose.view(batch_size, -1, 3), 1, + neck_kin_chain) + rot_mats = batch_rodrigues( + aa_pose.view(-1, 3)).view(batch_size, -1, 3, 3) + else: + rot_mats = torch.index_select( + pose.view(batch_size, -1, 3, 3), 1, neck_kin_chain) + + rel_rot_mat = torch.eye( + 3, device=vertices.device, dtype=dtype).unsqueeze_(dim=0).repeat( + batch_size, 1, 1) + for idx in range(len(neck_kin_chain)): + rel_rot_mat = torch.bmm(rot_mats[:, idx], rel_rot_mat) + + y_rot_angle = torch.round( + torch.clamp(-rot_mat_to_euler(rel_rot_mat) * 180.0 / np.pi, + max=39)).to(dtype=torch.long) + neg_mask = y_rot_angle.lt(0).to(dtype=torch.long) + mask = y_rot_angle.lt(-39).to(dtype=torch.long) + neg_vals = mask * 78 + (1 - mask) * (39 - y_rot_angle) + y_rot_angle = (neg_mask * neg_vals + + (1 - neg_mask) * y_rot_angle) + + dyn_lmk_faces_idx = torch.index_select(dynamic_lmk_faces_idx, + 0, y_rot_angle) + dyn_lmk_b_coords = torch.index_select(dynamic_lmk_b_coords, + 0, y_rot_angle) + + return dyn_lmk_faces_idx, dyn_lmk_b_coords + + +def vertices2landmarks( + vertices: Tensor, + faces: Tensor, + lmk_faces_idx: Tensor, + lmk_bary_coords: Tensor +) -> Tensor: + ''' Calculates landmarks by barycentric interpolation + + Parameters + ---------- + vertices: torch.tensor BxVx3, dtype = torch.float32 + The tensor of input vertices + faces: torch.tensor Fx3, dtype = torch.long + The faces of the mesh + lmk_faces_idx: torch.tensor L, dtype = torch.long + The tensor with the indices of the faces used to calculate the + landmarks. + lmk_bary_coords: torch.tensor Lx3, dtype = torch.float32 + The tensor of barycentric coordinates that are used to interpolate + the landmarks + + Returns + ------- + landmarks: torch.tensor BxLx3, dtype = torch.float32 + The coordinates of the landmarks for each mesh in the batch + ''' + # Extract the indices of the vertices for each face + # BxLx3 + batch_size, num_verts = vertices.shape[:2] + device = vertices.device + + lmk_faces = torch.index_select(faces, 0, lmk_faces_idx.view(-1)).view( + batch_size, -1, 3) + + lmk_faces += torch.arange( + batch_size, dtype=torch.long, device=device).view(-1, 1, 1) * num_verts + + lmk_vertices = vertices.view(-1, 3)[lmk_faces].view( + batch_size, -1, 3, 3) + + landmarks = torch.einsum('blfi,blf->bli', [lmk_vertices, lmk_bary_coords]) + return landmarks + + +def lbs( + betas: Tensor, + pose: Tensor, + v_template: Tensor, + shapedirs: Tensor, + posedirs: Tensor, + J_regressor: Tensor, + parents: Tensor, + lbs_weights: Tensor, + pose2rot: bool = True, + return_affine_mat = False, +) -> Tuple[Tensor, Tensor]: + ''' Performs Linear Blend Skinning with the given shape and pose parameters + + Parameters + ---------- + betas : torch.tensor BxNB + The tensor of shape parameters + pose : torch.tensor Bx(J + 1) * 3 + The pose parameters in axis-angle format + v_template torch.tensor BxVx3 + The template mesh that will be deformed + shapedirs : torch.tensor 1xNB + The tensor of PCA shape displacements + posedirs : torch.tensor Px(V * 3) + The pose PCA coefficients + J_regressor : torch.tensor JxV + The regressor array that is used to calculate the joints from + the position of the vertices + parents: torch.tensor J + The array that describes the kinematic tree for the model + lbs_weights: torch.tensor N x V x (J + 1) + The linear blend skinning weights that represent how much the + rotation matrix of each part affects each vertex + pose2rot: bool, optional + Flag on whether to convert the input pose tensor to rotation + matrices. The default value is True. If False, then the pose tensor + should already contain rotation matrices and have a size of + Bx(J + 1)x9 + dtype: torch.dtype, optional + + Returns + ------- + verts: torch.tensor BxVx3 + The vertices of the mesh after applying the shape and pose + displacements. + joints: torch.tensor BxJx3 + The joints of the model + ''' + + batch_size = max(betas.shape[0], pose.shape[0]) + device, dtype = betas.device, betas.dtype + + # Add shape contribution + v_shaped = v_template + blend_shapes(betas, shapedirs) + + # Get the joints + # NxJx3 array + J = vertices2joints(J_regressor, v_shaped) + + # 3. Add pose blend shapes + # N x J x 3 x 3 + ident = torch.eye(3, dtype=dtype, device=device) + if pose2rot: + rot_mats = batch_rodrigues(pose.view(-1, 3)).view( + [batch_size, -1, 3, 3]) + + pose_feature = (rot_mats[:, 1:, :, :] - ident).view([batch_size, -1]) + # (N x P) x (P, V * 3) -> N x V x 3 + pose_offsets = torch.matmul( + pose_feature, posedirs).view(batch_size, -1, 3) + else: + pose_feature = pose[:, 1:].view(batch_size, -1, 3, 3) - ident + rot_mats = pose.view(batch_size, -1, 3, 3) + + pose_offsets = torch.matmul(pose_feature.view(batch_size, -1), + posedirs).view(batch_size, -1, 3) + + v_posed = pose_offsets + v_shaped + # 4. Get the global joint location + J_transformed, A = batch_rigid_transform(rot_mats, J, parents, dtype=dtype) + + # 5. Do skinning: + # W is N x V x (J + 1) + W = lbs_weights.unsqueeze(dim=0).expand([batch_size, -1, -1]) + # (N x V x (J + 1)) x (N x (J + 1) x 16) + num_joints = J_regressor.shape[0] + T = torch.matmul(W, A.view(batch_size, num_joints, 16)) \ + .view(batch_size, -1, 4, 4) + + homogen_coord = torch.ones([batch_size, v_posed.shape[1], 1], + dtype=dtype, device=device) + v_posed_homo = torch.cat([v_posed, homogen_coord], dim=2) + v_homo = torch.matmul(T, torch.unsqueeze(v_posed_homo, dim=-1)) + + verts = v_homo[:, :, :3, 0] + + if return_affine_mat: + return verts, J_transformed, A + else: + return verts, J_transformed + + +def vertices2joints(J_regressor: Tensor, vertices: Tensor) -> Tensor: + ''' Calculates the 3D joint locations from the vertices + + Parameters + ---------- + J_regressor : torch.tensor JxV + The regressor array that is used to calculate the joints from the + position of the vertices + vertices : torch.tensor BxVx3 + The tensor of mesh vertices + + Returns + ------- + torch.tensor BxJx3 + The location of the joints + ''' + + return torch.einsum('bik,ji->bjk', [vertices, J_regressor]) + + +def blend_shapes(betas: Tensor, shape_disps: Tensor) -> Tensor: + ''' Calculates the per vertex displacement due to the blend shapes + + + Parameters + ---------- + betas : torch.tensor Bx(num_betas) + Blend shape coefficients + shape_disps: torch.tensor Vx3x(num_betas) + Blend shapes + + Returns + ------- + torch.tensor BxVx3 + The per-vertex displacement due to shape deformation + ''' + + # Displacement[b, m, k] = sum_{l} betas[b, l] * shape_disps[m, k, l] + # i.e. Multiply each shape displacement by its corresponding beta and + # then sum them. + blend_shape = torch.einsum('bl,mkl->bmk', [betas, shape_disps]) + return blend_shape + + +def batch_rodrigues( + rot_vecs: Tensor, + epsilon: float = 1e-8, +) -> Tensor: + ''' Calculates the rotation matrices for a batch of rotation vectors + Parameters + ---------- + rot_vecs: torch.tensor Nx3 + array of N axis-angle vectors + Returns + ------- + R: torch.tensor Nx3x3 + The rotation matrices for the given axis-angle parameters + ''' + + batch_size = rot_vecs.shape[0] + device, dtype = rot_vecs.device, rot_vecs.dtype + + angle = torch.norm(rot_vecs + 1e-8, dim=1, keepdim=True) + rot_dir = rot_vecs / angle + + cos = torch.unsqueeze(torch.cos(angle), dim=1) + sin = torch.unsqueeze(torch.sin(angle), dim=1) + + # Bx1 arrays + rx, ry, rz = torch.split(rot_dir, 1, dim=1) + K = torch.zeros((batch_size, 3, 3), dtype=dtype, device=device) + + zeros = torch.zeros((batch_size, 1), dtype=dtype, device=device) + K = torch.cat([zeros, -rz, ry, rz, zeros, -rx, -ry, rx, zeros], dim=1) \ + .view((batch_size, 3, 3)) + + ident = torch.eye(3, dtype=dtype, device=device).unsqueeze(dim=0) + rot_mat = ident + sin * K + (1 - cos) * torch.bmm(K, K) + return rot_mat + + +def transform_mat(R: Tensor, t: Tensor) -> Tensor: + ''' Creates a batch of transformation matrices + Args: + - R: Bx3x3 array of a batch of rotation matrices + - t: Bx3x1 array of a batch of translation vectors + Returns: + - T: Bx4x4 Transformation matrix + ''' + # No padding left or right, only add an extra row + return torch.cat([F.pad(R, [0, 0, 0, 1]), + F.pad(t, [0, 0, 0, 1], value=1)], dim=2) + + +def batch_rigid_transform( + rot_mats: Tensor, + joints: Tensor, + parents: Tensor, + dtype=torch.float32 +) -> Tensor: + """ + Applies a batch of rigid transformations to the joints + + Parameters + ---------- + rot_mats : torch.tensor BxNx3x3 + Tensor of rotation matrices + joints : torch.tensor BxNx3 + Locations of joints + parents : torch.tensor BxN + The kinematic tree of each object + dtype : torch.dtype, optional: + The data type of the created tensors, the default is torch.float32 + + Returns + ------- + posed_joints : torch.tensor BxNx3 + The locations of the joints after applying the pose rotations + rel_transforms : torch.tensor BxNx4x4 + The relative (with respect to the root joint) rigid transformations + for all the joints + """ + + joints = torch.unsqueeze(joints, dim=-1) + + rel_joints = joints.clone() + rel_joints[:, 1:] -= joints[:, parents[1:]] + + transforms_mat = transform_mat( + rot_mats.reshape(-1, 3, 3), + rel_joints.reshape(-1, 3, 1)).reshape(-1, joints.shape[1], 4, 4) + + transform_chain = [transforms_mat[:, 0]] + for i in range(1, parents.shape[0]): + # Subtract the joint location at the rest pose + # No need for rotation, since it's identity when at rest + curr_res = torch.matmul(transform_chain[parents[i]], + transforms_mat[:, i]) + transform_chain.append(curr_res) + + transforms = torch.stack(transform_chain, dim=1) + + # The last column of the transformations contains the posed joints + posed_joints = transforms[:, :, :3, 3] + + joints_homogen = F.pad(joints, [0, 0, 0, 1]) + + rel_transforms = transforms - F.pad( + torch.matmul(transforms, joints_homogen), [3, 0, 0, 0, 0, 0, 0, 0]) + + return posed_joints, rel_transforms diff --git a/AnimatableGaussians/smplx/utils.py b/AnimatableGaussians/smplx/utils.py new file mode 100644 index 0000000000000000000000000000000000000000..957e4b3a4230998e9310b1d6a5f8d3c550f93740 --- /dev/null +++ b/AnimatableGaussians/smplx/utils.py @@ -0,0 +1,128 @@ +# -*- coding: utf-8 -*- + +# Max-Planck-Gesellschaft zur Förderung der Wissenschaften e.V. (MPG) is +# holder of all proprietary rights on this computer program. +# You can only use this computer program if you have closed +# a license agreement with MPG or you get the right to use the computer +# program from someone who is authorized to grant you that right. +# Any use of the computer program without a valid license is prohibited and +# liable to prosecution. +# +# Copyright©2019 Max-Planck-Gesellschaft zur Förderung +# der Wissenschaften e.V. (MPG). acting on behalf of its Max Planck Institute +# for Intelligent Systems. All rights reserved. +# +# Contact: ps-license@tuebingen.mpg.de + +from typing import NewType, Union, Optional +from dataclasses import dataclass, asdict, fields +import numpy as np +import torch + +Tensor = NewType('Tensor', torch.Tensor) +Array = NewType('Array', np.ndarray) + + +@dataclass +class ModelOutput: + vertices: Optional[Tensor] = None + joints: Optional[Tensor] = None + full_pose: Optional[Tensor] = None + global_orient: Optional[Tensor] = None + transl: Optional[Tensor] = None + v_shaped: Optional[Tensor] = None + + def __getitem__(self, key): + return getattr(self, key) + + def get(self, key, default=None): + return getattr(self, key, default) + + def __iter__(self): + return self.keys() + + def keys(self): + keys = [t.name for t in fields(self)] + return iter(keys) + + def values(self): + values = [getattr(self, t.name) for t in fields(self)] + return iter(values) + + def items(self): + data = [(t.name, getattr(self, t.name)) for t in fields(self)] + return iter(data) + + +@dataclass +class SMPLOutput(ModelOutput): + betas: Optional[Tensor] = None + body_pose: Optional[Tensor] = None + A: Optional[Tensor] = None + + +@dataclass +class SMPLHOutput(SMPLOutput): + left_hand_pose: Optional[Tensor] = None + right_hand_pose: Optional[Tensor] = None + transl: Optional[Tensor] = None + + +@dataclass +class SMPLXOutput(SMPLHOutput): + expression: Optional[Tensor] = None + jaw_pose: Optional[Tensor] = None + A: Optional[Tensor] = None + + +@dataclass +class MANOOutput(ModelOutput): + betas: Optional[Tensor] = None + hand_pose: Optional[Tensor] = None + + +@dataclass +class FLAMEOutput(ModelOutput): + betas: Optional[Tensor] = None + expression: Optional[Tensor] = None + jaw_pose: Optional[Tensor] = None + neck_pose: Optional[Tensor] = None + + +def find_joint_kin_chain(joint_id, kinematic_tree): + kin_chain = [] + curr_idx = joint_id + while curr_idx != -1: + kin_chain.append(curr_idx) + curr_idx = kinematic_tree[curr_idx] + return kin_chain + + +def to_tensor( + array: Union[Array, Tensor], dtype=torch.float32 +) -> Tensor: + if torch.is_tensor(array): + return array + else: + return torch.tensor(array, dtype=dtype) + + +class Struct(object): + def __init__(self, **kwargs): + for key, val in kwargs.items(): + setattr(self, key, val) + + +def to_np(array, dtype=np.float32): + if 'scipy.sparse' in str(type(array)): + array = array.todense() + return np.array(array, dtype=dtype) + + +def rot_mat_to_euler(rot_mats): + # Calculates rotation matrix to euler angles + # Careful for extreme cases of eular angles like [0.0, pi, 0.0] + + sy = torch.sqrt(rot_mats[:, 0, 0] * rot_mats[:, 0, 0] + + rot_mats[:, 1, 0] * rot_mats[:, 1, 0]) + return torch.atan2(-rot_mats[:, 2, 0], sy) diff --git a/AnimatableGaussians/smplx/vertex_ids.py b/AnimatableGaussians/smplx/vertex_ids.py new file mode 100644 index 0000000000000000000000000000000000000000..8122698a4c8a2ddc70cef73881b6137495d36a22 --- /dev/null +++ b/AnimatableGaussians/smplx/vertex_ids.py @@ -0,0 +1,77 @@ +# -*- coding: utf-8 -*- + +# Max-Planck-Gesellschaft zur Förderung der Wissenschaften e.V. (MPG) is +# holder of all proprietary rights on this computer program. +# You can only use this computer program if you have closed +# a license agreement with MPG or you get the right to use the computer +# program from someone who is authorized to grant you that right. +# Any use of the computer program without a valid license is prohibited and +# liable to prosecution. +# +# Copyright©2019 Max-Planck-Gesellschaft zur Förderung +# der Wissenschaften e.V. (MPG). acting on behalf of its Max Planck Institute +# for Intelligent Systems. All rights reserved. +# +# Contact: ps-license@tuebingen.mpg.de + +from __future__ import print_function +from __future__ import absolute_import +from __future__ import division + +# Joint name to vertex mapping. SMPL/SMPL-H/SMPL-X vertices that correspond to +# MSCOCO and OpenPose joints +vertex_ids = { + 'smplh': { + 'nose': 332, + 'reye': 6260, + 'leye': 2800, + 'rear': 4071, + 'lear': 583, + 'rthumb': 6191, + 'rindex': 5782, + 'rmiddle': 5905, + 'rring': 6016, + 'rpinky': 6133, + 'lthumb': 2746, + 'lindex': 2319, + 'lmiddle': 2445, + 'lring': 2556, + 'lpinky': 2673, + 'LBigToe': 3216, + 'LSmallToe': 3226, + 'LHeel': 3387, + 'RBigToe': 6617, + 'RSmallToe': 6624, + 'RHeel': 6787 + }, + 'smplx': { + 'nose': 9120, + 'reye': 9929, + 'leye': 9448, + 'rear': 616, + 'lear': 6, + 'rthumb': 8079, + 'rindex': 7669, + 'rmiddle': 7794, + 'rring': 7905, + 'rpinky': 8022, + 'lthumb': 5361, + 'lindex': 4933, + 'lmiddle': 5058, + 'lring': 5169, + 'lpinky': 5286, + 'LBigToe': 5770, + 'LSmallToe': 5780, + 'LHeel': 8846, + 'RBigToe': 8463, + 'RSmallToe': 8474, + 'RHeel': 8635 + }, + 'mano': { + 'thumb': 744, + 'index': 320, + 'middle': 443, + 'ring': 554, + 'pinky': 671, + } +} diff --git a/AnimatableGaussians/smplx/vertex_joint_selector.py b/AnimatableGaussians/smplx/vertex_joint_selector.py new file mode 100644 index 0000000000000000000000000000000000000000..83ab0f7d7e1da5a513b81b1bbff85a57acf53608 --- /dev/null +++ b/AnimatableGaussians/smplx/vertex_joint_selector.py @@ -0,0 +1,77 @@ +# -*- coding: utf-8 -*- + +# Max-Planck-Gesellschaft zur Förderung der Wissenschaften e.V. (MPG) is +# holder of all proprietary rights on this computer program. +# You can only use this computer program if you have closed +# a license agreement with MPG or you get the right to use the computer +# program from someone who is authorized to grant you that right. +# Any use of the computer program without a valid license is prohibited and +# liable to prosecution. +# +# Copyright©2019 Max-Planck-Gesellschaft zur Förderung +# der Wissenschaften e.V. (MPG). acting on behalf of its Max Planck Institute +# for Intelligent Systems. All rights reserved. +# +# Contact: ps-license@tuebingen.mpg.de + +from __future__ import absolute_import +from __future__ import print_function +from __future__ import division + +import numpy as np + +import torch +import torch.nn as nn + +from .utils import to_tensor + + +class VertexJointSelector(nn.Module): + + def __init__(self, vertex_ids=None, + use_hands=True, + use_feet_keypoints=True, **kwargs): + super(VertexJointSelector, self).__init__() + + extra_joints_idxs = [] + + face_keyp_idxs = np.array([ + vertex_ids['nose'], + vertex_ids['reye'], + vertex_ids['leye'], + vertex_ids['rear'], + vertex_ids['lear']], dtype=np.int64) + + extra_joints_idxs = np.concatenate([extra_joints_idxs, + face_keyp_idxs]) + + if use_feet_keypoints: + feet_keyp_idxs = np.array([vertex_ids['LBigToe'], + vertex_ids['LSmallToe'], + vertex_ids['LHeel'], + vertex_ids['RBigToe'], + vertex_ids['RSmallToe'], + vertex_ids['RHeel']], dtype=np.int32) + + extra_joints_idxs = np.concatenate( + [extra_joints_idxs, feet_keyp_idxs]) + + if use_hands: + self.tip_names = ['thumb', 'index', 'middle', 'ring', 'pinky'] + + tips_idxs = [] + for hand_id in ['l', 'r']: + for tip_name in self.tip_names: + tips_idxs.append(vertex_ids[hand_id + tip_name]) + + extra_joints_idxs = np.concatenate( + [extra_joints_idxs, tips_idxs]) + + self.register_buffer('extra_joints_idxs', + to_tensor(extra_joints_idxs, dtype=torch.long)) + + def forward(self, vertices, joints): + extra_joints = torch.index_select(vertices, 1, self.extra_joints_idxs) + joints = torch.cat([joints, extra_joints], dim=1) + + return joints diff --git a/AnimatableGaussians/utils/__pycache__/camera_dir.cpython-310.pyc b/AnimatableGaussians/utils/__pycache__/camera_dir.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6b30f5b76c00be1f104a9e5815f14cab40ce6c73 Binary files /dev/null and b/AnimatableGaussians/utils/__pycache__/camera_dir.cpython-310.pyc differ diff --git a/AnimatableGaussians/utils/__pycache__/general_utils.cpython-310.pyc b/AnimatableGaussians/utils/__pycache__/general_utils.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9728930b6db3189e7e24544a1737ba31bed72582 Binary files /dev/null and b/AnimatableGaussians/utils/__pycache__/general_utils.cpython-310.pyc differ diff --git a/AnimatableGaussians/utils/__pycache__/general_utils.cpython-38.pyc b/AnimatableGaussians/utils/__pycache__/general_utils.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..46c7905e587bdcd644f7826a06cfb8c651a49d42 Binary files /dev/null and b/AnimatableGaussians/utils/__pycache__/general_utils.cpython-38.pyc differ diff --git a/AnimatableGaussians/utils/__pycache__/geo_util.cpython-310.pyc b/AnimatableGaussians/utils/__pycache__/geo_util.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fe6e9bc05f7c2fed00ed3f5234089239febd4ed3 Binary files /dev/null and b/AnimatableGaussians/utils/__pycache__/geo_util.cpython-310.pyc differ diff --git a/AnimatableGaussians/utils/__pycache__/geo_util.cpython-38.pyc b/AnimatableGaussians/utils/__pycache__/geo_util.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..67e4d99e3a4a339151e80a327dd043800a653201 Binary files /dev/null and b/AnimatableGaussians/utils/__pycache__/geo_util.cpython-38.pyc differ diff --git a/AnimatableGaussians/utils/__pycache__/graphics_utils.cpython-310.pyc b/AnimatableGaussians/utils/__pycache__/graphics_utils.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..57f50d7582b5bc8f0446892b2ef8b472f4e5bbc1 Binary files /dev/null and b/AnimatableGaussians/utils/__pycache__/graphics_utils.cpython-310.pyc differ diff --git a/AnimatableGaussians/utils/__pycache__/graphics_utils.cpython-38.pyc b/AnimatableGaussians/utils/__pycache__/graphics_utils.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c00cdd6954849de24366f2f256ac60fcfd2d2ad3 Binary files /dev/null and b/AnimatableGaussians/utils/__pycache__/graphics_utils.cpython-38.pyc differ diff --git a/AnimatableGaussians/utils/__pycache__/knn.cpython-310.pyc b/AnimatableGaussians/utils/__pycache__/knn.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e9076ded34f453581018a2c206d7ce6fe2cd06c6 Binary files /dev/null and b/AnimatableGaussians/utils/__pycache__/knn.cpython-310.pyc differ diff --git a/AnimatableGaussians/utils/__pycache__/knn.cpython-38.pyc b/AnimatableGaussians/utils/__pycache__/knn.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d3ae7aad48ad3ed6dff3047af0fc21aa95629d95 Binary files /dev/null and b/AnimatableGaussians/utils/__pycache__/knn.cpython-38.pyc differ diff --git a/AnimatableGaussians/utils/__pycache__/nerf_util.cpython-310.pyc b/AnimatableGaussians/utils/__pycache__/nerf_util.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4a1fec8cf62a8da9e3c5e6464ab9b211a20df272 Binary files /dev/null and b/AnimatableGaussians/utils/__pycache__/nerf_util.cpython-310.pyc differ diff --git a/AnimatableGaussians/utils/__pycache__/nerf_util.cpython-38.pyc b/AnimatableGaussians/utils/__pycache__/nerf_util.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..814600134a50428c4d908f378f98cd9ebc9a5591 Binary files /dev/null and b/AnimatableGaussians/utils/__pycache__/nerf_util.cpython-38.pyc differ diff --git a/AnimatableGaussians/utils/__pycache__/net_util.cpython-310.pyc b/AnimatableGaussians/utils/__pycache__/net_util.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..50f75d1d0e35b98eed30bb234eab260999459c30 Binary files /dev/null and b/AnimatableGaussians/utils/__pycache__/net_util.cpython-310.pyc differ diff --git a/AnimatableGaussians/utils/__pycache__/net_util.cpython-38.pyc b/AnimatableGaussians/utils/__pycache__/net_util.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..cf7651d30a75d6cde07d266fa2360db43a162fe3 Binary files /dev/null and b/AnimatableGaussians/utils/__pycache__/net_util.cpython-38.pyc differ diff --git a/AnimatableGaussians/utils/__pycache__/obj_io.cpython-310.pyc b/AnimatableGaussians/utils/__pycache__/obj_io.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b203ad445935acee0d4d31cd68767c112d7b4660 Binary files /dev/null and b/AnimatableGaussians/utils/__pycache__/obj_io.cpython-310.pyc differ diff --git a/AnimatableGaussians/utils/__pycache__/obj_io.cpython-38.pyc b/AnimatableGaussians/utils/__pycache__/obj_io.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..52813a3442ff12e6a72783dacd983c7668cd82ed Binary files /dev/null and b/AnimatableGaussians/utils/__pycache__/obj_io.cpython-38.pyc differ diff --git a/AnimatableGaussians/utils/__pycache__/sh_utils.cpython-310.pyc b/AnimatableGaussians/utils/__pycache__/sh_utils.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a7c502c24fcfd1b0b4c10f54dc786391c387b4c5 Binary files /dev/null and b/AnimatableGaussians/utils/__pycache__/sh_utils.cpython-310.pyc differ diff --git a/AnimatableGaussians/utils/__pycache__/sh_utils.cpython-38.pyc b/AnimatableGaussians/utils/__pycache__/sh_utils.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c3e11ca137d25f4d5091bc5044855cbb68121c6c Binary files /dev/null and b/AnimatableGaussians/utils/__pycache__/sh_utils.cpython-38.pyc differ diff --git a/AnimatableGaussians/utils/__pycache__/visualize_util.cpython-310.pyc b/AnimatableGaussians/utils/__pycache__/visualize_util.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5fe76214a72ce7e577c4ab277893fc265d47d2a6 Binary files /dev/null and b/AnimatableGaussians/utils/__pycache__/visualize_util.cpython-310.pyc differ diff --git a/AnimatableGaussians/utils/__pycache__/visualize_util.cpython-38.pyc b/AnimatableGaussians/utils/__pycache__/visualize_util.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0ba87adfa8bc05884331b0dcebd190289d7fd073 Binary files /dev/null and b/AnimatableGaussians/utils/__pycache__/visualize_util.cpython-38.pyc differ diff --git a/AnimatableGaussians/utils/camera_dir.py b/AnimatableGaussians/utils/camera_dir.py new file mode 100644 index 0000000000000000000000000000000000000000..e3c8c989e2f3d811fdd763126687ef7e9b35c228 --- /dev/null +++ b/AnimatableGaussians/utils/camera_dir.py @@ -0,0 +1,119 @@ +import numpy as np +import AnimatableGaussians.utils.visualize_util as visualize_util + +def get_camera_dir(idx,object_center,global_orient,img_scale,view_setting): + + if view_setting.startswith('free'): + # free view setting + # frame_num_per_circle = 360 + # print(self.opt['test'].get('global_orient', False)) + frame_num_per_circle = 360 + rot_Y = (idx % frame_num_per_circle) / float(frame_num_per_circle) * 2 * np.pi + + extr = visualize_util.calc_free_mv(object_center, + tar_pos = np.array([0, 0, 2.5]), + rot_Y = rot_Y, + rot_X = 0.3 if view_setting.endswith('bird') else 0., + global_orient = global_orient) + intr = np.array([[1100, 0, 512], [0, 1100, 512], [0, 0, 1]], np.float32) + intr[:2] *= img_scale + img_h = int(1024 * img_scale) + img_w = int(1024 * img_scale) + + + elif view_setting.startswith('degree120'): + # print('we render 120 degree') + # +- 60 degree + frame_per_cycle = 480 + max_degree = 60 + frame_half_cycle = frame_per_cycle // 2 + if idx%frame_per_cycle < frame_per_cycle/2: + rot_Y = -max_degree + (2 * max_degree / frame_half_cycle) * (idx%frame_half_cycle) + # rot_Y = (idx % frame_per_60) / float(frame_per_60) * 2 * np.pi + else: + rot_Y = max_degree - (2 * max_degree / frame_half_cycle) * (idx%frame_half_cycle) + + # to radian + rot_Y = rot_Y * np.pi / 180 + if rot_Y<0: + rot_Y = rot_Y + 2 * np.pi + # print('rot_Y: ', rot_Y) + extr = visualize_util.calc_free_mv(object_center, + tar_pos = np.array([0, 0, 2.5]), + rot_Y = rot_Y, + rot_X = 0.3 if view_setting.endswith('bird') else 0., + global_orient = global_orient) + intr = np.array([[1100, 0, 512], [0, 1100, 512], [0, 0, 1]], np.float32) + intr[:2] *= img_scale + img_h = int(1024 * img_scale) + img_w = int(1024 * img_scale) + + + elif view_setting.startswith('degree90'): + # print('we render 90 degree') + # +- 60 degree + frame_per_cycle = 360 + max_degree = 45 + frame_half_cycle = frame_per_cycle // 2 + if idx%frame_per_cycle < frame_per_cycle/2: + rot_Y = -max_degree + (2 * max_degree / frame_half_cycle) * (idx%frame_half_cycle) + # rot_Y = (idx % frame_per_60) / float(frame_per_60) * 2 * np.pi + else: + rot_Y = max_degree - (2 * max_degree / frame_half_cycle) * (idx%frame_half_cycle) + + # to radian + rot_Y = rot_Y * np.pi / 180 + if rot_Y<0: + rot_Y = rot_Y + 2 * np.pi + # print('rot_Y: ', rot_Y) + extr = visualize_util.calc_free_mv(object_center, + tar_pos = np.array([0, 0, 2.5]), + rot_Y = rot_Y, + rot_X = 0.3 if view_setting.endswith('bird') else 0., + global_orient = global_orient) + intr = np.array([[1100, 0, 512], [0, 1100, 512], [0, 0, 1]], np.float32) + intr[:2] *= img_scale + img_h = int(1024 * img_scale) + img_w = int(1024 * img_scale) + + elif view_setting.startswith('front'): + # front view setting + extr = visualize_util.calc_free_mv(object_center, + tar_pos = np.array([0, 0, 2.5]), + rot_Y = 0., + rot_X = 0.3 if view_setting.endswith('bird') else 0., + global_orient = global_orient) + intr = np.array([[1100, 0, 512], [0, 1100, 512], [0, 0, 1]], np.float32) + intr[:2] *= img_scale + img_h = int(1024 * img_scale) + img_w = int(1024 * img_scale) + + elif view_setting.startswith('back'): + # back view setting + extr = visualize_util.calc_free_mv(object_center, + tar_pos = np.array([0, 0, 2.5]), + rot_Y = np.pi, + rot_X = 0.5 * np.pi / 4. if view_setting.endswith('bird') else 0., + global_orient = global_orient) + intr = np.array([[1100, 0, 512], [0, 1100, 512], [0, 0, 1]], np.float32) + intr[:2] *= img_scale + img_h = int(1024 * img_scale) + img_w = int(1024 * img_scale) + elif view_setting.startswith('moving'): + # moving camera setting + extr = visualize_util.calc_free_mv(object_center, + # tar_pos = np.array([0, 0, 3.0]), + # rot_Y = -0.3, + tar_pos = np.array([0, 0, 2.5]), + rot_Y = 0., + rot_X = 0.3 if view_setting.endswith('bird') else 0., + global_orient = global_orient) + intr = np.array([[1100, 0, 512], [0, 1100, 512], [0, 0, 1]], np.float32) + intr[:2] *= img_scale + img_h = int(1024 * img_scale) + img_w = int(1024 * img_scale) + + else: + raise ValueError('Invalid view setting for animation!') + + return extr, intr, img_h, img_w \ No newline at end of file diff --git a/AnimatableGaussians/utils/embedder.py b/AnimatableGaussians/utils/embedder.py new file mode 100644 index 0000000000000000000000000000000000000000..6347a1120dcaac15df2dfee7fb5ba03e7553dbff --- /dev/null +++ b/AnimatableGaussians/utils/embedder.py @@ -0,0 +1,50 @@ +import torch + + +class Embedder: + def __init__(self, **kwargs): + self.kwargs = kwargs + self.create_embedding_fn() + + def create_embedding_fn(self): + embed_fns = [] + d = self.kwargs['input_dims'] + out_dim = 0 + if self.kwargs['include_input']: + embed_fns.append(lambda x: x) + out_dim += d + + max_freq = self.kwargs['max_freq_log2'] + N_freqs = self.kwargs['num_freqs'] + + if self.kwargs['log_sampling']: + freq_bands = 2. ** torch.linspace(0., max_freq, N_freqs) + else: + freq_bands = torch.linspace(2.**0., 2.**max_freq, N_freqs) + + for freq in freq_bands: + for p_fn in self.kwargs['periodic_fns']: + embed_fns.append(lambda x, p_fn=p_fn, + freq=freq: p_fn(x * freq)) + out_dim += d + + self.embed_fns = embed_fns + self.out_dim = out_dim + + def embed(self, inputs): + return torch.cat([fn(inputs) for fn in self.embed_fns], -1) + + +def get_embedder(multires, input_dims=3): + embed_kwargs = { + 'include_input': True, + 'input_dims': input_dims, + 'max_freq_log2': multires-1, + 'num_freqs': multires, + 'log_sampling': True, + 'periodic_fns': [torch.sin, torch.cos], + } + + embedder_obj = Embedder(**embed_kwargs) + def embed(x, eo=embedder_obj): return eo.embed(x) + return embed, embedder_obj.out_dim diff --git a/AnimatableGaussians/utils/feature2d.py b/AnimatableGaussians/utils/feature2d.py new file mode 100644 index 0000000000000000000000000000000000000000..a8f6aa650b015a47296c6d043589c111649ce4c7 --- /dev/null +++ b/AnimatableGaussians/utils/feature2d.py @@ -0,0 +1,265 @@ +import torch +import torch.nn as nn +import math + +# from lib.modules.stylegan2 import Generator +# from lib.ops.styleGAN import grid_sample_gradfix + + +def conv3x3(in_channels, out_channels, stride=1, use_bn=False): + assert stride == 1 or stride == 2 + layers = [nn.Conv2d(in_channels, out_channels, kernel_size=3, stride=stride, padding=1, bias=False), + nn.LeakyReLU(0.2, inplace=True)] + if use_bn: + layers.append(nn.BatchNorm2d(out_channels)) + return nn.Sequential(*layers) + + +def deconv3x3(in_channels, out_channels, use_bn=False): + layers = [nn.Upsample(scale_factor=2, mode='bilinear', align_corners=True), + nn.Conv2d(in_channels, out_channels, kernel_size=3, stride=1, padding=1, bias=False), + nn.LeakyReLU(0.2, inplace=True)] + if use_bn: + layers.append(nn.BatchNorm2d(out_channels)) + return nn.Sequential(*layers) + + +class ConvStack(nn.Module): + def __init__(self, + in_dim, + out_dim, + hid_dim=None, + kernel_size=5, + layer_num=3, + use_relu=False, + ): + super().__init__() + assert kernel_size in [3, 5, 7] + if hid_dim is None: + hid_dim = out_dim + padding = (kernel_size - 1) // 2 + + layers = [] + layers.append(nn.Conv2d(in_dim, hid_dim, kernel_size=kernel_size, stride=1, padding=padding, bias=False)) + if use_relu: + layers.append(nn.LeakyReLU(0.2, inplace=True)) + for i in range(layer_num - 2): + layers.append(nn.Conv2d(hid_dim, hid_dim, kernel_size=kernel_size, stride=1, padding=padding, bias=False)) + if use_relu: + layers.append(nn.LeakyReLU(0.2, inplace=True)) + layers.append(nn.Conv2d(hid_dim, out_dim, kernel_size=kernel_size, stride=1, padding=padding, bias=False)) + + self.layers = nn.Sequential(*layers) + + def forward(self, x): + return self.layers(x) + + +class Unet5d(nn.Module): + def __init__(self, in_c, out_c, nf): + super().__init__() + self.conv1 = conv3x3(in_c, nf, stride=1, use_bn=False) + self.conv2 = conv3x3(nf, 2 * nf, stride=2, use_bn=True) + self.conv3 = conv3x3(2 * nf, 4 * nf, stride=2, use_bn=True) + self.conv4 = conv3x3(4 * nf, 8 * nf, stride=2, use_bn=True) + self.conv5 = conv3x3(8 * nf, 8 * nf, stride=2, use_bn=True) + self.deconv1 = deconv3x3(8 * nf, 8 * nf, use_bn=True) + self.deconv2 = deconv3x3(2 * 8 * nf, 4 * nf, use_bn=True) + self.deconv3 = deconv3x3(2 * 4 * nf, 2 * nf, use_bn=True) + self.deconv4 = deconv3x3(2 * 2 * nf, nf, use_bn=True) + self.deconv5 = conv3x3(2 * nf, nf, stride=1, use_bn=False) + self.tail = nn.Conv2d(nf, out_c, kernel_size=1, stride=1, padding=0, bias=True) + + def forward(self, x): + # x: bs x in_c x 128 x 128 + x1 = self.conv1(x) # bs x nf x 128 x 128 + x2 = self.conv2(x1) # bs x 2nf x 64 x 64 + x3 = self.conv3(x2) # bs x 4nf x 32 x 32 + x4 = self.conv4(x3) # bs x 8nf x 16 x 16 + x5 = self.conv5(x4) # bs x 8nf x 8 x 8 + + y1 = self.deconv1(x5) # bs x 8nf x 16 x 16 + y2 = self.deconv2(torch.cat([y1, x4], dim=1)) # bs x 4nf x 32 x 32 + y3 = self.deconv3(torch.cat([y2, x3], dim=1)) # bs x 2nf x 64 x 64 + y4 = self.deconv4(torch.cat([y3, x2], dim=1)) # bs x nf x 128 x 128 + y5 = self.deconv5(torch.cat([y4, x1], dim=1)) # bs x nf x 128 x 128 + + out = self.tail(y5) + return out + + +def grid_sample(image, p2d): + # p2d: B x ... x 2 + # image: B x C x IH x IW + B, C, IH, IW = image.shape + image = image.view(B, C, IH * IW) + assert p2d.shape[0] == B + assert p2d.shape[-1] == 2 + points_shape = list(p2d.shape[1:-1]) + p2d = p2d.contiguous().view(B, 1, -1, 2) # B x 1 x N x 2 + + ix = p2d[..., 0] # B x 1 x N + iy = p2d[..., 1] # B x 1 x N + ix = ((ix + 1) / 2) * (IW - 1) + iy = ((iy + 1) / 2) * (IH - 1) + with torch.no_grad(): + ix_nw = torch.floor(ix) + iy_nw = torch.floor(iy) + ix_ne = ix_nw + 1 + iy_ne = iy_nw + ix_sw = ix_nw + iy_sw = iy_nw + 1 + ix_se = ix_nw + 1 + iy_se = iy_nw + 1 + + nw = (ix_se - ix) * (iy_se - iy) + ne = (ix - ix_sw) * (iy_sw - iy) + sw = (ix_ne - ix) * (iy - iy_ne) + se = (ix - ix_nw) * (iy - iy_nw) + + with torch.no_grad(): + torch.clamp(ix_nw, 0, IW - 1, out=ix_nw) + torch.clamp(iy_nw, 0, IH - 1, out=iy_nw) + + torch.clamp(ix_ne, 0, IW - 1, out=ix_ne) + torch.clamp(iy_ne, 0, IH - 1, out=iy_ne) + + torch.clamp(ix_sw, 0, IW - 1, out=ix_sw) + torch.clamp(iy_sw, 0, IH - 1, out=iy_sw) + + torch.clamp(ix_se, 0, IW - 1, out=ix_se) + torch.clamp(iy_se, 0, IH - 1, out=iy_se) + + nw_val = torch.gather(image, 2, (iy_nw * IW + ix_nw).long().view(B, 1, -1).expand(-1, C, -1)) # B x C x N + ne_val = torch.gather(image, 2, (iy_ne * IW + ix_ne).long().view(B, 1, -1).expand(-1, C, -1)) # B x C x N + sw_val = torch.gather(image, 2, (iy_sw * IW + ix_sw).long().view(B, 1, -1).expand(-1, C, -1)) # B x C x N + se_val = torch.gather(image, 2, (iy_se * IW + ix_se).long().view(B, 1, -1).expand(-1, C, -1)) # B x C x N + + out_val = nw_val * nw + ne_val * ne + sw_val * sw + se_val * se # B x C x N + out_val = out_val.permute(0, 2, 1).contiguous().view([B] + points_shape + [C]) + + return out_val + + +def triplane_sample(xyz, fmap): + C = fmap.shape[1] // 3 + assert fmap.shape[1] == 3 * C + fmap_list = fmap.split(C, dim=1) + output = [] + for fmapIdx, axisIdx1, axisIdx2 in zip([0, 1, 2], [0, 1, 2], [1, 2, 0]): + feat = grid_sample(torch.stack([xyz[..., axisIdx1], xyz[..., axisIdx2]], dim=-1), + fmap_list[fmapIdx].expand(xyz.shape[0], -1, -1, -1)) + output.append(feat) + return torch.cat(output, dim=-1) + + +class TriPlaneFeature(nn.Module): + def __init__(self, feat_dim, feat_size): + super().__init__() + self.feat_dim = feat_dim + self.famp = nn.Parameter(torch.randn(1, 3 * feat_dim, feat_size, feat_size).float() * 0.03) + + def forward(self, input): + return self.famp.expand(input.shape[0], -1, -1, -1) + + @staticmethod + def sample_feat(xyz, fmap): + triplane_sample(xyz, fmap) + + +class UVFeature(nn.Module): + def __init__(self, feat_dim, feat_size): + super().__init__() + self.feat_dim = feat_dim + self.famp = nn.Parameter(torch.randn(1, feat_dim, feat_size, feat_size).float() * 0.03) + + def forward(self, input): + return self.famp.expand(input.shape[0], -1, -1, -1) + + @staticmethod + def sample_feat(p2d, fmap): + return grid_sample(p2d, fmap) + + +# class TriPlaneFeature_StyleGAN(nn.Module): +# def __init__(self, feat_dim, feat_size, semantic_dim=0, style_dim=512, n_mlp=8): +# super().__init__() +# assert 2 ** int(math.log(feat_size, 2)) == feat_size +# self.semantic_dim = max(semantic_dim, 0) +# self.style_dim = style_dim +# self.feat_dim = feat_dim +# self.fc = nn.Linear(style_dim + semantic_dim, style_dim) +# self.generator = Generator(size=feat_size, dim=feat_dim * 3, style_dim=style_dim, n_mlp=n_mlp) + +# def forward(self, styles, semantic=None, randomize_noise=True): +# if isinstance(styles, (list, tuple)): +# if semantic is None: +# x = styles +# else: +# x = [self.fc(torch.cat([s, semantic], dim=-1)) for s in styles] +# elif isinstance(styles, torch.Tensor): +# if semantic is None: +# x = [styles] +# else: +# x = [torch.cat([styles, semantic], dim=-1)] +# else: +# raise NotImplementedError + +# fmap_x, fmap_y, fmap_z = self.generator(styles=x, randomize_noise=randomize_noise)[0].split(self.feat_dim, dim=1) +# return [fmap_x, fmap_y, fmap_z] + +# @staticmethod +# def sample_feat(xyz, fmap_list): +# # xyz: B x N x 3 (-1 ~ 1) +# # im_feat: B x C x H x W +# # output: B x N x f +# assert xyz.shape[-1] == 3 +# output = [] +# for fmapIdx, axisIdx1, axisIdx2 in zip([0, 1, 2], [1, 2, 0], [2, 0, 1]): +# p2d = torch.stack([xyz[..., axisIdx1], xyz[..., axisIdx2]], dim=-1) +# fmap = fmap_list[fmapIdx].expand(xyz.shape[0], -1, -1, -1) +# p2d = p2d + 1.0 / fmap.shape[-1] +# feat = grid_sample_gradfix.grid_sample(fmap, p2d.unsqueeze(2))[..., 0] +# feat = feat.permute(0, 2, 1) +# output.append(feat) +# return torch.cat(output, dim=-1) + + +# class UVFeature_StyleGAN(nn.Module): +# def __init__(self, feat_dim, feat_size, semantic_dim=0, style_dim=512, n_mlp=8): +# super().__init__() +# assert 2 ** int(math.log(feat_size, 2)) == feat_size +# self.semantic_dim = max(semantic_dim, 0) +# self.style_dim = style_dim +# self.feat_dim = feat_dim +# self.fc = nn.Linear(style_dim + semantic_dim, style_dim) +# self.generator = Generator(size=feat_size, dim=feat_dim, style_dim=style_dim, n_mlp=n_mlp) + +# def forward(self, styles, semantic=None, randomize_noise=True): +# if isinstance(styles, (list, tuple)): +# if semantic is None: +# x = styles +# else: +# x = [self.fc(torch.cat([s, semantic], dim=-1)) for s in styles] +# elif isinstance(styles, torch.Tensor): +# if semantic is None: +# x = [styles] +# else: +# x = [torch.cat([styles, semantic], dim=-1)] +# else: +# raise NotImplementedError + +# fmap = self.generator(styles=x, randomize_noise=randomize_noise)[0] +# return fmap + +# @staticmethod +# def sample_feat(p2d, fmap): +# # p2d: B x N x 2 (-1 ~ 1) +# # im_feat: B x C x H x W +# # output: B x N x f +# assert p2d.shape[-1] == 2 +# fmap = fmap.expand(p2d.shape[0], -1, -1, -1) +# p2d = p2d + 1.0 / fmap.shape[-1] +# feat = grid_sample_gradfix.grid_sample(fmap, p2d.unsqueeze(2))[..., 0] +# feat = feat.permute(0, 2, 1) +# return feat diff --git a/AnimatableGaussians/utils/general_utils.py b/AnimatableGaussians/utils/general_utils.py new file mode 100644 index 0000000000000000000000000000000000000000..ae982066ab2d04fac15e997df9dbd37620ad08ed --- /dev/null +++ b/AnimatableGaussians/utils/general_utils.py @@ -0,0 +1,133 @@ +# +# Copyright (C) 2023, Inria +# GRAPHDECO research group, https://team.inria.fr/graphdeco +# All rights reserved. +# +# This software is free for non-commercial, research and evaluation use +# under the terms of the LICENSE.md file. +# +# For inquiries contact george.drettakis@inria.fr +# + +import torch +import sys +from datetime import datetime +import numpy as np +import random + +def inverse_sigmoid(x): + return torch.log(x/(1-x)) + +def PILtoTorch(pil_image, resolution): + resized_image_PIL = pil_image.resize(resolution) + resized_image = torch.from_numpy(np.array(resized_image_PIL)) / 255.0 + if len(resized_image.shape) == 3: + return resized_image.permute(2, 0, 1) + else: + return resized_image.unsqueeze(dim=-1).permute(2, 0, 1) + +def get_expon_lr_func( + lr_init, lr_final, lr_delay_steps=0, lr_delay_mult=1.0, max_steps=1000000 +): + """ + Copied from Plenoxels + + Continuous learning rate decay function. Adapted from JaxNeRF + The returned rate is lr_init when step=0 and lr_final when step=max_steps, and + is log-linearly interpolated elsewhere (equivalent to exponential decay). + If lr_delay_steps>0 then the learning rate will be scaled by some smooth + function of lr_delay_mult, such that the initial learning rate is + lr_init*lr_delay_mult at the beginning of optimization but will be eased back + to the normal learning rate when steps>lr_delay_steps. + :param conf: config subtree 'lr' or similar + :param max_steps: int, the number of steps during optimization. + :return HoF which takes step as input + """ + + def helper(step): + if step < 0 or (lr_init == 0.0 and lr_final == 0.0): + # Disable this parameter + return 0.0 + if lr_delay_steps > 0: + # A kind of reverse cosine decay. + delay_rate = lr_delay_mult + (1 - lr_delay_mult) * np.sin( + 0.5 * np.pi * np.clip(step / lr_delay_steps, 0, 1) + ) + else: + delay_rate = 1.0 + t = np.clip(step / max_steps, 0, 1) + log_lerp = np.exp(np.log(lr_init) * (1 - t) + np.log(lr_final) * t) + return delay_rate * log_lerp + + return helper + +def strip_lowerdiag(L): + uncertainty = torch.zeros((L.shape[0], 6), dtype=torch.float, device="cuda") + + uncertainty[:, 0] = L[:, 0, 0] + uncertainty[:, 1] = L[:, 0, 1] + uncertainty[:, 2] = L[:, 0, 2] + uncertainty[:, 3] = L[:, 1, 1] + uncertainty[:, 4] = L[:, 1, 2] + uncertainty[:, 5] = L[:, 2, 2] + return uncertainty + +def strip_symmetric(sym): + return strip_lowerdiag(sym) + +def build_rotation(r): + norm = torch.sqrt(r[:,0]*r[:,0] + r[:,1]*r[:,1] + r[:,2]*r[:,2] + r[:,3]*r[:,3]) + + q = r / norm[:, None] + + R = torch.zeros((q.size(0), 3, 3), device='cuda') + + r = q[:, 0] + x = q[:, 1] + y = q[:, 2] + z = q[:, 3] + + R[:, 0, 0] = 1 - 2 * (y*y + z*z) + R[:, 0, 1] = 2 * (x*y - r*z) + R[:, 0, 2] = 2 * (x*z + r*y) + R[:, 1, 0] = 2 * (x*y + r*z) + R[:, 1, 1] = 1 - 2 * (x*x + z*z) + R[:, 1, 2] = 2 * (y*z - r*x) + R[:, 2, 0] = 2 * (x*z - r*y) + R[:, 2, 1] = 2 * (y*z + r*x) + R[:, 2, 2] = 1 - 2 * (x*x + y*y) + return R + +def build_scaling_rotation(s, r): + L = torch.zeros((s.shape[0], 3, 3), dtype=torch.float, device="cuda") + R = build_rotation(r) + + L[:,0,0] = s[:,0] + L[:,1,1] = s[:,1] + L[:,2,2] = s[:,2] + + L = R @ L + return L + +def safe_state(silent): + old_f = sys.stdout + class F: + def __init__(self, silent): + self.silent = silent + + def write(self, x): + if not self.silent: + if x.endswith("\n"): + old_f.write(x.replace("\n", " [{}]\n".format(str(datetime.now().strftime("%d/%m %H:%M:%S"))))) + else: + old_f.write(x) + + def flush(self): + old_f.flush() + + sys.stdout = F(silent) + + random.seed(0) + np.random.seed(0) + torch.manual_seed(0) + torch.cuda.set_device(torch.device("cuda:0")) diff --git a/AnimatableGaussians/utils/geo_util.py b/AnimatableGaussians/utils/geo_util.py new file mode 100644 index 0000000000000000000000000000000000000000..506606281197aba2ef7799f96d1a3e358365a6ed --- /dev/null +++ b/AnimatableGaussians/utils/geo_util.py @@ -0,0 +1,114 @@ +import torch +import torch.nn.functional as F +import numpy as np + +from AnimatableGaussians.utils.knn import knn_gather + + +def barycentric_coordinate(pts, face_vertices): + """ + :param pts: (B, N, 3) + :param face_vertices: (B, N, 3, 3) + :return bc_coords: (B, N, 3) + """ + vec0 = face_vertices[:, :, 0] - pts + vec1 = face_vertices[:, :, 1] - pts + vec2 = face_vertices[:, :, 2] - pts + area0 = torch.linalg.norm(torch.cross(vec1, vec2), dim = -1) + area1 = torch.linalg.norm(torch.cross(vec2, vec0), dim = -1) + area2 = torch.linalg.norm(torch.cross(vec0, vec1), dim = -1) + bc_coord = torch.stack([area0, area1, area2], -1) + bc_coord = F.normalize(bc_coord, p = 1, dim = -1, eps = 1e-16) + return bc_coord + + +def barycentric_interpolate(vert_attris, faces, face_ids, bc_coords): + """ + :param vert_attris: (B, V, C) + :param faces: (B, F, 3) + :param face_ids: (B, N) + :param bc_coords: (B, N, 3) + :return inter_attris: (B, N, C) + """ + selected_faces = torch.gather(faces, 1, face_ids.unsqueeze(-1).expand(-1, -1, 3)) # (B, N, 3) + face_attris = knn_gather(vert_attris, selected_faces) # (B, N, 3, C) + inter_attris = (face_attris * bc_coords.unsqueeze(-1)).sum(-2) # (B, N, C) + return inter_attris + + +def sample_surface_pts(mesh, count, mask = None, w_color = False): + """ + Modified from Scanimate code + Sample the surface of a mesh, returning the specified + number of points + For individual triangle sampling uses this method: + http://mathworld.wolfram.com/TrianglePointPicking.html + Parameters + --------- + mesh : trimesh.Trimesh + Geometry to sample the surface of + count : int + Number of points to return + Returns + --------- + samples : (count, 3) float + Points in space on the surface of mesh + face_index : (count,) int + Indices of faces for each sampled point + """ + valid_faces = mesh.faces[mask] + face_index = np.random.choice(a = valid_faces.shape[0], size = count, replace = True) + selected_faces = valid_faces[face_index] + + # pull triangles into the form of an origin + 2 vectors + tri_origins = mesh.vertices[selected_faces[:, 0]] + tri_vectors = mesh.vertices[selected_faces[:, 1:]].copy() + tri_vectors -= np.tile(tri_origins, (1, 2)).reshape((-1, 2, 3)) + + # randomly generate two 0-1 scalar components to multiply edge vectors by + random_lengths = np.random.random((len(tri_vectors), 2, 1)) + + # points will be distributed on a quadrilateral if we use 2 0-1 samples + # if the two scalar components sum less than 1.0 the point will be + # inside the triangle, so we find vectors longer than 1.0 and + # transform them to be inside the triangle + random_test = random_lengths.sum(axis = 1).reshape(-1) > 1.0 + random_lengths[random_test] -= 1.0 + random_lengths = np.abs(random_lengths) + + # multiply triangle edge vectors by the random lengths and sum + sample_vector = (tri_vectors * random_lengths).sum(axis = 1) + + # finally, offset by the origin to generate + # (n,3) points in space on the triangle + samples = sample_vector + tri_origins + + colors = None + normals = None + if w_color: + colors = mesh.visual.vertex_colors[:, :3].astype(np.float32) + colors = colors / 255.0 + colors = colors.view(np.ndarray)[selected_faces] + clr_origins = colors[:, 0] + clr_vectors = colors[:, 1:] + clr_vectors -= np.tile(clr_origins, (1, 2)).reshape((-1, 2, 3)) + + sample_color = (clr_vectors * random_lengths).sum(axis=1) + colors = sample_color + clr_origins + + normals = mesh.face_normals[face_index] + + return samples, colors, normals + + +def normalize_vert_bbox(verts, attris = None, dim=-1, per_axis=False): + bbox_min = torch.min(verts, dim=dim, keepdim=True)[0] + bbox_max = torch.max(verts, dim=dim, keepdim=True)[0] + if attris is not None: + verts = attris + verts = verts - 0.5 * (bbox_max + bbox_min) + if per_axis: + verts = 2 * verts / (bbox_max - bbox_min) + else: + verts = 2 * verts / torch.max(bbox_max-bbox_min, dim=dim, keepdim=True)[0] + return verts diff --git a/AnimatableGaussians/utils/graphics_utils.py b/AnimatableGaussians/utils/graphics_utils.py new file mode 100644 index 0000000000000000000000000000000000000000..2dc6e361eaa8ed3e44f00298135ea6fc985838fa --- /dev/null +++ b/AnimatableGaussians/utils/graphics_utils.py @@ -0,0 +1,85 @@ +# +# Copyright (C) 2023, Inria +# GRAPHDECO research group, https://team.inria.fr/graphdeco +# All rights reserved. +# +# This software is free for non-commercial, research and evaluation use +# under the terms of the LICENSE.md file. +# +# For inquiries contact george.drettakis@inria.fr +# + +import torch +import math +import numpy as np +from typing import NamedTuple + +class BasicPointCloud(NamedTuple): + points : np.array + colors : np.array + normals : np.array + +def geom_transform_points(points, transf_matrix): + P, _ = points.shape + ones = torch.ones(P, 1, dtype=points.dtype, device=points.device) + points_hom = torch.cat([points, ones], dim=1) + points_out = torch.matmul(points_hom, transf_matrix.unsqueeze(0)) + + denom = points_out[..., 3:] + 0.0000001 + return (points_out[..., :3] / denom).squeeze(dim=0) + +def getWorld2View(R, t): + Rt = np.zeros((4, 4)) + Rt[:3, :3] = R.transpose() + Rt[:3, 3] = t + Rt[3, 3] = 1.0 + return np.float32(Rt) + +def getWorld2View2(R, t, translate=np.array([.0, .0, .0]), scale=1.0): + Rt = np.zeros((4, 4)) + Rt[:3, :3] = R.transpose() + Rt[:3, 3] = t + Rt[3, 3] = 1.0 + + C2W = np.linalg.inv(Rt) + cam_center = C2W[:3, 3] + cam_center = (cam_center + translate) * scale + C2W[:3, 3] = cam_center + Rt = np.linalg.inv(C2W) + return np.float32(Rt) + +def getProjectionMatrix(znear, zfar, fovX, fovY, K = None, img_h = None, img_w = None): + if K is None: + tanHalfFovY = math.tan((fovY / 2)) + tanHalfFovX = math.tan((fovX / 2)) + top = tanHalfFovY * znear + bottom = -top + right = tanHalfFovX * znear + left = -right + else: + near_fx = znear / K[0, 0] + near_fy = znear / K[1, 1] + + left = - (img_w - K[0, 2]) * near_fx + right = K[0, 2] * near_fx + bottom = (K[1, 2] - img_h) * near_fy + top = K[1, 2] * near_fy + + P = torch.zeros(4, 4) + + z_sign = 1.0 + + P[0, 0] = 2.0 * znear / (right - left) + P[1, 1] = 2.0 * znear / (top - bottom) + P[0, 2] = (right + left) / (right - left) + P[1, 2] = (top + bottom) / (top - bottom) + P[3, 2] = z_sign + P[2, 2] = z_sign * zfar / (zfar - znear) + P[2, 3] = -(zfar * znear) / (zfar - znear) + return P + +def fov2focal(fov, pixels): + return pixels / (2 * math.tan(fov / 2)) + +def focal2fov(focal, pixels): + return 2*math.atan(pixels/(2*focal)) \ No newline at end of file diff --git a/AnimatableGaussians/utils/knn.py b/AnimatableGaussians/utils/knn.py new file mode 100644 index 0000000000000000000000000000000000000000..794aeebcc8cf717f3167c53af5fde99f7146cc26 --- /dev/null +++ b/AnimatableGaussians/utils/knn.py @@ -0,0 +1,15 @@ +import torch + + +def knn_gather(x, idx): + """ + :param x: (B, N, C) + :param idx: (B, N, K) + :return: (B, N, K, C) + """ + C = x.shape[-1] + B, N, K = idx.shape + idx_expanded = idx[:, :, :, None].expand(-1, -1, -1, C) + x_out = x[:, :, None].expand(-1, -1, K, -1).gather(1, idx_expanded) + + return x_out diff --git a/AnimatableGaussians/utils/losses.py b/AnimatableGaussians/utils/losses.py new file mode 100644 index 0000000000000000000000000000000000000000..81c26eefe26fe6f699eea3ef1b3c8841fdc7a3f9 --- /dev/null +++ b/AnimatableGaussians/utils/losses.py @@ -0,0 +1,160 @@ +""" +Losses for meshes +Borrowed from: https://github.com/ShichenLiu/SoftRas +Note that I changed the implementation of laplacian matrices from dense tensor to COO sparse tensor +""" + +import torch +import torch.nn as nn +import torch.nn.functional as F +import torch.autograd as autograd +import numpy as np + +import network.styleunet.conv2d_gradfix as conv2d_gradfix + + +class SecondOrderSmoothnessLossForSequence(nn.Module): + def __init__(self): + super(SecondOrderSmoothnessLossForSequence, self).__init__() + + def forward(self, x, dim=0): + assert x.shape[dim] > 3 + a = x.shape[dim] + a0 = torch.arange(0, a-2).long().to(x.device) + a1 = torch.arange(1, a-1).long().to(x.device) + a2 = torch.arange(2, a).long().to(x.device) + x0 = torch.index_select(x, dim, index=a0) + x1 = torch.index_select(x, dim, index=a1) + x2 = torch.index_select(x, dim, index=a2) + + l = (2*x1 - x2 - x0).pow(2) + return torch.mean(l) + + +class WeightedMSELoss(nn.Module): + def __init__(self, reduction: str = 'mean'): + super(WeightedMSELoss, self).__init__() + self.reduction = reduction + + def forward(self, pred, target, weight): + return F.mse_loss(pred * weight, target * weight, reduction=self.reduction) + + +class CosineSimilarityLoss(nn.Module): + def __init__(self, reduction: str = 'mean'): + super(CosineSimilarityLoss, self).__init__() + self.reduction = reduction + if reduction not in ['mean', 'none', 'sum']: + raise RuntimeError('Unknown reduction type! It should be in ["mean", "none", "sum"]') + + def forward(self, pred, target, weight=None, dim=-1, normalized=True): + if normalized: # assumes both ```pred``` and ```target``` have been normalized + cs = 1 - torch.sum(pred*target, dim=dim) + else: + cs = 1 - F.cosine_similarity(pred, target, dim=dim) + + if weight is not None: + cs = weight * cs + if self.reduction == 'mean': + return torch.mean(cs) + else: + return torch.sum(cs) + + +class LeastMagnitudeLoss(nn.Module): + def __init__(self, average=False): + super(LeastMagnitudeLoss, self).__init__() + self.average = average + + def forward(self, x): + batch_size = x.size(0) + dims = tuple(range(x.ndimension())[1:]) + x = x.pow(2).sum(dims) + if self.average: + return x.sum() / batch_size + else: + return x.sum() + + +class NegIOULoss(nn.Module): + def __init__(self, average=False): + super(NegIOULoss, self).__init__() + self.average = average + + def forward(self, predict, target): + dims = tuple(range(predict.ndimension())[1:]) + intersect = (predict * target).sum(dims) + union = (predict + target - predict * target).sum(dims) + 1e-6 + return 1. - (intersect / union).sum() / intersect.nelement() + + +class KLDLoss(nn.Module): + def __init__(self, reduction='mean'): + super(KLDLoss, self).__init__() + self.reduction = reduction + + def forward(self, mu, logvar): + d = -0.5 * torch.sum(1 + logvar - mu.pow(2) - logvar.exp()) + if self.reduction == 'mean': + return d / mu.shape[0] + return d + + +class PhaseTransitionsPotential(nn.Module): + """ + Refer to: Phase Transitions, Distance Functions, and Implicit Neural Representations + """ + def __init__(self, reduction='mean'): + super(PhaseTransitionsPotential, self).__init__() + self.reduction = reduction + + def forward(self, x): + assert torch.all(x >= 0) and torch.all(x <= 1) + s = 2 * x - 1 + l = s ** 2 - 2 * torch.abs(s) +1 + if self.reduction == 'mean': + return torch.mean(l) + return l + + +class TotalVariationLoss(nn.Module): + """ + https://discuss.pytorch.org/t/implement-total-variation-loss-in-pytorch/55574 + """ + def __init__(self, scale_factor=None): + super(TotalVariationLoss, self).__init__() + self.scale_factor = scale_factor + + def forward(self, x): + if self.scale_factor is not None: + x = F.interpolate(x, scale_factor=self.scale_factor, mode='nearest') + + assert len(x.shape) == 4 + tv_h = torch.pow(x[:, :, 1:, :] - x[:, :, :-1, :], 2).sum() + tv_w = torch.pow(x[:, :, :, 1:] - x[:, :, :, :-1], 2).sum() + l = (tv_h+tv_w) / np.prod(x.shape) + return l + + +def d_logistic_loss(real_pred, fake_pred): + real_loss = F.softplus(-real_pred) + fake_loss = F.softplus(fake_pred) + + return real_loss.mean() + fake_loss.mean() + + +def d_r1_loss(real_pred, real_img): + with conv2d_gradfix.no_weight_gradients(): + grad_real, = autograd.grad( + outputs=real_pred.sum(), inputs=real_img, create_graph=True + ) + grad_penalty = grad_real.pow(2).reshape(grad_real.shape[0], -1).sum(1).mean() + + return grad_penalty + + +def g_nonsaturating_loss(fake_pred): + loss = F.softplus(-fake_pred).mean() + + return loss + diff --git a/AnimatableGaussians/utils/lr_schedule.py b/AnimatableGaussians/utils/lr_schedule.py new file mode 100644 index 0000000000000000000000000000000000000000..a4c7425373770bff87ce087cc199d68236362233 --- /dev/null +++ b/AnimatableGaussians/utils/lr_schedule.py @@ -0,0 +1,65 @@ +class LearningRateSchedule: + def get_learning_rate(self, epoch): + pass + + +class ConstantLearningRateSchedule(LearningRateSchedule): + def __init__(self, value): + self.value = value + + def get_learning_rate(self, epoch): + return self.value + + +class StepLearningRateSchedule(LearningRateSchedule): + def __init__(self, initial, interval, factor, min = None): + self.initial = initial + self.interval = interval + self.factor = factor + self.min = min + + def get_learning_rate(self, iter_num): + lr = self.initial * (self.factor ** (iter_num // self.interval)) + if self.min is not None: + return max(self.min, lr) + else: + return lr + + +class WarmupLearningRateSchedule(LearningRateSchedule): + def __init__(self, initial, warmed_up, length): + self.initial = initial + self.warmed_up = warmed_up + self.length = length + + def get_learning_rate(self, epoch): + if epoch > self.length: + return self.warmed_up + return self.initial + (self.warmed_up - self.initial) * epoch / self.length + + +def get_learning_rate_schedules(type, **kwargs): + + if type == 'Step': + assert 'initial' in kwargs, 'Missing keyword argument "Initial"' + assert 'interval' in kwargs, 'Missing keyword argument "Interval"' + assert 'factor' in kwargs, 'Missing keyword argument "Factor"' + return StepLearningRateSchedule( + **kwargs + ) + elif type == 'Warmup': + assert 'initial' in kwargs, 'Missing keyword argument "Initial"' + assert 'final' in kwargs, 'Missing keyword argument "Final"' + assert 'length' in kwargs, 'Missing keyword argument "Length"' + return WarmupLearningRateSchedule( + kwargs["initial"], + kwargs["final"], + kwargs["length"], + ) + elif type == 'Constant': + assert 'value' in kwargs, 'Missing keyword argument "Value"' + return ConstantLearningRateSchedule(kwargs["value"]) + else: + raise ValueError( + 'Unknown learning rate of type "{}"! ' + 'Schedule ype must be "Step", "Warmup" or "Constant". '.format(type)) diff --git a/AnimatableGaussians/utils/nerf_util.py b/AnimatableGaussians/utils/nerf_util.py new file mode 100644 index 0000000000000000000000000000000000000000..35a9187fd2d022ffb78a5505104b3a0b7eb0173d --- /dev/null +++ b/AnimatableGaussians/utils/nerf_util.py @@ -0,0 +1,511 @@ +import torch +import torch.nn.functional as F +import numpy as np +import cv2 + + +def project(xyz, K, RT): + """ + xyz: [N, 3] + K: [3, 3] + RT: [4, 4] + """ + xyz = np.dot(xyz, RT[:3, :3].T) + RT[:3, 3:].T + xyz = np.dot(xyz, K.T) + xy = xyz[:, :2] / xyz[:, 2:] + return xy + + +def get_bound_corners(bounds): + min_x, min_y, min_z = bounds[0] + max_x, max_y, max_z = bounds[1] + corners_3d = np.array([ + [min_x, min_y, min_z], + [min_x, min_y, max_z], + [min_x, max_y, min_z], + [min_x, max_y, max_z], + [max_x, min_y, min_z], + [max_x, min_y, max_z], + [max_x, max_y, min_z], + [max_x, max_y, max_z], + ]) + return corners_3d + + +def get_bound_2d_mask(bounds, K, pose, H, W): + corners_3d = get_bound_corners(bounds) + corners_2d = project(corners_3d, K, pose) + corners_2d = np.round(corners_2d).astype(int) + mask = np.zeros((H, W), dtype=np.uint8) + cv2.fillPoly(mask, [corners_2d[[0, 1, 3, 2, 0]]], 1) + cv2.fillPoly(mask, [corners_2d[[4, 5, 7, 6, 4]]], 1) + cv2.fillPoly(mask, [corners_2d[[0, 1, 5, 4, 0]]], 1) + cv2.fillPoly(mask, [corners_2d[[2, 3, 7, 6, 2]]], 1) + cv2.fillPoly(mask, [corners_2d[[0, 2, 6, 4, 0]]], 1) + cv2.fillPoly(mask, [corners_2d[[1, 3, 7, 5, 1]]], 1) + return mask + + +def get_near_far(bounds, ray_o, ray_d): + """calculate intersections with 3d bounding box""" + bounds = bounds + np.array([-0.01, 0.01])[:, None] + nominator = bounds[None] - ray_o[:, None] + # calculate the step of intersections at six planes of the 3d bounding box + d_intersect = (nominator / (ray_d[:, None] + 1e-9)).reshape(-1, 6) + # calculate the six interections + p_intersect = d_intersect[..., None] * ray_d[:, None] + ray_o[:, None] + # calculate the intersections located at the 3d bounding box + min_x, min_y, min_z, max_x, max_y, max_z = bounds.ravel() + eps = 1e-6 + p_mask_at_box = (p_intersect[..., 0] >= (min_x - eps)) * \ + (p_intersect[..., 0] <= (max_x + eps)) * \ + (p_intersect[..., 1] >= (min_y - eps)) * \ + (p_intersect[..., 1] <= (max_y + eps)) * \ + (p_intersect[..., 2] >= (min_z - eps)) * \ + (p_intersect[..., 2] <= (max_z + eps)) + # obtain the intersections of rays which intersect exactly twice + mask_at_box = p_mask_at_box.sum(-1) == 2 + p_intervals = p_intersect[mask_at_box][p_mask_at_box[mask_at_box]].reshape( + -1, 2, 3) + + # calculate the step of intersections + ray_o = ray_o[mask_at_box] + ray_d = ray_d[mask_at_box] + norm_ray = np.linalg.norm(ray_d, axis=1) + d0 = np.linalg.norm(p_intervals[:, 0] - ray_o, axis=1) / norm_ray + d1 = np.linalg.norm(p_intervals[:, 1] - ray_o, axis=1) / norm_ray + near = np.minimum(d0, d1) + far = np.maximum(d0, d1) + + return near, far, mask_at_box + + +def get_rays(uv, extr, intr): + inv_extr = np.linalg.inv(extr) + cam_loc = inv_extr[:3, 3] + + num_samples, _ = uv.shape + + depth = np.ones((num_samples, 1)).astype(uv.dtype) + pixel_2d = np.concatenate([uv, depth], -1) + + inv_intr = np.linalg.inv(intr) + pixel_points_cam = np.einsum('ij,nj->ni', inv_intr, pixel_2d) + + world_coords = np.einsum('ij,nj->ni', inv_extr[:3, :3], pixel_points_cam) + inv_extr[:3, 3] + ray_dirs = world_coords - cam_loc[None] + ray_dirs /= (np.linalg.norm(ray_dirs, axis = -1, keepdims = True) + 1e-8) + + return ray_dirs, cam_loc[None].repeat(num_samples, axis = 0) + + +def sample_pts_on_rays(ray_o, ray_d, near, far, N_samples = 64, perturb = False, depth_guided_mask = None): + # calculate the steps for each ray + t_vals = torch.linspace(0., 1., steps = N_samples).to(near) + z_vals = near[..., None] * (1. - t_vals) + far[..., None] * t_vals + + if perturb: + # only perturb for depth_guided_mask == True + # get intervals between samples + if depth_guided_mask is None: + depth_guided_mask = torch.ones(ray_o.shape[:-1], dtype = torch.bool, device = ray_o.device) + # mids = .5 * (z_vals[..., 1:] + z_vals[..., :-1]) + # upper = torch.cat([mids, z_vals[..., -1:]], -1) + # lower = torch.cat([z_vals[..., :1], mids], -1) + # # stratified samples in those intervals + # t_rand = torch.rand(z_vals.shape).to(upper) + # z_vals = lower + (upper - lower) * t_rand + + z_vals = z_vals.view(-1, N_samples) + depth_guided_mask = depth_guided_mask.view(-1) + mids = .5 * (z_vals[depth_guided_mask, 1:] + z_vals[depth_guided_mask, :-1]) + upper = torch.cat([mids, z_vals[depth_guided_mask, -1:]], -1) + lower = torch.cat([z_vals[depth_guided_mask, :1], mids], -1) + # stratified samples in those intervals + t_rand = torch.rand(z_vals[depth_guided_mask].shape).to(upper) + z_vals[depth_guided_mask] = lower + (upper - lower) * t_rand + z_vals = z_vals.view(list(ray_o.shape[:-1]) + [N_samples]) + + pts = ray_o[:, :, None] + ray_d[:, :, None] * z_vals[..., None] + + return pts, z_vals + + +# Hierarchical sampling (section 5.2) +def sample_pdf(bins, weights, N_samples, det=False, pytest=False): + # Get pdf + weights = weights + 1e-5 # prevent nans + pdf = weights / torch.sum(weights, -1, keepdim=True) + cdf = torch.cumsum(pdf, -1) + cdf = torch.cat([torch.zeros_like(cdf[..., :1]), cdf], -1) # (batch, len(bins)) + + # Take uniform samples + if det: + u = torch.linspace(0., 1., steps=N_samples).to(weights) + u = u.expand(list(cdf.shape[:-1]) + [N_samples]) + else: + u = torch.rand(list(cdf.shape[:-1]) + [N_samples]).to(weights) + + # Pytest, overwrite u with numpy's fixed random numbers + if pytest: + np.random.seed(0) + new_shape = list(cdf.shape[:-1]) + [N_samples] + if det: + u = np.linspace(0., 1., N_samples) + u = np.broadcast_to(u, new_shape) + else: + u = np.random.rand(*new_shape) + u = torch.Tensor(u).to(weights) + + # Invert CDF + u = u.contiguous() + inds = torch.searchsorted(cdf, u, right=True) + # inds = searchsorted(cdf, u, side='right') + below = torch.max(torch.zeros_like(inds - 1), inds - 1) + above = torch.min((cdf.shape[-1] - 1) * torch.ones_like(inds), inds) + inds_g = torch.stack([below, above], -1) # (batch, N_samples, 2) + + # cdf_g = tf.gather(cdf, inds_g, axis=-1, batch_dims=len(inds_g.shape)-2) + # bins_g = tf.gather(bins, inds_g, axis=-1, batch_dims=len(inds_g.shape)-2) + matched_shape = [inds_g.shape[0], inds_g.shape[1], cdf.shape[-1]] + cdf_g = torch.gather(cdf.unsqueeze(1).expand(matched_shape), 2, inds_g) + bins_g = torch.gather(bins.unsqueeze(1).expand(matched_shape), 2, inds_g) + + denom = (cdf_g[..., 1] - cdf_g[..., 0]) + denom = torch.where(denom < 1e-5, torch.ones_like(denom), denom) + t = (u - cdf_g[..., 0]) / denom + samples = bins_g[..., 0] + t * (bins_g[..., 1] - bins_g[..., 0]) + + return samples + + +def sample_pts_on_rays_fine(rays_o, rays_d, z_vals, weights, N_importance, perturb=0.): + batch_size, rays_per_batch = rays_o.shape[:2] + + z_vals_mid = .5 * (z_vals[..., 1:] + z_vals[..., :-1]) + z_samples = sample_pdf( + z_vals_mid.view(batch_size*rays_per_batch, -1), + weights[..., 1:-1].view(batch_size*rays_per_batch, -1), + N_importance, det=(perturb==0.), pytest=False) + z_samples = z_samples.detach().view(batch_size, rays_per_batch, -1) + + z_vals, _ = torch.sort(torch.cat([z_vals, z_samples], -1), -1) + pts = rays_o[..., None, :] + rays_d[..., None, :] * z_vals[..., :, None] # [N_rays, N_samples + N_importance, 3] + return pts, z_vals + + +def raw2outputs(raw, z_vals, white_bkgd = False): + """Transforms model's predictions to semantically meaningful values. + Args: + raw: [num_rays, num_samples along ray, 4]. Prediction from model. + z_vals: [num_rays, num_samples along ray]. Integration time. + Returns: + rgb_map: [num_rays, 3]. Estimated RGB color of a ray. + disp_map: [num_rays]. Disparity map. Inverse of depth map. + acc_map: [num_rays]. Sum of weights along each ray. + weights: [num_rays, num_samples]. Weights assigned to each sampled color. + depth_map: [num_rays]. Estimated distance to object. + """ + rgb = raw[..., :-1] # [N_rays, N_samples, 3] + alpha = raw[..., -1] + + weights = alpha * torch.cumprod(torch.cat([torch.ones_like(alpha[..., :1]), 1. - alpha + 1e-10], -1), -1)[..., :-1] + rgb_map = torch.sum(weights[..., None] * rgb, -2) # [N_rays, 3] + + depth_map = torch.sum(weights * z_vals, -1) + disp_map = 1. / torch.max(1e-10 * torch.ones_like(depth_map).to(depth_map), + depth_map / torch.sum(weights, -1)) + acc_map = torch.sum(weights, -1) + + if white_bkgd: + rgb_map = rgb_map + (1. - acc_map[..., None]) + + return rgb_map, disp_map, acc_map, weights, depth_map + + +def raw2outputs2(rgb, alpha, z_vals, white_bkgd = False): + """Transforms model's predictions to semantically meaningful values. + Args: + raw: [num_rays, num_samples along ray, 4]. Prediction from model. + z_vals: [num_rays, num_samples along ray]. Integration time. + Returns: + rgb_map: [num_rays, 3]. Estimated RGB color of a ray. + disp_map: [num_rays]. Disparity map. Inverse of depth map. + acc_map: [num_rays]. Sum of weights along each ray. + weights: [num_rays, num_samples]. Weights assigned to each sampled color. + depth_map: [num_rays]. Estimated distance to object. + """ + + weights = alpha * torch.cumprod(torch.cat([torch.ones_like(alpha[..., :1]), 1. - alpha + 1e-10], -1), -1)[..., :-1] + rgb_map = torch.sum(weights[..., None] * rgb, -2) # [N_rays, 3] + + depth_map = torch.sum(weights * z_vals, -1) + disp_map = 1. / torch.max(1e-10 * torch.ones_like(depth_map).to(depth_map), + depth_map / torch.sum(weights, -1)) + acc_map = torch.sum(weights, -1) + + if white_bkgd: + rgb_map = rgb_map + (1. - acc_map[..., None]) + + return rgb_map, disp_map, acc_map, weights, depth_map + + +def gen_uv(img_w, img_h): + x, y = np.meshgrid(np.linspace(0, img_w - 1, img_w, dtype = np.int), + np.linspace(0, img_h - 1, img_h, dtype = np.int)) + uv = np.stack([x, y], axis = -1) + return uv + + +def sample_randomly_for_nerf_rendering(color_img, + mask_img, + depth_img, + extr, + intr, + live_bounds, + sample_num = 1024, + inside_radio = 0.5, + unsample_region_mask = None): + assert color_img.shape[:2] == mask_img.shape[:2] and color_img.shape[:2] == depth_img.shape[:2] + assert 0. <= inside_radio <= 1.0 + img_h, img_w = color_img.shape[:2] + bound_mask = get_bound_2d_mask(live_bounds, intr, extr, img_h, img_w) > 0 + # cv2.imshow('bound_mask_0', bound_mask.astype(np.uint8) * 255) + # cv2.waitKey(0) + if unsample_region_mask is not None: + bound_mask = np.logical_and(bound_mask, unsample_region_mask < 1e-6) + # cv2.imshow('bound_mask_1', bound_mask.astype(np.uint8) * 255) + # cv2.waitKey(0) + uv_img = gen_uv(img_w, img_h) + inside_uv = uv_img[np.logical_and(mask_img, bound_mask > 1e-6)] + outside_uv = uv_img[np.logical_and(~mask_img, bound_mask > 1e-6)] + count = 0 + uv, ray_o, ray_d, near, far = [], [], [], [], [] + while count < sample_num: + rest_num = sample_num - count + inside_sample_num = int(rest_num * inside_radio) + outside_sample_num = rest_num - inside_sample_num + sampled_inside_uv = inside_uv[np.random.choice(inside_uv.shape[0], inside_sample_num, replace = False)] + sampled_outside_uv = outside_uv[np.random.choice(outside_uv.shape[0], outside_sample_num, replace = False)] + uv_ = np.concatenate([sampled_inside_uv, sampled_outside_uv], axis = 0) + ray_d_, ray_o_ = get_rays(uv_, extr, intr) + near_, far_, mask_at_bound = get_near_far(live_bounds, ray_o_, ray_d_) + uv.append(uv_[mask_at_bound]) + ray_o.append(ray_o_[mask_at_bound]) + ray_d.append(ray_d_[mask_at_bound]) + near.append(near_) + far.append(far_) + count += near_.shape[0] + uv = np.concatenate(uv, 0) + ray_o = np.concatenate(ray_o, 0) + ray_d = np.concatenate(ray_d, 0) + near = np.concatenate(near, 0) + far = np.concatenate(far, 0) + + # gt + color_gt = color_img[uv[:, 1], uv[:, 0]] + mask_gt = mask_img[uv[:, 1], uv[:, 0]] + depth_gt = depth_img[uv[:, 1], uv[:, 0]] + color_gt[mask_gt < 1e-6] = 0 + + # distance to depth if depth is available + x = (uv[:, 0] + 0.5 - intr[0, 2]) * depth_gt / intr[0, 0] + y = (uv[:, 1] + 0.5 - intr[1, 2]) * depth_gt / intr[1, 1] + dist = np.sqrt(x * x + y * y + depth_gt * depth_gt).astype(np.float32) + + ret = { + 'uv': uv, + 'ray_o': ray_o, + 'ray_d': ray_d, + 'near': near, + 'far': far, + 'color_gt': color_gt, + 'mask_gt': mask_gt.astype(np.float32), + 'depth_gt': depth_gt, + 'dist': dist + } + + return ret + + +def sample_patch_for_nerf_rendering(color_img, + mask_img, + depth_img, + extr, + intr, + live_bounds, + patch_num = 2, + patch_size = 32, + inside_radio = 0.5, + unsample_region_mask = None, + resize_factor = 1.0): + assert color_img.shape[:2] == mask_img.shape[:2] and color_img.shape[:2] == depth_img.shape[:2] + assert 0. <= inside_radio <= 1.0 + if resize_factor != 1.0: + color_img = cv2.resize(color_img, (0, 0), fx = resize_factor, fy = resize_factor, interpolation = cv2.INTER_NEAREST) + mask_img = cv2.resize(mask_img.astype(np.uint8), (0, 0), fx = resize_factor, fy = resize_factor, interpolation = cv2.INTER_NEAREST) > 0 + depth_img = cv2.resize(depth_img, (0, 0), fx = resize_factor, fy = resize_factor, interpolation = cv2.INTER_NEAREST) + if unsample_region_mask is not None: + unsample_region_mask = cv2.resize(unsample_region_mask.astype(np.uint8), (0, 0), fx = resize_factor, fy = resize_factor, interpolation = cv2.INTER_NEAREST) > 0 + intr_ = intr.copy() + intr_[:2] *= resize_factor + intr = intr_ + + img_h, img_w = color_img.shape[:2] + bound_mask = get_bound_2d_mask(live_bounds, intr, extr, img_h, img_w) > 0. + # cv2.imshow('bound_mask', bound_mask.astype(np.uint8) * 255) + # cv2.waitKey(0) + if unsample_region_mask is not None: + bound_mask = np.logical_and(bound_mask, unsample_region_mask < 1e-6) + # cv2.imshow('unsample_region', unsample_region_mask.astype(np.uint8) * 255) + # cv2.imshow('bound_mask', bound_mask.astype(np.uint8) * 255) + # cv2.waitKey(0) + uv_img = gen_uv(img_w, img_h) + inside_uv = uv_img[np.logical_and(mask_img, bound_mask > 1e-6)] + outside_uv = uv_img[np.logical_and(~mask_img, bound_mask > 1e-6)] + # cv2.imwrite('./debug/mask_img.png', mask_img.astype(np.uint8) * 255) + # cv2.imwrite('./debug/bound_mask.png', bound_mask.astype(np.uint8) * 255) + # exit(1) + # cv2.imshow('mask_img', mask_img.astype(np.uint8) * 255) + # cv2.imshow('bound_mask', bound_mask.astype(np.uint8) * 255) + # cv2.waitKey(0) + uv, ray_o, ray_d, near, far, mask_within_patch = [], [], [], [], [], [] + for patch_idx in range(patch_num): + p = np.random.rand() + if p < inside_radio: + candidate_uv = inside_uv + else: + candidate_uv = outside_uv + center_uv = candidate_uv[np.random.choice(candidate_uv.shape[0], 1, replace = False)[0]] + half_patch_size = patch_size // 2 + u_min = np.clip(center_uv[0] - half_patch_size, 0, img_w - patch_size) + v_min = np.clip(center_uv[1] - half_patch_size, 0, img_h - patch_size) + u_max = u_min + patch_size + v_max = v_min + patch_size + + uv_patch = uv_img[v_min: v_max, u_min: u_max].reshape(-1, 2) + bound_mask_patch = bound_mask[v_min: v_max, u_min: u_max].reshape(-1) + ray_d_patch, ray_o_patch = get_rays(uv_patch[bound_mask_patch], extr, intr) + near_patch, far_patch, mask_at_bound = get_near_far(live_bounds, ray_o_patch, ray_d_patch) + ray_o.append(ray_o_patch[mask_at_bound]) + ray_d.append(ray_d_patch[mask_at_bound]) + near.append(near_patch) + far.append(far_patch) + uv.append(uv_patch) + bound_mask_patch_pos = np.argwhere(bound_mask_patch) + bound_mask_patch[bound_mask_patch_pos[~mask_at_bound]] = False + mask_within_patch.append(bound_mask_patch) + + uv = np.concatenate(uv, 0) + mask_within_patch = np.concatenate(mask_within_patch, 0) + ray_o = np.concatenate(ray_o, 0) + ray_d = np.concatenate(ray_d, 0) + near = np.concatenate(near, 0) + far = np.concatenate(far, 0) + + # gt + color_gt = color_img[uv[:, 1], uv[:, 0]] + mask_gt = mask_img[uv[:, 1], uv[:, 0]] + depth_gt = depth_img[uv[:, 1], uv[:, 0]] + color_gt[mask_gt < 1e-6] = 0 + + # distance to depth if depth is available + x = (uv[:, 0] + 0.5 - intr[0, 2]) * depth_gt / intr[0, 0] + y = (uv[:, 1] + 0.5 - intr[1, 2]) * depth_gt / intr[1, 1] + dist = np.sqrt(x * x + y * y + depth_gt * depth_gt).astype(np.float32)[mask_within_patch] + + ret = { + 'uv': uv, + 'mask_within_patch': mask_within_patch, + 'ray_o': ray_o, + 'ray_d': ray_d, + 'near': near, + 'far': far, + 'color_gt': color_gt, + 'mask_gt': mask_gt.astype(np.float32), + 'depth_gt': depth_gt, + 'dist': dist + } + + return ret + + +def sample_randomly_for_nerf_rendering_wSideViewMask( + color_img, + mask_img, + depth_img, + extr, + intr, + live_bounds, + sample_num = 1024, + inside_radio = 0.5, + side_view_radio = 0.8, + unsample_region_mask = None, + side_view_mask = None +): + assert color_img.shape[:2] == mask_img.shape[:2] and color_img.shape[:2] == depth_img.shape[:2] + assert 0. <= inside_radio <= 1.0 + img_h, img_w = color_img.shape[:2] + bound_mask = get_bound_2d_mask(live_bounds, intr, extr, img_h, img_w) > 0 + # cv2.imshow('bound_mask', bound_mask.astype(np.uint8) * 255) + # cv2.waitKey(0) + if unsample_region_mask is not None: + bound_mask = np.logical_and(bound_mask, unsample_region_mask < 1e-6) + uv_img = gen_uv(img_w, img_h) + inside_uv_sideView = uv_img[np.logical_and(np.logical_and(mask_img, bound_mask), side_view_mask)] + inside_uv_fbView = uv_img[np.logical_and(np.logical_and(mask_img, bound_mask), ~side_view_mask)] + outside_uv = uv_img[np.logical_and(~mask_img, bound_mask)] + count = 0 + uv, ray_o, ray_d, near, far = [], [], [], [], [] + while count < sample_num: + rest_num = sample_num - count + inside_sample_num_1 = int(rest_num * inside_radio * side_view_radio) + inside_sample_num_2 = int(rest_num * inside_radio * (1. - side_view_radio)) + outside_sample_num = rest_num - (inside_sample_num_1 + inside_sample_num_2) + sampled_inside_uv_1 = inside_uv_sideView[np.random.choice(inside_uv_sideView.shape[0], inside_sample_num_1, replace = inside_sample_num_1 < inside_uv_sideView.shape[0])] + sampled_inside_uv_2 = inside_uv_fbView[np.random.choice(inside_uv_fbView.shape[0], inside_sample_num_2, replace = inside_sample_num_2 < inside_uv_fbView.shape[0])] + sampled_outside_uv = outside_uv[np.random.choice(outside_uv.shape[0], outside_sample_num, replace = False)] + uv_ = np.concatenate([sampled_inside_uv_1, sampled_inside_uv_2, sampled_outside_uv], axis = 0) + ray_d_, ray_o_ = get_rays(uv_, extr, intr) + near_, far_, mask_at_bound = get_near_far(live_bounds, ray_o_, ray_d_) + uv.append(uv_[mask_at_bound]) + ray_o.append(ray_o_[mask_at_bound]) + ray_d.append(ray_d_[mask_at_bound]) + near.append(near_) + far.append(far_) + count += near_.shape[0] + uv = np.concatenate(uv, 0) + ray_o = np.concatenate(ray_o, 0) + ray_d = np.concatenate(ray_d, 0) + near = np.concatenate(near, 0) + far = np.concatenate(far, 0) + + # gt + color_gt = color_img[uv[:, 1], uv[:, 0]] + mask_gt = mask_img[uv[:, 1], uv[:, 0]] + depth_gt = depth_img[uv[:, 1], uv[:, 0]] + color_gt[mask_gt < 1e-6] = 0 + + # distance to depth if depth is available + x = (uv[:, 0] + 0.5 - intr[0, 2]) * depth_gt / intr[0, 0] + y = (uv[:, 1] + 0.5 - intr[1, 2]) * depth_gt / intr[1, 1] + dist = np.sqrt(x * x + y * y + depth_gt * depth_gt).astype(np.float32) + + ret = { + 'uv': uv, + 'ray_o': ray_o, + 'ray_d': ray_d, + 'near': near, + 'far': far, + 'color_gt': color_gt, + 'mask_gt': mask_gt.astype(np.float32), + 'depth_gt': depth_gt, + 'dist': dist + } + + # color_img[uv[:, 1], uv[:, 0]] = 255 + # cv2.imshow('color', color_img) + # cv2.waitKey(0) + + return ret + diff --git a/AnimatableGaussians/utils/net_util.py b/AnimatableGaussians/utils/net_util.py new file mode 100644 index 0000000000000000000000000000000000000000..b290f4d2f2ee051d6d9fe411dd858b54fefa3780 --- /dev/null +++ b/AnimatableGaussians/utils/net_util.py @@ -0,0 +1,63 @@ +import torch +import numpy as np +import AnimatableGaussians.config as config + + +def to_cuda(items: dict, add_batch = False, precision = torch.float32): + items_cuda = dict() + for key, data in items.items(): + if isinstance(data, torch.Tensor): + items_cuda[key] = data.to(config.device) + elif isinstance(data, np.ndarray): + items_cuda[key] = torch.from_numpy(data).to(config.device) + elif isinstance(data, dict): # usually some float tensors + for key2, data2 in data.items(): + if isinstance(data2, np.ndarray): + data[key2] = torch.from_numpy(data2).to(config.device) + elif isinstance(data2, torch.Tensor): + data[key2] = data2.to(config.device) + else: + raise TypeError('Do not support other data types.') + if data[key2].dtype == torch.float32 or data[key2].dtype == torch.float64: + data[key2] = data[key2].to(precision) + items_cuda[key] = data + else: + items_cuda[key] = data + if isinstance(items_cuda[key], torch.Tensor) and\ + (items_cuda[key].dtype == torch.float32 or items_cuda[key].dtype == torch.float64): + items_cuda[key] = items_cuda[key].to(precision) + if add_batch: + if isinstance(items_cuda[key], torch.Tensor): + items_cuda[key] = items_cuda[key].unsqueeze(0) + elif isinstance(items_cuda[key], dict): + for k in items_cuda[key].keys(): + items_cuda[key][k] = items_cuda[key][k].unsqueeze(0) + else: + items_cuda[key] = [items_cuda[key]] + return items_cuda + + +def delete_batch_idx(items: dict): + for k, v in items.items(): + if isinstance(v, torch.Tensor): + assert v.shape[0] == 1 + items[k] = v[0] + return items + + +def generate_volume_points(bounds, testing_res = (256, 256, 256)): + x_coords = torch.linspace(0, 1, steps = testing_res[0], dtype = torch.float32, device = config.device).detach() + y_coords = torch.linspace(0, 1, steps = testing_res[1], dtype = torch.float32, device = config.device).detach() + z_coords = torch.linspace(0, 1, steps = testing_res[2], dtype = torch.float32, device = config.device).detach() + xv, yv, zv = torch.meshgrid(x_coords, y_coords, z_coords) # print(xv.shape) # (256, 256, 256) + xv = torch.reshape(xv, (-1, 1)) # print(xv.shape) # (256*256*256, 1) + yv = torch.reshape(yv, (-1, 1)) + zv = torch.reshape(zv, (-1, 1)) + pts = torch.cat([xv, yv, zv], dim = -1) + + # transform to canonical space + if isinstance(bounds, np.ndarray): + bounds = torch.from_numpy(bounds).to(pts) + pts = pts * (bounds[1] - bounds[0]) + bounds[0] + + return pts diff --git a/AnimatableGaussians/utils/obj_io.py b/AnimatableGaussians/utils/obj_io.py new file mode 100644 index 0000000000000000000000000000000000000000..1556e42353ec27f7c521ac190fcc25529c8a67a9 --- /dev/null +++ b/AnimatableGaussians/utils/obj_io.py @@ -0,0 +1,430 @@ +from __future__ import print_function, absolute_import, division +import numpy as np + + +def load_obj_data(filename): + """load model data from .obj file""" + v_list = [] # vertex coordinate + vt_list = [] # vertex texture coordinate + vc_list = [] # vertex color + vn_list = [] # vertex normal + f_list = [] # face vertex indices + fn_list = [] # face normal indices + ft_list = [] # face texture indices + + # read data + fp = open(filename, 'r') + lines = fp.readlines() + fp.close() + + for line in lines: + if len(line) < 2: + continue + line_data = line.strip().split(' ') + if '' in line_data: + line_data.remove('') + # parse vertex cocordinate + if line_data[0] == 'v': + v_list.append((float(line_data[1]), float(line_data[2]), float(line_data[3]))) + if len(line_data) == 7: + vc_list.append((float(line_data[4]), float(line_data[5]), float(line_data[6]))) + else: + vc_list.append((0.5, 0.5, 0.5)) + + # parse vertex texture coordinate + if line_data[0] == 'vt': + vt_list.append((float(line_data[1]), float(line_data[2]))) + + # parse vertex normal + if line_data[0] == 'vn': + vn_list.append((float(line_data[1]), float(line_data[2]), float(line_data[3]))) + + # parse face + if line_data[0] == 'f': + if len(line_data) < 3: + continue + # used for parsing face element data + def segElementData(ele_str): + fv = None + ft = None + fn = None + eles = ele_str.strip().split('/') + if len(eles) == 1: + fv = int(eles[0]) - 1 + elif len(eles) == 2: + fv = int(eles[0]) - 1 + ft = int(eles[1]) - 1 + elif len(eles) == 3: + fv = int(eles[0]) - 1 + fn = int(eles[2]) - 1 + ft = None if eles[1] == '' else int(eles[1]) - 1 + return fv, ft, fn + + fv0, ft0, fn0 = segElementData(line_data[1]) + fv1, ft1, fn1 = segElementData(line_data[2]) + fv2, ft2, fn2 = segElementData(line_data[3]) + + f_list.append((fv0, fv1, fv2)) + if ft0 is not None and ft1 is not None and ft2 is not None: + ft_list.append((ft0, ft1, ft2)) + if fn0 is not None and fn1 is not None and fn2 is not None: + fn_list.append((fn0, fn1, fn2)) + + v_list = np.asarray(v_list) + vn_list = np.asarray(vn_list) + vt_list = np.asarray(vt_list) + vc_list = np.asarray(vc_list) + f_list = np.asarray(f_list) + ft_list = np.asarray(ft_list) + fn_list = np.asarray(fn_list) + + model = {'v': v_list, 'vt': vt_list, 'vc': vc_list, 'vn': vn_list, + 'f': f_list, 'ft': ft_list, 'fn': fn_list} + return model + + +def load_obj_data_binary(filename): + """load model data from .obj file""" + v_list = [] # vertex coordinate + vt_list = [] # vertex texture coordinate + vc_list = [] # vertex color + vn_list = [] # vertex normal + f_list = [] # face vertex indices + fn_list = [] # face normal indices + ft_list = [] # face texture indices + + # read data + fp = open(filename, 'rb') + lines = fp.readlines() + fp.close() + + for line in lines: + line_data = line.strip().split(' ') + + # parse vertex cocordinate + if line_data[0] == 'v': + v_list.append((float(line_data[1]), float(line_data[2]), float(line_data[3]))) + if len(line_data) == 7: + vc_list.append((float(line_data[4]), float(line_data[5]), float(line_data[6]))) + else: + vc_list.append((0.5, 0.5, 0.5)) + + # parse vertex texture coordinate + if line_data[0] == 'vt': + vt_list.append((float(line_data[1]), float(line_data[2]))) + + # parse vertex normal + if line_data[0] == 'vn': + vn_list.append((float(line_data[1]), float(line_data[2]), float(line_data[3]))) + + # parse face + if line_data[0] == 'f': + # used for parsing face element data + def segElementData(ele_str): + fv = None + ft = None + fn = None + eles = ele_str.strip().split('/') + if len(eles) == 1: + fv = int(eles[0]) - 1 + elif len(eles) == 2: + fv = int(eles[0]) - 1 + ft = int(eles[1]) - 1 + elif len(eles) == 3: + fv = int(eles[0]) - 1 + fn = int(eles[2]) - 1 + ft = None if eles[1] == '' else int(eles[1]) - 1 + return fv, ft, fn + + fv0, ft0, fn0 = segElementData(line_data[1]) + fv1, ft1, fn1 = segElementData(line_data[2]) + fv2, ft2, fn2 = segElementData(line_data[3]) + f_list.append((fv0, fv1, fv2)) + if ft0 is not None and ft1 is not None and ft2 is not None: + ft_list.append((ft0, ft1, ft2)) + if fn0 is not None and fn1 is not None and fn2 is not None: + fn_list.append((fn0, fn1, fn2)) + + v_list = np.asarray(v_list) + vn_list = np.asarray(vn_list) + vt_list = np.asarray(vt_list) + vc_list = np.asarray(vc_list) + f_list = np.asarray(f_list) + ft_list = np.asarray(ft_list) + fn_list = np.asarray(fn_list) + + model = {'v': v_list, 'vt': vt_list, 'vc': vc_list, 'vn': vn_list, + 'f': f_list, 'ft': ft_list, 'fn': fn_list} + return model + + +def save_obj_data(model, filename): + assert 'v' in model and model['v'].size != 0 + + with open(filename, 'w') as fp: + if 'v' in model and model['v'].size != 0: + for i in range(model['v'].shape[0]): + v = model['v'][i] + fp.write('v %f %f %f ' % (v[0], v[1], v[2])) + if 'c' in model and model['c'].size != 0: + c = model['c'][i] + fp.write('%f %f %f\n' % (c[0], c[1], c[2])) + else: + fp.write('\n') + + if 'vn' in model and model['vn'].size != 0: + for vn in model['vn']: + fp.write('vn %f %f %f\n' % (vn[0], vn[1], vn[2])) + + if 'vt' in model and model['vt'].size != 0: + for vt in model['vt']: + fp.write('vt %f %f\n' % (vt[0], vt[1])) + + if 'f' in model and model['f'].size != 0: + if 'fn' in model and model['fn'].size != 0 and 'ft' in model and model['ft'].size != 0: + assert model['f'].size == model['fn'].size + assert model['f'].size == model['ft'].size + for f_, ft_, fn_ in zip(model['f'], model['ft'], model['fn']): + f = np.copy(f_) + 1 + ft = np.copy(ft_) + 1 + fn = np.copy(fn_) + 1 + fp.write('f %d/%d/%d %d/%d/%d %d/%d/%d\n' % + (f[0], ft[0], fn[0], f[1], ft[1], fn[1], f[2], ft[2], fn[2])) + elif 'fn' in model and model['fn'].size != 0: + assert model['f'].size == model['fn'].size + for f_, fn_ in zip(model['f'], model['fn']): + f = np.copy(f_) + 1 + fn = np.copy(fn_) + 1 + fp.write('f %d//%d %d//%d %d//%d\n' % (f[0], fn[0], f[1], fn[1], f[2], fn[2])) + elif 'ft' in model and model['ft'].size != 0: + assert model['f'].size == model['ft'].size + for f_, ft_ in zip(model['f'], model['ft']): + f = np.copy(f_) + 1 + ft = np.copy(ft_) + 1 + fp.write('f %d/%d %d/%d %d/%d\n' % (f[0], ft[0], f[1], ft[1], f[2], ft[2])) + else: + for f_ in model['f']: + f = np.copy(f_) + 1 + fp.write('f %d %d %d\n' % (f[0], f[1], f[2])) + + +def save_obj_data_binary(model, filename): + assert 'v' in model and model['v'].size != 0 + + with open(filename, 'wb') as fp: + if 'v' in model and model['v'].size != 0: + for v in model['v']: + fp.write('v %f %f %f\n' % (v[0], v[1], v[2])) + + if 'vn' in model and model['vn'].size != 0: + for vn in model['vn']: + fp.write('vn %f %f %f\n' % (vn[0], vn[1], vn[2])) + + if 'vt' in model and model['vt'].size != 0: + for vt in model['vt']: + fp.write('vt %f %f\n' % (vt[0], vt[1])) + + if 'f' in model and model['f'].size != 0: + if 'fn' in model and model['fn'].size != 0 and 'ft' in model and model['ft'].size != 0: + assert model['f'].size == model['fn'].size + assert model['f'].size == model['ft'].size + for f_, ft_, fn_ in zip(model['f'], model['ft'], model['fn']): + f = np.copy(f_) + 1 + ft = np.copy(ft_) + 1 + fn = np.copy(fn_) + 1 + fp.write('f %d/%d/%d %d/%d/%d %d/%d/%d\n' % + (f[0], ft[0], fn[0], f[1], ft[1], fn[1], f[2], ft[2], fn[2])) + elif 'fn' in model and model['fn'].size != 0: + assert model['f'].size == model['fn'].size + for f_, fn_ in zip(model['f'], model['fn']): + f = np.copy(f_) + 1 + fn = np.copy(fn_) + 1 + fp.write('f %d//%d %d//%d %d//%d\n' % (f[0], fn[0], f[1], fn[1], f[2], fn[2])) + elif 'ft' in model and model['ft'].size != 0: + assert model['f'].size == model['ft'].size + for f_, ft_ in zip(model['f'], model['ft']): + f = np.copy(f_) + 1 + ft = np.copy(ft_) + 1 + fp.write('f %d/%d %d/%d %d/%d\n' % (f[0], ft[0], f[1], ft[1], f[2], ft[2])) + else: + for f_ in model['f']: + f = np.copy(f_) + 1 + fp.write('f %d %d %d\n' % (f[0], f[1], f[2])) + + +def save_obj_data_binary_for_voxelization(model, min_corner, max_corner, corner_size, filename): + """ + Save Obj data with the corner of the bounding box + This small feature will be useful when you use some 3d software to voxelize the mesh, + because it can help you avoid complex alignments. + """ + assert 'v' in model and model['v'].size != 0 + with open(filename, 'wb') as fp: + if 'v' in model and model['v'].size != 0: + for v in model['v']: + fp.write('v %f %f %f\n' % (v[0], v[1], v[2])) + + # add corner + fp.write('v %f %f %f\n' % (min_corner[0] + corner_size, min_corner[1], min_corner[2])) + fp.write('v %f %f %f\n' % (min_corner[0], min_corner[1] + corner_size, min_corner[2])) + fp.write('v %f %f %f\n' % (min_corner[0], min_corner[1], min_corner[2] + corner_size)) + fp.write('v %f %f %f\n' % (min_corner[0], min_corner[1], min_corner[2])) + + fp.write('v %f %f %f\n' % (max_corner[0] - corner_size, max_corner[1], max_corner[2])) + fp.write('v %f %f %f\n' % (max_corner[0], max_corner[1] - corner_size, max_corner[2])) + fp.write('v %f %f %f\n' % (max_corner[0], max_corner[1], max_corner[2] - corner_size)) + fp.write('v %f %f %f\n' % (max_corner[0], max_corner[1], max_corner[2])) + + # if 'vn' in model and model['vn'].size != 0: + # for vn in model['vn']: + # fp.write('vn %f %f %f\n' % (vn[0], vn[1], vn[2])) + # + # if 'vt' in model and model['vt'].size != 0: + # for vt in model['vt']: + # fp.write('vt %f %f\n' % (vt[0], vt[1])) + + if 'f' in model and model['f'].size != 0: + # if 'fn' in model and model['fn'].size != 0 and 'ft' in model and model['ft'].size != 0: + # assert model['f'].size == model['fn'].size + # assert model['f'].size == model['ft'].size + # for f_, ft_, fn_ in zip(model['f'], model['ft'], model['fn']): + # f = np.copy(f_) + 1 + # ft = np.copy(ft_) + 1 + # fn = np.copy(fn_) + 1 + # fp.write('f %d/%d/%d %d/%d/%d %d/%d/%d\n' % + # (f[0], ft[0], fn[0], f[1], ft[1], fn[1], f[2], ft[2], fn[2])) + # elif 'fn' in model and model['fn'].size != 0: + # assert model['f'].size == model['fn'].size + # for f_, fn_ in zip(model['f'], model['fn']): + # f = np.copy(f_) + 1 + # fn = np.copy(fn_) + 1 + # fp.write('f %d//%d %d//%d %d//%d\n' % (f[0], fn[0], f[1], fn[1], f[2], fn[2])) + # elif 'ft' in model and model['ft'].size != 0: + # assert model['f'].size == model['ft'].size + # for f_, ft_ in zip(model['f'], model['ft']): + # f = np.copy(f_) + 1 + # ft = np.copy(ft_) + 1 + # fp.write('f %d/%d %d/%d %d/%d\n' % (f[0], ft[0], f[1], ft[1], f[2], ft[2])) + # else: + for f_ in model['f']: + f = np.copy(f_) + 1 + fp.write('f %d %d %d\n' % (f[0], f[1], f[2])) + + # add corner + vid_start = model['v'].size / 3 + fp.write('f %d %d %d\n' % (vid_start + 1, vid_start + 2, vid_start + 3)) + fp.write('f %d %d %d\n' % (vid_start + 1, vid_start + 4, vid_start + 2)) + fp.write('f %d %d %d\n' % (vid_start + 1, vid_start + 3, vid_start + 4)) + fp.write('f %d %d %d\n' % (vid_start + 2, vid_start + 4, vid_start + 3)) + + vid_start += 4 + fp.write('f %d %d %d\n' % (vid_start + 1, vid_start + 2, vid_start + 3)) + fp.write('f %d %d %d\n' % (vid_start + 1, vid_start + 4, vid_start + 2)) + fp.write('f %d %d %d\n' % (vid_start + 1, vid_start + 3, vid_start + 4)) + fp.write('f %d %d %d\n' % (vid_start + 2, vid_start + 4, vid_start + 3)) + + +def save_mesh_as_obj(path, vertices, faces=None, normals=None, colors=None): + mesh = dict() + mesh['v'] = vertices + if faces is not None: + mesh['f'] = faces + if normals is not None: + mesh['vn'] = normals + if colors is not None: + mesh['c'] = colors + save_obj_data(mesh, path) + + +# def save_mesh_as_ply(path, vertices, faces=None, normals=None, colors=None): +# path = path + '.ply' +# mesh = o3d.geometry.TriangleMesh() +# mesh.vertices = o3d.utility.Vector3dVector(vertices) +# if faces is not None: +# mesh.triangles = o3d.utility.Vector3iVector(faces) +# if normals is not None: +# mesh.vertex_normals = o3d.utility.Vector3dVector(normals) +# if colors is not None: +# mesh.vertex_colors = o3d.utility.Vector3dVector(colors) +# o3d.io.write_triangle_mesh(path, mesh, write_vertex_colors=True if colors is not None else False) + + +def save_mesh_as_ply(path, vertices, faces = None, normals = None, colors = None): + import struct + fp = open(path, 'w') + fp.write('ply\n') + fp.write('format binary_little_endian 1.0\n') + fp.write('element vertex %d\n' % vertices.shape[0]) + fp.write('property float x\nproperty float y\nproperty float z\n') + if normals is not None: + fp.write('property float nx\nproperty float ny\nproperty float nz\n') + if colors is not None: + fp.write('property uchar red\nproperty uchar green\nproperty uchar blue\n') + # if faces is not None: + face_num = 0 if faces is None else faces.shape[0] + fp.write('element face %d\n' % face_num) + fp.write('property list int int vertex_indices\n') + fp.write('end_header\n') + fp.close() + + fp = open(path, 'ab') + # data = vertices.astype(np.float32) + # if normals is not None: + # normals = normals.astype(np.float32) + # data = np.concatenate([data, normals], 1) + + # if colors is not None: + # colors = (colors*255).astype(np.uint8) + # data = np.concatenate([data, colors], 1) + # data = data.reshape(-1) + # data_num = data.shape[0] + # data = data.astype('= 0. and np.max(colors) <= 1.: + colors *= 255 + colors = np.clip(colors, 0, 255) + colors = colors.astype(np.uint8) + for i in range(vertices.shape[0]): + v = vertices[i] + n = normals[i] if normals is not None else None + c = colors[i] if colors is not None else None + if normals is None: + if colors is None: + data = struct.pack('3f', v[0], v[1], v[2]) + else: + data = struct.pack('3f3B', v[0], v[1], v[2], c[0], c[1], c[2]) + else: + if colors is None: + data = struct.pack('6f', v[0], v[1], v[2], n[0], n[1], n[2]) + else: + data = struct.pack('6f3B', v[0], v[1], v[2], n[0], n[1], n[2], c[0], c[1], c[2]) + fp.write(data) + if faces is not None: + for i in range(faces.shape[0]): + f = faces[i] + data = struct.pack('4i', 3, f[0], f[1], f[2]) + fp.write(data) + fp.close() + + +def save_corres(path, pts1, pts2): + """ + source is red, target is blue + """ + pts = np.concatenate([pts1, pts2], axis = 1).reshape(-1, 3) + lines = np.arange(0, pts.shape[0], dtype = np.int).reshape(-1, 2) + + with open(path, 'w') as fp: + for vi in range(pts.shape[0]): + p = pts[vi] + if vi % 2 == 0: + fp.write('v %f %f %f 1 0 0\n' % (p[0], p[1], p[2])) + else: + fp.write('v %f %f %f 0 0 1\n' % (p[0], p[1], p[2])) + for li in range(lines.shape[0]): + fp.write('l %d %d\n' % (lines[li, 0] + 1, lines[li, 1] + 1)) diff --git a/AnimatableGaussians/utils/posevocab_custom_ops/__pycache__/nearest_face.cpython-310.pyc b/AnimatableGaussians/utils/posevocab_custom_ops/__pycache__/nearest_face.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f354cd7f54263e3c7a922d4b16dff7accd9ff7ab Binary files /dev/null and b/AnimatableGaussians/utils/posevocab_custom_ops/__pycache__/nearest_face.cpython-310.pyc differ diff --git a/AnimatableGaussians/utils/posevocab_custom_ops/__pycache__/nearest_face.cpython-38.pyc b/AnimatableGaussians/utils/posevocab_custom_ops/__pycache__/nearest_face.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9987df42e8cf40f1285d23853da3107d2ba4214c Binary files /dev/null and b/AnimatableGaussians/utils/posevocab_custom_ops/__pycache__/nearest_face.cpython-38.pyc differ diff --git a/AnimatableGaussians/utils/posevocab_custom_ops/bind.cpp b/AnimatableGaussians/utils/posevocab_custom_ops/bind.cpp new file mode 100644 index 0000000000000000000000000000000000000000..d8df49dfa9f766f12ec16f8a1c888aa5e5d493b9 --- /dev/null +++ b/AnimatableGaussians/utils/posevocab_custom_ops/bind.cpp @@ -0,0 +1,14 @@ +#include +#include + +#include "point_mesh.h" + +void near_far_smpl(at::Tensor vertices, at::Tensor ray_o, at::Tensor ray_d, at::Tensor near, at::Tensor far, at::Tensor intersect_flag, const float radius); +void nearest_face(at::Tensor vertices, at::Tensor faces, at::Tensor queries, at::Tensor dist, at::Tensor face_ids, at::Tensor nearest_pts); + +PYBIND11_MODULE(TORCH_EXTENSION_NAME, m) { + m.def("near_far_smpl", &near_far_smpl, "Near and far computed by SMPL (CUDA)"); + m.def("nearest_face", &nearest_face, "Search nearest face given a mesh (CUDA)"); + m.def("nearest_face_pytorch3d", &PointFaceDistanceForward, "Search nearest face given a mesh (CUDA)"); +} + diff --git a/AnimatableGaussians/utils/posevocab_custom_ops/build/lib.linux-x86_64-cpython-38/posevocab_custom_ops.cpython-38-x86_64-linux-gnu.so b/AnimatableGaussians/utils/posevocab_custom_ops/build/lib.linux-x86_64-cpython-38/posevocab_custom_ops.cpython-38-x86_64-linux-gnu.so new file mode 100644 index 0000000000000000000000000000000000000000..bc44b6ffea417df6fecff06c9159b537a372d776 --- /dev/null +++ b/AnimatableGaussians/utils/posevocab_custom_ops/build/lib.linux-x86_64-cpython-38/posevocab_custom_ops.cpython-38-x86_64-linux-gnu.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:986e5d5996fe87cd9edbc18f18b00406fa73a428f5f8c0d60dd88a0bdc6ed553 +size 12222352 diff --git a/AnimatableGaussians/utils/posevocab_custom_ops/build/temp.linux-x86_64-cpython-38/.ninja_deps b/AnimatableGaussians/utils/posevocab_custom_ops/build/temp.linux-x86_64-cpython-38/.ninja_deps new file mode 100644 index 0000000000000000000000000000000000000000..53315c41ab1fe95aca58c7aa2b337f4e32a134a8 Binary files /dev/null and b/AnimatableGaussians/utils/posevocab_custom_ops/build/temp.linux-x86_64-cpython-38/.ninja_deps differ diff --git a/AnimatableGaussians/utils/posevocab_custom_ops/build/temp.linux-x86_64-cpython-38/.ninja_log b/AnimatableGaussians/utils/posevocab_custom_ops/build/temp.linux-x86_64-cpython-38/.ninja_log new file mode 100644 index 0000000000000000000000000000000000000000..aa62a225f066f046e16aed9deddf99517a815bb3 --- /dev/null +++ b/AnimatableGaussians/utils/posevocab_custom_ops/build/temp.linux-x86_64-cpython-38/.ninja_log @@ -0,0 +1,5 @@ +# ninja log v5 +0 23295 1726452823021747654 /home/pengc02/pengcheng/projects/gaussian_avatar/ag_gha/AnimatableGaussians/utils/posevocab_custom_ops/build/temp.linux-x86_64-cpython-38/near_far_smpl_kernel.o 9c3ca9fa190d2b76 +0 23303 1726452823021747654 /home/pengc02/pengcheng/projects/gaussian_avatar/ag_gha/AnimatableGaussians/utils/posevocab_custom_ops/build/temp.linux-x86_64-cpython-38/nearest_face_kernel.o 1c7d22196946b09d +1 23318 1726452823037747335 /home/pengc02/pengcheng/projects/gaussian_avatar/ag_gha/AnimatableGaussians/utils/posevocab_custom_ops/build/temp.linux-x86_64-cpython-38/point_mesh.o 176ec650890787c1 +0 30158 1726452829857611220 /home/pengc02/pengcheng/projects/gaussian_avatar/ag_gha/AnimatableGaussians/utils/posevocab_custom_ops/build/temp.linux-x86_64-cpython-38/bind.o 65c59912a42495c9 diff --git a/AnimatableGaussians/utils/posevocab_custom_ops/build/temp.linux-x86_64-cpython-38/bind.o b/AnimatableGaussians/utils/posevocab_custom_ops/build/temp.linux-x86_64-cpython-38/bind.o new file mode 100644 index 0000000000000000000000000000000000000000..02308359d3a3b5f6ebbfc405dc96e8da85613007 --- /dev/null +++ b/AnimatableGaussians/utils/posevocab_custom_ops/build/temp.linux-x86_64-cpython-38/bind.o @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7a848683335370cfa58f21d0d9118356740792fcbc7ed329059c0b17d20075fd +size 18841768 diff --git a/AnimatableGaussians/utils/posevocab_custom_ops/build/temp.linux-x86_64-cpython-38/build.ninja b/AnimatableGaussians/utils/posevocab_custom_ops/build/temp.linux-x86_64-cpython-38/build.ninja new file mode 100644 index 0000000000000000000000000000000000000000..76fed8de75aac04c496a94b9f3bf7f8d6f3938db --- /dev/null +++ b/AnimatableGaussians/utils/posevocab_custom_ops/build/temp.linux-x86_64-cpython-38/build.ninja @@ -0,0 +1,36 @@ +ninja_required_version = 1.3 +cxx = c++ +nvcc = /usr/local/cuda-11.3/bin/nvcc + +cflags = -pthread -B /home/pengc02/anaconda3/envs/ag1/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DWITH_CUDA -I/home/pengc02/anaconda3/envs/ag1/lib/python3.8/site-packages/torch/include -I/home/pengc02/anaconda3/envs/ag1/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/home/pengc02/anaconda3/envs/ag1/lib/python3.8/site-packages/torch/include/TH -I/home/pengc02/anaconda3/envs/ag1/lib/python3.8/site-packages/torch/include/THC -I/usr/local/cuda-11.3/include -I/home/pengc02/anaconda3/envs/ag1/include/python3.8 -c +post_cflags = -O2 -I./ -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=posevocab_custom_ops -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++17 +cuda_cflags = -DWITH_CUDA -I/home/pengc02/anaconda3/envs/ag1/lib/python3.8/site-packages/torch/include -I/home/pengc02/anaconda3/envs/ag1/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/home/pengc02/anaconda3/envs/ag1/lib/python3.8/site-packages/torch/include/TH -I/home/pengc02/anaconda3/envs/ag1/lib/python3.8/site-packages/torch/include/THC -I/usr/local/cuda-11.3/include -I/home/pengc02/anaconda3/envs/ag1/include/python3.8 -c +cuda_post_cflags = -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_BFLOAT16_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr --compiler-options ''"'"'-fPIC'"'"'' -O2 -I./ -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=posevocab_custom_ops -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_86,code=compute_86 -gencode=arch=compute_86,code=sm_86 -std=c++17 +cuda_dlink_post_cflags = +ldflags = + +rule compile + command = $cxx -MMD -MF $out.d $cflags -c $in -o $out $post_cflags + depfile = $out.d + deps = gcc + +rule cuda_compile + depfile = $out.d + deps = gcc + command = $nvcc $cuda_cflags -c $in -o $out $cuda_post_cflags + + + + + +build /home/pengc02/pengcheng/projects/gaussian_avatar/ag_gha/AnimatableGaussians/utils/posevocab_custom_ops/build/temp.linux-x86_64-cpython-38/bind.o: compile /home/pengc02/pengcheng/projects/gaussian_avatar/ag_gha/AnimatableGaussians/utils/posevocab_custom_ops/bind.cpp +build /home/pengc02/pengcheng/projects/gaussian_avatar/ag_gha/AnimatableGaussians/utils/posevocab_custom_ops/build/temp.linux-x86_64-cpython-38/near_far_smpl_kernel.o: cuda_compile /home/pengc02/pengcheng/projects/gaussian_avatar/ag_gha/AnimatableGaussians/utils/posevocab_custom_ops/near_far_smpl_kernel.cu +build /home/pengc02/pengcheng/projects/gaussian_avatar/ag_gha/AnimatableGaussians/utils/posevocab_custom_ops/build/temp.linux-x86_64-cpython-38/nearest_face_kernel.o: cuda_compile /home/pengc02/pengcheng/projects/gaussian_avatar/ag_gha/AnimatableGaussians/utils/posevocab_custom_ops/nearest_face_kernel.cu +build /home/pengc02/pengcheng/projects/gaussian_avatar/ag_gha/AnimatableGaussians/utils/posevocab_custom_ops/build/temp.linux-x86_64-cpython-38/point_mesh.o: cuda_compile /home/pengc02/pengcheng/projects/gaussian_avatar/ag_gha/AnimatableGaussians/utils/posevocab_custom_ops/point_mesh.cu + + + + + + + diff --git a/AnimatableGaussians/utils/posevocab_custom_ops/build/temp.linux-x86_64-cpython-38/near_far_smpl_kernel.o b/AnimatableGaussians/utils/posevocab_custom_ops/build/temp.linux-x86_64-cpython-38/near_far_smpl_kernel.o new file mode 100644 index 0000000000000000000000000000000000000000..5c92c31c48d49d4ffef4a8707cd68d8767fbddb6 Binary files /dev/null and b/AnimatableGaussians/utils/posevocab_custom_ops/build/temp.linux-x86_64-cpython-38/near_far_smpl_kernel.o differ diff --git a/AnimatableGaussians/utils/posevocab_custom_ops/build/temp.linux-x86_64-cpython-38/nearest_face_kernel.o b/AnimatableGaussians/utils/posevocab_custom_ops/build/temp.linux-x86_64-cpython-38/nearest_face_kernel.o new file mode 100644 index 0000000000000000000000000000000000000000..49c09abfa53cecacb0c473218df3a49d03117f4d Binary files /dev/null and b/AnimatableGaussians/utils/posevocab_custom_ops/build/temp.linux-x86_64-cpython-38/nearest_face_kernel.o differ diff --git a/AnimatableGaussians/utils/posevocab_custom_ops/build/temp.linux-x86_64-cpython-38/point_mesh.o b/AnimatableGaussians/utils/posevocab_custom_ops/build/temp.linux-x86_64-cpython-38/point_mesh.o new file mode 100644 index 0000000000000000000000000000000000000000..5cf4f50e1cde9903b5a720ca87a1c469a0e2e574 Binary files /dev/null and b/AnimatableGaussians/utils/posevocab_custom_ops/build/temp.linux-x86_64-cpython-38/point_mesh.o differ diff --git a/AnimatableGaussians/utils/posevocab_custom_ops/dist/posevocab_custom_ops-0.0.0-py3.8-linux-x86_64.egg b/AnimatableGaussians/utils/posevocab_custom_ops/dist/posevocab_custom_ops-0.0.0-py3.8-linux-x86_64.egg new file mode 100644 index 0000000000000000000000000000000000000000..7c9a8886cc63e793395683065a6bdddc877c15ac --- /dev/null +++ b/AnimatableGaussians/utils/posevocab_custom_ops/dist/posevocab_custom_ops-0.0.0-py3.8-linux-x86_64.egg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ba2a1980bc63df6cbe67a658a83466c2860534552c1bbfc23bdc030f90aaf70e +size 3411011 diff --git a/AnimatableGaussians/utils/posevocab_custom_ops/float_math.cuh b/AnimatableGaussians/utils/posevocab_custom_ops/float_math.cuh new file mode 100644 index 0000000000000000000000000000000000000000..07da19415f1946f919814ff3b0f402079325511d --- /dev/null +++ b/AnimatableGaussians/utils/posevocab_custom_ops/float_math.cuh @@ -0,0 +1,139 @@ +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. + +#pragma once +#include + +// Set epsilon +#ifdef _MSC_VER +#define vEpsilon 1e-8f +#else +const auto vEpsilon = 1e-8; +#endif + +// Common functions and operators for float2. + +__device__ inline float2 operator-(const float2& a, const float2& b) { + return make_float2(a.x - b.x, a.y - b.y); +} + +__device__ inline float2 operator+(const float2& a, const float2& b) { + return make_float2(a.x + b.x, a.y + b.y); +} + +__device__ inline float2 operator/(const float2& a, const float2& b) { + return make_float2(a.x / b.x, a.y / b.y); +} + +__device__ inline float2 operator/(const float2& a, const float b) { + return make_float2(a.x / b, a.y / b); +} + +__device__ inline float2 operator*(const float2& a, const float2& b) { + return make_float2(a.x * b.x, a.y * b.y); +} + +__device__ inline float2 operator*(const float a, const float2& b) { + return make_float2(a * b.x, a * b.y); +} + +__device__ inline float dot(const float2& a, const float2& b) { + return a.x * b.x + a.y * b.y; +} + +// Backward pass for the dot product. +// Args: +// a, b: Coordinates of two points. +// grad_dot: Upstream gradient for the output. +// +// Returns: +// tuple of gradients for each of the input points: +// (float2 grad_a, float2 grad_b) +// +__device__ inline thrust::tuple +DotBackward(const float2& a, const float2& b, const float& grad_dot) { + return thrust::make_tuple(grad_dot * b, grad_dot * a); +} + +__device__ inline float sum(const float2& a) { + return a.x + a.y; +} + +// Common functions and operators for float3. + +__device__ inline float3 operator-(const float3& a, const float3& b) { + return make_float3(a.x - b.x, a.y - b.y, a.z - b.z); +} + +__device__ inline float3 operator+(const float3& a, const float3& b) { + return make_float3(a.x + b.x, a.y + b.y, a.z + b.z); +} + +__device__ inline float3 operator/(const float3& a, const float3& b) { + return make_float3(a.x / b.x, a.y / b.y, a.z / b.z); +} + +__device__ inline float3 operator/(const float3& a, const float b) { + return make_float3(a.x / b, a.y / b, a.z / b); +} + +__device__ inline float3 operator*(const float3& a, const float3& b) { + return make_float3(a.x * b.x, a.y * b.y, a.z * b.z); +} + +__device__ inline float3 operator*(const float a, const float3& b) { + return make_float3(a * b.x, a * b.y, a * b.z); +} + +__device__ inline float dot(const float3& a, const float3& b) { + return a.x * b.x + a.y * b.y + a.z * b.z; +} + +__device__ inline float sum(const float3& a) { + return a.x + a.y + a.z; +} + +__device__ inline float3 cross(const float3& a, const float3& b) { + return make_float3( + a.y * b.z - a.z * b.y, a.z * b.x - a.x * b.z, a.x * b.y - a.y * b.x); +} + +__device__ inline thrust::tuple +cross_backward(const float3& a, const float3& b, const float3& grad_cross) { + const float grad_ax = -grad_cross.y * b.z + grad_cross.z * b.y; + const float grad_ay = grad_cross.x * b.z - grad_cross.z * b.x; + const float grad_az = -grad_cross.x * b.y + grad_cross.y * b.x; + const float3 grad_a = make_float3(grad_ax, grad_ay, grad_az); + + const float grad_bx = grad_cross.y * a.z - grad_cross.z * a.y; + const float grad_by = -grad_cross.x * a.z + grad_cross.z * a.x; + const float grad_bz = grad_cross.x * a.y - grad_cross.y * a.x; + const float3 grad_b = make_float3(grad_bx, grad_by, grad_bz); + + return thrust::make_tuple(grad_a, grad_b); +} + +__device__ inline float norm(const float3& a) { + return sqrt(dot(a, a)); +} + +__device__ inline float3 normalize(const float3& a) { + return a / (norm(a) + vEpsilon); +} + +__device__ inline float3 normalize_backward( + const float3& a, + const float3& grad_normz) { + const float a_norm = norm(a) + vEpsilon; + const float3 out = a / a_norm; + + const float grad_ax = grad_normz.x * (1.0f - out.x * out.x) / a_norm + + grad_normz.y * (-out.x * out.y) / a_norm + + grad_normz.z * (-out.x * out.z) / a_norm; + const float grad_ay = grad_normz.x * (-out.x * out.y) / a_norm + + grad_normz.y * (1.0f - out.y * out.y) / a_norm + + grad_normz.z * (-out.y * out.z) / a_norm; + const float grad_az = grad_normz.x * (-out.x * out.z) / a_norm + + grad_normz.y * (-out.y * out.z) / a_norm + + grad_normz.z * (1.0f - out.z * out.z) / a_norm; + return make_float3(grad_ax, grad_ay, grad_az); +} diff --git a/AnimatableGaussians/utils/posevocab_custom_ops/geometry_utils.cuh b/AnimatableGaussians/utils/posevocab_custom_ops/geometry_utils.cuh new file mode 100644 index 0000000000000000000000000000000000000000..d2bfcff52f8511f3b0cc7c3cb044c2ed5dc9fb48 --- /dev/null +++ b/AnimatableGaussians/utils/posevocab_custom_ops/geometry_utils.cuh @@ -0,0 +1,907 @@ +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. + +#include +#include +#include +#include "float_math.cuh" + +// Set epsilon for preventing floating point errors and division by 0. +#ifdef _MSC_VER +#define kEpsilon 1e-8f +#else +const auto kEpsilon = 1e-8; +#endif + +// ************************************************************* // +// vec2 utils // +// ************************************************************* // + +// Determines whether a point p is on the right side of a 2D line segment +// given by the end points v0, v1. +// +// Args: +// p: vec2 Coordinates of a point. +// v0, v1: vec2 Coordinates of the end points of the edge. +// +// Returns: +// area: The signed area of the parallelogram given by the vectors +// A = p - v0 +// B = v1 - v0 +// +__device__ inline float +EdgeFunctionForward(const float2& p, const float2& v0, const float2& v1) { + return (p.x - v0.x) * (v1.y - v0.y) - (p.y - v0.y) * (v1.x - v0.x); +} + +// Backward pass for the edge function returning partial dervivatives for each +// of the input points. +// +// Args: +// p: vec2 Coordinates of a point. +// v0, v1: vec2 Coordinates of the end points of the edge. +// grad_edge: Upstream gradient for output from edge function. +// +// Returns: +// tuple of gradients for each of the input points: +// (float2 d_edge_dp, float2 d_edge_dv0, float2 d_edge_dv1) +// +__device__ inline thrust::tuple EdgeFunctionBackward( + const float2& p, + const float2& v0, + const float2& v1, + const float& grad_edge) { + const float2 dedge_dp = make_float2(v1.y - v0.y, v0.x - v1.x); + const float2 dedge_dv0 = make_float2(p.y - v1.y, v1.x - p.x); + const float2 dedge_dv1 = make_float2(v0.y - p.y, p.x - v0.x); + return thrust::make_tuple( + grad_edge * dedge_dp, grad_edge * dedge_dv0, grad_edge * dedge_dv1); +} + +// The forward pass for computing the barycentric coordinates of a point +// relative to a triangle. +// +// Args: +// p: Coordinates of a point. +// v0, v1, v2: Coordinates of the triangle vertices. +// +// Returns +// bary: (w0, w1, w2) barycentric coordinates in the range [0, 1]. +// +__device__ inline float3 BarycentricCoordsForward( + const float2& p, + const float2& v0, + const float2& v1, + const float2& v2) { + const float area = EdgeFunctionForward(v2, v0, v1) + kEpsilon; + const float w0 = EdgeFunctionForward(p, v1, v2) / area; + const float w1 = EdgeFunctionForward(p, v2, v0) / area; + const float w2 = EdgeFunctionForward(p, v0, v1) / area; + return make_float3(w0, w1, w2); +} + +// The backward pass for computing the barycentric coordinates of a point +// relative to a triangle. +// +// Args: +// p: Coordinates of a point. +// v0, v1, v2: (x, y) coordinates of the triangle vertices. +// grad_bary_upstream: vec3 Upstream gradient for each of the +// barycentric coordaintes [grad_w0, grad_w1, grad_w2]. +// +// Returns +// tuple of gradients for each of the triangle vertices: +// (float2 grad_v0, float2 grad_v1, float2 grad_v2) +// +__device__ inline thrust::tuple +BarycentricCoordsBackward( + const float2& p, + const float2& v0, + const float2& v1, + const float2& v2, + const float3& grad_bary_upstream) { + const float area = EdgeFunctionForward(v2, v0, v1) + kEpsilon; + const float area2 = pow(area, 2.0f); + const float e0 = EdgeFunctionForward(p, v1, v2); + const float e1 = EdgeFunctionForward(p, v2, v0); + const float e2 = EdgeFunctionForward(p, v0, v1); + + const float grad_w0 = grad_bary_upstream.x; + const float grad_w1 = grad_bary_upstream.y; + const float grad_w2 = grad_bary_upstream.z; + + // Calculate component of the gradient from each of w0, w1 and w2. + // e.g. for w0: + // dloss/dw0_v = dl/dw0 * dw0/dw0_top * dw0_top/dv + // + dl/dw0 * dw0/dw0_bot * dw0_bot/dv + const float dw0_darea = -e0 / (area2); + const float dw0_e0 = 1 / area; + const float dloss_d_w0area = grad_w0 * dw0_darea; + const float dloss_e0 = grad_w0 * dw0_e0; + auto de0_dv = EdgeFunctionBackward(p, v1, v2, dloss_e0); + auto dw0area_dv = EdgeFunctionBackward(v2, v0, v1, dloss_d_w0area); + const float2 dw0_p = thrust::get<0>(de0_dv); + const float2 dw0_dv0 = thrust::get<1>(dw0area_dv); + const float2 dw0_dv1 = thrust::get<1>(de0_dv) + thrust::get<2>(dw0area_dv); + const float2 dw0_dv2 = thrust::get<2>(de0_dv) + thrust::get<0>(dw0area_dv); + + const float dw1_darea = -e1 / (area2); + const float dw1_e1 = 1 / area; + const float dloss_d_w1area = grad_w1 * dw1_darea; + const float dloss_e1 = grad_w1 * dw1_e1; + auto de1_dv = EdgeFunctionBackward(p, v2, v0, dloss_e1); + auto dw1area_dv = EdgeFunctionBackward(v2, v0, v1, dloss_d_w1area); + const float2 dw1_p = thrust::get<0>(de1_dv); + const float2 dw1_dv0 = thrust::get<2>(de1_dv) + thrust::get<1>(dw1area_dv); + const float2 dw1_dv1 = thrust::get<2>(dw1area_dv); + const float2 dw1_dv2 = thrust::get<1>(de1_dv) + thrust::get<0>(dw1area_dv); + + const float dw2_darea = -e2 / (area2); + const float dw2_e2 = 1 / area; + const float dloss_d_w2area = grad_w2 * dw2_darea; + const float dloss_e2 = grad_w2 * dw2_e2; + auto de2_dv = EdgeFunctionBackward(p, v0, v1, dloss_e2); + auto dw2area_dv = EdgeFunctionBackward(v2, v0, v1, dloss_d_w2area); + const float2 dw2_p = thrust::get<0>(de2_dv); + const float2 dw2_dv0 = thrust::get<1>(de2_dv) + thrust::get<1>(dw2area_dv); + const float2 dw2_dv1 = thrust::get<2>(de2_dv) + thrust::get<2>(dw2area_dv); + const float2 dw2_dv2 = thrust::get<0>(dw2area_dv); + + const float2 dbary_p = dw0_p + dw1_p + dw2_p; + const float2 dbary_dv0 = dw0_dv0 + dw1_dv0 + dw2_dv0; + const float2 dbary_dv1 = dw0_dv1 + dw1_dv1 + dw2_dv1; + const float2 dbary_dv2 = dw0_dv2 + dw1_dv2 + dw2_dv2; + + return thrust::make_tuple(dbary_p, dbary_dv0, dbary_dv1, dbary_dv2); +} + +// Forward pass for applying perspective correction to barycentric coordinates. +// +// Args: +// bary: Screen-space barycentric coordinates for a point +// z0, z1, z2: Camera-space z-coordinates of the triangle vertices +// +// Returns +// World-space barycentric coordinates +// +__device__ inline float3 BarycentricPerspectiveCorrectionForward( + const float3& bary, + const float z0, + const float z1, + const float z2) { + const float w0_top = bary.x * z1 * z2; + const float w1_top = z0 * bary.y * z2; + const float w2_top = z0 * z1 * bary.z; + const float denom = w0_top + w1_top + w2_top; + const float w0 = w0_top / denom; + const float w1 = w1_top / denom; + const float w2 = w2_top / denom; + return make_float3(w0, w1, w2); +} + +// Backward pass for applying perspective correction to barycentric coordinates. +// +// Args: +// bary: Screen-space barycentric coordinates for a point +// z0, z1, z2: Camera-space z-coordinates of the triangle vertices +// grad_out: Upstream gradient of the loss with respect to the corrected +// barycentric coordinates. +// +// Returns a tuple of: +// grad_bary: Downstream gradient of the loss with respect to the the +// uncorrected barycentric coordinates. +// grad_z0, grad_z1, grad_z2: Downstream gradient of the loss with respect +// to the z-coordinates of the triangle verts +__device__ inline thrust::tuple +BarycentricPerspectiveCorrectionBackward( + const float3& bary, + const float z0, + const float z1, + const float z2, + const float3& grad_out) { + // Recompute forward pass + const float w0_top = bary.x * z1 * z2; + const float w1_top = z0 * bary.y * z2; + const float w2_top = z0 * z1 * bary.z; + const float denom = w0_top + w1_top + w2_top; + + // Now do backward pass + const float grad_denom_top = + -w0_top * grad_out.x - w1_top * grad_out.y - w2_top * grad_out.z; + const float grad_denom = grad_denom_top / (denom * denom); + const float grad_w0_top = grad_denom + grad_out.x / denom; + const float grad_w1_top = grad_denom + grad_out.y / denom; + const float grad_w2_top = grad_denom + grad_out.z / denom; + const float grad_bary_x = grad_w0_top * z1 * z2; + const float grad_bary_y = grad_w1_top * z0 * z2; + const float grad_bary_z = grad_w2_top * z0 * z1; + const float3 grad_bary = make_float3(grad_bary_x, grad_bary_y, grad_bary_z); + const float grad_z0 = grad_w1_top * bary.y * z2 + grad_w2_top * bary.z * z1; + const float grad_z1 = grad_w0_top * bary.x * z2 + grad_w2_top * bary.z * z0; + const float grad_z2 = grad_w0_top * bary.x * z1 + grad_w1_top * bary.y * z0; + return thrust::make_tuple(grad_bary, grad_z0, grad_z1, grad_z2); +} + +// Clip negative barycentric coordinates to 0.0 and renormalize so +// the barycentric coordinates for a point sum to 1. When the blur_radius +// is greater than 0, a face will still be recorded as overlapping a pixel +// if the pixel is outisde the face. In this case at least one of the +// barycentric coordinates for the pixel relative to the face will be negative. +// Clipping will ensure that the texture and z buffer are interpolated +// correctly. +// +// Args +// bary: (w0, w1, w2) barycentric coordinates which can be outside the +// range [0, 1]. +// +// Returns +// bary: (w0, w1, w2) barycentric coordinates in the range [0, 1] which +// satisfy the condition: sum(w0, w1, w2) = 1.0. +// +__device__ inline float3 BarycentricClipForward(const float3 bary) { + float3 w = make_float3(0.0f, 0.0f, 0.0f); + // Clamp lower bound only + w.x = max(bary.x, 0.0); + w.y = max(bary.y, 0.0); + w.z = max(bary.z, 0.0); + float w_sum = w.x + w.y + w.z; + w_sum = fmaxf(w_sum, 1e-5); + w.x /= w_sum; + w.y /= w_sum; + w.z /= w_sum; + + return w; +} + +// Backward pass for barycentric coordinate clipping. +// +// Args +// bary: (w0, w1, w2) barycentric coordinates which can be outside the +// range [0, 1]. +// grad_baryclip_upstream: vec3 Upstream gradient for each of the clipped +// barycentric coordinates [grad_w0, grad_w1, grad_w2]. +// +// Returns +// vec3 of gradients for the unclipped barycentric coordinates: +// (grad_w0, grad_w1, grad_w2) +// +__device__ inline float3 BarycentricClipBackward( + const float3 bary, + const float3 grad_baryclip_upstream) { + // Redo some of the forward pass calculations + float3 w = make_float3(0.0f, 0.0f, 0.0f); + // Clamp lower bound only + w.x = max(bary.x, 0.0); + w.y = max(bary.y, 0.0); + w.z = max(bary.z, 0.0); + float w_sum = w.x + w.y + w.z; + + float3 grad_bary = make_float3(1.0f, 1.0f, 1.0f); + float3 grad_clip = make_float3(1.0f, 1.0f, 1.0f); + float3 grad_sum = make_float3(1.0f, 1.0f, 1.0f); + + // Check if sum was clipped. + float grad_sum_clip = 1.0f; + if (w_sum < 1e-5) { + grad_sum_clip = 0.0f; + w_sum = 1e-5; + } + + // Check if any of bary values have been clipped. + if (bary.x < 0.0f) { + grad_clip.x = 0.0f; + } + if (bary.y < 0.0f) { + grad_clip.y = 0.0f; + } + if (bary.z < 0.0f) { + grad_clip.z = 0.0f; + } + + // Gradients of the sum. + grad_sum.x = -w.x / (pow(w_sum, 2.0f)) * grad_sum_clip; + grad_sum.y = -w.y / (pow(w_sum, 2.0f)) * grad_sum_clip; + grad_sum.z = -w.z / (pow(w_sum, 2.0f)) * grad_sum_clip; + + // Gradients for each of the bary coordinates including the cross terms + // from the sum. + grad_bary.x = grad_clip.x * + (grad_baryclip_upstream.x * (1.0f / w_sum + grad_sum.x) + + grad_baryclip_upstream.y * (grad_sum.y) + + grad_baryclip_upstream.z * (grad_sum.z)); + + grad_bary.y = grad_clip.y * + (grad_baryclip_upstream.y * (1.0f / w_sum + grad_sum.y) + + grad_baryclip_upstream.x * (grad_sum.x) + + grad_baryclip_upstream.z * (grad_sum.z)); + + grad_bary.z = grad_clip.z * + (grad_baryclip_upstream.z * (1.0f / w_sum + grad_sum.z) + + grad_baryclip_upstream.x * (grad_sum.x) + + grad_baryclip_upstream.y * (grad_sum.y)); + + return grad_bary; +} + +// Return minimum distance between line segment (v1 - v0) and point p. +// +// Args: +// p: Coordinates of a point. +// v0, v1: Coordinates of the end points of the line segment. +// +// Returns: +// squared distance to the boundary of the triangle. +// +__device__ inline float +PointLineDistanceForward(const float2& p, const float2& a, const float2& b) { + const float2 ba = b - a; + float l2 = dot(ba, ba); + float t = dot(ba, p - a) / l2; + if (l2 <= kEpsilon) { + return dot(p - b, p - b); + } + t = __saturatef(t); // clamp to the interval [+0.0, 1.0] + const float2 p_proj = a + t * ba; + const float2 d = (p_proj - p); + return dot(d, d); // squared distance +} + +// Backward pass for point to line distance in 2D. +// +// Args: +// p: Coordinates of a point. +// v0, v1: Coordinates of the end points of the line segment. +// grad_dist: Upstream gradient for the distance. +// +// Returns: +// tuple of gradients for each of the input points: +// (float2 grad_p, float2 grad_v0, float2 grad_v1) +// +__device__ inline thrust::tuple +PointLineDistanceBackward( + const float2& p, + const float2& v0, + const float2& v1, + const float& grad_dist) { + // Redo some of the forward pass calculations. + const float2 v1v0 = v1 - v0; + const float2 pv0 = p - v0; + const float t_bot = dot(v1v0, v1v0); + const float t_top = dot(v1v0, pv0); + float tt = t_top / t_bot; + tt = __saturatef(tt); + const float2 p_proj = (1.0f - tt) * v0 + tt * v1; + const float2 d = p - p_proj; + const float dist = sqrt(dot(d, d)); + + const float2 grad_p = -1.0f * grad_dist * 2.0f * (p_proj - p); + const float2 grad_v0 = grad_dist * (1.0f - tt) * 2.0f * (p_proj - p); + const float2 grad_v1 = grad_dist * tt * 2.0f * (p_proj - p); + + return thrust::make_tuple(grad_p, grad_v0, grad_v1); +} + +// The forward pass for calculating the shortest distance between a point +// and a triangle. +// +// Args: +// p: Coordinates of a point. +// v0, v1, v2: Coordinates of the three triangle vertices. +// +// Returns: +// shortest squared distance from a point to a triangle. +// +__device__ inline float PointTriangleDistanceForward( + const float2& p, + const float2& v0, + const float2& v1, + const float2& v2) { + // Compute distance to all 3 edges of the triangle and return the min. + const float e01_dist = PointLineDistanceForward(p, v0, v1); + const float e02_dist = PointLineDistanceForward(p, v0, v2); + const float e12_dist = PointLineDistanceForward(p, v1, v2); + const float edge_dist = fminf(fminf(e01_dist, e02_dist), e12_dist); + return edge_dist; +} + +// Backward pass for point triangle distance. +// +// Args: +// p: Coordinates of a point. +// v0, v1, v2: Coordinates of the three triangle vertices. +// grad_dist: Upstream gradient for the distance. +// +// Returns: +// tuple of gradients for each of the triangle vertices: +// (float2 grad_v0, float2 grad_v1, float2 grad_v2) +// +__device__ inline thrust::tuple +PointTriangleDistanceBackward( + const float2& p, + const float2& v0, + const float2& v1, + const float2& v2, + const float& grad_dist) { + // Compute distance to all 3 edges of the triangle. + const float e01_dist = PointLineDistanceForward(p, v0, v1); + const float e02_dist = PointLineDistanceForward(p, v0, v2); + const float e12_dist = PointLineDistanceForward(p, v1, v2); + + // Initialize output tensors. + float2 grad_v0 = make_float2(0.0f, 0.0f); + float2 grad_v1 = make_float2(0.0f, 0.0f); + float2 grad_v2 = make_float2(0.0f, 0.0f); + float2 grad_p = make_float2(0.0f, 0.0f); + + // Find which edge is the closest and return PointLineDistanceBackward for + // that edge. + if (e01_dist <= e02_dist && e01_dist <= e12_dist) { + // Closest edge is v1 - v0. + auto grad_e01 = PointLineDistanceBackward(p, v0, v1, grad_dist); + grad_p = thrust::get<0>(grad_e01); + grad_v0 = thrust::get<1>(grad_e01); + grad_v1 = thrust::get<2>(grad_e01); + } else if (e02_dist <= e01_dist && e02_dist <= e12_dist) { + // Closest edge is v2 - v0. + auto grad_e02 = PointLineDistanceBackward(p, v0, v2, grad_dist); + grad_p = thrust::get<0>(grad_e02); + grad_v0 = thrust::get<1>(grad_e02); + grad_v2 = thrust::get<2>(grad_e02); + } else if (e12_dist <= e01_dist && e12_dist <= e02_dist) { + // Closest edge is v2 - v1. + auto grad_e12 = PointLineDistanceBackward(p, v1, v2, grad_dist); + grad_p = thrust::get<0>(grad_e12); + grad_v1 = thrust::get<1>(grad_e12); + grad_v2 = thrust::get<2>(grad_e12); + } + + return thrust::make_tuple(grad_p, grad_v0, grad_v1, grad_v2); +} + +// ************************************************************* // +// vec3 utils // +// ************************************************************* // + +// Computes the barycentric coordinates of a point p relative +// to a triangle (v0, v1, v2), i.e. **/ p = w0 * v0 + w1 * v1 + w2 * v2 /* +// s.t. w0 + w1 + w2 = 1.0 +// +// NOTE that this function assumes that p lives on the space spanned +// by (v0, v1, v2). +// TODO(gkioxari) explicitly check whether p is coplanar with (v0, v1, v2) +// and throw an error if check fails +// +// Args: +// p: vec3 coordinates of a point +// v0, v1, v2: vec3 coordinates of the triangle vertices +// +// Returns +// bary: (w0, w1, w2) barycentric coordinates +// +inline float fmaxf(float a, float b) +{ + return a > b ? a : b; +} + +__device__ inline float3 BarycentricCoords3Forward( + const float3& p, + const float3& v0, + const float3& v1, + const float3& v2) { +// float3 p0 = v1 - v0; +// float3 p1 = v2 - v0; +// float3 p2 = p - v0; +// +// const float d00 = dot(p0, p0); +// const float d01 = dot(p0, p1); +// const float d11 = dot(p1, p1); +// const float d20 = dot(p2, p0); +// const float d21 = dot(p2, p1); +// const float maxd = fmaxf(fmaxf(fmaxf(fmaxf(d00, d11), d11), d20), d21); //BUG: numerical safe... +// +// const float denom = d00 / maxd * d11 - d01 / maxd * d01 + kEpsilon; +// const float w1 = (d11 / maxd * d20 - d01 / maxd * d21) / denom; +// const float w2 = (d00 / maxd * d21 - d01 / maxd * d20) / denom; +// const float w0 = 1.0f - w1 - w2; + float3 vec0 = v0 - p; + float3 vec1 = v1 - p; + float3 vec2 = v2 - p; + float area0 = norm(cross(vec1, vec2)); + float area1 = norm(cross(vec2, vec0)); + float area2 = norm(cross(vec0, vec1)); + float area = area0 + area1 + area2; + float w0 = area0 / area; + float w1 = area1 / area; + float w2 = area2 / area; + return make_float3(w0, w1, w2); +} + +// Checks whether the point p is inside the triangle (v0, v1, v2). +// A point is inside the triangle, if all barycentric coordinates +// wrt the triangle are >= 0 & <= 1. +// +// NOTE that this function assumes that p lives on the space spanned +// by (v0, v1, v2). +// TODO(gkioxari) explicitly check whether p is coplanar with (v0, v1, v2) +// and throw an error if check fails +// +// Args: +// p: vec3 coordinates of a point +// v0, v1, v2: vec3 coordinates of the triangle vertices +// +// Returns: +// inside: bool indicating wether p is inside triangle +// +__device__ inline bool IsInsideTriangle( + const float3& p, + const float3& v0, + const float3& v1, + const float3& v2) { + float3 bary = BarycentricCoords3Forward(p, v0, v1, v2); + bool x_in = 0.0f <= bary.x && bary.x <= 1.0f; + bool y_in = 0.0f <= bary.y && bary.y <= 1.0f; + bool z_in = 0.0f <= bary.z && bary.z <= 1.0f; + bool inside = x_in && y_in && z_in; + return inside; +} + +// Computes the minimum squared Euclidean distance between the point p +// and the segment spanned by (v0, v1). +// To find this we parametrize p as: x(t) = v0 + t * (v1 - v0) +// and find t which minimizes (x(t) - p) ^ 2. +// Note that p does not need to live in the space spanned by (v0, v1) +// +// Args: +// p: vec3 coordinates of a point +// v0, v1: vec3 coordinates of start and end of segment +// +// Returns: +// dist: the minimum squared distance of p from segment (v0, v1) +// + +__device__ inline float +PointLine3DistanceForward(const float3& p, const float3& v0, const float3& v1) { + const float3 v1v0 = v1 - v0; + const float3 pv0 = p - v0; + const float t_bot = dot(v1v0, v1v0); + const float t_top = dot(pv0, v1v0); + // if t_bot small, then v0 == v1, set tt to 0. + float tt = (t_bot < kEpsilon) ? 0.0f : (t_top / t_bot); + + tt = __saturatef(tt); // clamps to [0, 1] + + const float3 p_proj = v0 + tt * v1v0; + const float3 diff = p - p_proj; + const float dist = dot(diff, diff); + return dist; +} + +// Backward function of the minimum squared Euclidean distance between the point +// p and the line segment (v0, v1). +// +// Args: +// p: vec3 coordinates of a point +// v0, v1: vec3 coordinates of start and end of segment +// grad_dist: Float of the gradient wrt dist +// +// Returns: +// tuple of gradients for the point and line segment (v0, v1): +// (float3 grad_p, float3 grad_v0, float3 grad_v1) + +__device__ inline thrust::tuple +PointLine3DistanceBackward( + const float3& p, + const float3& v0, + const float3& v1, + const float& grad_dist) { + const float3 v1v0 = v1 - v0; + const float3 pv0 = p - v0; + const float t_bot = dot(v1v0, v1v0); + const float t_top = dot(v1v0, pv0); + + float3 grad_p = make_float3(0.0f, 0.0f, 0.0f); + float3 grad_v0 = make_float3(0.0f, 0.0f, 0.0f); + float3 grad_v1 = make_float3(0.0f, 0.0f, 0.0f); + + const float tt = t_top / t_bot; + + if (t_bot < kEpsilon) { + // if t_bot small, then v0 == v1, + // and dist = 0.5 * dot(pv0, pv0) + 0.5 * dot(pv1, pv1) + grad_p = grad_dist * 2.0f * pv0; + grad_v0 = -0.5f * grad_p; + grad_v1 = grad_v0; + } else if (tt < 0.0f) { + grad_p = grad_dist * 2.0f * pv0; + grad_v0 = -1.0f * grad_p; + // no gradients wrt v1 + } else if (tt > 1.0f) { + grad_p = grad_dist * 2.0f * (p - v1); + grad_v1 = -1.0f * grad_p; + // no gradients wrt v0 + } else { + const float3 p_proj = v0 + tt * v1v0; + const float3 diff = p - p_proj; + const float3 grad_base = grad_dist * 2.0f * diff; + grad_p = grad_base - dot(grad_base, v1v0) * v1v0 / t_bot; + const float3 dtt_v0 = (-1.0f * v1v0 - pv0 + 2.0f * tt * v1v0) / t_bot; + grad_v0 = (-1.0f + tt) * grad_base - dot(grad_base, v1v0) * dtt_v0; + const float3 dtt_v1 = (pv0 - 2.0f * tt * v1v0) / t_bot; + grad_v1 = -dot(grad_base, v1v0) * dtt_v1 - tt * grad_base; + } + + return thrust::make_tuple(grad_p, grad_v0, grad_v1); +} + +// Computes the squared distance of a point p relative to a triangle (v0, v1, +// v2). If the point's projection p0 on the plane spanned by (v0, v1, v2) is +// inside the triangle with vertices (v0, v1, v2), then the returned value is +// the squared distance of p to its projection p0. Otherwise, the returned value +// is the smallest squared distance of p from the line segments (v0, v1), (v0, +// v2) and (v1, v2). +// +// Args: +// p: vec3 coordinates of a point +// v0, v1, v2: vec3 coordinates of the triangle vertices +// +// Returns: +// dist: Float of the squared distance +// + +__device__ inline float PointTriangle3DistanceForward( + const float3& p, + const float3& v0, + const float3& v1, + const float3& v2) { + float3 normal = cross(v2 - v0, v1 - v0); + const float norm_normal = norm(normal); + normal = normalize(normal); + + // p0 is the projection of p on the plane spanned by (v0, v1, v2) + // i.e. p0 = p + t * normal, s.t. (p0 - v0) is orthogonal to normal + const float t = dot(v0 - p, normal); + const float3 p0 = p + t * normal; + + bool is_inside = IsInsideTriangle(p0, v0, v1, v2); + float dist = 0.0f; + + if ((is_inside) && (norm_normal > kEpsilon)) { + // if projection p0 is inside triangle spanned by (v0, v1, v2) + // then distance is equal to norm(p0 - p)^2 +// dist = t * t; + dist = min(norm(p-v0), norm(p-v1)); + dist = min(dist, norm(p-v2)); + } else { + const float e01 = PointLine3DistanceForward(p, v0, v1); + const float e02 = PointLine3DistanceForward(p, v0, v2); + const float e12 = PointLine3DistanceForward(p, v1, v2); + + dist = (e01 > e02) ? e02 : e01; + dist = (dist > e12) ? e12 : dist; + } + + return dist; +} + +// The backward pass for computing the squared distance of a point +// to the triangle (v0, v1, v2). +// +// Args: +// p: xyz coordinates of a point +// v0, v1, v2: xyz coordinates of the triangle vertices +// grad_dist: Float of the gradient wrt dist +// +// Returns: +// tuple of gradients for the point and triangle: +// (float3 grad_p, float3 grad_v0, float3 grad_v1, float3 grad_v2) +// + +__device__ inline thrust::tuple +PointTriangle3DistanceBackward( + const float3& p, + const float3& v0, + const float3& v1, + const float3& v2, + const float& grad_dist) { + const float3 v2v0 = v2 - v0; + const float3 v1v0 = v1 - v0; + const float3 v0p = v0 - p; + float3 raw_normal = cross(v2v0, v1v0); + const float norm_normal = norm(raw_normal); + float3 normal = normalize(raw_normal); + + // p0 is the projection of p on the plane spanned by (v0, v1, v2) + // i.e. p0 = p + t * normal, s.t. (p0 - v0) is orthogonal to normal + const float t = dot(v0 - p, normal); + const float3 p0 = p + t * normal; + const float3 diff = t * normal; + + bool is_inside = IsInsideTriangle(p0, v0, v1, v2); + + float3 grad_p = make_float3(0.0f, 0.0f, 0.0f); + float3 grad_v0 = make_float3(0.0f, 0.0f, 0.0f); + float3 grad_v1 = make_float3(0.0f, 0.0f, 0.0f); + float3 grad_v2 = make_float3(0.0f, 0.0f, 0.0f); + + if ((is_inside) && (norm_normal > kEpsilon)) { + // derivative of dist wrt p + grad_p = -2.0f * grad_dist * t * normal; + // derivative of dist wrt normal + const float3 grad_normal = 2.0f * grad_dist * t * (v0p + diff); + // derivative of dist wrt raw_normal + const float3 grad_raw_normal = normalize_backward(raw_normal, grad_normal); + // derivative of dist wrt v2v0 and v1v0 + const auto grad_cross = cross_backward(v2v0, v1v0, grad_raw_normal); + const float3 grad_cross_v2v0 = thrust::get<0>(grad_cross); + const float3 grad_cross_v1v0 = thrust::get<1>(grad_cross); + grad_v0 = + grad_dist * 2.0f * t * normal - (grad_cross_v2v0 + grad_cross_v1v0); + grad_v1 = grad_cross_v1v0; + grad_v2 = grad_cross_v2v0; + } else { + const float e01 = PointLine3DistanceForward(p, v0, v1); + const float e02 = PointLine3DistanceForward(p, v0, v2); + const float e12 = PointLine3DistanceForward(p, v1, v2); + + if ((e01 <= e02) && (e01 <= e12)) { + // e01 is smallest + const auto grads = PointLine3DistanceBackward(p, v0, v1, grad_dist); + grad_p = thrust::get<0>(grads); + grad_v0 = thrust::get<1>(grads); + grad_v1 = thrust::get<2>(grads); + } else if ((e02 <= e01) && (e02 <= e12)) { + // e02 is smallest + const auto grads = PointLine3DistanceBackward(p, v0, v2, grad_dist); + grad_p = thrust::get<0>(grads); + grad_v0 = thrust::get<1>(grads); + grad_v2 = thrust::get<2>(grads); + } else if ((e12 <= e01) && (e12 <= e02)) { + // e12 is smallest + const auto grads = PointLine3DistanceBackward(p, v1, v2, grad_dist); + grad_p = thrust::get<0>(grads); + grad_v1 = thrust::get<1>(grads); + grad_v2 = thrust::get<2>(grads); + } + } + + return thrust::make_tuple(grad_p, grad_v0, grad_v1, grad_v2); +} + + + +__device__ inline float2 +PointLine3DistanceCoordsForward(const float3& p, const float3& v0, const float3& v1) { + const float3 v1v0 = v1 - v0; + const float3 pv0 = p - v0; + const float t_bot = dot(v1v0, v1v0); + const float t_top = dot(pv0, v1v0); + // if t_bot small, then v0 == v1, set tt to 0. + float tt = (t_bot < kEpsilon) ? 0.0f : (t_top / t_bot); + + tt = __saturatef(tt); // clamps to [0, 1] + + const float3 p_proj = v0 + tt * v1v0; + const float3 diff = p - p_proj; + const float dist = dot(diff, diff); + return make_float2(dist, tt); +} + + +__device__ float closest_pt_on_line(const float3& a, const float3& b, const float3& c, float3& closest_pt){ + float3 ac = c - a; + float3 ab = b - a; + float t = dot(ac, ab) / dot(ab, ab); + t = fminf(0.f, t); + t = fmaxf(t, 1.f); + closest_pt = a + t * ab; + return norm(closest_pt - c); +} + + +__device__ bool pt_in_triangle(const float3& v0, const float3& v1, const float3& v2, const float3& p) +{ + float3 a = v0 - p; + float3 b = v1 - p; + float3 c = v2 - p; + + float3 u = cross(a, b); + float3 v = cross(b, c); + float3 w = cross(c, a); + + if (dot(u, v) < 0.f){ + return false; + } + if (dot(u, w) < 0.f){ + return false; + } + return true; +} + + +// PointFaceDistance with barycentric coordinates +// No Backward is implemented +__device__ inline thrust::tuple +PointTriangle3DistanceCoordsForward( + const float3& p, + const float3& v0, + const float3& v1, + const float3& v2) { + + float3 normal = cross(v2 - v0, v1 - v0); + const float norm_normal = norm(normal); + normal = normalize(normal); + + // p0 is the projection of p on the plane spanned by (v0, v1, v2) + // i.e. p0 = p + t * normal, s.t. (p0 - v0) is orthogonal to normal + + + // check if point projected to triangle +// float3 bary = BarycentricCoords3Forward(p0, v0, v1, v2); // barycentric coordinates +// bool x_in = (0.0f <= bary.x) && (bary.x <= 1.0f); +// bool y_in = (0.0f <= bary.y) && (bary.y <= 1.0f); +// bool z_in = (0.0f <= bary.z) && (bary.z <= 1.0f); +// bool is_inside = x_in && y_in && z_in; + bool is_inside = pt_in_triangle(v0, v1, v2, p); + +// float dist = 0.0f; +// float tt = 0.0f; +// int type = -1; +// if ((is_inside) && (norm_normal > kEpsilon)) { +// // if projection p0 is inside triangle spanned by (v0, v1, v2) +// // then distance is equal to norm(p0 - p)^2 +// dist = dot(p - p0, p - p0); +// type = 0; +// +// } else { +// const float2 e01 = PointLine3DistanceCoordsForward(p, v0, v1); // 1-tt, tt, 0 +// const float2 e02 = PointLine3DistanceCoordsForward(p, v0, v2); // 1-tt, 0, tt +// const float2 e12 = PointLine3DistanceCoordsForward(p, v1, v2); // 0, 1-tt, tt +// +// if (e01.x > e02.x) { +// if (e02.x > e12.x) { +// dist = e12.x; tt = e12.y; +// bary.x = 0; bary.y = 1-tt; bary.z = tt; +// type = 1; +// } else { +// dist = e02.x; tt = e02.y; +// bary.x = 1-tt; bary.y = 0; bary.z = tt; +// type = 2; +// } +// } else { +// if (e01.x > e12.x) { +// dist = e12.x; tt = e12.y; +// bary.x = 0; bary.y = 1-tt; bary.z = tt; +// type = 1; +// } else { +// dist = e01.x; tt = e01.y; +// bary.x = 1-tt; bary.y = tt; bary.z = 0; +// type = 3; +// } +// } +// } + float dist = 0.f; + float3 closest_pt; + if (is_inside){ + const float t = dot(v0 - p, normal); + closest_pt = p + t * normal; + dist = dot(p - closest_pt, p - closest_pt); + }else{ + float3 closest_pt_tmp; + dist = closest_pt_on_line(v0, v1, p, closest_pt_tmp); + closest_pt = closest_pt_tmp; + float d2 = closest_pt_on_line(v1, v2, p, closest_pt_tmp); + if (d2 < dist){ + closest_pt = closest_pt_tmp; + dist = d2; + } + float d3 = closest_pt_on_line(v2, v0, p, closest_pt_tmp); + if (d3 < dist){ + closest_pt = closest_pt_tmp; + dist = d3; + } + dist = dist * dist; // squared distance + } + + float3 bary = BarycentricCoords3Forward(closest_pt, v0, v1, v2); + + return thrust::make_tuple(dist, bary); +} \ No newline at end of file diff --git a/AnimatableGaussians/utils/posevocab_custom_ops/near_far_smpl.py b/AnimatableGaussians/utils/posevocab_custom_ops/near_far_smpl.py new file mode 100644 index 0000000000000000000000000000000000000000..2ef1102f5c9bf7764684f9a920cd71a6bbfb9acb --- /dev/null +++ b/AnimatableGaussians/utils/posevocab_custom_ops/near_far_smpl.py @@ -0,0 +1,30 @@ +from __future__ import division, print_function +import os +import torch +import numpy as np +from torch.utils.cpp_extension import load + +# file_dir = os.path.dirname(os.path.realpath(__file__)) +# sources = [file_dir + '/near_far_smpl.cpp', file_dir + '/near_far_smpl_kernel.cu'] +# +# near_far_smpl_bridge = load( +# name='near_far_smpl_bridge', +# sources=sources, +# # extra_include_paths=['/usr/include/python2.7'], +# verbose=True) +import posevocab_custom_ops + + +def near_far_smpl(vertices, ray_o, ray_d, radius = 0.1): + vertices = vertices.contiguous().to(torch.float32) + ray_o = ray_o.contiguous().to(torch.float32) + ray_d = ray_d.contiguous().to(torch.float32) + ray_num = ray_o.shape[0] + near = torch.cuda.FloatTensor(ray_num).fill_(0.0).contiguous() + far = torch.cuda.FloatTensor(ray_num).fill_(0.0).contiguous() + intersect_flag = torch.cuda.BoolTensor(ray_num).fill_(0.0).contiguous() + posevocab_custom_ops.near_far_smpl(vertices, ray_o, ray_d, near, far, intersect_flag, radius) + return near, far, intersect_flag + + + diff --git a/AnimatableGaussians/utils/posevocab_custom_ops/near_far_smpl_kernel.cu b/AnimatableGaussians/utils/posevocab_custom_ops/near_far_smpl_kernel.cu new file mode 100644 index 0000000000000000000000000000000000000000..1e651e046b22ccd47b8c1daff70b653477da646a --- /dev/null +++ b/AnimatableGaussians/utils/posevocab_custom_ops/near_far_smpl_kernel.cu @@ -0,0 +1,122 @@ +#include +#include +#include +#include + +#ifndef FLT_MAX +#define FLT_MAX 3.402823466e+38F +#endif + +#define EPSILON_ABS_ZERO 1e-10 +#define EPSILON_DIV_ZERO 1e-4 + + +// for the older gpus atomicAdd with double arguments does not exist +//#if __CUDA_ARCH__ < 600 and defined(__CUDA_ARCH__) +//static __inline__ __device__ double atomicAdd(double* address, double val) { +// unsigned long long int* address_as_ull = (unsigned long long int*)address; +// unsigned long long int old = *address_as_ull, assumed; +// do { +// assumed = old; +// old = atomicCAS(address_as_ull, assumed, +// __double_as_longlong(val + __longlong_as_double(assumed))); +// // Note: uses integer comparison to avoid hang in case of NaN (since NaN != NaN) } while (assumed != old); +// } while (assumed != old); +// return __longlong_as_double(old); +//} +//#endif + +__device__ float fast_sqrt(float v) { return __fsqrt_rn(v); } +__device__ double fast_sqrt(double v) { return __dsqrt_rn(v); } + +template +__device__ bool intersect_ball(const scalar_t* ray_o, const scalar_t* ray_d, const scalar_t* center, const scalar_t radius, scalar_t* near, scalar_t* far){ + scalar_t a = ray_d[0] * ray_d[0] + ray_d[1] * ray_d[1] + ray_d[2] * ray_d[2]; + scalar_t b = 2 * (ray_d[0] * (ray_o[0] - center[0]) + ray_d[1] * (ray_o[1] - center[1]) + ray_d[2] * (ray_o[2] - center[2])); + scalar_t c = (ray_o[0] - center[0]) * (ray_o[0] - center[0]) + (ray_o[1] - center[1]) * (ray_o[1] - center[1]) + (ray_o[2] - center[2]) * (ray_o[2] - center[2]) - radius * radius; + scalar_t d = b * b - 4 * a * c; + if (d < 1e-8){ + return false; + } else{ + *near = (-b - fast_sqrt(d)) / (2 * a); + *far = (-b + fast_sqrt(d)) / (2 * a); + return true; + } +} + + +template +__global__ void near_far_smpl_kernel( + const scalar_t* __restrict__ vertices, + const scalar_t* __restrict__ ray_o, + const scalar_t* __restrict__ ray_d, + scalar_t* __restrict__ near, + scalar_t* __restrict__ far, + bool* __restrict__ intersect_flag, + const scalar_t radius, + int vertex_num, + int ray_num) +{ + const int tid = blockIdx.x * blockDim.x + threadIdx.x; + if (tid >= ray_num) { + return; + } + const scalar_t ray_o_[3] = { + ray_o[3 * tid + 0], ray_o[3 * tid + 1], ray_o[3 * tid + 2] + }; + const scalar_t ray_d_[3] = { + ray_d[3 * tid + 0], ray_d[3 * tid + 1], ray_d[3 * tid + 2] + }; + + near[tid] = FLT_MAX; + far[tid] = -1.0; + bool intersect_once = false; + for (int vi = 0; vi < vertex_num; vi++) + { + const scalar_t v[3] = {vertices[3 * vi + 0], vertices[3 * vi + 1], vertices[3 * vi + 2]}; + + scalar_t near_ = 0.0, far_ = 0.0; + bool intersect = intersect_ball(ray_o_, ray_d_, v, radius, &near_, &far_); + if (!intersect){ + continue; + }else{ + intersect_once = true; + near[tid] = fminf(near[tid], near_); + far[tid] = fmaxf(far[tid], far_); + intersect_flag[tid] = true; + } + } + if (!intersect_once){ + near[tid] = 0.0; + far[tid] = 0.0; + intersect_flag[tid] = false; + } +} + + + +void near_far_smpl(at::Tensor vertices, at::Tensor ray_o, at::Tensor ray_d, at::Tensor near, at::Tensor far, at::Tensor intersect_flag, const float radius) +{ + const auto vertex_num = vertices.size(0); + const auto ray_num = ray_o.size(0); + const int threads = 512; + const dim3 blocks((ray_num - 1) / threads + 1); + AT_DISPATCH_FLOATING_TYPES(vertices.scalar_type(), "near_far_smpl_kernel", ([&] { + near_far_smpl_kernel<<>>( + vertices.data(), + ray_o.data(), + ray_d.data(), + near.data(), + far.data(), + intersect_flag.data(), + radius, + vertex_num, + ray_num); + })); + + cudaError_t err = cudaGetLastError(); + if (err != cudaSuccess) + printf("Error in sdf_kernel: %s\n", cudaGetErrorString(err)); + + return; +} \ No newline at end of file diff --git a/AnimatableGaussians/utils/posevocab_custom_ops/nearest_face.py b/AnimatableGaussians/utils/posevocab_custom_ops/nearest_face.py new file mode 100644 index 0000000000000000000000000000000000000000..2a5b40ebee85b9f069dd526e3c99b8b3a34a078a --- /dev/null +++ b/AnimatableGaussians/utils/posevocab_custom_ops/nearest_face.py @@ -0,0 +1,94 @@ +from __future__ import division, print_function +import os +import time +import torch +import numpy as np +from torch.utils.cpp_extension import load + +# dir_name = os.path.dirname(os.path.realpath(__file__)) +# sources = [dir_name + '/nearest_face_kernel.cu', dir_name + '/nearest_face.cpp'] +# +# nearest_face_bridge = load( +# name='nearest_face_bridge', +# sources=sources, +# verbose=True) +import posevocab_custom_ops + + +def nearest_face(vertices, faces, query_points): + vertices = vertices.contiguous().to(torch.float32) + faces = faces.contiguous().to(torch.int32) + query_points = query_points.contiguous().to(torch.float32) + query_num = query_points.size(0) + dist = torch.cuda.FloatTensor(query_num).fill_(0.0).contiguous() + face_ids = torch.cuda.IntTensor(query_num).fill_(-1).contiguous() + nearest_pts = torch.cuda.FloatTensor(query_num, 3).fill_(0.0).contiguous() + posevocab_custom_ops.nearest_face(vertices, faces, query_points, dist, face_ids, nearest_pts) + return dist, face_ids, nearest_pts + + +def nearest_face_pytorch3d(points, vertices, faces): + """ + :param points: (B, N, 3) + :param vertices: (B, M, 3) + :param faces: (F, 3) + :return dists (B, N), indices (B, N), bc_coords (B, N, 3) + """ + B, N = points.shape[:2] + F = faces.shape[0] + dists, indices, bc_coords = [], [], [] + points = points.contiguous() + for b in range(B): + triangles = vertices[b, faces.reshape(-1).to(torch.long)].reshape(F, 3, 3) + triangles = triangles.contiguous() + + l_idx = torch.tensor([0, ]).to(torch.long).to(points.device) + dist, index, w0, w1, w2 = posevocab_custom_ops.nearest_face_pytorch3d( + points[b], + l_idx, + triangles, + l_idx, + N + ) + dists.append(torch.sqrt(dist)) + indices.append(index) + bc_coords.append(torch.stack([w0, w1, w2], 1)) + + dists = torch.stack(dists, 0) + indices = torch.stack(indices, 0) + bc_coords = torch.stack(bc_coords, 0) + + return dists, indices, bc_coords + + +if __name__ == '__main__': + import trimesh + import igl + mesh = trimesh.load('../../debug/smpl_torch_0.obj', process = False) + vertices = torch.from_numpy(mesh.vertices).to(torch.float32).cuda() + faces = torch.from_numpy(mesh.faces).to(torch.int32).cuda() + query = torch.randn((1024*32, 3)).to(vertices) + time0 = time.time() + dist1, face_ids1, closest_pts1 = nearest_face(vertices, faces, query) + print('Time cost: %f' % (time.time() - time0)) + # print(dist1) + # print(face_ids1) + # print(closest_pts1) + + time1 = time.time() + dist2, face_ids2, closest_pts2 = igl.signed_distance(query.cpu().numpy(), vertices.cpu().numpy(), faces.cpu().numpy()) + print('Time cost: %f' % (time.time() - time1)) + # print(dist2) + # print(face_ids2) + # print(closest_pts2) + + # print(np.abs(dist1.cpu().numpy() - dist2).sum()) + # print(np.abs(face_ids1.cpu().numpy() - face_ids2).sum()) + # print(np.abs(closest_pts1.cpu().numpy() - closest_pts2).sum()) + + time2 = time.time() + dist3, face_ids3, bc_coords = nearest_face_pytorch3d(query[None], vertices, faces) + print('Time cost: %f' % (time.time() - time2)) + # print(dist3[0]) + # print(face_ids3[0]) + diff --git a/AnimatableGaussians/utils/posevocab_custom_ops/nearest_face_kernel.cu b/AnimatableGaussians/utils/posevocab_custom_ops/nearest_face_kernel.cu new file mode 100644 index 0000000000000000000000000000000000000000..dc9db2628b2dfc21542759bb39020d5f49fb7853 --- /dev/null +++ b/AnimatableGaussians/utils/posevocab_custom_ops/nearest_face_kernel.cu @@ -0,0 +1,256 @@ +#include +#include +#include +#include +#include + +#ifndef FLT_MAX +#define FLT_MAX 3.402823466e+38F +#endif + +#define EPSILON_ABS_ZERO 1e-10 +#define EPSILON_DIV_ZERO 1e-4 + + +// for the older gpus atomicAdd with double arguments does not exist +//#if __CUDA_ARCH__ < 600 and defined(__CUDA_ARCH__) +//static __inline__ __device__ double atomicAdd(double* address, double val) { +// unsigned long long int* address_as_ull = (unsigned long long int*)address; +// unsigned long long int old = *address_as_ull, assumed; +// do { +// assumed = old; +// old = atomicCAS(address_as_ull, assumed, +// __double_as_longlong(val + __longlong_as_double(assumed))); +// // Note: uses integer comparison to avoid hang in case of NaN (since NaN != NaN) } while (assumed != old); +// } while (assumed != old); +// return __longlong_as_double(old); +//} +//#endif + + +namespace{ + +/* + Distance Calculator +*/ + +__device__ void print_vec3f(const float* p, const char* string) +{ + printf("%s, %f %f %f\n", string, p[0], p[1], p[2]); +} + +__device__ float calc_squared_dist(const float *p1, const float *p2) { + const float x = p1[0] - p2[0]; + const float y = p1[1] - p2[1]; + const float z = p1[2] - p2[2]; + return x*x + y*y + z*z; +} + +__device__ double calc_squared_dist(const double *p1, const double *p2) { + const double x = p1[0] - p2[0]; + const double y = p1[1] - p2[1]; + const double z = p1[2] - p2[2]; + return x*x + y*y + z*z; +} + +__device__ float fast_sqrt(float v) { return __fsqrt_rn(v); } +__device__ double fast_sqrt(double v) { return __dsqrt_rn(v); } +__device__ void my_swap(int *a, int *b) { + int tmp = *a; + *a = *b; + *b = tmp; +} +__device__ void my_swap(double *a, double *b) { + double tmp = *a; + *a = *b; + *b = tmp; +} +__device__ void my_swap(float *a, float *b) { + float tmp = *a; + *a = *b; + *b = tmp; +} + +template +__device__ void cross(const scalar_t* v1, const scalar_t* v2, scalar_t* n) +{ + n[0] = v1[1] * v2[2] - v1[2] * v2[1]; + n[1] = v1[2] * v2[0] - v1[0] * v2[2]; + n[2] = v1[0] * v2[1] - v1[1] * v2[0]; +} + +template +__device__ scalar_t dot(const scalar_t* v1, const scalar_t* v2) +{ + return v1[0] * v2[0] + v1[1] * v2[1] + v1[2] * v2[2]; +} + +template +__device__ scalar_t closest_pt_on_plane(const scalar_t* v0, const scalar_t* v1, const scalar_t* v2, const scalar_t* p, scalar_t* closest_pt){ + scalar_t vec01[3] = {v1[0]-v0[0], v1[1]-v0[1], v1[2]-v0[2]}; + scalar_t vec02[3] = {v2[0]-v0[0], v2[1]-v0[1], v2[2]-v0[2]}; + scalar_t plane_normal[3]; + cross(vec01, vec02, plane_normal); + scalar_t norm = fast_sqrt(dot(plane_normal, plane_normal)); + plane_normal[0] /= norm; + plane_normal[1] /= norm; + plane_normal[2] /= norm; + + scalar_t vec0_p[3] = {p[0]-v0[0], p[1]-v0[1], p[2]-v0[2]}; + scalar_t min_dist = dot(vec0_p, plane_normal); + closest_pt[0] = p[0] - min_dist * plane_normal[0]; + closest_pt[1] = p[1] - min_dist * plane_normal[1]; + closest_pt[2] = p[2] - min_dist * plane_normal[2]; + min_dist = fabsf(min_dist); + return min_dist; +} + +template +__device__ bool pt_in_triangle(const scalar_t* v0, const scalar_t* v1, const scalar_t* v2, const scalar_t* p) +{ + scalar_t a[3] = {v0[0] - p[0], v0[1] - p[1], v0[2] - p[2]}; + scalar_t b[3] = {v1[0] - p[0], v1[1] - p[1], v1[2] - p[2]}; + scalar_t c[3] = {v2[0] - p[0], v2[1] - p[1], v2[2] - p[2]}; + + scalar_t u[3], v[3], w[3]; + cross(a, b, u); + cross(b, c, v); + cross(c, a, w); + + // printf("v0 %f %f %f, v1 %f %f %f, v2 %f %f %f, p %f %f %f, a %f %f %f, b %f %f %f, c %f %f %f, u %f %f %f, v %f %f %f, w %f %f %f,\n", + // v0[0],v0[1],v0[2],v1[0],v1[1],v1[2],v2[0],v2[1],v2[2],p[0],p[1],p[2],a[0],a[1],a[2],b[0],b[1],b[2],c[0],c[1],c[2],u[0],u[1],u[2],v[0],v[1],v[2],w[0],w[1],w[2]); + + if (dot(u, v) < 0.f){ + return false; + } + + if (dot(u, w) < 0.f){ + return false; + } + + return true; +} + +template +__device__ scalar_t closest_pt_on_line(const scalar_t* a, const scalar_t* b, const scalar_t* c, scalar_t* closest_pt){ + scalar_t ac[3] = {c[0] - a[0], c[1] - a[1], c[2] - a[2]}; + scalar_t ab[3] = {b[0] - a[0], b[1] - a[1], b[2] - a[2]}; + scalar_t t = dot(ac, ab) / dot(ab, ab); + t = fminf(0.f, t); + t = fmaxf(t, 1.f); + closest_pt[0] = a[0] + t * ab[0]; + closest_pt[1] = a[1] + t * ab[1]; + closest_pt[2] = a[2] + t * ab[2]; + return fast_sqrt(calc_squared_dist(closest_pt, c)); +} + +template +__device__ float closest_pt_in_triangle(const scalar_t* v0, const scalar_t* v1, const scalar_t* v2, const scalar_t* p, scalar_t* closest_pt){ + scalar_t min_dist = closest_pt_on_plane(v0, v1, v2, p, closest_pt); + scalar_t inside_flag = pt_in_triangle(v0, v1, v2, closest_pt); + // printf("v0 %f %f %f, v1 %f %f %f, v2 %f %f %f, p %f %f %f, clsest_pt %f %f %f, inside flag: %d\n", + // v0[0],v0[1],v0[2],v1[0],v1[1],v1[2],v2[0],v2[1],v2[2],p[0],p[1],p[2],closest_pt[0],closest_pt[1],closest_pt[2], inside_flag); + + // inside test + if (inside_flag){ + return min_dist; + } + + scalar_t closest_pt_tmp[3]; + min_dist = closest_pt_on_line(v0, v1, p, closest_pt_tmp); + closest_pt[0] = closest_pt_tmp[0]; closest_pt[1] = closest_pt_tmp[1]; closest_pt[2] = closest_pt_tmp[2]; + scalar_t d2 = closest_pt_on_line(v1, v2, p, closest_pt_tmp); + if (d2 < min_dist) {closest_pt[0] = closest_pt_tmp[0]; closest_pt[1] = closest_pt_tmp[1]; closest_pt[2] = closest_pt_tmp[2]; min_dist = d2;} + scalar_t d3 = closest_pt_on_line(v2, v0, p, closest_pt_tmp); + if (d3 < min_dist) {closest_pt[0] = closest_pt_tmp[0]; closest_pt[1] = closest_pt_tmp[1]; closest_pt[2] = closest_pt_tmp[2]; min_dist = d3;} + + return min_dist; +} + +template +__global__ void nearest_face_kernel( + const scalar_t* __restrict__ vertices, + const int* __restrict__ faces, + const scalar_t* __restrict__ queries, + scalar_t* __restrict__ dist, + int* __restrict__ face_ids, + scalar_t* __restrict__ nearest_pts, + int face_num, + int query_num) { + const int chunk = 512; + __shared__ scalar_t buffer[chunk * 3 * 3]; + for (int fi = 0; fi < face_num; fi += chunk){ + int chunk_size = min(face_num, fi + chunk) - fi; + for (int j = threadIdx.x; j < chunk_size; j += blockDim.x){ + int vidx0 = faces[3 * (fi + j) + 0], vidx1 = faces[3 * (fi + j) + 1], vidx2 = faces[3 * (fi + j) + 2]; + buffer[9 * j + 0] = vertices[3 * vidx0 + 0]; + buffer[9 * j + 1] = vertices[3 * vidx0 + 1]; + buffer[9 * j + 2] = vertices[3 * vidx0 + 2]; + buffer[9 * j + 3] = vertices[3 * vidx1 + 0]; + buffer[9 * j + 4] = vertices[3 * vidx1 + 1]; + buffer[9 * j + 5] = vertices[3 * vidx1 + 2]; + buffer[9 * j + 6] = vertices[3 * vidx2 + 0]; + buffer[9 * j + 7] = vertices[3 * vidx2 + 1]; + buffer[9 * j + 8] = vertices[3 * vidx2 + 2]; + } + __syncthreads(); + +// for (int query_idx = threadIdx.x + blockIdx.x * blockDim.x; query_idx < query_num; query_idx += blockDim.x * gridDim.x) + int query_idx = threadIdx.x + blockIdx.x * blockDim.x; + if (query_idx < query_num) + { + const scalar_t query_pt[3] = { + queries[3 * query_idx + 0], queries[3 * query_idx + 1], queries[3 * query_idx + 2] + }; + int nearest_face_id = 0; + scalar_t nearest_dist = FLT_MAX; + scalar_t nearest_pt[3]; + for (int k = 0; k < chunk_size; k++){ + scalar_t nearest_pt_tmp[3]; + scalar_t d = closest_pt_in_triangle(buffer + 9 * k + 0, buffer + 9 * k + 3, buffer + 9 * k + 6, query_pt, nearest_pt_tmp); + if (nearest_dist > d || k == 0){ + nearest_face_id = k + fi; + nearest_dist = d; + nearest_pt[0] = nearest_pt_tmp[0]; + nearest_pt[1] = nearest_pt_tmp[1]; + nearest_pt[2] = nearest_pt_tmp[2]; + } + } + if (fi == 0 || dist[query_idx] > nearest_dist){ + dist[query_idx] = nearest_dist; + face_ids[query_idx] = nearest_face_id; + nearest_pts[3 * query_idx + 0] = nearest_pt[0]; + nearest_pts[3 * query_idx + 1] = nearest_pt[1]; + nearest_pts[3 * query_idx + 2] = nearest_pt[2]; + } + } + __syncthreads(); + } +} + +} + +void nearest_face(at::Tensor vertices, at::Tensor faces, at::Tensor queries, at::Tensor dist, at::Tensor face_ids, at::Tensor nearest_pts) +{ + const auto vertex_num = vertices.size(0); + const auto query_num = queries.size(0); + const auto face_num = faces.size(0); + const int threads = 512; + const dim3 blocks((query_num - 1) / threads + 1); +// const int blocks = 256; +// const int threads = 256; + AT_DISPATCH_FLOATING_TYPES(vertices.type(), "nearest_face_kernel", ([&] { + nearest_face_kernel<<>>( + vertices.data(), + faces.data(), + queries.data(), + dist.data(), + face_ids.data(), + nearest_pts.data(), + face_num, query_num); + })); + + //cudaError_t err = cudaGetLastError(); + //if (err != cudaSuccess) + // printf("Error in nearest_face_kernel: %s\n", cudaGetErrorString(err)); +} \ No newline at end of file diff --git a/AnimatableGaussians/utils/posevocab_custom_ops/point_mesh.cu b/AnimatableGaussians/utils/posevocab_custom_ops/point_mesh.cu new file mode 100644 index 0000000000000000000000000000000000000000..feaf6cb263b59161d50713b0d1448255ed1039fd --- /dev/null +++ b/AnimatableGaussians/utils/posevocab_custom_ops/point_mesh.cu @@ -0,0 +1,719 @@ +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. + +#include +#include +#include +#include +#include +#include +#include +#include "float_math.cuh" +#include "geometry_utils.cuh" +#include "warp_reduce.cuh" + +// **************************************************************************** +// * PointFaceDistance * +// **************************************************************************** + +__global__ void PointFaceForwardKernel( + const float* __restrict__ points, // (P, 3) + const int64_t* __restrict__ points_first_idx, // (B,) + const float* __restrict__ tris, // (T, 3, 3) + const int64_t* __restrict__ tris_first_idx, // (B,) + float* __restrict__ dist_points, // (P,) + int64_t* __restrict__ idx_points, // (P,) + float* __restrict__ w0, // (P,) + float* __restrict__ w1, // (P,) + float* __restrict__ w2, // (P,) + const size_t B, + const size_t P, + const size_t T) { + + float3* points_f3 = (float3*)points; + float3* tris_f3 = (float3*)tris; + + // Single shared memory buffer which is split and cast to different types. + extern __shared__ char shared_buf[]; + + float* min_dists = (float*)shared_buf; // float[NUM_THREADS] + float* mw0 = (float*)&min_dists[blockDim.x]; + float* mw1 = (float*)&min_dists[blockDim.x * 2]; + float* mw2 = (float*)&min_dists[blockDim.x * 3]; + int64_t* min_idxs = (int64_t*)&min_dists[blockDim.x * 4]; // int64_t[NUM_THREADS] + + const size_t batch_idx = blockIdx.y; // index of batch element. + + // start and end for points in batch_idx + const int64_t startp = points_first_idx[batch_idx]; + const int64_t endp = batch_idx + 1 < B ? points_first_idx[batch_idx + 1] : P; + + // start and end for faces in batch_idx + const int64_t startt = tris_first_idx[batch_idx]; + const int64_t endt = batch_idx + 1 < B ? tris_first_idx[batch_idx + 1] : T; + + const size_t i = blockIdx.x; // index of point within batch element. + const size_t tid = threadIdx.x; // thread index + + // Each block will compute one element of the output idx_points[startp + i], + // dist_points[startp + i]. Within the block we will use threads to compute + // the distances between points[startp + i] and tris[j] for all j belonging + // in the same batch as i, i.e. j in [startt, endt]. Then use a block + // reduction to take an argmin of the distances. + + // If i exceeds the number of points in batch_idx, then do nothing + if (i < (endp - startp)) { + // Retrieve (startp + i) point + const float3 p_f3 = points_f3[startp + i]; + + // Compute the distances between points[startp + i] and tris[j] for + // all j belonging in the same batch as i, i.e. j in [startt, endt]. + // Here each thread will reduce over (endt-startt) / blockDim.x in serial, + // and store its result to shared memory + float min_dist = FLT_MAX; + size_t min_idx = 0; + float min_w0 = -1; + float min_w1 = -1; + float min_w2 = -1; + + for (size_t j = tid; j < (endt - startt); j += blockDim.x) { + const float3 v0 = tris_f3[(startt + j) * 3 + 0]; + const float3 v1 = tris_f3[(startt + j) * 3 + 1]; + const float3 v2 = tris_f3[(startt + j) * 3 + 2]; + thrust::tuple outs = PointTriangle3DistanceCoordsForward(p_f3, v0, v1, v2); + float dist = thrust::get<0>(outs); + float3 bary = thrust::get<1>(outs); + // printf("%f : %f %f %f %d |\n", dist, bary.x, bary.y, bary.z, startt + j); + min_dist = (j == tid) ? dist : min_dist; + min_idx = (dist <= min_dist) ? (startt + j) : min_idx; + min_w0 = (dist <= min_dist) ? bary.x : min_w0; + min_w1 = (dist <= min_dist) ? bary.y : min_w1; + min_w2 = (dist <= min_dist) ? bary.z : min_w2; + min_dist = (dist <= min_dist) ? dist : min_dist; + } + min_dists[tid] = min_dist; + min_idxs[tid] = min_idx; + mw0[tid] = min_w0; + mw1[tid] = min_w1; + mw2[tid] = min_w2; + __syncthreads(); + + // Perform reduction in shared memory. + for (int s = blockDim.x / 2; s > 32; s >>= 1) { + if (tid < s) { + if (min_dists[tid] > min_dists[tid + s]) { + min_dists[tid] = min_dists[tid + s]; + min_idxs[tid] = min_idxs[tid + s]; + mw0[tid] = mw0[tid + s]; + mw1[tid] = mw1[tid + s]; + mw2[tid] = mw2[tid + s]; + } + } + __syncthreads(); + } + + // Unroll the last 6 iterations of the loop since they will happen + // synchronized within a single warp. + if (tid < 32) + WarpReduce2(min_dists, min_idxs, mw0, mw1, mw2, tid); + + // Finally thread 0 writes the result to the output buffer. + if (tid == 0) { + idx_points[startp + i] = min_idxs[0]; + dist_points[startp + i] = min_dists[0]; + w0[startp + i] = mw0[0]; + w1[startp + i] = mw1[0]; + w2[startp + i] = mw2[0]; + } + } +} + +std::tuple +PointFaceDistanceForwardCuda( + const at::Tensor& points, + const at::Tensor& points_first_idx, + const at::Tensor& tris, + const at::Tensor& tris_first_idx, + const int64_t max_points) { + // Check inputs are on the same device + at::TensorArg points_t{points, "points", 1}, + points_first_idx_t{points_first_idx, "points_first_idx", 2}, + tris_t{tris, "tris", 3}, + tris_first_idx_t{tris_first_idx, "tris_first_idx", 4}; + at::CheckedFrom c = "PointFaceDistanceForwardCuda"; + at::checkAllSameGPU( + c, {points_t, points_first_idx_t, tris_t, tris_first_idx_t}); + at::checkAllSameType(c, {points_t, tris_t}); + + // Set the device for the kernel launch based on the device of the input + at::cuda::CUDAGuard device_guard(points.device()); + cudaStream_t stream = at::cuda::getCurrentCUDAStream(); + + const int64_t P = points.size(0); + const int64_t T = tris.size(0); + const int64_t B = points_first_idx.size(0); + + TORCH_CHECK(points.size(1) == 3, "points must be of shape Px3"); + TORCH_CHECK( + (tris.size(1) == 3) && (tris.size(2) == 3), + "tris must be of shape Tx3x3"); + TORCH_CHECK(tris_first_idx.size(0) == B); + + // clang-format off + at::Tensor dists = at::zeros({P,}, points.options()); + at::Tensor w0 = at::zeros({P,}, points.options()); + at::Tensor w1 = at::zeros({P,}, points.options()); + at::Tensor w2 = at::zeros({P,}, points.options()); + at::Tensor idxs = at::zeros({P,}, points_first_idx.options()); + // clang-format on + + if (dists.numel() == 0) { + AT_CUDA_CHECK(cudaGetLastError()); + return std::make_tuple(dists, idxs, w0, w1, w2); + } + + const int threads = 128; + const dim3 blocks(max_points, B); + size_t shared_size = 4 * threads * sizeof(size_t) + threads * sizeof(int64_t); + + PointFaceForwardKernel<<>>( + points.data_ptr(), + points_first_idx.data_ptr(), + tris.data_ptr(), + tris_first_idx.data_ptr(), + dists.data_ptr(), + idxs.data_ptr(), + w0.data_ptr(), + w1.data_ptr(), + w2.data_ptr(), + B, + P, + T); + + AT_CUDA_CHECK(cudaGetLastError()); + return std::make_tuple(dists, idxs, w0, w1, w2); +} + +__global__ void PointFaceBackwardKernel( + const float* __restrict__ points, // (P, 3) + const float* __restrict__ tris, // (T, 3, 3) + const int64_t* __restrict__ idx_points, // (P,) + const float* __restrict__ grad_dists, // (P,) + float* __restrict__ grad_points, // (P, 3) + float* __restrict__ grad_tris, // (T, 3, 3) + const size_t P) { + float3* points_f3 = (float3*)points; + float3* tris_f3 = (float3*)tris; + + const size_t tid = blockIdx.x * blockDim.x + threadIdx.x; + const size_t stride = gridDim.x * blockDim.x; + + for (size_t p = tid; p < P; p += stride) { + const float3 p_f3 = points_f3[p]; + + const int64_t tidx = idx_points[p]; + const float3 v0 = tris_f3[tidx * 3 + 0]; + const float3 v1 = tris_f3[tidx * 3 + 1]; + const float3 v2 = tris_f3[tidx * 3 + 2]; + + const float grad_dist = grad_dists[p]; + + const auto grads = + PointTriangle3DistanceBackward(p_f3, v0, v1, v2, grad_dist); + const float3 grad_point = thrust::get<0>(grads); + const float3 grad_v0 = thrust::get<1>(grads); + const float3 grad_v1 = thrust::get<2>(grads); + const float3 grad_v2 = thrust::get<3>(grads); + + atomicAdd(grad_points + p * 3 + 0, grad_point.x); + atomicAdd(grad_points + p * 3 + 1, grad_point.y); + atomicAdd(grad_points + p * 3 + 2, grad_point.z); + + atomicAdd(grad_tris + tidx * 3 * 3 + 0 * 3 + 0, grad_v0.x); + atomicAdd(grad_tris + tidx * 3 * 3 + 0 * 3 + 1, grad_v0.y); + atomicAdd(grad_tris + tidx * 3 * 3 + 0 * 3 + 2, grad_v0.z); + + atomicAdd(grad_tris + tidx * 3 * 3 + 1 * 3 + 0, grad_v1.x); + atomicAdd(grad_tris + tidx * 3 * 3 + 1 * 3 + 1, grad_v1.y); + atomicAdd(grad_tris + tidx * 3 * 3 + 1 * 3 + 2, grad_v1.z); + + atomicAdd(grad_tris + tidx * 3 * 3 + 2 * 3 + 0, grad_v2.x); + atomicAdd(grad_tris + tidx * 3 * 3 + 2 * 3 + 1, grad_v2.y); + atomicAdd(grad_tris + tidx * 3 * 3 + 2 * 3 + 2, grad_v2.z); + } +} + +std::tuple PointFaceDistanceBackwardCuda( + const at::Tensor& points, + const at::Tensor& tris, + const at::Tensor& idx_points, + const at::Tensor& grad_dists) { + // Check inputs are on the same device + at::TensorArg points_t{points, "points", 1}, + idx_points_t{idx_points, "idx_points", 2}, tris_t{tris, "tris", 3}, + grad_dists_t{grad_dists, "grad_dists", 4}; + at::CheckedFrom c = "PointFaceDistanceBackwardCuda"; + at::checkAllSameGPU(c, {points_t, idx_points_t, tris_t, grad_dists_t}); + at::checkAllSameType(c, {points_t, tris_t, grad_dists_t}); + + // Set the device for the kernel launch based on the device of the input + at::cuda::CUDAGuard device_guard(points.device()); + cudaStream_t stream = at::cuda::getCurrentCUDAStream(); + + const int64_t P = points.size(0); + const int64_t T = tris.size(0); + + TORCH_CHECK(points.size(1) == 3, "points must be of shape Px3"); + TORCH_CHECK( + (tris.size(1) == 3) && (tris.size(2) == 3), + "tris must be of shape Tx3x3"); + TORCH_CHECK(idx_points.size(0) == P); + TORCH_CHECK(grad_dists.size(0) == P); + + // clang-format off + at::Tensor grad_points = at::zeros({P, 3}, points.options()); + at::Tensor grad_tris = at::zeros({T, 3, 3}, tris.options()); + // clang-format on + + if (grad_points.numel() == 0 || grad_tris.numel() == 0) { + AT_CUDA_CHECK(cudaGetLastError()); + return std::make_tuple(grad_points, grad_tris); + } + + const int blocks = 64; + const int threads = 512; + + PointFaceBackwardKernel<<>>( + points.data_ptr(), + tris.data_ptr(), + idx_points.data_ptr(), + grad_dists.data_ptr(), + grad_points.data_ptr(), + grad_tris.data_ptr(), + P); + + AT_CUDA_CHECK(cudaGetLastError()); + return std::make_tuple(grad_points, grad_tris); +} + +// **************************************************************************** +// * FacePointDistance * +// **************************************************************************** + +__global__ void FacePointForwardKernel( + const float* __restrict__ points, // (P, 3) + const int64_t* __restrict__ points_first_idx, // (B,) + const float* __restrict__ tris, // (T, 3, 3) + const int64_t* __restrict__ tris_first_idx, // (B,) + float* __restrict__ dist_tris, // (T,) + int64_t* __restrict__ idx_tris, // (T,) + const size_t B, + const size_t P, + const size_t T) { + float3* points_f3 = (float3*)points; + float3* tris_f3 = (float3*)tris; + + // Single shared memory buffer which is split and cast to different types. + extern __shared__ char shared_buf[]; + float* min_dists = (float*)shared_buf; // float[NUM_THREADS] + int64_t* min_idxs = (int64_t*)&min_dists[blockDim.x]; // int64_t[NUM_THREADS] + + const size_t batch_idx = blockIdx.y; // index of batch element. + + // start and end for points in batch_idx + const int64_t startp = points_first_idx[batch_idx]; + const int64_t endp = batch_idx + 1 < B ? points_first_idx[batch_idx + 1] : P; + + // start and end for tris in batch_idx + const int64_t startt = tris_first_idx[batch_idx]; + const int64_t endt = batch_idx + 1 < B ? tris_first_idx[batch_idx + 1] : T; + + const size_t i = blockIdx.x; // index of point within batch element. + const size_t tid = threadIdx.x; + + // Each block will compute one element of the output idx_tris[startt + i], + // dist_tris[startt + i]. Within the block we will use threads to compute + // the distances between tris[startt + i] and points[j] for all j belonging + // in the same batch as i, i.e. j in [startp, endp]. Then use a block + // reduction to take an argmin of the distances. + + // If i exceeds the number of tris in batch_idx, then do nothing + if (i < (endt - startt)) { + const float3 v0 = tris_f3[(startt + i) * 3 + 0]; + const float3 v1 = tris_f3[(startt + i) * 3 + 1]; + const float3 v2 = tris_f3[(startt + i) * 3 + 2]; + + // Compute the distances between tris[startt + i] and points[j] for + // all j belonging in the same batch as i, i.e. j in [startp, endp]. + // Here each thread will reduce over (endp-startp) / blockDim.x in serial, + // and store its result to shared memory + float min_dist = FLT_MAX; + size_t min_idx = 0; + for (size_t j = tid; j < (endp - startp); j += blockDim.x) { + // Retrieve (startp + i) point + const float3 p_f3 = points_f3[startp + j]; + + float dist = PointTriangle3DistanceForward(p_f3, v0, v1, v2); + min_dist = (j == tid) ? dist : min_dist; + min_idx = (dist <= min_dist) ? (startp + j) : min_idx; + min_dist = (dist <= min_dist) ? dist : min_dist; + } + min_dists[tid] = min_dist; + min_idxs[tid] = min_idx; + __syncthreads(); + + // Perform reduction in shared memory. + for (int s = blockDim.x / 2; s > 32; s >>= 1) { + if (tid < s) { + if (min_dists[tid] > min_dists[tid + s]) { + min_dists[tid] = min_dists[tid + s]; + min_idxs[tid] = min_idxs[tid + s]; + } + } + __syncthreads(); + } + + // Unroll the last 6 iterations of the loop since they will happen + // synchronized within a single warp. + if (tid < 32) + WarpReduce(min_dists, min_idxs, tid); + + // Finally thread 0 writes the result to the output buffer. + if (tid == 0) { + idx_tris[startt + i] = min_idxs[0]; + dist_tris[startt + i] = min_dists[0]; + } + } +} + +std::tuple FacePointDistanceForwardCuda( + const at::Tensor& points, + const at::Tensor& points_first_idx, + const at::Tensor& tris, + const at::Tensor& tris_first_idx, + const int64_t max_tris) { + // Check inputs are on the same device + at::TensorArg points_t{points, "points", 1}, + points_first_idx_t{points_first_idx, "points_first_idx", 2}, + tris_t{tris, "tris", 3}, + tris_first_idx_t{tris_first_idx, "tris_first_idx", 4}; + at::CheckedFrom c = "FacePointDistanceForwardCuda"; + at::checkAllSameGPU( + c, {points_t, points_first_idx_t, tris_t, tris_first_idx_t}); + at::checkAllSameType(c, {points_t, tris_t}); + + // Set the device for the kernel launch based on the device of the input + at::cuda::CUDAGuard device_guard(points.device()); + cudaStream_t stream = at::cuda::getCurrentCUDAStream(); + + const int64_t P = points.size(0); + const int64_t T = tris.size(0); + const int64_t B = points_first_idx.size(0); + + TORCH_CHECK(points.size(1) == 3, "points must be of shape Px3"); + TORCH_CHECK( + (tris.size(1) == 3) && (tris.size(2) == 3), + "tris must be of shape Tx3x3"); + TORCH_CHECK(tris_first_idx.size(0) == B); + + // clang-format off + at::Tensor dists = at::zeros({T,}, tris.options()); + at::Tensor idxs = at::zeros({T,}, tris_first_idx.options()); + // clang-format on + + if (dists.numel() == 0) { + AT_CUDA_CHECK(cudaGetLastError()); + return std::make_tuple(dists, idxs); + } + + const int threads = 128; + const dim3 blocks(max_tris, B); + size_t shared_size = threads * sizeof(size_t) + threads * sizeof(int64_t); + + FacePointForwardKernel<<>>( + points.data_ptr(), + points_first_idx.data_ptr(), + tris.data_ptr(), + tris_first_idx.data_ptr(), + dists.data_ptr(), + idxs.data_ptr(), + B, + P, + T); + + AT_CUDA_CHECK(cudaGetLastError()); + return std::make_tuple(dists, idxs); +} + +__global__ void FacePointBackwardKernel( + const float* __restrict__ points, // (P, 3) + const float* __restrict__ tris, // (T, 3, 3) + const int64_t* __restrict__ idx_tris, // (T,) + const float* __restrict__ grad_dists, // (T,) + float* __restrict__ grad_points, // (P, 3) + float* __restrict__ grad_tris, // (T, 3, 3) + const size_t T) { + float3* points_f3 = (float3*)points; + float3* tris_f3 = (float3*)tris; + + const size_t tid = blockIdx.x * blockDim.x + threadIdx.x; + const size_t stride = gridDim.x * blockDim.x; + + for (size_t t = tid; t < T; t += stride) { + const float3 v0 = tris_f3[t * 3 + 0]; + const float3 v1 = tris_f3[t * 3 + 1]; + const float3 v2 = tris_f3[t * 3 + 2]; + + const int64_t pidx = idx_tris[t]; + + const float3 p_f3 = points_f3[pidx]; + + const float grad_dist = grad_dists[t]; + + const auto grads = + PointTriangle3DistanceBackward(p_f3, v0, v1, v2, grad_dist); + const float3 grad_point = thrust::get<0>(grads); + const float3 grad_v0 = thrust::get<1>(grads); + const float3 grad_v1 = thrust::get<2>(grads); + const float3 grad_v2 = thrust::get<3>(grads); + + atomicAdd(grad_points + pidx * 3 + 0, grad_point.x); + atomicAdd(grad_points + pidx * 3 + 1, grad_point.y); + atomicAdd(grad_points + pidx * 3 + 2, grad_point.z); + + atomicAdd(grad_tris + t * 3 * 3 + 0 * 3 + 0, grad_v0.x); + atomicAdd(grad_tris + t * 3 * 3 + 0 * 3 + 1, grad_v0.y); + atomicAdd(grad_tris + t * 3 * 3 + 0 * 3 + 2, grad_v0.z); + + atomicAdd(grad_tris + t * 3 * 3 + 1 * 3 + 0, grad_v1.x); + atomicAdd(grad_tris + t * 3 * 3 + 1 * 3 + 1, grad_v1.y); + atomicAdd(grad_tris + t * 3 * 3 + 1 * 3 + 2, grad_v1.z); + + atomicAdd(grad_tris + t * 3 * 3 + 2 * 3 + 0, grad_v2.x); + atomicAdd(grad_tris + t * 3 * 3 + 2 * 3 + 1, grad_v2.y); + atomicAdd(grad_tris + t * 3 * 3 + 2 * 3 + 2, grad_v2.z); + } +} + +std::tuple FacePointDistanceBackwardCuda( + const at::Tensor& points, + const at::Tensor& tris, + const at::Tensor& idx_tris, + const at::Tensor& grad_dists) { + // Check inputs are on the same device + at::TensorArg points_t{points, "points", 1}, + idx_tris_t{idx_tris, "idx_tris", 2}, tris_t{tris, "tris", 3}, + grad_dists_t{grad_dists, "grad_dists", 4}; + at::CheckedFrom c = "FacePointDistanceBackwardCuda"; + at::checkAllSameGPU(c, {points_t, idx_tris_t, tris_t, grad_dists_t}); + at::checkAllSameType(c, {points_t, tris_t, grad_dists_t}); + + // Set the device for the kernel launch based on the device of the input + at::cuda::CUDAGuard device_guard(points.device()); + cudaStream_t stream = at::cuda::getCurrentCUDAStream(); + + const int64_t P = points.size(0); + const int64_t T = tris.size(0); + + TORCH_CHECK(points.size(1) == 3, "points must be of shape Px3"); + TORCH_CHECK( + (tris.size(1) == 3) && (tris.size(2) == 3), + "tris must be of shape Tx3x3"); + TORCH_CHECK(idx_tris.size(0) == T); + TORCH_CHECK(grad_dists.size(0) == T); + + // clang-format off + at::Tensor grad_points = at::zeros({P, 3}, points.options()); + at::Tensor grad_tris = at::zeros({T, 3, 3}, tris.options()); + // clang-format on + + if (grad_points.numel() == 0 || grad_tris.numel() == 0) { + AT_CUDA_CHECK(cudaGetLastError()); + return std::make_tuple(grad_points, grad_tris); + } + + const int blocks = 64; + const int threads = 512; + + FacePointBackwardKernel<<>>( + points.data_ptr(), + tris.data_ptr(), + idx_tris.data_ptr(), + grad_dists.data_ptr(), + grad_points.data_ptr(), + grad_tris.data_ptr(), + T); + + AT_CUDA_CHECK(cudaGetLastError()); + return std::make_tuple(grad_points, grad_tris); +} + +// **************************************************************************** +// * PointFaceArrayDistance * +// **************************************************************************** + +__global__ void PointFaceArrayForwardKernel( + const float* __restrict__ points, // (P, 3) + const float* __restrict__ tris, // (T, 3, 3) + float* __restrict__ dists, // (P, T) + const size_t P, + const size_t T) { + const float3* points_f3 = (float3*)points; + const float3* tris_f3 = (float3*)tris; + + // Parallelize over P * S computations + const int num_threads = gridDim.x * blockDim.x; + const int tid = blockIdx.x * blockDim.x + threadIdx.x; + + for (int t_i = tid; t_i < P * T; t_i += num_threads) { + const int t = t_i / P; // segment index. + const int p = t_i % P; // point index + const float3 v0 = tris_f3[t * 3 + 0]; + const float3 v1 = tris_f3[t * 3 + 1]; + const float3 v2 = tris_f3[t * 3 + 2]; + + const float3 point = points_f3[p]; + float dist = PointTriangle3DistanceForward(point, v0, v1, v2); + dists[p * T + t] = dist; + } +} + +at::Tensor PointFaceArrayDistanceForwardCuda( + const at::Tensor& points, + const at::Tensor& tris) { + // Check inputs are on the same device + at::TensorArg points_t{points, "points", 1}, tris_t{tris, "tris", 2}; + at::CheckedFrom c = "PointFaceArrayDistanceForwardCuda"; + at::checkAllSameGPU(c, {points_t, tris_t}); + at::checkAllSameType(c, {points_t, tris_t}); + + // Set the device for the kernel launch based on the device of the input + at::cuda::CUDAGuard device_guard(points.device()); + cudaStream_t stream = at::cuda::getCurrentCUDAStream(); + + const int64_t P = points.size(0); + const int64_t T = tris.size(0); + + TORCH_CHECK(points.size(1) == 3, "points must be of shape Px3"); + TORCH_CHECK( + (tris.size(1) == 3) && (tris.size(2) == 3), + "tris must be of shape Tx3x3"); + + at::Tensor dists = at::zeros({P, T}, points.options()); + + if (dists.numel() == 0) { + AT_CUDA_CHECK(cudaGetLastError()); + return dists; + } + + const size_t blocks = 1024; + const size_t threads = 64; + + PointFaceArrayForwardKernel<<>>( + points.data_ptr(), + tris.data_ptr(), + dists.data_ptr(), + P, + T); + + AT_CUDA_CHECK(cudaGetLastError()); + return dists; +} + +__global__ void PointFaceArrayBackwardKernel( + const float* __restrict__ points, // (P, 3) + const float* __restrict__ tris, // (T, 3, 3) + const float* __restrict__ grad_dists, // (P, T) + float* __restrict__ grad_points, // (P, 3) + float* __restrict__ grad_tris, // (T, 3, 3) + const size_t P, + const size_t T) { + const float3* points_f3 = (float3*)points; + const float3* tris_f3 = (float3*)tris; + + // Parallelize over P * S computations + const int num_threads = gridDim.x * blockDim.x; + const int tid = blockIdx.x * blockDim.x + threadIdx.x; + + for (int t_i = tid; t_i < P * T; t_i += num_threads) { + const int t = t_i / P; // triangle index. + const int p = t_i % P; // point index + const float3 v0 = tris_f3[t * 3 + 0]; + const float3 v1 = tris_f3[t * 3 + 1]; + const float3 v2 = tris_f3[t * 3 + 2]; + + const float3 point = points_f3[p]; + + const float grad_dist = grad_dists[p * T + t]; + const auto grad = + PointTriangle3DistanceBackward(point, v0, v1, v2, grad_dist); + + const float3 grad_point = thrust::get<0>(grad); + const float3 grad_v0 = thrust::get<1>(grad); + const float3 grad_v1 = thrust::get<2>(grad); + const float3 grad_v2 = thrust::get<3>(grad); + + atomicAdd(grad_points + 3 * p + 0, grad_point.x); + atomicAdd(grad_points + 3 * p + 1, grad_point.y); + atomicAdd(grad_points + 3 * p + 2, grad_point.z); + + atomicAdd(grad_tris + t * 3 * 3 + 0 * 3 + 0, grad_v0.x); + atomicAdd(grad_tris + t * 3 * 3 + 0 * 3 + 1, grad_v0.y); + atomicAdd(grad_tris + t * 3 * 3 + 0 * 3 + 2, grad_v0.z); + + atomicAdd(grad_tris + t * 3 * 3 + 1 * 3 + 0, grad_v1.x); + atomicAdd(grad_tris + t * 3 * 3 + 1 * 3 + 1, grad_v1.y); + atomicAdd(grad_tris + t * 3 * 3 + 1 * 3 + 2, grad_v1.z); + + atomicAdd(grad_tris + t * 3 * 3 + 2 * 3 + 0, grad_v2.x); + atomicAdd(grad_tris + t * 3 * 3 + 2 * 3 + 1, grad_v2.y); + atomicAdd(grad_tris + t * 3 * 3 + 2 * 3 + 2, grad_v2.z); + } +} + +std::tuple PointFaceArrayDistanceBackwardCuda( + const at::Tensor& points, + const at::Tensor& tris, + const at::Tensor& grad_dists) { + // Check inputs are on the same device + at::TensorArg points_t{points, "points", 1}, tris_t{tris, "tris", 2}, + grad_dists_t{grad_dists, "grad_dists", 3}; + at::CheckedFrom c = "PointFaceArrayDistanceBackwardCuda"; + at::checkAllSameGPU(c, {points_t, tris_t, grad_dists_t}); + at::checkAllSameType(c, {points_t, tris_t, grad_dists_t}); + + // Set the device for the kernel launch based on the device of the input + at::cuda::CUDAGuard device_guard(points.device()); + cudaStream_t stream = at::cuda::getCurrentCUDAStream(); + + const int64_t P = points.size(0); + const int64_t T = tris.size(0); + + TORCH_CHECK(points.size(1) == 3, "points must be of shape Px3"); + TORCH_CHECK( + (tris.size(1) == 3) && (tris.size(2) == 3), + "tris must be of shape Tx3x3"); + TORCH_CHECK((grad_dists.size(0) == P) && (grad_dists.size(1) == T)); + + at::Tensor grad_points = at::zeros({P, 3}, points.options()); + at::Tensor grad_tris = at::zeros({T, 3, 3}, tris.options()); + + if (grad_points.numel() == 0 || grad_tris.numel() == 0) { + AT_CUDA_CHECK(cudaGetLastError()); + return std::make_tuple(grad_points, grad_tris); + } + + const size_t blocks = 1024; + const size_t threads = 64; + + PointFaceArrayBackwardKernel<<>>( + points.data_ptr(), + tris.data_ptr(), + grad_dists.data_ptr(), + grad_points.data_ptr(), + grad_tris.data_ptr(), + P, + T); + + AT_CUDA_CHECK(cudaGetLastError()); + return std::make_tuple(grad_points, grad_tris); +} \ No newline at end of file diff --git a/AnimatableGaussians/utils/posevocab_custom_ops/point_mesh.h b/AnimatableGaussians/utils/posevocab_custom_ops/point_mesh.h new file mode 100644 index 0000000000000000000000000000000000000000..e8b1dc06dd4f59835eed3e7a6d947cd969b9c4ff --- /dev/null +++ b/AnimatableGaussians/utils/posevocab_custom_ops/point_mesh.h @@ -0,0 +1,300 @@ +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. + +#pragma once +#include +#include +#include +#include "utils.h" + +// **************************************************************************** +// * PointFaceDistance * +// **************************************************************************** + +// Computes the squared euclidean distance of each p in points to it closest +// triangular face belonging to the corresponding mesh example in the batch of +// size N. +// +// Args: +// points: FloatTensor of shape (P, 3) +// points_first_idx: LongTensor of shape (N,) indicating the first point +// index for each example in the batch +// tris: FloatTensor of shape (T, 3, 3) of the triangular faces. The t-th +// triangulare face is spanned by (tris[t, 0], tris[t, 1], tris[t, 2]) +// tris_first_idx: LongTensor of shape (N,) indicating the first face +// index for each example in the batch +// max_points: Scalar equal to max(P_i) for i in [0, N - 1] containing +// the maximum number of points in the batch and is used to set +// the block dimensions in the CUDA implementation. +// +// Returns: +// dists: FloatTensor of shape (P,), where dists[p] is the minimum +// squared euclidean distance of points[p] to the faces in the same +// example in the batch. +// idxs: LongTensor of shape (P,), where idxs[p] is the index of the closest +// face in the batch. +// So, dists[p] = d(points[p], tris[idxs[p], 0], tris[idxs[p], 1], +// tris[idxs[p], 2]) where d(u, v0, v1, v2) is the distance of u from the +// face spanned by (v0, v1, v2) +// +// + +#ifdef WITH_CUDA + +std::tuple +PointFaceDistanceForwardCuda( + const torch::Tensor& points, + const torch::Tensor& points_first_idx, + const torch::Tensor& tris, + const torch::Tensor& tris_first_idx, + const int64_t max_points); +#endif + + +std::tuple +PointFaceDistanceForward( + const torch::Tensor& points, + const torch::Tensor& points_first_idx, + const torch::Tensor& tris, + const torch::Tensor& tris_first_idx, + const int64_t max_points) { + if (points.is_cuda()) { +#ifdef WITH_CUDA + CHECK_CONTIGUOUS_CUDA(points); + CHECK_CONTIGUOUS_CUDA(points_first_idx); + CHECK_CONTIGUOUS_CUDA(tris); + CHECK_CONTIGUOUS_CUDA(tris_first_idx); + return PointFaceDistanceForwardCuda( + points, points_first_idx, tris, tris_first_idx, max_points); +#else + AT_ERROR("Not compiled with GPU support."); +#endif + } + AT_ERROR("No CPU implementation."); +} + +// Backward pass for PointFaceDistance. +// +// Args: +// points: FloatTensor of shape (P, 3) +// tris: FloatTensor of shape (T, 3, 3) +// idx_points: LongTensor of shape (P,) containing the indices +// of the closest face in the example in the batch. +// This is computed by the forward pass +// grad_dists: FloatTensor of shape (P,) +// +// Returns: +// grad_points: FloatTensor of shape (P, 3) +// grad_tris: FloatTensor of shape (T, 3, 3) +// + +#ifdef WITH_CUDA + +std::tuple PointFaceDistanceBackwardCuda( + const torch::Tensor& points, + const torch::Tensor& tris, + const torch::Tensor& idx_points, + const torch::Tensor& grad_dists); +#endif + +std::tuple PointFaceDistanceBackward( + const torch::Tensor& points, + const torch::Tensor& tris, + const torch::Tensor& idx_points, + const torch::Tensor& grad_dists) { + if (points.is_cuda()) { +#ifdef WITH_CUDA + CHECK_CONTIGUOUS_CUDA(points); + CHECK_CONTIGUOUS_CUDA(tris); + CHECK_CONTIGUOUS_CUDA(idx_points); + CHECK_CONTIGUOUS_CUDA(grad_dists); + return PointFaceDistanceBackwardCuda(points, tris, idx_points, grad_dists); +#else + AT_ERROR("Not compiled with GPU support."); +#endif + } + AT_ERROR("No CPU implementation."); +} + +// **************************************************************************** +// * FacePointDistance * +// **************************************************************************** + +// Computes the squared euclidean distance of each triangular face to its +// closest point belonging to the corresponding example in the batch of size N. +// +// Args: +// points: FloatTensor of shape (P, 3) +// points_first_idx: LongTensor of shape (N,) indicating the first point +// index for each example in the batch +// tris: FloatTensor of shape (T, 3, 3) of the triangular faces. The t-th +// triangulare face is spanned by (tris[t, 0], tris[t, 1], tris[t, 2]) +// tris_first_idx: LongTensor of shape (N,) indicating the first face +// index for each example in the batch +// max_tris: Scalar equal to max(T_i) for i in [0, N - 1] containing +// the maximum number of faces in the batch and is used to set +// the block dimensions in the CUDA implementation. +// +// Returns: +// dists: FloatTensor of shape (T,), where dists[t] is the minimum squared +// euclidean distance of t-th triangular face from the closest point in +// the batch. +// idxs: LongTensor of shape (T,), where idxs[t] is the index of the closest +// point in the batch. +// So, dists[t] = d(points[idxs[t]], tris[t, 0], tris[t, 1], tris[t, 2]) +// where d(u, v0, v1, v2) is the distance of u from the triangular face +// spanned by (v0, v1, v2) +// + +#ifdef WITH_CUDA + +std::tuple FacePointDistanceForwardCuda( + const torch::Tensor& points, + const torch::Tensor& points_first_idx, + const torch::Tensor& tris, + const torch::Tensor& tris_first_idx, + const int64_t max_tros); +#endif + +std::tuple FacePointDistanceForward( + const torch::Tensor& points, + const torch::Tensor& points_first_idx, + const torch::Tensor& tris, + const torch::Tensor& tris_first_idx, + const int64_t max_tris) { + if (points.is_cuda()) { +#ifdef WITH_CUDA + CHECK_CONTIGUOUS_CUDA(points); + CHECK_CONTIGUOUS_CUDA(points_first_idx); + CHECK_CONTIGUOUS_CUDA(tris); + CHECK_CONTIGUOUS_CUDA(tris_first_idx); + return FacePointDistanceForwardCuda( + points, points_first_idx, tris, tris_first_idx, max_tris); +#else + AT_ERROR("Not compiled with GPU support."); +#endif + } + AT_ERROR("No CPU implementation."); +} + +// Backward pass for FacePointDistance. +// +// Args: +// points: FloatTensor of shape (P, 3) +// tris: FloatTensor of shape (T, 3, 3) +// idx_tris: LongTensor of shape (T,) containing the indices +// of the closest point in the example in the batch. +// This is computed by the forward pass +// grad_dists: FloatTensor of shape (T,) +// +// Returns: +// grad_points: FloatTensor of shape (P, 3) +// grad_tris: FloatTensor of shape (T, 3, 3) +// + +#ifdef WITH_CUDA + +std::tuple FacePointDistanceBackwardCuda( + const torch::Tensor& points, + const torch::Tensor& tris, + const torch::Tensor& idx_tris, + const torch::Tensor& grad_dists); +#endif + +std::tuple FacePointDistanceBackward( + const torch::Tensor& points, + const torch::Tensor& tris, + const torch::Tensor& idx_tris, + const torch::Tensor& grad_dists) { + if (points.is_cuda()) { +#ifdef WITH_CUDA + CHECK_CONTIGUOUS_CUDA(points); + CHECK_CONTIGUOUS_CUDA(tris); + CHECK_CONTIGUOUS_CUDA(idx_tris); + CHECK_CONTIGUOUS_CUDA(grad_dists); + return FacePointDistanceBackwardCuda(points, tris, idx_tris, grad_dists); +#else + AT_ERROR("Not compiled with GPU support."); +#endif + } + AT_ERROR("No CPU implementation."); +} + +// **************************************************************************** +// * PointFaceArrayDistance * +// **************************************************************************** + +// Computes the squared euclidean distance of each p in points to each +// triangular face spanned by (v0, v1, v2) in tris. +// +// Args: +// points: FloatTensor of shape (P, 3) +// tris: FloatTensor of shape (T, 3, 3) of the triangular faces. The t-th +// triangulare face is spanned by (tris[t, 0], tris[t, 1], tris[t, 2]) +// +// Returns: +// dists: FloatTensor of shape (P, T), where dists[p, t] is the squared +// euclidean distance of points[p] to the face spanned by (v0, v1, v2) +// where v0 = tris[t, 0], v1 = tris[t, 1] and v2 = tris[t, 2] +// +// For pointcloud and meshes of batch size N, this function requires N +// computations. The memory occupied is O(NPT) which can become quite large. +// For example, a medium sized batch with N = 32 with P = 10000 and T = 5000 +// will require for the forward pass 5.8G of memory to store dists. + +#ifdef WITH_CUDA + +torch::Tensor PointFaceArrayDistanceForwardCuda( + const torch::Tensor& points, + const torch::Tensor& tris); +#endif + +torch::Tensor PointFaceArrayDistanceForward( + const torch::Tensor& points, + const torch::Tensor& tris) { + if (points.is_cuda()) { +#ifdef WITH_CUDA + CHECK_CONTIGUOUS_CUDA(points); + CHECK_CONTIGUOUS_CUDA(tris); + return PointFaceArrayDistanceForwardCuda(points, tris); +#else + AT_ERROR("Not compiled with GPU support."); +#endif + } + AT_ERROR("No CPU implementation."); +} + +// Backward pass for PointFaceArrayDistance. +// +// Args: +// points: FloatTensor of shape (P, 3) +// tris: FloatTensor of shape (T, 3, 3) +// grad_dists: FloatTensor of shape (P, T) +// +// Returns: +// grad_points: FloatTensor of shape (P, 3) +// grad_tris: FloatTensor of shape (T, 3, 3) +// + +#ifdef WITH_CUDA +std::tuple PointFaceArrayDistanceBackwardCuda( + const torch::Tensor& points, + const torch::Tensor& tris, + const torch::Tensor& grad_dists); +#endif + +std::tuple PointFaceArrayDistanceBackward( + const torch::Tensor& points, + const torch::Tensor& tris, + const torch::Tensor& grad_dists) { + if (points.is_cuda()) { +#ifdef WITH_CUDA + CHECK_CONTIGUOUS_CUDA(points); + CHECK_CONTIGUOUS_CUDA(tris); + CHECK_CONTIGUOUS_CUDA(grad_dists); + return PointFaceArrayDistanceBackwardCuda(points, tris, grad_dists); +#else + AT_ERROR("Not compiled with GPU support."); +#endif + } + AT_ERROR("No CPU implementation."); +} \ No newline at end of file diff --git a/AnimatableGaussians/utils/posevocab_custom_ops/posevocab_custom_ops.egg-info/PKG-INFO b/AnimatableGaussians/utils/posevocab_custom_ops/posevocab_custom_ops.egg-info/PKG-INFO new file mode 100644 index 0000000000000000000000000000000000000000..639e0e32dfb0e8ec92acca35c056db0b58d71715 --- /dev/null +++ b/AnimatableGaussians/utils/posevocab_custom_ops/posevocab_custom_ops.egg-info/PKG-INFO @@ -0,0 +1,3 @@ +Metadata-Version: 2.1 +Name: posevocab_custom_ops +Version: 0.0.0 diff --git a/AnimatableGaussians/utils/posevocab_custom_ops/posevocab_custom_ops.egg-info/SOURCES.txt b/AnimatableGaussians/utils/posevocab_custom_ops/posevocab_custom_ops.egg-info/SOURCES.txt new file mode 100644 index 0000000000000000000000000000000000000000..d835a07010d254ee96d4b4e4277357666126fbe0 --- /dev/null +++ b/AnimatableGaussians/utils/posevocab_custom_ops/posevocab_custom_ops.egg-info/SOURCES.txt @@ -0,0 +1,9 @@ +bind.cpp +near_far_smpl_kernel.cu +nearest_face_kernel.cu +point_mesh.cu +setup.py +posevocab_custom_ops.egg-info/PKG-INFO +posevocab_custom_ops.egg-info/SOURCES.txt +posevocab_custom_ops.egg-info/dependency_links.txt +posevocab_custom_ops.egg-info/top_level.txt \ No newline at end of file diff --git a/AnimatableGaussians/utils/posevocab_custom_ops/posevocab_custom_ops.egg-info/dependency_links.txt b/AnimatableGaussians/utils/posevocab_custom_ops/posevocab_custom_ops.egg-info/dependency_links.txt new file mode 100644 index 0000000000000000000000000000000000000000..8b137891791fe96927ad78e64b0aad7bded08bdc --- /dev/null +++ b/AnimatableGaussians/utils/posevocab_custom_ops/posevocab_custom_ops.egg-info/dependency_links.txt @@ -0,0 +1 @@ + diff --git a/AnimatableGaussians/utils/posevocab_custom_ops/posevocab_custom_ops.egg-info/top_level.txt b/AnimatableGaussians/utils/posevocab_custom_ops/posevocab_custom_ops.egg-info/top_level.txt new file mode 100644 index 0000000000000000000000000000000000000000..e26697eaa77eb6bf5b4d8776c0f3791ef539d8be --- /dev/null +++ b/AnimatableGaussians/utils/posevocab_custom_ops/posevocab_custom_ops.egg-info/top_level.txt @@ -0,0 +1 @@ +posevocab_custom_ops diff --git a/AnimatableGaussians/utils/posevocab_custom_ops/setup.py b/AnimatableGaussians/utils/posevocab_custom_ops/setup.py new file mode 100644 index 0000000000000000000000000000000000000000..4f6f1ac32ad26113630b72c927594b30e12bacce --- /dev/null +++ b/AnimatableGaussians/utils/posevocab_custom_ops/setup.py @@ -0,0 +1,25 @@ +from setuptools import setup, Extension +from torch.utils.cpp_extension import CUDAExtension, BuildExtension + +sources = ["bind.cpp", + "near_far_smpl_kernel.cu", + "nearest_face_kernel.cu", + "point_mesh.cu"] + +setup( + name='posevocab_custom_ops', + ext_modules=[ + CUDAExtension( + name='posevocab_custom_ops', + sources=sources, + extra_compile_args={ + "cxx": ["-O2", "-I{}".format("./")], + "nvcc": ["-O2", "-I{}".format("./")], + }, + define_macros=[("WITH_CUDA", None)], + ) + ], + cmdclass={ + 'build_ext': BuildExtension + } +) diff --git a/AnimatableGaussians/utils/posevocab_custom_ops/utils.h b/AnimatableGaussians/utils/posevocab_custom_ops/utils.h new file mode 100644 index 0000000000000000000000000000000000000000..95d7028809dbf21b393ad1a9717adfb8c3884121 --- /dev/null +++ b/AnimatableGaussians/utils/posevocab_custom_ops/utils.h @@ -0,0 +1,27 @@ +// Copyright (c) Facebook, Inc. and its affiliates. +// +// This source code is licensed under the MIT license found in the +// LICENSE file in the root directory of this source tree. + +#pragma once +#include +#include + +#define CHECK_IS_INT(x) \ + do { \ + TORCH_CHECK(x.scalar_type() == at::ScalarType::Int, \ + #x " must be an int tensor"); \ + } while (0) + +#define CHECK_IS_FLOAT(x) \ + do { \ + TORCH_CHECK(x.scalar_type() == at::ScalarType::Float, \ + #x " must be a float tensor"); \ + } while (0) + +#define CHECK_CUDA(x) TORCH_CHECK(x.is_cuda(), #x " must be a CUDA tensor.") +#define CHECK_CONTIGUOUS(x) \ + TORCH_CHECK(x.is_contiguous(), #x " must be contiguous.") +#define CHECK_CONTIGUOUS_CUDA(x) \ + CHECK_CUDA(x); \ + CHECK_CONTIGUOUS(x) \ No newline at end of file diff --git a/AnimatableGaussians/utils/posevocab_custom_ops/warp_reduce.cuh b/AnimatableGaussians/utils/posevocab_custom_ops/warp_reduce.cuh new file mode 100644 index 0000000000000000000000000000000000000000..e5e0d0046b75d2c81298826f0723513fea84d399 --- /dev/null +++ b/AnimatableGaussians/utils/posevocab_custom_ops/warp_reduce.cuh @@ -0,0 +1,103 @@ +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. + +#include +#include +#include + +// helper WarpReduce used in .cu files + +template +__device__ void WarpReduce( + volatile scalar_t* min_dists, + volatile int64_t* min_idxs, + const size_t tid) { + // s = 32 + if (min_dists[tid] > min_dists[tid + 32]) { + min_idxs[tid] = min_idxs[tid + 32]; + min_dists[tid] = min_dists[tid + 32]; + } + // s = 16 + if (min_dists[tid] > min_dists[tid + 16]) { + min_idxs[tid] = min_idxs[tid + 16]; + min_dists[tid] = min_dists[tid + 16]; + } + // s = 8 + if (min_dists[tid] > min_dists[tid + 8]) { + min_idxs[tid] = min_idxs[tid + 8]; + min_dists[tid] = min_dists[tid + 8]; + } + // s = 4 + if (min_dists[tid] > min_dists[tid + 4]) { + min_idxs[tid] = min_idxs[tid + 4]; + min_dists[tid] = min_dists[tid + 4]; + } + // s = 2 + if (min_dists[tid] > min_dists[tid + 2]) { + min_idxs[tid] = min_idxs[tid + 2]; + min_dists[tid] = min_dists[tid + 2]; + } + // s = 1 + if (min_dists[tid] > min_dists[tid + 1]) { + min_idxs[tid] = min_idxs[tid + 1]; + min_dists[tid] = min_dists[tid + 1]; + } +} + + +template +__device__ void WarpReduce2( + volatile scalar_t* min_dists, + volatile int64_t* min_idxs, + volatile scalar_t* mw0, + volatile scalar_t* mw1, + volatile scalar_t* mw2, + const size_t tid) { + // s = 32 + if (min_dists[tid] > min_dists[tid + 32]) { + min_idxs[tid] = min_idxs[tid + 32]; + min_dists[tid] = min_dists[tid + 32]; + mw0[tid] = mw0[tid + 32]; + mw1[tid] = mw1[tid + 32]; + mw2[tid] = mw2[tid + 32]; + } + // s = 16 + if (min_dists[tid] > min_dists[tid + 16]) { + min_idxs[tid] = min_idxs[tid + 16]; + min_dists[tid] = min_dists[tid + 16]; + mw0[tid] = mw0[tid + 16]; + mw1[tid] = mw1[tid + 16]; + mw2[tid] = mw2[tid + 16]; + } + // s = 8 + if (min_dists[tid] > min_dists[tid + 8]) { + min_idxs[tid] = min_idxs[tid + 8]; + min_dists[tid] = min_dists[tid + 8]; + mw0[tid] = mw0[tid + 8]; + mw1[tid] = mw1[tid + 8]; + mw2[tid] = mw2[tid + 8]; + } + // s = 4 + if (min_dists[tid] > min_dists[tid + 4]) { + min_idxs[tid] = min_idxs[tid + 4]; + min_dists[tid] = min_dists[tid + 4]; + mw0[tid] = mw0[tid + 4]; + mw1[tid] = mw1[tid + 4]; + mw2[tid] = mw2[tid + 4]; + } + // s = 2 + if (min_dists[tid] > min_dists[tid + 2]) { + min_idxs[tid] = min_idxs[tid + 2]; + min_dists[tid] = min_dists[tid + 2]; + mw0[tid] = mw0[tid + 2]; + mw1[tid] = mw1[tid + 2]; + mw2[tid] = mw2[tid + 2]; + } + // s = 1 + if (min_dists[tid] > min_dists[tid + 1]) { + min_idxs[tid] = min_idxs[tid + 1]; + min_dists[tid] = min_dists[tid + 1]; + mw0[tid] = mw0[tid + 1]; + mw1[tid] = mw1[tid + 1]; + mw2[tid] = mw2[tid + 1]; + } +} diff --git a/AnimatableGaussians/utils/recon_util.py b/AnimatableGaussians/utils/recon_util.py new file mode 100644 index 0000000000000000000000000000000000000000..944f8e574c42115604375da9ce796ea382e68d6d --- /dev/null +++ b/AnimatableGaussians/utils/recon_util.py @@ -0,0 +1,75 @@ +import numpy as np +import skimage.measure as measure +import torch +import torch.nn.functional as F + +import config + + +def extract_normal_volume(sdf_volume, voxel_size): + sobel_x = torch.zeros((3, 3, 3), dtype = torch.float32, device = config.device) + sobel_x[0] = torch.tensor([[-1,-2,-1], [-2,-4,-2], [-1,-2,-1]], dtype = torch.float32) + sobel_x[2] = -sobel_x[0] + sobel_z = sobel_x.permute((1, 2, 0)) + sobel_y = sobel_x.permute((2, 0, 1)) + + # normalize + sobel_x = sobel_x / (16 * 2 * voxel_size[0]) + sobel_y = sobel_y / (16 * 2 * voxel_size[1]) + sobel_z = sobel_z / (16 * 2 * voxel_size[2]) + + sobel_filter = torch.cat((sobel_x.unsqueeze(0), sobel_y.unsqueeze(0), sobel_z.unsqueeze(0)), dim = 0) + sobel_filter = sobel_filter.unsqueeze(1) + + normal_volume = F.conv3d(input = sdf_volume.view(1, 1, sdf_volume.shape[0], sdf_volume.shape[1], sdf_volume.shape[2]), + weight = sobel_filter, + padding = 1) + normal_volume = normal_volume.squeeze() + normal_volume = normal_volume.permute((1, 2, 3, 0)) + return normal_volume + + +def extract_normal_from_volume(sdf_volume, voxel_size, pts): + ''' + :param sdf_volume: + :param voxel_size: [vx, vy, vz] + :param pts: (N, 3) + :return: + ''' + normal_volume = extract_normal_volume(sdf_volume, voxel_size) + pts = pts[:, [2, 1, 0]] + pts = pts.unsqueeze(0).unsqueeze(2).unsqueeze(3) + normals = F.grid_sample(normal_volume.permute((3, 0, 1, 2)).unsqueeze(0), + pts, padding_mode = 'border', align_corners = True) + normals = normals.squeeze() + normals = normals.permute((1, 0)) + normals_norm = torch.norm(normals, dim = 1, keepdim = True) + normals /= normals_norm + return normals + + +def recon_mesh(occ_volume, volume_res, bounds, volume_mask = None, iso_value = 0.5): + """ + :param occ_volume: torch.Tensor + :param volume_res: list or tuple + :param bounds: numpy.ndarray (2, 3) + :param iso_value: 0.5 for occupancy, 0 for sdf + :return: + """ + occ_volume = occ_volume.reshape(volume_res) + if isinstance(volume_mask, torch.Tensor): + volume_mask = volume_mask.cpu().numpy() + volume_mask = volume_mask.reshape(volume_res) + if isinstance(bounds, torch.Tensor): + bounds = bounds.cpu().numpy() + + volume_len = bounds[1] - bounds[0] + voxel_size = volume_len / np.array(volume_res, dtype = np.float32) + + vertices, faces, _, _ = measure.marching_cubes(occ_volume.cpu().numpy(), iso_value, spacing = voxel_size, mask = volume_mask) + vertices = vertices + bounds[0] + 0.5 * voxel_size + vertices_grid = 2 * (vertices - bounds[0]) / volume_len - 1.0 + normals = extract_normal_from_volume(occ_volume, voxel_size, torch.from_numpy(vertices_grid).to(occ_volume)) + normals = -normals.cpu().numpy() + faces = faces[:, [2, 1, 0]] + return vertices, faces, normals diff --git a/AnimatableGaussians/utils/renderer/__init__.py b/AnimatableGaussians/utils/renderer/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..22fe2dd292750b6e5539813580005719ee9e7c98 --- /dev/null +++ b/AnimatableGaussians/utils/renderer/__init__.py @@ -0,0 +1,17 @@ +from screeninfo import get_monitors + + +def get_monitor_count(): + try: + count = len(get_monitors()) + except: + count = 0 + return count + + +if get_monitor_count() > 0: + print('# Using GL-based Renderer') + from .renderer_gl import Renderer +else: + print('# Using Pytorch3d Renderer') + from .renderer_pytorch3d import Renderer diff --git a/AnimatableGaussians/utils/renderer/__pycache__/__init__.cpython-310.pyc b/AnimatableGaussians/utils/renderer/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..afdfecc233690738844e92634740613826b2a2ad Binary files /dev/null and b/AnimatableGaussians/utils/renderer/__pycache__/__init__.cpython-310.pyc differ diff --git a/AnimatableGaussians/utils/renderer/__pycache__/__init__.cpython-38.pyc b/AnimatableGaussians/utils/renderer/__pycache__/__init__.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..45a1b95ba2346d40bb491bd99ff4ed3a207ad69f Binary files /dev/null and b/AnimatableGaussians/utils/renderer/__pycache__/__init__.cpython-38.pyc differ diff --git a/AnimatableGaussians/utils/renderer/__pycache__/renderer_pytorch3d.cpython-310.pyc b/AnimatableGaussians/utils/renderer/__pycache__/renderer_pytorch3d.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..30cb1d84b5c9ce9358cefac2b728b43b3d3d8337 Binary files /dev/null and b/AnimatableGaussians/utils/renderer/__pycache__/renderer_pytorch3d.cpython-310.pyc differ diff --git a/AnimatableGaussians/utils/renderer/__pycache__/renderer_pytorch3d.cpython-38.pyc b/AnimatableGaussians/utils/renderer/__pycache__/renderer_pytorch3d.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4b7827304f1f80df3d94c866a7e0ebb60b51ea6a Binary files /dev/null and b/AnimatableGaussians/utils/renderer/__pycache__/renderer_pytorch3d.cpython-38.pyc differ diff --git a/AnimatableGaussians/utils/renderer/renderer_gl.py b/AnimatableGaussians/utils/renderer/renderer_gl.py new file mode 100644 index 0000000000000000000000000000000000000000..663bc915fe3670da6061d444f8f76202e5a835b9 --- /dev/null +++ b/AnimatableGaussians/utils/renderer/renderer_gl.py @@ -0,0 +1,550 @@ +import ctypes +import glfw +from OpenGL.GL import * +from OpenGL.GL import shaders +import numpy as np +import cv2 as cv +import trimesh + +null = ctypes.c_void_p(0) + +''' render vertex attributes, e.g., colors or normals ''' +vs_vertex_attribute = ''' + #version 330 core + uniform mat4 mvp; + layout (location = 0) in vec3 vertices; + layout (location = 1) in vec3 attributes; + out vec4 vertex_attributes; + void main(){ + gl_Position = mvp * vec4(vertices, 1.f); + vertex_attributes = vec4(attributes, 1.f); + } + ''' + +fs_vertex_attribute = ''' + #version 330 core + in vec4 vertex_attributes; + out vec4 frag_color; + void main(){ + frag_color = vertex_attributes; + } + ''' + +''' render vertex positions ''' +vs_position = ''' + #version 330 core + uniform mat4 mvp; + layout (location = 0) in vec3 vertices; + out vec4 positions; + void main(){ + gl_Position = mvp * vec4(vertices, 1.f); + positions = vec4(vertices, 1.f); + } + ''' + +fs_position = ''' + #version 330 core + in vec4 positions; + out vec4 frag_color; + void main(){ + frag_color = positions; + } + ''' + +''' Render phong geometry ''' +vs_phong_geometry = ''' + #version 330 core + uniform mat4 mvp; + uniform mat4 mv; + layout (location = 0) in vec3 vertices; + layout (location = 1) in vec3 normals; + out VS_OUT + { + vec3 v; + vec3 fn; + vec3 bn; + } vs_out; + void main(){ + gl_Position = mvp * vec4(vertices, 1.f); + + vec4 v_cam = mv * vec4(vertices, 1.f); + vs_out.v = v_cam.xyz; + + mat3 R = mat3(mv); + vec3 front_normal = normalize(R * normals.xyz); + vec3 back_normal = -front_normal; + vs_out.fn = front_normal; + vs_out.bn = back_normal; + } + ''' + +fs_phong_geometry = ''' + #version 330 core + struct LightAttrib + { + vec3 la; + vec3 ld; + vec3 ls; + vec3 ldir; + }; + + struct MaterialAttrib + { + vec3 ma; + vec3 md; + vec3 ms; + float ss; + }; + + in VS_OUT + { + vec3 v; + vec3 fn; + vec3 bn; + } fs_in; + + out vec4 frag_color; + void main(){ + /* init lighting, front material and back material */ + LightAttrib light = LightAttrib( + vec3(0.3, 0.3, 0.3), + vec3(0.7, 0.7, 0.7), + vec3(1.0, 1.0, 1.0), + vec3(0.0, 0.0, 1.0) + ); + + // gray + MaterialAttrib fmat = MaterialAttrib( + vec3(0.85f, 0.85f, 0.85f), + vec3(0.85f, 0.85f, 0.85f), + vec3(0.1, 0.1, 0.1), + 10.0 + ); + + MaterialAttrib bmat = MaterialAttrib( + vec3(0.85, 0.85, 0.85), + vec3(0.85, 0.85, 0.85), + vec3(0.6, 0.6, 0.6), + 100.0 + ); + + /*Calculate light, view, front-facing and back-facing normals*/ + vec3 ldir = normalize(light.ldir); + vec3 fn = normalize(fs_in.fn); + vec3 bn = normalize(fs_in.bn); + vec3 vdir = normalize(-fs_in.v); + vec3 frdir = reflect(-ldir, fn); + vec3 brdir = reflect(-ldir, bn); + + /*discard this fragment if normal is NAN*/ + if (any(isnan(fn)) || any(isnan(bn))) discard; + + /*render double faces*/ + if (gl_FrontFacing) { + /*calculate radiance*/ + vec3 ka = light.la * fmat.ma; + vec3 kd = light.ld * fmat.md; + vec3 ks = light.ls * fmat.ms; + + /*calculate Phong lighting of front-facing fragment*/ + vec3 fca = ka; + vec3 fcd = kd * max(dot(fn, ldir), 0.0); + vec3 fcs = ks * pow(max(dot(vdir, frdir), 0.0), fmat.ss); + + vec3 fc = clamp(fca + fcd + fcs, 0.0, 1.0); + frag_color = vec4(fc, 1.0); + } + else { + /*calculate radiance*/ + vec3 ka = light.la * bmat.ma; + vec3 kd = light.ld * bmat.md; + vec3 ks = light.ls * bmat.ms; + + /*calculate Phong lighting of back-facing fragment*/ + vec3 bca = ka; + vec3 bcd = kd * max(dot(bn, ldir), 0.0); + vec3 bcs = ks * pow(max(dot(vdir, brdir), 0.0), bmat.ss); + + vec3 bc = clamp(bca + bcd + bcs, 0.0, 1.0); + frag_color = vec4(bc, 1.0); + } + } + ''' + +''' Render phong color ''' +vs_phong_color = ''' + #version 330 core + uniform mat4 mvp; + uniform mat4 mv; + layout (location = 0) in vec3 vertices; + layout (location = 1) in vec3 normals; + layout (location = 2) in vec3 colors; + out VS_OUT + { + vec3 v; + vec3 fn; + vec3 bn; + vec3 c; + } vs_out; + void main(){ + gl_Position = mvp * vec4(vertices, 1.f); + + vec4 v_cam = mv * vec4(vertices, 1.f); + vs_out.v = v_cam.xyz; + + mat3 R = mat3(mv); + vec3 front_normal = normalize(R * normals.xyz); + vec3 back_normal = -front_normal; + vs_out.fn = front_normal; + vs_out.bn = back_normal; + vs_out.c = colors; + } + ''' + +fs_phong_color = ''' + #version 330 core + struct LightAttrib + { + vec3 la; + vec3 ld; + vec3 ls; + vec3 ldir; + }; + + struct MaterialAttrib + { + vec3 ma; + vec3 md; + vec3 ms; + float ss; + }; + + in VS_OUT + { + vec3 v; + vec3 fn; + vec3 bn; + vec3 c; + } fs_in; + + out vec4 frag_color; + void main(){ + /* init lighting, front material and back material */ + LightAttrib light = LightAttrib( + vec3(0.3, 0.3, 0.3), + vec3(0.7, 0.7, 0.7), + vec3(1.0, 1.0, 1.0), + vec3(0.0, 0.0, 1.0) + ); + + // gray + MaterialAttrib fmat = MaterialAttrib( + vec3(0.85f, 0.85f, 0.85f), + vec3(0.85f, 0.85f, 0.85f), + vec3(0.1, 0.1, 0.1), + 10.0 + ); + + MaterialAttrib bmat = MaterialAttrib( + vec3(0.85, 0.85, 0.85), + vec3(0.85, 0.85, 0.85), + vec3(0.6, 0.6, 0.6), + 100.0 + ); + + /*Calculate light, view, front-facing and back-facing normals*/ + vec3 ldir = normalize(light.ldir); + vec3 fn = normalize(fs_in.fn); + vec3 bn = normalize(fs_in.bn); + vec3 vdir = normalize(-fs_in.v); + vec3 frdir = reflect(-ldir, fn); + vec3 brdir = reflect(-ldir, bn); + + /*discard this fragment if normal is NAN*/ + if (any(isnan(fn)) || any(isnan(bn))) discard; + + /*render double faces*/ + if (gl_FrontFacing) { + /*calculate radiance*/ + vec3 ka = light.la * fmat.ma; + vec3 kd = light.ld * fmat.md; + vec3 ks = light.ls * fmat.ms; + + /*calculate Phong lighting of front-facing fragment*/ + vec3 fca = ka; + vec3 fcd = kd * max(dot(fn, ldir), 0.0); + vec3 fcs = ks * pow(max(dot(vdir, frdir), 0.0), fmat.ss); + + vec3 fc = clamp(fca + fcd + fcs, 0.0, 1.0); + frag_color = vec4(fc, 1.0) * vec4(fs_in.c, 1.0); + } + else { + /*calculate radiance*/ + vec3 ka = light.la * bmat.ma; + vec3 kd = light.ld * bmat.md; + vec3 ks = light.ls * bmat.ms; + + /*calculate Phong lighting of back-facing fragment*/ + vec3 bca = ka; + vec3 bcd = kd * max(dot(bn, ldir), 0.0); + vec3 bcs = ks * pow(max(dot(vdir, brdir), 0.0), bmat.ss); + + vec3 bc = clamp(bca + bcd + bcs, 0.0, 1.0); + frag_color = vec4(bc, 1.0) * vec4(fs_in.c, 1.0); + } + } + ''' + +''' Render color from texture map''' +vs_texture_color = ''' + #version 330 core + uniform mat4 mvp; + in vec3 vertices; + in vec2 texture_coords; + out vec2 texCoords; + void main() { + texCoords = texture_coords; + gl_Position = mvp * vec4(vertices.xyz, 1.0); + } +''' + +fs_texture_color = ''' + #version 330 + uniform sampler2D tex0; + in vec2 texCoords; + out vec4 frag_color; + void main() { + frag_color = texture(tex0, texCoords); + } +''' + +''' render vertex attributes to a UV map ''' +vs_vertex_attribute_to_uv = ''' + #version 330 core + uniform mat4 mvp; + layout (location = 0) in vec2 vt; + layout (location = 1) in vec3 attributes; + out vec4 vertex_attributes; + void main(){ + gl_Position = vec4(vt.x, vt.y, 0.f, 1.f); + vertex_attributes = vec4(attributes, 1.f); + } + ''' + +fs_vertex_attribute_to_uv = ''' + #version 330 core + in vec4 vertex_attributes; + out vec4 frag_color; + void main(){ + frag_color = vertex_attributes; + } + ''' + + +# Note that the model is in the usual camera space by default (not opengl) +def gl_perspective_projection_matrix(fx, fy, cx, cy, img_w, img_h, far = 100.0, near = 0.1, gl_space = False): + proj_mat = np.zeros((4, 4), dtype = np.float32) + proj_mat[0, 0] = 2 * fx / img_w + proj_mat[0, 2] = (2 * cx - img_w) / img_w + proj_mat[1, 1] = -2 * fy / img_h + proj_mat[1, 2] = (img_h - 2 * cy) / img_h + proj_mat[2, 2] = (far + near) / (far - near) + proj_mat[2, 3] = 2 * near * far / (near - far) + proj_mat[3, 2] = 1. + if gl_space: + real2gl = np.identity(4, dtype = np.float32) + real2gl[1, 1] = -1 + real2gl[2, 2] = -1 + proj_mat = np.dot(proj_mat, real2gl) + return proj_mat + + +# Note that the model is in the usual camera space by default (not opengl) +def gl_orthographic_projection_matrix(far = -100.0, near = -0.1, gl_space = False): + proj_mat = np.zeros((4, 4), dtype = np.float32) + proj_mat[0, 0] = 1. + proj_mat[1, 1] = 1. + proj_mat[2, 2] = 2 / (far - near) + proj_mat[2, 3] = -(far + near) / (far - near) + proj_mat[3, 3] = 1. + if not gl_space: + gl2real = np.identity(4, dtype = np.float32) + gl2real[1, 1] = -1 + gl2real[2, 2] = -1 + proj_mat = np.dot(proj_mat, gl2real) + return proj_mat + + +class Renderer: + def __init__(self, img_w: int, img_h: int, mvp: np.ndarray = np.identity(4, dtype = np.float32), shader_name = 'vertex_attribute', bg_color = (0, 0, 0), win_name = ''): + glfw.init() + self.img_w = img_w + self.img_h = img_h + self.bg_color = bg_color + self.window = glfw.create_window(img_w, img_h, win_name, None, None) + glfw.set_window_pos(self.window, 500, 500) + glfw.hide_window(self.window) + glfw.make_context_current(self.window) + + # init shader + self.shader_name = shader_name + if shader_name == 'vertex_attribute': + vertex_shader = shaders.compileShader(vs_vertex_attribute, GL_VERTEX_SHADER) + fragment_shader = shaders.compileShader(fs_vertex_attribute, GL_FRAGMENT_SHADER) + elif shader_name == 'position': + vertex_shader = shaders.compileShader(vs_position, GL_VERTEX_SHADER) + fragment_shader = shaders.compileShader(fs_position, GL_FRAGMENT_SHADER) + elif shader_name == 'phong_geometry': + vertex_shader = shaders.compileShader(vs_phong_geometry, GL_VERTEX_SHADER) + fragment_shader = shaders.compileShader(fs_phong_geometry, GL_FRAGMENT_SHADER) + elif shader_name == 'phong_color': + vertex_shader = shaders.compileShader(vs_phong_color, GL_VERTEX_SHADER) + fragment_shader = shaders.compileShader(fs_phong_color, GL_FRAGMENT_SHADER) + elif shader_name == 'texture_color': + vertex_shader = shaders.compileShader(vs_texture_color, GL_VERTEX_SHADER) + fragment_shader = shaders.compileShader(fs_texture_color, GL_FRAGMENT_SHADER) + elif shader_name == 'vertex_attribute_to_uv': + vertex_shader = shaders.compileShader(vs_vertex_attribute_to_uv, GL_VERTEX_SHADER) + fragment_shader = shaders.compileShader(fs_vertex_attribute_to_uv, GL_FRAGMENT_SHADER) + else: + raise ValueError('Invalid shader name!') + self.shader = shaders.compileProgram(vertex_shader, fragment_shader) + glUseProgram(self.shader) + + # init model, view, projection matrix + self.uniform_locations = {'mvp': glGetUniformLocation(self.shader, 'mvp')} + glUniformMatrix4fv(self.uniform_locations['mvp'], 1, GL_TRUE, mvp) + + # vertex and corresponding attribute location + # self.attribute_locations = {'vertices': glGetAttribLocation(self.shader, 'vertices'), + # 'attributes': glGetAttribLocation(self.shader, 'attributes')} + self.vao = glGenVertexArrays(1) + self.vertices_vbo = glGenBuffers(1) + self.attributes_vbo = glGenBuffers(1) + self.attributes_vbo_2 = glGenBuffers(1) + + ''' frame buffer object ''' + # frame buffer + self.fbo = glGenFramebuffers(1) + glBindFramebuffer(GL_FRAMEBUFFER, self.fbo) + # texture + texture = glGenTextures(1) + glBindTexture(GL_TEXTURE_2D, texture) + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA32F, img_w, img_h, 0, GL_RGBA, GL_FLOAT, None) + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR) + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR) + glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture, 0) + + # render buffer + rbo = glGenRenderbuffers(1) + glBindRenderbuffer(GL_RENDERBUFFER, rbo) + glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH24_STENCIL8, img_w, img_h) + glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, GL_RENDERBUFFER, rbo) + + if glCheckFramebufferStatus(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE: + print('frame buffer is not complete!') + glBindFramebuffer(GL_FRAMEBUFFER, 0) # switch to default frame buffer + + # texture map (if used) + if shader_name == 'texture_color': + self.texture_map_id = glGenTextures(1) + else: + self.texture_map_id = None + + def set_mvp_mat(self, mvp: np.ndarray): + glfw.make_context_current(self.window) + glUseProgram(self.shader) + glUniformMatrix4fv(self.uniform_locations['mvp'], 1, GL_TRUE, mvp) + + def set_mv_mat(self, mv: np.ndarray): + glfw.make_context_current(self.window) + glUseProgram(self.shader) + mv_location = glGetUniformLocation(self.shader, 'mv') + glUniformMatrix4fv(mv_location, 1, GL_TRUE, mv) + + def set_camera(self, extr, intr = None): + if intr is None: # assume orthographic projection + proj_mat = gl_orthographic_projection_matrix() + else: + proj_mat = gl_perspective_projection_matrix( + intr[0, 0], intr[1, 1], + intr[0, 2], intr[1, 2], + self.img_w, self.img_h + ) + mvp = proj_mat @ extr + self.set_mvp_mat(mvp) + if self.shader_name.startswith('phong'): + real2gl = np.identity(4, np.float32) + real2gl[1, 1] = -1 + real2gl[2, 2] = -1 + self.set_mv_mat(real2gl @ extr) + + def set_model(self, vertices, vertex_attributes = None, vertex_attributes_2 = None): + """ + the order of vertex attributes: + 1. normal + 2. color + """ + vertices = vertices.astype(np.float32) + glfw.make_context_current(self.window) + glBindVertexArray(self.vao) + # vertices + glBindBuffer(GL_ARRAY_BUFFER, self.vertices_vbo) + glBufferData(GL_ARRAY_BUFFER, vertices.size * ctypes.sizeof(GLfloat), vertices, GL_STREAM_DRAW) + glEnableVertexAttribArray(0) + glVertexAttribPointer(0, vertices.shape[1], GL_FLOAT, False, 0, null) + + if vertex_attributes is not None: + vertex_attributes = vertex_attributes.astype(np.float32) + # attributes + glBindBuffer(GL_ARRAY_BUFFER, self.attributes_vbo) + glBufferData(GL_ARRAY_BUFFER, vertex_attributes.size * ctypes.sizeof(GLfloat), vertex_attributes, GL_STREAM_DRAW) + glEnableVertexAttribArray(1) + glVertexAttribPointer(1, vertex_attributes.shape[1], GL_FLOAT, False, 0, null) + + if vertex_attributes_2 is not None: + vertex_attributes_2 = vertex_attributes_2.astype(np.float32) + # attributes + glBindBuffer(GL_ARRAY_BUFFER, self.attributes_vbo_2) + glBufferData(GL_ARRAY_BUFFER, vertex_attributes_2.size * ctypes.sizeof(GLfloat), vertex_attributes_2, GL_STREAM_DRAW) + glEnableVertexAttribArray(2) + glVertexAttribPointer(2, vertex_attributes_2.shape[1], GL_FLOAT, False, 0, null) + + glBindVertexArray(0) + + self.vnum = vertices.shape[0] + + def set_texture(self, tex_map): + height, width = tex_map.shape[:2] + glBindTexture(GL_TEXTURE_2D, self.texture_map_id) + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, width, height, 0, GL_RGB, GL_UNSIGNED_BYTE, tex_map) + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR) + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR) + glGenerateMipmap(GL_TEXTURE_2D) + + def render(self, cull_face = True): + glfw.make_context_current(self.window) + glfw.poll_events() + + # defined frame buffer object + glBindFramebuffer(GL_FRAMEBUFFER, self.fbo) + glClearColor(self.bg_color[0], self.bg_color[1], self.bg_color[2], 0) + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) + glEnable(GL_DEPTH_TEST) + if cull_face: + glEnable(GL_CULL_FACE) + else: + glDisable(GL_CULL_FACE) + + if self.texture_map_id is not None: + glBindTexture(GL_TEXTURE_2D, self.texture_map_id) + + glBindVertexArray(self.vao) + glDrawArrays(GL_TRIANGLES, 0, self.vnum) + data = glReadPixels(0, 0, self.img_w, self.img_h, GL_RGBA, GL_FLOAT) + data = np.frombuffer(data, np.float32) + data.shape = self.img_h, self.img_w, 4 + data = data[::-1, :] + glBindVertexArray(0) + return data + diff --git a/AnimatableGaussians/utils/renderer/renderer_pytorch3d.py b/AnimatableGaussians/utils/renderer/renderer_pytorch3d.py new file mode 100644 index 0000000000000000000000000000000000000000..a2753fa37e06a87367bb0159da6eb2a69ca5e469 --- /dev/null +++ b/AnimatableGaussians/utils/renderer/renderer_pytorch3d.py @@ -0,0 +1,185 @@ +from pytorch3d.renderer import ( + look_at_view_transform, + PerspectiveCameras, + OrthographicCameras, + PointLights, + DirectionalLights, + Materials, + RasterizationSettings, + MeshRenderer, + MeshRasterizer, + TexturesUV, + TexturesVertex +) +from pytorch3d.renderer.mesh.shader import ShaderBase, HardDepthShader, HardPhongShader +from pytorch3d.renderer.mesh.rasterizer import Fragments +from pytorch3d.renderer.blending import ( + BlendParams, + hard_rgb_blend, + sigmoid_alpha_blend, + softmax_rgb_blend, +) +from pytorch3d.renderer.mesh.textures import TexturesVertex +from pytorch3d.structures import Meshes +import torch +import numpy as np +import cv2 as cv + + +class VertexAtrriShader(ShaderBase): + def forward(self, fragments: Fragments, meshes: Meshes, **kwargs) -> torch.Tensor: + texels = meshes.sample_textures(fragments) + blend_params = kwargs.get("blend_params", self.blend_params) + + images = hard_rgb_blend(texels, fragments, blend_params) + return images + + +class Renderer: + def __init__(self, img_w: int, img_h: int, mvp = None, shader_name = 'vertex_attribute', bg_color = (0, 0, 0), win_name = None, device = 'cuda'): + self.img_w = img_w + self.img_h = img_h + self.device = device + raster_settings = RasterizationSettings( + image_size = (img_h, img_w), + blur_radius = 0.0, + faces_per_pixel = 1, + bin_size = None, + max_faces_per_bin = 50000 + ) + + self.shader_name = shader_name + blend_params = BlendParams(background_color = bg_color) + if shader_name == 'vertex_attribute': + shader = VertexAtrriShader(device = device, blend_params = blend_params) + elif shader_name == 'position': + shader = VertexAtrriShader(device = device, blend_params = blend_params) + elif shader_name == 'phong_geometry': + shader = HardPhongShader(device = device, blend_params = blend_params) + else: + raise ValueError('Invalid shader_name') + self.renderer = MeshRenderer( + rasterizer = MeshRasterizer( + cameras = None, + raster_settings = raster_settings + ), + shader = shader + ) + + self.mesh = None + + def set_camera(self, extr, intr = None): + affine_mat = np.identity(4, np.float32) + affine_mat[0, 0] = -1 + affine_mat[1, 1] = -1 + extr = affine_mat @ extr + extr[:3, :3] = np.linalg.inv(extr[:3, :3]) + extr = torch.from_numpy(extr).to(torch.float32).to(self.device) + if intr is None: # assume orthographic projection + cameras = OrthographicCameras( + focal_length = ((self.img_w / 2., self.img_h / 2.),), + principal_point = ((self.img_w / 2., self.img_h / 2.),), + R = extr[:3, :3].unsqueeze(0), + T = extr[:3, 3].unsqueeze(0), + in_ndc = False, + device = self.device, + image_size = ((self.img_h, self.img_w),) + ) + else: + intr = torch.from_numpy(intr).to(torch.float32).to(self.device) + cameras = PerspectiveCameras(((intr[0, 0], intr[1, 1]),), + ((intr[0, 2], intr[1, 2]),), + extr[:3, :3].unsqueeze(0), + extr[:3, 3].unsqueeze(0), + in_ndc = False, + device = self.device, + image_size = ((self.img_h, self.img_w),)) + self.renderer.rasterizer.cameras = cameras + + def set_model(self, vertices, vertex_attributes = None): + if isinstance(vertices, np.ndarray): + vertices = torch.from_numpy(vertices) + if vertex_attributes is not None: + if isinstance(vertex_attributes, np.ndarray): + vertex_attributes = torch.from_numpy(vertex_attributes) + vertex_attributes = vertex_attributes.to(torch.float32).to(self.device) + vertices = vertices.to(torch.float32).to(self.device) + faces = torch.arange(0, vertices.shape[0], dtype = torch.int64).to(self.device).reshape(-1, 3) + + if self.shader_name == 'vertex_attribute': + textures = TexturesVertex([vertex_attributes]) + elif self.shader_name == 'position': + textures = TexturesVertex([vertices]) + else: + textures = TexturesVertex([torch.ones_like(vertices)]) + + self.mesh = Meshes([vertices], [faces], textures = textures) + + def render(self): + img = self.renderer(self.mesh, cameras = self.renderer.rasterizer.cameras) + return img[0].cpu().numpy() + + +if __name__ == '__main__': + import trimesh + import json + import time + + """ test perspective projection """ + # cam_data = json.load(open('F:/Pose/thuman4/calibration_00.json', 'r')) + # cam_names = list(cam_data.keys()) + # view_num = len(cam_names) + # extr_mats = [] + # for view_idx in range(view_num): + # extr_mat = np.identity(4, np.float32) + # extr_mat[:3, :3] = np.array(cam_data[cam_names[view_idx]]['R'], np.float32).reshape(3, 3) + # extr_mat[:3, 3] = np.array(cam_data[cam_names[view_idx]]['T'], np.float32) + # extr_mats.append(extr_mat) + # intr_mats = [np.array(cam_data[cam_names[view_idx]]['K'], np.float32).reshape(3, 3) for view_idx in range(view_num)] + # img_heights = [cam_data[cam_names[view_idx]]['imgSize'][1] for view_idx in range(view_num)] + # img_widths = [cam_data[cam_names[view_idx]]['imgSize'][0] for view_idx in range(view_num)] + # + # mesh = trimesh.load('E:\\ProjectCode\\AvatarHD\\test_results\\zzr_avatarrex\\posevocab_wHand_diffVolume_wRootfind\\thuman00_cam18_epoch120\\live_geometry/2141.ply', process = False) + # + # renderer = Renderer(img_widths[0], img_heights[0], shader_name = 'vertex_attribute') + # # renderer = Renderer(img_widths[0], img_heights[0], shader_name = 'phong_geometry') + # vertices = mesh.vertices[mesh.faces.reshape(-1)] + # normals = mesh.vertex_normals[mesh.faces.reshape(-1)] + # renderer.set_model(vertices, normals) + # + # for view_idx in range(view_num): + # time_0 = time.time() + # proj_mat = gl_perspective_projection_matrix( + # intr_mats[view_idx][0, 0], + # intr_mats[view_idx][1, 1], + # intr_mats[view_idx][0, 2], + # intr_mats[view_idx][1, 2], + # renderer.img_w, + # renderer.img_h + # ) + # mvp = proj_mat @ extr_mats[view_idx] + # + # renderer.set_camera(extr_mats[view_idx], intr_mats[view_idx]) + # + # img = renderer.render() + # print('Render cost %f secs' % (time.time() - time_0)) + # + # cv.imshow('img', img) + # cv.waitKey(0) + + """ test orthographic projection """ + mesh = trimesh.load('../debug/cano_smpl.obj', process = False) + renderer = Renderer(1024, 1024, shader_name = 'vertex_attribute') + + cano_center = 0.5 * (mesh.vertices.max(0) + mesh.vertices.min(0)) + front_mv = np.identity(4, np.float32) + front_mv[:3, 3] = -cano_center + np.array([0, 0, -10], np.float32) + front_mv[1:3] *= -1 # gl2real + + vertices = mesh.vertices[mesh.faces.reshape(-1)].astype(np.float32) + normals = mesh.vertex_normals[mesh.faces.reshape(-1)].astype(np.float32) + renderer.set_camera(front_mv) + renderer.set_model(vertices, normals) + img = renderer.render() + cv.imshow('img', img) + cv.waitKey(0) diff --git a/AnimatableGaussians/utils/root_finding/bind.cpp b/AnimatableGaussians/utils/root_finding/bind.cpp new file mode 100644 index 0000000000000000000000000000000000000000..28fcec7507a574296cd030c913e31d4d7707667f --- /dev/null +++ b/AnimatableGaussians/utils/root_finding/bind.cpp @@ -0,0 +1,20 @@ +#include +#include + + +void root_finding(at::Tensor _weight_volume, // (X, Y, Z, J) + at::Tensor _grad_volume, // (X, Y, Z, J*3) + at::Tensor _xt, // (B, N, 3) + at::Tensor _xc_init, // (B, N, 3) + at::Tensor _jnt_mats, // (B, J, 4, 4) + at::Tensor _bounds, // (2, 3) + at::Tensor _res, // (3) + at::Tensor _xc_opt, + float _lambda, + int _iter_num); + + +PYBIND11_MODULE(TORCH_EXTENSION_NAME, m) { + m.def("root_finding", &root_finding); +} + diff --git a/AnimatableGaussians/utils/root_finding/build/lib.linux-x86_64-cpython-38/root_finding.cpython-38-x86_64-linux-gnu.so b/AnimatableGaussians/utils/root_finding/build/lib.linux-x86_64-cpython-38/root_finding.cpython-38-x86_64-linux-gnu.so new file mode 100644 index 0000000000000000000000000000000000000000..eec316ea476c6b4f41b4927100b0fd62583bb059 --- /dev/null +++ b/AnimatableGaussians/utils/root_finding/build/lib.linux-x86_64-cpython-38/root_finding.cpython-38-x86_64-linux-gnu.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2ca28e8d6384b47f83b97c9c4f8e80ac73aa7cb751d719569184b46ce746cb59 +size 11641448 diff --git a/AnimatableGaussians/utils/root_finding/build/temp.linux-x86_64-cpython-38/.ninja_deps b/AnimatableGaussians/utils/root_finding/build/temp.linux-x86_64-cpython-38/.ninja_deps new file mode 100644 index 0000000000000000000000000000000000000000..70bd59a2eee1e461102b53279ec7681f89f2dc27 Binary files /dev/null and b/AnimatableGaussians/utils/root_finding/build/temp.linux-x86_64-cpython-38/.ninja_deps differ diff --git a/AnimatableGaussians/utils/root_finding/build/temp.linux-x86_64-cpython-38/.ninja_log b/AnimatableGaussians/utils/root_finding/build/temp.linux-x86_64-cpython-38/.ninja_log new file mode 100644 index 0000000000000000000000000000000000000000..8b0aa73cf17e0f0d7fa70f0629ca94fd9fb3595b --- /dev/null +++ b/AnimatableGaussians/utils/root_finding/build/temp.linux-x86_64-cpython-38/.ninja_log @@ -0,0 +1,3 @@ +# ninja log v5 +0 21186 1726452870756794726 /home/pengc02/pengcheng/projects/gaussian_avatar/ag_gha/AnimatableGaussians/utils/root_finding/build/temp.linux-x86_64-cpython-38/bind.o ef4259ca4ad7e9bd +1 37016 1726452886600478346 /home/pengc02/pengcheng/projects/gaussian_avatar/ag_gha/AnimatableGaussians/utils/root_finding/build/temp.linux-x86_64-cpython-38/root_finding.o 77d7ba9b38a8cff7 diff --git a/AnimatableGaussians/utils/root_finding/build/temp.linux-x86_64-cpython-38/bind.o b/AnimatableGaussians/utils/root_finding/build/temp.linux-x86_64-cpython-38/bind.o new file mode 100644 index 0000000000000000000000000000000000000000..19859d4536dcd6ebf86d3bff69810c06ed323cf9 --- /dev/null +++ b/AnimatableGaussians/utils/root_finding/build/temp.linux-x86_64-cpython-38/bind.o @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c46ca4b762a7ecea17dcc95757badc792ab094337b6b9757c93267699a6d848d +size 18198632 diff --git a/AnimatableGaussians/utils/root_finding/build/temp.linux-x86_64-cpython-38/build.ninja b/AnimatableGaussians/utils/root_finding/build/temp.linux-x86_64-cpython-38/build.ninja new file mode 100644 index 0000000000000000000000000000000000000000..ff18665a8dda2b5c0d325e0957a19909855aa5ec --- /dev/null +++ b/AnimatableGaussians/utils/root_finding/build/temp.linux-x86_64-cpython-38/build.ninja @@ -0,0 +1,34 @@ +ninja_required_version = 1.3 +cxx = c++ +nvcc = /usr/local/cuda-11.3/bin/nvcc + +cflags = -pthread -B /home/pengc02/anaconda3/envs/ag1/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DWITH_CUDA -I/home/pengc02/anaconda3/envs/ag1/lib/python3.8/site-packages/torch/include -I/home/pengc02/anaconda3/envs/ag1/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/home/pengc02/anaconda3/envs/ag1/lib/python3.8/site-packages/torch/include/TH -I/home/pengc02/anaconda3/envs/ag1/lib/python3.8/site-packages/torch/include/THC -I/usr/local/cuda-11.3/include -I/home/pengc02/anaconda3/envs/ag1/include/python3.8 -c +post_cflags = -O2 -I./ -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=root_finding -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++17 +cuda_cflags = -DWITH_CUDA -I/home/pengc02/anaconda3/envs/ag1/lib/python3.8/site-packages/torch/include -I/home/pengc02/anaconda3/envs/ag1/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/home/pengc02/anaconda3/envs/ag1/lib/python3.8/site-packages/torch/include/TH -I/home/pengc02/anaconda3/envs/ag1/lib/python3.8/site-packages/torch/include/THC -I/usr/local/cuda-11.3/include -I/home/pengc02/anaconda3/envs/ag1/include/python3.8 -c +cuda_post_cflags = -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_BFLOAT16_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr --compiler-options ''"'"'-fPIC'"'"'' -O2 -I./ -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=root_finding -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_86,code=compute_86 -gencode=arch=compute_86,code=sm_86 -std=c++17 +cuda_dlink_post_cflags = +ldflags = + +rule compile + command = $cxx -MMD -MF $out.d $cflags -c $in -o $out $post_cflags + depfile = $out.d + deps = gcc + +rule cuda_compile + depfile = $out.d + deps = gcc + command = $nvcc $cuda_cflags -c $in -o $out $cuda_post_cflags + + + + + +build /home/pengc02/pengcheng/projects/gaussian_avatar/ag_gha/AnimatableGaussians/utils/root_finding/build/temp.linux-x86_64-cpython-38/bind.o: compile /home/pengc02/pengcheng/projects/gaussian_avatar/ag_gha/AnimatableGaussians/utils/root_finding/bind.cpp +build /home/pengc02/pengcheng/projects/gaussian_avatar/ag_gha/AnimatableGaussians/utils/root_finding/build/temp.linux-x86_64-cpython-38/root_finding.o: cuda_compile /home/pengc02/pengcheng/projects/gaussian_avatar/ag_gha/AnimatableGaussians/utils/root_finding/root_finding.cu + + + + + + + diff --git a/AnimatableGaussians/utils/root_finding/build/temp.linux-x86_64-cpython-38/root_finding.o b/AnimatableGaussians/utils/root_finding/build/temp.linux-x86_64-cpython-38/root_finding.o new file mode 100644 index 0000000000000000000000000000000000000000..993dbbefa07509ee96eb3a6937aa218c9096c773 Binary files /dev/null and b/AnimatableGaussians/utils/root_finding/build/temp.linux-x86_64-cpython-38/root_finding.o differ diff --git a/AnimatableGaussians/utils/root_finding/dist/root_finding-0.0.0-py3.8-linux-x86_64.egg b/AnimatableGaussians/utils/root_finding/dist/root_finding-0.0.0-py3.8-linux-x86_64.egg new file mode 100644 index 0000000000000000000000000000000000000000..bc94985bc207a665f61c3e488007a1c7bcd78640 --- /dev/null +++ b/AnimatableGaussians/utils/root_finding/dist/root_finding-0.0.0-py3.8-linux-x86_64.egg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:59665b84e24bc2a095f3c61cda6012d585d22d40fb946a47f503aca1ce25f68a +size 3245669 diff --git a/AnimatableGaussians/utils/root_finding/root_finding.cu b/AnimatableGaussians/utils/root_finding/root_finding.cu new file mode 100644 index 0000000000000000000000000000000000000000..62ac4835d296f2a45e0268e76b15132761be47bf --- /dev/null +++ b/AnimatableGaussians/utils/root_finding/root_finding.cu @@ -0,0 +1,219 @@ +#include +#include +#include +#include +#include + +#include "vector_operations.hpp" +#include "utils.h" + + +__device__ void grid_sample_3d( + const float* _volume, // (X, Y, Z, C), + const float3 _v, + const float3 _min_v, + const float3 _max_v, + const int3 _res, + const int _channel_num, + float* _val +){ + float3 normalized_v; // [0, 1] + normalized_v.x = (_v.x - _min_v.x) / (_max_v.x - _min_v.x); + normalized_v.y = (_v.y - _min_v.y) / (_max_v.y - _min_v.y); + normalized_v.z = (_v.z - _min_v.z) / (_max_v.z - _min_v.z); + + normalized_v.x = fmaxf(fminf(normalized_v.x, 1.f), 0.f); + normalized_v.y = fmaxf(fminf(normalized_v.y, 1.f), 0.f); + normalized_v.z = fmaxf(fminf(normalized_v.z, 1.f), 0.f); + + int x = static_cast(::round((_res.x - 1) * normalized_v.x)); + int y = static_cast(::round((_res.y - 1) * normalized_v.y)); + int z = static_cast(::round((_res.z - 1) * normalized_v.z)); + + int start = x * (_res.y * _res.z * _channel_num) + y * (_res.z * _channel_num) + z * _channel_num; + for(int i=0; i<_channel_num; i++){ + _val[i] = _volume[start + i]; + } + + // if (_channel_num == 55) + // printf("%d %d %d %f %f %f %f\n", x, y, z, _val[0], _val[1], _val[2], _val[3]); +} + + +__global__ void root_finding_kernel( + const float* __restrict__ _weight_volume, // (X, Y, Z, J) + const float* __restrict__ _grad_volume, // (X, Y, Z, J*3) + const float* __restrict__ _xt, // (B, N, 3) + const float* __restrict__ _xc_init, // (B, N, 3) + const float* __restrict__ _jnt_mats, // (B, J, 4, 4) + const float* __restrict__ _bounds, // (2, 3) + const int* __restrict__ _res, // (3) + float* __restrict__ _xc_opt, // (B, N, 3) + const int batch_size, + const int point_num, + const int joint_num, + const float lambda, + const int iter_num = 10 +){ + int thread_idx = threadIdx.x + blockIdx.x * blockDim.x; + if (thread_idx >= batch_size * point_num){ + return; + } + + int batch_idx = thread_idx / point_num; + int point_idx = thread_idx % point_num; + + float3 xc = make_float3(_xc_init[3*thread_idx + 0], _xc_init[3*thread_idx + 1], _xc_init[3*thread_idx + 2]); + float3 xt = make_float3(_xt[3*thread_idx+0], _xt[3*thread_idx+1], _xt[3*thread_idx+2]); + + mat34 jnt_mats[55]; + for(int j=0; j>>( + _weight_volume.data(), + _grad_volume.data(), + _xt.data(), + _xc_init.data(), + _jnt_mats.data(), + _bounds.data(), + _res.data(), + _xc_opt.data(), + batch_size, + point_num, + joint_num, + _lambda, + _iter_num + ); + + cudaError_t err = cudaGetLastError(); + if (err != cudaSuccess) + printf("Error in root_finding_kernel: %s\n", cudaGetErrorString(err)); + + cudaDeviceSynchronize(); + +} + + diff --git a/AnimatableGaussians/utils/root_finding/root_finding.egg-info/PKG-INFO b/AnimatableGaussians/utils/root_finding/root_finding.egg-info/PKG-INFO new file mode 100644 index 0000000000000000000000000000000000000000..3aa138c463fd5552a6dcd8e10a094d8bc52125ac --- /dev/null +++ b/AnimatableGaussians/utils/root_finding/root_finding.egg-info/PKG-INFO @@ -0,0 +1,3 @@ +Metadata-Version: 2.1 +Name: root_finding +Version: 0.0.0 diff --git a/AnimatableGaussians/utils/root_finding/root_finding.egg-info/SOURCES.txt b/AnimatableGaussians/utils/root_finding/root_finding.egg-info/SOURCES.txt new file mode 100644 index 0000000000000000000000000000000000000000..82223f45b8253e71905487a4aecc9187a3354f2d --- /dev/null +++ b/AnimatableGaussians/utils/root_finding/root_finding.egg-info/SOURCES.txt @@ -0,0 +1,7 @@ +bind.cpp +root_finding.cu +setup.py +root_finding.egg-info/PKG-INFO +root_finding.egg-info/SOURCES.txt +root_finding.egg-info/dependency_links.txt +root_finding.egg-info/top_level.txt \ No newline at end of file diff --git a/AnimatableGaussians/utils/root_finding/root_finding.egg-info/dependency_links.txt b/AnimatableGaussians/utils/root_finding/root_finding.egg-info/dependency_links.txt new file mode 100644 index 0000000000000000000000000000000000000000..8b137891791fe96927ad78e64b0aad7bded08bdc --- /dev/null +++ b/AnimatableGaussians/utils/root_finding/root_finding.egg-info/dependency_links.txt @@ -0,0 +1 @@ + diff --git a/AnimatableGaussians/utils/root_finding/root_finding.egg-info/top_level.txt b/AnimatableGaussians/utils/root_finding/root_finding.egg-info/top_level.txt new file mode 100644 index 0000000000000000000000000000000000000000..7cb653c626c7b909e0bf815ffc4db2ae963efaee --- /dev/null +++ b/AnimatableGaussians/utils/root_finding/root_finding.egg-info/top_level.txt @@ -0,0 +1 @@ +root_finding diff --git a/AnimatableGaussians/utils/root_finding/setup.py b/AnimatableGaussians/utils/root_finding/setup.py new file mode 100644 index 0000000000000000000000000000000000000000..c7a9cb1735dcea1c7b467bd30c1409cfcfb36018 --- /dev/null +++ b/AnimatableGaussians/utils/root_finding/setup.py @@ -0,0 +1,23 @@ +from setuptools import setup, Extension +from torch.utils.cpp_extension import CUDAExtension, BuildExtension + +sources = ["bind.cpp", + "root_finding.cu"] + +setup( + name='root_finding', + ext_modules=[ + CUDAExtension( + name='root_finding', + sources=sources, + extra_compile_args={ + "cxx": ["-O2", "-I{}".format("./")], + "nvcc": ["-O2", "-I{}".format("./")], + }, + define_macros=[("WITH_CUDA", None)], + ) + ], + cmdclass={ + 'build_ext': BuildExtension + } +) diff --git a/AnimatableGaussians/utils/root_finding/utils.h b/AnimatableGaussians/utils/root_finding/utils.h new file mode 100644 index 0000000000000000000000000000000000000000..95d7028809dbf21b393ad1a9717adfb8c3884121 --- /dev/null +++ b/AnimatableGaussians/utils/root_finding/utils.h @@ -0,0 +1,27 @@ +// Copyright (c) Facebook, Inc. and its affiliates. +// +// This source code is licensed under the MIT license found in the +// LICENSE file in the root directory of this source tree. + +#pragma once +#include +#include + +#define CHECK_IS_INT(x) \ + do { \ + TORCH_CHECK(x.scalar_type() == at::ScalarType::Int, \ + #x " must be an int tensor"); \ + } while (0) + +#define CHECK_IS_FLOAT(x) \ + do { \ + TORCH_CHECK(x.scalar_type() == at::ScalarType::Float, \ + #x " must be a float tensor"); \ + } while (0) + +#define CHECK_CUDA(x) TORCH_CHECK(x.is_cuda(), #x " must be a CUDA tensor.") +#define CHECK_CONTIGUOUS(x) \ + TORCH_CHECK(x.is_contiguous(), #x " must be contiguous.") +#define CHECK_CONTIGUOUS_CUDA(x) \ + CHECK_CUDA(x); \ + CHECK_CONTIGUOUS(x) \ No newline at end of file diff --git a/AnimatableGaussians/utils/root_finding/vector_operations.hpp b/AnimatableGaussians/utils/root_finding/vector_operations.hpp new file mode 100644 index 0000000000000000000000000000000000000000..8e368fae93284d7aa70c004301b830321dcd0fea --- /dev/null +++ b/AnimatableGaussians/utils/root_finding/vector_operations.hpp @@ -0,0 +1,508 @@ +#ifndef _VECTOR_OPERATION_HPP_ +#define _VECTOR_OPERATION_HPP_ + +#include +#include + +// overloading +__host__ __device__ __forceinline__ float3 +make_float3(const float4 &_v) +{ + return make_float3(_v.x, _v.y, _v.z); +} + +__host__ __device__ __forceinline__ float4 +make_float4(const float3 &_v, const float &_w) +{ + return make_float4(_v.x, _v.y, _v.z, _w); +} + +__host__ __device__ __forceinline__ float +dot(const float3& v1, const float3& v2) +{ + return v1.x * v2.x + v1.y*v2.y + v1.z*v2.z; +} + +__host__ __device__ __forceinline__ float3& +operator+=(float3& vec, const float& v) +{ + vec.x += v; vec.y += v; vec.z += v; return vec; +} + +__host__ __device__ __forceinline__ float3 +operator+(const float3& v1, const float3& v2) +{ + return make_float3(v1.x + v2.x, v1.y + v2.y, v1.z + v2.z); +} + +__host__ __device__ __forceinline__ float3& +operator*=(float3& vec, const float& v) +{ + vec.x *= v; vec.y *= v; vec.z *= v; return vec; +} + +__host__ __device__ __forceinline__ float4 +operator+(const float4& v1, const float4& v2) +{ + return make_float4(v1.x + v2.x, v1.y + v2.y, v1.z + v2.z, v1.w + v2.w); +} + +__host__ __device__ __forceinline__ float3 +operator-(const float3& v1, const float3& v2) +{ + return make_float3(v1.x - v2.x, v1.y - v2.y, v1.z - v2.z); +} + +__host__ __device__ __forceinline__ float4 +operator-(const float4& v1, const float4& v2) +{ + return make_float4(v1.x-v2.x, v1.y-v2.y, v1.z-v2.z, v1.w-v2.w); +} + +__host__ __device__ __forceinline__ float3 +operator*(const float& v, const float3& v1) +{ + return make_float3(v * v1.x, v * v1.y, v * v1.z); +} + +__host__ __device__ __forceinline__ float3 +operator*(const float3& v1, const float& v) +{ + return make_float3(v1.x * v, v1.y * v, v1.z * v); +} + +__host__ __device__ __forceinline__ float +fabs_sum(const float3 &v) +{ + return fabsf(v.x) + fabsf(v.y) + fabsf(v.z); +} + +__host__ __device__ __forceinline__ float +squared_norm(const float3 &v) +{ + return dot(v, v); +} + +__host__ __device__ __forceinline__ float +squared_norm(const float2 &v) +{ + return v.x*v.x + v.y*v.y; +} + +__host__ __device__ __forceinline__ float +norm(const float3& v) +{ + return sqrt(dot(v, v)); +} + +__host__ __device__ __forceinline__ float3 +normalized(const float3 &v) +{ + return v * (1.0f/sqrtf(dot(v, v))); +} + +__host__ __device__ __forceinline__ float3 +cross(const float3& v1, const float3& v2) +{ + return make_float3(v1.y * v2.z - v1.z * v2.y, v1.z * v2.x - v1.x * v2.z, v1.x * v2.y - v1.y * v2.x); +} + +__host__ __device__ __forceinline__ float +dot(const float4 &v1, const float4 &v2) +{ + return v1.w*v2.w+v1.x*v2.x+v1.y*v2.y+v1.z*v2.z; +} + +__host__ __device__ __forceinline__ float +squared_norm(const float4 &v) +{ + return dot(v, v); +} + +__host__ __device__ __forceinline__ float +norm(const float4 &v4) +{ + return sqrtf(squared_norm(v4)); +} + +__host__ __device__ __forceinline__ float4 operator*(const float4 &v, float s) +{ + return make_float4(v.x*s, v.y*s, v.z*s, v.w*s); +} + +__host__ __device__ __forceinline__ float4 operator*(float s, const float4 &v) +{ + return make_float4(s*v.x, s*v.y, s*v.z, s*v.w); +} + +__host__ __device__ __forceinline__ float4 +normalized(const float4 &v) +{ + return v * (1.0f/sqrtf(dot(v, v))); +} +#endif + +__host__ __device__ __forceinline__ float3 +operator-(const float3 &v) +{ + return make_float3(-v.x, -v.y, -v.z); +} + +__host__ __device__ __forceinline__ float4 +operator-(const float4 &v) +{ + return make_float4(-v.x, -v.y, -v.z, -v.w); +} + +struct mat33 { + __host__ __device__ mat33() {} + __host__ __device__ mat33(const float3 &_a0, const float3 &_a1, const float3 &_a2) { cols[0] = _a0; cols[1] = _a1; cols[2] = _a2; } + __host__ __device__ mat33(const float *_data) + { + /*_data MUST have at least 9 float elements, ctor does not check range*/ + cols[0] = make_float3(_data[0], _data[1], _data[2]); + cols[1] = make_float3(_data[3], _data[4], _data[5]); + cols[2] = make_float3(_data[6], _data[7], _data[8]); + } + + __host__ __device__ const float& m00() const { return cols[0].x; } + __host__ __device__ const float& m10() const { return cols[0].y; } + __host__ __device__ const float& m20() const { return cols[0].z; } + __host__ __device__ const float& m01() const { return cols[1].x; } + __host__ __device__ const float& m11() const { return cols[1].y; } + __host__ __device__ const float& m21() const { return cols[1].z; } + __host__ __device__ const float& m02() const { return cols[2].x; } + __host__ __device__ const float& m12() const { return cols[2].y; } + __host__ __device__ const float& m22() const { return cols[2].z; } + + __host__ __device__ float& m00() { return cols[0].x; } + __host__ __device__ float& m10() { return cols[0].y; } + __host__ __device__ float& m20() { return cols[0].z; } + __host__ __device__ float& m01() { return cols[1].x; } + __host__ __device__ float& m11() { return cols[1].y; } + __host__ __device__ float& m21() { return cols[1].z; } + __host__ __device__ float& m02() { return cols[2].x; } + __host__ __device__ float& m12() { return cols[2].y; } + __host__ __device__ float& m22() { return cols[2].z; } + + __host__ __device__ mat33 transpose() const + { + float3 row0 = make_float3(cols[0].x, cols[1].x, cols[2].x); + float3 row1 = make_float3(cols[0].y, cols[1].y, cols[2].y); + float3 row2 = make_float3(cols[0].z, cols[1].z, cols[2].z); + return mat33(row0, row1, row2); + } + + __host__ __device__ mat33 operator* (const mat33 &_mat) const + { + mat33 mat; + mat.m00() = m00()*_mat.m00() + m01()*_mat.m10() + m02()*_mat.m20(); + mat.m01() = m00()*_mat.m01() + m01()*_mat.m11() + m02()*_mat.m21(); + mat.m02() = m00()*_mat.m02() + m01()*_mat.m12() + m02()*_mat.m22(); + mat.m10() = m10()*_mat.m00() + m11()*_mat.m10() + m12()*_mat.m20(); + mat.m11() = m10()*_mat.m01() + m11()*_mat.m11() + m12()*_mat.m21(); + mat.m12() = m10()*_mat.m02() + m11()*_mat.m12() + m12()*_mat.m22(); + mat.m20() = m20()*_mat.m00() + m21()*_mat.m10() + m22()*_mat.m20(); + mat.m21() = m20()*_mat.m01() + m21()*_mat.m11() + m22()*_mat.m21(); + mat.m22() = m20()*_mat.m02() + m21()*_mat.m12() + m22()*_mat.m22(); + return mat; + } + + __host__ __device__ mat33 operator+ (const mat33 &_mat) const + { + mat33 mat_sum; + mat_sum.m00() = m00() + _mat.m00(); + mat_sum.m01() = m01() + _mat.m01(); + mat_sum.m02() = m02() + _mat.m02(); + + mat_sum.m10() = m10() + _mat.m10(); + mat_sum.m11() = m11() + _mat.m11(); + mat_sum.m12() = m12() + _mat.m12(); + + mat_sum.m20() = m20() + _mat.m20(); + mat_sum.m21() = m21() + _mat.m21(); + mat_sum.m22() = m22() + _mat.m22(); + + return mat_sum; + } + + __host__ __device__ mat33 operator- (const mat33 &_mat) const + { + mat33 mat_diff; + mat_diff.m00() = m00() - _mat.m00(); + mat_diff.m01() = m01() - _mat.m01(); + mat_diff.m02() = m02() - _mat.m02(); + + mat_diff.m10() = m10() - _mat.m10(); + mat_diff.m11() = m11() - _mat.m11(); + mat_diff.m12() = m12() - _mat.m12(); + + mat_diff.m20() = m20() - _mat.m20(); + mat_diff.m21() = m21() - _mat.m21(); + mat_diff.m22() = m22() - _mat.m22(); + + return mat_diff; + } + + __host__ __device__ mat33 operator-() const + { + mat33 mat_neg; + mat_neg.m00() = -m00(); + mat_neg.m01() = -m01(); + mat_neg.m02() = -m02(); + + mat_neg.m10() = -m10(); + mat_neg.m11() = -m11(); + mat_neg.m12() = -m12(); + + mat_neg.m20() = -m20(); + mat_neg.m21() = -m21(); + mat_neg.m22() = -m22(); + + return mat_neg; + } + + __host__ __device__ mat33& operator*= (const mat33 &_mat) + { + *this = *this * _mat; + return *this; + } + + __host__ __device__ float3 operator* (const float3 &_vec) const + { + float x = m00()*_vec.x + m01()*_vec.y + m02()*_vec.z; + float y = m10()*_vec.x + m11()*_vec.y + m12()*_vec.z; + float z = m20()*_vec.x + m21()*_vec.y + m22()*_vec.z; + return make_float3(x, y, z); + } + + __host__ __device__ mat33 operator* (const float &_f) const + { + return mat33(cols[0] * _f, cols[1] * _f, cols[2] * _f); + } + + __host__ __device__ mat33 inverse() const + { + /* + Reference: + d = (m00_*m11_*m22_ - m00_*m12_*m21_ - m01_*m10_*m22_ + m01_*m12_*m20_ + m02_*m10_*m21_ - m02_*m11_*m20_) + ans = + + [ (m11_*m22_ - m12_*m21_)/d, -(m01_*m22_ - m02_*m21_)/d, (m01_*m12_ - m02_*m11_)/d] + [ -(m10_*m22_ - m12_*m20_)/d, (m00_*m22_ - m02_*m20_)/d, -(m00_*m12_ - m02_*m10_)/d] + [ (m10_*m21_ - m11_*m20_)/d, -(m00_*m21_ - m01_*m20_)/d, (m00_*m11_ - m01_*m10_)/d] + + */ + + float d = m00()*m11()*m22() - m00()*m12()*m21() - m01()*m10()*m22() + m01()*m12()*m20() + m02()*m10()*m21() - m02()*m11()*m20(); + mat33 r; + r.m00() = (m11()*m22() - m12()*m21()); + r.m01() = -(m01()*m22() - m02()*m21()); + r.m02() = (m01()*m12() - m02()*m11()); + r.m10() = -(m10()*m22() - m12()*m20()); + r.m11() = (m00()*m22() - m02()*m20()); + r.m12() = -(m00()*m12() - m02()*m10()); + r.m20() = (m10()*m21() - m11()*m20()); + r.m21() = -(m00()*m21() - m01()*m20()); + r.m22() = (m00()*m11() - m01()*m10()); + + return r * (1.f / d); + } + + __host__ __device__ void set_identity() + { + cols[0] = make_float3(1, 0, 0); + cols[1] = make_float3(0, 1, 0); + cols[2] = make_float3(0, 0, 1); + } + + __host__ __device__ static mat33 identity() + { + mat33 idmat; + idmat.set_identity(); + return idmat; + } + + __host__ __device__ static mat33 zero() + { + mat33 idmat; + idmat.cols[0] = make_float3(0, 0, 0); + idmat.cols[1] = make_float3(0, 0, 0); + idmat.cols[2] = make_float3(0, 0, 0); + return idmat; + } + + __host__ __device__ void print() const + { + printf("%f %f %f \n", m00(), m01(), m02()); + printf("%f %f %f \n", m10(), m11(), m12()); + printf("%f %f %f \n", m20(), m21(), m22()); + } + + float3 cols[3]; /*colume major*/ +}; + +/*rotation and translation*/ +struct mat34 { + __host__ __device__ mat34() {} + __host__ __device__ mat34(const mat33 &_rot, const float3 &_trans) : rot(_rot), trans(_trans) {} + + __host__ __device__ static mat34 identity() + { + return mat34(mat33::identity(), make_float3(0, 0, 0)); + } + + __host__ __device__ static mat34 zeros() + { + return mat34(mat33::zero(), make_float3(0, 0, 0)); + } + + __host__ __device__ mat34 operator* (const mat34 &_right_se3) const + { + mat34 se3; + se3.rot = rot*_right_se3.rot; + se3.trans = rot*_right_se3.trans + trans; + return se3; + } + + __host__ __device__ mat34 operator* (const float &_w) const + { + mat34 se3; + se3.rot = rot; + se3.trans = trans; + + //se3.rot.m00() *= _w*se3.rot.m00(); se3.rot.m01() *= _w*se3.rot.m01(); se3.rot.m02() *= _w*se3.rot.m02(); + //se3.rot.m10() *= _w*se3.rot.m10(); se3.rot.m11() *= _w*se3.rot.m11(); se3.rot.m12() *= _w*se3.rot.m12(); + //se3.rot.m20() *= _w*se3.rot.m20(); se3.rot.m21() *= _w*se3.rot.m21(); se3.rot.m22() *= _w*se3.rot.m22(); + + //se3.trans.x *= _w*se3.trans.x; se3.trans.y *= _w*se3.trans.y; se3.trans.z *= _w*se3.trans.z; + + + se3.rot.m00() *= _w; se3.rot.m01() *= _w; se3.rot.m02() *= _w; + se3.rot.m10() *= _w; se3.rot.m11() *= _w; se3.rot.m12() *= _w; + se3.rot.m20() *= _w; se3.rot.m21() *= _w; se3.rot.m22() *= _w; + + se3.trans.x *= _w; se3.trans.y *= _w; se3.trans.z *= _w; + return se3; + } + + __host__ __device__ mat34 operator+ (const mat34 &_T) const + { + mat34 se3; + se3.rot = rot; + se3.trans = trans; + + se3.rot.m00() += _T.rot.m00(); se3.rot.m01() += _T.rot.m01(); se3.rot.m02() += _T.rot.m02(); + se3.rot.m10() += _T.rot.m10(); se3.rot.m11() += _T.rot.m11(); se3.rot.m12() += _T.rot.m12(); + se3.rot.m20() += _T.rot.m20(); se3.rot.m21() += _T.rot.m21(); se3.rot.m22() += _T.rot.m22(); + + se3.trans.x += _T.trans.x; se3.trans.y += _T.trans.y; se3.trans.z += _T.trans.z; + + return se3; + } + + + __host__ __device__ mat34& operator*= (const mat34 &_right_se3) + { + *this = *this * _right_se3; + return *this; + } + + __host__ __device__ float3 operator* (const float3 &_vec) const + { + return rot * _vec + trans; + } + + __host__ __device__ float4 operator* (const float4 &_vec) const + { + float3 v = rot * make_float3(_vec) + _vec.w * trans; + return make_float4(v, _vec.w); + } + + __host__ __device__ mat34 inverse() const + { + mat34 r; + mat33 rot_inv = rot.inverse(); + r.rot = rot_inv; + r.trans = -rot_inv * trans; + return r; + } + + __host__ __device__ void print() const + { + printf("%f %f %f %f \n", rot.m00(), rot.m01(), rot.m02(), trans.x); + printf("%f %f %f %f \n", rot.m10(), rot.m11(), rot.m12(), trans.y); + printf("%f %f %f %f \n", rot.m20(), rot.m21(), rot.m22(), trans.z); + } + + bool checkOrthogonalityMat34() + { + // orthogonality check + mat33 R = rot; + mat33 RTR = R.transpose() * R; + + bool ortho = true; + + if (fabsf(RTR.m00() - 1.0f) > 1e-6f) ortho = false; + if (fabsf(RTR.m01() - 0.0f) > 1e-6f) ortho = false; + if (fabsf(RTR.m02() - 0.0f) > 1e-6f) ortho = false; + + if (fabsf(RTR.m10() - 0.0f) > 1e-6f) ortho = false; + if (fabsf(RTR.m11() - 1.0f) > 1e-6f) ortho = false; + if (fabsf(RTR.m12() - 0.0f) > 1e-6f) ortho = false; + + if (fabsf(RTR.m20() - 0.0f) > 1e-6f) ortho = false; + if (fabsf(RTR.m21() - 0.0f) > 1e-6f) ortho = false; + if (fabsf(RTR.m22() - 1.0f) > 1e-6f) ortho = false; + + float det = + RTR.m00() * RTR.m11() * RTR.m22() + + RTR.m01() * RTR.m12() * RTR.m20() + + RTR.m02() * RTR.m10() * RTR.m21() - + RTR.m02() * RTR.m11() * RTR.m20() - + RTR.m01() * RTR.m10() * RTR.m22() - + RTR.m00() * RTR.m12() * RTR.m21(); + + if (fabsf(det - 1.0f) > 1e-6f) ortho = false; + + return ortho; + } + + mat33 rot; + float3 trans; +}; + +/*outer production of two float3*/ +__host__ __device__ __forceinline__ mat33 +outer_prod(const float3 &v0, const float3 &v1) +{ + return mat33(v0*v1.x, v0*v1.y, v0*v1.z); +} + +// symmetric inverse of mat33 +__host__ __device__ __forceinline__ +mat33 sym_inv(const mat33 &_A) +{ + float det = _A.m00()*_A.m11()*_A.m22() + + 2*_A.m01()*_A.m02()*_A.m12() - + (_A.m00()*_A.m12()*_A.m12() + + _A.m11()*_A.m02()*_A.m02() + + _A.m22()*_A.m01()*_A.m01()); + + mat33 A_inv; + + if (fabs(det) < 1e-10f) { + A_inv.set_identity(); + } + else { + float det_inv = 1/det; + A_inv.m00() = det_inv*(_A.m11()*_A.m22() - _A.m12()*_A.m12()); + A_inv.m11() = det_inv*(_A.m00()*_A.m22() - _A.m02()*_A.m02()); + A_inv.m22() = det_inv*(_A.m00()*_A.m11() - _A.m01()*_A.m01()); + A_inv.m01() = A_inv.m10() = det_inv*(_A.m02()*_A.m12() - _A.m01()*_A.m22()); + A_inv.m02() = A_inv.m20() = det_inv*(_A.m01()*_A.m12() - _A.m02()*_A.m11()); + A_inv.m12() = A_inv.m21() = det_inv*(_A.m02()*_A.m01() - _A.m00()*_A.m12()); + } + + return A_inv; +} \ No newline at end of file diff --git a/AnimatableGaussians/utils/sh_utils.py b/AnimatableGaussians/utils/sh_utils.py new file mode 100644 index 0000000000000000000000000000000000000000..a54612b24cde4e1ab6da3fb37142cc5d0248ada8 --- /dev/null +++ b/AnimatableGaussians/utils/sh_utils.py @@ -0,0 +1,118 @@ +# Copyright 2021 The PlenOctree Authors. +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. + +import torch + +C0 = 0.28209479177387814 +C1 = 0.4886025119029199 +C2 = [ + 1.0925484305920792, + -1.0925484305920792, + 0.31539156525252005, + -1.0925484305920792, + 0.5462742152960396 +] +C3 = [ + -0.5900435899266435, + 2.890611442640554, + -0.4570457994644658, + 0.3731763325901154, + -0.4570457994644658, + 1.445305721320277, + -0.5900435899266435 +] +C4 = [ + 2.5033429417967046, + -1.7701307697799304, + 0.9461746957575601, + -0.6690465435572892, + 0.10578554691520431, + -0.6690465435572892, + 0.47308734787878004, + -1.7701307697799304, + 0.6258357354491761, +] + + +def eval_sh(deg, sh, dirs): + """ + Evaluate spherical harmonics at unit directions + using hardcoded SH polynomials. + Works with torch/np/jnp. + ... Can be 0 or more batch dimensions. + Args: + deg: int SH deg. Currently, 0-3 supported + sh: jnp.ndarray SH coeffs [..., C, (deg + 1) ** 2] + dirs: jnp.ndarray unit directions [..., 3] + Returns: + [..., C] + """ + assert deg <= 4 and deg >= 0 + coeff = (deg + 1) ** 2 + assert sh.shape[-1] >= coeff + + result = C0 * sh[..., 0] + if deg > 0: + x, y, z = dirs[..., 0:1], dirs[..., 1:2], dirs[..., 2:3] + result = (result - + C1 * y * sh[..., 1] + + C1 * z * sh[..., 2] - + C1 * x * sh[..., 3]) + + if deg > 1: + xx, yy, zz = x * x, y * y, z * z + xy, yz, xz = x * y, y * z, x * z + result = (result + + C2[0] * xy * sh[..., 4] + + C2[1] * yz * sh[..., 5] + + C2[2] * (2.0 * zz - xx - yy) * sh[..., 6] + + C2[3] * xz * sh[..., 7] + + C2[4] * (xx - yy) * sh[..., 8]) + + if deg > 2: + result = (result + + C3[0] * y * (3 * xx - yy) * sh[..., 9] + + C3[1] * xy * z * sh[..., 10] + + C3[2] * y * (4 * zz - xx - yy)* sh[..., 11] + + C3[3] * z * (2 * zz - 3 * xx - 3 * yy) * sh[..., 12] + + C3[4] * x * (4 * zz - xx - yy) * sh[..., 13] + + C3[5] * z * (xx - yy) * sh[..., 14] + + C3[6] * x * (xx - 3 * yy) * sh[..., 15]) + + if deg > 3: + result = (result + C4[0] * xy * (xx - yy) * sh[..., 16] + + C4[1] * yz * (3 * xx - yy) * sh[..., 17] + + C4[2] * xy * (7 * zz - 1) * sh[..., 18] + + C4[3] * yz * (7 * zz - 3) * sh[..., 19] + + C4[4] * (zz * (35 * zz - 30) + 3) * sh[..., 20] + + C4[5] * xz * (7 * zz - 3) * sh[..., 21] + + C4[6] * (xx - yy) * (7 * zz - 1) * sh[..., 22] + + C4[7] * xz * (xx - 3 * yy) * sh[..., 23] + + C4[8] * (xx * (xx - 3 * yy) - yy * (3 * xx - yy)) * sh[..., 24]) + return result + +def RGB2SH(rgb): + return (rgb - 0.5) / C0 + +def SH2RGB(sh): + return sh * C0 + 0.5 \ No newline at end of file diff --git a/AnimatableGaussians/utils/smpl_util.py b/AnimatableGaussians/utils/smpl_util.py new file mode 100644 index 0000000000000000000000000000000000000000..8c67d5c229a27ac1118769a8c9582818db13688c --- /dev/null +++ b/AnimatableGaussians/utils/smpl_util.py @@ -0,0 +1,84 @@ +import torch +import pytorch3d.ops + +import smplx +from utils.posevocab_custom_ops.nearest_face import nearest_face_pytorch3d, nearest_face +from utils.knn import knn_gather +import config + + +def calc_blending_weight(query_pts, smpl_v, smpl_f, smpl_lbs = None, near_thres = 0.08, method = 'NN'): + """ + :param query_pts: (B, N, 3) + :param smpl_v: (B, M, 3) + :param smpl_f: (B, F, 3) + :param near_thres: + :param method: 'NN' or 'barycentric' + :return: + """ + assert (query_pts.shape[0] == smpl_v.shape[0] == smpl_f.shape[0]) + batch_size = query_pts.shape[0] + + if smpl_lbs is None: + smpl_lbs = smpl_skinning_weights[None].expand(batch_size, -1, -1) + + if method == 'NN': + # NN + dists_to_smpl, indices, _ = pytorch3d.ops.knn_points(query_pts, smpl_v, K = 1) + near_flag = dists_to_smpl[:, :, 0] < near_thres ** 2 + pts_w = pytorch3d.ops.knn_gather(smpl_lbs, indices) + pts_w = pts_w[:, :, 0] + else: + # # barycentric + # dists_to_smpl, face_indices, closest_pts = [], [], [] + # for batch_idx in range(batch_size): + # dists_to_smpl_, face_indices_, closest_pts_ = nearest_face(smpl_v[batch_idx], smpl_f[batch_idx], query_pts[batch_idx]) + # dists_to_smpl.append(dists_to_smpl_) + # face_indices.append(face_indices_) + # closest_pts.append(closest_pts_) + # dists_to_smpl = torch.stack(dists_to_smpl, 0) + # face_indices = torch.stack(face_indices, 0) # (B, N) + # closest_pts = torch.stack(closest_pts, 0) + # face_vertex_ids = torch.gather(smpl_f.long(), 1, face_indices[:, :, None].long().expand(-1, -1, 3)) # (B, N, 3) + # face_vertices = knn_gather(smpl_v, face_vertex_ids) + # bc_coords = barycentric_coordinate(closest_pts, face_vertices) + + dists_to_smpl, face_indices, bc_coords = nearest_face_pytorch3d(query_pts, smpl_v, smpl_f[0]) + face_vertex_ids = torch.gather(smpl_f.long(), 1, face_indices[:, :, None].long().expand(-1, -1, 3)) # (B, N, 3) + + face_lbs = knn_gather(smpl_lbs, face_vertex_ids) + pts_w = (bc_coords[..., None] * face_lbs).sum(2) + near_flag = dists_to_smpl < near_thres + + return pts_w, near_flag + + +def skinning(points, lbs, jnt_mats, return_pt_mats = False): + """ + forward skinning + :param points: (B, N, 3) + :param lbs: (B, N, 24) + :param jnt_mats: (B, 24, 4, 4) + :return: + """ + # lbs + pt_mats = torch.einsum('bnj,bjxy->bnxy', lbs, jnt_mats) + + live_pts = torch.einsum('bnxy,bny->bnx', pt_mats[..., :3, :3], points) + pt_mats[..., :3, 3] + + if return_pt_mats: + return live_pts, pt_mats + else: + return live_pts + + +def skinning_normal(normals, lbs, jnt_mats): + # lbs + pt_mats = torch.einsum('bnj,bjxy->bnxy', lbs, jnt_mats) + + live_normals = torch.einsum('bnxy,bny->bnx', pt_mats[..., :3, :3], normals) + return live_normals + + +smpl_model = smplx.SMPLX(model_path = config.PROJ_DIR + '/smpl_files/smplx', gender = 'neutral', use_pca = False, num_pca_comps = 45, flat_hand_mean = True, batch_size = 1) +smpl_skinning_weights = smpl_model.lbs_weights.clone().to(torch.float32).to(config.device) diff --git a/AnimatableGaussians/utils/visualize_skeletons.py b/AnimatableGaussians/utils/visualize_skeletons.py new file mode 100644 index 0000000000000000000000000000000000000000..26bb87c67539d4420ac62a33021ff5254646c1b0 --- /dev/null +++ b/AnimatableGaussians/utils/visualize_skeletons.py @@ -0,0 +1,79 @@ +import numpy as np +import torch +import trimesh +import cv2 as cv + +import smplx +import config + + +def load_ball_cylinder(): + ball = trimesh.load(config.PROJ_DIR + '/assets/ball.obj', process = False) + cylinder = trimesh.load(config.PROJ_DIR + '/assets/cylinder.obj', process = False) + return ball, cylinder + +ball, cylinder = load_ball_cylinder() + + +def construct_skeletons(joints, parent_ids): + vertices = [] + faces = [] + vertex_num = 0 + for j in range(joints.shape[0]): + # for j in [18, 20]: + # add ball + ball_v = np.array(ball.vertices).astype(np.float32) + vertices.append(0.04 * ball_v + joints[j]) + faces.append(ball.faces + vertex_num) + vertex_num += ball_v.shape[0] + + if parent_ids[j] >= 0: + # add cylinder + bone_len = np.linalg.norm(joints[j] - joints[parent_ids[j]]) + bone_d = 0.02 + cylinder_v = np.array(cylinder.vertices).astype(np.float32) + cylinder_v[:, 1] = cylinder_v[:, 1] * bone_len / 1.0 + cylinder_v[:, [0, 2]] = cylinder_v[:, [0, 2]] * bone_d + + trans_j = np.identity(4, np.float32) + trans_j[:3, 3] = joints[j] - np.array([0, -0.5 * bone_len, 0]) + d0 = np.array([0, 1, 0], np.float32) + d1 = (joints[parent_ids[j]] - joints[j]) / bone_len + cos_theta = np.dot(d0, d1) + axis = np.cross(d0, d1) + axis_norm = np.linalg.norm(axis) + axis_angle = np.arccos(cos_theta) / axis_norm * axis + rot = np.identity(4, np.float32) + rot[:3, :3] = cv.Rodrigues(axis_angle)[0] + rot[:3, 3] = -rot[:3, :3] @ joints[j] + joints[j] + affine_mat = rot @ trans_j + + cylinder_v = np.einsum('ij,vj->vi', affine_mat[:3, :3], cylinder_v) + affine_mat[:3, 3] + vertices.append(cylinder_v) + faces.append(cylinder.faces + vertex_num) + vertex_num += cylinder_v.shape[0] + + vertices = np.concatenate(vertices, 0) + faces = np.concatenate(faces, 0) + return vertices, faces + + +if __name__ == '__main__': + smpl_params = np.load('G:/MultiviewRGB/subject00/smpl_params.npz') + smpl_params = dict(smpl_params) + smpl_params = {k: torch.from_numpy(v) for k, v in smpl_params.items()} + + smpl_model = smplx.SMPLX(model_path = config.PROJ_DIR + '/smpl_files/smplx', gender = 'neutral', use_pca = False, num_pca_comps = 45, flat_hand_mean = True, batch_size = 1) + + frame_id = 310 + # smpl_ret = smpl_model.forward(betas = smpl_params['betas'], + # body_pose = smpl_params['body_pose'][frame_id].unsqueeze(0)) + smpl_ret = smpl_model.forward(betas = smpl_params['betas'], + body_pose = config.cano_smpl_body_pose.unsqueeze(0)) + + joints = smpl_ret.joints[0, :22].detach().cpu().numpy() + parents = smpl_model.parents[:22] + vertices, faces = construct_skeletons(joints, parents) + + skeleton_mesh = trimesh.Trimesh(vertices, faces, process = False) + skeleton_mesh.export(config.PROJ_DIR + '/debug/skeleton_mesh.obj') diff --git a/AnimatableGaussians/utils/visualize_util.py b/AnimatableGaussians/utils/visualize_util.py new file mode 100644 index 0000000000000000000000000000000000000000..acc793a50a4eb0cd4c1a3547d65722db109121ed --- /dev/null +++ b/AnimatableGaussians/utils/visualize_util.py @@ -0,0 +1,200 @@ +import math +import numpy as np +import torch +import torch.nn.functional as F +import cv2 as cv +import trimesh + + +def pos_map_to_mesh(pos_map: torch.Tensor): + pd = (0, 0, 1 if pos_map.shape[1] % 2 == 1 else 0, 0, 1 if pos_map.shape[0] % 2 == 1 else 0, 0) + pos_map = F.pad(pos_map, pd, 'constant', 0) + mask = torch.linalg.norm(pos_map, dim = -1) > 0.1 + # cv.imshow('mask', mask.cpu().numpy().astype(np.uint8) * 255) + mask = cv.erode(mask.cpu().numpy().astype(np.uint8), (5, 5), iterations = 20) + mask = torch.from_numpy(mask > 0).to(pos_map.device) + # cv.imshow('mask_eroded', mask.cpu().numpy().astype(np.uint8) * 255) + # cv.waitKey(0) + v0 = pos_map[:-1, :-1].reshape(-1, 3) + v1 = pos_map[1:, :-1].reshape(-1, 3) + v2 = pos_map[:-1, 1:].reshape(-1, 3) + v3 = pos_map[1:, 1:].reshape(-1, 3) + m0 = mask[:-1, :-1].reshape(-1) + m1 = mask[1:, :-1].reshape(-1) + m2 = mask[:-1, 1:].reshape(-1) + m3 = mask[1:, 1:].reshape(-1) + vertices = torch.cat([v0, v1, v2, v3], 0) + masks = torch.cat([m0, m1, m2, m3], 0) + pnum = v0.shape[0] + + a = torch.arange(0, pnum).to(torch.int64).to(pos_map.device) + f1 = torch.stack([a, a + pnum, a + pnum * 2], 1) + f2 = torch.stack([a + pnum, a + pnum * 3, a + pnum * 2], 1) + faces = torch.cat([f1, f2], 0) + + # remove invalid faces + face_mask = masks[faces.reshape(-1)].reshape(-1, 3).sum(1) == 3 + face_mask = torch.logical_and(face_mask, torch.linalg.norm(vertices[faces[:, 0]] - vertices[faces[:, 1]], dim = 1) < 0.02) + face_mask = torch.logical_and(face_mask, torch.linalg.norm(vertices[faces[:, 1]] - vertices[faces[:, 2]], dim = 1) < 0.02) + face_mask = torch.logical_and(face_mask, torch.linalg.norm(vertices[faces[:, 0]] - vertices[faces[:, 2]], dim = 1) < 0.02) + valid_faces = faces[face_mask] + + # debug + mesh = trimesh.Trimesh(vertices = vertices.cpu().numpy(), faces = valid_faces.cpu().numpy()) + mesh.export('./debug/mesh.obj') + exit(1) + + +def to_HSV(c: torch.Tensor): + """ + :param c: (N, 1) or (N,) + :return: (N, 3) + """ + h = (1 - c) * 240. / 60. + x = 1 - torch.abs(h.to(torch.int64) % 2 + h - h.to(torch.int64) - 1.) + + rgb = torch.zeros((c.shape[0], 3)).to(c).to(torch.int64) + + cond_1 = torch.logical_and(h >= 0, h < 1) + rgb[cond_1, 0] = 255 + rgb[cond_1, 1] = (x[cond_1] * 255).to(torch.int64) + + cond_2 = torch.logical_and(h >= 1, h < 2) + rgb[cond_2, 0] = (x[cond_2] * 255).to(torch.int64) + rgb[cond_2, 1] = 255 + + cond_3 = torch.logical_and(h >= 2, h < 3) + rgb[cond_3, 1] = 255 + rgb[cond_3, 2] = (x[cond_3] * 255).to(torch.int64) + + cond_4 = h >= 3 + rgb[cond_4, 1] = (x[cond_4] * 255).to(torch.int64) + rgb[cond_4, 2] = 255 + + rgb.clip_(0, 255) + + return rgb.to(torch.uint8) + + +# def calc_back_mv(dist): +# rot_center = np.array([0, 0, dist], np.float32) +# trans_mat = np.identity(4, np.float32) +# trans_mat[:3, :3] = cv.Rodrigues(np.array([0, math.pi, 0]))[0] +# trans_mat[:3, 3] = (np.identity(3) - trans_mat[:3, :3]) @ rot_center +# +# return trans_mat + + +def calc_front_mv(object_center, tar_pos = np.array([0, 0, 2.0])): + """ + calculate an extrinsic matrix for rendering the front of a 3D object + under the assumption of fx,fy=550, cx,cy=256, img_h,img_w=512 + :param object_center: np.ndarray, (3,): the original center of the 3D object + :param tar_pos: np.ndarray, (3,): the target center of the 3D object + :return: extr_mat: np.ndarray, (4, 4) + """ + mat_2origin = np.identity(4, np.float32) + mat_2origin[:3, 3] = -object_center + + mat_rotX = np.identity(4, np.float32) + mat_rotX[:3, :3] = cv.Rodrigues(np.array([math.pi, 0, 0]))[0] + + mat_2tarPos = np.identity(4, np.float32) + mat_2tarPos[:3, 3] = tar_pos + + extr_mat = mat_2tarPos @ mat_rotX @ mat_2origin + return extr_mat + + +def calc_back_mv(object_center, tar_pos = np.array([0, 0, 2.0])): + """ + calculate an extrinsic matrix for rendering the back of a 3D object + under the assumption of fx,fy=550, cx,cy=256, img_h,img_w=512 + :param object_center: np.ndarray, (3,): the original center of the 3D object + :param tar_pos: np.ndarray, (3,): the target center of the 3D object + :return: extr_mat: np.ndarray, (4, 4) + """ + mat_2origin = np.identity(4, np.float32) + mat_2origin[:3, 3] = -object_center + + mat_rotX = np.identity(4, np.float32) + mat_rotX[:3, :3] = cv.Rodrigues(np.array([math.pi, 0, 0]))[0] + + mat_rotY = np.identity(4, np.float32) + mat_rotY[:3, :3] = cv.Rodrigues(np.array([0, math.pi, 0]))[0] + + mat_2tarPos = np.identity(4, np.float32) + mat_2tarPos[:3, 3] = tar_pos + + extr_mat = mat_2tarPos @ mat_rotY @ mat_rotX @ mat_2origin + return extr_mat + + +def calc_free_mv(object_center, tar_pos = np.array([0, 0, 2.0]), rot_Y = 0., rot_X = 0., global_orient = None): + """ + calculate an extrinsic matrix for rendering the back of a 3D object + under the assumption of fx,fy=550, cx,cy=256, img_h,img_w=512 + :param object_center: np.ndarray, (3,): the original center of the 3D object + :param tar_pos: np.ndarray, (3,): the target center of the 3D object + :param rot_Y: float, rotation angle along Y axis + :param global_orient: np.ndarray, global orientation of the 3D object + :return: extr_mat: np.ndarray, (4, 4) + """ + # import ipdb; ipdb.set_trace() + mat_2origin = np.identity(4, np.float32) + mat_2origin[:3, 3] = -object_center + + mat_invGlobalOrient = np.identity(4, np.float32) + if global_orient is not None: + mat_invGlobalOrient[:3, :3] = cv.Rodrigues(np.array([math.pi, 0., 0.]))[0] @ np.linalg.inv(global_orient) + else: + mat_invGlobalOrient[:3, :3] = cv.Rodrigues(np.array([math.pi, 0., 0.]))[0] + + mat_rotY = np.identity(4, np.float32) + mat_rotY[:3, :3] = cv.Rodrigues(np.array([0, rot_Y, 0]))[0] + + mat_rotX = np.identity(4, np.float32) + mat_rotX[:3, :3] = cv.Rodrigues(np.array([rot_X, 0, 0]))[0] + + mat_2tarPos = np.identity(4, np.float32) + mat_2tarPos[:3, 3] = tar_pos + + extr_mat = mat_2tarPos @ mat_rotX @ mat_rotY @ mat_invGlobalOrient @ mat_2origin + return extr_mat + + +def calculate_cano_front_mv(mesh_center): + if isinstance(mesh_center, torch.Tensor): + mesh_center = mesh_center.cpu().numpy() + front_mv = np.identity(4, np.float32) + front_mv[:3, 3] = -mesh_center + np.array([0, 0, -10], np.float32) + front_mv[1:3] *= -1 + return front_mv + + +def calculate_cano_back_mv(mesh_center): + if isinstance(mesh_center, torch.Tensor): + mesh_center = mesh_center.cpu().numpy() + back_mv = np.identity(4, np.float32) + rot_y = cv.Rodrigues(np.array([0, np.pi, 0], np.float32))[0] + back_mv[:3, :3] = rot_y + back_mv[:3, 3] = -rot_y @ mesh_center + np.array([0, 0, -10], np.float32) + back_mv[1:3] *= -1 + return back_mv + + +def paper_visualize_pos_map(pos_map): + mask = np.linalg.norm(pos_map, axis = -1) > 1e-6 + valid_pos = pos_map[mask] + min_xyz = valid_pos.min(0)[None] + max_xyz = valid_pos.max(0)[None] + normalized_pos = (valid_pos - min_xyz) / (max_xyz - min_xyz) + pos_map[mask] = normalized_pos + pos_map[~mask] = np.array([0.5, 0.5, 0.5]) + return pos_map + +def paper_visualize_gaussian_map(gaussian_map): + mask = np.linalg.norm(gaussian_map, axis = -1) > 1e-6 + valid_gaussians = gaussian_map[mask] + u, s, v = np.linalg.svd(valid_gaussians.transpose()) + print(u, s, v) diff --git a/GHA b/GHA deleted file mode 160000 index f2cb812bda5e1088bcec2cd601014d23c817575d..0000000000000000000000000000000000000000 --- a/GHA +++ /dev/null @@ -1 +0,0 @@ -Subproject commit f2cb812bda5e1088bcec2cd601014d23c817575d diff --git a/GHA/.DS_Store b/GHA/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..8626ff52c65d9a55b8f35bb359ea777215add550 Binary files /dev/null and b/GHA/.DS_Store differ diff --git a/GHA/.gitignore b/GHA/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..b226be4cf7469a5e39e133ef88e04ec4ce627952 --- /dev/null +++ b/GHA/.gitignore @@ -0,0 +1,178 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.pyc +*.pyd +*.pyo +*$py.class + +# C extensions +*.so +*.lib + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +# lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +*.py,cover +.hypothesis/ +.pytest_cache/ +cover/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 +db.sqlite3-journal + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +.pybuilder/ +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# pyenv +# For a library or package, you might want to ignore these files since the code is +# intended to run in multiple environments; otherwise, check them in: +# .python-version + +# pipenv +# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. +# However, in case of collaboration, if having platform-specific dependencies or dependencies +# having no cross-platform support, pipenv may install dependencies that don't work, or not +# install all needed dependencies. +#Pipfile.lock + +# poetry +# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. +# This is especially recommended for binary packages to ensure reproducibility, and is more +# commonly ignored for libraries. +# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control +#poetry.lock + +# pdm +# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control. +#pdm.lock +# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it +# in version control. +# https://pdm.fming.dev/#use-with-ide +.pdm.toml + +# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm +__pypackages__/ + +# Celery stuff +celerybeat-schedule +celerybeat.pid + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ + +# pytype static type analyzer +.pytype/ + +# Cython debug symbols +cython_debug/ + +# PyCharm +# JetBrains specific template is maintained in a separate JetBrains.gitignore that can +# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore +# and can be added to the global gitignore or merged into this file. For a more nuclear +# option (not recommended) you can uncomment the following to ignore the entire idea folder. +.idea/ + +# repo +*results/ +*debug/ +*smpl_files/smpl +*smpl_files/smplx +*smpl_files/others +*tmp* + +*.exe +*.bin +*.onnx +log/ +checkpoints/ +assets/ diff --git a/GHA/LICENSE b/GHA/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..bbf68b76164975324bf777c0b0ca1c7e52865704 --- /dev/null +++ b/GHA/LICENSE @@ -0,0 +1,39 @@ +Please read carefully the following terms and conditions and any accompanying documentation before you download and/or use Gaussian Head Avatar Software/Code/Data (the "Software"). By downloading and/or using the Software, you acknowledge that you have read these terms and conditions, understand them, and agree to be bound by them. If you do not agree with these terms and conditions, you must not download and/or use the Software. + +Ownership + +The Software has been developed at the Tsinghua University and is owned by and proprietary material of the Tsinghua University. + +License Grant + +Tsinghua University grants you a non-exclusive, non-transferable, free of charge right: + +To download the Software and use it on computers owned, leased or otherwise controlled by you and/or your organisation; + +To use the Software for the sole purpose of performing non-commercial scientific research, non-commercial education, or non-commercial artistic projects. + +Any other use, in particular any use for commercial purposes, is prohibited. This includes, without limitation, incorporation in a commercial product, use in a commercial service, as training data for a commercial product, for commercial ergonomic analysis (e.g. product design, architectural design, etc.), or production of other artifacts for commercial purposes including, for example, web services, movies, television programs, mobile applications, or video games. The Software may not be used for pornographic purposes or to generate pornographic material whether commercial or not. This license also prohibits the use of the Software to train methods/algorithms/neural networks/etc. for commercial use of any kind. The Software may not be reproduced, modified and/or made available in any form to any third party without Tsinghua University’s prior written permission. By downloading the Software, you agree not to reverse engineer it. + +Disclaimer of Representations and Warranties + +You expressly acknowledge and agree that the Software results from basic research, is provided “AS IS”, may contain errors, and that any use of the Software is at your sole risk. TSINGHUA UNIVERSITY MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE SOFTWARE, NEITHER EXPRESS NOR IMPLIED, AND THE ABSENCE OF ANY LEGAL OR ACTUAL DEFECTS, WHETHER DISCOVERABLE OR NOT. Specifically, and not to limit the foregoing, Tsinghua University makes no representations or warranties (i) regarding the merchantability or fitness for a particular purpose of the Software, (ii) that the use of the Software will not infringe any patents, copyrights or other intellectual property rights of a third party, and (iii) that the use of the Software will not cause any damage of any kind to you or a third party. + +Limitation of Liability + +Under no circumstances shall Tsinghua University be liable for any incidental, special, indirect or consequential damages arising out of or relating to this license, including but not limited to, any lost profits, business interruption, loss of programs or other data, or all other commercial damages or losses, even if advised of the possibility thereof. + +No Maintenance Services + +You understand and agree that Tsinghua University is under no obligation to provide either maintenance services, update services, notices of latent defects, or corrections of defects with regard to the Software. Tsinghua University nevertheless reserves the right to update, modify, or discontinue the Software at any time. + +Publication with the Software + +You agree to cite the paper describing the software and algorithm as specified on the download website. + +Media Projects with the Software + +When using the Software in a media project please give credit to Tsinghua University. For example: the Software was used for performance capture courtesy of the Tsinghua University. + +Commercial Licensing Opportunities + +For commercial use and commercial license please contact: liuyebin@mail.tsinghua.edu.cn. diff --git a/GHA/README.md b/GHA/README.md new file mode 100644 index 0000000000000000000000000000000000000000..92c6d5490840212414fd4afde581fb9fc2d62756 --- /dev/null +++ b/GHA/README.md @@ -0,0 +1,73 @@ +# Gaussian Head Avatar: Ultra High-fidelity Head Avatar via Dynamic Gaussians +## [Paper](https://arxiv.org/abs/2312.03029) | [Project Page](https://yuelangx.github.io/gaussianheadavatar/) + + +## Requirements +* Create a conda environment. +``` +conda env create -f environment.yaml +``` +* Install [Pytorch3d](https://github.com/facebookresearch/pytorch3d). +``` +pip install --no-index --no-cache-dir pytorch3d -f https://dl.fbaipublicfiles.com/pytorch3d/packaging/wheels/py38_cu113_pyt1120/download.html +``` +* Install [kaolin](https://github.com/NVIDIAGameWorks/kaolin). +``` +pip install kaolin==0.13.0 -f https://nvidia-kaolin.s3.us-east-2.amazonaws.com/torch-1.12.0_cu113.html +``` +* Install diff-gaussian-rasterization and simple_knn from [gaussian-splatting](https://github.com/graphdeco-inria/gaussian-splatting). Note, for rendering 32-channel images, please modify "NUM_CHANNELS 3" to "NUM_CHANNELS 32" in "diff-gaussian-rasterization/cuda_rasterizer/config.h". +``` +cd path/to/gaussian-splatting +# Modify "submodules/diff-gaussian-rasterization/cuda_rasterizer/config.h" +pip install submodules/diff-gaussian-rasterization +pip install submodules/simple-knn +``` +* Download ["tets_data.npz"](https://drive.google.com/file/d/1SMkp8v8bDyYxEdyq25jWnAX1zeQuAkNq/view?usp=drive_link) and put it into "assets/". + + +## Datasets +We provide instructions for preprocessing [NeRSemble dataset](https://tobias-kirschstein.github.io/nersemble/): +* Apply to download [NeRSemble dataset](https://tobias-kirschstein.github.io/nersemble/) and unzip it into "path/to/raw_NeRSemble/". +* Extract the images, cameras and background for specific identities into a structured dataset "NeRSemble/{id}". +``` +cd preprocess +python preprocess_nersemble.py +``` +* Remove background using [BackgroundMattingV2](https://github.com/PeterL1n/BackgroundMattingV2). Please git clone the code. Download [pytorch_resnet101.pth](https://drive.google.com/file/d/1zysR-jW6jydA2zkWfevxD1JpQHglKG1_/view?usp=drive_link) and put it into "path/to/BackgroundMattingV2/assets/". Then run the script we provide "preprocess/remove_background_nersemble.py". +``` +cp preprocess/remove_background_nersemble.py path/to/BackgroundMattingV2/ +cd path/to/BackgroundMattingV2 +python remove_background_nersemble.py +``` +* Fit BFM model for head pose and expression coefficients using [Multiview-3DMM-Fitting](https://github.com/YuelangX/Multiview-3DMM-Fitting). Please follow the instructions. + +We provide a [mini demo dataset](https://drive.google.com/file/d/1OddIml-gJgRQU4YEP-T6USzIQyKSaF7I/view?usp=drive_link) for checking whether the code is runnable. Note, before downloading it, you must first sign the [NeRSemble Terms of Use](https://forms.gle/H4JLdUuehqkBNrBo7). + +## Training +First, edit the config file, for example "config/train_meshhead_N031", and train the geometry guidance model. +``` +python train_meshhead.py --config config/train_meshhead_N031.yaml +``` +Second, edit the config file "config/train_gaussianhead_N031", and train the gaussian head avatar. +``` +python train_gaussianhead.py --config config/train_gaussianhead_N031.yaml +``` + +## Reenactment +Once the two-stage training is completed, the trained avatar can be reenacted by a sequence of expression coefficients. Please specify the avatar checkpoints and the source data in the config file "config/reenactment_N031.py" and run the reenactment application. +``` +python reenactment.py --config config/reenactment_N031.yaml +``` + + +## Acknowledgement +Part of the code is borrowed from [gaussian-splatting](https://github.com/graphdeco-inria/gaussian-splatting). + +## Citation +``` +@inproceedings{xu2023gaussianheadavatar, + title={Gaussian Head Avatar: Ultra High-fidelity Head Avatar via Dynamic Gaussians}, + author={Xu, Yuelang and Chen, Benwang and Li, Zhe and Zhang, Hongwen and Wang, Lizhen and Zheng, Zerong and Liu, Yebin}, + booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)}, + year={2024} +} diff --git a/GHA/config/config.py b/GHA/config/config.py new file mode 100644 index 0000000000000000000000000000000000000000..6b7c89c826adf6699e9c522c6971767ded82e8e5 --- /dev/null +++ b/GHA/config/config.py @@ -0,0 +1,129 @@ +import os +from yacs.config import CfgNode as CN + + +class config_base(): + + def __init__(self): + self.cfg = CN() + + def get_cfg(self): + return self.cfg.clone() + + def load(self,config_file): + self.cfg.defrost() + self.cfg.merge_from_file(config_file) + + def freeze(self): + self.cfg.freeze() + + +class config_train(config_base): + + def __init__(self): + super(config_train, self).__init__() + + self.cfg.gpu_id = 0 # which gpu is used + self.cfg.load_meshhead_checkpoint = '' # checkpoint path of mesh head + self.cfg.load_gaussianhead_checkpoint = '' # checkpoint path of gaussian head + self.cfg.load_supres_checkpoint = '' # checkpoint path of super resolution network + self.cfg.load_delta_poses_checkpoint = '' # checkpoint path of per-frame offset of head pose + self.cfg.lr_net = 0.0 # learning rate for models and networks + self.cfg.lr_lmk = 0.0 # learning rate for 3D landmarks + self.cfg.lr_pose = 0.0 # learning rate for delta_poses + self.cfg.batch_size = 1 # recommend batch_size = 1 + self.cfg.optimize_pose = False # optimize delta_poses or not + + self.cfg.dataset = CN() + self.cfg.dataset.dataroot = '' # root of the dataset + self.cfg.dataset.camera_ids = [] # which cameras are used + self.cfg.dataset.original_resolution = 2048 # original image resolution, should match the intrinsic + self.cfg.dataset.resolution = 512 # image resolution for rendering + self.cfg.dataset.num_sample_view = 8 # number of sampled images from different views during mesh head training + + self.cfg.meshheadmodule = CN() + self.cfg.meshheadmodule.geo_mlp = [] # dimensions of geometry MLP + self.cfg.meshheadmodule.exp_color_mlp = [] # dimensions of expression color MLP + self.cfg.meshheadmodule.pose_color_mlp = [] # dimensions of pose color MLP + self.cfg.meshheadmodule.exp_deform_mlp = [] # dimensions of expression deformation MLP + self.cfg.meshheadmodule.pose_deform_mlp = [] # dimensions of pose deformation MLP + self.cfg.meshheadmodule.pos_freq = 4 # frequency of positional encoding + self.cfg.meshheadmodule.model_bbox = [] # bounding box of the head model + self.cfg.meshheadmodule.dist_threshold_near = 0.1 # threshold t1 + self.cfg.meshheadmodule.dist_threshold_far = 0.2 # thresgold t2 + self.cfg.meshheadmodule.deform_scale = 0.3 # scale factor for deformation + self.cfg.meshheadmodule.subdivide = False # subdivide the tetmesh (resolution: 128 --> 256) or not + + self.cfg.supresmodule = CN() + self.cfg.supresmodule.input_dim = 32 # input dim, equal to the channel number of the multi-channel color + self.cfg.supresmodule.output_dim = 3 # output dim, euqal to the channel number of the final image + self.cfg.supresmodule.network_capacity = 64 # dimension of the network's last conv layer + + self.cfg.gaussianheadmodule = CN() + self.cfg.gaussianheadmodule.num_add_mouth_points = 0 # number of the points added around mouth landmarks while initialization + self.cfg.gaussianheadmodule.exp_color_mlp = [] # dimensions of expression color MLP + self.cfg.gaussianheadmodule.pose_color_mlp = [] # dimensions of pose color MLP + self.cfg.gaussianheadmodule.exp_attributes_mlp = [] # dimensions of expression attribute MLP + self.cfg.gaussianheadmodule.pose_attributes_mlp = [] # dimensions of pose attribute MLP + self.cfg.gaussianheadmodule.exp_deform_mlp = [] # dimensions of expression deformation MLP + self.cfg.gaussianheadmodule.pose_deform_mlp = [] # dimensions of pose deformation MLP + self.cfg.gaussianheadmodule.exp_coeffs_dim = 64 # dimension of the expression coefficients + self.cfg.gaussianheadmodule.pos_freq = 4 # frequency of positional encoding + self.cfg.gaussianheadmodule.dist_threshold_near = 0.1 # threshold t1 + self.cfg.gaussianheadmodule.dist_threshold_far = 0.2 # thresgold t2 + self.cfg.gaussianheadmodule.deform_scale = 0.3 # scale factor for deformation + self.cfg.gaussianheadmodule.attributes_scale = 0.05 # scale factor for attribute offset + + self.cfg.recorder = CN() + self.cfg.recorder.name = '' # name of the avatar + self.cfg.recorder.logdir = '' # directory of the tensorboard log + self.cfg.recorder.checkpoint_path = '' # path to the saved checkpoints + self.cfg.recorder.result_path = '' # path to the visualization results + self.cfg.recorder.save_freq = 1 # how often the checkpoints are saved + self.cfg.recorder.show_freq = 1 # how often the visualization results are saved + + + +class config_reenactment(config_base): + + def __init__(self): + super(config_reenactment, self).__init__() + + self.cfg.gpu_id = 0 # which gpu is used + self.cfg.load_gaussianhead_checkpoint = '' # checkpoint path of gaussian head + self.cfg.load_supres_checkpoint = '' # checkpoint path of super resolution network + + self.cfg.dataset = CN() + self.cfg.dataset.dataroot = '' # root of the dataset + self.cfg.dataset.image_files = '' # file names of input images + self.cfg.dataset.param_files = '' # file names of BFM parameters (head pose and expression coefficients) + self.cfg.dataset.camera_path = '' # path of a specific camera + self.cfg.dataset.pose_code_path = '' # path of a specific pose code (as network input) + self.cfg.dataset.exp_path = '' # path of a specific expression code (as network input) + self.cfg.dataset.freeview = False # freeview rendering or using the specific camera + self.cfg.dataset.original_resolution = 2048 # original image resolution, should match the intrinsic + self.cfg.dataset.resolution = 512 # image resolution for rendering + + self.cfg.supresmodule = CN() + self.cfg.supresmodule.input_dim = 32 # input dim, equal to the channel number of the multi-channel color + self.cfg.supresmodule.output_dim = 3 # output dim, euqal to the channel number of the final image + self.cfg.supresmodule.network_capacity = 64 # dimension of the network's last conv layer + + self.cfg.gaussianheadmodule = CN() + self.cfg.gaussianheadmodule.num_add_mouth_points = 0 # number of the points added around mouth landmarks while initialization + self.cfg.gaussianheadmodule.exp_color_mlp = [] # dimensions of expression color MLP + self.cfg.gaussianheadmodule.pose_color_mlp = [] # dimensions of pose color MLP + self.cfg.gaussianheadmodule.exp_attributes_mlp = [] # dimensions of expression attribute MLP + self.cfg.gaussianheadmodule.pose_attributes_mlp = [] # dimensions of pose attribute MLP + self.cfg.gaussianheadmodule.exp_deform_mlp = [] # dimensions of expression deformation MLP + self.cfg.gaussianheadmodule.pose_deform_mlp = [] # dimensions of pose deformation MLP + self.cfg.gaussianheadmodule.exp_coeffs_dim = 64 # dimension of the expression coefficients + self.cfg.gaussianheadmodule.pos_freq = 4 # frequency of positional encoding + self.cfg.gaussianheadmodule.dist_threshold_near = 0.1 # threshold t1 + self.cfg.gaussianheadmodule.dist_threshold_far = 0.2 # thresgold t2 + self.cfg.gaussianheadmodule.deform_scale = 0.3 # scale factor for deformation + self.cfg.gaussianheadmodule.attributes_scale = 0.05 # scale factor for attribute offset + + self.cfg.recorder = CN() + self.cfg.recorder.name = '' # name of the avatar + self.cfg.recorder.result_path = '' # path to the visualization results \ No newline at end of file diff --git a/GHA/config/reenactment_0924.yaml b/GHA/config/reenactment_0924.yaml new file mode 100644 index 0000000000000000000000000000000000000000..9e8ffee1d9bf488065b50605dbf7bd57591dc837 --- /dev/null +++ b/GHA/config/reenactment_0924.yaml @@ -0,0 +1,37 @@ +gpu_id: 0 +load_supres_checkpoint: '../checkpoints/face_0929/supres_latest' +load_gaussianhead_checkpoint: '../checkpoints/face_0929/gaussianhead_latest' + +dataset: + dataroot: '../data/face1001' + image_files: 'images/*/wrong_image.jpg' + param_files: 'params/*/params.npz' + camera_path: '../data/face1001/cameras/0000/camera_22070938.npz' + pose_code_path: '../data/face1001/params/0000/params.npz' + freeview: False + resolution: 2048 + original_resolution: 2048 + +supresmodule: + input_dim: 32 + output_dim: 3 + network_capacity: 32 + +gaussianheadmodule: + num_add_mouth_points: 3000 + exp_color_mlp: [180, 256, 256, 32] + pose_color_mlp: [182, 128, 32] + exp_deform_mlp: [79, 256, 256, 256, 256, 256, 3] + pose_deform_mlp: [81, 256, 256, 3] + exp_attributes_mlp: [180, 256, 256, 256, 8] + pose_attributes_mlp: [182, 128, 128, 8] + exp_coeffs_dim: 52 + pos_freq: 4 + dist_threshold_near: 0.05 + dist_threshold_far: 0.12 + deform_scale: 0.3 + attributes_scale: 0.2 + +recorder: + name: 'train_exp_cat' + result_path: 'results/reenactment' \ No newline at end of file diff --git a/GHA/config/reenactment_1004.yaml b/GHA/config/reenactment_1004.yaml new file mode 100644 index 0000000000000000000000000000000000000000..a5dac41ae98a97378a0339229a5dcd6fd5fc5f7f --- /dev/null +++ b/GHA/config/reenactment_1004.yaml @@ -0,0 +1,38 @@ +gpu_id: 0 +load_supres_checkpoint: '../checkpoints/face_0929/supres_latest' +load_gaussianhead_checkpoint: '../checkpoints/face_0929/gaussianhead_latest' + +dataset: + dataroot: '../data/face1001' + image_files: 'images/*/wrong_image.jpg' + param_files: 'params/*/params.npz' + camera_path: '../data/face1001/cameras/0000/camera_22070938.npz' + pose_code_path: '../data/face1001/params/0000/params.npz' + exp_path: '/home/pengc02/pengcheng/projects/gaussian_avatar/avatar_final/data/1005_thu_slow/thuSlow10.npy' + freeview: False + resolution: 2048 + original_resolution: 2048 + +supresmodule: + input_dim: 32 + output_dim: 3 + network_capacity: 32 + +gaussianheadmodule: + num_add_mouth_points: 3000 + exp_color_mlp: [180, 256, 256, 32] + pose_color_mlp: [182, 128, 32] + exp_deform_mlp: [79, 256, 256, 256, 256, 256, 3] + pose_deform_mlp: [81, 256, 256, 3] + exp_attributes_mlp: [180, 256, 256, 256, 8] + pose_attributes_mlp: [182, 128, 128, 8] + exp_coeffs_dim: 52 + pos_freq: 4 + dist_threshold_near: 0.05 + dist_threshold_far: 0.12 + deform_scale: 0.3 + attributes_scale: 0.2 + +recorder: + name: 'thu_exp_slow' + result_path: 'results/reenactment' \ No newline at end of file diff --git a/GHA/config/reenactment_N031.yaml b/GHA/config/reenactment_N031.yaml new file mode 100644 index 0000000000000000000000000000000000000000..41e53bb807bea4cf959354d873f6514df36a369c --- /dev/null +++ b/GHA/config/reenactment_N031.yaml @@ -0,0 +1,37 @@ +gpu_id: 0 +load_supres_checkpoint: '../checkpoints/face_0920/supres_latest' +load_gaussianhead_checkpoint: '../checkpoints/face_0920/gaussianhead_latest' + +dataset: + dataroot: '../data/face0313all' + image_files: 'images/*/wrong_image.jpg' + param_files: 'params/*/params.npz' + camera_path: '../data/face0313all/cameras/0000/camera_22070938.npz' + pose_code_path: '../data/face0313all/params/0000/params.npz' + freeview: False + resolution: 2048 + original_resolution: 2048 + +supresmodule: + input_dim: 32 + output_dim: 3 + network_capacity: 32 + +gaussianheadmodule: + num_add_mouth_points: 3000 + exp_color_mlp: [180, 256, 256, 32] + pose_color_mlp: [182, 128, 32] + exp_deform_mlp: [79, 256, 256, 256, 256, 256, 3] + pose_deform_mlp: [81, 256, 256, 3] + exp_attributes_mlp: [180, 256, 256, 256, 8] + pose_attributes_mlp: [182, 128, 128, 8] + exp_coeffs_dim: 52 + pos_freq: 4 + dist_threshold_near: 0.05 + dist_threshold_far: 0.12 + deform_scale: 0.3 + attributes_scale: 0.2 + +recorder: + name: '0923_nzc' + result_path: 'results/reenactment' \ No newline at end of file diff --git a/GHA/config/reenactment_face0313.yaml b/GHA/config/reenactment_face0313.yaml new file mode 100644 index 0000000000000000000000000000000000000000..6aa30a8ab1bbd766a439dadf1d8d329f4e2895c4 --- /dev/null +++ b/GHA/config/reenactment_face0313.yaml @@ -0,0 +1,37 @@ +gpu_id: 0 +load_supres_checkpoint: '/home/pengc02/pengcheng/projects/gaussian_avatar/ag_gha/checkpoints_new_v2/face_0920/supres_latest' +load_gaussianhead_checkpoint: '/home/pengc02/pengcheng/projects/gaussian_avatar/ag_gha/checkpoints_new_v2/face_0920/gaussianhead_latest' + +dataset: + dataroot: '/home/pengc02/pengcheng/projects/gaussian_avatar/ag_gha/data/face0313all' + image_files: 'images/*/wrong_image.jpg' + param_files: 'params/*/params.npz' + camera_path: '/home/pengc02/pengcheng/projects/gaussian_avatar/ag_gha/data/face0313all/cameras/0000/camera_22070938.npz' + pose_code_path: '/home/pengc02/pengcheng/projects/gaussian_avatar/ag_gha/data/face0313all/params/0000/params.npz' + freeview: False + resolution: 2048 + original_resolution: 2048 + +supresmodule: + input_dim: 32 + output_dim: 3 + network_capacity: 32 + +gaussianheadmodule: + num_add_mouth_points: 3000 + exp_color_mlp: [180, 256, 256, 32] + pose_color_mlp: [182, 128, 32] + exp_deform_mlp: [79, 256, 256, 256, 256, 256, 3] + pose_deform_mlp: [81, 256, 256, 3] + exp_attributes_mlp: [180, 256, 256, 256, 8] + pose_attributes_mlp: [182, 128, 128, 8] + exp_coeffs_dim: 52 + pos_freq: 4 + dist_threshold_near: 0.05 + dist_threshold_far: 0.12 + deform_scale: 0.3 + attributes_scale: 0.2 + +recorder: + name: 'face0313_freeview3' + result_path: 'results/reenactment' \ No newline at end of file diff --git a/GHA/config/train_gaussianhead_N031.yaml b/GHA/config/train_gaussianhead_N031.yaml new file mode 100644 index 0000000000000000000000000000000000000000..8a15a4999dd04eb838250b16feb4c7427ab4bf1c --- /dev/null +++ b/GHA/config/train_gaussianhead_N031.yaml @@ -0,0 +1,57 @@ +gpu_id: 0 +load_meshhead_checkpoint: 'checkpoints/meshhead_huawei0425/meshhead_latest' +load_gaussianhead_checkpoint: 'checkpoints/meshhead_huawei0425/gaussianhead_latest' +load_supres_checkpoint: 'checkpoints/meshhead_huawei0425/supres_latest' +load_delta_poses_checkpoint: 'checkpoints/meshhead_huawei0425/delta_poses_latest' +lr_net: 1e-4 +lr_pose: 1e-5 +batch_size: 1 +optimize_pose: True + +dataset: + dataroot: '../data/face_data' + # dataroot: 'D:/GaussianSplatting/data/Shuangqing/huawei0425/face0425_single' + camera_ids: ['01', '02', '04', '05'] + original_resolution: 2048 + resolution: 2048 + +meshheadmodule: + geo_mlp: [27, 256, 256, 256, 256, 256, 132] + exp_color_mlp: [180, 256, 256, 32] + pose_color_mlp: [182, 128, 32] + exp_deform_mlp: [79, 256, 256, 256, 256, 256, 3] + pose_deform_mlp: [81, 256, 256, 3] + pos_freq: 4 + model_bbox: [[-1.6, 1.6], [-1.7, 1.8], [-2.5, 1.0]] + dist_threshold_near: 0.1 + dist_threshold_far: 0.25 + deform_scale: 0.3 + subdivide: False + +supresmodule: + input_dim: 32 + output_dim: 3 + network_capacity: 32 + +gaussianheadmodule: + num_add_mouth_points: 3000 + exp_color_mlp: [180, 256, 256, 32] + pose_color_mlp: [182, 128, 32] + exp_deform_mlp: [79, 256, 256, 256, 256, 256, 3] + pose_deform_mlp: [81, 256, 256, 3] + exp_attributes_mlp: [180, 256, 256, 256, 8] + pose_attributes_mlp: [182, 128, 128, 8] + exp_coeffs_dim: 64 + pos_freq: 4 + dist_threshold_near: 0.1 + dist_threshold_far: 0.25 + deform_scale: 0.3 + attributes_scale: 0.2 + +recorder: + name: 'gaussianhead_huawei0425' + logdir: 'log/gaussianhead_huawei0425' + checkpoint_path: 'checkpoints' + result_path: 'results' + save_freq: 1000 + show_freq: 100 diff --git a/GHA/config/train_meshhead_N031.yaml b/GHA/config/train_meshhead_N031.yaml new file mode 100644 index 0000000000000000000000000000000000000000..725326e203d0ccc94f6d03b27142c0551faaa3ec --- /dev/null +++ b/GHA/config/train_meshhead_N031.yaml @@ -0,0 +1,34 @@ +gpu_id: 0 +load_meshhead_checkpoint: 'checkpoints/meshhead_NeRSemble031/meshhead_latest' +lr_net: 1e-3 +lr_lmk: 1e-4 +batch_size: 1 + +dataset: + # dataroot: '../data/face_data' + dataroot: 'D:/GaussianSplatting/data/Shuangqing/huawei0425/face0425_single' + camera_ids: ['01', '02', '04', '05'] + original_resolution: 2048 + resolution: 256 + num_sample_view: 4 + +meshheadmodule: + geo_mlp: [27, 256, 256, 256, 256, 256, 132] + exp_color_mlp: [180, 256, 256, 32] + pose_color_mlp: [182, 128, 32] + exp_deform_mlp: [79, 256, 256, 256, 256, 256, 3] + pose_deform_mlp: [81, 256, 256, 3] + pos_freq: 4 + model_bbox: [[-1.6, 1.6], [-1.7, 1.8], [-2.5, 1.0]] + dist_threshold_near: 0.1 + dist_threshold_far: 0.25 + deform_scale: 0.3 + subdivide: False + +recorder: + name: 'meshhead_huawei0425' + logdir: 'log/meshhead_huawei0425' + checkpoint_path: 'checkpoints' + result_path: 'results' + save_freq: 1000 + show_freq: 100 diff --git a/GHA/environment.yaml b/GHA/environment.yaml new file mode 100644 index 0000000000000000000000000000000000000000..d00b62c30a1b4ae6c2b3a245639c3b05f75c929f --- /dev/null +++ b/GHA/environment.yaml @@ -0,0 +1,114 @@ +name: gha +channels: + - bottler + - iopath + - fvcore + - pytorch + - conda-forge + - defaults +dependencies: + - _libgcc_mutex=0.1=main + - _openmp_mutex=5.1=1_gnu + - blas=1.0=mkl + - bzip2=1.0.8=h5eee18b_5 + - ca-certificates=2024.3.11=h06a4308_0 + - certifi=2024.2.2=py38h06a4308_0 + - charset-normalizer=2.0.4=pyhd3eb1b0_0 + - colorama=0.4.6=pyhd8ed1ab_0 + - cudatoolkit=11.3.1=h2bc3f7f_2 + - ffmpeg=4.3=hf484d3e_0 + - freetype=2.12.1=h4a9f257_0 + - fvcore=0.1.5.post20210915=py38 + - gmp=6.2.1=h295c915_3 + - gnutls=3.6.15=he1e5248_0 + - idna=3.4=py38h06a4308_0 + - intel-openmp=2023.1.0=hdb19cb5_46306 + - iopath=0.1.9=py38 + - jpeg=9e=h5eee18b_1 + - lame=3.100=h7b6447c_0 + - lcms2=2.12=h3be6417_0 + - ld_impl_linux-64=2.38=h1181459_1 + - lerc=3.0=h295c915_0 + - libdeflate=1.17=h5eee18b_1 + - libffi=3.4.4=h6a678d5_0 + - libgcc-ng=11.2.0=h1234567_1 + - libgomp=11.2.0=h1234567_1 + - libiconv=1.16=h7f8727e_2 + - libidn2=2.3.4=h5eee18b_0 + - libpng=1.6.39=h5eee18b_0 + - libstdcxx-ng=11.2.0=h1234567_1 + - libtasn1=4.19.0=h5eee18b_0 + - libtiff=4.5.1=h6a678d5_0 + - libunistring=0.9.10=h27cfd23_0 + - libwebp-base=1.3.2=h5eee18b_0 + - lz4-c=1.9.4=h6a678d5_0 + - mkl=2023.1.0=h213fc3f_46344 + - mkl-service=2.4.0=py38h5eee18b_1 + - mkl_fft=1.3.8=py38h5eee18b_0 + - mkl_random=1.2.4=py38hdb19cb5_0 + - ncurses=6.4=h6a678d5_0 + - nettle=3.7.3=hbbd107a_1 + - numpy=1.24.3=py38hf6e8229_1 + - numpy-base=1.24.3=py38h060ed82_1 + - nvidiacub=1.10.0=0 + - openh264=2.1.1=h4ff587b_0 + - openjpeg=2.4.0=h3ad879b_0 + - openssl=3.0.13=h7f8727e_0 + - pillow=10.2.0=py38h5eee18b_0 + - pip=23.3.1=py38h06a4308_0 + - portalocker=1.4.0=py_0 + - python=3.8.19=h955ad1f_0 + - pytorch=1.12.0=py3.8_cuda11.3_cudnn8.3.2_0 + - pytorch-mutex=1.0=cuda + - pyyaml=5.1.2=py38h516909a_1 + - readline=8.2=h5eee18b_0 + - requests=2.31.0=py38h06a4308_1 + - setuptools=68.2.2=py38h06a4308_0 + - sqlite=3.41.2=h5eee18b_0 + - tabulate=0.9.0=pyhd8ed1ab_1 + - tbb=2021.8.0=hdb19cb5_0 + - termcolor=2.4.0=pyhd8ed1ab_0 + - tk=8.6.12=h1ccaba5_0 + - torchaudio=0.12.0=py38_cu113 + - torchvision=0.13.0=py38_cu113 + - tqdm=4.66.2=pyhd8ed1ab_0 + - typing_extensions=4.9.0=py38h06a4308_1 + - urllib3=2.1.0=py38h06a4308_0 + - wheel=0.41.2=py38h06a4308_0 + - xz=5.4.6=h5eee18b_0 + - yacs=0.1.8=pyhd8ed1ab_0 + - yaml=0.2.5=h7f98852_2 + - zlib=1.2.13=h5eee18b_0 + - zstd=1.5.5=hc292b87_0 + - pip: + - click==8.1.7 + - coloredlogs==15.0.1 + - einops==0.7.0 + - flask==2.0.3 + - flatbuffers==24.3.25 + - humanfriendly==10.0 + - imageio==2.34.0 + - itsdangerous==2.1.2 + - jinja2==3.1.3 + - kornia==0.7.2 + - kornia-rs==0.1.2 + - lazy-loader==0.3 + - lpips==0.1.4 + - markupsafe==2.1.5 + - mpmath==1.3.0 + - networkx==3.1 + - ninja==1.11.1.1 + - onnxruntime==1.17.1 + - opencv-python==4.9.0.80 + - packaging==24.0 + - prefetch-generator==1.0.3 + - protobuf==5.26.1 + - pywavelets==1.4.1 + - scikit-image==0.21.0 + - scipy==1.10.1 + - sympy==1.12 + - tensorboardx==2.6.2.2 + - tifffile==2023.7.10 + - tornado==6.1 + - usd-core==22.5.post1 + - werkzeug==3.0.1 diff --git a/GHA/imgs/teaser.jpg b/GHA/imgs/teaser.jpg new file mode 100644 index 0000000000000000000000000000000000000000..7ab7b054c02b9dca416645af0cb655e178d05352 Binary files /dev/null and b/GHA/imgs/teaser.jpg differ diff --git a/GHA/lib/apps/Reenactment.py b/GHA/lib/apps/Reenactment.py new file mode 100644 index 0000000000000000000000000000000000000000..22d285b7fa95954712f15cde1984d93bb3edc763 --- /dev/null +++ b/GHA/lib/apps/Reenactment.py @@ -0,0 +1,145 @@ +import torch +import torch.nn.functional as F +from tqdm import tqdm +import numpy as np +import math +from GHA.lib.utils.graphics_utils import getWorld2View2, getProjectionMatrix + + +class Reenactment(): + def __init__(self, dataloader, gaussianhead, supres, camera, recorder, gpu_id, freeview): + self.dataloader = dataloader + self.gaussianhead = gaussianhead + self.supres = supres + self.camera = camera + self.recorder = recorder + self.device = torch.device('cuda:%d' % gpu_id) + self.freeview = freeview + + def run(self, stop_fid=None): + for idx, data in tqdm(enumerate(self.dataloader)): + + to_cuda = ['images', 'intrinsics', 'extrinsics', 'world_view_transform', 'projection_matrix', 'full_proj_transform', 'camera_center', + 'pose', 'scale', 'exp_coeff', 'pose_code'] + for data_item in to_cuda: + data[data_item] = data[data_item].to(device=self.device) + + if not self.freeview: + if idx > 0: + data['pose'] = pose_last * 0.5 + data['pose'] * 0.5 + data['exp_coeff'] = exp_last * 0.5 + data['exp_coeff'] * 0.5 + pose_last = data['pose'] + exp_last = data['exp_coeff'] + + else: + data['pose'] *= 0 + if idx > 0: + data['exp_coeff'] = exp_last * 0.5 + data['exp_coeff'] * 0.5 + exp_last = data['exp_coeff'] + + with torch.no_grad(): + data = self.gaussianhead.generate(data) + data = self.camera.render_gaussian(data, 512) + render_images = data['render_images'] + supres_images = self.supres(render_images) + data['supres_images'] = supres_images + + log = { + 'data': data, + 'iter': idx + } + self.recorder.log(log) + if stop_fid is not None and idx == stop_fid: + print('# Reaching stop frame index (%d)' % stop_fid) + break + + def run_for_offline_stitching(self, offline_rendering_param_fpath): + head_offline_rendering_param = np.load(offline_rendering_param_fpath) + cam_extr = head_offline_rendering_param['cam_extr'] + cam_intr = head_offline_rendering_param['cam_intr'] + cam_intr_zoom = head_offline_rendering_param['cam_intr_zoom'] + zoom_image_size = head_offline_rendering_param['zoom_image_size'] + head_pose = head_offline_rendering_param['head_pose'] + head_scale = head_offline_rendering_param['head_scale'] + head_color_bw = head_offline_rendering_param['head_color_bw'] + zoom_scale = head_offline_rendering_param['zoom_scale'] + head_pose = torch.from_numpy(head_pose.astype(np.float32)).to(self.device) + head_color_bw = torch.from_numpy(head_color_bw.astype(np.float32)).to(self.device) + render_size = 512 + + for idx, data in enumerate(tqdm(self.dataloader)): + if idx >= len(cam_extr): + print('# Reaching the end of offline stiitching parameters! Rendering stopped. ') + break + + new_gs_camera_param_dict = self.prepare_camera_data_for_gs_rendering(cam_extr[idx], cam_intr_zoom[idx], render_size, render_size) + for k in new_gs_camera_param_dict.keys(): + if isinstance(new_gs_camera_param_dict[k], torch.Tensor): + new_gs_camera_param_dict[k] = new_gs_camera_param_dict[k].unsqueeze(0).to(self.device) + new_gs_camera_param_dict['pose'] = head_pose.unsqueeze(0).to(self.device) + + to_cuda = ['images', 'intrinsics', 'extrinsics', 'world_view_transform', 'projection_matrix', 'full_proj_transform', 'camera_center', + 'pose', 'scale', 'exp_coeff', 'pose_code'] + for data_item in to_cuda: + data[data_item] = data[data_item].to(device=self.device) + + data.update(new_gs_camera_param_dict) + + with torch.no_grad(): + data = self.gaussianhead.generate(data) + data = self.camera.render_gaussian(data, 512) + render_images = data['render_images'] + supres_images = self.supres(render_images) + data['supres_images'] = supres_images + + data['bg_color'] = torch.zeros([1, 32], device=self.device, dtype=torch.float32) + data['color_bk'] = data.pop('color') + data['color'] = torch.ones_like(data['color_bk']) * head_color_bw.reshape([1, -1, 1]) * 2.0 + data['color'][:, :, 1] = 1 + data['color'] = torch.clamp(data['color'], 0., 1.) + data = self.camera.render_gaussian(data, render_size) + render_bw = data['render_images'][:, :3, :, :] + data['color'] = data.pop('color_bk') + data['render_bw'] = render_bw + + log = { + 'data': data, + 'iter': idx + } + self.recorder.log(log) + + def prepare_camera_data_for_gs_rendering(self, extrinsic, intrinsic, original_resolution, new_resolution): + extrinsic = np.copy(extrinsic) + intrinsic = np.copy(intrinsic) + new_intrinsic = np.copy(intrinsic) + new_intrinsic[:2] *= new_resolution / original_resolution + + intrinsic[0, 0] = intrinsic[0, 0] * 2 / original_resolution + intrinsic[0, 2] = intrinsic[1, 2] * 2 / original_resolution - 1 + intrinsic[1, 1] = intrinsic[1, 1] * 2 / original_resolution + intrinsic[1, 2] = intrinsic[1, 2] * 2 / original_resolution - 1 + fovx = 2 * math.atan(1 / intrinsic[0, 0]) + fovy = 2 * math.atan(1 / intrinsic[1, 1]) + + world_view_transform = torch.tensor(getWorld2View2(extrinsic[:3, :3].transpose(), extrinsic[:3, 3])).transpose(0, 1) + projection_matrix = getProjectionMatrix( + znear=0.01, zfar=100, fovX=None, fovY=None, + K=new_intrinsic, img_h=new_resolution, img_w=new_resolution).transpose(0,1) + full_proj_transform = (world_view_transform.unsqueeze(0).bmm(projection_matrix.unsqueeze(0))).squeeze(0) + camera_center = world_view_transform.inverse()[3, :3] + + c2w = np.linalg.inv(extrinsic) + viewdir = np.matmul(c2w[:3, :3], np.array([0, 0, -1], np.float32).reshape([3, 1])).reshape([-1]) + viewdir = torch.from_numpy(viewdir.astype(np.float32)) + + return { + 'extrinsics': torch.from_numpy(extrinsic.astype(np.float32)), + 'intrinsics': torch.from_numpy(intrinsic.astype(np.float32)), + 'viewdir': viewdir, + 'fovx': torch.Tensor([fovx]), + 'fovy': torch.Tensor([fovy]), + 'world_view_transform': world_view_transform, + 'projection_matrix': projection_matrix, + 'full_proj_transform': full_proj_transform, + 'camera_center': camera_center + } \ No newline at end of file diff --git a/GHA/lib/dataset/DataLoaderX.py b/GHA/lib/dataset/DataLoaderX.py new file mode 100644 index 0000000000000000000000000000000000000000..1a8cd2b933f5dd575481d972dbb8137614c12cb3 --- /dev/null +++ b/GHA/lib/dataset/DataLoaderX.py @@ -0,0 +1,7 @@ +import torch +from prefetch_generator import BackgroundGenerator + +class DataLoaderX(torch.utils.data.DataLoader): + + def __iter__(self): + return BackgroundGenerator(super().__iter__()) \ No newline at end of file diff --git a/GHA/lib/dataset/Dataset.py b/GHA/lib/dataset/Dataset.py new file mode 100644 index 0000000000000000000000000000000000000000..06d6e182edfeda113c44b7d000b36fc30a4c6213 --- /dev/null +++ b/GHA/lib/dataset/Dataset.py @@ -0,0 +1,462 @@ +import torch +import torch.nn.functional as F +import torchvision as tv +from torch.utils.data import Dataset +import numpy as np +import glob +import math +import os +import random +import cv2 +from skimage import io +from pytorch3d.renderer.cameras import look_at_view_transform +from pytorch3d.transforms import so3_exponential_map + +from GHA.lib.utils.graphics_utils import getWorld2View2, getProjectionMatrix + + +def CropImage(left_up, crop_size, image=None, K=None): + crop_size = np.array(crop_size).astype(np.int32) + left_up = np.array(left_up).astype(np.int32) + + if not K is None: + K[0:2,2] = K[0:2,2] - np.array(left_up) + + if not image is None: + if left_up[0] < 0: + image_left = np.zeros([image.shape[0], -left_up[0], image.shape[2]], dtype=np.uint8) + image = np.hstack([image_left, image]) + left_up[0] = 0 + if left_up[1] < 0: + image_up = np.zeros([-left_up[1], image.shape[1], image.shape[2]], dtype=np.uint8) + image = np.vstack([image_up, image]) + left_up[1] = 0 + if crop_size[0] + left_up[0] > image.shape[1]: + image_right = np.zeros([image.shape[0], crop_size[0] + left_up[0] - image.shape[1], image.shape[2]], dtype=np.uint8) + image = np.hstack([image, image_right]) + if crop_size[1] + left_up[1] > image.shape[0]: + image_down = np.zeros([crop_size[1] + left_up[1] - image.shape[0], image.shape[1], image.shape[2]], dtype=np.uint8) + image = np.vstack([image, image_down]) + + image = image[left_up[1]:left_up[1]+crop_size[1], left_up[0]:left_up[0]+crop_size[0], :] + + return image, K + + +def ResizeImage(target_size, source_size, image=None, K=None): + if not K is None: + K[0,:] = (target_size[0] / source_size[0]) * K[0,:] + K[1,:] = (target_size[1] / source_size[1]) * K[1,:] + + if not image is None: + image = cv2.resize(image, dsize=target_size) + return image, K + + +class MeshDataset(Dataset): + + def __init__(self, cfg): + super(MeshDataset, self).__init__() + + self.dataroot = cfg.dataroot + self.camera_ids = cfg.camera_ids + self.original_resolution = cfg.original_resolution + self.resolution = cfg.resolution + self.num_sample_view = cfg.num_sample_view + + self.samples = [] + + image_folder = os.path.join(self.dataroot, 'images') + param_folder = os.path.join(self.dataroot, 'params') + camera_folder = os.path.join(self.dataroot, 'cameras') + frames = os.listdir(image_folder) + + self.num_exp_id = 0 + for frame in frames: + image_paths = [os.path.join(image_folder, frame, 'image_%s.jpg' % camera_id) for camera_id in self.camera_ids] + mask_paths = [os.path.join(image_folder, frame, 'mask_%s.jpg' % camera_id) for camera_id in self.camera_ids] + visible_paths = [os.path.join(image_folder, frame, 'window_%s.jpg' % camera_id) for camera_id in self.camera_ids] + camera_paths = [os.path.join(image_folder, frame, 'camera_%s.npz' % camera_id) for camera_id in self.camera_ids] + param_path = os.path.join(param_folder, frame, 'params.npz') + landmarks_3d_path = os.path.join(param_folder, frame, 'lmk_3d.npy') + vertices_path = os.path.join(param_folder, frame, 'vertices.npy') + + sample = (image_paths, mask_paths, visible_paths, camera_paths, param_path, landmarks_3d_path, vertices_path, self.num_exp_id) + self.samples.append(sample) + self.num_exp_id += 1 + + init_landmarks_3d = torch.from_numpy(np.load(os.path.join(param_folder, frames[0], 'lmk_3d.npy'))).float() + init_vertices = torch.from_numpy(np.load(os.path.join(param_folder, frames[0], 'vertices.npy'))).float() + init_landmarks_3d = torch.cat([init_landmarks_3d, init_vertices[::100]], 0) + + param = np.load(os.path.join(param_folder, frames[0], 'params.npz')) + pose = torch.from_numpy(param['pose'][0]).float() + R = so3_exponential_map(pose[None, :3])[0] + T = pose[None, 3:] + S = torch.from_numpy(param['scale']).float() + self.init_landmarks_3d_neutral = (torch.matmul(init_landmarks_3d- T, R)) / S + + + def get_item(self, index): + data = self.__getitem__(index) + return data + + def __getitem__(self, index): + sample = self.samples[index] + + images = [] + masks = [] + visibles = [] + views = random.sample(range(len(self.camera_ids)), self.num_sample_view) + for view in views: + image_path = sample[0][view] + image = cv2.resize(io.imread(image_path), (self.resolution, self.resolution)) + image = torch.from_numpy(image / 255).permute(2, 0, 1).float() + images.append(image) + + mask_path = sample[1][view] + mask = cv2.resize(io.imread(mask_path), (self.resolution, self.resolution)) + if len(mask.shape) == 3: + mask = mask[:, :, 0:1] + elif len(mask.shape) == 2: + mask = mask[:, :, None] + mask = torch.from_numpy(mask / 255).permute(2, 0, 1).float() + masks.append(mask) + + visible_path = sample[2][view] + if os.path.exists(visible_path): + visible = cv2.resize(io.imread(visible_path), (self.resolution, self.resolution)) + if len(mask.shape) == 3: + visible = visible[:, :, 0:1] + elif len(mask.shape) == 2: + visible = visible[:, :, None] + visible = torch.from_numpy(visible / 255).permute(2, 0, 1).float() + else: + visible = torch.ones_like(image) + visibles.append(visible) + + images = torch.stack(images) + masks = torch.stack(masks) + images = images * masks + visibles = torch.stack(visibles) + + cameras = [np.load(sample[3][view]) for view in views] + intrinsics = torch.stack([torch.from_numpy(camera['intrinsic']).float() for camera in cameras]) + extrinsics = torch.stack([torch.from_numpy(camera['extrinsic']).float() for camera in cameras]) + intrinsics[:, 0, 0] = intrinsics[:, 0, 0] * 2 / self.original_resolution + intrinsics[:, 0, 2] = intrinsics[:, 0, 2] * 2 / self.original_resolution - 1 + intrinsics[:, 1, 1] = intrinsics[:, 1, 1] * 2 / self.original_resolution + intrinsics[:, 1, 2] = intrinsics[:, 1, 2] * 2 / self.original_resolution - 1 + + param_path = sample[4] + param = np.load(param_path) + pose = torch.from_numpy(param['pose'][0]).float() + scale = torch.from_numpy(param['scale']).float() + exp_coeff = torch.from_numpy(param['exp_coeff'][0]).float() + + landmarks_3d_path = sample[5] + landmarks_3d = torch.from_numpy(np.load(landmarks_3d_path)).float() + vertices_path = sample[6] + vertices = torch.from_numpy(np.load(vertices_path)).float() + landmarks_3d = torch.cat([landmarks_3d, vertices[::100]], 0) + + exp_id = sample[7] + + return { + 'images': images, + 'masks': masks, + 'visibles': visibles, + 'pose': pose, + 'scale': scale, + 'exp_coeff': exp_coeff, + 'landmarks_3d': landmarks_3d, + 'intrinsics': intrinsics, + 'extrinsics': extrinsics, + 'exp_id': exp_id} + + def __len__(self): + return len(self.samples) + + + + +class GaussianDataset(Dataset): + + def __init__(self, cfg): + super(GaussianDataset, self).__init__() + + self.dataroot = cfg.dataroot + self.camera_ids = cfg.camera_ids + self.original_resolution = cfg.original_resolution + self.resolution = cfg.resolution + + self.samples = [] + + image_folder = os.path.join(self.dataroot, 'images') + param_folder = os.path.join(self.dataroot, 'params') + camera_folder = os.path.join(self.dataroot, 'cameras') + frames = os.listdir(image_folder) + + self.num_exp_id = 0 + for frame in frames: + image_paths = [os.path.join(image_folder, frame, 'image_%s.jpg' % camera_id) for camera_id in self.camera_ids] + mask_paths = [os.path.join(image_folder, frame, 'mask_%s.jpg' % camera_id) for camera_id in self.camera_ids] + visible_paths = [os.path.join(image_folder, frame, 'window_%s.jpg' % camera_id) for camera_id in self.camera_ids] + camera_paths = [os.path.join(image_folder, frame, 'camera_%s.npz' % camera_id) for camera_id in self.camera_ids] + param_path = os.path.join(param_folder, frame, 'params.npz') + landmarks_3d_path = os.path.join(param_folder, frame, 'lmk_3d.npy') + vertices_path = os.path.join(param_folder, frame, 'vertices.npy') + + sample = (image_paths, mask_paths, visible_paths, camera_paths, param_path, landmarks_3d_path, vertices_path, self.num_exp_id) + self.samples.append(sample) + self.num_exp_id += 1 + + def get_item(self, index): + data = self.__getitem__(index) + return data + + def __getitem__(self, index): + sample = self.samples[index] + + view = random.sample(range(len(self.camera_ids)), 1)[0] + + image_path = sample[0][view] + image = cv2.resize(io.imread(image_path), (self.original_resolution, self.original_resolution)) / 255 + mask_path = sample[1][view] + mask = cv2.resize(io.imread(mask_path), (self.original_resolution, self.original_resolution)) / 255 + if len(mask.shape) == 3: + mask = mask[:, :, 0:1] + elif len(mask.shape) == 2: + mask = mask[:, :, None] + image = image * mask + (1 - mask) + + visible_path = sample[2][view] + if os.path.exists(visible_path): + visible = cv2.resize(io.imread(visible_path), (self.original_resolution, self.original_resolution)) / 255 + if len(visible.shape) == 3: + visible = visible[:, :, 0:1] + elif len(mask.shape) == 2: + visible = visible[:, :, None] + else: + visible = np.ones_like(image) + + camera = np.load(sample[3][view]) + extrinsic = torch.from_numpy(camera['extrinsic']).float() + R = extrinsic[:3,:3].t() + T = extrinsic[:3, 3] + + intrinsic = camera['intrinsic'] + if np.abs(intrinsic[0, 2] - self.original_resolution / 2) > 1 or np.abs(intrinsic[1, 2] - self.original_resolution / 2) > 1: + left_up = np.around(intrinsic[0:2, 2] - np.array([self.original_resolution / 2, self.original_resolution / 2])).astype(np.int32) + _, intrinsic = CropImage(left_up, (self.original_resolution, self.original_resolution), K=intrinsic) + image, _ = CropImage(left_up, (self.original_resolution, self.original_resolution), image=image) + mask, _ = CropImage(left_up, (self.original_resolution, self.original_resolution), image=mask) + visible, _ = CropImage(left_up, (self.original_resolution, self.original_resolution), image=visible) + + intrinsic[0, 0] = intrinsic[0, 0] * 2 / self.original_resolution + intrinsic[0, 2] = intrinsic[0, 2] * 2 / self.original_resolution - 1 + intrinsic[1, 1] = intrinsic[1, 1] * 2 / self.original_resolution + intrinsic[1, 2] = intrinsic[1, 2] * 2 / self.original_resolution - 1 + intrinsic = torch.from_numpy(intrinsic).float() + + image = torch.from_numpy(cv2.resize(image, (self.resolution, self.resolution))).permute(2, 0, 1).float() + mask = torch.from_numpy(cv2.resize(mask, (self.resolution, self.resolution)))[None].float() + visible = torch.from_numpy(cv2.resize(visible, (self.resolution, self.resolution)))[None].float() + image_coarse = F.interpolate(image[None], scale_factor=0.25)[0] + mask_coarse = F.interpolate(mask[None], scale_factor=0.25)[0] + visible_coarse = F.interpolate(visible[None], scale_factor=0.25)[0] + + fovx = 2 * math.atan(1 / intrinsic[0, 0]) + fovy = 2 * math.atan(1 / intrinsic[1, 1]) + + world_view_transform = torch.tensor(getWorld2View2(R.numpy(), T.numpy())).transpose(0, 1) + projection_matrix = getProjectionMatrix(znear=0.01, zfar=100, fovX=fovx, fovY=fovy).transpose(0,1) + full_proj_transform = (world_view_transform.unsqueeze(0).bmm(projection_matrix.unsqueeze(0))).squeeze(0) + camera_center = world_view_transform.inverse()[3, :3] + + param_path = sample[4] + param = np.load(param_path) + pose = torch.from_numpy(param['pose'][0]).float() + scale = torch.from_numpy(param['scale']).float() + exp_coeff = torch.from_numpy(param['exp_coeff'][0]).float() + + landmarks_3d_path = sample[5] + landmarks_3d = torch.from_numpy(np.load(landmarks_3d_path)).float() + vertices_path = sample[6] + vertices = torch.from_numpy(np.load(vertices_path)).float() + landmarks_3d = torch.cat([landmarks_3d, vertices[::100]], 0) + + exp_id = torch.tensor(sample[7]).long() + + return { + 'images': image, + 'masks': mask, + 'visibles': visible, + 'images_coarse': image_coarse, + 'masks_coarse': mask_coarse, + 'visibles_coarse': visible_coarse, + 'pose': pose, + 'scale': scale, + 'exp_coeff': exp_coeff, + 'landmarks_3d': landmarks_3d, + 'exp_id': exp_id, + 'extrinsics': extrinsic, + 'intrinsics': intrinsic, + 'fovx': fovx, + 'fovy': fovy, + 'world_view_transform': world_view_transform, + 'projection_matrix': projection_matrix, + 'full_proj_transform': full_proj_transform, + 'camera_center': camera_center} + + def __len__(self): + return len(self.samples) + + + +class ReenactmentDataset(Dataset): + + def __init__(self, cfg): + super(ReenactmentDataset, self).__init__() + + self.dataroot = cfg.dataroot + self.original_resolution = cfg.original_resolution + self.resolution = cfg.resolution + self.freeview = cfg.freeview + + self.Rot_z = torch.eye(3) + self.Rot_z[0,0] = -1.0 + self.Rot_z[1,1] = -1.0 + + self.samples = [] + image_paths = sorted(glob.glob(os.path.join(self.dataroot, cfg.image_files))) + param_paths = sorted(glob.glob(os.path.join(self.dataroot, cfg.param_files))) + # assert len(image_paths) == len(param_paths) + + self.samples = [] + # for i, image_path in enumerate(image_paths): + # param_path = param_paths[i] + # if os.path.exists(image_path) and os.path.exists(param_path): + # sample = (image_path, param_path) + # self.samples.append(sample) + exp_path = cfg.exp_path + self.exp_coeff = np.load(exp_path) + + for i, param_path in enumerate(param_paths): + image_path = image_paths[0] + if os.path.exists(image_path) and os.path.exists(param_path): + sample = (image_path, param_path) + self.samples.append(sample) + + # add to length of exp_path + while len(self.samples) < self.exp_coeff.shape[0]: + pack = (image_paths[0], param_paths[0]) + self.samples.append(pack) + + if os.path.exists(cfg.pose_code_path): + self.pose_code = torch.from_numpy(np.load(cfg.pose_code_path)['pose'][0]).float() + else: + self.pose_code = None + + + self.extrinsic = torch.tensor([[1.0000, 0.0000, 0.0000, 0.0000], + [0.0000, -1.0000, 0.0000, 0.0000], + [0.0000, 0.0000, -1.0000, 1.0000]]).float() + self.intrinsic = torch.tensor([[self.original_resolution * 3.5, 0.0000e+00, self.original_resolution / 2], + [0.0000e+00, self.original_resolution * 3.5, self.original_resolution / 2], + [0.0000e+00, 0.0000e+00, 1.0000e+00]]).float() + if os.path.exists(cfg.camera_path): + camera = np.load(cfg.camera_path) + self.extrinsic = torch.from_numpy(camera['extrinsic']).float() + if not self.freeview: + self.intrinsic = torch.from_numpy(camera['intrinsic']).float() + + self.R = self.extrinsic[:3,:3].t() + self.T = self.extrinsic[:3, 3] + + self.intrinsic[0, 0] = self.intrinsic[0, 0] * 2 / self.original_resolution + self.intrinsic[0, 2] = self.intrinsic[0, 2] * 2 / self.original_resolution - 1 + self.intrinsic[1, 1] = self.intrinsic[1, 1] * 2 / self.original_resolution + self.intrinsic[1, 2] = self.intrinsic[1, 2] * 2 / self.original_resolution - 1 + + self.fovx = 2 * math.atan(1 / self.intrinsic[0, 0]) + self.fovy = 2 * math.atan(1 / self.intrinsic[1, 1]) + + self.world_view_transform = torch.tensor(getWorld2View2(self.R.numpy(), self.T.numpy())).transpose(0, 1) + self.projection_matrix = getProjectionMatrix(znear=0.01, zfar=100, fovX=self.fovx, fovY=self.fovy).transpose(0,1) + self.full_proj_transform = (self.world_view_transform.unsqueeze(0).bmm(self.projection_matrix.unsqueeze(0))).squeeze(0) + self.camera_center = self.world_view_transform.inverse()[3, :3] + + def update_camera(self, index): + elev = math.sin(index / 20) * 8 + 0 + azim = math.cos(index / 20) * 45 - 0 + R, T = look_at_view_transform(dist=1.2, elev=elev, azim=azim, at=((0.0, 0.0, 0.05),)) + R = torch.matmul(self.Rot_z, R[0].t()) + self.extrinsic = torch.cat([R, T.t()], -1) + + self.R = self.extrinsic[:3,:3].t() + self.T = self.extrinsic[:3, 3] + + self.world_view_transform = torch.tensor(getWorld2View2(self.R.numpy(), self.T.numpy())).transpose(0, 1) + self.full_proj_transform = (self.world_view_transform.unsqueeze(0).bmm(self.projection_matrix.unsqueeze(0))).squeeze(0) + self.camera_center = self.world_view_transform.inverse()[3, :3] + + def get_item(self, index): + data = self.__getitem__(index) + return data + + def __getitem__(self, index): + if self.freeview: + self.update_camera(index) + + sample = self.samples[index] + + image_path = sample[0] + image = torch.from_numpy(cv2.resize(io.imread(image_path), (self.resolution, self.resolution)) / 255).permute(2, 0, 1).float() + + param_path = sample[1] + param = np.load(param_path) + pose = torch.from_numpy(param['pose'][0]).float() + scale = torch.from_numpy(param['scale']).float() + exp_coeff = torch.from_numpy(param['exp_coeff'][0]).float() + id_coeff = torch.from_numpy(param['id_coeff'])[0].float() + + # load new exp_coeff + # exp_coeff = np.load('/home/pengc02/pengcheng/projects/gaussian_avatar/ag_gha/data/face_pose/thu.npy') + # exp_coeff = np.load('/home/pengc02/pengcheng/projects/gaussian_avatar/avatar_final/data/1004_slow_exp/auto.npy') + # exp_coeff = np.load('/home/pengc02/pengcheng/projects/gaussian_avatar/avatar_final/data/0930_sing/singc.npy') + # exp_coeff = np.load('/home/pengc02/pengcheng/projects/gaussian_avatar/avatar_final/data/train_audio_and_exp/train_exp.npy') + exp_coeff = self.exp_coeff + exp_coeff = torch.from_numpy(exp_coeff[index]).float() + + # add mid exp_coeff + mid_exp_coeff = np.load('/home/pengc02/pengcheng/projects/gaussian_avatar/ag_gha/data/face0313all/params/0005/params.npz') + mid_exp_coeff = mid_exp_coeff['exp_coeff'][0] + mid_exp_coeff = torch.from_numpy(mid_exp_coeff).float() + + # exp_coeff = exp_coeff+mid_exp_coeff + + + if self.pose_code is not None: + pose_code = self.pose_code + else: + pose_code = pose + + return { + 'images': image, + 'pose': pose, + 'scale': scale, + 'id_coeff': id_coeff, + 'exp_coeff': exp_coeff, + 'pose_code': pose_code, + 'extrinsics': self.extrinsic, + 'intrinsics': self.intrinsic, + 'fovx': self.fovx, + 'fovy': self.fovy, + 'world_view_transform': self.world_view_transform, + 'projection_matrix': self.projection_matrix, + 'full_proj_transform': self.full_proj_transform, + 'camera_center': self.camera_center} + + def __len__(self): + return len(self.samples) \ No newline at end of file diff --git a/GHA/lib/module/CameraModule.py b/GHA/lib/module/CameraModule.py new file mode 100644 index 0000000000000000000000000000000000000000..0d831d11e00a0b0179857cf912f8c0c5b476986c --- /dev/null +++ b/GHA/lib/module/CameraModule.py @@ -0,0 +1,188 @@ +import torch +import kaolin +import math +from diff_gaussian_rasterization import GaussianRasterizationSettings, GaussianRasterizer + + +class CameraModule(): + def __init__(self): + self.bg_color = torch.tensor([1.0] * 32).float() + self.scale_modifier = 1.0 + + def perspective_camera(self, points, camera_proj): + projected_points = torch.bmm(points, camera_proj.permute(0, 2, 1)) + projected_2d_points = projected_points[:, :, :2] / projected_points[:, :, 2:3] + + return projected_2d_points + + def prepare_vertices(self, vertices, faces, camera_proj, camera_rot=None, camera_trans=None, + camera_transform=None): + if camera_transform is None: + assert camera_trans is not None and camera_rot is not None, \ + "camera_transform or camera_trans and camera_rot must be defined" + vertices_camera = kaolin.render.camera.rotate_translate_points(vertices, camera_rot, + camera_trans) + else: + assert camera_trans is None and camera_rot is None, \ + "camera_trans and camera_rot must be None when camera_transform is defined" + padded_vertices = torch.nn.functional.pad( + vertices, (0, 1), mode='constant', value=1. + ) + vertices_camera = (padded_vertices @ camera_transform) + # Project the vertices on the camera image plan + vertices_image = self.perspective_camera(vertices_camera, camera_proj) + face_vertices_camera = kaolin.ops.mesh.index_vertices_by_faces(vertices_camera, faces) + face_vertices_image = kaolin.ops.mesh.index_vertices_by_faces(vertices_image, faces) + face_normals = kaolin.ops.mesh.face_normals(face_vertices_camera, unit=True) + return face_vertices_camera, face_vertices_image, face_normals + + def render(self, data, resolution): + verts_list = data['verts_list'] + faces_list = data['faces_list'] + verts_color_list = data['verts_color_list'] + + B = len(verts_list) + + render_images = [] + render_soft_masks = [] + render_depths = [] + render_normals = [] + face_normals_list = [] + for b in range(B): + intrinsics = data['intrinsics'][b] + extrinsics = data['extrinsics'][b] + #camera_proj = torch.stack([intrinsics[:, 0, 0] / intrinsics[:, 0, 2], intrinsics[:, 1, 1] / intrinsics[:, 1, 2], torch.ones_like(intrinsics[:, 0, 0])], -1).to(device) + camera_proj = intrinsics + camera_transform = extrinsics.permute(0, 2, 1) + + verts = verts_list[b].unsqueeze(0).repeat(intrinsics.shape[0], 1, 1) + faces = faces_list[b] + verts_color = verts_color_list[b].unsqueeze(0).repeat(intrinsics.shape[0], 1, 1) + faces_color = verts_color[:, faces] + + face_vertices_camera, face_vertices_image, face_normals = self.prepare_vertices( + verts, faces, camera_proj, camera_transform=camera_transform + ) + face_vertices_image[:, :, :, 1] = -face_vertices_image[:, :, :, 1] + #face_vertices_camera[:, :, :, 1:] = -face_vertices_camera[:, :, :, 1:] + face_normals[:, :, 1:] = -face_normals[:, :, 1:] + ### Perform Rasterization ### + # Construct attributes that DI1-R rasterizer will interpolate. + # the first is the UVS associated to each face + # the second will make a hard segmentation mask + face_attributes = [ + faces_color, + torch.ones((faces_color.shape[0], faces_color.shape[1], 3, 1), device=verts.device), + face_vertices_camera[:, :, :, 2:], + face_normals.unsqueeze(-2).repeat(1, 1, 3, 1), + ] + + # If you have nvdiffrast installed you can change rast_backend to + # nvdiffrast or nvdiffrast_fwd + image_features, soft_masks, face_idx = kaolin.render.mesh.dibr_rasterization( + resolution, resolution, -face_vertices_camera[:, :, :, -1], + face_vertices_image, face_attributes, face_normals[:, :, -1], + rast_backend='cuda') + + # image_features is a tuple in composed of the interpolated attributes of face_attributes + images, masks, depths, normals = image_features + images = torch.clamp(images * masks, 0., 1.) + depths = (depths * masks) + normals = (normals * masks) + + render_images.append(images) + render_soft_masks.append(soft_masks) + render_depths.append(depths) + render_normals.append(normals) + face_normals_list.append(face_normals) + + render_images = torch.stack(render_images, 0) + render_soft_masks = torch.stack(render_soft_masks, 0) + render_depths = torch.stack(render_depths, 0) + render_normals = torch.stack(render_normals, 0) + + data['render_images'] = render_images + data['render_soft_masks'] = render_soft_masks + data['render_depths'] = render_depths + data['render_normals'] = render_normals + data['verts_list'] = verts_list + data['faces_list'] = faces_list + data['face_normals_list'] = face_normals_list + + return data + + + def render_gaussian(self, data, resolution): + """ + Render the scene. + + Background tensor (bg_color) must be on GPU! + """ + B = data['xyz'].shape[0] + xyz = data['xyz'] + #shs = rearrange(data['shs'], 'b n (x y) -> b n x y', y=3) + colors_precomp = data['color'] + opacity = data['opacity'] + scales = data['scales'] + rotations = data['rotation'] + fovx = data['fovx'] + fovy = data['fovy'] + bg_color = self.bg_color if 'bg_color' not in data.keys() else data['bg_color'] + + world_view_transform = data['world_view_transform'] + full_proj_transform = data['full_proj_transform'] + camera_center = data['camera_center'] + + # Create zero tensor. We will use it to make pytorch return gradients of the 2D (screen-space) means + screenspace_points = torch.zeros_like(xyz, dtype=xyz.dtype, requires_grad=True, device=xyz.device) + 0 + try: + screenspace_points.retain_grad() + except: + pass + + render_images = [] + radii = [] + for b in range(B): + + tanfovx = math.tan(fovx[b] * 0.5) + tanfovy = math.tan(fovy[b] * 0.5) + # Set up rasterization configuration + raster_settings = GaussianRasterizationSettings( + image_height=int(resolution), + image_width=int(resolution), + tanfovx=tanfovx, + tanfovy=tanfovy, + bg=bg_color.to(xyz.device), + scale_modifier=self.scale_modifier, + viewmatrix=world_view_transform[b], + projmatrix=full_proj_transform[b], + sh_degree=0, + campos=camera_center[b], + prefiltered=False, + debug=False + ) + + rasterizer = GaussianRasterizer(raster_settings=raster_settings) + + means3D = xyz[b] + means2D = screenspace_points[b] + + # Rasterize visible Gaussians to image, obtain their radii (on screen). + render_images_b, radii_b, _ = rasterizer( + means3D = means3D, + means2D = means2D, + #shs = shs[b], + colors_precomp = colors_precomp[b], + opacities = opacity[b], + scales = scales[b], + rotations = rotations[b]) + render_images.append(render_images_b) + radii.append(radii_b) + + render_images = torch.stack(render_images) + radii = torch.stack(radii) + data['render_images'] = render_images + data['viewspace_points'] = screenspace_points + data['visibility_filter'] = radii > 0 + data['radii'] = radii + return data \ No newline at end of file diff --git a/GHA/lib/module/GaussianHeadModule.py b/GHA/lib/module/GaussianHeadModule.py new file mode 100644 index 0000000000000000000000000000000000000000..01860baf62cdd3f4ec2a1f99e6c417328fd25c49 --- /dev/null +++ b/GHA/lib/module/GaussianHeadModule.py @@ -0,0 +1,142 @@ +import torch +from torch import nn +from einops import rearrange +import tqdm +from pytorch3d.ops.knn import knn_gather, knn_points +from pytorch3d.transforms import so3_exponential_map +from pytorch3d.transforms.rotation_conversions import quaternion_to_matrix, matrix_to_quaternion +from simple_knn._C import distCUDA2 + +from GHA.lib.network.MLP import MLP +from GHA.lib.network.PositionalEmbedding import get_embedder +from GHA.lib.utils.general_utils import inverse_sigmoid + + +class GaussianHeadModule(nn.Module): + def __init__(self, cfg, xyz, feature, landmarks_3d_neutral, add_mouth_points=False): + super(GaussianHeadModule, self).__init__() + + if add_mouth_points and cfg.num_add_mouth_points > 0: + mouth_keypoints = landmarks_3d_neutral[48:66] + mouth_center = torch.mean(mouth_keypoints, dim=0, keepdim=True) + mouth_center[:, 2] = mouth_keypoints[:, 2].min() + max_dist = (mouth_keypoints - mouth_center).abs().max(0)[0] + points_add = (torch.rand([cfg.num_add_mouth_points, 3]) - 0.5) * 1.6 * max_dist + mouth_center + + xyz = torch.cat([xyz, points_add]) + feature = torch.cat([feature, torch.zeros([cfg.num_add_mouth_points, feature.shape[1]])]) + + self.xyz = nn.Parameter(xyz) + self.feature = nn.Parameter(feature) + self.register_buffer('landmarks_3d_neutral', landmarks_3d_neutral) + + dist2 = torch.clamp_min(distCUDA2(self.xyz.cuda()), 0.0000001).cpu() + scales = torch.log(torch.sqrt(dist2))[...,None].repeat(1, 3) + self.scales = nn.Parameter(scales) + + rots = torch.zeros((xyz.shape[0], 4), device=xyz.device) + rots[:, 0] = 1 + self.rotation = nn.Parameter(rots) + + self.opacity = nn.Parameter(inverse_sigmoid(0.3 * torch.ones((xyz.shape[0], 1)))) + + self.exp_color_mlp = MLP(cfg.exp_color_mlp, last_op=None) + self.pose_color_mlp = MLP(cfg.pose_color_mlp, last_op=None) + self.exp_attributes_mlp = MLP(cfg.exp_attributes_mlp, last_op=None) + self.pose_attributes_mlp = MLP(cfg.pose_attributes_mlp, last_op=None) + self.exp_deform_mlp = MLP(cfg.exp_deform_mlp, last_op=nn.Tanh()) + self.pose_deform_mlp = MLP(cfg.pose_deform_mlp, last_op=nn.Tanh()) + + self.pos_embedding, _ = get_embedder(cfg.pos_freq) + + self.exp_coeffs_dim = cfg.exp_coeffs_dim + self.dist_threshold_near = cfg.dist_threshold_near + self.dist_threshold_far = cfg.dist_threshold_far + self.deform_scale = cfg.deform_scale + self.attributes_scale = cfg.attributes_scale + + def generate(self, data): + B = data['exp_coeff'].shape[0] + + xyz = self.xyz.unsqueeze(0).repeat(B, 1, 1) + feature = torch.tanh(self.feature).unsqueeze(0).repeat(B, 1, 1) + + dists, _, _ = knn_points(xyz, self.landmarks_3d_neutral.unsqueeze(0).repeat(B, 1, 1)) + exp_weights = torch.clamp((self.dist_threshold_far - dists) / (self.dist_threshold_far - self.dist_threshold_near), 0.0, 1.0) + pose_weights = 1 - exp_weights + exp_controlled = (dists < self.dist_threshold_far).squeeze(-1) + pose_controlled = (dists > self.dist_threshold_near).squeeze(-1) + + color = torch.zeros([B, xyz.shape[1], self.exp_color_mlp.dims[-1]], device=xyz.device) + delta_xyz = torch.zeros_like(xyz, device=xyz.device) + delta_attributes = torch.zeros([B, xyz.shape[1], self.scales.shape[1] + self.rotation.shape[1] + self.opacity.shape[1]], device=xyz.device) + for b in range(B): + # print(B) + feature_exp_controlled = feature[b, exp_controlled[b], :] + exp_color_input = torch.cat([feature_exp_controlled.t(), + data['exp_coeff'][b].unsqueeze(-1).repeat(1, feature_exp_controlled.shape[0])], 0)[None] + exp_color = self.exp_color_mlp(exp_color_input)[0].t() + color[b, exp_controlled[b], :] += exp_color * exp_weights[b, exp_controlled[b], :] + + feature_pose_controlled = feature[b, pose_controlled[b], :] + pose_color_input = torch.cat([feature_pose_controlled.t(), + self.pos_embedding(data['pose'][b]).unsqueeze(-1).repeat(1, feature_pose_controlled.shape[0])], 0)[None] + pose_color = self.pose_color_mlp(pose_color_input)[0].t() + color[b, pose_controlled[b], :] += pose_color * pose_weights[b, pose_controlled[b], :] + + exp_attributes_input = exp_color_input + exp_delta_attributes = self.exp_attributes_mlp(exp_attributes_input)[0].t() + delta_attributes[b, exp_controlled[b], :] += exp_delta_attributes * exp_weights[b, exp_controlled[b], :] + + pose_attributes_input = pose_color_input + pose_attributes = self.pose_attributes_mlp(pose_attributes_input)[0].t() + delta_attributes[b, pose_controlled[b], :] += pose_attributes * pose_weights[b, pose_controlled[b], :] + + + xyz_exp_controlled = xyz[b, exp_controlled[b], :] + exp_deform_input = torch.cat([self.pos_embedding(xyz_exp_controlled).t(), + data['exp_coeff'][b].unsqueeze(-1).repeat(1, xyz_exp_controlled.shape[0])], 0)[None] + exp_deform = self.exp_deform_mlp(exp_deform_input)[0].t() + delta_xyz[b, exp_controlled[b], :] += exp_deform * exp_weights[b, exp_controlled[b], :] + + xyz_pose_controlled = xyz[b, pose_controlled[b], :] + pose_deform_input = torch.cat([self.pos_embedding(xyz_pose_controlled).t(), + self.pos_embedding(data['pose'][b]).unsqueeze(-1).repeat(1, xyz_pose_controlled.shape[0])], 0)[None] + pose_deform = self.pose_deform_mlp(pose_deform_input)[0].t() + delta_xyz[b, pose_controlled[b], :] += pose_deform * pose_weights[b, pose_controlled[b], :] + + xyz = xyz + delta_xyz * self.deform_scale + + delta_scales = delta_attributes[:, :, 0:3] + scales = self.scales.unsqueeze(0).repeat(B, 1, 1) + delta_scales * self.attributes_scale + scales = torch.exp(scales) + + delta_rotation = delta_attributes[:, :, 3:7] + rotation = self.rotation.unsqueeze(0).repeat(B, 1, 1) + delta_rotation * self.attributes_scale + rotation = torch.nn.functional.normalize(rotation, dim=2) + + delta_opacity = delta_attributes[:, :, 7:8] + opacity = self.opacity.unsqueeze(0).repeat(B, 1, 1) + delta_opacity * self.attributes_scale + opacity = torch.sigmoid(opacity) + + if 'pose' in data: + R = so3_exponential_map(data['pose'][:, :3]) + T = data['pose'][:, None, 3:] + S = data['scale'][:, :, None] + xyz = torch.bmm(xyz * S, R.permute(0, 2, 1)) + T + + rotation_matrix = quaternion_to_matrix(rotation) + rotation_matrix = rearrange(rotation_matrix, 'b n x y -> (b n) x y') + R = rearrange(R.unsqueeze(1).repeat(1, rotation.shape[1], 1, 1), 'b n x y -> (b n) x y') + rotation_matrix = rearrange(torch.bmm(R, rotation_matrix), '(b n) x y -> b n x y', b=B) + rotation = matrix_to_quaternion(rotation_matrix) + + scales = scales * S + + data['exp_deform'] = exp_deform + data['xyz'] = xyz + data['color'] = color + data['scales'] = scales + data['rotation'] = rotation + data['opacity'] = opacity + return data diff --git a/GHA/lib/module/MeshHeadModule.py b/GHA/lib/module/MeshHeadModule.py new file mode 100644 index 0000000000000000000000000000000000000000..ac2f48295d33628bcdfb257f1c41d867432ef0ae --- /dev/null +++ b/GHA/lib/module/MeshHeadModule.py @@ -0,0 +1,204 @@ +import torch +from torch import nn +import numpy as np +import kaolin +import tqdm +from pytorch3d.ops.knn import knn_gather, knn_points +from pytorch3d.transforms import so3_exponential_map + +from lib.network.MLP import MLP +from lib.network.PositionalEmbedding import get_embedder + +from lib.utils.dmtet_utils import marching_tetrahedra + +class MeshHeadModule(nn.Module): + def __init__(self, cfg, init_landmarks_3d_neutral): + super(MeshHeadModule, self).__init__() + + self.geo_mlp = MLP(cfg.geo_mlp, last_op=nn.Tanh()) + self.exp_color_mlp = MLP(cfg.exp_color_mlp, last_op=None) + self.pose_color_mlp = MLP(cfg.pose_color_mlp, last_op=None) + self.exp_deform_mlp = MLP(cfg.exp_deform_mlp, last_op=nn.Tanh()) + self.pose_deform_mlp = MLP(cfg.pose_deform_mlp, last_op=nn.Tanh()) + + self.landmarks_3d_neutral = nn.Parameter(init_landmarks_3d_neutral) + + self.pos_embedding, _ = get_embedder(cfg.pos_freq) + + self.model_bbox = cfg.model_bbox + self.dist_threshold_near = cfg.dist_threshold_near + self.dist_threshold_far = cfg.dist_threshold_far + self.deform_scale = cfg.deform_scale + + tets_data = np.load('assets/tets_data.npz') + self.register_buffer('tet_verts', torch.from_numpy(tets_data['tet_verts'])) + self.register_buffer('tets', torch.from_numpy(tets_data['tets'])) + self.grid_res = 128 + + if cfg.subdivide: + self.subdivide() + + def geometry(self, geo_input): + pred = self.geo_mlp(geo_input) + return pred + + def exp_color(self, color_input): + verts_color = self.exp_color_mlp(color_input) + return verts_color + + def pose_color(self, color_input): + verts_color = self.pose_color_mlp(color_input) + return verts_color + + def exp_deform(self, deform_input): + deform = self.exp_deform_mlp(deform_input) + return deform + + def pose_deform(self, deform_input): + deform = self.pose_deform_mlp(deform_input) + return deform + + def get_landmarks(self): + return self.landmarks_3d_neutral + + def subdivide(self): + new_tet_verts, new_tets = kaolin.ops.mesh.subdivide_tetmesh(self.tet_verts.unsqueeze(0), self.tets) + self.tet_verts = new_tet_verts[0] + self.tets = new_tets + self.grid_res *= 2 + + def reconstruct(self, data): + B = data['exp_coeff'].shape[0] + + query_pts = self.tet_verts.unsqueeze(0).repeat(B, 1, 1) + geo_input = self.pos_embedding(query_pts).permute(0, 2, 1) + + pred = self.geometry(geo_input) + + sdf, deform, features = pred[:, :1, :], pred[:, 1:4, :], pred[:, 4:, :] + sdf = sdf.permute(0, 2, 1) + features = features.permute(0, 2, 1) + verts_deformed = (query_pts + torch.tanh(deform.permute(0, 2, 1)) / self.grid_res) + verts_list, features_list, faces_list = marching_tetrahedra(verts_deformed, features, self.tets, sdf) + + data['verts0_list'] = verts_list + data['faces_list'] = faces_list + + verts_batch = [] + verts_features_batch = [] + num_pts_max = 0 + for b in range(B): + if verts_list[b].shape[0] > num_pts_max: + num_pts_max = verts_list[b].shape[0] + + for b in range(B): + verts_batch.append(torch.cat([verts_list[b], torch.zeros([num_pts_max - verts_list[b].shape[0], verts_list[b].shape[1]], device=verts_list[b].device)], 0)) + verts_features_batch.append(torch.cat([features_list[b], torch.zeros([num_pts_max - features_list[b].shape[0], features_list[b].shape[1]], device=features_list[b].device)], 0)) + verts_batch = torch.stack(verts_batch, 0) + verts_features_batch = torch.stack(verts_features_batch, 0) + + dists, idx, _ = knn_points(verts_batch, data['landmarks_3d_neutral']) + exp_weights = torch.clamp((self.dist_threshold_far - dists) / (self.dist_threshold_far - self.dist_threshold_near), 0.0, 1.0) + pose_weights = 1 - exp_weights + + exp_color_input = torch.cat([verts_features_batch.permute(0, 2, 1), data['exp_coeff'].unsqueeze(-1).repeat(1, 1, num_pts_max)], 1) + verts_color_batch = self.exp_color(exp_color_input).permute(0, 2, 1) * exp_weights + + pose_color_input = torch.cat([verts_features_batch.permute(0, 2, 1), self.pos_embedding(data['pose']).unsqueeze(-1).repeat(1, 1, num_pts_max)], 1) + verts_color_batch = verts_color_batch + self.pose_color(pose_color_input).permute(0, 2, 1) * pose_weights + + exp_deform_input = torch.cat([self.pos_embedding(verts_batch).permute(0, 2, 1), data['exp_coeff'].unsqueeze(-1).repeat(1, 1, num_pts_max)], 1) + exp_deform = self.exp_deform(exp_deform_input).permute(0, 2, 1) + verts_batch = verts_batch + exp_deform * exp_weights * self.deform_scale + + pose_deform_input = torch.cat([self.pos_embedding(verts_batch).permute(0, 2, 1), self.pos_embedding(data['pose']).unsqueeze(-1).repeat(1, 1, num_pts_max)], 1) + pose_deform = self.pose_deform(pose_deform_input).permute(0, 2, 1) + verts_batch = verts_batch + pose_deform * pose_weights * self.deform_scale + + if 'pose' in data: + R = so3_exponential_map(data['pose'][:, :3]) + T = data['pose'][:, None, 3:] + S = data['scale'][:, :, None] + verts_batch = torch.bmm(verts_batch * S, R.permute(0, 2, 1)) + T + + data['exp_deform'] = exp_deform + data['pose_deform'] = pose_deform + data['verts_list'] = [verts_batch[b, :verts_list[b].shape[0], :] for b in range(B)] + data['verts_color_list'] = [verts_color_batch[b, :verts_list[b].shape[0], :] for b in range(B)] + return data + + def reconstruct_neutral(self): + query_pts = self.tet_verts.unsqueeze(0) + geo_input = self.pos_embedding(query_pts).permute(0, 2, 1) + + pred = self.geometry(geo_input) + + sdf, deform, features = pred[:, :1, :], pred[:, 1:4, :], pred[:, 4:, :] + sdf = sdf.permute(0, 2, 1) + features = features.permute(0, 2, 1) + verts_deformed = (query_pts + torch.tanh(deform.permute(0, 2, 1)) / self.grid_res) + verts_list, features_list, faces_list = marching_tetrahedra(verts_deformed, features, self.tets, sdf) + + data = {} + data['verts'] = verts_list[0] + data['faces'] = faces_list[0] + data['verts_feature'] = features_list[0] + return data + + def query_sdf(self, data): + query_pts = data['query_pts'] + + geo_input = self.pos_embedding(query_pts).permute(0, 2, 1) + + pred = self.geometry(geo_input) + sdf = pred[:, :1, :] + sdf = sdf.permute(0, 2, 1) + + data['sdf'] = sdf + return data + + def deform(self, data): + exp_coeff = data['exp_coeff'] + query_pts = data['query_pts'] + + geo_input = self.pos_embedding(query_pts).permute(0, 2, 1) + + pred = self.geometry(geo_input) + sdf, deform = pred[:, :1, :], pred[:, 1:4, :] + query_pts = (query_pts + torch.tanh(deform).permute(0, 2, 1) / self.grid_res) + + exp_deform_input = torch.cat([self.pos_embedding(query_pts).permute(0, 2, 1), exp_coeff.unsqueeze(-1).repeat(1, 1, query_pts.shape[1])], 1) + exp_deform = self.exp_deform(exp_deform_input).permute(0, 2, 1) + + deformed_pts = query_pts + exp_deform * self.deform_scale + + data['deformed_pts'] = deformed_pts + return data + + def in_bbox(self, verts, bbox): + is_in_bbox = (verts[:, :, 0] > bbox[0][0]) & \ + (verts[:, :, 1] > bbox[1][0]) & \ + (verts[:, :, 2] > bbox[2][0]) & \ + (verts[:, :, 0] < bbox[0][1]) & \ + (verts[:, :, 1] < bbox[1][1]) & \ + (verts[:, :, 2] < bbox[2][1]) + return is_in_bbox + + def pre_train_sphere(self, iter, device): + loss_fn = torch.nn.MSELoss() + optimizer = torch.optim.Adam(list(self.parameters()), lr=1e-3) + + for i in tqdm.tqdm(range(iter)): + query_pts = torch.rand((8, 1024, 3), device=device) * 3 - 1.5 + ref_value = torch.sqrt((query_pts**2).sum(-1)) - 1.0 + data = { + 'query_pts': query_pts + } + data = self.query_sdf(data) + sdf = data['sdf'] + loss = loss_fn(sdf[:, :, 0], ref_value) + optimizer.zero_grad() + loss.backward() + optimizer.step() + + print("Pre-trained MLP", loss.item()) \ No newline at end of file diff --git a/GHA/lib/module/SuperResolutionModule.py b/GHA/lib/module/SuperResolutionModule.py new file mode 100644 index 0000000000000000000000000000000000000000..cc390ed3c7873a5d0864aa62ea0649e826007dde --- /dev/null +++ b/GHA/lib/module/SuperResolutionModule.py @@ -0,0 +1,15 @@ +import torch +from torch import nn +from einops import rearrange + +from GHA.lib.network.Upsampler import Upsampler + +class SuperResolutionModule(nn.Module): + def __init__(self, cfg): + super(SuperResolutionModule, self).__init__() + + self.upsampler = Upsampler(cfg.input_dim, cfg.output_dim, cfg.network_capacity) + + def forward(self, input): + output = self.upsampler(input) + return output diff --git a/GHA/lib/network/MLP.py b/GHA/lib/network/MLP.py new file mode 100644 index 0000000000000000000000000000000000000000..5d216b2381010cd6ee0c1bce0c4a5cf3cbb0a20e --- /dev/null +++ b/GHA/lib/network/MLP.py @@ -0,0 +1,39 @@ +import torch +import torch.nn as nn +import torch.nn.functional as F + + +class MLP(nn.Module): + def __init__(self, dims, last_op=None): + super(MLP, self).__init__() + + self.dims = dims + self.skip_layer = [int(len(dims) / 2)] + self.last_op = last_op + + self.layers = [] + for l in range(0, len(dims) - 1): + if l in self.skip_layer: + self.layers.append(nn.Conv1d(dims[l] + dims[0], dims[l + 1], 1)) + else: + self.layers.append(nn.Conv1d(dims[l], dims[l + 1], 1)) + self.add_module("conv%d" % l, self.layers[l]) + + def forward(self, latet_code, return_all=False): + y = latet_code + tmpy = latet_code + y_list = [] + for l, f in enumerate(self.layers): + if l in self.skip_layer: + y = self._modules['conv' + str(l)](torch.cat([y, tmpy], 1)) + else: + y = self._modules['conv' + str(l)](y) + if l != len(self.layers) - 1: + y = F.leaky_relu(y) + if self.last_op: + y = self.last_op(y) + y_list.append(y) + if return_all: + return y_list + else: + return y \ No newline at end of file diff --git a/GHA/lib/network/PositionalEmbedding.py b/GHA/lib/network/PositionalEmbedding.py new file mode 100644 index 0000000000000000000000000000000000000000..ffd8c89b36e911ae4bc0bdc462a6a4a84b649f87 --- /dev/null +++ b/GHA/lib/network/PositionalEmbedding.py @@ -0,0 +1,52 @@ +import torch +import torch.nn as nn + +# Positional encoding (section 5.1) +class Embedder: + def __init__(self, **kwargs): + self.kwargs = kwargs + self.create_embedding_fn() + + def create_embedding_fn(self): + embed_fns = [] + d = self.kwargs['input_dims'] + out_dim = 0 + if self.kwargs['include_input']: + embed_fns.append(lambda x : x) + out_dim += d + + max_freq = self.kwargs['max_freq_log2'] + N_freqs = self.kwargs['num_freqs'] + + if self.kwargs['log_sampling']: + freq_bands = 2.**torch.linspace(0., max_freq, steps=N_freqs) + else: + freq_bands = torch.linspace(2.**0., 2.**max_freq, steps=N_freqs) + + for freq in freq_bands: + for p_fn in self.kwargs['periodic_fns']: + embed_fns.append(lambda x, p_fn=p_fn, freq=freq : p_fn(x * freq)) + out_dim += d + + self.embed_fns = embed_fns + self.out_dim = out_dim + + def embed(self, inputs): + return torch.cat([fn(inputs) for fn in self.embed_fns], -1) + +def get_embedder(multires, i=0): + if i == -1: + return nn.Identity(), 3 + + embed_kwargs = { + 'include_input' : True, + 'input_dims' : 1, + 'max_freq_log2' : multires-1, + 'num_freqs' : multires, + 'log_sampling' : True, + 'periodic_fns' : [torch.sin, torch.cos], + } + + embedder_obj = Embedder(**embed_kwargs) + embed = lambda x, eo=embedder_obj : eo.embed(x) + return embed, embedder_obj.out_dim \ No newline at end of file diff --git a/GHA/lib/network/Upsampler.py b/GHA/lib/network/Upsampler.py new file mode 100644 index 0000000000000000000000000000000000000000..4484376779eef8aa5f99cf86be498e101802e232 --- /dev/null +++ b/GHA/lib/network/Upsampler.py @@ -0,0 +1,85 @@ +import torch +import torch.nn as nn +import torch.nn.functional as F + + +class DoubleConv(nn.Module): + """(convolution => [BN] => ReLU) * 2""" + + def __init__(self, in_channels, out_channels, mid_channels=None): + super().__init__() + if not mid_channels: + mid_channels = out_channels + self.double_conv = nn.Sequential( + nn.Conv2d(in_channels, mid_channels, kernel_size=3, padding=1, bias=False), + nn.InstanceNorm2d(mid_channels), + nn.ReLU(inplace=True), + nn.Conv2d(mid_channels, out_channels, kernel_size=3, padding=1, bias=False), + nn.InstanceNorm2d(out_channels), + nn.ReLU(inplace=True) + ) + + def forward(self, x): + return self.double_conv(x) + + +class Down(nn.Module): + """Downscaling with maxpool then double conv""" + + def __init__(self, in_channels, out_channels): + super().__init__() + self.maxpool_conv = nn.Sequential( + nn.MaxPool2d(2), + DoubleConv(in_channels, out_channels) + ) + + def forward(self, x): + return self.maxpool_conv(x) + + +class Up(nn.Module): + """Upscaling then double conv""" + + def __init__(self, in_channels, out_channels): + super().__init__() + self.up = nn.Upsample(scale_factor=2, mode='bilinear', align_corners=True) + self.conv = DoubleConv(in_channels, out_channels, in_channels // 2) + + def forward(self, x1, x2=None): + x1 = self.up(x1) + if x2 is not None: + diffY = x2.size()[2] - x1.size()[2] + diffX = x2.size()[3] - x1.size()[3] + x1 = F.pad(x1, [diffX // 2, diffX - diffX // 2, + diffY // 2, diffY - diffY // 2]) + x = torch.cat([x2, x1], dim=1) + else: + x = x1 + return self.conv(x) + + +class OutConv(nn.Module): + def __init__(self, in_channels, out_channels): + super(OutConv, self).__init__() + self.conv = nn.Conv2d(in_channels, out_channels, kernel_size=1) + self.act_fn = nn.Sigmoid() + + def forward(self, x): + y = self.act_fn(self.conv(x)) + return y + + +class Upsampler(nn.Module): + def __init__(self, input_dim=32, output_dim=3, network_capacity=128): + super(Upsampler, self).__init__() + self.inc = DoubleConv(input_dim, network_capacity * 4) + self.up1 = Up(network_capacity * 4, network_capacity * 2) + self.up2 = Up(network_capacity * 2, network_capacity) + self.outc = OutConv(network_capacity, output_dim) + + def forward(self, x): + x = self.inc(x) + x = self.up1(x) + x = self.up2(x) + x = self.outc(x) + return x \ No newline at end of file diff --git a/GHA/lib/recorder/Recorder.py b/GHA/lib/recorder/Recorder.py new file mode 100644 index 0000000000000000000000000000000000000000..5b4a583946fc885e9695f7ff6f794ddcfd837204 --- /dev/null +++ b/GHA/lib/recorder/Recorder.py @@ -0,0 +1,217 @@ +from tensorboardX import SummaryWriter +import torch +import os +import numpy as np +import cv2 +import json +from plyfile import PlyData, PlyElement + + +class MeshHeadTrainRecorder(): + def __init__(self, cfg): + self.logdir = cfg.logdir + self.logger = SummaryWriter(self.logdir) + + self.name = cfg.name + self.checkpoint_path = cfg.checkpoint_path + self.result_path = cfg.result_path + + self.save_freq = cfg.save_freq + self.show_freq = cfg.show_freq + + os.makedirs(self.checkpoint_path, exist_ok=True) + os.makedirs(self.result_path, exist_ok=True) + os.makedirs('%s/%s' % (self.checkpoint_path, self.name), exist_ok=True) + os.makedirs('%s/%s' % (self.result_path, self.name), exist_ok=True) + + + def log(self, log_data): + self.logger.add_scalar('loss_rgb', log_data['loss_rgb'], log_data['iter']) + self.logger.add_scalar('loss_sil', log_data['loss_sil'], log_data['iter']) + self.logger.add_scalar('loss_def', log_data['loss_def'], log_data['iter']) + self.logger.add_scalar('loss_offset', log_data['loss_offset'], log_data['iter']) + self.logger.add_scalar('loss_lmk', log_data['loss_lmk'], log_data['iter']) + self.logger.add_scalar('loss_lap', log_data['loss_lap'], log_data['iter']) + + if log_data['iter'] % self.save_freq == 0: + print('saving checkpoint.') + torch.save(log_data['meshhead'].state_dict(), '%s/%s/meshhead_latest' % (self.checkpoint_path, self.name)) + torch.save(log_data['meshhead'].state_dict(), '%s/%s/meshhead_epoch_%d' % (self.checkpoint_path, self.name, log_data['epoch'])) + + if log_data['iter'] % self.show_freq == 0: + image = log_data['data']['images'][0, 0].permute(1, 2, 0).detach().cpu().numpy() + image = (image * 255).astype(np.uint8)[:,:,::-1] + + render_image = log_data['data']['render_images'][0, 0, :, :, 0:3].detach().cpu().numpy() + render_image = (render_image * 255).astype(np.uint8)[:,:,::-1] + + render_normal = log_data['data']['render_normals'][0, 0].detach().cpu().numpy() * 0.5 + 0.5 + render_normal = (render_normal * 255).astype(np.uint8)[:,:,::-1] + + render_image = cv2.resize(render_image, (render_image.shape[0], render_image.shape[1])) + render_normal = cv2.resize(render_normal, (render_image.shape[0], render_image.shape[1])) + result = np.hstack((image, render_image, render_normal)) + cv2.imwrite('%s/%s/%06d.jpg' % (self.result_path, self.name, log_data['iter']), result) + + + +class GaussianHeadTrainRecorder(): + def __init__(self, cfg): + self.logdir = cfg.logdir + self.logger = SummaryWriter(self.logdir) + + self.name = cfg.name + self.checkpoint_path = cfg.checkpoint_path + self.result_path = cfg.result_path + + self.save_freq = cfg.save_freq + self.show_freq = cfg.show_freq + + os.makedirs(self.checkpoint_path, exist_ok=True) + os.makedirs(self.result_path, exist_ok=True) + os.makedirs('%s/%s' % (self.checkpoint_path, self.name), exist_ok=True) + os.makedirs('%s/%s' % (self.result_path, self.name), exist_ok=True) + + + def log(self, log_data): + self.logger.add_scalar('loss_rgb_hr', log_data['loss_rgb_hr'], log_data['iter']) + self.logger.add_scalar('loss_rgb_lr', log_data['loss_rgb_lr'], log_data['iter']) + self.logger.add_scalar('loss_vgg', log_data['loss_vgg'], log_data['iter']) + + if log_data['iter'] % self.save_freq == 0: + print('saving checkpoint.') + torch.save(log_data['gaussianhead'].state_dict(), '%s/%s/gaussianhead_latest' % (self.checkpoint_path, self.name)) + torch.save(log_data['gaussianhead'].state_dict(), '%s/%s/gaussianhead_epoch_%d' % (self.checkpoint_path, self.name, log_data['epoch'])) + torch.save(log_data['supres'].state_dict(), '%s/%s/supres_latest' % (self.checkpoint_path, self.name)) + torch.save(log_data['supres'].state_dict(), '%s/%s/supres_epoch_%d' % (self.checkpoint_path, self.name, log_data['epoch'])) + torch.save(log_data['delta_poses'], '%s/%s/delta_poses_latest' % (self.checkpoint_path, self.name)) + torch.save(log_data['delta_poses'], '%s/%s/delta_poses_epoch_%d' % (self.checkpoint_path, self.name, log_data['epoch'])) + + if log_data['iter'] % self.show_freq == 0: + image = log_data['data']['images'][0].permute(1, 2, 0).detach().cpu().numpy() + image = (image * 255).astype(np.uint8)[:,:,::-1] + + render_image = log_data['data']['render_images'][0, 0:3].permute(1, 2, 0).detach().cpu().numpy() + render_image = (render_image * 255).astype(np.uint8)[:,:,::-1] + + cropped_image = log_data['data']['cropped_images'][0].permute(1, 2, 0).detach().cpu().numpy() + cropped_image = (cropped_image * 255).astype(np.uint8)[:,:,::-1] + + supres_image = log_data['data']['supres_images'][0].permute(1, 2, 0).detach().cpu().numpy() + supres_image = (supres_image * 255).astype(np.uint8)[:,:,::-1] + + render_image = cv2.resize(render_image, (image.shape[0], image.shape[1])) + result = np.hstack((image, render_image, cropped_image, supres_image)) + cv2.imwrite('%s/%s/%06d.jpg' % (self.result_path, self.name, log_data['iter']), result) + + + + +class ReenactmentRecorder(): + def __init__(self, cfg): + self.name = cfg.name + self.result_path = cfg.result_path + + os.makedirs('%s/%s' % (self.result_path, self.name), exist_ok=True) + os.makedirs('%s/%s/%s' % (self.result_path, self.name, 'params'), exist_ok=True) + os.makedirs('%s/%s/%s' % (self.result_path, self.name, 'posed_gaussians'), exist_ok=True) + + def log(self, log_data): + image = log_data['data']['images'][0].permute(1, 2, 0).detach().cpu().numpy() + image = (image * 255).astype(np.uint8)[:,:,::-1] + + supres_image = log_data['data']['supres_images'][0].permute(1, 2, 0).detach().cpu().numpy() + supres_image = (supres_image * 255).astype(np.uint8)[:,:,::-1] + + # image = cv2.resize(image, (supres_image.shape[0], supres_image.shape[1])) + # result = np.hstack((image, supres_image)) + cv2.imwrite('%s/%s/%06d.jpg' % (self.result_path, self.name, log_data['iter']), supres_image) + + if 'render_bw' in log_data['data'].keys(): + render_bw = log_data['data']['render_bw'][0].permute(1, 2, 0).detach().cpu().numpy() + render_bw = np.clip(render_bw * 255, 0, 255).astype(np.uint8)[:,:,::-1] + render_bw = cv2.resize(render_bw, (supres_image.shape[0], supres_image.shape[1])) + cv2.imwrite('%s/%s/%06d_bw.jpg' % (self.result_path, self.name, log_data['iter']), render_bw) + + pose = log_data['data']['pose'][0].detach().cpu().numpy() + scale = log_data['data']['scale'][0].detach().cpu().numpy() + exp_coeff = log_data['data']['exp_coeff'][0].detach().cpu().numpy() + id_coeff = log_data['data']['id_coeff'][0].detach().cpu().numpy() + np.savez('%s/%s/params/%06d_param.npz' % (self.result_path, self.name, log_data['iter']), + pose=pose, scale=scale, exp_coeff=exp_coeff, id_coeff=id_coeff) + + if log_data['iter'] == 0: + self.save_gaussians_as_ply('%s/%s/posed_gaussians/%06d.ply' % (self.result_path, self.name, log_data['iter']), log_data['data']) + self.save_camera_as_json('%s/%s/posed_gaussians/%06d.json' % (self.result_path, self.name, log_data['iter']), + log_data['data']['extrinsics'][0].detach().cpu().numpy(), + log_data['data']['intrinsics'][0].detach().cpu().numpy(), + image.shape[0], image.shape[1]) + + def save_camera_as_json(self, path, extrinsic, intrinsic, image_height, image_width): + with open(os.path.join(path), 'w') as fp: + cam_jsons = [] + + w2c = np.eye(4, dtype=np.float32) + w2c[:3, :4] = extrinsic[:3, :4] + c2w = np.linalg.inv(w2c) + pos = c2w[:3, 3] + rot = c2w[:3, :3] + serializable_array_2d = [x.tolist() for x in rot] + + camera_entry = { + 'id': 0, + 'img_name': '00000000', + 'width': int(image_width), + 'height': int(image_height), + 'position': pos.tolist(), + 'rotation': serializable_array_2d, + 'fy': float(intrinsic[1, 1]/2*image_height), + 'fx': float(intrinsic[0, 0]/2*image_width), + } + cam_jsons.append(camera_entry) + json.dump(cam_jsons, fp) + + def save_gaussians_as_ply(self, path, gaussian_vals: dict): + def construct_list_of_attributes(_features_dc, _features_rest, _scaling, _rotation): + l = ['x', 'y', 'z', 'nx', 'ny', 'nz'] + # All channels except the 3 DC + for i in range(_features_dc.shape[1] * _features_dc.shape[2]): + l.append('f_dc_{}'.format(i)) + for i in range(_features_rest.shape[1] * _features_rest.shape[2]): + l.append('f_rest_{}'.format(i)) + l.append('opacity') + for i in range(_scaling.shape[1]): + l.append('scale_{}'.format(i)) + for i in range(_rotation.shape[1]): + l.append('rot_{}'.format(i)) + return l + + def RGB2SH(rgb): + return (rgb - 0.5) / 0.28209479177387814 + + def inverse_sigmoid(x): + return torch.log(x/(1-x)) + + + os.makedirs(os.path.dirname(path), exist_ok=True) + + xyz = gaussian_vals['xyz'][0].detach().cpu().numpy() + normals = np.zeros_like(xyz) + fused_color = RGB2SH(gaussian_vals['color'][0].detach()[:, :3]) + features = torch.zeros((fused_color.shape[0], 3, (3 + 1) ** 2)) + features[:, :3, 0] = fused_color + features_dc = features[:, :, 0:1].transpose(1, 2) + features_rest = features[:, :, 1:].transpose(1, 2) + f_dc = features_dc.transpose(1, 2).flatten(start_dim = 1).contiguous().cpu().numpy() + f_rest = features_rest.transpose(1, 2).flatten(start_dim = 1).contiguous().cpu().numpy() + opacities = inverse_sigmoid(gaussian_vals['opacity'][0].detach()).cpu().numpy() + scale = torch.log(gaussian_vals['scales'][0].detach()).cpu().numpy() + rotation = gaussian_vals['rotation'][0].detach().cpu().numpy() + + dtype_full = [(attribute, 'f4') for attribute in construct_list_of_attributes(features_dc, features_rest, scale, rotation)] + + elements = np.empty(xyz.shape[0], dtype = dtype_full) + attributes = np.concatenate((xyz, normals, f_dc, f_rest, opacities, scale, rotation), axis = 1) + elements[:] = list(map(tuple, attributes)) + el = PlyElement.describe(elements, 'vertex') + PlyData([el]).write(path) diff --git a/GHA/lib/trainer/GaussianHeadTrainer.py b/GHA/lib/trainer/GaussianHeadTrainer.py new file mode 100644 index 0000000000000000000000000000000000000000..1a7d570b4cd2788d243b45ff952625ba6f27bc45 --- /dev/null +++ b/GHA/lib/trainer/GaussianHeadTrainer.py @@ -0,0 +1,109 @@ +import torch +import torch.nn.functional as F +from tqdm import tqdm +import random +import lpips + + +class GaussianHeadTrainer(): + def __init__(self, dataloader, delta_poses, gaussianhead, supres, camera, optimizer, recorder, gpu_id): + self.dataloader = dataloader + self.delta_poses = delta_poses + self.gaussianhead = gaussianhead + self.supres = supres + self.camera = camera + self.optimizer = optimizer + self.recorder = recorder + self.device = torch.device('cuda:%d' % gpu_id) + self.fn_lpips = lpips.LPIPS(net='vgg').to(self.device) + + def train(self, start_epoch=0, epochs=1): + for epoch in range(start_epoch, epochs): + for idx, data in tqdm(enumerate(self.dataloader)): + + # prepare data + to_cuda = ['images', 'masks', 'visibles', 'images_coarse', 'masks_coarse', 'visibles_coarse', + 'intrinsics', 'extrinsics', 'world_view_transform', 'projection_matrix', 'full_proj_transform', 'camera_center', + 'pose', 'scale', 'exp_coeff', 'landmarks_3d', 'exp_id'] + for data_item in to_cuda: + data[data_item] = data[data_item].to(device=self.device) + + images = data['images'] + visibles = data['visibles'] + if self.supres is None: + images_coarse = images + visibles_coarse = visibles + else: + images_coarse = data['images_coarse'] + visibles_coarse = data['visibles_coarse'] + + resolution_coarse = images_coarse.shape[2] + resolution_fine = images.shape[2] + + data['pose'] = data['pose'] + self.delta_poses[data['exp_id'], :] + + # render coarse images + data = self.gaussianhead.generate(data) + data = self.camera.render_gaussian(data, resolution_coarse) + render_images = data['render_images'] + + # crop images for augmentation + scale_factor = random.random() * 0.45 + 0.8 + scale_factor = int(resolution_coarse * scale_factor) / resolution_coarse + cropped_render_images, cropped_images, cropped_visibles = self.random_crop(render_images, images, visibles, scale_factor, resolution_coarse, resolution_fine) + data['cropped_images'] = cropped_images + + # generate super resolution images + supres_images = self.supres(cropped_render_images) + data['supres_images'] = supres_images + + # loss functions + loss_rgb_lr = F.l1_loss(render_images[:, 0:3, :, :] * visibles_coarse, images_coarse * visibles_coarse) + loss_rgb_hr = F.l1_loss(supres_images * cropped_visibles, cropped_images * cropped_visibles) + left_up = (random.randint(0, supres_images.shape[2] - 512), random.randint(0, supres_images.shape[3] - 512)) + loss_vgg = self.fn_lpips((supres_images * cropped_visibles)[:, :, left_up[0]:left_up[0]+512, left_up[1]:left_up[1]+512], + (cropped_images * cropped_visibles)[:, :, left_up[0]:left_up[0]+512, left_up[1]:left_up[1]+512], normalize=True).mean() + loss = loss_rgb_hr + loss_rgb_lr + loss_vgg * 1e-1 + + self.optimizer.zero_grad() + loss.backward() + self.optimizer.step() + + log = { + 'data': data, + 'delta_poses' : self.delta_poses, + 'gaussianhead' : self.gaussianhead, + 'supres' : self.supres, + 'loss_rgb_lr' : loss_rgb_lr, + 'loss_rgb_hr' : loss_rgb_hr, + 'loss_vgg' : loss_vgg, + 'epoch' : epoch, + 'iter' : idx + epoch * len(self.dataloader) + } + self.recorder.log(log) + + + def random_crop(self, render_images, images, visibles, scale_factor, resolution_coarse, resolution_fine): + render_images_scaled = F.interpolate(render_images, scale_factor=scale_factor) + images_scaled = F.interpolate(images, scale_factor=scale_factor) + visibles_scaled = F.interpolate(visibles, scale_factor=scale_factor) + + if scale_factor < 1: + render_images = torch.ones([render_images_scaled.shape[0], render_images_scaled.shape[1], resolution_coarse, resolution_coarse], device=self.device) + left_up_coarse = (random.randint(0, resolution_coarse - render_images_scaled.shape[2]), random.randint(0, resolution_coarse - render_images_scaled.shape[3])) + render_images[:, :, left_up_coarse[0]: left_up_coarse[0] + render_images_scaled.shape[2], left_up_coarse[1]: left_up_coarse[1] + render_images_scaled.shape[3]] = render_images_scaled + + images = torch.ones([images_scaled.shape[0], images_scaled.shape[1], resolution_fine, resolution_fine], device=self.device) + visibles = torch.ones([visibles_scaled.shape[0], visibles_scaled.shape[1], resolution_fine, resolution_fine], device=self.device) + left_up_fine = (int(left_up_coarse[0] * resolution_fine / resolution_coarse), int(left_up_coarse[1] * resolution_fine / resolution_coarse)) + images[:, :, left_up_fine[0]: left_up_fine[0] + images_scaled.shape[2], left_up_fine[1]: left_up_fine[1] + images_scaled.shape[3]] = images_scaled + visibles[:, :, left_up_fine[0]: left_up_fine[0] + visibles_scaled.shape[2], left_up_fine[1]: left_up_fine[1] + visibles_scaled.shape[3]] = visibles_scaled + else: + left_up_coarse = (random.randint(0, render_images_scaled.shape[2] - resolution_coarse), random.randint(0, render_images_scaled.shape[3] - resolution_coarse)) + render_images = render_images_scaled[:, :, left_up_coarse[0]: left_up_coarse[0] + resolution_coarse, left_up_coarse[1]: left_up_coarse[1] + resolution_coarse] + + left_up_fine = (int(left_up_coarse[0] * resolution_fine / resolution_coarse), int(left_up_coarse[1] * resolution_fine / resolution_coarse)) + images = images_scaled[:, :, left_up_fine[0]: left_up_fine[0] + resolution_fine, left_up_fine[1]: left_up_fine[1] + resolution_fine] + visibles = visibles_scaled[:, :, left_up_fine[0]: left_up_fine[0] + resolution_fine, left_up_fine[1]: left_up_fine[1] + resolution_fine] + + return render_images, images, visibles \ No newline at end of file diff --git a/GHA/lib/trainer/MeshHeadTrainer.py b/GHA/lib/trainer/MeshHeadTrainer.py new file mode 100644 index 0000000000000000000000000000000000000000..c3bc70d27ee82d365ea96ac6cbd33f2e55cb88d9 --- /dev/null +++ b/GHA/lib/trainer/MeshHeadTrainer.py @@ -0,0 +1,116 @@ +import torch +import torch.nn.functional as F +from tqdm import tqdm +import kaolin +import lpips +from einops import rearrange +from pytorch3d.transforms import so3_exponential_map + +from kaolin.ops.mesh import index_vertices_by_faces +from kaolin.metrics.trianglemesh import point_to_mesh_distance + + +def laplace_regularizer_const(mesh_verts, mesh_faces): + term = torch.zeros_like(mesh_verts) + norm = torch.zeros_like(mesh_verts[..., 0:1]) + + v0 = mesh_verts[mesh_faces[:, 0], :] + v1 = mesh_verts[mesh_faces[:, 1], :] + v2 = mesh_verts[mesh_faces[:, 2], :] + + term.scatter_add_(0, mesh_faces[:, 0:1].repeat(1,3), (v1 - v0) + (v2 - v0)) + term.scatter_add_(0, mesh_faces[:, 1:2].repeat(1,3), (v0 - v1) + (v2 - v1)) + term.scatter_add_(0, mesh_faces[:, 2:3].repeat(1,3), (v0 - v2) + (v1 - v2)) + + two = torch.ones_like(v0) * 2.0 + norm.scatter_add_(0, mesh_faces[:, 0:1], two) + norm.scatter_add_(0, mesh_faces[:, 1:2], two) + norm.scatter_add_(0, mesh_faces[:, 2:3], two) + + term = term / torch.clamp(norm, min=1.0) + + return torch.mean(term**2) + + + + +class MeshHeadTrainer(): + def __init__(self, dataloader, meshhead, camera, optimizer, recorder, gpu_id): + self.dataloader = dataloader + self.meshhead = meshhead + self.camera = camera + self.optimizer = optimizer + self.recorder = recorder + self.device = torch.device('cuda:%d' % gpu_id) + + def train(self, start_epoch=0, epochs=1): + for epoch in range(start_epoch, epochs): + for idx, data in tqdm(enumerate(self.dataloader)): + + # prepare data + to_cuda = ['images', 'masks', 'visibles', 'intrinsics', 'extrinsics', 'pose', 'scale', 'exp_coeff', 'landmarks_3d', 'exp_id'] + for data_item in to_cuda: + data[data_item] = data[data_item].to(device=self.device) + + images = data['images'].permute(0, 1, 3, 4, 2) + masks = data['masks'].permute(0, 1, 3, 4, 2) + visibles = data['visibles'].permute(0, 1, 3, 4, 2) + resolution = images.shape[2] + + R = so3_exponential_map(data['pose'][:, :3]) + T = data['pose'][:, 3:, None] + S = data['scale'][:, :, None] + landmarks_3d_can = (torch.bmm(R.permute(0,2,1), (data['landmarks_3d'].permute(0, 2, 1) - T)) / S).permute(0, 2, 1) + landmarks_3d_neutral = self.meshhead.get_landmarks()[None].repeat(data['landmarks_3d'].shape[0], 1, 1) + data['landmarks_3d_neutral'] = landmarks_3d_neutral + + deform_data = { + 'exp_coeff': data['exp_coeff'], + 'query_pts': landmarks_3d_neutral + } + deform_data = self.meshhead.deform(deform_data) + pred_landmarks_3d_can = deform_data['deformed_pts'] + loss_def = F.mse_loss(pred_landmarks_3d_can, landmarks_3d_can) + + deform_data = self.meshhead.query_sdf(deform_data) + sdf_landmarks_3d = deform_data['sdf'] + loss_lmk = torch.abs(sdf_landmarks_3d[:, :, 0]).mean() + + data = self.meshhead.reconstruct(data) + data = self.camera.render(data, resolution) + render_images = data['render_images'] + render_soft_masks = data['render_soft_masks'] + exp_deform = data['exp_deform'] + pose_deform = data['pose_deform'] + verts_list = data['verts_list'] + faces_list = data['faces_list'] + + loss_rgb = F.l1_loss(render_images[:, :, :, :, 0:3] * visibles, images * visibles) + loss_sil = kaolin.metrics.render.mask_iou((render_soft_masks * visibles[:, :, :, :, 0]).view(-1, resolution, resolution), (masks * visibles).squeeze().view(-1, resolution, resolution)) + loss_offset = (exp_deform ** 2).sum(-1).mean() + (pose_deform ** 2).sum(-1).mean() + + loss_lap = 0.0 + for b in range(len(verts_list)): + loss_lap += laplace_regularizer_const(verts_list[b], faces_list[b]) + + loss = loss_rgb * 1e-1 + loss_sil * 1e-1 + loss_def * 1e0 + loss_offset * 1e-2 + loss_lmk * 1e-1 + loss_lap * 1e2 + + self.optimizer.zero_grad() + loss.backward() + self.optimizer.step() + + log = { + 'data': data, + 'meshhead' : self.meshhead, + 'loss_rgb' : loss_rgb, + 'loss_sil' : loss_sil, + 'loss_def' : loss_def, + 'loss_offset' : loss_offset, + 'loss_lmk' : loss_lmk, + 'loss_lap' : loss_lap, + 'epoch' : epoch, + 'iter' : idx + epoch * len(self.dataloader) + } + self.recorder.log(log) + if idx + epoch * len(self.dataloader) >= 10000: + return diff --git a/GHA/lib/utils/dmtet_utils.py b/GHA/lib/utils/dmtet_utils.py new file mode 100644 index 0000000000000000000000000000000000000000..c4968a50e3789003ebe81d8fac93d61a384aa96a --- /dev/null +++ b/GHA/lib/utils/dmtet_utils.py @@ -0,0 +1,150 @@ +import torch + +triangle_table = torch.tensor([ + [-1, -1, -1, -1, -1, -1], + [1, 0, 2, -1, -1, -1], + [4, 0, 3, -1, -1, -1], + [1, 4, 2, 1, 3, 4], + [3, 1, 5, -1, -1, -1], + [2, 3, 0, 2, 5, 3], + [1, 4, 0, 1, 5, 4], + [4, 2, 5, -1, -1, -1], + [4, 5, 2, -1, -1, -1], + [4, 1, 0, 4, 5, 1], + [3, 2, 0, 3, 5, 2], + [1, 3, 5, -1, -1, -1], + [4, 1, 2, 4, 3, 1], + [3, 0, 4, -1, -1, -1], + [2, 0, 1, -1, -1, -1], + [-1, -1, -1, -1, -1, -1] +], dtype=torch.long) + +num_triangles_table = torch.tensor([0, 1, 1, 2, 1, 2, 2, 1, 1, 2, 2, 1, 2, 1, 1, 0], dtype=torch.long) +base_tet_edges = torch.tensor([0, 1, 0, 2, 0, 3, 1, 2, 1, 3, 2, 3], dtype=torch.long) +v_id = torch.pow(2, torch.arange(4, dtype=torch.long)) + + +def _sort_edges(edges): + """sort last dimension of edges of shape (E, 2)""" + with torch.no_grad(): + order = (edges[:, 0] > edges[:, 1]).long() + order = order.unsqueeze(dim=1) + + a = torch.gather(input=edges, index=order, dim=1) + b = torch.gather(input=edges, index=1 - order, dim=1) + + return torch.stack([a, b], -1) + + +def _unbatched_marching_tetrahedra(vertices, features, tets, sdf, return_tet_idx): + """unbatched marching tetrahedra. + + Refer to :func:`marching_tetrahedra`. + """ + device = vertices.device + with torch.no_grad(): + occ_n = sdf > 0 + occ_fx4 = occ_n[tets.reshape(-1)].reshape(-1, 4) + occ_sum = torch.sum(occ_fx4, -1) + valid_tets = (occ_sum > 0) & (occ_sum < 4) + occ_sum = occ_sum[valid_tets] + + # find all vertices + all_edges = tets[valid_tets][:, base_tet_edges.to(device)].reshape(-1, 2) + all_edges = _sort_edges(all_edges) + unique_edges, idx_map = torch.unique(all_edges, dim=0, return_inverse=True) + + unique_edges = unique_edges.long() + mask_edges = occ_n[unique_edges.reshape(-1)].reshape(-1, 2).sum(-1) == 1 + mapping = torch.ones((unique_edges.shape[0]), dtype=torch.long, device=device) * -1 + mapping[mask_edges] = torch.arange(mask_edges.sum(), dtype=torch.long, device=device) + idx_map = mapping[idx_map] + + interp_v = unique_edges[mask_edges] + edges_to_interp = vertices[interp_v.reshape(-1)].reshape(-1, 2, 3) + edges_to_interp_sdf = sdf[interp_v.reshape(-1)].reshape(-1, 2, 1) + edges_to_interp_sdf[:, -1] *= -1 + + edges_to_interp_features = features[interp_v.reshape(-1)].reshape(-1, 2, features.shape[1]) + + denominator = edges_to_interp_sdf.sum(1, keepdim=True) + + edges_to_interp_sdf = torch.flip(edges_to_interp_sdf, [1]) / denominator + verts = (edges_to_interp * edges_to_interp_sdf).sum(1) + vert_features = (edges_to_interp_features * edges_to_interp_sdf).sum(1) + + idx_map = idx_map.reshape(-1, 6) + + tetindex = (occ_fx4[valid_tets] * v_id.to(device).unsqueeze(0)).sum(-1) + num_triangles = num_triangles_table.to(device)[tetindex] + triangle_table_device = triangle_table.to(device) + + # Generate triangle indices + faces = torch.cat(( + torch.gather(input=idx_map[num_triangles == 1], dim=1, + index=triangle_table_device[tetindex[num_triangles == 1]][:, :3]).reshape(-1, 3), + torch.gather(input=idx_map[num_triangles == 2], dim=1, + index=triangle_table_device[tetindex[num_triangles == 2]][:, :6]).reshape(-1, 3), + ), dim=0) + + if return_tet_idx: + tet_idx = torch.arange(tets.shape[0], device=device)[valid_tets] + tet_idx = torch.cat((tet_idx[num_triangles == 1], tet_idx[num_triangles == + 2].unsqueeze(-1).expand(-1, 2).reshape(-1)), dim=0) + return verts, vert_features, faces, tet_idx + return verts, vert_features, faces + + +def marching_tetrahedra(vertices, features, tets, sdf, return_tet_idx=False): + r"""Convert discrete signed distance fields encoded on tetrahedral grids to triangle + meshes using marching tetrahedra algorithm as described in `An efficient method of + triangulating equi-valued surfaces by using tetrahedral cells`_. The output surface is differentiable with respect to + input vertex positions and the SDF values. For more details and example usage in learning, see + `Deep Marching Tetrahedra\: a Hybrid Representation for High-Resolution 3D Shape Synthesis`_ NeurIPS 2021. + + + Args: + vertices (torch.tensor): batched vertices of tetrahedral meshes, of shape + :math:`(\text{batch_size}, \text{num_vertices}, 3)`. + tets (torch.tensor): unbatched tetrahedral mesh topology, of shape + :math:`(\text{num_tetrahedrons}, 4)`. + sdf (torch.tensor): batched SDFs which specify the SDF value of each vertex, of shape + :math:`(\text{batch_size}, \text{num_vertices})`. + return_tet_idx (optional, bool): if True, return index of tetrahedron + where each face is extracted. Default: False. + + Returns: + (list[torch.Tensor], list[torch.LongTensor], (optional) list[torch.LongTensor]): + + - the list of vertices for mesh converted from each tetrahedral grid. + - the list of faces for mesh converted from each tetrahedral grid. + - the list of indices that correspond to tetrahedra where faces are extracted. + + Example: + >>> vertices = torch.tensor([[[0, 0, 0], + ... [1, 0, 0], + ... [0, 1, 0], + ... [0, 0, 1]]], dtype=torch.float) + >>> tets = torch.tensor([[0, 1, 2, 3]], dtype=torch.long) + >>> sdf = torch.tensor([[-1., -1., 0.5, 0.5]], dtype=torch.float) + >>> verts_list, faces_list, tet_idx_list = marching_tetrahedra(vertices, tets, sdf, True) + >>> verts_list[0] + tensor([[0.0000, 0.6667, 0.0000], + [0.0000, 0.0000, 0.6667], + [0.3333, 0.6667, 0.0000], + [0.3333, 0.0000, 0.6667]]) + >>> faces_list[0] + tensor([[3, 0, 1], + [3, 2, 0]]) + >>> tet_idx_list[0] + tensor([0, 0]) + + .. _An efficient method of triangulating equi-valued surfaces by using tetrahedral cells: + https://search.ieice.org/bin/summary.php?id=e74-d_1_214 + + .. _Deep Marching Tetrahedra\: a Hybrid Representation for High-Resolution 3D Shape Synthesis: + https://arxiv.org/abs/2111.04276 + """ + + list_of_outputs = [_unbatched_marching_tetrahedra(vertices[b], features[b], tets, sdf[b], return_tet_idx) for b in range(vertices.shape[0])] + return list(zip(*list_of_outputs)) diff --git a/GHA/lib/utils/general_utils.py b/GHA/lib/utils/general_utils.py new file mode 100644 index 0000000000000000000000000000000000000000..a6e6d0529bdc81c424a40c2cc7e46441a11f81ed --- /dev/null +++ b/GHA/lib/utils/general_utils.py @@ -0,0 +1,131 @@ +# +# Copyright (C) 2023, Inria +# GRAPHDECO research group, https://team.inria.fr/graphdeco +# All rights reserved. +# +# This software is free for non-commercial, research and evaluation use +# under the terms of the LICENSE.md file. +# +# For inquiries contact george.drettakis@inria.fr +# + +import torch +import sys +from datetime import datetime +import numpy as np +import random + +def inverse_sigmoid(x): + return torch.log(x/(1-x)) + +def PILtoTorch(pil_image, resolution): + resized_image_PIL = pil_image.resize(resolution) + resized_image = torch.from_numpy(np.array(resized_image_PIL)) / 255.0 + if len(resized_image.shape) == 3: + return resized_image.permute(2, 0, 1) + else: + return resized_image.unsqueeze(dim=-1).permute(2, 0, 1) + +def get_expon_lr_func( + lr_init, lr_final, lr_delay_steps=0, lr_delay_mult=1.0, max_steps=1000000 +): + """ + Copied from Plenoxels + + Continuous learning rate decay function. Adapted from JaxNeRF + The returned rate is lr_init when step=0 and lr_final when step=max_steps, and + is log-linearly interpolated elsewhere (equivalent to exponential decay). + If lr_delay_steps>0 then the learning rate will be scaled by some smooth + function of lr_delay_mult, such that the initial learning rate is + lr_init*lr_delay_mult at the beginning of optimization but will be eased back + to the normal learning rate when steps>lr_delay_steps. + :param conf: config subtree 'lr' or similar + :param max_steps: int, the number of steps during optimization. + :return HoF which takes step as input + """ + + def helper(step): + if step < 0 or (lr_init == 0.0 and lr_final == 0.0): + # Disable this parameter + return 0.0 + if lr_delay_steps > 0: + # A kind of reverse cosine decay. + delay_rate = lr_delay_mult + (1 - lr_delay_mult) * np.sin( + 0.5 * np.pi * np.clip(step / lr_delay_steps, 0, 1) + ) + else: + delay_rate = 1.0 + t = np.clip(step / max_steps, 0, 1) + log_lerp = np.exp(np.log(lr_init) * (1 - t) + np.log(lr_final) * t) + return delay_rate * log_lerp + + return helper + +def strip_lowerdiag(L): + uncertainty = torch.zeros((L.shape[0], 6), dtype=torch.float, device=L.device) + + uncertainty[:, 0] = L[:, 0, 0] + uncertainty[:, 1] = L[:, 0, 1] + uncertainty[:, 2] = L[:, 0, 2] + uncertainty[:, 3] = L[:, 1, 1] + uncertainty[:, 4] = L[:, 1, 2] + uncertainty[:, 5] = L[:, 2, 2] + return uncertainty + +def strip_symmetric(sym): + return strip_lowerdiag(sym) + +def build_rotation(r): + norm = torch.sqrt(r[:,0]*r[:,0] + r[:,1]*r[:,1] + r[:,2]*r[:,2] + r[:,3]*r[:,3]) + + q = r / norm[:, None] + + R = torch.zeros((q.size(0), 3, 3), device=r.device) + + r = q[:, 0] + x = q[:, 1] + y = q[:, 2] + z = q[:, 3] + + R[:, 0, 0] = 1 - 2 * (y*y + z*z) + R[:, 0, 1] = 2 * (x*y - r*z) + R[:, 0, 2] = 2 * (x*z + r*y) + R[:, 1, 0] = 2 * (x*y + r*z) + R[:, 1, 1] = 1 - 2 * (x*x + z*z) + R[:, 1, 2] = 2 * (y*z - r*x) + R[:, 2, 0] = 2 * (x*z - r*y) + R[:, 2, 1] = 2 * (y*z + r*x) + R[:, 2, 2] = 1 - 2 * (x*x + y*y) + return R + +def build_scaling_rotation(s, r): + L = torch.zeros((s.shape[0], 3, 3), dtype=torch.float, device=r.device) + R = build_rotation(r) + + L[:,0,0] = s[:,0] + L[:,1,1] = s[:,1] + L[:,2,2] = s[:,2] + + L = R @ L + return L + + +def Rotate_y_180(X, pos='right'): + R = torch.eye(3).to(X.device) + R[0,0] = -1.0 + R[2,2] = -1.0 + if pos == 'right': + X = torch.matmul(X, R) + else: + X = torch.matmul(R, X) + return X + +def Rotate_z_180(X, pos='right'): + R = torch.eye(3).to(X.device) + R[0,0] = -1.0 + R[1,1] = -1.0 + if pos == 'right': + X = torch.matmul(X, R) + else: + X = torch.matmul(R, X) + return X diff --git a/GHA/lib/utils/graphics_utils.py b/GHA/lib/utils/graphics_utils.py new file mode 100644 index 0000000000000000000000000000000000000000..2dc6e361eaa8ed3e44f00298135ea6fc985838fa --- /dev/null +++ b/GHA/lib/utils/graphics_utils.py @@ -0,0 +1,85 @@ +# +# Copyright (C) 2023, Inria +# GRAPHDECO research group, https://team.inria.fr/graphdeco +# All rights reserved. +# +# This software is free for non-commercial, research and evaluation use +# under the terms of the LICENSE.md file. +# +# For inquiries contact george.drettakis@inria.fr +# + +import torch +import math +import numpy as np +from typing import NamedTuple + +class BasicPointCloud(NamedTuple): + points : np.array + colors : np.array + normals : np.array + +def geom_transform_points(points, transf_matrix): + P, _ = points.shape + ones = torch.ones(P, 1, dtype=points.dtype, device=points.device) + points_hom = torch.cat([points, ones], dim=1) + points_out = torch.matmul(points_hom, transf_matrix.unsqueeze(0)) + + denom = points_out[..., 3:] + 0.0000001 + return (points_out[..., :3] / denom).squeeze(dim=0) + +def getWorld2View(R, t): + Rt = np.zeros((4, 4)) + Rt[:3, :3] = R.transpose() + Rt[:3, 3] = t + Rt[3, 3] = 1.0 + return np.float32(Rt) + +def getWorld2View2(R, t, translate=np.array([.0, .0, .0]), scale=1.0): + Rt = np.zeros((4, 4)) + Rt[:3, :3] = R.transpose() + Rt[:3, 3] = t + Rt[3, 3] = 1.0 + + C2W = np.linalg.inv(Rt) + cam_center = C2W[:3, 3] + cam_center = (cam_center + translate) * scale + C2W[:3, 3] = cam_center + Rt = np.linalg.inv(C2W) + return np.float32(Rt) + +def getProjectionMatrix(znear, zfar, fovX, fovY, K = None, img_h = None, img_w = None): + if K is None: + tanHalfFovY = math.tan((fovY / 2)) + tanHalfFovX = math.tan((fovX / 2)) + top = tanHalfFovY * znear + bottom = -top + right = tanHalfFovX * znear + left = -right + else: + near_fx = znear / K[0, 0] + near_fy = znear / K[1, 1] + + left = - (img_w - K[0, 2]) * near_fx + right = K[0, 2] * near_fx + bottom = (K[1, 2] - img_h) * near_fy + top = K[1, 2] * near_fy + + P = torch.zeros(4, 4) + + z_sign = 1.0 + + P[0, 0] = 2.0 * znear / (right - left) + P[1, 1] = 2.0 * znear / (top - bottom) + P[0, 2] = (right + left) / (right - left) + P[1, 2] = (top + bottom) / (top - bottom) + P[3, 2] = z_sign + P[2, 2] = z_sign * zfar / (zfar - znear) + P[2, 3] = -(zfar * znear) / (zfar - znear) + return P + +def fov2focal(fov, pixels): + return pixels / (2 * math.tan(fov / 2)) + +def focal2fov(focal, pixels): + return 2*math.atan(pixels/(2*focal)) \ No newline at end of file diff --git a/GHA/preprocess/extract_landmarks.py b/GHA/preprocess/extract_landmarks.py new file mode 100644 index 0000000000000000000000000000000000000000..c761b4cab07de0a3955c4bbd7aa799cd3592c723 --- /dev/null +++ b/GHA/preprocess/extract_landmarks.py @@ -0,0 +1,50 @@ +import torch +import os +import sys +import tqdm +import glob +import numpy as np +import cv2 +import face_alignment +from skimage import io +import argparse + +parser = argparse.ArgumentParser() +parser.add_argument('--data_source', type=str, default='./data/input') +args = parser.parse_args() +DATA_SOURCE = args.data_source + +device = torch.device('cuda:0') +fa = face_alignment.FaceAlignment(face_alignment.LandmarksType.THREE_D, flip_input=False, face_detector='blazeface') + +# DATA_SOURCE = '../../data/face_data' +# DATA_SOURCE = '../../data/face_data' +data_folder = os.path.join(DATA_SOURCE, 'images') +frame_folders = sorted(glob.glob(data_folder + '/*')) +for frame_folder in tqdm.tqdm(frame_folders): + if 'background' in frame_folder: + continue + image_paths = glob.glob(frame_folder + '/image_*') + images = np.stack([io.imread(image_path) for image_path in image_paths]) + images = torch.from_numpy(images).float().permute(0, 3, 1, 2).to(device) + results = fa.get_landmarks_from_batch(images, return_landmark_score=True) + for i in range(len(results[0])): + if results[1][i] is None: + results[0][i] = np.zeros([68, 3], dtype=np.float32) + results[1][i] = [np.zeros([68], dtype=np.float32)] + if len(results[1][i]) > 1: + total_score = 0.0 + for j in range(len(results[1][i])): + if np.sum(results[1][i][j]) > total_score: + total_score = np.sum(results[1][i][j]) + landmarks_i = results[0][i][j*68:(j+1)*68] + scores_i = results[1][i][j:j+1] + results[0][i] = landmarks_i + results[1][i] = scores_i + + landmarks = np.concatenate([np.stack(results[0])[:, :, :2], np.stack(results[1]).transpose(0, 2, 1)], -1) + i = 0 + for image_path in image_paths: + landmarks_path = image_path.replace('image_', 'landmarks_').replace('.jpg', '.npy') + np.save(landmarks_path, landmarks[i]) + i += 1 diff --git a/GHA/preprocess/fit_faceverse.py b/GHA/preprocess/fit_faceverse.py new file mode 100644 index 0000000000000000000000000000000000000000..4cdf757e28efed6cc7b60d43321ec71276297a89 --- /dev/null +++ b/GHA/preprocess/fit_faceverse.py @@ -0,0 +1,28 @@ +import torch +import os +import argparse +import sys +sys.path.append(os.path.dirname(os.path.dirname(__file__))) +from lib.LandmarkDataset import LandmarkDataset +from lib.CalibRecorder import CalibRecorder +from lib.Calibrator import Calibrator +from lib.FVMModule import FVMModule +from lib.CameraModule import CameraModule + + +device = torch.device('cuda:0') + +parser = argparse.ArgumentParser() +parser.add_argument('--data_source', type=str, default='./data/input') +args = parser.parse_args() +DATA_SOURCE = args.data_source + +data_folder = os.path.join(DATA_SOURCE, 'images') +param_folder = os.path.join(DATA_SOURCE, 'params') +dataset = LandmarkDataset(data_folder=data_folder) +bfm = FVMModule(batch_size=len(dataset)).to(device) +camera = CameraModule(2048).to(device).eval() +recorder = CalibRecorder(data_folder=data_folder, param_folder=param_folder) + +calibrator = Calibrator(dataset, bfm, camera, recorder) +calibrator.calibrate() diff --git a/GHA/preprocess/lib/BFMModule.py b/GHA/preprocess/lib/BFMModule.py new file mode 100644 index 0000000000000000000000000000000000000000..d22da5408a661f492dc3fb86bfbf49653d50d147 --- /dev/null +++ b/GHA/preprocess/lib/BFMModule.py @@ -0,0 +1,74 @@ +import torch +import torch.nn as nn +import numpy as np +import pickle +from scipy.io import loadmat +from pytorch3d.transforms import so3_exponential_map + + +class BFMModule(nn.Module): + def __init__(self, batch_size): + super(BFMModule, self).__init__() + + self.id_dims = 80 + self.exp_dims = 64 + + model_dict = loadmat('assets/BFM/BFM09_model_info.mat') + self.register_buffer('skinmask', torch.tensor(model_dict['skinmask'])) + kp_inds = torch.tensor(model_dict['keypoints']-1).squeeze().long() + #kp_inds = torch.cat([kp_inds[0:48], kp_inds[49:54], kp_inds[55:68]]) + self.register_buffer('kp_inds', kp_inds) + self.register_buffer('meanshape', torch.tensor(model_dict['meanshape']).float()) + self.register_buffer('idBase', torch.tensor(model_dict['idBase']).float()) + self.register_buffer('expBase', torch.tensor(model_dict['exBase']).float()) + self.register_buffer('faces', torch.tensor(model_dict['tri']-1).long()) + + self.batch_size = batch_size + self.id_coeff = nn.Parameter(torch.zeros(1, self.id_dims).float()) + self.exp_coeff = nn.Parameter(torch.zeros(self.batch_size, self.exp_dims).float()) + self.scale = nn.Parameter(torch.ones(1).float() * 0.15) + self.pose = nn.Parameter(torch.zeros(self.batch_size, 6).float()) + + def get_lms(self, vs): + lms = vs[:, self.kp_inds, :] + return lms + + def get_vs(self, id_coeff, exp_coeff): + n_b = id_coeff.size(0) + + face_shape = torch.einsum('ij,aj->ai', self.idBase, id_coeff) + \ + torch.einsum('ij,aj->ai', self.expBase, exp_coeff) + self.meanshape + + face_shape = face_shape.view(n_b, -1, 3) + face_shape = face_shape - \ + self.meanshape.view(1, -1, 3).mean(dim=1, keepdim=True) + + return face_shape + + def forward(self): + id_coeff = self.id_coeff.repeat(self.batch_size, 1) + vertices = self.get_vs(id_coeff, self.exp_coeff) + R = so3_exponential_map(self.pose[:, :3]) + T = self.pose[:, 3:] + vertices = torch.bmm(vertices * self.scale, R.permute(0,2,1)) + T[:, None, :] + landmarks = self.get_lms(vertices) + return vertices, landmarks + + def reg_loss(self, id_weight, exp_weight): + id_reg_loss = (self.id_coeff ** 2).sum() + exp_reg_loss = (self.exp_coeff ** 2).sum(-1).mean() + return id_reg_loss * id_weight + exp_reg_loss * exp_weight + + def save(self, path, batch_id=-1): + if batch_id < 0: + id_coeff = self.id_coeff.detach().cpu().numpy() + exp_coeff = self.exp_coeff.detach().cpu().numpy() + scale = self.scale.detach().cpu().numpy() + pose = self.pose.detach().cpu().numpy() + np.savez(path, id_coeff=id_coeff, exp_coeff=exp_coeff, scale=scale, pose=pose) + else: + id_coeff = self.id_coeff.detach().cpu().numpy() + exp_coeff = self.exp_coeff[batch_id:batch_id+1].detach().cpu().numpy() + scale = self.scale.detach().cpu().numpy() + pose = self.pose[batch_id:batch_id+1].detach().cpu().numpy() + np.savez(path, id_coeff=id_coeff, exp_coeff=exp_coeff, scale=scale, pose=pose) \ No newline at end of file diff --git a/GHA/preprocess/lib/CalibRecorder.py b/GHA/preprocess/lib/CalibRecorder.py new file mode 100644 index 0000000000000000000000000000000000000000..ef9e0220941c28bf7819f5fa2ce9538057beca6b --- /dev/null +++ b/GHA/preprocess/lib/CalibRecorder.py @@ -0,0 +1,63 @@ +import torch +import numpy as np +import os +import cv2 +import glob +import trimesh +import pyrender +from PIL import Image + +from lib.Renderer import Renderer_pyr + + +def get_cam_ssns(dataset_fpath): + cam_ssns = [] # sorted according to their spatial position + with open(os.path.join(dataset_fpath, 'cam_ssns.txt'), 'r') as fp: + lns = fp.readlines() + for ln in lns: + ln = ln.strip().split(' ') + if len(ln) > 0: + cam_ssns.append(ln[0]) + return cam_ssns + + +class CalibRecorder(): + def __init__(self, data_folder, param_folder): + self.data_folder = data_folder + self.camera_ids = ['01', '02', '04', '05'] + self.param_folder = param_folder + os.makedirs(self.param_folder, exist_ok=True) + # self.camera_ids = ['220700191', '221501007', '222200036', '222200037', '222200038', '222200039', '222200040', '222200041', + # '222200042', '222200043', '222200044', '222200045', '222200046', '222200047', '222200048', '222200049'] + + def log(self, log_data): + eids = log_data['eids'] + landmarks_gt = log_data['landmarks_gt'] + landmarks_2d = log_data['landmarks_2d'] + bfm = log_data['bfm'] + intrinsics = log_data['intrinsics'] + extrinsics = log_data['extrinsics'] + + with torch.no_grad(): + vertices0, landmarks0 = log_data['bfm']() + # landmarks = torch.cat([landmarks0, vertices0[:, ::100, :]], 1) + + for n, eid in enumerate(eids): + os.makedirs(os.path.join(self.param_folder, eid), exist_ok=True) + bfm.save('%s/params.npz' % (os.path.join(self.param_folder, eid)), batch_id=n) + np.save('%s/lmk_3d.npy' % (os.path.join(self.param_folder, eid)), landmarks0[n].cpu().numpy()) + np.save('%s/vertices.npy' % (os.path.join(self.param_folder, eid)), vertices0[n].cpu().numpy()) + # np.save('%s/keypoints_face.npy' % (os.path.join(self.param_folder, eid)), landmarks[n].cpu().numpy()) + + + # for v in range(0, 1): + # vertices = vertices0[n].cpu().numpy() + # faces = log_data['bfm'].faces.cpu().numpy() + # mesh_trimesh = trimesh.Trimesh(vertices=vertices, faces=faces) + # mesh = pyrender.Mesh.from_trimesh(mesh_trimesh) + + # renderer = Renderer_pyr(intrinsic=intrinsics[n, v], extrinsic=extrinsics[n, v]) + # render_image = renderer.render(mesh) + + # cv2.imwrite('%s/vis_%d.jpg' % (os.path.join(self.param_folder, eid), v+1), render_image[:,:,::-1]) + \ No newline at end of file diff --git a/GHA/preprocess/lib/Calibrator.py b/GHA/preprocess/lib/Calibrator.py new file mode 100644 index 0000000000000000000000000000000000000000..97579bc216cc8c9f1d986840da7fe08de797f8a6 --- /dev/null +++ b/GHA/preprocess/lib/Calibrator.py @@ -0,0 +1,191 @@ +import torch +import numpy as np +from einops import rearrange + + +class Calibrator(): + def __init__(self, dataset, bfm, camera, recorder): + self.dataset = dataset + self.bfm = bfm + self.camera = camera + self.recorder = recorder + self.device = torch.device('cuda:0') + + self.optimizer1 = torch.optim.Adam([{'params' : self.bfm.parameters(), 'lr' : 1e-2}]) + self.optimizer2 = torch.optim.Adam([{'params' : self.bfm.parameters(), 'lr' : 1e-3}]) + + def calibrate(self): + landmarks_gt, extrinsics0, intrinsics0, eids = self.dataset.get_item() + landmarks_gt = torch.from_numpy(landmarks_gt).float().to(self.device) + extrinsics0 = torch.from_numpy(extrinsics0).float().to(self.device) + intrinsics0 = torch.from_numpy(intrinsics0).float().to(self.device) + extrinsics = rearrange(extrinsics0, 'b v x y -> (b v) x y') + intrinsics = rearrange(intrinsics0, 'b v x y -> (b v) x y') + + pprev_loss = 1e8 + prev_loss = 1e8 + + for i in range(100000000): + self.optimizer1.zero_grad() + + _, landmarks_3d = self.bfm() + landmarks_3d = landmarks_3d.unsqueeze(1).repeat(1, landmarks_gt.shape[1], 1, 1) + landmarks_3d = rearrange(landmarks_3d, 'b v x y -> (b v) x y') + + landmarks_2d = self.project(landmarks_3d, intrinsics, extrinsics) + landmarks_2d = rearrange(landmarks_2d, '(b v) x y -> b v x y', b=landmarks_gt.shape[0]) + + pro_loss = (((landmarks_2d / self.camera.image_size - landmarks_gt[:, :, :, 0:2] / self.camera.image_size) * landmarks_gt[:, :, :, 2:3]) ** 2).sum(-1).sum(-2).mean() + reg_loss = self.bfm.reg_loss(5e-6, 1e-6) + loss = pro_loss + reg_loss + loss.backward() + self.optimizer1.step() + + if abs(loss.item() - prev_loss) < 1e-8 and abs(loss.item() - pprev_loss) < 1e-7: + if i % 100 == 0: + print(pro_loss.item(), reg_loss.item()) + break + else: + pprev_loss = prev_loss + prev_loss = loss.item() + if i % 100 == 0: + print(pro_loss.item(), reg_loss.item()) + + + for i in range(100000000): + self.optimizer2.zero_grad() + + + _, landmarks_3d = self.bfm() + landmarks_3d = landmarks_3d.unsqueeze(1).repeat(1, landmarks_gt.shape[1], 1, 1) + landmarks_3d = rearrange(landmarks_3d, 'b v x y -> (b v) x y') + + landmarks_2d = self.project(landmarks_3d, intrinsics, extrinsics) + landmarks_2d = rearrange(landmarks_2d, '(b v) x y -> b v x y', b=landmarks_gt.shape[0]) + + pro_loss = (((landmarks_2d / self.camera.image_size - landmarks_gt[:, :, :, 0:2] / self.camera.image_size) * landmarks_gt[:, :, :, 2:3]) ** 2).sum(-1).sum(-2).mean() + reg_loss = self.bfm.reg_loss(5e-6, 1e-6) + loss = pro_loss + reg_loss + loss.backward() + self.optimizer2.step() + + if abs(loss.item() - prev_loss) < 1e-11 and abs(loss.item() - pprev_loss) < 1e-10: + if i % 100 == 0: + print(pro_loss.item(), reg_loss.item()) + break + else: + pprev_loss = prev_loss + prev_loss = loss.item() + if i % 100 == 0: + print(pro_loss.item(), reg_loss.item()) + + log = { + 'eids': eids, + 'landmarks_gt': landmarks_gt, + 'landmarks_2d': landmarks_2d.detach(), + 'bfm': self.bfm, + 'intrinsics': intrinsics0, + 'extrinsics': extrinsics0 + } + self.recorder.log(log) + + + def project(self, points_3d, intrinsic, extrinsic): + points_3d = points_3d.permute(0,2,1) + calibrations = torch.bmm(intrinsic, extrinsic) + points_2d = self.camera.perspective(points_3d, calibrations) + points_2d = points_2d.permute(0,2,1) + return points_2d + + +class CalibratorSingleView(): + def __init__(self, dataset, bfm, camera, recorder): + self.dataset = dataset + self.bfm = bfm + self.camera = camera + self.recorder = recorder + self.device = torch.device('cuda:0') + + self.optimizer1 = torch.optim.Adam([{'params' : self.bfm.parameters(), 'lr' : 1e-2}]) + self.optimizer2 = torch.optim.Adam([{'params' : self.bfm.parameters(), 'lr' : 1e-3}]) + + def calibrate(self): + landmarks_gt, extrinsics0, intrinsics0, eids = self.dataset.get_item() + landmarks_gt = torch.from_numpy(landmarks_gt).float().to(self.device) + extrinsics0 = torch.from_numpy(extrinsics0).float().to(self.device) + intrinsics0 = torch.from_numpy(intrinsics0).float().to(self.device) + extrinsics = rearrange(extrinsics0, 'b v x y -> (b v) x y') + intrinsics = rearrange(intrinsics0, 'b v x y -> (b v) x y') + + pprev_loss = 1e8 + prev_loss = 1e8 + + for i in range(3000): + self.optimizer1.zero_grad() + + _, landmarks_3d = self.bfm() + landmarks_3d = landmarks_3d.unsqueeze(1).repeat(1, landmarks_gt.shape[1], 1, 1) + landmarks_3d = rearrange(landmarks_3d, 'b v x y -> (b v) x y') + + landmarks_2d = self.project(landmarks_3d, intrinsics, extrinsics) + landmarks_2d = rearrange(landmarks_2d, '(b v) x y -> b v x y', b=landmarks_gt.shape[0]) + + pro_loss = (((landmarks_2d / self.camera.image_size - landmarks_gt[:, :, :, 0:2] / self.camera.image_size) * landmarks_gt[:, :, :, 2:3]) ** 2).sum(-1).sum(-2).mean() + reg_loss = self.bfm.reg_loss(5e-6, 1e-6) + loss = pro_loss + reg_loss + loss.backward() + self.optimizer1.step() + + if False: #abs(loss.item() - prev_loss) < 1e-8 and abs(loss.item() - pprev_loss) < 1e-7: + print(prev_loss, 'optimization ends') + break + else: + pprev_loss = prev_loss + prev_loss = loss.item() + if i % 100 == 0: + print(i, prev_loss) + + + for i in range(1000): + self.optimizer2.zero_grad() + + + _, landmarks_3d = self.bfm() + landmarks_3d = landmarks_3d.unsqueeze(1).repeat(1, landmarks_gt.shape[1], 1, 1) + landmarks_3d = rearrange(landmarks_3d, 'b v x y -> (b v) x y') + + landmarks_2d = self.project(landmarks_3d, intrinsics, extrinsics) + landmarks_2d = rearrange(landmarks_2d, '(b v) x y -> b v x y', b=landmarks_gt.shape[0]) + + pro_loss = (((landmarks_2d / self.camera.image_size - landmarks_gt[:, :, :, 0:2] / self.camera.image_size) * landmarks_gt[:, :, :, 2:3]) ** 2).sum(-1).sum(-2).mean() + reg_loss = self.bfm.reg_loss(5e-6, 1e-6) + self.bfm.temporal_smooth_loss(3e-5) + loss = pro_loss + reg_loss + loss.backward() + self.optimizer2.step() + + if False: #abs(loss.item() - prev_loss) < 1e-11 and abs(loss.item() - pprev_loss) < 1e-10: + print(prev_loss, 'optimization ends') + break + else: + pprev_loss = prev_loss + prev_loss = loss.item() + if i % 100 == 0: + print(i, prev_loss) + + log = { + 'eids': eids, + 'landmarks_gt': landmarks_gt, + 'landmarks_2d': landmarks_2d.detach(), + 'bfm': self.bfm, + 'intrinsics': intrinsics0, + 'extrinsics': extrinsics0 + } + self.recorder.log(log) + + + def project(self, points_3d, intrinsic, extrinsic): + points_3d = points_3d.permute(0,2,1) + calibrations = torch.bmm(intrinsic, extrinsic) + points_2d = self.camera.perspective(points_3d, calibrations) + points_2d = points_2d.permute(0,2,1) + return points_2d diff --git a/GHA/preprocess/lib/CameraModule.py b/GHA/preprocess/lib/CameraModule.py new file mode 100644 index 0000000000000000000000000000000000000000..c71f16af9a9214e4e2c376e0736758386b722eb1 --- /dev/null +++ b/GHA/preprocess/lib/CameraModule.py @@ -0,0 +1,15 @@ +import torch +import torch.nn as nn + + +class CameraModule(nn.Module): + def __init__(self, image_size): + super(CameraModule, self).__init__() + self.image_size = image_size + + def perspective(self, query_pts, calibrations): + query_pts = torch.bmm(calibrations[:, :3, :3], query_pts) + query_pts = query_pts + calibrations[:, :3, 3:4] + query_pts_xy = query_pts[:, :2, :] / query_pts[:, 2:, :] + query_pts_xy = query_pts_xy + return query_pts_xy \ No newline at end of file diff --git a/GHA/preprocess/lib/FVMModule.py b/GHA/preprocess/lib/FVMModule.py new file mode 100644 index 0000000000000000000000000000000000000000..d872daa028593d89ee572350ca70588863ba7c84 --- /dev/null +++ b/GHA/preprocess/lib/FVMModule.py @@ -0,0 +1,94 @@ +import torch +import torch.nn as nn +import numpy as np +import pickle +from scipy.io import loadmat +from pytorch3d.transforms import so3_exponential_map + + +class FVMModule(nn.Module): + def __init__(self, batch_size): + super(FVMModule, self).__init__() + + self.id_dims = 150 + self.exp_dims = 52 + + # a = loadmat('assets/BFM/BFM09_model_info.mat') + model_dict = np.load('assets/FVM/faceverse_simple_v2.npy', allow_pickle=True).item() + self.register_buffer('skinmask', torch.tensor(model_dict['skinmask'])) + kp_inds = torch.tensor(model_dict['keypoints']).squeeze().long() + #kp_inds = torch.cat([kp_inds[0:48], kp_inds[49:54], kp_inds[55:68]]) + self.register_buffer('kp_inds', kp_inds) + + meanshape = torch.tensor(model_dict['meanshape']) + meanshape[:, 1:] = -meanshape[:, 1:] + self.register_buffer('meanshape', meanshape.view(1, -1).float()) + + idBase = torch.tensor(model_dict['idBase']).view(-1, 3, self.id_dims).float() + idBase[:, 1:, :] = -idBase[:, 1:, :] + self.register_buffer('idBase', idBase.view(-1, self.id_dims)) + + exBase = torch.tensor(model_dict['exBase']).view(-1, 3, self.exp_dims).float() + exBase[:, 1:, :] = -exBase[:, 1:, :] + self.register_buffer('exBase', exBase.view(-1, self.exp_dims)) + + self.register_buffer('faces', torch.tensor(model_dict['tri']).long()) + + self.batch_size = batch_size + self.id_coeff = nn.Parameter(torch.zeros(1, self.id_dims).float()) + self.exp_coeff = nn.Parameter(torch.zeros(self.batch_size, self.exp_dims).float()) + self.scale = nn.Parameter(torch.ones(1).float() * 0.3) + self.pose = nn.Parameter(torch.zeros(self.batch_size, 6).float()) + + def set_id_param(self, id_coeff, scale): + self.id_coeff.data = id_coeff + self.scale.data = scale + self.id_coeff.requires_grad = False + self.scale.requires_grad = False + + def get_lms(self, vs): + lms = vs[:, self.kp_inds, :] + return lms + + def get_vs(self, id_coeff, exp_coeff): + n_b = id_coeff.size(0) + + face_shape = torch.einsum('ij,aj->ai', self.idBase, id_coeff) + \ + torch.einsum('ij,aj->ai', self.exBase, exp_coeff) + self.meanshape + + face_shape = face_shape.view(n_b, -1, 3) + face_shape = face_shape - \ + self.meanshape.view(1, -1, 3).mean(dim=1, keepdim=True) + + return face_shape + + def forward(self): + id_coeff = self.id_coeff.repeat(self.batch_size, 1) + vertices = self.get_vs(id_coeff, self.exp_coeff) + R = so3_exponential_map(self.pose[:, :3]) + T = self.pose[:, 3:] + vertices = torch.bmm(vertices * self.scale, R.permute(0,2,1)) + T[:, None, :] + landmarks = self.get_lms(vertices) + return vertices, landmarks + + def reg_loss(self, id_weight, exp_weight): + id_reg_loss = (self.id_coeff ** 2).sum() + exp_reg_loss = (self.exp_coeff ** 2).sum(-1).mean() + return id_reg_loss * id_weight + exp_reg_loss * exp_weight + + def temporal_smooth_loss(self, smo_weight): + return ((self.exp_coeff[1:] - self.exp_coeff[:-1]) ** 2).sum(-1).mean() * smo_weight + + def save(self, path, batch_id=-1): + if batch_id < 0: + id_coeff = self.id_coeff.detach().cpu().numpy() + exp_coeff = self.exp_coeff.detach().cpu().numpy() + scale = self.scale.detach().cpu().numpy() + pose = self.pose.detach().cpu().numpy() + np.savez(path, id_coeff=id_coeff, exp_coeff=exp_coeff, scale=scale, pose=pose) + else: + id_coeff = self.id_coeff.detach().cpu().numpy() + exp_coeff = self.exp_coeff[batch_id:batch_id+1].detach().cpu().numpy() + scale = self.scale.detach().cpu().numpy() + pose = self.pose[batch_id:batch_id+1].detach().cpu().numpy() + np.savez(path, id_coeff=id_coeff, exp_coeff=exp_coeff, scale=scale, pose=pose) \ No newline at end of file diff --git a/GHA/preprocess/lib/LandmarkDataset.py b/GHA/preprocess/lib/LandmarkDataset.py new file mode 100644 index 0000000000000000000000000000000000000000..a151df471c353897c4038604aae31892eb92babd --- /dev/null +++ b/GHA/preprocess/lib/LandmarkDataset.py @@ -0,0 +1,56 @@ +import torch +import torchvision as tv +import numpy as np +import glob +import os +import random +import cv2 +from skimage import io +from torch.utils.data import Dataset + + +class LandmarkDataset(Dataset): + def __init__(self, data_folder): + super(LandmarkDataset, self).__init__() + + self.eids = sorted(os.listdir(data_folder)) + self.images_folders = [os.path.join(data_folder, eid) for eid in self.eids] + self.camera_ids = ['01', '02', '04', '05'] + + def get_item(self): + landmarks = [] + extrinsics = [] + intrinsics = [] + for images_folder in self.images_folders: + landmarks_ = [] + extrinsics_ = [] + intrinsics_ = [] + for v in range(len(self.camera_ids)): + if os.path.exists(images_folder + '/landmarks_%s.npy' % self.camera_ids[v]): + landmark = np.load(images_folder + '/landmarks_%s.npy' % self.camera_ids[v]) + landmark = np.vstack([landmark[0:48], landmark[49:54], landmark[55:68]]) + extrinsic = np.load(images_folder + '/camera_%s.npz' % self.camera_ids[v])['extrinsic'] + intrinsic = np.load(images_folder + '/camera_%s.npz' % self.camera_ids[v])['intrinsic'] + else: + landmark = np.zeros([68, 3], dtype=np.float32) + extrinsic = np.ones([3, 4], dtype=np.float32) + intrinsic = np.ones([3, 3], dtype=np.float32) + landmarks_.append(landmark) + extrinsics_.append(extrinsic) + intrinsics_.append(intrinsic) + landmarks_ = np.stack(landmarks_) + extrinsics_ = np.stack(extrinsics_) + intrinsics_ = np.stack(intrinsics_) + landmarks.append(landmarks_) + extrinsics.append(extrinsics_) + intrinsics.append(intrinsics_) + landmarks = np.stack(landmarks) + extrinsics = np.stack(extrinsics) + intrinsics = np.stack(intrinsics) + + return landmarks, extrinsics, intrinsics, self.eids + + def __len__(self): + return len(self.images_folders) + + \ No newline at end of file diff --git a/GHA/preprocess/lib/MultiviewDataset.py b/GHA/preprocess/lib/MultiviewDataset.py new file mode 100644 index 0000000000000000000000000000000000000000..bc01b331d928a297ca3330aa61175e0d62351af2 --- /dev/null +++ b/GHA/preprocess/lib/MultiviewDataset.py @@ -0,0 +1,39 @@ +import torch +import torchvision as tv +import numpy as np +import glob +import os +import random +from torch.utils.data import Dataset + + +class MultiviewDataset(Dataset): + + def __init__(self, data_folder, image_size, num_view): + super(MultiviewDataset, self).__init__() + + self.image_size = image_size + self.num_view = num_view + self.loader = tv.datasets.folder.default_loader + self.transform = tv.transforms.Compose([tv.transforms.Resize(self.image_size), tv.transforms.ToTensor()]) + + self.folders = sorted(glob.glob(os.path.join(data_folder, '*'))) + self.camera_ids = ['220700191', '221501007', '222200036', '222200037', '222200038', '222200039', '222200040', '222200041', + '222200042', '222200043', '222200044', '222200045', '222200046', '222200047', '222200048', '222200049'] + + def get_item(self, index): + data = self.__getitem__(index) + return data + + def __getitem__(self, index): + images = torch.stack([self.transform(self.loader(self.folders[index] + '/image_%s.jpg' % self.camera_ids[v])) for v in range(self.num_view)]) + intrinsics = torch.stack([torch.from_numpy(np.load(self.folders[index] + '/camera_%s.npz' % self.camera_ids[v])['intrinsic']) for v in range(self.num_view)]).float() + extrinsics = torch.stack([torch.from_numpy(np.load(self.folders[index] + '/camera_%s.npz' % self.camera_ids[v])['extrinsic']) for v in range(self.num_view)]).float() + + return {'images': images, + 'intrinsics': intrinsics, + 'extrinsics': extrinsics, + 'exp_id': int(self.folders[index][-4:])} + + def __len__(self): + return len(self.folders) diff --git a/GHA/preprocess/lib/Renderer.py b/GHA/preprocess/lib/Renderer.py new file mode 100644 index 0000000000000000000000000000000000000000..c67458705633eb5de1e4cc10a63ecbdc73c563c1 --- /dev/null +++ b/GHA/preprocess/lib/Renderer.py @@ -0,0 +1,85 @@ +import torch +import numpy as np +import pyrender +import cv2 +from pytorch3d.renderer import look_at_view_transform + +def Rotate_y_180(X, pos='right'): + R = torch.eye(3).to(X.device) + R[0,0] = -1.0 + R[2,2] = -1.0 + if pos == 'right': + X = torch.matmul(X, R) + else: + X = torch.matmul(R, X) + return X + +def Rotate_z_180(X, pos='right'): + R = torch.eye(3).to(X.device) + R[0,0] = -1.0 + R[1,1] = -1.0 + if pos == 'right': + X = torch.matmul(X, R) + else: + X = torch.matmul(R, X) + return X + +class Renderer_pyr(): + def __init__(self, intrinsic, extrinsic, image_size=2048): + self.name = 'pyrender' + self.image_size = image_size + + self.R = extrinsic[0:3, 0:3] + self.T = extrinsic[0:3, 3:4] + self.K = intrinsic + + R_pyrender = Rotate_y_180(torch.inverse(self.R), 'right').float() + T_pyrender = -torch.matmul(torch.inverse(self.R), self.T)[:,0].float() + + self.camera = pyrender.IntrinsicsCamera(self.K[0,0], self.K[1,1], self.image_size - self.K[0,2], self.image_size - self.K[1,2]) + self.camera_pose = np.eye(4) + self.camera_pose[0:3,0:3] = R_pyrender.cpu().numpy() + self.camera_pose[0:3,3] = T_pyrender.cpu().numpy() + + self.lights = [] + light = pyrender.PointLight(color=[1.0, 1.0, 1.0], intensity=100.0) + light_pose1 = np.array([[1.0, 0.0, 0.0, -3.0], + [0.0, 1.0, 0.0, -3.0], + [0.0, 0.0, 1.0, -1.0], + [0.0, 0.0, 0.0, 1.0],]) + light_pose2 = np.array([[1.0, 0.0, 0.0, 0.0], + [0.0, 1.0, 0.0, -6.0], + [0.0, 0.0, 1.0, -1.0], + [0.0, 0.0, 0.0, 1.0],]) + light_pose3 = np.array([[1.0, 0.0, 0.0, 3.0], + [0.0, 1.0, 0.0, 3.0], + [0.0, 0.0, 1.0, -1.0], + [0.0, 0.0, 0.0, 1.0],]) + light_pose4 = np.array([[1.0, 0.0, 0.0, 0.0], + [0.0, 1.0, 0.0, 1.0], + [0.0, 0.0, 1.0, -5.0], + [0.0, 0.0, 0.0, 1.0],]) + self.lights.append((light, light_pose1)) + self.lights.append((light, light_pose2)) + self.lights.append((light, light_pose3)) + self.lights.append((light, light_pose4)) + + def render(self, mesh, return_mask=False): + scene = pyrender.Scene(ambient_light=[0.1, 0.1, 0.1], bg_color=[0.0, 0.0, 0.0]) + scene.add(mesh) + for light in self.lights: + scene.add(light[0], pose=light[1]) + scene.add(self.camera, pose=self.camera_pose) + osr = pyrender.OffscreenRenderer(self.image_size, self.image_size) + color, depth = osr.render(scene) + color = cv2.flip(color, -1) + depth = cv2.flip(depth, -1) + if return_mask: + return color, (depth > 0).astype(np.uint8) * 255 + else: + return color + + def save(self, path): + intrinsic = self.K.numpy() + extrinsic = np.hstack((self.R.numpy(), self.T.numpy())) + np.savez(path, intrinsic=intrinsic, extrinsic=extrinsic) \ No newline at end of file diff --git a/GHA/preprocess/lib/rotation_conversion.py b/GHA/preprocess/lib/rotation_conversion.py new file mode 100644 index 0000000000000000000000000000000000000000..45b8dac8b17bceda64660123d4a0993283be98ea --- /dev/null +++ b/GHA/preprocess/lib/rotation_conversion.py @@ -0,0 +1,586 @@ +# Copyright (c) Facebook, Inc. and its affiliates. +# All rights reserved. +# +# This source code is licensed under the BSD-style license found in the +# LICENSE file in the root directory of this source tree. + +from typing import Optional, Union + +import torch +import torch.nn.functional as F + +Device = Union[str, torch.device] + +""" +The transformation matrices returned from the functions in this file assume +the points on which the transformation will be applied are column vectors. +i.e. the R matrix is structured as + + R = [ + [Rxx, Rxy, Rxz], + [Ryx, Ryy, Ryz], + [Rzx, Rzy, Rzz], + ] # (3, 3) + +This matrix can be applied to column vectors by post multiplication +by the points e.g. + + points = [[0], [1], [2]] # (3 x 1) xyz coordinates of a point + transformed_points = R * points + +To apply the same matrix to points which are row vectors, the R matrix +can be transposed and pre multiplied by the points: + +e.g. + points = [[0, 1, 2]] # (1 x 3) xyz coordinates of a point + transformed_points = points * R.transpose(1, 0) +""" + + +def quaternion_to_matrix(quaternions: torch.Tensor) -> torch.Tensor: + """ + Convert rotations given as quaternions to rotation matrices. + + Args: + quaternions: quaternions with real part first, + as tensor of shape (..., 4). + + Returns: + Rotation matrices as tensor of shape (..., 3, 3). + """ + r, i, j, k = torch.unbind(quaternions, -1) + two_s = 2.0 / (quaternions * quaternions).sum(-1) + + o = torch.stack( + ( + 1 - two_s * (j * j + k * k), + two_s * (i * j - k * r), + two_s * (i * k + j * r), + two_s * (i * j + k * r), + 1 - two_s * (i * i + k * k), + two_s * (j * k - i * r), + two_s * (i * k - j * r), + two_s * (j * k + i * r), + 1 - two_s * (i * i + j * j), + ), + -1, + ) + return o.reshape(quaternions.shape[:-1] + (3, 3)) + + +def _copysign(a: torch.Tensor, b: torch.Tensor) -> torch.Tensor: + """ + Return a tensor where each element has the absolute value taken from the, + corresponding element of a, with sign taken from the corresponding + element of b. This is like the standard copysign floating-point operation, + but is not careful about negative 0 and NaN. + + Args: + a: source tensor. + b: tensor whose signs will be used, of the same shape as a. + + Returns: + Tensor of the same shape as a with the signs of b. + """ + signs_differ = (a < 0) != (b < 0) + return torch.where(signs_differ, -a, a) + + +def _sqrt_positive_part(x: torch.Tensor) -> torch.Tensor: + """ + Returns torch.sqrt(torch.max(0, x)) + but with a zero subgradient where x is 0. + """ + ret = torch.zeros_like(x) + positive_mask = x > 0 + ret[positive_mask] = torch.sqrt(x[positive_mask]) + return ret + + +def matrix_to_quaternion(matrix: torch.Tensor) -> torch.Tensor: + """ + Convert rotations given as rotation matrices to quaternions. + + Args: + matrix: Rotation matrices as tensor of shape (..., 3, 3). + + Returns: + quaternions with real part first, as tensor of shape (..., 4). + """ + if matrix.size(-1) != 3 or matrix.size(-2) != 3: + raise ValueError(f"Invalid rotation matrix shape {matrix.shape}.") + + batch_dim = matrix.shape[:-2] + m00, m01, m02, m10, m11, m12, m20, m21, m22 = torch.unbind( + matrix.reshape(batch_dim + (9,)), dim=-1 + ) + + q_abs = _sqrt_positive_part( + torch.stack( + [ + 1.0 + m00 + m11 + m22, + 1.0 + m00 - m11 - m22, + 1.0 - m00 + m11 - m22, + 1.0 - m00 - m11 + m22, + ], + dim=-1, + ) + ) + + # we produce the desired quaternion multiplied by each of r, i, j, k + quat_by_rijk = torch.stack( + [ + torch.stack([q_abs[..., 0] ** 2, m21 - m12, m02 - m20, m10 - m01], dim=-1), + torch.stack([m21 - m12, q_abs[..., 1] ** 2, m10 + m01, m02 + m20], dim=-1), + torch.stack([m02 - m20, m10 + m01, q_abs[..., 2] ** 2, m12 + m21], dim=-1), + torch.stack([m10 - m01, m20 + m02, m21 + m12, q_abs[..., 3] ** 2], dim=-1), + ], + dim=-2, + ) + + # We floor here at 0.1 but the exact level is not important; if q_abs is small, + # the candidate won't be picked. + flr = torch.tensor(0.1).to(dtype=q_abs.dtype, device=q_abs.device) + quat_candidates = quat_by_rijk / (2.0 * q_abs[..., None].max(flr)) + + # if not for numerical problems, quat_candidates[i] should be same (up to a sign), + # forall i; we pick the best-conditioned one (with the largest denominator) + + return quat_candidates[ + F.one_hot(q_abs.argmax(dim=-1), num_classes=4) > 0.5, : # pyre-ignore[16] + ].reshape(batch_dim + (4,)) + + +def _axis_angle_rotation(axis: str, angle: torch.Tensor) -> torch.Tensor: + """ + Return the rotation matrices for one of the rotations about an axis + of which Euler angles describe, for each value of the angle given. + + Args: + axis: Axis label "X" or "Y or "Z". + angle: any shape tensor of Euler angles in radians + + Returns: + Rotation matrices as tensor of shape (..., 3, 3). + """ + + cos = torch.cos(angle) + sin = torch.sin(angle) + one = torch.ones_like(angle) + zero = torch.zeros_like(angle) + + if axis == "X": + R_flat = (one, zero, zero, zero, cos, -sin, zero, sin, cos) + elif axis == "Y": + R_flat = (cos, zero, sin, zero, one, zero, -sin, zero, cos) + elif axis == "Z": + R_flat = (cos, -sin, zero, sin, cos, zero, zero, zero, one) + else: + raise ValueError("letter must be either X, Y or Z.") + + return torch.stack(R_flat, -1).reshape(angle.shape + (3, 3)) + + +def euler_angles_to_matrix(euler_angles: torch.Tensor, convention: str) -> torch.Tensor: + """ + Convert rotations given as Euler angles in radians to rotation matrices. + + Args: + euler_angles: Euler angles in radians as tensor of shape (..., 3). + convention: Convention string of three uppercase letters from + {"X", "Y", and "Z"}. + + Returns: + Rotation matrices as tensor of shape (..., 3, 3). + """ + if euler_angles.dim() == 0 or euler_angles.shape[-1] != 3: + raise ValueError("Invalid input euler angles.") + if len(convention) != 3: + raise ValueError("Convention must have 3 letters.") + if convention[1] in (convention[0], convention[2]): + raise ValueError(f"Invalid convention {convention}.") + for letter in convention: + if letter not in ("X", "Y", "Z"): + raise ValueError(f"Invalid letter {letter} in convention string.") + matrices = [ + _axis_angle_rotation(c, e) + for c, e in zip(convention, torch.unbind(euler_angles, -1)) + ] + # return functools.reduce(torch.matmul, matrices) + return torch.matmul(torch.matmul(matrices[0], matrices[1]), matrices[2]) + + +def _angle_from_tan( + axis: str, other_axis: str, data, horizontal: bool, tait_bryan: bool +) -> torch.Tensor: + """ + Extract the first or third Euler angle from the two members of + the matrix which are positive constant times its sine and cosine. + + Args: + axis: Axis label "X" or "Y or "Z" for the angle we are finding. + other_axis: Axis label "X" or "Y or "Z" for the middle axis in the + convention. + data: Rotation matrices as tensor of shape (..., 3, 3). + horizontal: Whether we are looking for the angle for the third axis, + which means the relevant entries are in the same row of the + rotation matrix. If not, they are in the same column. + tait_bryan: Whether the first and third axes in the convention differ. + + Returns: + Euler Angles in radians for each matrix in data as a tensor + of shape (...). + """ + + i1, i2 = {"X": (2, 1), "Y": (0, 2), "Z": (1, 0)}[axis] + if horizontal: + i2, i1 = i1, i2 + even = (axis + other_axis) in ["XY", "YZ", "ZX"] + if horizontal == even: + return torch.atan2(data[..., i1], data[..., i2]) + if tait_bryan: + return torch.atan2(-data[..., i2], data[..., i1]) + return torch.atan2(data[..., i2], -data[..., i1]) + + +def _index_from_letter(letter: str) -> int: + if letter == "X": + return 0 + if letter == "Y": + return 1 + if letter == "Z": + return 2 + raise ValueError("letter must be either X, Y or Z.") + + +def matrix_to_euler_angles(matrix: torch.Tensor, convention: str) -> torch.Tensor: + """ + Convert rotations given as rotation matrices to Euler angles in radians. + + Args: + matrix: Rotation matrices as tensor of shape (..., 3, 3). + convention: Convention string of three uppercase letters. + + Returns: + Euler angles in radians as tensor of shape (..., 3). + """ + if len(convention) != 3: + raise ValueError("Convention must have 3 letters.") + if convention[1] in (convention[0], convention[2]): + raise ValueError(f"Invalid convention {convention}.") + for letter in convention: + if letter not in ("X", "Y", "Z"): + raise ValueError(f"Invalid letter {letter} in convention string.") + if matrix.size(-1) != 3 or matrix.size(-2) != 3: + raise ValueError(f"Invalid rotation matrix shape {matrix.shape}.") + i0 = _index_from_letter(convention[0]) + i2 = _index_from_letter(convention[2]) + tait_bryan = i0 != i2 + if tait_bryan: + central_angle = torch.asin( + matrix[..., i0, i2] * (-1.0 if i0 - i2 in [-1, 2] else 1.0) + ) + else: + central_angle = torch.acos(matrix[..., i0, i0]) + + o = ( + _angle_from_tan( + convention[0], convention[1], matrix[..., i2], False, tait_bryan + ), + central_angle, + _angle_from_tan( + convention[2], convention[1], matrix[..., i0, :], True, tait_bryan + ), + ) + return torch.stack(o, -1) + + +def random_quaternions( + n: int, dtype: Optional[torch.dtype] = None, device: Optional[Device] = None +) -> torch.Tensor: + """ + Generate random quaternions representing rotations, + i.e. versors with nonnegative real part. + + Args: + n: Number of quaternions in a batch to return. + dtype: Type to return. + device: Desired device of returned tensor. Default: + uses the current device for the default tensor type. + + Returns: + Quaternions as tensor of shape (N, 4). + """ + if isinstance(device, str): + device = torch.device(device) + o = torch.randn((n, 4), dtype=dtype, device=device) + s = (o * o).sum(1) + o = o / _copysign(torch.sqrt(s), o[:, 0])[:, None] + return o + + +def random_rotations( + n: int, dtype: Optional[torch.dtype] = None, device: Optional[Device] = None +) -> torch.Tensor: + """ + Generate random rotations as 3x3 rotation matrices. + + Args: + n: Number of rotation matrices in a batch to return. + dtype: Type to return. + device: Device of returned tensor. Default: if None, + uses the current device for the default tensor type. + + Returns: + Rotation matrices as tensor of shape (n, 3, 3). + """ + quaternions = random_quaternions(n, dtype=dtype, device=device) + return quaternion_to_matrix(quaternions) + + +def random_rotation( + dtype: Optional[torch.dtype] = None, device: Optional[Device] = None +) -> torch.Tensor: + """ + Generate a single random 3x3 rotation matrix. + + Args: + dtype: Type to return + device: Device of returned tensor. Default: if None, + uses the current device for the default tensor type + + Returns: + Rotation matrix as tensor of shape (3, 3). + """ + return random_rotations(1, dtype, device)[0] + + +def standardize_quaternion(quaternions: torch.Tensor) -> torch.Tensor: + """ + Convert a unit quaternion to a standard form: one in which the real + part is non negative. + + Args: + quaternions: Quaternions with real part first, + as tensor of shape (..., 4). + + Returns: + Standardized quaternions as tensor of shape (..., 4). + """ + return torch.where(quaternions[..., 0:1] < 0, -quaternions, quaternions) + + +def quaternion_raw_multiply(a: torch.Tensor, b: torch.Tensor) -> torch.Tensor: + """ + Multiply two quaternions. + Usual torch rules for broadcasting apply. + + Args: + a: Quaternions as tensor of shape (..., 4), real part first. + b: Quaternions as tensor of shape (..., 4), real part first. + + Returns: + The product of a and b, a tensor of quaternions shape (..., 4). + """ + aw, ax, ay, az = torch.unbind(a, -1) + bw, bx, by, bz = torch.unbind(b, -1) + ow = aw * bw - ax * bx - ay * by - az * bz + ox = aw * bx + ax * bw + ay * bz - az * by + oy = aw * by - ax * bz + ay * bw + az * bx + oz = aw * bz + ax * by - ay * bx + az * bw + return torch.stack((ow, ox, oy, oz), -1) + + +def quaternion_multiply(a: torch.Tensor, b: torch.Tensor) -> torch.Tensor: + """ + Multiply two quaternions representing rotations, returning the quaternion + representing their composition, i.e. the versor with nonnegative real part. + Usual torch rules for broadcasting apply. + + Args: + a: Quaternions as tensor of shape (..., 4), real part first. + b: Quaternions as tensor of shape (..., 4), real part first. + + Returns: + The product of a and b, a tensor of quaternions of shape (..., 4). + """ + ab = quaternion_raw_multiply(a, b) + return standardize_quaternion(ab) + + +def quaternion_invert(quaternion: torch.Tensor) -> torch.Tensor: + """ + Given a quaternion representing rotation, get the quaternion representing + its inverse. + + Args: + quaternion: Quaternions as tensor of shape (..., 4), with real part + first, which must be versors (unit quaternions). + + Returns: + The inverse, a tensor of quaternions of shape (..., 4). + """ + + scaling = torch.tensor([1, -1, -1, -1], device=quaternion.device) + return quaternion * scaling + + +def quaternion_apply(quaternion: torch.Tensor, point: torch.Tensor) -> torch.Tensor: + """ + Apply the rotation given by a quaternion to a 3D point. + Usual torch rules for broadcasting apply. + + Args: + quaternion: Tensor of quaternions, real part first, of shape (..., 4). + point: Tensor of 3D points of shape (..., 3). + + Returns: + Tensor of rotated points of shape (..., 3). + """ + if point.size(-1) != 3: + raise ValueError(f"Points are not in 3D, {point.shape}.") + real_parts = point.new_zeros(point.shape[:-1] + (1,)) + point_as_quaternion = torch.cat((real_parts, point), -1) + out = quaternion_raw_multiply( + quaternion_raw_multiply(quaternion, point_as_quaternion), + quaternion_invert(quaternion), + ) + return out[..., 1:] + + +def axis_angle_to_matrix(axis_angle: torch.Tensor) -> torch.Tensor: + """ + Convert rotations given as axis/angle to rotation matrices. + + Args: + axis_angle: Rotations given as a vector in axis angle form, + as a tensor of shape (..., 3), where the magnitude is + the angle turned anticlockwise in radians around the + vector's direction. + + Returns: + Rotation matrices as tensor of shape (..., 3, 3). + """ + return quaternion_to_matrix(axis_angle_to_quaternion(axis_angle)) + + +def matrix_to_axis_angle(matrix: torch.Tensor) -> torch.Tensor: + """ + Convert rotations given as rotation matrices to axis/angle. + + Args: + matrix: Rotation matrices as tensor of shape (..., 3, 3). + + Returns: + Rotations given as a vector in axis angle form, as a tensor + of shape (..., 3), where the magnitude is the angle + turned anticlockwise in radians around the vector's + direction. + """ + return quaternion_to_axis_angle(matrix_to_quaternion(matrix)) + + +def axis_angle_to_quaternion(axis_angle: torch.Tensor) -> torch.Tensor: + """ + Convert rotations given as axis/angle to quaternions. + + Args: + axis_angle: Rotations given as a vector in axis angle form, + as a tensor of shape (..., 3), where the magnitude is + the angle turned anticlockwise in radians around the + vector's direction. + + Returns: + quaternions with real part first, as tensor of shape (..., 4). + """ + angles = torch.norm(axis_angle, p=2, dim=-1, keepdim=True) + half_angles = angles * 0.5 + eps = 1e-6 + small_angles = angles.abs() < eps + sin_half_angles_over_angles = torch.empty_like(angles) + sin_half_angles_over_angles[~small_angles] = ( + torch.sin(half_angles[~small_angles]) / angles[~small_angles] + ) + # for x small, sin(x/2) is about x/2 - (x/2)^3/6 + # so sin(x/2)/x is about 1/2 - (x*x)/48 + sin_half_angles_over_angles[small_angles] = ( + 0.5 - (angles[small_angles] * angles[small_angles]) / 48 + ) + quaternions = torch.cat( + [torch.cos(half_angles), axis_angle * sin_half_angles_over_angles], dim=-1 + ) + return quaternions + + +def quaternion_to_axis_angle(quaternions: torch.Tensor) -> torch.Tensor: + """ + Convert rotations given as quaternions to axis/angle. + + Args: + quaternions: quaternions with real part first, + as tensor of shape (..., 4). + + Returns: + Rotations given as a vector in axis angle form, as a tensor + of shape (..., 3), where the magnitude is the angle + turned anticlockwise in radians around the vector's + direction. + """ + norms = torch.norm(quaternions[..., 1:], p=2, dim=-1, keepdim=True) + half_angles = torch.atan2(norms, quaternions[..., :1]) + angles = 2 * half_angles + eps = 1e-6 + small_angles = angles.abs() < eps + sin_half_angles_over_angles = torch.empty_like(angles) + sin_half_angles_over_angles[~small_angles] = ( + torch.sin(half_angles[~small_angles]) / angles[~small_angles] + ) + # for x small, sin(x/2) is about x/2 - (x/2)^3/6 + # so sin(x/2)/x is about 1/2 - (x*x)/48 + sin_half_angles_over_angles[small_angles] = ( + 0.5 - (angles[small_angles] * angles[small_angles]) / 48 + ) + return quaternions[..., 1:] / sin_half_angles_over_angles + + +def rotation_6d_to_matrix(d6: torch.Tensor) -> torch.Tensor: + """ + Converts 6D rotation representation by Zhou et al. [1] to rotation matrix + using Gram--Schmidt orthogonalization per Section B of [1]. + Args: + d6: 6D rotation representation, of size (*, 6) + + Returns: + batch of rotation matrices of size (*, 3, 3) + + [1] Zhou, Y., Barnes, C., Lu, J., Yang, J., & Li, H. + On the Continuity of Rotation Representations in Neural Networks. + IEEE Conference on Computer Vision and Pattern Recognition, 2019. + Retrieved from http://arxiv.org/abs/1812.07035 + """ + + a1, a2 = d6[..., :3], d6[..., 3:] + b1 = F.normalize(a1, dim=-1) + b2 = a2 - (b1 * a2).sum(-1, keepdim=True) * b1 + b2 = F.normalize(b2, dim=-1) + b3 = torch.cross(b1, b2, dim=-1) + return torch.stack((b1, b2, b3), dim=-2) + + +def matrix_to_rotation_6d(matrix: torch.Tensor) -> torch.Tensor: + """ + Converts rotation matrices to 6D rotation representation by Zhou et al. [1] + by dropping the last row. Note that 6D representation is not unique. + Args: + matrix: batch of rotation matrices of size (*, 3, 3) + + Returns: + 6D rotation representation, of size (*, 6) + + [1] Zhou, Y., Barnes, C., Lu, J., Yang, J., & Li, H. + On the Continuity of Rotation Representations in Neural Networks. + IEEE Conference on Computer Vision and Pattern Recognition, 2019. + Retrieved from http://arxiv.org/abs/1812.07035 + """ + batch_dim = matrix.size()[:-2] + return matrix[..., :2, :].clone().reshape(batch_dim + (6,)) diff --git a/GHA/preprocess/lib/utils.py b/GHA/preprocess/lib/utils.py new file mode 100644 index 0000000000000000000000000000000000000000..20fd1e752f12046b34fa9e69d161ad1ef4e1f67c --- /dev/null +++ b/GHA/preprocess/lib/utils.py @@ -0,0 +1,408 @@ +import numpy as np +import numpy.linalg as npla +import cv2 + + +landmarks_2D_new = np.array([ + [ 0.000213256, 0.106454 ], #17 + [ 0.0752622, 0.038915 ], #18 + [ 0.18113, 0.0187482 ], #19 + [ 0.29077, 0.0344891 ], #20 + [ 0.393397, 0.0773906 ], #21 + [ 0.586856, 0.0773906 ], #22 + [ 0.689483, 0.0344891 ], #23 + [ 0.799124, 0.0187482 ], #24 + [ 0.904991, 0.038915 ], #25 + [ 0.98004, 0.106454 ], #26 + [ 0.490127, 0.203352 ], #27 + [ 0.490127, 0.307009 ], #28 + [ 0.490127, 0.409805 ], #29 + [ 0.490127, 0.515625 ], #30 + [ 0.36688, 0.587326 ], #31 + [ 0.426036, 0.609345 ], #32 + [ 0.490127, 0.628106 ], #33 + [ 0.554217, 0.609345 ], #34 + [ 0.613373, 0.587326 ], #35 + [ 0.121737, 0.216423 ], #36 + [ 0.187122, 0.178758 ], #37 + [ 0.265825, 0.179852 ], #38 + [ 0.334606, 0.231733 ], #39 + [ 0.260918, 0.245099 ], #40 + [ 0.182743, 0.244077 ], #41 + [ 0.645647, 0.231733 ], #42 + [ 0.714428, 0.179852 ], #43 + [ 0.793132, 0.178758 ], #44 + [ 0.858516, 0.216423 ], #45 + [ 0.79751, 0.244077 ], #46 + [ 0.719335, 0.245099 ], #47 + [ 0.254149, 0.780233 ], #48 + [ 0.726104, 0.780233 ], #54 + ], dtype=np.float32 +) +landmarks_2D_new = (landmarks_2D_new - 0.5) * 0.8 + 0.5 + +def get_transform_mat(landmarks, output_size=128): + if not isinstance(landmarks, np.ndarray): + landmarks = np.array(landmarks) + + # estimate landmarks transform from global space to local aligned space with bounds [0..1] + mat = umeyama(np.concatenate([landmarks[17:49] , landmarks[54:55] ]), landmarks_2D_new, True)[0:2] + + # get corner points in global space + g_p = transform_points(np.float32([(0,0),(1,0),(1,1),(0,1),(0.5,0.5) ]), mat, True) + g_c = g_p[4] + + # calc diagonal vectors between corners in global space + tb_diag_vec = (g_p[2]-g_p[0]).astype(np.float32) + tb_diag_vec /= npla.norm(tb_diag_vec) + bt_diag_vec = (g_p[1]-g_p[3]).astype(np.float32) + bt_diag_vec /= npla.norm(bt_diag_vec) + + # calc modifier of diagonal vectors for scale and padding value + mod = npla.norm(g_p[0]-g_p[2])*(0.4*np.sqrt(2.0) + 0.5) + + # adjust vertical offset for WHOLE_FACE, 20% below in order to cover more forehead + vec = (g_p[0]-g_p[3]).astype(np.float32) + vec_len = npla.norm(vec) + vec /= vec_len + g_c += vec*vec_len*0.2 + + + # calc 3 points in global space to estimate 2d affine transform + l_t = np.array( [ g_c - tb_diag_vec*mod, + g_c + bt_diag_vec*mod, + g_c + tb_diag_vec*mod ] ) + + # calc affine transform from 3 global space points to 3 local space points size of 'output_size' + pts2 = np.float32(( (0,0),(output_size,0),(output_size,output_size) )) + mat = cv2.getAffineTransform(l_t,pts2) + return mat + +def transform_points(points, mat, invert=False): + if invert: + mat = cv2.invertAffineTransform (mat) + points = np.expand_dims(points, axis=1) + points = cv2.transform(points, mat, points.shape) + points = np.squeeze(points) + return points + +def get_image_hull_mask(image_shape, landmarks): + hull_mask = np.zeros(image_shape[0:2]+(1,),dtype=np.float32) + + lmrks = expand_eyebrows(landmarks, 1.0) + + r_jaw = (lmrks[0:9], lmrks[17:18]) + l_jaw = (lmrks[8:17], lmrks[26:27]) + r_cheek = (lmrks[17:20], lmrks[8:9]) + l_cheek = (lmrks[24:27], lmrks[8:9]) + nose_ridge = (lmrks[19:25], lmrks[8:9],) + r_eye = (lmrks[17:22], lmrks[27:28], lmrks[31:36], lmrks[8:9]) + l_eye = (lmrks[22:27], lmrks[27:28], lmrks[31:36], lmrks[8:9]) + nose = (lmrks[27:31], lmrks[31:36]) + parts = [r_jaw, l_jaw, r_cheek, l_cheek, nose_ridge, r_eye, l_eye, nose] + + for item in parts: + merged = np.concatenate(item) + cv2.fillConvexPoly(hull_mask, cv2.convexHull(merged), (1,) ) + + return hull_mask + +def expand_eyebrows(lmrks, eyebrows_expand_mod=1.0): + lmrks = np.array( lmrks.copy(), dtype=np.int ) + + # #nose + ml_pnt = (lmrks[36] + lmrks[0]) // 2 + mr_pnt = (lmrks[16] + lmrks[45]) // 2 + + # mid points between the mid points and eye + ql_pnt = (lmrks[36] + ml_pnt) // 2 + qr_pnt = (lmrks[45] + mr_pnt) // 2 + + # Top of the eye arrays + bot_l = np.array((ql_pnt, lmrks[36], lmrks[37], lmrks[38], lmrks[39])) + bot_r = np.array((lmrks[42], lmrks[43], lmrks[44], lmrks[45], qr_pnt)) + + # Eyebrow arrays + top_l = lmrks[17:22] + top_r = lmrks[22:27] + + # Adjust eyebrow arrays + lmrks[17:22] = top_l + eyebrows_expand_mod * 0.5 * (top_l - bot_l) + lmrks[22:27] = top_r + eyebrows_expand_mod * 0.5 * (top_r - bot_r) + return lmrks + +def process_face_det_results(face_det_results): + """Process det results, and return a list of bboxes. + + :param face_det_results: (top, right, bottom and left) + :return: a list of detected bounding boxes (x,y,x,y)-format + """ + + person_results = [] + for bbox in face_det_results: + bbox = bbox[0] + person = {} + # left, top, right, bottom + person['bbox'] = [bbox[3], bbox[0], bbox[1], bbox[2]] + person_results.append(person) + + return person_results + + +def area_of(left_top, right_bottom): + """Compute the areas of rectangles given two corners. + + Args: + left_top (N, 2): left top corner. + right_bottom (N, 2): right bottom corner. + + Returns: + area (N): return the area. + """ + hw = np.clip(right_bottom - left_top, 0.0, None) + return hw[..., 0] * hw[..., 1] + +def iou_of(boxes0, boxes1, eps=1e-5): + """Return intersection-over-union (Jaccard index) of boxes. + + Args: + boxes0 (N, 4): ground truth boxes. + boxes1 (N or 1, 4): predicted boxes. + eps: a small number to avoid 0 as denominator. + Returns: + iou (N): IoU values. + """ + overlap_left_top = np.maximum(boxes0[..., :2], boxes1[..., :2]) + overlap_right_bottom = np.minimum(boxes0[..., 2:], boxes1[..., 2:]) + + overlap_area = area_of(overlap_left_top, overlap_right_bottom) + area0 = area_of(boxes0[..., :2], boxes0[..., 2:]) + area1 = area_of(boxes1[..., :2], boxes1[..., 2:]) + return overlap_area / (area0 + area1 - overlap_area + eps) + +def hard_nms(box_scores, iou_threshold, top_k=-1, candidate_size=200): + """ + + Args: + box_scores (N, 5): boxes in corner-form and probabilities. + iou_threshold: intersection over union threshold. + top_k: keep top_k results. If k <= 0, keep all the results. + candidate_size: only consider the candidates with the highest scores. + Returns: + picked: a list of indexes of the kept boxes + """ + scores = box_scores[:, -1] + boxes = box_scores[:, :-1] + picked = [] + # _, indexes = scores.sort(descending=True) + indexes = np.argsort(scores) + # indexes = indexes[:candidate_size] + indexes = indexes[-candidate_size:] + while len(indexes) > 0: + # current = indexes[0] + current = indexes[-1] + picked.append(current) + if 0 < top_k == len(picked) or len(indexes) == 1: + break + current_box = boxes[current, :] + # indexes = indexes[1:] + indexes = indexes[:-1] + rest_boxes = boxes[indexes, :] + iou = iou_of( + rest_boxes, + np.expand_dims(current_box, axis=0), + ) + indexes = indexes[iou <= iou_threshold] + + return box_scores[picked, :] + +def predict_box(width, height, confidences, boxes, prob_threshold, iou_threshold=0.3, top_k=-1): + boxes = boxes[0] + confidences = confidences[0] + picked_box_probs = [] + picked_labels = [] + for class_index in range(1, confidences.shape[1]): + probs = confidences[:, class_index] + mask = probs > prob_threshold + probs = probs[mask] + if probs.shape[0] == 0: + continue + subset_boxes = boxes[mask, :] + box_probs = np.concatenate([subset_boxes, probs.reshape(-1, 1)], axis=1) + box_probs = hard_nms(box_probs, iou_threshold=iou_threshold, top_k=top_k) + picked_box_probs.append(box_probs) + picked_labels.extend([class_index] * box_probs.shape[0]) + if not picked_box_probs: + return np.array([]), np.array([]), np.array([]) + picked_box_probs = np.concatenate(picked_box_probs) + picked_box_probs[:, 0] *= width + picked_box_probs[:, 1] *= height + picked_box_probs[:, 2] *= width + picked_box_probs[:, 3] *= height + return picked_box_probs[:, :4].astype(np.int32), np.array(picked_labels), picked_box_probs[:, 4] + + +class BBox(object): + # bbox is a list of [left, right, top, bottom] + def __init__(self, bbox): + self.left = bbox[0] + self.right = bbox[1] + self.top = bbox[2] + self.bottom = bbox[3] + self.x = bbox[0] + self.y = bbox[2] + self.w = bbox[1] - bbox[0] + self.h = bbox[3] - bbox[2] + + # scale to [0,1] + def projectLandmark(self, landmark): + landmark_= np.asarray(np.zeros(landmark.shape)) + for i, point in enumerate(landmark): + landmark_[i] = ((point[0]-self.x)/self.w, (point[1]-self.y)/self.h) + return landmark_ + + # landmark of (5L, 2L) from [0,1] to real range + def reprojectLandmark(self, landmark): + landmark_= np.asarray(np.zeros(landmark.shape)) + for i, point in enumerate(landmark): + x = point[0] * self.w + self.x + y = point[1] * self.h + self.y + landmark_[i] = (x, y) + return landmark_ + + +def umeyama(src, dst, estimate_scale): + """Estimate N-D similarity transformation with or without scaling. + Parameters + ---------- + src : (M, N) array + Source coordinates. + dst : (M, N) array + Destination coordinates. + estimate_scale : bool + Whether to estimate scaling factor. + Returns + ------- + T : (N + 1, N + 1) + The homogeneous similarity transformation matrix. The matrix contains + NaN values only if the problem is not well-conditioned. + References + ---------- + .. [1] "Least-squares estimation of transformation parameters between two + point patterns", Shinji Umeyama, PAMI 1991, DOI: 10.1109/34.88573 + """ + + num = src.shape[0] + dim = src.shape[1] + + # Compute mean of src and dst. + src_mean = src.mean(axis=0) + dst_mean = dst.mean(axis=0) + + # Subtract mean from src and dst. + src_demean = src - src_mean + dst_demean = dst - dst_mean + + # Eq. (38). + A = np.dot(dst_demean.T, src_demean) / num + + # Eq. (39). + d = np.ones((dim,), dtype=np.double) + if np.linalg.det(A) < 0: + d[dim - 1] = -1 + + T = np.eye(dim + 1, dtype=np.double) + + U, S, V = np.linalg.svd(A) + + # Eq. (40) and (43). + rank = np.linalg.matrix_rank(A) + if rank == 0: + return np.nan * T + elif rank == dim - 1: + if np.linalg.det(U) * np.linalg.det(V) > 0: + T[:dim, :dim] = np.dot(U, V) + else: + s = d[dim - 1] + d[dim - 1] = -1 + T[:dim, :dim] = np.dot(U, np.dot(np.diag(d), V)) + d[dim - 1] = s + else: + T[:dim, :dim] = np.dot(U, np.dot(np.diag(d), V)) + + if estimate_scale: + # Eq. (41) and (42). + scale = 1.0 / src_demean.var(axis=0).sum() * np.dot(S, d) + else: + scale = 1.0 + + T[:dim, dim] = dst_mean - scale * np.dot(T[:dim, :dim], src_mean.T) + T[:dim, :dim] *= scale + + return T + + +def xyxy2xywh(bbox_xyxy): + """Transform the bbox format from x1y1x2y2 to xywh. + + Args: + bbox_xyxy (np.ndarray): Bounding boxes (with scores), shaped (n, 4) or + (n, 5). (left, top, right, bottom, [score]) + + Returns: + np.ndarray: Bounding boxes (with scores), + shaped (n, 4) or (n, 5). (left, top, width, height, [score]) + """ + bbox_xywh = bbox_xyxy.copy() + bbox_xywh[:, 2] = bbox_xywh[:, 2] - bbox_xywh[:, 0] + 1 + bbox_xywh[:, 3] = bbox_xywh[:, 3] - bbox_xywh[:, 1] + 1 + + return bbox_xywh + + +def xywh2xyxy(bbox_xywh): + """Transform the bbox format from xywh to x1y1x2y2. + + Args: + bbox_xywh (ndarray): Bounding boxes (with scores), + shaped (n, 4) or (n, 5). (left, top, width, height, [score]) + Returns: + np.ndarray: Bounding boxes (with scores), shaped (n, 4) or + (n, 5). (left, top, right, bottom, [score]) + """ + bbox_xyxy = bbox_xywh.copy() + bbox_xyxy[:, 2] = bbox_xyxy[:, 2] + bbox_xyxy[:, 0] - 1 + bbox_xyxy[:, 3] = bbox_xyxy[:, 3] + bbox_xyxy[:, 1] - 1 + + return bbox_xyxy + + +def box2cs(cfg, box): + """This encodes bbox(x,y,w,h) into (center, scale) + + Args: + x, y, w, h + + Returns: + tuple: A tuple containing center and scale. + + - np.ndarray[float32](2,): Center of the bbox (x, y). + - np.ndarray[float32](2,): Scale of the bbox w & h. + """ + + x, y, w, h = box[:4] + input_size = cfg.data_cfg['image_size'] + aspect_ratio = input_size[0] / input_size[1] + center = np.array([x + w * 0.5, y + h * 0.5], dtype=np.float32) + + if w > aspect_ratio * h: + h = w * 1.0 / aspect_ratio + elif w < aspect_ratio * h: + w = h * aspect_ratio + + # pixel std is 200.0 + scale = np.array([w / 200.0, h / 200.0], dtype=np.float32) + + scale = scale * 1.25 + + return center, scale \ No newline at end of file diff --git a/GHA/preprocess/preprocess_nersemble.py b/GHA/preprocess/preprocess_nersemble.py new file mode 100644 index 0000000000000000000000000000000000000000..18558d04f2274adf272e7936feb5cdc613b66e08 --- /dev/null +++ b/GHA/preprocess/preprocess_nersemble.py @@ -0,0 +1,111 @@ +import os +import numpy as np +import cv2 +import glob +import json + + +def CropImage(left_up, crop_size, image=None, K=None): + crop_size = np.array(crop_size).astype(np.int32) + left_up = np.array(left_up).astype(np.int32) + + if not K is None: + K[0:2,2] = K[0:2,2] - np.array(left_up) + + if not image is None: + if left_up[0] < 0: + image_left = np.zeros([image.shape[0], -left_up[0], image.shape[2]], dtype=np.uint8) + image = np.hstack([image_left, image]) + left_up[0] = 0 + if left_up[1] < 0: + image_up = np.zeros([-left_up[1], image.shape[1], image.shape[2]], dtype=np.uint8) + image = np.vstack([image_up, image]) + left_up[1] = 0 + if crop_size[0] + left_up[0] > image.shape[1]: + image_right = np.zeros([image.shape[0], crop_size[0] + left_up[0] - image.shape[1], image.shape[2]], dtype=np.uint8) + image = np.hstack([image, image_right]) + if crop_size[1] + left_up[1] > image.shape[0]: + image_down = np.zeros([crop_size[1] + left_up[1] - image.shape[0], image.shape[1], image.shape[2]], dtype=np.uint8) + image = np.vstack([image, image_down]) + + image = image[left_up[1]:left_up[1]+crop_size[1], left_up[0]:left_up[0]+crop_size[0], :] + + return image, K + + +def ResizeImage(target_size, source_size, image=None, K=None): + if not K is None: + K[0,:] = (target_size[0] / source_size[0]) * K[0,:] + K[1,:] = (target_size[1] / source_size[1]) * K[1,:] + + if not image is None: + image = cv2.resize(image, dsize=target_size) + return image, K + + + + +def extract_frames(id_list): + + for id in id_list: + camera_path = os.path.join(DATA_SOURCE, 'camera_params', id, 'camera_params.json') + with open(camera_path, 'r') as f: + camera = json.load(f) + + fids = {} + for camera_id in camera['world_2_cam'].keys(): + fids[camera_id] = 0 + background_path = os.path.join(DATA_SOURCE, 'sequence_BACKGROUND_part-1', id, 'BACKGROUND', 'image_%s.jpg' % camera_id) + background = cv2.imread(background_path) + background, _ = CropImage(LEFT_UP, CROP_SIZE, background, None) + background, _ = ResizeImage(SIZE, CROP_SIZE, background, None) + os.makedirs(os.path.join(DATA_OUTPUT, id, 'background'), exist_ok=True) + cv2.imwrite(os.path.join(DATA_OUTPUT, id, 'background', 'image_' + camera_id + '.jpg'), background) + + video_folders = glob.glob(os.path.join(DATA_SOURCE, '*', id, '*')) + for video_folder in video_folders: + if ('tongue' in video_folder) or ('GLASSES' in video_folder) or ('FREE' in video_folder) or ('BACKGROUND' in video_folder): + continue + video_paths = glob.glob(os.path.join(video_folder, 'cam_*')) + for video_path in video_paths: + camera_id = video_path[-13:-4] + extrinsic = np.array(camera['world_2_cam'][camera_id][:3]) + intrinsic = np.array(camera['intrinsics']) + _, intrinsic = CropImage(LEFT_UP, CROP_SIZE, None, intrinsic) + _, intrinsic = ResizeImage(SIZE, CROP_SIZE, None, intrinsic) + + cap = cv2.VideoCapture(video_path) + count = -1 + while(1): + _, image = cap.read() + if image is None: + break + count += 1 + if count % 3 != 0: + continue + visible = (np.ones_like(image) * 255).astype(np.uint8) + image, _ = CropImage(LEFT_UP, CROP_SIZE, image, None) + image, _ = ResizeImage(SIZE, CROP_SIZE, image, None) + visible, _ = CropImage(LEFT_UP, CROP_SIZE, visible, None) + visible, _ = ResizeImage(SIZE, CROP_SIZE, visible, None) + image_lowres = cv2.resize(image, SIZE_LOWRES) + visible_lowres = cv2.resize(visible, SIZE_LOWRES) + os.makedirs(os.path.join(DATA_OUTPUT, id, 'images', '%04d' % fids[camera_id]), exist_ok=True) + cv2.imwrite(os.path.join(DATA_OUTPUT, id, 'images', '%04d' % fids[camera_id], 'image_' + camera_id + '.jpg'), image) + cv2.imwrite(os.path.join(DATA_OUTPUT, id, 'images', '%04d' % fids[camera_id], 'image_lowres_' + camera_id + '.jpg'), image_lowres) + cv2.imwrite(os.path.join(DATA_OUTPUT, id, 'images', '%04d' % fids[camera_id], 'visible_' + camera_id + '.jpg'), visible) + cv2.imwrite(os.path.join(DATA_OUTPUT, id, 'images', '%04d' % fids[camera_id], 'visible_lowres_' + camera_id + '.jpg'), visible_lowres) + os.makedirs(os.path.join(DATA_OUTPUT, id, 'cameras', '%04d' % fids[camera_id]), exist_ok=True) + np.savez(os.path.join(DATA_OUTPUT, id, 'cameras', '%04d' % fids[camera_id], 'camera_' + camera_id + '.npz'), extrinsic=extrinsic, intrinsic=intrinsic) + + fids[camera_id] += 1 + + +if __name__ == "__main__": + LEFT_UP = [-200, 304] + CROP_SIZE = [2600, 2600] + SIZE = [2048, 2048] + SIZE_LOWRES = [256, 256] + DATA_SOURCE = 'path/to/raw_NeRSemble/' + DATA_OUTPUT = '../NeRSemble' + extract_frames(['031', '036']) \ No newline at end of file diff --git a/GHA/preprocess/remove_background_nersemble.py b/GHA/preprocess/remove_background_nersemble.py new file mode 100644 index 0000000000000000000000000000000000000000..7496a2f00ede66a127f6b79f2b0ae17b13ec925b --- /dev/null +++ b/GHA/preprocess/remove_background_nersemble.py @@ -0,0 +1,95 @@ +import argparse +import torch +import os +import shutil +import json +import glob +import cv2 +import imageio +import numpy as np +from tqdm import tqdm + +from torch import nn +from torch.nn import functional as F +from torch.utils.data import DataLoader +from torchvision import transforms as T +from torchvision.transforms.functional import to_pil_image +from threading import Thread + +from dataset import ImagesDataset, ZipDataset +from dataset import augmentation as A +from model import MattingBase, MattingRefine +from inference_utils import HomographicAlignment + + + +def preprocess_nersemble(args, data_folder, camera_ids): + device = torch.device(args.device) + # Load model + if args.model_type == 'mattingbase': + model = MattingBase(args.model_backbone) + if args.model_type == 'mattingrefine': + model = MattingRefine( + args.model_backbone, + args.model_backbone_scale, + args.model_refine_mode, + args.model_refine_sample_pixels, + args.model_refine_threshold, + args.model_refine_kernel_size) + + model = model.to(device).eval() + model.load_state_dict(torch.load(args.model_checkpoint, map_location=device), strict=False) + + fids = sorted(os.listdir(os.path.join(data_folder, 'images'))) + for v in range(len(camera_ids)): + for fid in tqdm(fids): + image_path = os.path.join(data_folder, 'images', fid, 'image_%s.jpg' % camera_ids[v]) + background_path = os.path.join(data_folder, 'background', 'image_%s.jpg' % camera_ids[v]) + if not os.path.exists(image_path): + continue + image = imageio.imread(image_path) + src = (torch.from_numpy(image).float() / 255).permute(2,0,1)[None].to(device, non_blocking=True) + + if os.path.exists(background_path): + background = imageio.imread(background_path) + bgr = (torch.from_numpy(background).float() / 255).permute(2,0,1)[None].to(device, non_blocking=True) + else: + bgr = src * 0.0 + + with torch.no_grad(): + if args.model_type == 'mattingbase': + pha, fgr, err, _ = model(src, bgr) + elif args.model_type == 'mattingrefine': + pha, fgr, _, _, err, ref = model(src, bgr) + mask = (pha[0].repeat([3, 1, 1]) * 255).permute(1,2,0).cpu().numpy().astype(np.uint8) + mask_lowres = cv2.resize(mask, (256, 256)) + + mask_path = os.path.join(data_folder, 'images', fid, 'mask_%s.jpg' % camera_ids[v]) + imageio.imsave(mask_path, mask) + + mask_lowres_path = os.path.join(data_folder, 'images', fid, 'mask_lowres_%s.jpg' % camera_ids[v]) + imageio.imsave(mask_lowres_path, mask_lowres) + + +if __name__ == "__main__": + parser = argparse.ArgumentParser(description='Inference images') + + parser.add_argument('--device', type=str, choices=['cpu', 'cuda'], default='cuda') + parser.add_argument('--model-type', type=str, default='mattingrefine', choices=['mattingbase', 'mattingrefine']) + parser.add_argument('--model-backbone', type=str, default='resnet101', choices=['resnet101', 'resnet50', 'mobilenetv2']) + parser.add_argument('--model-backbone-scale', type=float, default=0.25) + parser.add_argument('--model-checkpoint', type=str, default='assets/pytorch_resnet101.pth') + parser.add_argument('--model-refine-mode', type=str, default='sampling', choices=['full', 'sampling', 'thresholding']) + parser.add_argument('--model-refine-sample-pixels', type=int, default=80_000) + parser.add_argument('--model-refine-threshold', type=float, default=0.7) + parser.add_argument('--model-refine-kernel-size', type=int, default=3) + args = parser.parse_args() + + DATA_SOURCE = '../NeRSemble' + CAMERA_IDS = ['220700191', '221501007', '222200036', '222200037', '222200038', '222200039', '222200040', '222200041', + '222200042', '222200043', '222200044', '222200045', '222200046', '222200047', '222200048', '222200049'] + + ids = sorted(os.listdir(DATA_SOURCE)) + for id in ids: + data_folder = os.path.join(DATA_SOURCE, id) + preprocess_nersemble(args, data_folder, CAMERA_IDS) \ No newline at end of file diff --git a/GHA/preprocess/third_libs/OpenSeeFace/__init__.py b/GHA/preprocess/third_libs/OpenSeeFace/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..fc9f5ae737d0667819cd8dfb967df8b48ad2369e --- /dev/null +++ b/GHA/preprocess/third_libs/OpenSeeFace/__init__.py @@ -0,0 +1 @@ +from . import tracker diff --git a/GHA/preprocess/third_libs/OpenSeeFace/models/priorbox_640x640.json b/GHA/preprocess/third_libs/OpenSeeFace/models/priorbox_640x640.json new file mode 100644 index 0000000000000000000000000000000000000000..236401ea30c82aaaaadedfcdc60225c3b0a1eecd --- /dev/null +++ b/GHA/preprocess/third_libs/OpenSeeFace/models/priorbox_640x640.json @@ -0,0 +1 @@ +[[0.0062500000931322575, 0.0062500000931322575, 0.02500000037252903, 0.02500000037252903], [0.0062500000931322575, 0.0062500000931322575, 0.05000000074505806, 0.05000000074505806], [0.01875000074505806, 0.0062500000931322575, 0.02500000037252903, 0.02500000037252903], [0.01875000074505806, 0.0062500000931322575, 0.05000000074505806, 0.05000000074505806], [0.03125, 0.0062500000931322575, 0.02500000037252903, 0.02500000037252903], [0.03125, 0.0062500000931322575, 0.05000000074505806, 0.05000000074505806], [0.04374999925494194, 0.0062500000931322575, 0.02500000037252903, 0.02500000037252903], [0.04374999925494194, 0.0062500000931322575, 0.05000000074505806, 0.05000000074505806], [0.05624999850988388, 0.0062500000931322575, 0.02500000037252903, 0.02500000037252903], [0.05624999850988388, 0.0062500000931322575, 0.05000000074505806, 0.05000000074505806], [0.06875000149011612, 0.0062500000931322575, 0.02500000037252903, 0.02500000037252903], [0.06875000149011612, 0.0062500000931322575, 0.05000000074505806, 0.05000000074505806], [0.08124999701976776, 0.0062500000931322575, 0.02500000037252903, 0.02500000037252903], [0.08124999701976776, 0.0062500000931322575, 0.05000000074505806, 0.05000000074505806], [0.09375, 0.0062500000931322575, 0.02500000037252903, 0.02500000037252903], [0.09375, 0.0062500000931322575, 0.05000000074505806, 0.05000000074505806], [0.10625000298023224, 0.0062500000931322575, 0.02500000037252903, 0.02500000037252903], [0.10625000298023224, 0.0062500000931322575, 0.05000000074505806, 0.05000000074505806], [0.11874999850988388, 0.0062500000931322575, 0.02500000037252903, 0.02500000037252903], [0.11874999850988388, 0.0062500000931322575, 0.05000000074505806, 0.05000000074505806], [0.13124999403953552, 0.0062500000931322575, 0.02500000037252903, 0.02500000037252903], [0.13124999403953552, 0.0062500000931322575, 0.05000000074505806, 0.05000000074505806], [0.14374999701976776, 0.0062500000931322575, 0.02500000037252903, 0.02500000037252903], [0.14374999701976776, 0.0062500000931322575, 0.05000000074505806, 0.05000000074505806], [0.15625, 0.0062500000931322575, 0.02500000037252903, 0.02500000037252903], [0.15625, 0.0062500000931322575, 0.05000000074505806, 0.05000000074505806], [0.16875000298023224, 0.0062500000931322575, 0.02500000037252903, 0.02500000037252903], [0.16875000298023224, 0.0062500000931322575, 0.05000000074505806, 0.05000000074505806], [0.18125000596046448, 0.0062500000931322575, 0.02500000037252903, 0.02500000037252903], [0.18125000596046448, 0.0062500000931322575, 0.05000000074505806, 0.05000000074505806], [0.19374999403953552, 0.0062500000931322575, 0.02500000037252903, 0.02500000037252903], [0.19374999403953552, 0.0062500000931322575, 0.05000000074505806, 0.05000000074505806], [0.20624999701976776, 0.0062500000931322575, 0.02500000037252903, 0.02500000037252903], [0.20624999701976776, 0.0062500000931322575, 0.05000000074505806, 0.05000000074505806], [0.21875, 0.0062500000931322575, 0.02500000037252903, 0.02500000037252903], [0.21875, 0.0062500000931322575, 0.05000000074505806, 0.05000000074505806], [0.23125000298023224, 0.0062500000931322575, 0.02500000037252903, 0.02500000037252903], [0.23125000298023224, 0.0062500000931322575, 0.05000000074505806, 0.05000000074505806], [0.24375000596046448, 0.0062500000931322575, 0.02500000037252903, 0.02500000037252903], [0.24375000596046448, 0.0062500000931322575, 0.05000000074505806, 0.05000000074505806], [0.2562499940395355, 0.0062500000931322575, 0.02500000037252903, 0.02500000037252903], [0.2562499940395355, 0.0062500000931322575, 0.05000000074505806, 0.05000000074505806], [0.26875001192092896, 0.0062500000931322575, 0.02500000037252903, 0.02500000037252903], [0.26875001192092896, 0.0062500000931322575, 0.05000000074505806, 0.05000000074505806], [0.28125, 0.0062500000931322575, 0.02500000037252903, 0.02500000037252903], [0.28125, 0.0062500000931322575, 0.05000000074505806, 0.05000000074505806], [0.29374998807907104, 0.0062500000931322575, 0.02500000037252903, 0.02500000037252903], [0.29374998807907104, 0.0062500000931322575, 0.05000000074505806, 0.05000000074505806], [0.3062500059604645, 0.0062500000931322575, 0.02500000037252903, 0.02500000037252903], [0.3062500059604645, 0.0062500000931322575, 0.05000000074505806, 0.05000000074505806], [0.3187499940395355, 0.0062500000931322575, 0.02500000037252903, 0.02500000037252903], [0.3187499940395355, 0.0062500000931322575, 0.05000000074505806, 0.05000000074505806], [0.33125001192092896, 0.0062500000931322575, 0.02500000037252903, 0.02500000037252903], [0.33125001192092896, 0.0062500000931322575, 0.05000000074505806, 0.05000000074505806], [0.34375, 0.0062500000931322575, 0.02500000037252903, 0.02500000037252903], [0.34375, 0.0062500000931322575, 0.05000000074505806, 0.05000000074505806], [0.35624998807907104, 0.0062500000931322575, 0.02500000037252903, 0.02500000037252903], [0.35624998807907104, 0.0062500000931322575, 0.05000000074505806, 0.05000000074505806], [0.3687500059604645, 0.0062500000931322575, 0.02500000037252903, 0.02500000037252903], [0.3687500059604645, 0.0062500000931322575, 0.05000000074505806, 0.05000000074505806], [0.3812499940395355, 0.0062500000931322575, 0.02500000037252903, 0.02500000037252903], [0.3812499940395355, 0.0062500000931322575, 0.05000000074505806, 0.05000000074505806], [0.39375001192092896, 0.0062500000931322575, 0.02500000037252903, 0.02500000037252903], [0.39375001192092896, 0.0062500000931322575, 0.05000000074505806, 0.05000000074505806], [0.40625, 0.0062500000931322575, 0.02500000037252903, 0.02500000037252903], [0.40625, 0.0062500000931322575, 0.05000000074505806, 0.05000000074505806], [0.41874998807907104, 0.0062500000931322575, 0.02500000037252903, 0.02500000037252903], [0.41874998807907104, 0.0062500000931322575, 0.05000000074505806, 0.05000000074505806], [0.4312500059604645, 0.0062500000931322575, 0.02500000037252903, 0.02500000037252903], [0.4312500059604645, 0.0062500000931322575, 0.05000000074505806, 0.05000000074505806], [0.4437499940395355, 0.0062500000931322575, 0.02500000037252903, 0.02500000037252903], [0.4437499940395355, 0.0062500000931322575, 0.05000000074505806, 0.05000000074505806], [0.45625001192092896, 0.0062500000931322575, 0.02500000037252903, 0.02500000037252903], [0.45625001192092896, 0.0062500000931322575, 0.05000000074505806, 0.05000000074505806], [0.46875, 0.0062500000931322575, 0.02500000037252903, 0.02500000037252903], [0.46875, 0.0062500000931322575, 0.05000000074505806, 0.05000000074505806], [0.48124998807907104, 0.0062500000931322575, 0.02500000037252903, 0.02500000037252903], [0.48124998807907104, 0.0062500000931322575, 0.05000000074505806, 0.05000000074505806], [0.4937500059604645, 0.0062500000931322575, 0.02500000037252903, 0.02500000037252903], [0.4937500059604645, 0.0062500000931322575, 0.05000000074505806, 0.05000000074505806], [0.5062500238418579, 0.0062500000931322575, 0.02500000037252903, 0.02500000037252903], [0.5062500238418579, 0.0062500000931322575, 0.05000000074505806, 0.05000000074505806], [0.518750011920929, 0.0062500000931322575, 0.02500000037252903, 0.02500000037252903], [0.518750011920929, 0.0062500000931322575, 0.05000000074505806, 0.05000000074505806], [0.53125, 0.0062500000931322575, 0.02500000037252903, 0.02500000037252903], [0.53125, 0.0062500000931322575, 0.05000000074505806, 0.05000000074505806], [0.543749988079071, 0.0062500000931322575, 0.02500000037252903, 0.02500000037252903], [0.543749988079071, 0.0062500000931322575, 0.05000000074505806, 0.05000000074505806], [0.5562499761581421, 0.0062500000931322575, 0.02500000037252903, 0.02500000037252903], [0.5562499761581421, 0.0062500000931322575, 0.05000000074505806, 0.05000000074505806], [0.5687500238418579, 0.0062500000931322575, 0.02500000037252903, 0.02500000037252903], [0.5687500238418579, 0.0062500000931322575, 0.05000000074505806, 0.05000000074505806], [0.581250011920929, 0.0062500000931322575, 0.02500000037252903, 0.02500000037252903], [0.581250011920929, 0.0062500000931322575, 0.05000000074505806, 0.05000000074505806], [0.59375, 0.0062500000931322575, 0.02500000037252903, 0.02500000037252903], [0.59375, 0.0062500000931322575, 0.05000000074505806, 0.05000000074505806], [0.606249988079071, 0.0062500000931322575, 0.02500000037252903, 0.02500000037252903], [0.606249988079071, 0.0062500000931322575, 0.05000000074505806, 0.05000000074505806], [0.6187499761581421, 0.0062500000931322575, 0.02500000037252903, 0.02500000037252903], [0.6187499761581421, 0.0062500000931322575, 0.05000000074505806, 0.05000000074505806], [0.6312500238418579, 0.0062500000931322575, 0.02500000037252903, 0.02500000037252903], [0.6312500238418579, 0.0062500000931322575, 0.05000000074505806, 0.05000000074505806], [0.643750011920929, 0.0062500000931322575, 0.02500000037252903, 0.02500000037252903], [0.643750011920929, 0.0062500000931322575, 0.05000000074505806, 0.05000000074505806], [0.65625, 0.0062500000931322575, 0.02500000037252903, 0.02500000037252903], [0.65625, 0.0062500000931322575, 0.05000000074505806, 0.05000000074505806], [0.668749988079071, 0.0062500000931322575, 0.02500000037252903, 0.02500000037252903], [0.668749988079071, 0.0062500000931322575, 0.05000000074505806, 0.05000000074505806], [0.6812499761581421, 0.0062500000931322575, 0.02500000037252903, 0.02500000037252903], [0.6812499761581421, 0.0062500000931322575, 0.05000000074505806, 0.05000000074505806], [0.6937500238418579, 0.0062500000931322575, 0.02500000037252903, 0.02500000037252903], [0.6937500238418579, 0.0062500000931322575, 0.05000000074505806, 0.05000000074505806], [0.706250011920929, 0.0062500000931322575, 0.02500000037252903, 0.02500000037252903], [0.706250011920929, 0.0062500000931322575, 0.05000000074505806, 0.05000000074505806], [0.71875, 0.0062500000931322575, 0.02500000037252903, 0.02500000037252903], [0.71875, 0.0062500000931322575, 0.05000000074505806, 0.05000000074505806], [0.731249988079071, 0.0062500000931322575, 0.02500000037252903, 0.02500000037252903], [0.731249988079071, 0.0062500000931322575, 0.05000000074505806, 0.05000000074505806], [0.7437499761581421, 0.0062500000931322575, 0.02500000037252903, 0.02500000037252903], [0.7437499761581421, 0.0062500000931322575, 0.05000000074505806, 0.05000000074505806], [0.7562500238418579, 0.0062500000931322575, 0.02500000037252903, 0.02500000037252903], [0.7562500238418579, 0.0062500000931322575, 0.05000000074505806, 0.05000000074505806], [0.768750011920929, 0.0062500000931322575, 0.02500000037252903, 0.02500000037252903], [0.768750011920929, 0.0062500000931322575, 0.05000000074505806, 0.05000000074505806], [0.78125, 0.0062500000931322575, 0.02500000037252903, 0.02500000037252903], [0.78125, 0.0062500000931322575, 0.05000000074505806, 0.05000000074505806], [0.793749988079071, 0.0062500000931322575, 0.02500000037252903, 0.02500000037252903], [0.793749988079071, 0.0062500000931322575, 0.05000000074505806, 0.05000000074505806], [0.8062499761581421, 0.0062500000931322575, 0.02500000037252903, 0.02500000037252903], [0.8062499761581421, 0.0062500000931322575, 0.05000000074505806, 0.05000000074505806], [0.8187500238418579, 0.0062500000931322575, 0.02500000037252903, 0.02500000037252903], [0.8187500238418579, 0.0062500000931322575, 0.05000000074505806, 0.05000000074505806], [0.831250011920929, 0.0062500000931322575, 0.02500000037252903, 0.02500000037252903], [0.831250011920929, 0.0062500000931322575, 0.05000000074505806, 0.05000000074505806], [0.84375, 0.0062500000931322575, 0.02500000037252903, 0.02500000037252903], [0.84375, 0.0062500000931322575, 0.05000000074505806, 0.05000000074505806], [0.856249988079071, 0.0062500000931322575, 0.02500000037252903, 0.02500000037252903], [0.856249988079071, 0.0062500000931322575, 0.05000000074505806, 0.05000000074505806], [0.8687499761581421, 0.0062500000931322575, 0.02500000037252903, 0.02500000037252903], [0.8687499761581421, 0.0062500000931322575, 0.05000000074505806, 0.05000000074505806], [0.8812500238418579, 0.0062500000931322575, 0.02500000037252903, 0.02500000037252903], [0.8812500238418579, 0.0062500000931322575, 0.05000000074505806, 0.05000000074505806], [0.893750011920929, 0.0062500000931322575, 0.02500000037252903, 0.02500000037252903], [0.893750011920929, 0.0062500000931322575, 0.05000000074505806, 0.05000000074505806], [0.90625, 0.0062500000931322575, 0.02500000037252903, 0.02500000037252903], [0.90625, 0.0062500000931322575, 0.05000000074505806, 0.05000000074505806], [0.918749988079071, 0.0062500000931322575, 0.02500000037252903, 0.02500000037252903], [0.918749988079071, 0.0062500000931322575, 0.05000000074505806, 0.05000000074505806], [0.9312499761581421, 0.0062500000931322575, 0.02500000037252903, 0.02500000037252903], [0.9312499761581421, 0.0062500000931322575, 0.05000000074505806, 0.05000000074505806], [0.9437500238418579, 0.0062500000931322575, 0.02500000037252903, 0.02500000037252903], [0.9437500238418579, 0.0062500000931322575, 0.05000000074505806, 0.05000000074505806], [0.956250011920929, 0.0062500000931322575, 0.02500000037252903, 0.02500000037252903], [0.956250011920929, 0.0062500000931322575, 0.05000000074505806, 0.05000000074505806], [0.96875, 0.0062500000931322575, 0.02500000037252903, 0.02500000037252903], [0.96875, 0.0062500000931322575, 0.05000000074505806, 0.05000000074505806], [0.981249988079071, 0.0062500000931322575, 0.02500000037252903, 0.02500000037252903], [0.981249988079071, 0.0062500000931322575, 0.05000000074505806, 0.05000000074505806], [0.9937499761581421, 0.0062500000931322575, 0.02500000037252903, 0.02500000037252903], [0.9937499761581421, 0.0062500000931322575, 0.05000000074505806, 0.05000000074505806], [0.0062500000931322575, 0.01875000074505806, 0.02500000037252903, 0.02500000037252903], [0.0062500000931322575, 0.01875000074505806, 0.05000000074505806, 0.05000000074505806], [0.01875000074505806, 0.01875000074505806, 0.02500000037252903, 0.02500000037252903], [0.01875000074505806, 0.01875000074505806, 0.05000000074505806, 0.05000000074505806], [0.03125, 0.01875000074505806, 0.02500000037252903, 0.02500000037252903], [0.03125, 0.01875000074505806, 0.05000000074505806, 0.05000000074505806], [0.04374999925494194, 0.01875000074505806, 0.02500000037252903, 0.02500000037252903], [0.04374999925494194, 0.01875000074505806, 0.05000000074505806, 0.05000000074505806], [0.05624999850988388, 0.01875000074505806, 0.02500000037252903, 0.02500000037252903], [0.05624999850988388, 0.01875000074505806, 0.05000000074505806, 0.05000000074505806], [0.06875000149011612, 0.01875000074505806, 0.02500000037252903, 0.02500000037252903], [0.06875000149011612, 0.01875000074505806, 0.05000000074505806, 0.05000000074505806], [0.08124999701976776, 0.01875000074505806, 0.02500000037252903, 0.02500000037252903], [0.08124999701976776, 0.01875000074505806, 0.05000000074505806, 0.05000000074505806], [0.09375, 0.01875000074505806, 0.02500000037252903, 0.02500000037252903], [0.09375, 0.01875000074505806, 0.05000000074505806, 0.05000000074505806], [0.10625000298023224, 0.01875000074505806, 0.02500000037252903, 0.02500000037252903], [0.10625000298023224, 0.01875000074505806, 0.05000000074505806, 0.05000000074505806], [0.11874999850988388, 0.01875000074505806, 0.02500000037252903, 0.02500000037252903], [0.11874999850988388, 0.01875000074505806, 0.05000000074505806, 0.05000000074505806], [0.13124999403953552, 0.01875000074505806, 0.02500000037252903, 0.02500000037252903], [0.13124999403953552, 0.01875000074505806, 0.05000000074505806, 0.05000000074505806], [0.14374999701976776, 0.01875000074505806, 0.02500000037252903, 0.02500000037252903], [0.14374999701976776, 0.01875000074505806, 0.05000000074505806, 0.05000000074505806], [0.15625, 0.01875000074505806, 0.02500000037252903, 0.02500000037252903], [0.15625, 0.01875000074505806, 0.05000000074505806, 0.05000000074505806], [0.16875000298023224, 0.01875000074505806, 0.02500000037252903, 0.02500000037252903], [0.16875000298023224, 0.01875000074505806, 0.05000000074505806, 0.05000000074505806], [0.18125000596046448, 0.01875000074505806, 0.02500000037252903, 0.02500000037252903], [0.18125000596046448, 0.01875000074505806, 0.05000000074505806, 0.05000000074505806], [0.19374999403953552, 0.01875000074505806, 0.02500000037252903, 0.02500000037252903], [0.19374999403953552, 0.01875000074505806, 0.05000000074505806, 0.05000000074505806], [0.20624999701976776, 0.01875000074505806, 0.02500000037252903, 0.02500000037252903], [0.20624999701976776, 0.01875000074505806, 0.05000000074505806, 0.05000000074505806], [0.21875, 0.01875000074505806, 0.02500000037252903, 0.02500000037252903], [0.21875, 0.01875000074505806, 0.05000000074505806, 0.05000000074505806], [0.23125000298023224, 0.01875000074505806, 0.02500000037252903, 0.02500000037252903], [0.23125000298023224, 0.01875000074505806, 0.05000000074505806, 0.05000000074505806], [0.24375000596046448, 0.01875000074505806, 0.02500000037252903, 0.02500000037252903], [0.24375000596046448, 0.01875000074505806, 0.05000000074505806, 0.05000000074505806], [0.2562499940395355, 0.01875000074505806, 0.02500000037252903, 0.02500000037252903], [0.2562499940395355, 0.01875000074505806, 0.05000000074505806, 0.05000000074505806], [0.26875001192092896, 0.01875000074505806, 0.02500000037252903, 0.02500000037252903], [0.26875001192092896, 0.01875000074505806, 0.05000000074505806, 0.05000000074505806], [0.28125, 0.01875000074505806, 0.02500000037252903, 0.02500000037252903], [0.28125, 0.01875000074505806, 0.05000000074505806, 0.05000000074505806], [0.29374998807907104, 0.01875000074505806, 0.02500000037252903, 0.02500000037252903], [0.29374998807907104, 0.01875000074505806, 0.05000000074505806, 0.05000000074505806], [0.3062500059604645, 0.01875000074505806, 0.02500000037252903, 0.02500000037252903], [0.3062500059604645, 0.01875000074505806, 0.05000000074505806, 0.05000000074505806], [0.3187499940395355, 0.01875000074505806, 0.02500000037252903, 0.02500000037252903], [0.3187499940395355, 0.01875000074505806, 0.05000000074505806, 0.05000000074505806], [0.33125001192092896, 0.01875000074505806, 0.02500000037252903, 0.02500000037252903], [0.33125001192092896, 0.01875000074505806, 0.05000000074505806, 0.05000000074505806], [0.34375, 0.01875000074505806, 0.02500000037252903, 0.02500000037252903], [0.34375, 0.01875000074505806, 0.05000000074505806, 0.05000000074505806], [0.35624998807907104, 0.01875000074505806, 0.02500000037252903, 0.02500000037252903], [0.35624998807907104, 0.01875000074505806, 0.05000000074505806, 0.05000000074505806], [0.3687500059604645, 0.01875000074505806, 0.02500000037252903, 0.02500000037252903], [0.3687500059604645, 0.01875000074505806, 0.05000000074505806, 0.05000000074505806], [0.3812499940395355, 0.01875000074505806, 0.02500000037252903, 0.02500000037252903], [0.3812499940395355, 0.01875000074505806, 0.05000000074505806, 0.05000000074505806], [0.39375001192092896, 0.01875000074505806, 0.02500000037252903, 0.02500000037252903], [0.39375001192092896, 0.01875000074505806, 0.05000000074505806, 0.05000000074505806], [0.40625, 0.01875000074505806, 0.02500000037252903, 0.02500000037252903], [0.40625, 0.01875000074505806, 0.05000000074505806, 0.05000000074505806], [0.41874998807907104, 0.01875000074505806, 0.02500000037252903, 0.02500000037252903], [0.41874998807907104, 0.01875000074505806, 0.05000000074505806, 0.05000000074505806], [0.4312500059604645, 0.01875000074505806, 0.02500000037252903, 0.02500000037252903], [0.4312500059604645, 0.01875000074505806, 0.05000000074505806, 0.05000000074505806], [0.4437499940395355, 0.01875000074505806, 0.02500000037252903, 0.02500000037252903], [0.4437499940395355, 0.01875000074505806, 0.05000000074505806, 0.05000000074505806], [0.45625001192092896, 0.01875000074505806, 0.02500000037252903, 0.02500000037252903], [0.45625001192092896, 0.01875000074505806, 0.05000000074505806, 0.05000000074505806], [0.46875, 0.01875000074505806, 0.02500000037252903, 0.02500000037252903], [0.46875, 0.01875000074505806, 0.05000000074505806, 0.05000000074505806], [0.48124998807907104, 0.01875000074505806, 0.02500000037252903, 0.02500000037252903], [0.48124998807907104, 0.01875000074505806, 0.05000000074505806, 0.05000000074505806], [0.4937500059604645, 0.01875000074505806, 0.02500000037252903, 0.02500000037252903], [0.4937500059604645, 0.01875000074505806, 0.05000000074505806, 0.05000000074505806], [0.5062500238418579, 0.01875000074505806, 0.02500000037252903, 0.02500000037252903], [0.5062500238418579, 0.01875000074505806, 0.05000000074505806, 0.05000000074505806], [0.518750011920929, 0.01875000074505806, 0.02500000037252903, 0.02500000037252903], [0.518750011920929, 0.01875000074505806, 0.05000000074505806, 0.05000000074505806], [0.53125, 0.01875000074505806, 0.02500000037252903, 0.02500000037252903], [0.53125, 0.01875000074505806, 0.05000000074505806, 0.05000000074505806], [0.543749988079071, 0.01875000074505806, 0.02500000037252903, 0.02500000037252903], [0.543749988079071, 0.01875000074505806, 0.05000000074505806, 0.05000000074505806], [0.5562499761581421, 0.01875000074505806, 0.02500000037252903, 0.02500000037252903], [0.5562499761581421, 0.01875000074505806, 0.05000000074505806, 0.05000000074505806], [0.5687500238418579, 0.01875000074505806, 0.02500000037252903, 0.02500000037252903], [0.5687500238418579, 0.01875000074505806, 0.05000000074505806, 0.05000000074505806], [0.581250011920929, 0.01875000074505806, 0.02500000037252903, 0.02500000037252903], [0.581250011920929, 0.01875000074505806, 0.05000000074505806, 0.05000000074505806], [0.59375, 0.01875000074505806, 0.02500000037252903, 0.02500000037252903], [0.59375, 0.01875000074505806, 0.05000000074505806, 0.05000000074505806], [0.606249988079071, 0.01875000074505806, 0.02500000037252903, 0.02500000037252903], [0.606249988079071, 0.01875000074505806, 0.05000000074505806, 0.05000000074505806], [0.6187499761581421, 0.01875000074505806, 0.02500000037252903, 0.02500000037252903], [0.6187499761581421, 0.01875000074505806, 0.05000000074505806, 0.05000000074505806], [0.6312500238418579, 0.01875000074505806, 0.02500000037252903, 0.02500000037252903], [0.6312500238418579, 0.01875000074505806, 0.05000000074505806, 0.05000000074505806], [0.643750011920929, 0.01875000074505806, 0.02500000037252903, 0.02500000037252903], [0.643750011920929, 0.01875000074505806, 0.05000000074505806, 0.05000000074505806], [0.65625, 0.01875000074505806, 0.02500000037252903, 0.02500000037252903], [0.65625, 0.01875000074505806, 0.05000000074505806, 0.05000000074505806], [0.668749988079071, 0.01875000074505806, 0.02500000037252903, 0.02500000037252903], [0.668749988079071, 0.01875000074505806, 0.05000000074505806, 0.05000000074505806], [0.6812499761581421, 0.01875000074505806, 0.02500000037252903, 0.02500000037252903], [0.6812499761581421, 0.01875000074505806, 0.05000000074505806, 0.05000000074505806], [0.6937500238418579, 0.01875000074505806, 0.02500000037252903, 0.02500000037252903], [0.6937500238418579, 0.01875000074505806, 0.05000000074505806, 0.05000000074505806], [0.706250011920929, 0.01875000074505806, 0.02500000037252903, 0.02500000037252903], [0.706250011920929, 0.01875000074505806, 0.05000000074505806, 0.05000000074505806], [0.71875, 0.01875000074505806, 0.02500000037252903, 0.02500000037252903], [0.71875, 0.01875000074505806, 0.05000000074505806, 0.05000000074505806], [0.731249988079071, 0.01875000074505806, 0.02500000037252903, 0.02500000037252903], [0.731249988079071, 0.01875000074505806, 0.05000000074505806, 0.05000000074505806], [0.7437499761581421, 0.01875000074505806, 0.02500000037252903, 0.02500000037252903], [0.7437499761581421, 0.01875000074505806, 0.05000000074505806, 0.05000000074505806], [0.7562500238418579, 0.01875000074505806, 0.02500000037252903, 0.02500000037252903], [0.7562500238418579, 0.01875000074505806, 0.05000000074505806, 0.05000000074505806], [0.768750011920929, 0.01875000074505806, 0.02500000037252903, 0.02500000037252903], [0.768750011920929, 0.01875000074505806, 0.05000000074505806, 0.05000000074505806], [0.78125, 0.01875000074505806, 0.02500000037252903, 0.02500000037252903], [0.78125, 0.01875000074505806, 0.05000000074505806, 0.05000000074505806], [0.793749988079071, 0.01875000074505806, 0.02500000037252903, 0.02500000037252903], [0.793749988079071, 0.01875000074505806, 0.05000000074505806, 0.05000000074505806], [0.8062499761581421, 0.01875000074505806, 0.02500000037252903, 0.02500000037252903], [0.8062499761581421, 0.01875000074505806, 0.05000000074505806, 0.05000000074505806], [0.8187500238418579, 0.01875000074505806, 0.02500000037252903, 0.02500000037252903], [0.8187500238418579, 0.01875000074505806, 0.05000000074505806, 0.05000000074505806], [0.831250011920929, 0.01875000074505806, 0.02500000037252903, 0.02500000037252903], [0.831250011920929, 0.01875000074505806, 0.05000000074505806, 0.05000000074505806], [0.84375, 0.01875000074505806, 0.02500000037252903, 0.02500000037252903], [0.84375, 0.01875000074505806, 0.05000000074505806, 0.05000000074505806], [0.856249988079071, 0.01875000074505806, 0.02500000037252903, 0.02500000037252903], [0.856249988079071, 0.01875000074505806, 0.05000000074505806, 0.05000000074505806], [0.8687499761581421, 0.01875000074505806, 0.02500000037252903, 0.02500000037252903], [0.8687499761581421, 0.01875000074505806, 0.05000000074505806, 0.05000000074505806], [0.8812500238418579, 0.01875000074505806, 0.02500000037252903, 0.02500000037252903], [0.8812500238418579, 0.01875000074505806, 0.05000000074505806, 0.05000000074505806], [0.893750011920929, 0.01875000074505806, 0.02500000037252903, 0.02500000037252903], [0.893750011920929, 0.01875000074505806, 0.05000000074505806, 0.05000000074505806], [0.90625, 0.01875000074505806, 0.02500000037252903, 0.02500000037252903], [0.90625, 0.01875000074505806, 0.05000000074505806, 0.05000000074505806], [0.918749988079071, 0.01875000074505806, 0.02500000037252903, 0.02500000037252903], [0.918749988079071, 0.01875000074505806, 0.05000000074505806, 0.05000000074505806], [0.9312499761581421, 0.01875000074505806, 0.02500000037252903, 0.02500000037252903], [0.9312499761581421, 0.01875000074505806, 0.05000000074505806, 0.05000000074505806], [0.9437500238418579, 0.01875000074505806, 0.02500000037252903, 0.02500000037252903], [0.9437500238418579, 0.01875000074505806, 0.05000000074505806, 0.05000000074505806], [0.956250011920929, 0.01875000074505806, 0.02500000037252903, 0.02500000037252903], [0.956250011920929, 0.01875000074505806, 0.05000000074505806, 0.05000000074505806], [0.96875, 0.01875000074505806, 0.02500000037252903, 0.02500000037252903], [0.96875, 0.01875000074505806, 0.05000000074505806, 0.05000000074505806], [0.981249988079071, 0.01875000074505806, 0.02500000037252903, 0.02500000037252903], [0.981249988079071, 0.01875000074505806, 0.05000000074505806, 0.05000000074505806], [0.9937499761581421, 0.01875000074505806, 0.02500000037252903, 0.02500000037252903], [0.9937499761581421, 0.01875000074505806, 0.05000000074505806, 0.05000000074505806], [0.0062500000931322575, 0.03125, 0.02500000037252903, 0.02500000037252903], [0.0062500000931322575, 0.03125, 0.05000000074505806, 0.05000000074505806], [0.01875000074505806, 0.03125, 0.02500000037252903, 0.02500000037252903], [0.01875000074505806, 0.03125, 0.05000000074505806, 0.05000000074505806], [0.03125, 0.03125, 0.02500000037252903, 0.02500000037252903], [0.03125, 0.03125, 0.05000000074505806, 0.05000000074505806], [0.04374999925494194, 0.03125, 0.02500000037252903, 0.02500000037252903], [0.04374999925494194, 0.03125, 0.05000000074505806, 0.05000000074505806], [0.05624999850988388, 0.03125, 0.02500000037252903, 0.02500000037252903], [0.05624999850988388, 0.03125, 0.05000000074505806, 0.05000000074505806], [0.06875000149011612, 0.03125, 0.02500000037252903, 0.02500000037252903], [0.06875000149011612, 0.03125, 0.05000000074505806, 0.05000000074505806], [0.08124999701976776, 0.03125, 0.02500000037252903, 0.02500000037252903], [0.08124999701976776, 0.03125, 0.05000000074505806, 0.05000000074505806], [0.09375, 0.03125, 0.02500000037252903, 0.02500000037252903], [0.09375, 0.03125, 0.05000000074505806, 0.05000000074505806], [0.10625000298023224, 0.03125, 0.02500000037252903, 0.02500000037252903], [0.10625000298023224, 0.03125, 0.05000000074505806, 0.05000000074505806], [0.11874999850988388, 0.03125, 0.02500000037252903, 0.02500000037252903], [0.11874999850988388, 0.03125, 0.05000000074505806, 0.05000000074505806], [0.13124999403953552, 0.03125, 0.02500000037252903, 0.02500000037252903], [0.13124999403953552, 0.03125, 0.05000000074505806, 0.05000000074505806], [0.14374999701976776, 0.03125, 0.02500000037252903, 0.02500000037252903], [0.14374999701976776, 0.03125, 0.05000000074505806, 0.05000000074505806], [0.15625, 0.03125, 0.02500000037252903, 0.02500000037252903], [0.15625, 0.03125, 0.05000000074505806, 0.05000000074505806], [0.16875000298023224, 0.03125, 0.02500000037252903, 0.02500000037252903], [0.16875000298023224, 0.03125, 0.05000000074505806, 0.05000000074505806], [0.18125000596046448, 0.03125, 0.02500000037252903, 0.02500000037252903], [0.18125000596046448, 0.03125, 0.05000000074505806, 0.05000000074505806], [0.19374999403953552, 0.03125, 0.02500000037252903, 0.02500000037252903], [0.19374999403953552, 0.03125, 0.05000000074505806, 0.05000000074505806], [0.20624999701976776, 0.03125, 0.02500000037252903, 0.02500000037252903], [0.20624999701976776, 0.03125, 0.05000000074505806, 0.05000000074505806], [0.21875, 0.03125, 0.02500000037252903, 0.02500000037252903], [0.21875, 0.03125, 0.05000000074505806, 0.05000000074505806], [0.23125000298023224, 0.03125, 0.02500000037252903, 0.02500000037252903], [0.23125000298023224, 0.03125, 0.05000000074505806, 0.05000000074505806], [0.24375000596046448, 0.03125, 0.02500000037252903, 0.02500000037252903], [0.24375000596046448, 0.03125, 0.05000000074505806, 0.05000000074505806], [0.2562499940395355, 0.03125, 0.02500000037252903, 0.02500000037252903], [0.2562499940395355, 0.03125, 0.05000000074505806, 0.05000000074505806], [0.26875001192092896, 0.03125, 0.02500000037252903, 0.02500000037252903], [0.26875001192092896, 0.03125, 0.05000000074505806, 0.05000000074505806], [0.28125, 0.03125, 0.02500000037252903, 0.02500000037252903], [0.28125, 0.03125, 0.05000000074505806, 0.05000000074505806], [0.29374998807907104, 0.03125, 0.02500000037252903, 0.02500000037252903], [0.29374998807907104, 0.03125, 0.05000000074505806, 0.05000000074505806], [0.3062500059604645, 0.03125, 0.02500000037252903, 0.02500000037252903], [0.3062500059604645, 0.03125, 0.05000000074505806, 0.05000000074505806], [0.3187499940395355, 0.03125, 0.02500000037252903, 0.02500000037252903], [0.3187499940395355, 0.03125, 0.05000000074505806, 0.05000000074505806], [0.33125001192092896, 0.03125, 0.02500000037252903, 0.02500000037252903], [0.33125001192092896, 0.03125, 0.05000000074505806, 0.05000000074505806], [0.34375, 0.03125, 0.02500000037252903, 0.02500000037252903], [0.34375, 0.03125, 0.05000000074505806, 0.05000000074505806], [0.35624998807907104, 0.03125, 0.02500000037252903, 0.02500000037252903], [0.35624998807907104, 0.03125, 0.05000000074505806, 0.05000000074505806], [0.3687500059604645, 0.03125, 0.02500000037252903, 0.02500000037252903], [0.3687500059604645, 0.03125, 0.05000000074505806, 0.05000000074505806], [0.3812499940395355, 0.03125, 0.02500000037252903, 0.02500000037252903], [0.3812499940395355, 0.03125, 0.05000000074505806, 0.05000000074505806], [0.39375001192092896, 0.03125, 0.02500000037252903, 0.02500000037252903], [0.39375001192092896, 0.03125, 0.05000000074505806, 0.05000000074505806], [0.40625, 0.03125, 0.02500000037252903, 0.02500000037252903], [0.40625, 0.03125, 0.05000000074505806, 0.05000000074505806], [0.41874998807907104, 0.03125, 0.02500000037252903, 0.02500000037252903], [0.41874998807907104, 0.03125, 0.05000000074505806, 0.05000000074505806], [0.4312500059604645, 0.03125, 0.02500000037252903, 0.02500000037252903], [0.4312500059604645, 0.03125, 0.05000000074505806, 0.05000000074505806], [0.4437499940395355, 0.03125, 0.02500000037252903, 0.02500000037252903], [0.4437499940395355, 0.03125, 0.05000000074505806, 0.05000000074505806], [0.45625001192092896, 0.03125, 0.02500000037252903, 0.02500000037252903], [0.45625001192092896, 0.03125, 0.05000000074505806, 0.05000000074505806], [0.46875, 0.03125, 0.02500000037252903, 0.02500000037252903], [0.46875, 0.03125, 0.05000000074505806, 0.05000000074505806], [0.48124998807907104, 0.03125, 0.02500000037252903, 0.02500000037252903], [0.48124998807907104, 0.03125, 0.05000000074505806, 0.05000000074505806], [0.4937500059604645, 0.03125, 0.02500000037252903, 0.02500000037252903], [0.4937500059604645, 0.03125, 0.05000000074505806, 0.05000000074505806], [0.5062500238418579, 0.03125, 0.02500000037252903, 0.02500000037252903], [0.5062500238418579, 0.03125, 0.05000000074505806, 0.05000000074505806], [0.518750011920929, 0.03125, 0.02500000037252903, 0.02500000037252903], [0.518750011920929, 0.03125, 0.05000000074505806, 0.05000000074505806], [0.53125, 0.03125, 0.02500000037252903, 0.02500000037252903], [0.53125, 0.03125, 0.05000000074505806, 0.05000000074505806], [0.543749988079071, 0.03125, 0.02500000037252903, 0.02500000037252903], [0.543749988079071, 0.03125, 0.05000000074505806, 0.05000000074505806], [0.5562499761581421, 0.03125, 0.02500000037252903, 0.02500000037252903], [0.5562499761581421, 0.03125, 0.05000000074505806, 0.05000000074505806], [0.5687500238418579, 0.03125, 0.02500000037252903, 0.02500000037252903], [0.5687500238418579, 0.03125, 0.05000000074505806, 0.05000000074505806], [0.581250011920929, 0.03125, 0.02500000037252903, 0.02500000037252903], [0.581250011920929, 0.03125, 0.05000000074505806, 0.05000000074505806], [0.59375, 0.03125, 0.02500000037252903, 0.02500000037252903], [0.59375, 0.03125, 0.05000000074505806, 0.05000000074505806], [0.606249988079071, 0.03125, 0.02500000037252903, 0.02500000037252903], [0.606249988079071, 0.03125, 0.05000000074505806, 0.05000000074505806], [0.6187499761581421, 0.03125, 0.02500000037252903, 0.02500000037252903], [0.6187499761581421, 0.03125, 0.05000000074505806, 0.05000000074505806], [0.6312500238418579, 0.03125, 0.02500000037252903, 0.02500000037252903], [0.6312500238418579, 0.03125, 0.05000000074505806, 0.05000000074505806], [0.643750011920929, 0.03125, 0.02500000037252903, 0.02500000037252903], [0.643750011920929, 0.03125, 0.05000000074505806, 0.05000000074505806], [0.65625, 0.03125, 0.02500000037252903, 0.02500000037252903], [0.65625, 0.03125, 0.05000000074505806, 0.05000000074505806], [0.668749988079071, 0.03125, 0.02500000037252903, 0.02500000037252903], [0.668749988079071, 0.03125, 0.05000000074505806, 0.05000000074505806], [0.6812499761581421, 0.03125, 0.02500000037252903, 0.02500000037252903], [0.6812499761581421, 0.03125, 0.05000000074505806, 0.05000000074505806], [0.6937500238418579, 0.03125, 0.02500000037252903, 0.02500000037252903], [0.6937500238418579, 0.03125, 0.05000000074505806, 0.05000000074505806], [0.706250011920929, 0.03125, 0.02500000037252903, 0.02500000037252903], [0.706250011920929, 0.03125, 0.05000000074505806, 0.05000000074505806], [0.71875, 0.03125, 0.02500000037252903, 0.02500000037252903], [0.71875, 0.03125, 0.05000000074505806, 0.05000000074505806], [0.731249988079071, 0.03125, 0.02500000037252903, 0.02500000037252903], [0.731249988079071, 0.03125, 0.05000000074505806, 0.05000000074505806], [0.7437499761581421, 0.03125, 0.02500000037252903, 0.02500000037252903], [0.7437499761581421, 0.03125, 0.05000000074505806, 0.05000000074505806], [0.7562500238418579, 0.03125, 0.02500000037252903, 0.02500000037252903], [0.7562500238418579, 0.03125, 0.05000000074505806, 0.05000000074505806], [0.768750011920929, 0.03125, 0.02500000037252903, 0.02500000037252903], [0.768750011920929, 0.03125, 0.05000000074505806, 0.05000000074505806], [0.78125, 0.03125, 0.02500000037252903, 0.02500000037252903], [0.78125, 0.03125, 0.05000000074505806, 0.05000000074505806], [0.793749988079071, 0.03125, 0.02500000037252903, 0.02500000037252903], [0.793749988079071, 0.03125, 0.05000000074505806, 0.05000000074505806], [0.8062499761581421, 0.03125, 0.02500000037252903, 0.02500000037252903], [0.8062499761581421, 0.03125, 0.05000000074505806, 0.05000000074505806], [0.8187500238418579, 0.03125, 0.02500000037252903, 0.02500000037252903], [0.8187500238418579, 0.03125, 0.05000000074505806, 0.05000000074505806], [0.831250011920929, 0.03125, 0.02500000037252903, 0.02500000037252903], [0.831250011920929, 0.03125, 0.05000000074505806, 0.05000000074505806], [0.84375, 0.03125, 0.02500000037252903, 0.02500000037252903], [0.84375, 0.03125, 0.05000000074505806, 0.05000000074505806], [0.856249988079071, 0.03125, 0.02500000037252903, 0.02500000037252903], [0.856249988079071, 0.03125, 0.05000000074505806, 0.05000000074505806], [0.8687499761581421, 0.03125, 0.02500000037252903, 0.02500000037252903], [0.8687499761581421, 0.03125, 0.05000000074505806, 0.05000000074505806], [0.8812500238418579, 0.03125, 0.02500000037252903, 0.02500000037252903], [0.8812500238418579, 0.03125, 0.05000000074505806, 0.05000000074505806], [0.893750011920929, 0.03125, 0.02500000037252903, 0.02500000037252903], [0.893750011920929, 0.03125, 0.05000000074505806, 0.05000000074505806], [0.90625, 0.03125, 0.02500000037252903, 0.02500000037252903], [0.90625, 0.03125, 0.05000000074505806, 0.05000000074505806], [0.918749988079071, 0.03125, 0.02500000037252903, 0.02500000037252903], [0.918749988079071, 0.03125, 0.05000000074505806, 0.05000000074505806], [0.9312499761581421, 0.03125, 0.02500000037252903, 0.02500000037252903], [0.9312499761581421, 0.03125, 0.05000000074505806, 0.05000000074505806], [0.9437500238418579, 0.03125, 0.02500000037252903, 0.02500000037252903], [0.9437500238418579, 0.03125, 0.05000000074505806, 0.05000000074505806], [0.956250011920929, 0.03125, 0.02500000037252903, 0.02500000037252903], [0.956250011920929, 0.03125, 0.05000000074505806, 0.05000000074505806], [0.96875, 0.03125, 0.02500000037252903, 0.02500000037252903], [0.96875, 0.03125, 0.05000000074505806, 0.05000000074505806], [0.981249988079071, 0.03125, 0.02500000037252903, 0.02500000037252903], [0.981249988079071, 0.03125, 0.05000000074505806, 0.05000000074505806], [0.9937499761581421, 0.03125, 0.02500000037252903, 0.02500000037252903], [0.9937499761581421, 0.03125, 0.05000000074505806, 0.05000000074505806], [0.0062500000931322575, 0.04374999925494194, 0.02500000037252903, 0.02500000037252903], [0.0062500000931322575, 0.04374999925494194, 0.05000000074505806, 0.05000000074505806], [0.01875000074505806, 0.04374999925494194, 0.02500000037252903, 0.02500000037252903], [0.01875000074505806, 0.04374999925494194, 0.05000000074505806, 0.05000000074505806], [0.03125, 0.04374999925494194, 0.02500000037252903, 0.02500000037252903], [0.03125, 0.04374999925494194, 0.05000000074505806, 0.05000000074505806], [0.04374999925494194, 0.04374999925494194, 0.02500000037252903, 0.02500000037252903], [0.04374999925494194, 0.04374999925494194, 0.05000000074505806, 0.05000000074505806], [0.05624999850988388, 0.04374999925494194, 0.02500000037252903, 0.02500000037252903], [0.05624999850988388, 0.04374999925494194, 0.05000000074505806, 0.05000000074505806], [0.06875000149011612, 0.04374999925494194, 0.02500000037252903, 0.02500000037252903], [0.06875000149011612, 0.04374999925494194, 0.05000000074505806, 0.05000000074505806], [0.08124999701976776, 0.04374999925494194, 0.02500000037252903, 0.02500000037252903], [0.08124999701976776, 0.04374999925494194, 0.05000000074505806, 0.05000000074505806], [0.09375, 0.04374999925494194, 0.02500000037252903, 0.02500000037252903], [0.09375, 0.04374999925494194, 0.05000000074505806, 0.05000000074505806], [0.10625000298023224, 0.04374999925494194, 0.02500000037252903, 0.02500000037252903], [0.10625000298023224, 0.04374999925494194, 0.05000000074505806, 0.05000000074505806], [0.11874999850988388, 0.04374999925494194, 0.02500000037252903, 0.02500000037252903], [0.11874999850988388, 0.04374999925494194, 0.05000000074505806, 0.05000000074505806], [0.13124999403953552, 0.04374999925494194, 0.02500000037252903, 0.02500000037252903], [0.13124999403953552, 0.04374999925494194, 0.05000000074505806, 0.05000000074505806], [0.14374999701976776, 0.04374999925494194, 0.02500000037252903, 0.02500000037252903], [0.14374999701976776, 0.04374999925494194, 0.05000000074505806, 0.05000000074505806], [0.15625, 0.04374999925494194, 0.02500000037252903, 0.02500000037252903], [0.15625, 0.04374999925494194, 0.05000000074505806, 0.05000000074505806], [0.16875000298023224, 0.04374999925494194, 0.02500000037252903, 0.02500000037252903], [0.16875000298023224, 0.04374999925494194, 0.05000000074505806, 0.05000000074505806], [0.18125000596046448, 0.04374999925494194, 0.02500000037252903, 0.02500000037252903], [0.18125000596046448, 0.04374999925494194, 0.05000000074505806, 0.05000000074505806], [0.19374999403953552, 0.04374999925494194, 0.02500000037252903, 0.02500000037252903], [0.19374999403953552, 0.04374999925494194, 0.05000000074505806, 0.05000000074505806], [0.20624999701976776, 0.04374999925494194, 0.02500000037252903, 0.02500000037252903], [0.20624999701976776, 0.04374999925494194, 0.05000000074505806, 0.05000000074505806], [0.21875, 0.04374999925494194, 0.02500000037252903, 0.02500000037252903], [0.21875, 0.04374999925494194, 0.05000000074505806, 0.05000000074505806], [0.23125000298023224, 0.04374999925494194, 0.02500000037252903, 0.02500000037252903], [0.23125000298023224, 0.04374999925494194, 0.05000000074505806, 0.05000000074505806], [0.24375000596046448, 0.04374999925494194, 0.02500000037252903, 0.02500000037252903], [0.24375000596046448, 0.04374999925494194, 0.05000000074505806, 0.05000000074505806], [0.2562499940395355, 0.04374999925494194, 0.02500000037252903, 0.02500000037252903], [0.2562499940395355, 0.04374999925494194, 0.05000000074505806, 0.05000000074505806], [0.26875001192092896, 0.04374999925494194, 0.02500000037252903, 0.02500000037252903], [0.26875001192092896, 0.04374999925494194, 0.05000000074505806, 0.05000000074505806], [0.28125, 0.04374999925494194, 0.02500000037252903, 0.02500000037252903], [0.28125, 0.04374999925494194, 0.05000000074505806, 0.05000000074505806], [0.29374998807907104, 0.04374999925494194, 0.02500000037252903, 0.02500000037252903], [0.29374998807907104, 0.04374999925494194, 0.05000000074505806, 0.05000000074505806], [0.3062500059604645, 0.04374999925494194, 0.02500000037252903, 0.02500000037252903], [0.3062500059604645, 0.04374999925494194, 0.05000000074505806, 0.05000000074505806], [0.3187499940395355, 0.04374999925494194, 0.02500000037252903, 0.02500000037252903], [0.3187499940395355, 0.04374999925494194, 0.05000000074505806, 0.05000000074505806], [0.33125001192092896, 0.04374999925494194, 0.02500000037252903, 0.02500000037252903], [0.33125001192092896, 0.04374999925494194, 0.05000000074505806, 0.05000000074505806], [0.34375, 0.04374999925494194, 0.02500000037252903, 0.02500000037252903], [0.34375, 0.04374999925494194, 0.05000000074505806, 0.05000000074505806], [0.35624998807907104, 0.04374999925494194, 0.02500000037252903, 0.02500000037252903], [0.35624998807907104, 0.04374999925494194, 0.05000000074505806, 0.05000000074505806], [0.3687500059604645, 0.04374999925494194, 0.02500000037252903, 0.02500000037252903], [0.3687500059604645, 0.04374999925494194, 0.05000000074505806, 0.05000000074505806], [0.3812499940395355, 0.04374999925494194, 0.02500000037252903, 0.02500000037252903], [0.3812499940395355, 0.04374999925494194, 0.05000000074505806, 0.05000000074505806], [0.39375001192092896, 0.04374999925494194, 0.02500000037252903, 0.02500000037252903], [0.39375001192092896, 0.04374999925494194, 0.05000000074505806, 0.05000000074505806], [0.40625, 0.04374999925494194, 0.02500000037252903, 0.02500000037252903], [0.40625, 0.04374999925494194, 0.05000000074505806, 0.05000000074505806], [0.41874998807907104, 0.04374999925494194, 0.02500000037252903, 0.02500000037252903], [0.41874998807907104, 0.04374999925494194, 0.05000000074505806, 0.05000000074505806], [0.4312500059604645, 0.04374999925494194, 0.02500000037252903, 0.02500000037252903], [0.4312500059604645, 0.04374999925494194, 0.05000000074505806, 0.05000000074505806], [0.4437499940395355, 0.04374999925494194, 0.02500000037252903, 0.02500000037252903], [0.4437499940395355, 0.04374999925494194, 0.05000000074505806, 0.05000000074505806], [0.45625001192092896, 0.04374999925494194, 0.02500000037252903, 0.02500000037252903], [0.45625001192092896, 0.04374999925494194, 0.05000000074505806, 0.05000000074505806], [0.46875, 0.04374999925494194, 0.02500000037252903, 0.02500000037252903], [0.46875, 0.04374999925494194, 0.05000000074505806, 0.05000000074505806], [0.48124998807907104, 0.04374999925494194, 0.02500000037252903, 0.02500000037252903], [0.48124998807907104, 0.04374999925494194, 0.05000000074505806, 0.05000000074505806], [0.4937500059604645, 0.04374999925494194, 0.02500000037252903, 0.02500000037252903], [0.4937500059604645, 0.04374999925494194, 0.05000000074505806, 0.05000000074505806], [0.5062500238418579, 0.04374999925494194, 0.02500000037252903, 0.02500000037252903], [0.5062500238418579, 0.04374999925494194, 0.05000000074505806, 0.05000000074505806], [0.518750011920929, 0.04374999925494194, 0.02500000037252903, 0.02500000037252903], [0.518750011920929, 0.04374999925494194, 0.05000000074505806, 0.05000000074505806], [0.53125, 0.04374999925494194, 0.02500000037252903, 0.02500000037252903], [0.53125, 0.04374999925494194, 0.05000000074505806, 0.05000000074505806], [0.543749988079071, 0.04374999925494194, 0.02500000037252903, 0.02500000037252903], [0.543749988079071, 0.04374999925494194, 0.05000000074505806, 0.05000000074505806], [0.5562499761581421, 0.04374999925494194, 0.02500000037252903, 0.02500000037252903], [0.5562499761581421, 0.04374999925494194, 0.05000000074505806, 0.05000000074505806], [0.5687500238418579, 0.04374999925494194, 0.02500000037252903, 0.02500000037252903], [0.5687500238418579, 0.04374999925494194, 0.05000000074505806, 0.05000000074505806], [0.581250011920929, 0.04374999925494194, 0.02500000037252903, 0.02500000037252903], [0.581250011920929, 0.04374999925494194, 0.05000000074505806, 0.05000000074505806], [0.59375, 0.04374999925494194, 0.02500000037252903, 0.02500000037252903], [0.59375, 0.04374999925494194, 0.05000000074505806, 0.05000000074505806], [0.606249988079071, 0.04374999925494194, 0.02500000037252903, 0.02500000037252903], [0.606249988079071, 0.04374999925494194, 0.05000000074505806, 0.05000000074505806], [0.6187499761581421, 0.04374999925494194, 0.02500000037252903, 0.02500000037252903], [0.6187499761581421, 0.04374999925494194, 0.05000000074505806, 0.05000000074505806], [0.6312500238418579, 0.04374999925494194, 0.02500000037252903, 0.02500000037252903], [0.6312500238418579, 0.04374999925494194, 0.05000000074505806, 0.05000000074505806], [0.643750011920929, 0.04374999925494194, 0.02500000037252903, 0.02500000037252903], [0.643750011920929, 0.04374999925494194, 0.05000000074505806, 0.05000000074505806], [0.65625, 0.04374999925494194, 0.02500000037252903, 0.02500000037252903], [0.65625, 0.04374999925494194, 0.05000000074505806, 0.05000000074505806], [0.668749988079071, 0.04374999925494194, 0.02500000037252903, 0.02500000037252903], [0.668749988079071, 0.04374999925494194, 0.05000000074505806, 0.05000000074505806], [0.6812499761581421, 0.04374999925494194, 0.02500000037252903, 0.02500000037252903], [0.6812499761581421, 0.04374999925494194, 0.05000000074505806, 0.05000000074505806], [0.6937500238418579, 0.04374999925494194, 0.02500000037252903, 0.02500000037252903], [0.6937500238418579, 0.04374999925494194, 0.05000000074505806, 0.05000000074505806], [0.706250011920929, 0.04374999925494194, 0.02500000037252903, 0.02500000037252903], [0.706250011920929, 0.04374999925494194, 0.05000000074505806, 0.05000000074505806], [0.71875, 0.04374999925494194, 0.02500000037252903, 0.02500000037252903], [0.71875, 0.04374999925494194, 0.05000000074505806, 0.05000000074505806], [0.731249988079071, 0.04374999925494194, 0.02500000037252903, 0.02500000037252903], [0.731249988079071, 0.04374999925494194, 0.05000000074505806, 0.05000000074505806], [0.7437499761581421, 0.04374999925494194, 0.02500000037252903, 0.02500000037252903], [0.7437499761581421, 0.04374999925494194, 0.05000000074505806, 0.05000000074505806], [0.7562500238418579, 0.04374999925494194, 0.02500000037252903, 0.02500000037252903], [0.7562500238418579, 0.04374999925494194, 0.05000000074505806, 0.05000000074505806], [0.768750011920929, 0.04374999925494194, 0.02500000037252903, 0.02500000037252903], [0.768750011920929, 0.04374999925494194, 0.05000000074505806, 0.05000000074505806], [0.78125, 0.04374999925494194, 0.02500000037252903, 0.02500000037252903], [0.78125, 0.04374999925494194, 0.05000000074505806, 0.05000000074505806], [0.793749988079071, 0.04374999925494194, 0.02500000037252903, 0.02500000037252903], [0.793749988079071, 0.04374999925494194, 0.05000000074505806, 0.05000000074505806], [0.8062499761581421, 0.04374999925494194, 0.02500000037252903, 0.02500000037252903], [0.8062499761581421, 0.04374999925494194, 0.05000000074505806, 0.05000000074505806], [0.8187500238418579, 0.04374999925494194, 0.02500000037252903, 0.02500000037252903], [0.8187500238418579, 0.04374999925494194, 0.05000000074505806, 0.05000000074505806], [0.831250011920929, 0.04374999925494194, 0.02500000037252903, 0.02500000037252903], [0.831250011920929, 0.04374999925494194, 0.05000000074505806, 0.05000000074505806], [0.84375, 0.04374999925494194, 0.02500000037252903, 0.02500000037252903], [0.84375, 0.04374999925494194, 0.05000000074505806, 0.05000000074505806], [0.856249988079071, 0.04374999925494194, 0.02500000037252903, 0.02500000037252903], [0.856249988079071, 0.04374999925494194, 0.05000000074505806, 0.05000000074505806], [0.8687499761581421, 0.04374999925494194, 0.02500000037252903, 0.02500000037252903], [0.8687499761581421, 0.04374999925494194, 0.05000000074505806, 0.05000000074505806], [0.8812500238418579, 0.04374999925494194, 0.02500000037252903, 0.02500000037252903], [0.8812500238418579, 0.04374999925494194, 0.05000000074505806, 0.05000000074505806], [0.893750011920929, 0.04374999925494194, 0.02500000037252903, 0.02500000037252903], [0.893750011920929, 0.04374999925494194, 0.05000000074505806, 0.05000000074505806], [0.90625, 0.04374999925494194, 0.02500000037252903, 0.02500000037252903], [0.90625, 0.04374999925494194, 0.05000000074505806, 0.05000000074505806], [0.918749988079071, 0.04374999925494194, 0.02500000037252903, 0.02500000037252903], [0.918749988079071, 0.04374999925494194, 0.05000000074505806, 0.05000000074505806], [0.9312499761581421, 0.04374999925494194, 0.02500000037252903, 0.02500000037252903], [0.9312499761581421, 0.04374999925494194, 0.05000000074505806, 0.05000000074505806], [0.9437500238418579, 0.04374999925494194, 0.02500000037252903, 0.02500000037252903], [0.9437500238418579, 0.04374999925494194, 0.05000000074505806, 0.05000000074505806], [0.956250011920929, 0.04374999925494194, 0.02500000037252903, 0.02500000037252903], [0.956250011920929, 0.04374999925494194, 0.05000000074505806, 0.05000000074505806], [0.96875, 0.04374999925494194, 0.02500000037252903, 0.02500000037252903], [0.96875, 0.04374999925494194, 0.05000000074505806, 0.05000000074505806], [0.981249988079071, 0.04374999925494194, 0.02500000037252903, 0.02500000037252903], [0.981249988079071, 0.04374999925494194, 0.05000000074505806, 0.05000000074505806], [0.9937499761581421, 0.04374999925494194, 0.02500000037252903, 0.02500000037252903], [0.9937499761581421, 0.04374999925494194, 0.05000000074505806, 0.05000000074505806], [0.0062500000931322575, 0.05624999850988388, 0.02500000037252903, 0.02500000037252903], [0.0062500000931322575, 0.05624999850988388, 0.05000000074505806, 0.05000000074505806], [0.01875000074505806, 0.05624999850988388, 0.02500000037252903, 0.02500000037252903], [0.01875000074505806, 0.05624999850988388, 0.05000000074505806, 0.05000000074505806], [0.03125, 0.05624999850988388, 0.02500000037252903, 0.02500000037252903], [0.03125, 0.05624999850988388, 0.05000000074505806, 0.05000000074505806], [0.04374999925494194, 0.05624999850988388, 0.02500000037252903, 0.02500000037252903], [0.04374999925494194, 0.05624999850988388, 0.05000000074505806, 0.05000000074505806], [0.05624999850988388, 0.05624999850988388, 0.02500000037252903, 0.02500000037252903], [0.05624999850988388, 0.05624999850988388, 0.05000000074505806, 0.05000000074505806], [0.06875000149011612, 0.05624999850988388, 0.02500000037252903, 0.02500000037252903], [0.06875000149011612, 0.05624999850988388, 0.05000000074505806, 0.05000000074505806], [0.08124999701976776, 0.05624999850988388, 0.02500000037252903, 0.02500000037252903], [0.08124999701976776, 0.05624999850988388, 0.05000000074505806, 0.05000000074505806], [0.09375, 0.05624999850988388, 0.02500000037252903, 0.02500000037252903], [0.09375, 0.05624999850988388, 0.05000000074505806, 0.05000000074505806], [0.10625000298023224, 0.05624999850988388, 0.02500000037252903, 0.02500000037252903], [0.10625000298023224, 0.05624999850988388, 0.05000000074505806, 0.05000000074505806], [0.11874999850988388, 0.05624999850988388, 0.02500000037252903, 0.02500000037252903], [0.11874999850988388, 0.05624999850988388, 0.05000000074505806, 0.05000000074505806], [0.13124999403953552, 0.05624999850988388, 0.02500000037252903, 0.02500000037252903], [0.13124999403953552, 0.05624999850988388, 0.05000000074505806, 0.05000000074505806], [0.14374999701976776, 0.05624999850988388, 0.02500000037252903, 0.02500000037252903], [0.14374999701976776, 0.05624999850988388, 0.05000000074505806, 0.05000000074505806], [0.15625, 0.05624999850988388, 0.02500000037252903, 0.02500000037252903], [0.15625, 0.05624999850988388, 0.05000000074505806, 0.05000000074505806], [0.16875000298023224, 0.05624999850988388, 0.02500000037252903, 0.02500000037252903], [0.16875000298023224, 0.05624999850988388, 0.05000000074505806, 0.05000000074505806], [0.18125000596046448, 0.05624999850988388, 0.02500000037252903, 0.02500000037252903], [0.18125000596046448, 0.05624999850988388, 0.05000000074505806, 0.05000000074505806], [0.19374999403953552, 0.05624999850988388, 0.02500000037252903, 0.02500000037252903], [0.19374999403953552, 0.05624999850988388, 0.05000000074505806, 0.05000000074505806], [0.20624999701976776, 0.05624999850988388, 0.02500000037252903, 0.02500000037252903], [0.20624999701976776, 0.05624999850988388, 0.05000000074505806, 0.05000000074505806], [0.21875, 0.05624999850988388, 0.02500000037252903, 0.02500000037252903], [0.21875, 0.05624999850988388, 0.05000000074505806, 0.05000000074505806], [0.23125000298023224, 0.05624999850988388, 0.02500000037252903, 0.02500000037252903], [0.23125000298023224, 0.05624999850988388, 0.05000000074505806, 0.05000000074505806], [0.24375000596046448, 0.05624999850988388, 0.02500000037252903, 0.02500000037252903], [0.24375000596046448, 0.05624999850988388, 0.05000000074505806, 0.05000000074505806], [0.2562499940395355, 0.05624999850988388, 0.02500000037252903, 0.02500000037252903], [0.2562499940395355, 0.05624999850988388, 0.05000000074505806, 0.05000000074505806], [0.26875001192092896, 0.05624999850988388, 0.02500000037252903, 0.02500000037252903], [0.26875001192092896, 0.05624999850988388, 0.05000000074505806, 0.05000000074505806], [0.28125, 0.05624999850988388, 0.02500000037252903, 0.02500000037252903], [0.28125, 0.05624999850988388, 0.05000000074505806, 0.05000000074505806], [0.29374998807907104, 0.05624999850988388, 0.02500000037252903, 0.02500000037252903], [0.29374998807907104, 0.05624999850988388, 0.05000000074505806, 0.05000000074505806], [0.3062500059604645, 0.05624999850988388, 0.02500000037252903, 0.02500000037252903], [0.3062500059604645, 0.05624999850988388, 0.05000000074505806, 0.05000000074505806], [0.3187499940395355, 0.05624999850988388, 0.02500000037252903, 0.02500000037252903], [0.3187499940395355, 0.05624999850988388, 0.05000000074505806, 0.05000000074505806], [0.33125001192092896, 0.05624999850988388, 0.02500000037252903, 0.02500000037252903], [0.33125001192092896, 0.05624999850988388, 0.05000000074505806, 0.05000000074505806], [0.34375, 0.05624999850988388, 0.02500000037252903, 0.02500000037252903], [0.34375, 0.05624999850988388, 0.05000000074505806, 0.05000000074505806], [0.35624998807907104, 0.05624999850988388, 0.02500000037252903, 0.02500000037252903], [0.35624998807907104, 0.05624999850988388, 0.05000000074505806, 0.05000000074505806], [0.3687500059604645, 0.05624999850988388, 0.02500000037252903, 0.02500000037252903], [0.3687500059604645, 0.05624999850988388, 0.05000000074505806, 0.05000000074505806], [0.3812499940395355, 0.05624999850988388, 0.02500000037252903, 0.02500000037252903], [0.3812499940395355, 0.05624999850988388, 0.05000000074505806, 0.05000000074505806], [0.39375001192092896, 0.05624999850988388, 0.02500000037252903, 0.02500000037252903], [0.39375001192092896, 0.05624999850988388, 0.05000000074505806, 0.05000000074505806], [0.40625, 0.05624999850988388, 0.02500000037252903, 0.02500000037252903], [0.40625, 0.05624999850988388, 0.05000000074505806, 0.05000000074505806], [0.41874998807907104, 0.05624999850988388, 0.02500000037252903, 0.02500000037252903], [0.41874998807907104, 0.05624999850988388, 0.05000000074505806, 0.05000000074505806], [0.4312500059604645, 0.05624999850988388, 0.02500000037252903, 0.02500000037252903], [0.4312500059604645, 0.05624999850988388, 0.05000000074505806, 0.05000000074505806], [0.4437499940395355, 0.05624999850988388, 0.02500000037252903, 0.02500000037252903], [0.4437499940395355, 0.05624999850988388, 0.05000000074505806, 0.05000000074505806], [0.45625001192092896, 0.05624999850988388, 0.02500000037252903, 0.02500000037252903], [0.45625001192092896, 0.05624999850988388, 0.05000000074505806, 0.05000000074505806], [0.46875, 0.05624999850988388, 0.02500000037252903, 0.02500000037252903], [0.46875, 0.05624999850988388, 0.05000000074505806, 0.05000000074505806], [0.48124998807907104, 0.05624999850988388, 0.02500000037252903, 0.02500000037252903], [0.48124998807907104, 0.05624999850988388, 0.05000000074505806, 0.05000000074505806], [0.4937500059604645, 0.05624999850988388, 0.02500000037252903, 0.02500000037252903], [0.4937500059604645, 0.05624999850988388, 0.05000000074505806, 0.05000000074505806], [0.5062500238418579, 0.05624999850988388, 0.02500000037252903, 0.02500000037252903], [0.5062500238418579, 0.05624999850988388, 0.05000000074505806, 0.05000000074505806], [0.518750011920929, 0.05624999850988388, 0.02500000037252903, 0.02500000037252903], [0.518750011920929, 0.05624999850988388, 0.05000000074505806, 0.05000000074505806], [0.53125, 0.05624999850988388, 0.02500000037252903, 0.02500000037252903], [0.53125, 0.05624999850988388, 0.05000000074505806, 0.05000000074505806], [0.543749988079071, 0.05624999850988388, 0.02500000037252903, 0.02500000037252903], [0.543749988079071, 0.05624999850988388, 0.05000000074505806, 0.05000000074505806], [0.5562499761581421, 0.05624999850988388, 0.02500000037252903, 0.02500000037252903], [0.5562499761581421, 0.05624999850988388, 0.05000000074505806, 0.05000000074505806], [0.5687500238418579, 0.05624999850988388, 0.02500000037252903, 0.02500000037252903], [0.5687500238418579, 0.05624999850988388, 0.05000000074505806, 0.05000000074505806], [0.581250011920929, 0.05624999850988388, 0.02500000037252903, 0.02500000037252903], [0.581250011920929, 0.05624999850988388, 0.05000000074505806, 0.05000000074505806], [0.59375, 0.05624999850988388, 0.02500000037252903, 0.02500000037252903], [0.59375, 0.05624999850988388, 0.05000000074505806, 0.05000000074505806], [0.606249988079071, 0.05624999850988388, 0.02500000037252903, 0.02500000037252903], [0.606249988079071, 0.05624999850988388, 0.05000000074505806, 0.05000000074505806], [0.6187499761581421, 0.05624999850988388, 0.02500000037252903, 0.02500000037252903], [0.6187499761581421, 0.05624999850988388, 0.05000000074505806, 0.05000000074505806], [0.6312500238418579, 0.05624999850988388, 0.02500000037252903, 0.02500000037252903], [0.6312500238418579, 0.05624999850988388, 0.05000000074505806, 0.05000000074505806], [0.643750011920929, 0.05624999850988388, 0.02500000037252903, 0.02500000037252903], [0.643750011920929, 0.05624999850988388, 0.05000000074505806, 0.05000000074505806], [0.65625, 0.05624999850988388, 0.02500000037252903, 0.02500000037252903], [0.65625, 0.05624999850988388, 0.05000000074505806, 0.05000000074505806], [0.668749988079071, 0.05624999850988388, 0.02500000037252903, 0.02500000037252903], [0.668749988079071, 0.05624999850988388, 0.05000000074505806, 0.05000000074505806], [0.6812499761581421, 0.05624999850988388, 0.02500000037252903, 0.02500000037252903], [0.6812499761581421, 0.05624999850988388, 0.05000000074505806, 0.05000000074505806], [0.6937500238418579, 0.05624999850988388, 0.02500000037252903, 0.02500000037252903], [0.6937500238418579, 0.05624999850988388, 0.05000000074505806, 0.05000000074505806], [0.706250011920929, 0.05624999850988388, 0.02500000037252903, 0.02500000037252903], [0.706250011920929, 0.05624999850988388, 0.05000000074505806, 0.05000000074505806], [0.71875, 0.05624999850988388, 0.02500000037252903, 0.02500000037252903], [0.71875, 0.05624999850988388, 0.05000000074505806, 0.05000000074505806], [0.731249988079071, 0.05624999850988388, 0.02500000037252903, 0.02500000037252903], [0.731249988079071, 0.05624999850988388, 0.05000000074505806, 0.05000000074505806], [0.7437499761581421, 0.05624999850988388, 0.02500000037252903, 0.02500000037252903], [0.7437499761581421, 0.05624999850988388, 0.05000000074505806, 0.05000000074505806], [0.7562500238418579, 0.05624999850988388, 0.02500000037252903, 0.02500000037252903], [0.7562500238418579, 0.05624999850988388, 0.05000000074505806, 0.05000000074505806], [0.768750011920929, 0.05624999850988388, 0.02500000037252903, 0.02500000037252903], [0.768750011920929, 0.05624999850988388, 0.05000000074505806, 0.05000000074505806], [0.78125, 0.05624999850988388, 0.02500000037252903, 0.02500000037252903], [0.78125, 0.05624999850988388, 0.05000000074505806, 0.05000000074505806], [0.793749988079071, 0.05624999850988388, 0.02500000037252903, 0.02500000037252903], [0.793749988079071, 0.05624999850988388, 0.05000000074505806, 0.05000000074505806], [0.8062499761581421, 0.05624999850988388, 0.02500000037252903, 0.02500000037252903], [0.8062499761581421, 0.05624999850988388, 0.05000000074505806, 0.05000000074505806], [0.8187500238418579, 0.05624999850988388, 0.02500000037252903, 0.02500000037252903], [0.8187500238418579, 0.05624999850988388, 0.05000000074505806, 0.05000000074505806], [0.831250011920929, 0.05624999850988388, 0.02500000037252903, 0.02500000037252903], [0.831250011920929, 0.05624999850988388, 0.05000000074505806, 0.05000000074505806], [0.84375, 0.05624999850988388, 0.02500000037252903, 0.02500000037252903], [0.84375, 0.05624999850988388, 0.05000000074505806, 0.05000000074505806], [0.856249988079071, 0.05624999850988388, 0.02500000037252903, 0.02500000037252903], [0.856249988079071, 0.05624999850988388, 0.05000000074505806, 0.05000000074505806], [0.8687499761581421, 0.05624999850988388, 0.02500000037252903, 0.02500000037252903], [0.8687499761581421, 0.05624999850988388, 0.05000000074505806, 0.05000000074505806], [0.8812500238418579, 0.05624999850988388, 0.02500000037252903, 0.02500000037252903], [0.8812500238418579, 0.05624999850988388, 0.05000000074505806, 0.05000000074505806], [0.893750011920929, 0.05624999850988388, 0.02500000037252903, 0.02500000037252903], [0.893750011920929, 0.05624999850988388, 0.05000000074505806, 0.05000000074505806], [0.90625, 0.05624999850988388, 0.02500000037252903, 0.02500000037252903], [0.90625, 0.05624999850988388, 0.05000000074505806, 0.05000000074505806], [0.918749988079071, 0.05624999850988388, 0.02500000037252903, 0.02500000037252903], [0.918749988079071, 0.05624999850988388, 0.05000000074505806, 0.05000000074505806], [0.9312499761581421, 0.05624999850988388, 0.02500000037252903, 0.02500000037252903], [0.9312499761581421, 0.05624999850988388, 0.05000000074505806, 0.05000000074505806], [0.9437500238418579, 0.05624999850988388, 0.02500000037252903, 0.02500000037252903], [0.9437500238418579, 0.05624999850988388, 0.05000000074505806, 0.05000000074505806], [0.956250011920929, 0.05624999850988388, 0.02500000037252903, 0.02500000037252903], [0.956250011920929, 0.05624999850988388, 0.05000000074505806, 0.05000000074505806], [0.96875, 0.05624999850988388, 0.02500000037252903, 0.02500000037252903], [0.96875, 0.05624999850988388, 0.05000000074505806, 0.05000000074505806], [0.981249988079071, 0.05624999850988388, 0.02500000037252903, 0.02500000037252903], [0.981249988079071, 0.05624999850988388, 0.05000000074505806, 0.05000000074505806], [0.9937499761581421, 0.05624999850988388, 0.02500000037252903, 0.02500000037252903], [0.9937499761581421, 0.05624999850988388, 0.05000000074505806, 0.05000000074505806], [0.0062500000931322575, 0.06875000149011612, 0.02500000037252903, 0.02500000037252903], [0.0062500000931322575, 0.06875000149011612, 0.05000000074505806, 0.05000000074505806], [0.01875000074505806, 0.06875000149011612, 0.02500000037252903, 0.02500000037252903], [0.01875000074505806, 0.06875000149011612, 0.05000000074505806, 0.05000000074505806], [0.03125, 0.06875000149011612, 0.02500000037252903, 0.02500000037252903], [0.03125, 0.06875000149011612, 0.05000000074505806, 0.05000000074505806], [0.04374999925494194, 0.06875000149011612, 0.02500000037252903, 0.02500000037252903], [0.04374999925494194, 0.06875000149011612, 0.05000000074505806, 0.05000000074505806], [0.05624999850988388, 0.06875000149011612, 0.02500000037252903, 0.02500000037252903], [0.05624999850988388, 0.06875000149011612, 0.05000000074505806, 0.05000000074505806], [0.06875000149011612, 0.06875000149011612, 0.02500000037252903, 0.02500000037252903], [0.06875000149011612, 0.06875000149011612, 0.05000000074505806, 0.05000000074505806], [0.08124999701976776, 0.06875000149011612, 0.02500000037252903, 0.02500000037252903], [0.08124999701976776, 0.06875000149011612, 0.05000000074505806, 0.05000000074505806], [0.09375, 0.06875000149011612, 0.02500000037252903, 0.02500000037252903], [0.09375, 0.06875000149011612, 0.05000000074505806, 0.05000000074505806], [0.10625000298023224, 0.06875000149011612, 0.02500000037252903, 0.02500000037252903], [0.10625000298023224, 0.06875000149011612, 0.05000000074505806, 0.05000000074505806], [0.11874999850988388, 0.06875000149011612, 0.02500000037252903, 0.02500000037252903], [0.11874999850988388, 0.06875000149011612, 0.05000000074505806, 0.05000000074505806], [0.13124999403953552, 0.06875000149011612, 0.02500000037252903, 0.02500000037252903], [0.13124999403953552, 0.06875000149011612, 0.05000000074505806, 0.05000000074505806], [0.14374999701976776, 0.06875000149011612, 0.02500000037252903, 0.02500000037252903], [0.14374999701976776, 0.06875000149011612, 0.05000000074505806, 0.05000000074505806], [0.15625, 0.06875000149011612, 0.02500000037252903, 0.02500000037252903], [0.15625, 0.06875000149011612, 0.05000000074505806, 0.05000000074505806], [0.16875000298023224, 0.06875000149011612, 0.02500000037252903, 0.02500000037252903], [0.16875000298023224, 0.06875000149011612, 0.05000000074505806, 0.05000000074505806], [0.18125000596046448, 0.06875000149011612, 0.02500000037252903, 0.02500000037252903], [0.18125000596046448, 0.06875000149011612, 0.05000000074505806, 0.05000000074505806], [0.19374999403953552, 0.06875000149011612, 0.02500000037252903, 0.02500000037252903], [0.19374999403953552, 0.06875000149011612, 0.05000000074505806, 0.05000000074505806], [0.20624999701976776, 0.06875000149011612, 0.02500000037252903, 0.02500000037252903], [0.20624999701976776, 0.06875000149011612, 0.05000000074505806, 0.05000000074505806], [0.21875, 0.06875000149011612, 0.02500000037252903, 0.02500000037252903], [0.21875, 0.06875000149011612, 0.05000000074505806, 0.05000000074505806], [0.23125000298023224, 0.06875000149011612, 0.02500000037252903, 0.02500000037252903], [0.23125000298023224, 0.06875000149011612, 0.05000000074505806, 0.05000000074505806], [0.24375000596046448, 0.06875000149011612, 0.02500000037252903, 0.02500000037252903], [0.24375000596046448, 0.06875000149011612, 0.05000000074505806, 0.05000000074505806], [0.2562499940395355, 0.06875000149011612, 0.02500000037252903, 0.02500000037252903], [0.2562499940395355, 0.06875000149011612, 0.05000000074505806, 0.05000000074505806], [0.26875001192092896, 0.06875000149011612, 0.02500000037252903, 0.02500000037252903], [0.26875001192092896, 0.06875000149011612, 0.05000000074505806, 0.05000000074505806], [0.28125, 0.06875000149011612, 0.02500000037252903, 0.02500000037252903], [0.28125, 0.06875000149011612, 0.05000000074505806, 0.05000000074505806], [0.29374998807907104, 0.06875000149011612, 0.02500000037252903, 0.02500000037252903], [0.29374998807907104, 0.06875000149011612, 0.05000000074505806, 0.05000000074505806], [0.3062500059604645, 0.06875000149011612, 0.02500000037252903, 0.02500000037252903], [0.3062500059604645, 0.06875000149011612, 0.05000000074505806, 0.05000000074505806], [0.3187499940395355, 0.06875000149011612, 0.02500000037252903, 0.02500000037252903], [0.3187499940395355, 0.06875000149011612, 0.05000000074505806, 0.05000000074505806], [0.33125001192092896, 0.06875000149011612, 0.02500000037252903, 0.02500000037252903], [0.33125001192092896, 0.06875000149011612, 0.05000000074505806, 0.05000000074505806], [0.34375, 0.06875000149011612, 0.02500000037252903, 0.02500000037252903], [0.34375, 0.06875000149011612, 0.05000000074505806, 0.05000000074505806], [0.35624998807907104, 0.06875000149011612, 0.02500000037252903, 0.02500000037252903], [0.35624998807907104, 0.06875000149011612, 0.05000000074505806, 0.05000000074505806], [0.3687500059604645, 0.06875000149011612, 0.02500000037252903, 0.02500000037252903], [0.3687500059604645, 0.06875000149011612, 0.05000000074505806, 0.05000000074505806], [0.3812499940395355, 0.06875000149011612, 0.02500000037252903, 0.02500000037252903], [0.3812499940395355, 0.06875000149011612, 0.05000000074505806, 0.05000000074505806], [0.39375001192092896, 0.06875000149011612, 0.02500000037252903, 0.02500000037252903], [0.39375001192092896, 0.06875000149011612, 0.05000000074505806, 0.05000000074505806], [0.40625, 0.06875000149011612, 0.02500000037252903, 0.02500000037252903], [0.40625, 0.06875000149011612, 0.05000000074505806, 0.05000000074505806], [0.41874998807907104, 0.06875000149011612, 0.02500000037252903, 0.02500000037252903], [0.41874998807907104, 0.06875000149011612, 0.05000000074505806, 0.05000000074505806], [0.4312500059604645, 0.06875000149011612, 0.02500000037252903, 0.02500000037252903], [0.4312500059604645, 0.06875000149011612, 0.05000000074505806, 0.05000000074505806], [0.4437499940395355, 0.06875000149011612, 0.02500000037252903, 0.02500000037252903], [0.4437499940395355, 0.06875000149011612, 0.05000000074505806, 0.05000000074505806], [0.45625001192092896, 0.06875000149011612, 0.02500000037252903, 0.02500000037252903], [0.45625001192092896, 0.06875000149011612, 0.05000000074505806, 0.05000000074505806], [0.46875, 0.06875000149011612, 0.02500000037252903, 0.02500000037252903], [0.46875, 0.06875000149011612, 0.05000000074505806, 0.05000000074505806], [0.48124998807907104, 0.06875000149011612, 0.02500000037252903, 0.02500000037252903], [0.48124998807907104, 0.06875000149011612, 0.05000000074505806, 0.05000000074505806], [0.4937500059604645, 0.06875000149011612, 0.02500000037252903, 0.02500000037252903], [0.4937500059604645, 0.06875000149011612, 0.05000000074505806, 0.05000000074505806], [0.5062500238418579, 0.06875000149011612, 0.02500000037252903, 0.02500000037252903], [0.5062500238418579, 0.06875000149011612, 0.05000000074505806, 0.05000000074505806], [0.518750011920929, 0.06875000149011612, 0.02500000037252903, 0.02500000037252903], [0.518750011920929, 0.06875000149011612, 0.05000000074505806, 0.05000000074505806], [0.53125, 0.06875000149011612, 0.02500000037252903, 0.02500000037252903], [0.53125, 0.06875000149011612, 0.05000000074505806, 0.05000000074505806], [0.543749988079071, 0.06875000149011612, 0.02500000037252903, 0.02500000037252903], [0.543749988079071, 0.06875000149011612, 0.05000000074505806, 0.05000000074505806], [0.5562499761581421, 0.06875000149011612, 0.02500000037252903, 0.02500000037252903], [0.5562499761581421, 0.06875000149011612, 0.05000000074505806, 0.05000000074505806], [0.5687500238418579, 0.06875000149011612, 0.02500000037252903, 0.02500000037252903], [0.5687500238418579, 0.06875000149011612, 0.05000000074505806, 0.05000000074505806], [0.581250011920929, 0.06875000149011612, 0.02500000037252903, 0.02500000037252903], [0.581250011920929, 0.06875000149011612, 0.05000000074505806, 0.05000000074505806], [0.59375, 0.06875000149011612, 0.02500000037252903, 0.02500000037252903], [0.59375, 0.06875000149011612, 0.05000000074505806, 0.05000000074505806], [0.606249988079071, 0.06875000149011612, 0.02500000037252903, 0.02500000037252903], [0.606249988079071, 0.06875000149011612, 0.05000000074505806, 0.05000000074505806], [0.6187499761581421, 0.06875000149011612, 0.02500000037252903, 0.02500000037252903], [0.6187499761581421, 0.06875000149011612, 0.05000000074505806, 0.05000000074505806], [0.6312500238418579, 0.06875000149011612, 0.02500000037252903, 0.02500000037252903], [0.6312500238418579, 0.06875000149011612, 0.05000000074505806, 0.05000000074505806], [0.643750011920929, 0.06875000149011612, 0.02500000037252903, 0.02500000037252903], [0.643750011920929, 0.06875000149011612, 0.05000000074505806, 0.05000000074505806], [0.65625, 0.06875000149011612, 0.02500000037252903, 0.02500000037252903], [0.65625, 0.06875000149011612, 0.05000000074505806, 0.05000000074505806], [0.668749988079071, 0.06875000149011612, 0.02500000037252903, 0.02500000037252903], [0.668749988079071, 0.06875000149011612, 0.05000000074505806, 0.05000000074505806], [0.6812499761581421, 0.06875000149011612, 0.02500000037252903, 0.02500000037252903], [0.6812499761581421, 0.06875000149011612, 0.05000000074505806, 0.05000000074505806], [0.6937500238418579, 0.06875000149011612, 0.02500000037252903, 0.02500000037252903], [0.6937500238418579, 0.06875000149011612, 0.05000000074505806, 0.05000000074505806], [0.706250011920929, 0.06875000149011612, 0.02500000037252903, 0.02500000037252903], [0.706250011920929, 0.06875000149011612, 0.05000000074505806, 0.05000000074505806], [0.71875, 0.06875000149011612, 0.02500000037252903, 0.02500000037252903], [0.71875, 0.06875000149011612, 0.05000000074505806, 0.05000000074505806], [0.731249988079071, 0.06875000149011612, 0.02500000037252903, 0.02500000037252903], [0.731249988079071, 0.06875000149011612, 0.05000000074505806, 0.05000000074505806], [0.7437499761581421, 0.06875000149011612, 0.02500000037252903, 0.02500000037252903], [0.7437499761581421, 0.06875000149011612, 0.05000000074505806, 0.05000000074505806], [0.7562500238418579, 0.06875000149011612, 0.02500000037252903, 0.02500000037252903], [0.7562500238418579, 0.06875000149011612, 0.05000000074505806, 0.05000000074505806], [0.768750011920929, 0.06875000149011612, 0.02500000037252903, 0.02500000037252903], [0.768750011920929, 0.06875000149011612, 0.05000000074505806, 0.05000000074505806], [0.78125, 0.06875000149011612, 0.02500000037252903, 0.02500000037252903], [0.78125, 0.06875000149011612, 0.05000000074505806, 0.05000000074505806], [0.793749988079071, 0.06875000149011612, 0.02500000037252903, 0.02500000037252903], [0.793749988079071, 0.06875000149011612, 0.05000000074505806, 0.05000000074505806], [0.8062499761581421, 0.06875000149011612, 0.02500000037252903, 0.02500000037252903], [0.8062499761581421, 0.06875000149011612, 0.05000000074505806, 0.05000000074505806], [0.8187500238418579, 0.06875000149011612, 0.02500000037252903, 0.02500000037252903], [0.8187500238418579, 0.06875000149011612, 0.05000000074505806, 0.05000000074505806], [0.831250011920929, 0.06875000149011612, 0.02500000037252903, 0.02500000037252903], [0.831250011920929, 0.06875000149011612, 0.05000000074505806, 0.05000000074505806], [0.84375, 0.06875000149011612, 0.02500000037252903, 0.02500000037252903], [0.84375, 0.06875000149011612, 0.05000000074505806, 0.05000000074505806], [0.856249988079071, 0.06875000149011612, 0.02500000037252903, 0.02500000037252903], [0.856249988079071, 0.06875000149011612, 0.05000000074505806, 0.05000000074505806], [0.8687499761581421, 0.06875000149011612, 0.02500000037252903, 0.02500000037252903], [0.8687499761581421, 0.06875000149011612, 0.05000000074505806, 0.05000000074505806], [0.8812500238418579, 0.06875000149011612, 0.02500000037252903, 0.02500000037252903], [0.8812500238418579, 0.06875000149011612, 0.05000000074505806, 0.05000000074505806], [0.893750011920929, 0.06875000149011612, 0.02500000037252903, 0.02500000037252903], [0.893750011920929, 0.06875000149011612, 0.05000000074505806, 0.05000000074505806], [0.90625, 0.06875000149011612, 0.02500000037252903, 0.02500000037252903], [0.90625, 0.06875000149011612, 0.05000000074505806, 0.05000000074505806], [0.918749988079071, 0.06875000149011612, 0.02500000037252903, 0.02500000037252903], [0.918749988079071, 0.06875000149011612, 0.05000000074505806, 0.05000000074505806], [0.9312499761581421, 0.06875000149011612, 0.02500000037252903, 0.02500000037252903], [0.9312499761581421, 0.06875000149011612, 0.05000000074505806, 0.05000000074505806], [0.9437500238418579, 0.06875000149011612, 0.02500000037252903, 0.02500000037252903], [0.9437500238418579, 0.06875000149011612, 0.05000000074505806, 0.05000000074505806], [0.956250011920929, 0.06875000149011612, 0.02500000037252903, 0.02500000037252903], [0.956250011920929, 0.06875000149011612, 0.05000000074505806, 0.05000000074505806], [0.96875, 0.06875000149011612, 0.02500000037252903, 0.02500000037252903], [0.96875, 0.06875000149011612, 0.05000000074505806, 0.05000000074505806], [0.981249988079071, 0.06875000149011612, 0.02500000037252903, 0.02500000037252903], [0.981249988079071, 0.06875000149011612, 0.05000000074505806, 0.05000000074505806], [0.9937499761581421, 0.06875000149011612, 0.02500000037252903, 0.02500000037252903], [0.9937499761581421, 0.06875000149011612, 0.05000000074505806, 0.05000000074505806], [0.0062500000931322575, 0.08124999701976776, 0.02500000037252903, 0.02500000037252903], [0.0062500000931322575, 0.08124999701976776, 0.05000000074505806, 0.05000000074505806], [0.01875000074505806, 0.08124999701976776, 0.02500000037252903, 0.02500000037252903], [0.01875000074505806, 0.08124999701976776, 0.05000000074505806, 0.05000000074505806], [0.03125, 0.08124999701976776, 0.02500000037252903, 0.02500000037252903], [0.03125, 0.08124999701976776, 0.05000000074505806, 0.05000000074505806], [0.04374999925494194, 0.08124999701976776, 0.02500000037252903, 0.02500000037252903], [0.04374999925494194, 0.08124999701976776, 0.05000000074505806, 0.05000000074505806], [0.05624999850988388, 0.08124999701976776, 0.02500000037252903, 0.02500000037252903], [0.05624999850988388, 0.08124999701976776, 0.05000000074505806, 0.05000000074505806], [0.06875000149011612, 0.08124999701976776, 0.02500000037252903, 0.02500000037252903], [0.06875000149011612, 0.08124999701976776, 0.05000000074505806, 0.05000000074505806], [0.08124999701976776, 0.08124999701976776, 0.02500000037252903, 0.02500000037252903], [0.08124999701976776, 0.08124999701976776, 0.05000000074505806, 0.05000000074505806], [0.09375, 0.08124999701976776, 0.02500000037252903, 0.02500000037252903], [0.09375, 0.08124999701976776, 0.05000000074505806, 0.05000000074505806], [0.10625000298023224, 0.08124999701976776, 0.02500000037252903, 0.02500000037252903], [0.10625000298023224, 0.08124999701976776, 0.05000000074505806, 0.05000000074505806], [0.11874999850988388, 0.08124999701976776, 0.02500000037252903, 0.02500000037252903], [0.11874999850988388, 0.08124999701976776, 0.05000000074505806, 0.05000000074505806], [0.13124999403953552, 0.08124999701976776, 0.02500000037252903, 0.02500000037252903], [0.13124999403953552, 0.08124999701976776, 0.05000000074505806, 0.05000000074505806], [0.14374999701976776, 0.08124999701976776, 0.02500000037252903, 0.02500000037252903], [0.14374999701976776, 0.08124999701976776, 0.05000000074505806, 0.05000000074505806], [0.15625, 0.08124999701976776, 0.02500000037252903, 0.02500000037252903], [0.15625, 0.08124999701976776, 0.05000000074505806, 0.05000000074505806], [0.16875000298023224, 0.08124999701976776, 0.02500000037252903, 0.02500000037252903], [0.16875000298023224, 0.08124999701976776, 0.05000000074505806, 0.05000000074505806], [0.18125000596046448, 0.08124999701976776, 0.02500000037252903, 0.02500000037252903], [0.18125000596046448, 0.08124999701976776, 0.05000000074505806, 0.05000000074505806], [0.19374999403953552, 0.08124999701976776, 0.02500000037252903, 0.02500000037252903], [0.19374999403953552, 0.08124999701976776, 0.05000000074505806, 0.05000000074505806], [0.20624999701976776, 0.08124999701976776, 0.02500000037252903, 0.02500000037252903], [0.20624999701976776, 0.08124999701976776, 0.05000000074505806, 0.05000000074505806], [0.21875, 0.08124999701976776, 0.02500000037252903, 0.02500000037252903], [0.21875, 0.08124999701976776, 0.05000000074505806, 0.05000000074505806], [0.23125000298023224, 0.08124999701976776, 0.02500000037252903, 0.02500000037252903], [0.23125000298023224, 0.08124999701976776, 0.05000000074505806, 0.05000000074505806], [0.24375000596046448, 0.08124999701976776, 0.02500000037252903, 0.02500000037252903], [0.24375000596046448, 0.08124999701976776, 0.05000000074505806, 0.05000000074505806], [0.2562499940395355, 0.08124999701976776, 0.02500000037252903, 0.02500000037252903], [0.2562499940395355, 0.08124999701976776, 0.05000000074505806, 0.05000000074505806], [0.26875001192092896, 0.08124999701976776, 0.02500000037252903, 0.02500000037252903], [0.26875001192092896, 0.08124999701976776, 0.05000000074505806, 0.05000000074505806], [0.28125, 0.08124999701976776, 0.02500000037252903, 0.02500000037252903], [0.28125, 0.08124999701976776, 0.05000000074505806, 0.05000000074505806], [0.29374998807907104, 0.08124999701976776, 0.02500000037252903, 0.02500000037252903], [0.29374998807907104, 0.08124999701976776, 0.05000000074505806, 0.05000000074505806], [0.3062500059604645, 0.08124999701976776, 0.02500000037252903, 0.02500000037252903], [0.3062500059604645, 0.08124999701976776, 0.05000000074505806, 0.05000000074505806], [0.3187499940395355, 0.08124999701976776, 0.02500000037252903, 0.02500000037252903], [0.3187499940395355, 0.08124999701976776, 0.05000000074505806, 0.05000000074505806], [0.33125001192092896, 0.08124999701976776, 0.02500000037252903, 0.02500000037252903], [0.33125001192092896, 0.08124999701976776, 0.05000000074505806, 0.05000000074505806], [0.34375, 0.08124999701976776, 0.02500000037252903, 0.02500000037252903], [0.34375, 0.08124999701976776, 0.05000000074505806, 0.05000000074505806], [0.35624998807907104, 0.08124999701976776, 0.02500000037252903, 0.02500000037252903], [0.35624998807907104, 0.08124999701976776, 0.05000000074505806, 0.05000000074505806], [0.3687500059604645, 0.08124999701976776, 0.02500000037252903, 0.02500000037252903], [0.3687500059604645, 0.08124999701976776, 0.05000000074505806, 0.05000000074505806], [0.3812499940395355, 0.08124999701976776, 0.02500000037252903, 0.02500000037252903], [0.3812499940395355, 0.08124999701976776, 0.05000000074505806, 0.05000000074505806], [0.39375001192092896, 0.08124999701976776, 0.02500000037252903, 0.02500000037252903], [0.39375001192092896, 0.08124999701976776, 0.05000000074505806, 0.05000000074505806], [0.40625, 0.08124999701976776, 0.02500000037252903, 0.02500000037252903], [0.40625, 0.08124999701976776, 0.05000000074505806, 0.05000000074505806], [0.41874998807907104, 0.08124999701976776, 0.02500000037252903, 0.02500000037252903], [0.41874998807907104, 0.08124999701976776, 0.05000000074505806, 0.05000000074505806], [0.4312500059604645, 0.08124999701976776, 0.02500000037252903, 0.02500000037252903], [0.4312500059604645, 0.08124999701976776, 0.05000000074505806, 0.05000000074505806], [0.4437499940395355, 0.08124999701976776, 0.02500000037252903, 0.02500000037252903], [0.4437499940395355, 0.08124999701976776, 0.05000000074505806, 0.05000000074505806], [0.45625001192092896, 0.08124999701976776, 0.02500000037252903, 0.02500000037252903], [0.45625001192092896, 0.08124999701976776, 0.05000000074505806, 0.05000000074505806], [0.46875, 0.08124999701976776, 0.02500000037252903, 0.02500000037252903], [0.46875, 0.08124999701976776, 0.05000000074505806, 0.05000000074505806], [0.48124998807907104, 0.08124999701976776, 0.02500000037252903, 0.02500000037252903], [0.48124998807907104, 0.08124999701976776, 0.05000000074505806, 0.05000000074505806], [0.4937500059604645, 0.08124999701976776, 0.02500000037252903, 0.02500000037252903], [0.4937500059604645, 0.08124999701976776, 0.05000000074505806, 0.05000000074505806], [0.5062500238418579, 0.08124999701976776, 0.02500000037252903, 0.02500000037252903], [0.5062500238418579, 0.08124999701976776, 0.05000000074505806, 0.05000000074505806], [0.518750011920929, 0.08124999701976776, 0.02500000037252903, 0.02500000037252903], [0.518750011920929, 0.08124999701976776, 0.05000000074505806, 0.05000000074505806], [0.53125, 0.08124999701976776, 0.02500000037252903, 0.02500000037252903], [0.53125, 0.08124999701976776, 0.05000000074505806, 0.05000000074505806], [0.543749988079071, 0.08124999701976776, 0.02500000037252903, 0.02500000037252903], [0.543749988079071, 0.08124999701976776, 0.05000000074505806, 0.05000000074505806], [0.5562499761581421, 0.08124999701976776, 0.02500000037252903, 0.02500000037252903], [0.5562499761581421, 0.08124999701976776, 0.05000000074505806, 0.05000000074505806], [0.5687500238418579, 0.08124999701976776, 0.02500000037252903, 0.02500000037252903], [0.5687500238418579, 0.08124999701976776, 0.05000000074505806, 0.05000000074505806], [0.581250011920929, 0.08124999701976776, 0.02500000037252903, 0.02500000037252903], [0.581250011920929, 0.08124999701976776, 0.05000000074505806, 0.05000000074505806], [0.59375, 0.08124999701976776, 0.02500000037252903, 0.02500000037252903], [0.59375, 0.08124999701976776, 0.05000000074505806, 0.05000000074505806], [0.606249988079071, 0.08124999701976776, 0.02500000037252903, 0.02500000037252903], [0.606249988079071, 0.08124999701976776, 0.05000000074505806, 0.05000000074505806], [0.6187499761581421, 0.08124999701976776, 0.02500000037252903, 0.02500000037252903], [0.6187499761581421, 0.08124999701976776, 0.05000000074505806, 0.05000000074505806], [0.6312500238418579, 0.08124999701976776, 0.02500000037252903, 0.02500000037252903], [0.6312500238418579, 0.08124999701976776, 0.05000000074505806, 0.05000000074505806], [0.643750011920929, 0.08124999701976776, 0.02500000037252903, 0.02500000037252903], [0.643750011920929, 0.08124999701976776, 0.05000000074505806, 0.05000000074505806], [0.65625, 0.08124999701976776, 0.02500000037252903, 0.02500000037252903], [0.65625, 0.08124999701976776, 0.05000000074505806, 0.05000000074505806], [0.668749988079071, 0.08124999701976776, 0.02500000037252903, 0.02500000037252903], [0.668749988079071, 0.08124999701976776, 0.05000000074505806, 0.05000000074505806], [0.6812499761581421, 0.08124999701976776, 0.02500000037252903, 0.02500000037252903], [0.6812499761581421, 0.08124999701976776, 0.05000000074505806, 0.05000000074505806], [0.6937500238418579, 0.08124999701976776, 0.02500000037252903, 0.02500000037252903], [0.6937500238418579, 0.08124999701976776, 0.05000000074505806, 0.05000000074505806], [0.706250011920929, 0.08124999701976776, 0.02500000037252903, 0.02500000037252903], [0.706250011920929, 0.08124999701976776, 0.05000000074505806, 0.05000000074505806], [0.71875, 0.08124999701976776, 0.02500000037252903, 0.02500000037252903], [0.71875, 0.08124999701976776, 0.05000000074505806, 0.05000000074505806], [0.731249988079071, 0.08124999701976776, 0.02500000037252903, 0.02500000037252903], [0.731249988079071, 0.08124999701976776, 0.05000000074505806, 0.05000000074505806], [0.7437499761581421, 0.08124999701976776, 0.02500000037252903, 0.02500000037252903], [0.7437499761581421, 0.08124999701976776, 0.05000000074505806, 0.05000000074505806], [0.7562500238418579, 0.08124999701976776, 0.02500000037252903, 0.02500000037252903], [0.7562500238418579, 0.08124999701976776, 0.05000000074505806, 0.05000000074505806], [0.768750011920929, 0.08124999701976776, 0.02500000037252903, 0.02500000037252903], [0.768750011920929, 0.08124999701976776, 0.05000000074505806, 0.05000000074505806], [0.78125, 0.08124999701976776, 0.02500000037252903, 0.02500000037252903], [0.78125, 0.08124999701976776, 0.05000000074505806, 0.05000000074505806], [0.793749988079071, 0.08124999701976776, 0.02500000037252903, 0.02500000037252903], [0.793749988079071, 0.08124999701976776, 0.05000000074505806, 0.05000000074505806], [0.8062499761581421, 0.08124999701976776, 0.02500000037252903, 0.02500000037252903], [0.8062499761581421, 0.08124999701976776, 0.05000000074505806, 0.05000000074505806], [0.8187500238418579, 0.08124999701976776, 0.02500000037252903, 0.02500000037252903], [0.8187500238418579, 0.08124999701976776, 0.05000000074505806, 0.05000000074505806], [0.831250011920929, 0.08124999701976776, 0.02500000037252903, 0.02500000037252903], [0.831250011920929, 0.08124999701976776, 0.05000000074505806, 0.05000000074505806], [0.84375, 0.08124999701976776, 0.02500000037252903, 0.02500000037252903], [0.84375, 0.08124999701976776, 0.05000000074505806, 0.05000000074505806], [0.856249988079071, 0.08124999701976776, 0.02500000037252903, 0.02500000037252903], [0.856249988079071, 0.08124999701976776, 0.05000000074505806, 0.05000000074505806], [0.8687499761581421, 0.08124999701976776, 0.02500000037252903, 0.02500000037252903], [0.8687499761581421, 0.08124999701976776, 0.05000000074505806, 0.05000000074505806], [0.8812500238418579, 0.08124999701976776, 0.02500000037252903, 0.02500000037252903], [0.8812500238418579, 0.08124999701976776, 0.05000000074505806, 0.05000000074505806], [0.893750011920929, 0.08124999701976776, 0.02500000037252903, 0.02500000037252903], [0.893750011920929, 0.08124999701976776, 0.05000000074505806, 0.05000000074505806], [0.90625, 0.08124999701976776, 0.02500000037252903, 0.02500000037252903], [0.90625, 0.08124999701976776, 0.05000000074505806, 0.05000000074505806], [0.918749988079071, 0.08124999701976776, 0.02500000037252903, 0.02500000037252903], [0.918749988079071, 0.08124999701976776, 0.05000000074505806, 0.05000000074505806], [0.9312499761581421, 0.08124999701976776, 0.02500000037252903, 0.02500000037252903], [0.9312499761581421, 0.08124999701976776, 0.05000000074505806, 0.05000000074505806], [0.9437500238418579, 0.08124999701976776, 0.02500000037252903, 0.02500000037252903], [0.9437500238418579, 0.08124999701976776, 0.05000000074505806, 0.05000000074505806], [0.956250011920929, 0.08124999701976776, 0.02500000037252903, 0.02500000037252903], [0.956250011920929, 0.08124999701976776, 0.05000000074505806, 0.05000000074505806], [0.96875, 0.08124999701976776, 0.02500000037252903, 0.02500000037252903], [0.96875, 0.08124999701976776, 0.05000000074505806, 0.05000000074505806], [0.981249988079071, 0.08124999701976776, 0.02500000037252903, 0.02500000037252903], [0.981249988079071, 0.08124999701976776, 0.05000000074505806, 0.05000000074505806], [0.9937499761581421, 0.08124999701976776, 0.02500000037252903, 0.02500000037252903], [0.9937499761581421, 0.08124999701976776, 0.05000000074505806, 0.05000000074505806], [0.0062500000931322575, 0.09375, 0.02500000037252903, 0.02500000037252903], [0.0062500000931322575, 0.09375, 0.05000000074505806, 0.05000000074505806], [0.01875000074505806, 0.09375, 0.02500000037252903, 0.02500000037252903], [0.01875000074505806, 0.09375, 0.05000000074505806, 0.05000000074505806], [0.03125, 0.09375, 0.02500000037252903, 0.02500000037252903], [0.03125, 0.09375, 0.05000000074505806, 0.05000000074505806], [0.04374999925494194, 0.09375, 0.02500000037252903, 0.02500000037252903], [0.04374999925494194, 0.09375, 0.05000000074505806, 0.05000000074505806], [0.05624999850988388, 0.09375, 0.02500000037252903, 0.02500000037252903], [0.05624999850988388, 0.09375, 0.05000000074505806, 0.05000000074505806], [0.06875000149011612, 0.09375, 0.02500000037252903, 0.02500000037252903], [0.06875000149011612, 0.09375, 0.05000000074505806, 0.05000000074505806], [0.08124999701976776, 0.09375, 0.02500000037252903, 0.02500000037252903], [0.08124999701976776, 0.09375, 0.05000000074505806, 0.05000000074505806], [0.09375, 0.09375, 0.02500000037252903, 0.02500000037252903], [0.09375, 0.09375, 0.05000000074505806, 0.05000000074505806], [0.10625000298023224, 0.09375, 0.02500000037252903, 0.02500000037252903], [0.10625000298023224, 0.09375, 0.05000000074505806, 0.05000000074505806], [0.11874999850988388, 0.09375, 0.02500000037252903, 0.02500000037252903], [0.11874999850988388, 0.09375, 0.05000000074505806, 0.05000000074505806], [0.13124999403953552, 0.09375, 0.02500000037252903, 0.02500000037252903], [0.13124999403953552, 0.09375, 0.05000000074505806, 0.05000000074505806], [0.14374999701976776, 0.09375, 0.02500000037252903, 0.02500000037252903], [0.14374999701976776, 0.09375, 0.05000000074505806, 0.05000000074505806], [0.15625, 0.09375, 0.02500000037252903, 0.02500000037252903], [0.15625, 0.09375, 0.05000000074505806, 0.05000000074505806], [0.16875000298023224, 0.09375, 0.02500000037252903, 0.02500000037252903], [0.16875000298023224, 0.09375, 0.05000000074505806, 0.05000000074505806], [0.18125000596046448, 0.09375, 0.02500000037252903, 0.02500000037252903], [0.18125000596046448, 0.09375, 0.05000000074505806, 0.05000000074505806], [0.19374999403953552, 0.09375, 0.02500000037252903, 0.02500000037252903], [0.19374999403953552, 0.09375, 0.05000000074505806, 0.05000000074505806], [0.20624999701976776, 0.09375, 0.02500000037252903, 0.02500000037252903], [0.20624999701976776, 0.09375, 0.05000000074505806, 0.05000000074505806], [0.21875, 0.09375, 0.02500000037252903, 0.02500000037252903], [0.21875, 0.09375, 0.05000000074505806, 0.05000000074505806], [0.23125000298023224, 0.09375, 0.02500000037252903, 0.02500000037252903], [0.23125000298023224, 0.09375, 0.05000000074505806, 0.05000000074505806], [0.24375000596046448, 0.09375, 0.02500000037252903, 0.02500000037252903], [0.24375000596046448, 0.09375, 0.05000000074505806, 0.05000000074505806], [0.2562499940395355, 0.09375, 0.02500000037252903, 0.02500000037252903], [0.2562499940395355, 0.09375, 0.05000000074505806, 0.05000000074505806], [0.26875001192092896, 0.09375, 0.02500000037252903, 0.02500000037252903], [0.26875001192092896, 0.09375, 0.05000000074505806, 0.05000000074505806], [0.28125, 0.09375, 0.02500000037252903, 0.02500000037252903], [0.28125, 0.09375, 0.05000000074505806, 0.05000000074505806], [0.29374998807907104, 0.09375, 0.02500000037252903, 0.02500000037252903], [0.29374998807907104, 0.09375, 0.05000000074505806, 0.05000000074505806], [0.3062500059604645, 0.09375, 0.02500000037252903, 0.02500000037252903], [0.3062500059604645, 0.09375, 0.05000000074505806, 0.05000000074505806], [0.3187499940395355, 0.09375, 0.02500000037252903, 0.02500000037252903], [0.3187499940395355, 0.09375, 0.05000000074505806, 0.05000000074505806], [0.33125001192092896, 0.09375, 0.02500000037252903, 0.02500000037252903], [0.33125001192092896, 0.09375, 0.05000000074505806, 0.05000000074505806], [0.34375, 0.09375, 0.02500000037252903, 0.02500000037252903], [0.34375, 0.09375, 0.05000000074505806, 0.05000000074505806], [0.35624998807907104, 0.09375, 0.02500000037252903, 0.02500000037252903], [0.35624998807907104, 0.09375, 0.05000000074505806, 0.05000000074505806], [0.3687500059604645, 0.09375, 0.02500000037252903, 0.02500000037252903], [0.3687500059604645, 0.09375, 0.05000000074505806, 0.05000000074505806], [0.3812499940395355, 0.09375, 0.02500000037252903, 0.02500000037252903], [0.3812499940395355, 0.09375, 0.05000000074505806, 0.05000000074505806], [0.39375001192092896, 0.09375, 0.02500000037252903, 0.02500000037252903], [0.39375001192092896, 0.09375, 0.05000000074505806, 0.05000000074505806], [0.40625, 0.09375, 0.02500000037252903, 0.02500000037252903], [0.40625, 0.09375, 0.05000000074505806, 0.05000000074505806], [0.41874998807907104, 0.09375, 0.02500000037252903, 0.02500000037252903], [0.41874998807907104, 0.09375, 0.05000000074505806, 0.05000000074505806], [0.4312500059604645, 0.09375, 0.02500000037252903, 0.02500000037252903], [0.4312500059604645, 0.09375, 0.05000000074505806, 0.05000000074505806], [0.4437499940395355, 0.09375, 0.02500000037252903, 0.02500000037252903], [0.4437499940395355, 0.09375, 0.05000000074505806, 0.05000000074505806], [0.45625001192092896, 0.09375, 0.02500000037252903, 0.02500000037252903], [0.45625001192092896, 0.09375, 0.05000000074505806, 0.05000000074505806], [0.46875, 0.09375, 0.02500000037252903, 0.02500000037252903], [0.46875, 0.09375, 0.05000000074505806, 0.05000000074505806], [0.48124998807907104, 0.09375, 0.02500000037252903, 0.02500000037252903], [0.48124998807907104, 0.09375, 0.05000000074505806, 0.05000000074505806], [0.4937500059604645, 0.09375, 0.02500000037252903, 0.02500000037252903], [0.4937500059604645, 0.09375, 0.05000000074505806, 0.05000000074505806], [0.5062500238418579, 0.09375, 0.02500000037252903, 0.02500000037252903], [0.5062500238418579, 0.09375, 0.05000000074505806, 0.05000000074505806], [0.518750011920929, 0.09375, 0.02500000037252903, 0.02500000037252903], [0.518750011920929, 0.09375, 0.05000000074505806, 0.05000000074505806], [0.53125, 0.09375, 0.02500000037252903, 0.02500000037252903], [0.53125, 0.09375, 0.05000000074505806, 0.05000000074505806], [0.543749988079071, 0.09375, 0.02500000037252903, 0.02500000037252903], [0.543749988079071, 0.09375, 0.05000000074505806, 0.05000000074505806], [0.5562499761581421, 0.09375, 0.02500000037252903, 0.02500000037252903], [0.5562499761581421, 0.09375, 0.05000000074505806, 0.05000000074505806], [0.5687500238418579, 0.09375, 0.02500000037252903, 0.02500000037252903], [0.5687500238418579, 0.09375, 0.05000000074505806, 0.05000000074505806], [0.581250011920929, 0.09375, 0.02500000037252903, 0.02500000037252903], [0.581250011920929, 0.09375, 0.05000000074505806, 0.05000000074505806], [0.59375, 0.09375, 0.02500000037252903, 0.02500000037252903], [0.59375, 0.09375, 0.05000000074505806, 0.05000000074505806], [0.606249988079071, 0.09375, 0.02500000037252903, 0.02500000037252903], [0.606249988079071, 0.09375, 0.05000000074505806, 0.05000000074505806], [0.6187499761581421, 0.09375, 0.02500000037252903, 0.02500000037252903], [0.6187499761581421, 0.09375, 0.05000000074505806, 0.05000000074505806], [0.6312500238418579, 0.09375, 0.02500000037252903, 0.02500000037252903], [0.6312500238418579, 0.09375, 0.05000000074505806, 0.05000000074505806], [0.643750011920929, 0.09375, 0.02500000037252903, 0.02500000037252903], [0.643750011920929, 0.09375, 0.05000000074505806, 0.05000000074505806], [0.65625, 0.09375, 0.02500000037252903, 0.02500000037252903], [0.65625, 0.09375, 0.05000000074505806, 0.05000000074505806], [0.668749988079071, 0.09375, 0.02500000037252903, 0.02500000037252903], [0.668749988079071, 0.09375, 0.05000000074505806, 0.05000000074505806], [0.6812499761581421, 0.09375, 0.02500000037252903, 0.02500000037252903], [0.6812499761581421, 0.09375, 0.05000000074505806, 0.05000000074505806], [0.6937500238418579, 0.09375, 0.02500000037252903, 0.02500000037252903], [0.6937500238418579, 0.09375, 0.05000000074505806, 0.05000000074505806], [0.706250011920929, 0.09375, 0.02500000037252903, 0.02500000037252903], [0.706250011920929, 0.09375, 0.05000000074505806, 0.05000000074505806], [0.71875, 0.09375, 0.02500000037252903, 0.02500000037252903], [0.71875, 0.09375, 0.05000000074505806, 0.05000000074505806], [0.731249988079071, 0.09375, 0.02500000037252903, 0.02500000037252903], [0.731249988079071, 0.09375, 0.05000000074505806, 0.05000000074505806], [0.7437499761581421, 0.09375, 0.02500000037252903, 0.02500000037252903], [0.7437499761581421, 0.09375, 0.05000000074505806, 0.05000000074505806], [0.7562500238418579, 0.09375, 0.02500000037252903, 0.02500000037252903], [0.7562500238418579, 0.09375, 0.05000000074505806, 0.05000000074505806], [0.768750011920929, 0.09375, 0.02500000037252903, 0.02500000037252903], [0.768750011920929, 0.09375, 0.05000000074505806, 0.05000000074505806], [0.78125, 0.09375, 0.02500000037252903, 0.02500000037252903], [0.78125, 0.09375, 0.05000000074505806, 0.05000000074505806], [0.793749988079071, 0.09375, 0.02500000037252903, 0.02500000037252903], [0.793749988079071, 0.09375, 0.05000000074505806, 0.05000000074505806], [0.8062499761581421, 0.09375, 0.02500000037252903, 0.02500000037252903], [0.8062499761581421, 0.09375, 0.05000000074505806, 0.05000000074505806], [0.8187500238418579, 0.09375, 0.02500000037252903, 0.02500000037252903], [0.8187500238418579, 0.09375, 0.05000000074505806, 0.05000000074505806], [0.831250011920929, 0.09375, 0.02500000037252903, 0.02500000037252903], [0.831250011920929, 0.09375, 0.05000000074505806, 0.05000000074505806], [0.84375, 0.09375, 0.02500000037252903, 0.02500000037252903], [0.84375, 0.09375, 0.05000000074505806, 0.05000000074505806], [0.856249988079071, 0.09375, 0.02500000037252903, 0.02500000037252903], [0.856249988079071, 0.09375, 0.05000000074505806, 0.05000000074505806], [0.8687499761581421, 0.09375, 0.02500000037252903, 0.02500000037252903], [0.8687499761581421, 0.09375, 0.05000000074505806, 0.05000000074505806], [0.8812500238418579, 0.09375, 0.02500000037252903, 0.02500000037252903], [0.8812500238418579, 0.09375, 0.05000000074505806, 0.05000000074505806], [0.893750011920929, 0.09375, 0.02500000037252903, 0.02500000037252903], [0.893750011920929, 0.09375, 0.05000000074505806, 0.05000000074505806], [0.90625, 0.09375, 0.02500000037252903, 0.02500000037252903], [0.90625, 0.09375, 0.05000000074505806, 0.05000000074505806], [0.918749988079071, 0.09375, 0.02500000037252903, 0.02500000037252903], [0.918749988079071, 0.09375, 0.05000000074505806, 0.05000000074505806], [0.9312499761581421, 0.09375, 0.02500000037252903, 0.02500000037252903], [0.9312499761581421, 0.09375, 0.05000000074505806, 0.05000000074505806], [0.9437500238418579, 0.09375, 0.02500000037252903, 0.02500000037252903], [0.9437500238418579, 0.09375, 0.05000000074505806, 0.05000000074505806], [0.956250011920929, 0.09375, 0.02500000037252903, 0.02500000037252903], [0.956250011920929, 0.09375, 0.05000000074505806, 0.05000000074505806], [0.96875, 0.09375, 0.02500000037252903, 0.02500000037252903], [0.96875, 0.09375, 0.05000000074505806, 0.05000000074505806], [0.981249988079071, 0.09375, 0.02500000037252903, 0.02500000037252903], [0.981249988079071, 0.09375, 0.05000000074505806, 0.05000000074505806], [0.9937499761581421, 0.09375, 0.02500000037252903, 0.02500000037252903], [0.9937499761581421, 0.09375, 0.05000000074505806, 0.05000000074505806], [0.0062500000931322575, 0.10625000298023224, 0.02500000037252903, 0.02500000037252903], [0.0062500000931322575, 0.10625000298023224, 0.05000000074505806, 0.05000000074505806], [0.01875000074505806, 0.10625000298023224, 0.02500000037252903, 0.02500000037252903], [0.01875000074505806, 0.10625000298023224, 0.05000000074505806, 0.05000000074505806], [0.03125, 0.10625000298023224, 0.02500000037252903, 0.02500000037252903], [0.03125, 0.10625000298023224, 0.05000000074505806, 0.05000000074505806], [0.04374999925494194, 0.10625000298023224, 0.02500000037252903, 0.02500000037252903], [0.04374999925494194, 0.10625000298023224, 0.05000000074505806, 0.05000000074505806], [0.05624999850988388, 0.10625000298023224, 0.02500000037252903, 0.02500000037252903], [0.05624999850988388, 0.10625000298023224, 0.05000000074505806, 0.05000000074505806], [0.06875000149011612, 0.10625000298023224, 0.02500000037252903, 0.02500000037252903], [0.06875000149011612, 0.10625000298023224, 0.05000000074505806, 0.05000000074505806], [0.08124999701976776, 0.10625000298023224, 0.02500000037252903, 0.02500000037252903], [0.08124999701976776, 0.10625000298023224, 0.05000000074505806, 0.05000000074505806], [0.09375, 0.10625000298023224, 0.02500000037252903, 0.02500000037252903], [0.09375, 0.10625000298023224, 0.05000000074505806, 0.05000000074505806], [0.10625000298023224, 0.10625000298023224, 0.02500000037252903, 0.02500000037252903], [0.10625000298023224, 0.10625000298023224, 0.05000000074505806, 0.05000000074505806], [0.11874999850988388, 0.10625000298023224, 0.02500000037252903, 0.02500000037252903], [0.11874999850988388, 0.10625000298023224, 0.05000000074505806, 0.05000000074505806], [0.13124999403953552, 0.10625000298023224, 0.02500000037252903, 0.02500000037252903], [0.13124999403953552, 0.10625000298023224, 0.05000000074505806, 0.05000000074505806], [0.14374999701976776, 0.10625000298023224, 0.02500000037252903, 0.02500000037252903], [0.14374999701976776, 0.10625000298023224, 0.05000000074505806, 0.05000000074505806], [0.15625, 0.10625000298023224, 0.02500000037252903, 0.02500000037252903], [0.15625, 0.10625000298023224, 0.05000000074505806, 0.05000000074505806], [0.16875000298023224, 0.10625000298023224, 0.02500000037252903, 0.02500000037252903], [0.16875000298023224, 0.10625000298023224, 0.05000000074505806, 0.05000000074505806], [0.18125000596046448, 0.10625000298023224, 0.02500000037252903, 0.02500000037252903], [0.18125000596046448, 0.10625000298023224, 0.05000000074505806, 0.05000000074505806], [0.19374999403953552, 0.10625000298023224, 0.02500000037252903, 0.02500000037252903], [0.19374999403953552, 0.10625000298023224, 0.05000000074505806, 0.05000000074505806], [0.20624999701976776, 0.10625000298023224, 0.02500000037252903, 0.02500000037252903], [0.20624999701976776, 0.10625000298023224, 0.05000000074505806, 0.05000000074505806], [0.21875, 0.10625000298023224, 0.02500000037252903, 0.02500000037252903], [0.21875, 0.10625000298023224, 0.05000000074505806, 0.05000000074505806], [0.23125000298023224, 0.10625000298023224, 0.02500000037252903, 0.02500000037252903], [0.23125000298023224, 0.10625000298023224, 0.05000000074505806, 0.05000000074505806], [0.24375000596046448, 0.10625000298023224, 0.02500000037252903, 0.02500000037252903], [0.24375000596046448, 0.10625000298023224, 0.05000000074505806, 0.05000000074505806], [0.2562499940395355, 0.10625000298023224, 0.02500000037252903, 0.02500000037252903], [0.2562499940395355, 0.10625000298023224, 0.05000000074505806, 0.05000000074505806], [0.26875001192092896, 0.10625000298023224, 0.02500000037252903, 0.02500000037252903], [0.26875001192092896, 0.10625000298023224, 0.05000000074505806, 0.05000000074505806], [0.28125, 0.10625000298023224, 0.02500000037252903, 0.02500000037252903], [0.28125, 0.10625000298023224, 0.05000000074505806, 0.05000000074505806], [0.29374998807907104, 0.10625000298023224, 0.02500000037252903, 0.02500000037252903], [0.29374998807907104, 0.10625000298023224, 0.05000000074505806, 0.05000000074505806], [0.3062500059604645, 0.10625000298023224, 0.02500000037252903, 0.02500000037252903], [0.3062500059604645, 0.10625000298023224, 0.05000000074505806, 0.05000000074505806], [0.3187499940395355, 0.10625000298023224, 0.02500000037252903, 0.02500000037252903], [0.3187499940395355, 0.10625000298023224, 0.05000000074505806, 0.05000000074505806], [0.33125001192092896, 0.10625000298023224, 0.02500000037252903, 0.02500000037252903], [0.33125001192092896, 0.10625000298023224, 0.05000000074505806, 0.05000000074505806], [0.34375, 0.10625000298023224, 0.02500000037252903, 0.02500000037252903], [0.34375, 0.10625000298023224, 0.05000000074505806, 0.05000000074505806], [0.35624998807907104, 0.10625000298023224, 0.02500000037252903, 0.02500000037252903], [0.35624998807907104, 0.10625000298023224, 0.05000000074505806, 0.05000000074505806], [0.3687500059604645, 0.10625000298023224, 0.02500000037252903, 0.02500000037252903], [0.3687500059604645, 0.10625000298023224, 0.05000000074505806, 0.05000000074505806], [0.3812499940395355, 0.10625000298023224, 0.02500000037252903, 0.02500000037252903], [0.3812499940395355, 0.10625000298023224, 0.05000000074505806, 0.05000000074505806], [0.39375001192092896, 0.10625000298023224, 0.02500000037252903, 0.02500000037252903], [0.39375001192092896, 0.10625000298023224, 0.05000000074505806, 0.05000000074505806], [0.40625, 0.10625000298023224, 0.02500000037252903, 0.02500000037252903], [0.40625, 0.10625000298023224, 0.05000000074505806, 0.05000000074505806], [0.41874998807907104, 0.10625000298023224, 0.02500000037252903, 0.02500000037252903], [0.41874998807907104, 0.10625000298023224, 0.05000000074505806, 0.05000000074505806], [0.4312500059604645, 0.10625000298023224, 0.02500000037252903, 0.02500000037252903], [0.4312500059604645, 0.10625000298023224, 0.05000000074505806, 0.05000000074505806], [0.4437499940395355, 0.10625000298023224, 0.02500000037252903, 0.02500000037252903], [0.4437499940395355, 0.10625000298023224, 0.05000000074505806, 0.05000000074505806], [0.45625001192092896, 0.10625000298023224, 0.02500000037252903, 0.02500000037252903], [0.45625001192092896, 0.10625000298023224, 0.05000000074505806, 0.05000000074505806], [0.46875, 0.10625000298023224, 0.02500000037252903, 0.02500000037252903], [0.46875, 0.10625000298023224, 0.05000000074505806, 0.05000000074505806], [0.48124998807907104, 0.10625000298023224, 0.02500000037252903, 0.02500000037252903], [0.48124998807907104, 0.10625000298023224, 0.05000000074505806, 0.05000000074505806], [0.4937500059604645, 0.10625000298023224, 0.02500000037252903, 0.02500000037252903], [0.4937500059604645, 0.10625000298023224, 0.05000000074505806, 0.05000000074505806], [0.5062500238418579, 0.10625000298023224, 0.02500000037252903, 0.02500000037252903], [0.5062500238418579, 0.10625000298023224, 0.05000000074505806, 0.05000000074505806], [0.518750011920929, 0.10625000298023224, 0.02500000037252903, 0.02500000037252903], [0.518750011920929, 0.10625000298023224, 0.05000000074505806, 0.05000000074505806], [0.53125, 0.10625000298023224, 0.02500000037252903, 0.02500000037252903], [0.53125, 0.10625000298023224, 0.05000000074505806, 0.05000000074505806], [0.543749988079071, 0.10625000298023224, 0.02500000037252903, 0.02500000037252903], [0.543749988079071, 0.10625000298023224, 0.05000000074505806, 0.05000000074505806], [0.5562499761581421, 0.10625000298023224, 0.02500000037252903, 0.02500000037252903], [0.5562499761581421, 0.10625000298023224, 0.05000000074505806, 0.05000000074505806], [0.5687500238418579, 0.10625000298023224, 0.02500000037252903, 0.02500000037252903], [0.5687500238418579, 0.10625000298023224, 0.05000000074505806, 0.05000000074505806], [0.581250011920929, 0.10625000298023224, 0.02500000037252903, 0.02500000037252903], [0.581250011920929, 0.10625000298023224, 0.05000000074505806, 0.05000000074505806], [0.59375, 0.10625000298023224, 0.02500000037252903, 0.02500000037252903], [0.59375, 0.10625000298023224, 0.05000000074505806, 0.05000000074505806], [0.606249988079071, 0.10625000298023224, 0.02500000037252903, 0.02500000037252903], [0.606249988079071, 0.10625000298023224, 0.05000000074505806, 0.05000000074505806], [0.6187499761581421, 0.10625000298023224, 0.02500000037252903, 0.02500000037252903], [0.6187499761581421, 0.10625000298023224, 0.05000000074505806, 0.05000000074505806], [0.6312500238418579, 0.10625000298023224, 0.02500000037252903, 0.02500000037252903], [0.6312500238418579, 0.10625000298023224, 0.05000000074505806, 0.05000000074505806], [0.643750011920929, 0.10625000298023224, 0.02500000037252903, 0.02500000037252903], [0.643750011920929, 0.10625000298023224, 0.05000000074505806, 0.05000000074505806], [0.65625, 0.10625000298023224, 0.02500000037252903, 0.02500000037252903], [0.65625, 0.10625000298023224, 0.05000000074505806, 0.05000000074505806], [0.668749988079071, 0.10625000298023224, 0.02500000037252903, 0.02500000037252903], [0.668749988079071, 0.10625000298023224, 0.05000000074505806, 0.05000000074505806], [0.6812499761581421, 0.10625000298023224, 0.02500000037252903, 0.02500000037252903], [0.6812499761581421, 0.10625000298023224, 0.05000000074505806, 0.05000000074505806], [0.6937500238418579, 0.10625000298023224, 0.02500000037252903, 0.02500000037252903], [0.6937500238418579, 0.10625000298023224, 0.05000000074505806, 0.05000000074505806], [0.706250011920929, 0.10625000298023224, 0.02500000037252903, 0.02500000037252903], [0.706250011920929, 0.10625000298023224, 0.05000000074505806, 0.05000000074505806], [0.71875, 0.10625000298023224, 0.02500000037252903, 0.02500000037252903], [0.71875, 0.10625000298023224, 0.05000000074505806, 0.05000000074505806], [0.731249988079071, 0.10625000298023224, 0.02500000037252903, 0.02500000037252903], [0.731249988079071, 0.10625000298023224, 0.05000000074505806, 0.05000000074505806], [0.7437499761581421, 0.10625000298023224, 0.02500000037252903, 0.02500000037252903], [0.7437499761581421, 0.10625000298023224, 0.05000000074505806, 0.05000000074505806], [0.7562500238418579, 0.10625000298023224, 0.02500000037252903, 0.02500000037252903], [0.7562500238418579, 0.10625000298023224, 0.05000000074505806, 0.05000000074505806], [0.768750011920929, 0.10625000298023224, 0.02500000037252903, 0.02500000037252903], [0.768750011920929, 0.10625000298023224, 0.05000000074505806, 0.05000000074505806], [0.78125, 0.10625000298023224, 0.02500000037252903, 0.02500000037252903], [0.78125, 0.10625000298023224, 0.05000000074505806, 0.05000000074505806], [0.793749988079071, 0.10625000298023224, 0.02500000037252903, 0.02500000037252903], [0.793749988079071, 0.10625000298023224, 0.05000000074505806, 0.05000000074505806], [0.8062499761581421, 0.10625000298023224, 0.02500000037252903, 0.02500000037252903], [0.8062499761581421, 0.10625000298023224, 0.05000000074505806, 0.05000000074505806], [0.8187500238418579, 0.10625000298023224, 0.02500000037252903, 0.02500000037252903], [0.8187500238418579, 0.10625000298023224, 0.05000000074505806, 0.05000000074505806], [0.831250011920929, 0.10625000298023224, 0.02500000037252903, 0.02500000037252903], [0.831250011920929, 0.10625000298023224, 0.05000000074505806, 0.05000000074505806], [0.84375, 0.10625000298023224, 0.02500000037252903, 0.02500000037252903], [0.84375, 0.10625000298023224, 0.05000000074505806, 0.05000000074505806], [0.856249988079071, 0.10625000298023224, 0.02500000037252903, 0.02500000037252903], [0.856249988079071, 0.10625000298023224, 0.05000000074505806, 0.05000000074505806], [0.8687499761581421, 0.10625000298023224, 0.02500000037252903, 0.02500000037252903], [0.8687499761581421, 0.10625000298023224, 0.05000000074505806, 0.05000000074505806], [0.8812500238418579, 0.10625000298023224, 0.02500000037252903, 0.02500000037252903], [0.8812500238418579, 0.10625000298023224, 0.05000000074505806, 0.05000000074505806], [0.893750011920929, 0.10625000298023224, 0.02500000037252903, 0.02500000037252903], [0.893750011920929, 0.10625000298023224, 0.05000000074505806, 0.05000000074505806], [0.90625, 0.10625000298023224, 0.02500000037252903, 0.02500000037252903], [0.90625, 0.10625000298023224, 0.05000000074505806, 0.05000000074505806], [0.918749988079071, 0.10625000298023224, 0.02500000037252903, 0.02500000037252903], [0.918749988079071, 0.10625000298023224, 0.05000000074505806, 0.05000000074505806], [0.9312499761581421, 0.10625000298023224, 0.02500000037252903, 0.02500000037252903], [0.9312499761581421, 0.10625000298023224, 0.05000000074505806, 0.05000000074505806], [0.9437500238418579, 0.10625000298023224, 0.02500000037252903, 0.02500000037252903], [0.9437500238418579, 0.10625000298023224, 0.05000000074505806, 0.05000000074505806], [0.956250011920929, 0.10625000298023224, 0.02500000037252903, 0.02500000037252903], [0.956250011920929, 0.10625000298023224, 0.05000000074505806, 0.05000000074505806], [0.96875, 0.10625000298023224, 0.02500000037252903, 0.02500000037252903], [0.96875, 0.10625000298023224, 0.05000000074505806, 0.05000000074505806], [0.981249988079071, 0.10625000298023224, 0.02500000037252903, 0.02500000037252903], [0.981249988079071, 0.10625000298023224, 0.05000000074505806, 0.05000000074505806], [0.9937499761581421, 0.10625000298023224, 0.02500000037252903, 0.02500000037252903], [0.9937499761581421, 0.10625000298023224, 0.05000000074505806, 0.05000000074505806], [0.0062500000931322575, 0.11874999850988388, 0.02500000037252903, 0.02500000037252903], [0.0062500000931322575, 0.11874999850988388, 0.05000000074505806, 0.05000000074505806], [0.01875000074505806, 0.11874999850988388, 0.02500000037252903, 0.02500000037252903], [0.01875000074505806, 0.11874999850988388, 0.05000000074505806, 0.05000000074505806], [0.03125, 0.11874999850988388, 0.02500000037252903, 0.02500000037252903], [0.03125, 0.11874999850988388, 0.05000000074505806, 0.05000000074505806], [0.04374999925494194, 0.11874999850988388, 0.02500000037252903, 0.02500000037252903], [0.04374999925494194, 0.11874999850988388, 0.05000000074505806, 0.05000000074505806], [0.05624999850988388, 0.11874999850988388, 0.02500000037252903, 0.02500000037252903], [0.05624999850988388, 0.11874999850988388, 0.05000000074505806, 0.05000000074505806], [0.06875000149011612, 0.11874999850988388, 0.02500000037252903, 0.02500000037252903], [0.06875000149011612, 0.11874999850988388, 0.05000000074505806, 0.05000000074505806], [0.08124999701976776, 0.11874999850988388, 0.02500000037252903, 0.02500000037252903], [0.08124999701976776, 0.11874999850988388, 0.05000000074505806, 0.05000000074505806], [0.09375, 0.11874999850988388, 0.02500000037252903, 0.02500000037252903], [0.09375, 0.11874999850988388, 0.05000000074505806, 0.05000000074505806], [0.10625000298023224, 0.11874999850988388, 0.02500000037252903, 0.02500000037252903], [0.10625000298023224, 0.11874999850988388, 0.05000000074505806, 0.05000000074505806], [0.11874999850988388, 0.11874999850988388, 0.02500000037252903, 0.02500000037252903], [0.11874999850988388, 0.11874999850988388, 0.05000000074505806, 0.05000000074505806], [0.13124999403953552, 0.11874999850988388, 0.02500000037252903, 0.02500000037252903], [0.13124999403953552, 0.11874999850988388, 0.05000000074505806, 0.05000000074505806], [0.14374999701976776, 0.11874999850988388, 0.02500000037252903, 0.02500000037252903], [0.14374999701976776, 0.11874999850988388, 0.05000000074505806, 0.05000000074505806], [0.15625, 0.11874999850988388, 0.02500000037252903, 0.02500000037252903], [0.15625, 0.11874999850988388, 0.05000000074505806, 0.05000000074505806], [0.16875000298023224, 0.11874999850988388, 0.02500000037252903, 0.02500000037252903], [0.16875000298023224, 0.11874999850988388, 0.05000000074505806, 0.05000000074505806], [0.18125000596046448, 0.11874999850988388, 0.02500000037252903, 0.02500000037252903], [0.18125000596046448, 0.11874999850988388, 0.05000000074505806, 0.05000000074505806], [0.19374999403953552, 0.11874999850988388, 0.02500000037252903, 0.02500000037252903], [0.19374999403953552, 0.11874999850988388, 0.05000000074505806, 0.05000000074505806], [0.20624999701976776, 0.11874999850988388, 0.02500000037252903, 0.02500000037252903], [0.20624999701976776, 0.11874999850988388, 0.05000000074505806, 0.05000000074505806], [0.21875, 0.11874999850988388, 0.02500000037252903, 0.02500000037252903], [0.21875, 0.11874999850988388, 0.05000000074505806, 0.05000000074505806], [0.23125000298023224, 0.11874999850988388, 0.02500000037252903, 0.02500000037252903], [0.23125000298023224, 0.11874999850988388, 0.05000000074505806, 0.05000000074505806], [0.24375000596046448, 0.11874999850988388, 0.02500000037252903, 0.02500000037252903], [0.24375000596046448, 0.11874999850988388, 0.05000000074505806, 0.05000000074505806], [0.2562499940395355, 0.11874999850988388, 0.02500000037252903, 0.02500000037252903], [0.2562499940395355, 0.11874999850988388, 0.05000000074505806, 0.05000000074505806], [0.26875001192092896, 0.11874999850988388, 0.02500000037252903, 0.02500000037252903], [0.26875001192092896, 0.11874999850988388, 0.05000000074505806, 0.05000000074505806], [0.28125, 0.11874999850988388, 0.02500000037252903, 0.02500000037252903], [0.28125, 0.11874999850988388, 0.05000000074505806, 0.05000000074505806], [0.29374998807907104, 0.11874999850988388, 0.02500000037252903, 0.02500000037252903], [0.29374998807907104, 0.11874999850988388, 0.05000000074505806, 0.05000000074505806], [0.3062500059604645, 0.11874999850988388, 0.02500000037252903, 0.02500000037252903], [0.3062500059604645, 0.11874999850988388, 0.05000000074505806, 0.05000000074505806], [0.3187499940395355, 0.11874999850988388, 0.02500000037252903, 0.02500000037252903], [0.3187499940395355, 0.11874999850988388, 0.05000000074505806, 0.05000000074505806], [0.33125001192092896, 0.11874999850988388, 0.02500000037252903, 0.02500000037252903], [0.33125001192092896, 0.11874999850988388, 0.05000000074505806, 0.05000000074505806], [0.34375, 0.11874999850988388, 0.02500000037252903, 0.02500000037252903], [0.34375, 0.11874999850988388, 0.05000000074505806, 0.05000000074505806], [0.35624998807907104, 0.11874999850988388, 0.02500000037252903, 0.02500000037252903], [0.35624998807907104, 0.11874999850988388, 0.05000000074505806, 0.05000000074505806], [0.3687500059604645, 0.11874999850988388, 0.02500000037252903, 0.02500000037252903], [0.3687500059604645, 0.11874999850988388, 0.05000000074505806, 0.05000000074505806], [0.3812499940395355, 0.11874999850988388, 0.02500000037252903, 0.02500000037252903], [0.3812499940395355, 0.11874999850988388, 0.05000000074505806, 0.05000000074505806], [0.39375001192092896, 0.11874999850988388, 0.02500000037252903, 0.02500000037252903], [0.39375001192092896, 0.11874999850988388, 0.05000000074505806, 0.05000000074505806], [0.40625, 0.11874999850988388, 0.02500000037252903, 0.02500000037252903], [0.40625, 0.11874999850988388, 0.05000000074505806, 0.05000000074505806], [0.41874998807907104, 0.11874999850988388, 0.02500000037252903, 0.02500000037252903], [0.41874998807907104, 0.11874999850988388, 0.05000000074505806, 0.05000000074505806], [0.4312500059604645, 0.11874999850988388, 0.02500000037252903, 0.02500000037252903], [0.4312500059604645, 0.11874999850988388, 0.05000000074505806, 0.05000000074505806], [0.4437499940395355, 0.11874999850988388, 0.02500000037252903, 0.02500000037252903], [0.4437499940395355, 0.11874999850988388, 0.05000000074505806, 0.05000000074505806], [0.45625001192092896, 0.11874999850988388, 0.02500000037252903, 0.02500000037252903], [0.45625001192092896, 0.11874999850988388, 0.05000000074505806, 0.05000000074505806], [0.46875, 0.11874999850988388, 0.02500000037252903, 0.02500000037252903], [0.46875, 0.11874999850988388, 0.05000000074505806, 0.05000000074505806], [0.48124998807907104, 0.11874999850988388, 0.02500000037252903, 0.02500000037252903], [0.48124998807907104, 0.11874999850988388, 0.05000000074505806, 0.05000000074505806], [0.4937500059604645, 0.11874999850988388, 0.02500000037252903, 0.02500000037252903], [0.4937500059604645, 0.11874999850988388, 0.05000000074505806, 0.05000000074505806], [0.5062500238418579, 0.11874999850988388, 0.02500000037252903, 0.02500000037252903], [0.5062500238418579, 0.11874999850988388, 0.05000000074505806, 0.05000000074505806], [0.518750011920929, 0.11874999850988388, 0.02500000037252903, 0.02500000037252903], [0.518750011920929, 0.11874999850988388, 0.05000000074505806, 0.05000000074505806], [0.53125, 0.11874999850988388, 0.02500000037252903, 0.02500000037252903], [0.53125, 0.11874999850988388, 0.05000000074505806, 0.05000000074505806], [0.543749988079071, 0.11874999850988388, 0.02500000037252903, 0.02500000037252903], [0.543749988079071, 0.11874999850988388, 0.05000000074505806, 0.05000000074505806], [0.5562499761581421, 0.11874999850988388, 0.02500000037252903, 0.02500000037252903], [0.5562499761581421, 0.11874999850988388, 0.05000000074505806, 0.05000000074505806], [0.5687500238418579, 0.11874999850988388, 0.02500000037252903, 0.02500000037252903], [0.5687500238418579, 0.11874999850988388, 0.05000000074505806, 0.05000000074505806], [0.581250011920929, 0.11874999850988388, 0.02500000037252903, 0.02500000037252903], [0.581250011920929, 0.11874999850988388, 0.05000000074505806, 0.05000000074505806], [0.59375, 0.11874999850988388, 0.02500000037252903, 0.02500000037252903], [0.59375, 0.11874999850988388, 0.05000000074505806, 0.05000000074505806], [0.606249988079071, 0.11874999850988388, 0.02500000037252903, 0.02500000037252903], [0.606249988079071, 0.11874999850988388, 0.05000000074505806, 0.05000000074505806], [0.6187499761581421, 0.11874999850988388, 0.02500000037252903, 0.02500000037252903], [0.6187499761581421, 0.11874999850988388, 0.05000000074505806, 0.05000000074505806], [0.6312500238418579, 0.11874999850988388, 0.02500000037252903, 0.02500000037252903], [0.6312500238418579, 0.11874999850988388, 0.05000000074505806, 0.05000000074505806], [0.643750011920929, 0.11874999850988388, 0.02500000037252903, 0.02500000037252903], [0.643750011920929, 0.11874999850988388, 0.05000000074505806, 0.05000000074505806], [0.65625, 0.11874999850988388, 0.02500000037252903, 0.02500000037252903], [0.65625, 0.11874999850988388, 0.05000000074505806, 0.05000000074505806], [0.668749988079071, 0.11874999850988388, 0.02500000037252903, 0.02500000037252903], [0.668749988079071, 0.11874999850988388, 0.05000000074505806, 0.05000000074505806], [0.6812499761581421, 0.11874999850988388, 0.02500000037252903, 0.02500000037252903], [0.6812499761581421, 0.11874999850988388, 0.05000000074505806, 0.05000000074505806], [0.6937500238418579, 0.11874999850988388, 0.02500000037252903, 0.02500000037252903], [0.6937500238418579, 0.11874999850988388, 0.05000000074505806, 0.05000000074505806], [0.706250011920929, 0.11874999850988388, 0.02500000037252903, 0.02500000037252903], [0.706250011920929, 0.11874999850988388, 0.05000000074505806, 0.05000000074505806], [0.71875, 0.11874999850988388, 0.02500000037252903, 0.02500000037252903], [0.71875, 0.11874999850988388, 0.05000000074505806, 0.05000000074505806], [0.731249988079071, 0.11874999850988388, 0.02500000037252903, 0.02500000037252903], [0.731249988079071, 0.11874999850988388, 0.05000000074505806, 0.05000000074505806], [0.7437499761581421, 0.11874999850988388, 0.02500000037252903, 0.02500000037252903], [0.7437499761581421, 0.11874999850988388, 0.05000000074505806, 0.05000000074505806], [0.7562500238418579, 0.11874999850988388, 0.02500000037252903, 0.02500000037252903], [0.7562500238418579, 0.11874999850988388, 0.05000000074505806, 0.05000000074505806], [0.768750011920929, 0.11874999850988388, 0.02500000037252903, 0.02500000037252903], [0.768750011920929, 0.11874999850988388, 0.05000000074505806, 0.05000000074505806], [0.78125, 0.11874999850988388, 0.02500000037252903, 0.02500000037252903], [0.78125, 0.11874999850988388, 0.05000000074505806, 0.05000000074505806], [0.793749988079071, 0.11874999850988388, 0.02500000037252903, 0.02500000037252903], [0.793749988079071, 0.11874999850988388, 0.05000000074505806, 0.05000000074505806], [0.8062499761581421, 0.11874999850988388, 0.02500000037252903, 0.02500000037252903], [0.8062499761581421, 0.11874999850988388, 0.05000000074505806, 0.05000000074505806], [0.8187500238418579, 0.11874999850988388, 0.02500000037252903, 0.02500000037252903], [0.8187500238418579, 0.11874999850988388, 0.05000000074505806, 0.05000000074505806], [0.831250011920929, 0.11874999850988388, 0.02500000037252903, 0.02500000037252903], [0.831250011920929, 0.11874999850988388, 0.05000000074505806, 0.05000000074505806], [0.84375, 0.11874999850988388, 0.02500000037252903, 0.02500000037252903], [0.84375, 0.11874999850988388, 0.05000000074505806, 0.05000000074505806], [0.856249988079071, 0.11874999850988388, 0.02500000037252903, 0.02500000037252903], [0.856249988079071, 0.11874999850988388, 0.05000000074505806, 0.05000000074505806], [0.8687499761581421, 0.11874999850988388, 0.02500000037252903, 0.02500000037252903], [0.8687499761581421, 0.11874999850988388, 0.05000000074505806, 0.05000000074505806], [0.8812500238418579, 0.11874999850988388, 0.02500000037252903, 0.02500000037252903], [0.8812500238418579, 0.11874999850988388, 0.05000000074505806, 0.05000000074505806], [0.893750011920929, 0.11874999850988388, 0.02500000037252903, 0.02500000037252903], [0.893750011920929, 0.11874999850988388, 0.05000000074505806, 0.05000000074505806], [0.90625, 0.11874999850988388, 0.02500000037252903, 0.02500000037252903], [0.90625, 0.11874999850988388, 0.05000000074505806, 0.05000000074505806], [0.918749988079071, 0.11874999850988388, 0.02500000037252903, 0.02500000037252903], [0.918749988079071, 0.11874999850988388, 0.05000000074505806, 0.05000000074505806], [0.9312499761581421, 0.11874999850988388, 0.02500000037252903, 0.02500000037252903], [0.9312499761581421, 0.11874999850988388, 0.05000000074505806, 0.05000000074505806], [0.9437500238418579, 0.11874999850988388, 0.02500000037252903, 0.02500000037252903], [0.9437500238418579, 0.11874999850988388, 0.05000000074505806, 0.05000000074505806], [0.956250011920929, 0.11874999850988388, 0.02500000037252903, 0.02500000037252903], [0.956250011920929, 0.11874999850988388, 0.05000000074505806, 0.05000000074505806], [0.96875, 0.11874999850988388, 0.02500000037252903, 0.02500000037252903], [0.96875, 0.11874999850988388, 0.05000000074505806, 0.05000000074505806], [0.981249988079071, 0.11874999850988388, 0.02500000037252903, 0.02500000037252903], [0.981249988079071, 0.11874999850988388, 0.05000000074505806, 0.05000000074505806], [0.9937499761581421, 0.11874999850988388, 0.02500000037252903, 0.02500000037252903], [0.9937499761581421, 0.11874999850988388, 0.05000000074505806, 0.05000000074505806], [0.0062500000931322575, 0.13124999403953552, 0.02500000037252903, 0.02500000037252903], [0.0062500000931322575, 0.13124999403953552, 0.05000000074505806, 0.05000000074505806], [0.01875000074505806, 0.13124999403953552, 0.02500000037252903, 0.02500000037252903], [0.01875000074505806, 0.13124999403953552, 0.05000000074505806, 0.05000000074505806], [0.03125, 0.13124999403953552, 0.02500000037252903, 0.02500000037252903], [0.03125, 0.13124999403953552, 0.05000000074505806, 0.05000000074505806], [0.04374999925494194, 0.13124999403953552, 0.02500000037252903, 0.02500000037252903], [0.04374999925494194, 0.13124999403953552, 0.05000000074505806, 0.05000000074505806], [0.05624999850988388, 0.13124999403953552, 0.02500000037252903, 0.02500000037252903], [0.05624999850988388, 0.13124999403953552, 0.05000000074505806, 0.05000000074505806], [0.06875000149011612, 0.13124999403953552, 0.02500000037252903, 0.02500000037252903], [0.06875000149011612, 0.13124999403953552, 0.05000000074505806, 0.05000000074505806], [0.08124999701976776, 0.13124999403953552, 0.02500000037252903, 0.02500000037252903], [0.08124999701976776, 0.13124999403953552, 0.05000000074505806, 0.05000000074505806], [0.09375, 0.13124999403953552, 0.02500000037252903, 0.02500000037252903], [0.09375, 0.13124999403953552, 0.05000000074505806, 0.05000000074505806], [0.10625000298023224, 0.13124999403953552, 0.02500000037252903, 0.02500000037252903], [0.10625000298023224, 0.13124999403953552, 0.05000000074505806, 0.05000000074505806], [0.11874999850988388, 0.13124999403953552, 0.02500000037252903, 0.02500000037252903], [0.11874999850988388, 0.13124999403953552, 0.05000000074505806, 0.05000000074505806], [0.13124999403953552, 0.13124999403953552, 0.02500000037252903, 0.02500000037252903], [0.13124999403953552, 0.13124999403953552, 0.05000000074505806, 0.05000000074505806], [0.14374999701976776, 0.13124999403953552, 0.02500000037252903, 0.02500000037252903], [0.14374999701976776, 0.13124999403953552, 0.05000000074505806, 0.05000000074505806], [0.15625, 0.13124999403953552, 0.02500000037252903, 0.02500000037252903], [0.15625, 0.13124999403953552, 0.05000000074505806, 0.05000000074505806], [0.16875000298023224, 0.13124999403953552, 0.02500000037252903, 0.02500000037252903], [0.16875000298023224, 0.13124999403953552, 0.05000000074505806, 0.05000000074505806], [0.18125000596046448, 0.13124999403953552, 0.02500000037252903, 0.02500000037252903], [0.18125000596046448, 0.13124999403953552, 0.05000000074505806, 0.05000000074505806], [0.19374999403953552, 0.13124999403953552, 0.02500000037252903, 0.02500000037252903], [0.19374999403953552, 0.13124999403953552, 0.05000000074505806, 0.05000000074505806], [0.20624999701976776, 0.13124999403953552, 0.02500000037252903, 0.02500000037252903], [0.20624999701976776, 0.13124999403953552, 0.05000000074505806, 0.05000000074505806], [0.21875, 0.13124999403953552, 0.02500000037252903, 0.02500000037252903], [0.21875, 0.13124999403953552, 0.05000000074505806, 0.05000000074505806], [0.23125000298023224, 0.13124999403953552, 0.02500000037252903, 0.02500000037252903], [0.23125000298023224, 0.13124999403953552, 0.05000000074505806, 0.05000000074505806], [0.24375000596046448, 0.13124999403953552, 0.02500000037252903, 0.02500000037252903], [0.24375000596046448, 0.13124999403953552, 0.05000000074505806, 0.05000000074505806], [0.2562499940395355, 0.13124999403953552, 0.02500000037252903, 0.02500000037252903], [0.2562499940395355, 0.13124999403953552, 0.05000000074505806, 0.05000000074505806], [0.26875001192092896, 0.13124999403953552, 0.02500000037252903, 0.02500000037252903], [0.26875001192092896, 0.13124999403953552, 0.05000000074505806, 0.05000000074505806], [0.28125, 0.13124999403953552, 0.02500000037252903, 0.02500000037252903], [0.28125, 0.13124999403953552, 0.05000000074505806, 0.05000000074505806], [0.29374998807907104, 0.13124999403953552, 0.02500000037252903, 0.02500000037252903], [0.29374998807907104, 0.13124999403953552, 0.05000000074505806, 0.05000000074505806], [0.3062500059604645, 0.13124999403953552, 0.02500000037252903, 0.02500000037252903], [0.3062500059604645, 0.13124999403953552, 0.05000000074505806, 0.05000000074505806], [0.3187499940395355, 0.13124999403953552, 0.02500000037252903, 0.02500000037252903], [0.3187499940395355, 0.13124999403953552, 0.05000000074505806, 0.05000000074505806], [0.33125001192092896, 0.13124999403953552, 0.02500000037252903, 0.02500000037252903], [0.33125001192092896, 0.13124999403953552, 0.05000000074505806, 0.05000000074505806], [0.34375, 0.13124999403953552, 0.02500000037252903, 0.02500000037252903], [0.34375, 0.13124999403953552, 0.05000000074505806, 0.05000000074505806], [0.35624998807907104, 0.13124999403953552, 0.02500000037252903, 0.02500000037252903], [0.35624998807907104, 0.13124999403953552, 0.05000000074505806, 0.05000000074505806], [0.3687500059604645, 0.13124999403953552, 0.02500000037252903, 0.02500000037252903], [0.3687500059604645, 0.13124999403953552, 0.05000000074505806, 0.05000000074505806], [0.3812499940395355, 0.13124999403953552, 0.02500000037252903, 0.02500000037252903], [0.3812499940395355, 0.13124999403953552, 0.05000000074505806, 0.05000000074505806], [0.39375001192092896, 0.13124999403953552, 0.02500000037252903, 0.02500000037252903], [0.39375001192092896, 0.13124999403953552, 0.05000000074505806, 0.05000000074505806], [0.40625, 0.13124999403953552, 0.02500000037252903, 0.02500000037252903], [0.40625, 0.13124999403953552, 0.05000000074505806, 0.05000000074505806], [0.41874998807907104, 0.13124999403953552, 0.02500000037252903, 0.02500000037252903], [0.41874998807907104, 0.13124999403953552, 0.05000000074505806, 0.05000000074505806], [0.4312500059604645, 0.13124999403953552, 0.02500000037252903, 0.02500000037252903], [0.4312500059604645, 0.13124999403953552, 0.05000000074505806, 0.05000000074505806], [0.4437499940395355, 0.13124999403953552, 0.02500000037252903, 0.02500000037252903], [0.4437499940395355, 0.13124999403953552, 0.05000000074505806, 0.05000000074505806], [0.45625001192092896, 0.13124999403953552, 0.02500000037252903, 0.02500000037252903], [0.45625001192092896, 0.13124999403953552, 0.05000000074505806, 0.05000000074505806], [0.46875, 0.13124999403953552, 0.02500000037252903, 0.02500000037252903], [0.46875, 0.13124999403953552, 0.05000000074505806, 0.05000000074505806], [0.48124998807907104, 0.13124999403953552, 0.02500000037252903, 0.02500000037252903], [0.48124998807907104, 0.13124999403953552, 0.05000000074505806, 0.05000000074505806], [0.4937500059604645, 0.13124999403953552, 0.02500000037252903, 0.02500000037252903], [0.4937500059604645, 0.13124999403953552, 0.05000000074505806, 0.05000000074505806], [0.5062500238418579, 0.13124999403953552, 0.02500000037252903, 0.02500000037252903], [0.5062500238418579, 0.13124999403953552, 0.05000000074505806, 0.05000000074505806], [0.518750011920929, 0.13124999403953552, 0.02500000037252903, 0.02500000037252903], [0.518750011920929, 0.13124999403953552, 0.05000000074505806, 0.05000000074505806], [0.53125, 0.13124999403953552, 0.02500000037252903, 0.02500000037252903], [0.53125, 0.13124999403953552, 0.05000000074505806, 0.05000000074505806], [0.543749988079071, 0.13124999403953552, 0.02500000037252903, 0.02500000037252903], [0.543749988079071, 0.13124999403953552, 0.05000000074505806, 0.05000000074505806], [0.5562499761581421, 0.13124999403953552, 0.02500000037252903, 0.02500000037252903], [0.5562499761581421, 0.13124999403953552, 0.05000000074505806, 0.05000000074505806], [0.5687500238418579, 0.13124999403953552, 0.02500000037252903, 0.02500000037252903], [0.5687500238418579, 0.13124999403953552, 0.05000000074505806, 0.05000000074505806], [0.581250011920929, 0.13124999403953552, 0.02500000037252903, 0.02500000037252903], [0.581250011920929, 0.13124999403953552, 0.05000000074505806, 0.05000000074505806], [0.59375, 0.13124999403953552, 0.02500000037252903, 0.02500000037252903], [0.59375, 0.13124999403953552, 0.05000000074505806, 0.05000000074505806], [0.606249988079071, 0.13124999403953552, 0.02500000037252903, 0.02500000037252903], [0.606249988079071, 0.13124999403953552, 0.05000000074505806, 0.05000000074505806], [0.6187499761581421, 0.13124999403953552, 0.02500000037252903, 0.02500000037252903], [0.6187499761581421, 0.13124999403953552, 0.05000000074505806, 0.05000000074505806], [0.6312500238418579, 0.13124999403953552, 0.02500000037252903, 0.02500000037252903], [0.6312500238418579, 0.13124999403953552, 0.05000000074505806, 0.05000000074505806], [0.643750011920929, 0.13124999403953552, 0.02500000037252903, 0.02500000037252903], [0.643750011920929, 0.13124999403953552, 0.05000000074505806, 0.05000000074505806], [0.65625, 0.13124999403953552, 0.02500000037252903, 0.02500000037252903], [0.65625, 0.13124999403953552, 0.05000000074505806, 0.05000000074505806], [0.668749988079071, 0.13124999403953552, 0.02500000037252903, 0.02500000037252903], [0.668749988079071, 0.13124999403953552, 0.05000000074505806, 0.05000000074505806], [0.6812499761581421, 0.13124999403953552, 0.02500000037252903, 0.02500000037252903], [0.6812499761581421, 0.13124999403953552, 0.05000000074505806, 0.05000000074505806], [0.6937500238418579, 0.13124999403953552, 0.02500000037252903, 0.02500000037252903], [0.6937500238418579, 0.13124999403953552, 0.05000000074505806, 0.05000000074505806], [0.706250011920929, 0.13124999403953552, 0.02500000037252903, 0.02500000037252903], [0.706250011920929, 0.13124999403953552, 0.05000000074505806, 0.05000000074505806], [0.71875, 0.13124999403953552, 0.02500000037252903, 0.02500000037252903], [0.71875, 0.13124999403953552, 0.05000000074505806, 0.05000000074505806], [0.731249988079071, 0.13124999403953552, 0.02500000037252903, 0.02500000037252903], [0.731249988079071, 0.13124999403953552, 0.05000000074505806, 0.05000000074505806], [0.7437499761581421, 0.13124999403953552, 0.02500000037252903, 0.02500000037252903], [0.7437499761581421, 0.13124999403953552, 0.05000000074505806, 0.05000000074505806], [0.7562500238418579, 0.13124999403953552, 0.02500000037252903, 0.02500000037252903], [0.7562500238418579, 0.13124999403953552, 0.05000000074505806, 0.05000000074505806], [0.768750011920929, 0.13124999403953552, 0.02500000037252903, 0.02500000037252903], [0.768750011920929, 0.13124999403953552, 0.05000000074505806, 0.05000000074505806], [0.78125, 0.13124999403953552, 0.02500000037252903, 0.02500000037252903], [0.78125, 0.13124999403953552, 0.05000000074505806, 0.05000000074505806], [0.793749988079071, 0.13124999403953552, 0.02500000037252903, 0.02500000037252903], [0.793749988079071, 0.13124999403953552, 0.05000000074505806, 0.05000000074505806], [0.8062499761581421, 0.13124999403953552, 0.02500000037252903, 0.02500000037252903], [0.8062499761581421, 0.13124999403953552, 0.05000000074505806, 0.05000000074505806], [0.8187500238418579, 0.13124999403953552, 0.02500000037252903, 0.02500000037252903], [0.8187500238418579, 0.13124999403953552, 0.05000000074505806, 0.05000000074505806], [0.831250011920929, 0.13124999403953552, 0.02500000037252903, 0.02500000037252903], [0.831250011920929, 0.13124999403953552, 0.05000000074505806, 0.05000000074505806], [0.84375, 0.13124999403953552, 0.02500000037252903, 0.02500000037252903], [0.84375, 0.13124999403953552, 0.05000000074505806, 0.05000000074505806], [0.856249988079071, 0.13124999403953552, 0.02500000037252903, 0.02500000037252903], [0.856249988079071, 0.13124999403953552, 0.05000000074505806, 0.05000000074505806], [0.8687499761581421, 0.13124999403953552, 0.02500000037252903, 0.02500000037252903], [0.8687499761581421, 0.13124999403953552, 0.05000000074505806, 0.05000000074505806], [0.8812500238418579, 0.13124999403953552, 0.02500000037252903, 0.02500000037252903], [0.8812500238418579, 0.13124999403953552, 0.05000000074505806, 0.05000000074505806], [0.893750011920929, 0.13124999403953552, 0.02500000037252903, 0.02500000037252903], [0.893750011920929, 0.13124999403953552, 0.05000000074505806, 0.05000000074505806], [0.90625, 0.13124999403953552, 0.02500000037252903, 0.02500000037252903], [0.90625, 0.13124999403953552, 0.05000000074505806, 0.05000000074505806], [0.918749988079071, 0.13124999403953552, 0.02500000037252903, 0.02500000037252903], [0.918749988079071, 0.13124999403953552, 0.05000000074505806, 0.05000000074505806], [0.9312499761581421, 0.13124999403953552, 0.02500000037252903, 0.02500000037252903], [0.9312499761581421, 0.13124999403953552, 0.05000000074505806, 0.05000000074505806], [0.9437500238418579, 0.13124999403953552, 0.02500000037252903, 0.02500000037252903], [0.9437500238418579, 0.13124999403953552, 0.05000000074505806, 0.05000000074505806], [0.956250011920929, 0.13124999403953552, 0.02500000037252903, 0.02500000037252903], [0.956250011920929, 0.13124999403953552, 0.05000000074505806, 0.05000000074505806], [0.96875, 0.13124999403953552, 0.02500000037252903, 0.02500000037252903], [0.96875, 0.13124999403953552, 0.05000000074505806, 0.05000000074505806], [0.981249988079071, 0.13124999403953552, 0.02500000037252903, 0.02500000037252903], [0.981249988079071, 0.13124999403953552, 0.05000000074505806, 0.05000000074505806], [0.9937499761581421, 0.13124999403953552, 0.02500000037252903, 0.02500000037252903], [0.9937499761581421, 0.13124999403953552, 0.05000000074505806, 0.05000000074505806], [0.0062500000931322575, 0.14374999701976776, 0.02500000037252903, 0.02500000037252903], [0.0062500000931322575, 0.14374999701976776, 0.05000000074505806, 0.05000000074505806], [0.01875000074505806, 0.14374999701976776, 0.02500000037252903, 0.02500000037252903], [0.01875000074505806, 0.14374999701976776, 0.05000000074505806, 0.05000000074505806], [0.03125, 0.14374999701976776, 0.02500000037252903, 0.02500000037252903], [0.03125, 0.14374999701976776, 0.05000000074505806, 0.05000000074505806], [0.04374999925494194, 0.14374999701976776, 0.02500000037252903, 0.02500000037252903], [0.04374999925494194, 0.14374999701976776, 0.05000000074505806, 0.05000000074505806], [0.05624999850988388, 0.14374999701976776, 0.02500000037252903, 0.02500000037252903], [0.05624999850988388, 0.14374999701976776, 0.05000000074505806, 0.05000000074505806], [0.06875000149011612, 0.14374999701976776, 0.02500000037252903, 0.02500000037252903], [0.06875000149011612, 0.14374999701976776, 0.05000000074505806, 0.05000000074505806], [0.08124999701976776, 0.14374999701976776, 0.02500000037252903, 0.02500000037252903], [0.08124999701976776, 0.14374999701976776, 0.05000000074505806, 0.05000000074505806], [0.09375, 0.14374999701976776, 0.02500000037252903, 0.02500000037252903], [0.09375, 0.14374999701976776, 0.05000000074505806, 0.05000000074505806], [0.10625000298023224, 0.14374999701976776, 0.02500000037252903, 0.02500000037252903], [0.10625000298023224, 0.14374999701976776, 0.05000000074505806, 0.05000000074505806], [0.11874999850988388, 0.14374999701976776, 0.02500000037252903, 0.02500000037252903], [0.11874999850988388, 0.14374999701976776, 0.05000000074505806, 0.05000000074505806], [0.13124999403953552, 0.14374999701976776, 0.02500000037252903, 0.02500000037252903], [0.13124999403953552, 0.14374999701976776, 0.05000000074505806, 0.05000000074505806], [0.14374999701976776, 0.14374999701976776, 0.02500000037252903, 0.02500000037252903], [0.14374999701976776, 0.14374999701976776, 0.05000000074505806, 0.05000000074505806], [0.15625, 0.14374999701976776, 0.02500000037252903, 0.02500000037252903], [0.15625, 0.14374999701976776, 0.05000000074505806, 0.05000000074505806], [0.16875000298023224, 0.14374999701976776, 0.02500000037252903, 0.02500000037252903], [0.16875000298023224, 0.14374999701976776, 0.05000000074505806, 0.05000000074505806], [0.18125000596046448, 0.14374999701976776, 0.02500000037252903, 0.02500000037252903], [0.18125000596046448, 0.14374999701976776, 0.05000000074505806, 0.05000000074505806], [0.19374999403953552, 0.14374999701976776, 0.02500000037252903, 0.02500000037252903], [0.19374999403953552, 0.14374999701976776, 0.05000000074505806, 0.05000000074505806], [0.20624999701976776, 0.14374999701976776, 0.02500000037252903, 0.02500000037252903], [0.20624999701976776, 0.14374999701976776, 0.05000000074505806, 0.05000000074505806], [0.21875, 0.14374999701976776, 0.02500000037252903, 0.02500000037252903], [0.21875, 0.14374999701976776, 0.05000000074505806, 0.05000000074505806], [0.23125000298023224, 0.14374999701976776, 0.02500000037252903, 0.02500000037252903], [0.23125000298023224, 0.14374999701976776, 0.05000000074505806, 0.05000000074505806], [0.24375000596046448, 0.14374999701976776, 0.02500000037252903, 0.02500000037252903], [0.24375000596046448, 0.14374999701976776, 0.05000000074505806, 0.05000000074505806], [0.2562499940395355, 0.14374999701976776, 0.02500000037252903, 0.02500000037252903], [0.2562499940395355, 0.14374999701976776, 0.05000000074505806, 0.05000000074505806], [0.26875001192092896, 0.14374999701976776, 0.02500000037252903, 0.02500000037252903], [0.26875001192092896, 0.14374999701976776, 0.05000000074505806, 0.05000000074505806], [0.28125, 0.14374999701976776, 0.02500000037252903, 0.02500000037252903], [0.28125, 0.14374999701976776, 0.05000000074505806, 0.05000000074505806], [0.29374998807907104, 0.14374999701976776, 0.02500000037252903, 0.02500000037252903], [0.29374998807907104, 0.14374999701976776, 0.05000000074505806, 0.05000000074505806], [0.3062500059604645, 0.14374999701976776, 0.02500000037252903, 0.02500000037252903], [0.3062500059604645, 0.14374999701976776, 0.05000000074505806, 0.05000000074505806], [0.3187499940395355, 0.14374999701976776, 0.02500000037252903, 0.02500000037252903], [0.3187499940395355, 0.14374999701976776, 0.05000000074505806, 0.05000000074505806], [0.33125001192092896, 0.14374999701976776, 0.02500000037252903, 0.02500000037252903], [0.33125001192092896, 0.14374999701976776, 0.05000000074505806, 0.05000000074505806], [0.34375, 0.14374999701976776, 0.02500000037252903, 0.02500000037252903], [0.34375, 0.14374999701976776, 0.05000000074505806, 0.05000000074505806], [0.35624998807907104, 0.14374999701976776, 0.02500000037252903, 0.02500000037252903], [0.35624998807907104, 0.14374999701976776, 0.05000000074505806, 0.05000000074505806], [0.3687500059604645, 0.14374999701976776, 0.02500000037252903, 0.02500000037252903], [0.3687500059604645, 0.14374999701976776, 0.05000000074505806, 0.05000000074505806], [0.3812499940395355, 0.14374999701976776, 0.02500000037252903, 0.02500000037252903], [0.3812499940395355, 0.14374999701976776, 0.05000000074505806, 0.05000000074505806], [0.39375001192092896, 0.14374999701976776, 0.02500000037252903, 0.02500000037252903], [0.39375001192092896, 0.14374999701976776, 0.05000000074505806, 0.05000000074505806], [0.40625, 0.14374999701976776, 0.02500000037252903, 0.02500000037252903], [0.40625, 0.14374999701976776, 0.05000000074505806, 0.05000000074505806], [0.41874998807907104, 0.14374999701976776, 0.02500000037252903, 0.02500000037252903], [0.41874998807907104, 0.14374999701976776, 0.05000000074505806, 0.05000000074505806], [0.4312500059604645, 0.14374999701976776, 0.02500000037252903, 0.02500000037252903], [0.4312500059604645, 0.14374999701976776, 0.05000000074505806, 0.05000000074505806], [0.4437499940395355, 0.14374999701976776, 0.02500000037252903, 0.02500000037252903], [0.4437499940395355, 0.14374999701976776, 0.05000000074505806, 0.05000000074505806], [0.45625001192092896, 0.14374999701976776, 0.02500000037252903, 0.02500000037252903], [0.45625001192092896, 0.14374999701976776, 0.05000000074505806, 0.05000000074505806], [0.46875, 0.14374999701976776, 0.02500000037252903, 0.02500000037252903], [0.46875, 0.14374999701976776, 0.05000000074505806, 0.05000000074505806], [0.48124998807907104, 0.14374999701976776, 0.02500000037252903, 0.02500000037252903], [0.48124998807907104, 0.14374999701976776, 0.05000000074505806, 0.05000000074505806], [0.4937500059604645, 0.14374999701976776, 0.02500000037252903, 0.02500000037252903], [0.4937500059604645, 0.14374999701976776, 0.05000000074505806, 0.05000000074505806], [0.5062500238418579, 0.14374999701976776, 0.02500000037252903, 0.02500000037252903], [0.5062500238418579, 0.14374999701976776, 0.05000000074505806, 0.05000000074505806], [0.518750011920929, 0.14374999701976776, 0.02500000037252903, 0.02500000037252903], [0.518750011920929, 0.14374999701976776, 0.05000000074505806, 0.05000000074505806], [0.53125, 0.14374999701976776, 0.02500000037252903, 0.02500000037252903], [0.53125, 0.14374999701976776, 0.05000000074505806, 0.05000000074505806], [0.543749988079071, 0.14374999701976776, 0.02500000037252903, 0.02500000037252903], [0.543749988079071, 0.14374999701976776, 0.05000000074505806, 0.05000000074505806], [0.5562499761581421, 0.14374999701976776, 0.02500000037252903, 0.02500000037252903], [0.5562499761581421, 0.14374999701976776, 0.05000000074505806, 0.05000000074505806], [0.5687500238418579, 0.14374999701976776, 0.02500000037252903, 0.02500000037252903], [0.5687500238418579, 0.14374999701976776, 0.05000000074505806, 0.05000000074505806], [0.581250011920929, 0.14374999701976776, 0.02500000037252903, 0.02500000037252903], [0.581250011920929, 0.14374999701976776, 0.05000000074505806, 0.05000000074505806], [0.59375, 0.14374999701976776, 0.02500000037252903, 0.02500000037252903], [0.59375, 0.14374999701976776, 0.05000000074505806, 0.05000000074505806], [0.606249988079071, 0.14374999701976776, 0.02500000037252903, 0.02500000037252903], [0.606249988079071, 0.14374999701976776, 0.05000000074505806, 0.05000000074505806], [0.6187499761581421, 0.14374999701976776, 0.02500000037252903, 0.02500000037252903], [0.6187499761581421, 0.14374999701976776, 0.05000000074505806, 0.05000000074505806], [0.6312500238418579, 0.14374999701976776, 0.02500000037252903, 0.02500000037252903], [0.6312500238418579, 0.14374999701976776, 0.05000000074505806, 0.05000000074505806], [0.643750011920929, 0.14374999701976776, 0.02500000037252903, 0.02500000037252903], [0.643750011920929, 0.14374999701976776, 0.05000000074505806, 0.05000000074505806], [0.65625, 0.14374999701976776, 0.02500000037252903, 0.02500000037252903], [0.65625, 0.14374999701976776, 0.05000000074505806, 0.05000000074505806], [0.668749988079071, 0.14374999701976776, 0.02500000037252903, 0.02500000037252903], [0.668749988079071, 0.14374999701976776, 0.05000000074505806, 0.05000000074505806], [0.6812499761581421, 0.14374999701976776, 0.02500000037252903, 0.02500000037252903], [0.6812499761581421, 0.14374999701976776, 0.05000000074505806, 0.05000000074505806], [0.6937500238418579, 0.14374999701976776, 0.02500000037252903, 0.02500000037252903], [0.6937500238418579, 0.14374999701976776, 0.05000000074505806, 0.05000000074505806], [0.706250011920929, 0.14374999701976776, 0.02500000037252903, 0.02500000037252903], [0.706250011920929, 0.14374999701976776, 0.05000000074505806, 0.05000000074505806], [0.71875, 0.14374999701976776, 0.02500000037252903, 0.02500000037252903], [0.71875, 0.14374999701976776, 0.05000000074505806, 0.05000000074505806], [0.731249988079071, 0.14374999701976776, 0.02500000037252903, 0.02500000037252903], [0.731249988079071, 0.14374999701976776, 0.05000000074505806, 0.05000000074505806], [0.7437499761581421, 0.14374999701976776, 0.02500000037252903, 0.02500000037252903], [0.7437499761581421, 0.14374999701976776, 0.05000000074505806, 0.05000000074505806], [0.7562500238418579, 0.14374999701976776, 0.02500000037252903, 0.02500000037252903], [0.7562500238418579, 0.14374999701976776, 0.05000000074505806, 0.05000000074505806], [0.768750011920929, 0.14374999701976776, 0.02500000037252903, 0.02500000037252903], [0.768750011920929, 0.14374999701976776, 0.05000000074505806, 0.05000000074505806], [0.78125, 0.14374999701976776, 0.02500000037252903, 0.02500000037252903], [0.78125, 0.14374999701976776, 0.05000000074505806, 0.05000000074505806], [0.793749988079071, 0.14374999701976776, 0.02500000037252903, 0.02500000037252903], [0.793749988079071, 0.14374999701976776, 0.05000000074505806, 0.05000000074505806], [0.8062499761581421, 0.14374999701976776, 0.02500000037252903, 0.02500000037252903], [0.8062499761581421, 0.14374999701976776, 0.05000000074505806, 0.05000000074505806], [0.8187500238418579, 0.14374999701976776, 0.02500000037252903, 0.02500000037252903], [0.8187500238418579, 0.14374999701976776, 0.05000000074505806, 0.05000000074505806], [0.831250011920929, 0.14374999701976776, 0.02500000037252903, 0.02500000037252903], [0.831250011920929, 0.14374999701976776, 0.05000000074505806, 0.05000000074505806], [0.84375, 0.14374999701976776, 0.02500000037252903, 0.02500000037252903], [0.84375, 0.14374999701976776, 0.05000000074505806, 0.05000000074505806], [0.856249988079071, 0.14374999701976776, 0.02500000037252903, 0.02500000037252903], [0.856249988079071, 0.14374999701976776, 0.05000000074505806, 0.05000000074505806], [0.8687499761581421, 0.14374999701976776, 0.02500000037252903, 0.02500000037252903], [0.8687499761581421, 0.14374999701976776, 0.05000000074505806, 0.05000000074505806], [0.8812500238418579, 0.14374999701976776, 0.02500000037252903, 0.02500000037252903], [0.8812500238418579, 0.14374999701976776, 0.05000000074505806, 0.05000000074505806], [0.893750011920929, 0.14374999701976776, 0.02500000037252903, 0.02500000037252903], [0.893750011920929, 0.14374999701976776, 0.05000000074505806, 0.05000000074505806], [0.90625, 0.14374999701976776, 0.02500000037252903, 0.02500000037252903], [0.90625, 0.14374999701976776, 0.05000000074505806, 0.05000000074505806], [0.918749988079071, 0.14374999701976776, 0.02500000037252903, 0.02500000037252903], [0.918749988079071, 0.14374999701976776, 0.05000000074505806, 0.05000000074505806], [0.9312499761581421, 0.14374999701976776, 0.02500000037252903, 0.02500000037252903], [0.9312499761581421, 0.14374999701976776, 0.05000000074505806, 0.05000000074505806], [0.9437500238418579, 0.14374999701976776, 0.02500000037252903, 0.02500000037252903], [0.9437500238418579, 0.14374999701976776, 0.05000000074505806, 0.05000000074505806], [0.956250011920929, 0.14374999701976776, 0.02500000037252903, 0.02500000037252903], [0.956250011920929, 0.14374999701976776, 0.05000000074505806, 0.05000000074505806], [0.96875, 0.14374999701976776, 0.02500000037252903, 0.02500000037252903], [0.96875, 0.14374999701976776, 0.05000000074505806, 0.05000000074505806], [0.981249988079071, 0.14374999701976776, 0.02500000037252903, 0.02500000037252903], [0.981249988079071, 0.14374999701976776, 0.05000000074505806, 0.05000000074505806], [0.9937499761581421, 0.14374999701976776, 0.02500000037252903, 0.02500000037252903], [0.9937499761581421, 0.14374999701976776, 0.05000000074505806, 0.05000000074505806], [0.0062500000931322575, 0.15625, 0.02500000037252903, 0.02500000037252903], [0.0062500000931322575, 0.15625, 0.05000000074505806, 0.05000000074505806], [0.01875000074505806, 0.15625, 0.02500000037252903, 0.02500000037252903], [0.01875000074505806, 0.15625, 0.05000000074505806, 0.05000000074505806], [0.03125, 0.15625, 0.02500000037252903, 0.02500000037252903], [0.03125, 0.15625, 0.05000000074505806, 0.05000000074505806], [0.04374999925494194, 0.15625, 0.02500000037252903, 0.02500000037252903], [0.04374999925494194, 0.15625, 0.05000000074505806, 0.05000000074505806], [0.05624999850988388, 0.15625, 0.02500000037252903, 0.02500000037252903], [0.05624999850988388, 0.15625, 0.05000000074505806, 0.05000000074505806], [0.06875000149011612, 0.15625, 0.02500000037252903, 0.02500000037252903], [0.06875000149011612, 0.15625, 0.05000000074505806, 0.05000000074505806], [0.08124999701976776, 0.15625, 0.02500000037252903, 0.02500000037252903], [0.08124999701976776, 0.15625, 0.05000000074505806, 0.05000000074505806], [0.09375, 0.15625, 0.02500000037252903, 0.02500000037252903], [0.09375, 0.15625, 0.05000000074505806, 0.05000000074505806], [0.10625000298023224, 0.15625, 0.02500000037252903, 0.02500000037252903], [0.10625000298023224, 0.15625, 0.05000000074505806, 0.05000000074505806], [0.11874999850988388, 0.15625, 0.02500000037252903, 0.02500000037252903], [0.11874999850988388, 0.15625, 0.05000000074505806, 0.05000000074505806], [0.13124999403953552, 0.15625, 0.02500000037252903, 0.02500000037252903], [0.13124999403953552, 0.15625, 0.05000000074505806, 0.05000000074505806], [0.14374999701976776, 0.15625, 0.02500000037252903, 0.02500000037252903], [0.14374999701976776, 0.15625, 0.05000000074505806, 0.05000000074505806], [0.15625, 0.15625, 0.02500000037252903, 0.02500000037252903], [0.15625, 0.15625, 0.05000000074505806, 0.05000000074505806], [0.16875000298023224, 0.15625, 0.02500000037252903, 0.02500000037252903], [0.16875000298023224, 0.15625, 0.05000000074505806, 0.05000000074505806], [0.18125000596046448, 0.15625, 0.02500000037252903, 0.02500000037252903], [0.18125000596046448, 0.15625, 0.05000000074505806, 0.05000000074505806], [0.19374999403953552, 0.15625, 0.02500000037252903, 0.02500000037252903], [0.19374999403953552, 0.15625, 0.05000000074505806, 0.05000000074505806], [0.20624999701976776, 0.15625, 0.02500000037252903, 0.02500000037252903], [0.20624999701976776, 0.15625, 0.05000000074505806, 0.05000000074505806], [0.21875, 0.15625, 0.02500000037252903, 0.02500000037252903], [0.21875, 0.15625, 0.05000000074505806, 0.05000000074505806], [0.23125000298023224, 0.15625, 0.02500000037252903, 0.02500000037252903], [0.23125000298023224, 0.15625, 0.05000000074505806, 0.05000000074505806], [0.24375000596046448, 0.15625, 0.02500000037252903, 0.02500000037252903], [0.24375000596046448, 0.15625, 0.05000000074505806, 0.05000000074505806], [0.2562499940395355, 0.15625, 0.02500000037252903, 0.02500000037252903], [0.2562499940395355, 0.15625, 0.05000000074505806, 0.05000000074505806], [0.26875001192092896, 0.15625, 0.02500000037252903, 0.02500000037252903], [0.26875001192092896, 0.15625, 0.05000000074505806, 0.05000000074505806], [0.28125, 0.15625, 0.02500000037252903, 0.02500000037252903], [0.28125, 0.15625, 0.05000000074505806, 0.05000000074505806], [0.29374998807907104, 0.15625, 0.02500000037252903, 0.02500000037252903], [0.29374998807907104, 0.15625, 0.05000000074505806, 0.05000000074505806], [0.3062500059604645, 0.15625, 0.02500000037252903, 0.02500000037252903], [0.3062500059604645, 0.15625, 0.05000000074505806, 0.05000000074505806], [0.3187499940395355, 0.15625, 0.02500000037252903, 0.02500000037252903], [0.3187499940395355, 0.15625, 0.05000000074505806, 0.05000000074505806], [0.33125001192092896, 0.15625, 0.02500000037252903, 0.02500000037252903], [0.33125001192092896, 0.15625, 0.05000000074505806, 0.05000000074505806], [0.34375, 0.15625, 0.02500000037252903, 0.02500000037252903], [0.34375, 0.15625, 0.05000000074505806, 0.05000000074505806], [0.35624998807907104, 0.15625, 0.02500000037252903, 0.02500000037252903], [0.35624998807907104, 0.15625, 0.05000000074505806, 0.05000000074505806], [0.3687500059604645, 0.15625, 0.02500000037252903, 0.02500000037252903], [0.3687500059604645, 0.15625, 0.05000000074505806, 0.05000000074505806], [0.3812499940395355, 0.15625, 0.02500000037252903, 0.02500000037252903], [0.3812499940395355, 0.15625, 0.05000000074505806, 0.05000000074505806], [0.39375001192092896, 0.15625, 0.02500000037252903, 0.02500000037252903], [0.39375001192092896, 0.15625, 0.05000000074505806, 0.05000000074505806], [0.40625, 0.15625, 0.02500000037252903, 0.02500000037252903], [0.40625, 0.15625, 0.05000000074505806, 0.05000000074505806], [0.41874998807907104, 0.15625, 0.02500000037252903, 0.02500000037252903], [0.41874998807907104, 0.15625, 0.05000000074505806, 0.05000000074505806], [0.4312500059604645, 0.15625, 0.02500000037252903, 0.02500000037252903], [0.4312500059604645, 0.15625, 0.05000000074505806, 0.05000000074505806], [0.4437499940395355, 0.15625, 0.02500000037252903, 0.02500000037252903], [0.4437499940395355, 0.15625, 0.05000000074505806, 0.05000000074505806], [0.45625001192092896, 0.15625, 0.02500000037252903, 0.02500000037252903], [0.45625001192092896, 0.15625, 0.05000000074505806, 0.05000000074505806], [0.46875, 0.15625, 0.02500000037252903, 0.02500000037252903], [0.46875, 0.15625, 0.05000000074505806, 0.05000000074505806], [0.48124998807907104, 0.15625, 0.02500000037252903, 0.02500000037252903], [0.48124998807907104, 0.15625, 0.05000000074505806, 0.05000000074505806], [0.4937500059604645, 0.15625, 0.02500000037252903, 0.02500000037252903], [0.4937500059604645, 0.15625, 0.05000000074505806, 0.05000000074505806], [0.5062500238418579, 0.15625, 0.02500000037252903, 0.02500000037252903], [0.5062500238418579, 0.15625, 0.05000000074505806, 0.05000000074505806], [0.518750011920929, 0.15625, 0.02500000037252903, 0.02500000037252903], [0.518750011920929, 0.15625, 0.05000000074505806, 0.05000000074505806], [0.53125, 0.15625, 0.02500000037252903, 0.02500000037252903], [0.53125, 0.15625, 0.05000000074505806, 0.05000000074505806], [0.543749988079071, 0.15625, 0.02500000037252903, 0.02500000037252903], [0.543749988079071, 0.15625, 0.05000000074505806, 0.05000000074505806], [0.5562499761581421, 0.15625, 0.02500000037252903, 0.02500000037252903], [0.5562499761581421, 0.15625, 0.05000000074505806, 0.05000000074505806], [0.5687500238418579, 0.15625, 0.02500000037252903, 0.02500000037252903], [0.5687500238418579, 0.15625, 0.05000000074505806, 0.05000000074505806], [0.581250011920929, 0.15625, 0.02500000037252903, 0.02500000037252903], [0.581250011920929, 0.15625, 0.05000000074505806, 0.05000000074505806], [0.59375, 0.15625, 0.02500000037252903, 0.02500000037252903], [0.59375, 0.15625, 0.05000000074505806, 0.05000000074505806], [0.606249988079071, 0.15625, 0.02500000037252903, 0.02500000037252903], [0.606249988079071, 0.15625, 0.05000000074505806, 0.05000000074505806], [0.6187499761581421, 0.15625, 0.02500000037252903, 0.02500000037252903], [0.6187499761581421, 0.15625, 0.05000000074505806, 0.05000000074505806], [0.6312500238418579, 0.15625, 0.02500000037252903, 0.02500000037252903], [0.6312500238418579, 0.15625, 0.05000000074505806, 0.05000000074505806], [0.643750011920929, 0.15625, 0.02500000037252903, 0.02500000037252903], [0.643750011920929, 0.15625, 0.05000000074505806, 0.05000000074505806], [0.65625, 0.15625, 0.02500000037252903, 0.02500000037252903], [0.65625, 0.15625, 0.05000000074505806, 0.05000000074505806], [0.668749988079071, 0.15625, 0.02500000037252903, 0.02500000037252903], [0.668749988079071, 0.15625, 0.05000000074505806, 0.05000000074505806], [0.6812499761581421, 0.15625, 0.02500000037252903, 0.02500000037252903], [0.6812499761581421, 0.15625, 0.05000000074505806, 0.05000000074505806], [0.6937500238418579, 0.15625, 0.02500000037252903, 0.02500000037252903], [0.6937500238418579, 0.15625, 0.05000000074505806, 0.05000000074505806], [0.706250011920929, 0.15625, 0.02500000037252903, 0.02500000037252903], [0.706250011920929, 0.15625, 0.05000000074505806, 0.05000000074505806], [0.71875, 0.15625, 0.02500000037252903, 0.02500000037252903], [0.71875, 0.15625, 0.05000000074505806, 0.05000000074505806], [0.731249988079071, 0.15625, 0.02500000037252903, 0.02500000037252903], [0.731249988079071, 0.15625, 0.05000000074505806, 0.05000000074505806], [0.7437499761581421, 0.15625, 0.02500000037252903, 0.02500000037252903], [0.7437499761581421, 0.15625, 0.05000000074505806, 0.05000000074505806], [0.7562500238418579, 0.15625, 0.02500000037252903, 0.02500000037252903], [0.7562500238418579, 0.15625, 0.05000000074505806, 0.05000000074505806], [0.768750011920929, 0.15625, 0.02500000037252903, 0.02500000037252903], [0.768750011920929, 0.15625, 0.05000000074505806, 0.05000000074505806], [0.78125, 0.15625, 0.02500000037252903, 0.02500000037252903], [0.78125, 0.15625, 0.05000000074505806, 0.05000000074505806], [0.793749988079071, 0.15625, 0.02500000037252903, 0.02500000037252903], [0.793749988079071, 0.15625, 0.05000000074505806, 0.05000000074505806], [0.8062499761581421, 0.15625, 0.02500000037252903, 0.02500000037252903], [0.8062499761581421, 0.15625, 0.05000000074505806, 0.05000000074505806], [0.8187500238418579, 0.15625, 0.02500000037252903, 0.02500000037252903], [0.8187500238418579, 0.15625, 0.05000000074505806, 0.05000000074505806], [0.831250011920929, 0.15625, 0.02500000037252903, 0.02500000037252903], [0.831250011920929, 0.15625, 0.05000000074505806, 0.05000000074505806], [0.84375, 0.15625, 0.02500000037252903, 0.02500000037252903], [0.84375, 0.15625, 0.05000000074505806, 0.05000000074505806], [0.856249988079071, 0.15625, 0.02500000037252903, 0.02500000037252903], [0.856249988079071, 0.15625, 0.05000000074505806, 0.05000000074505806], [0.8687499761581421, 0.15625, 0.02500000037252903, 0.02500000037252903], [0.8687499761581421, 0.15625, 0.05000000074505806, 0.05000000074505806], [0.8812500238418579, 0.15625, 0.02500000037252903, 0.02500000037252903], [0.8812500238418579, 0.15625, 0.05000000074505806, 0.05000000074505806], [0.893750011920929, 0.15625, 0.02500000037252903, 0.02500000037252903], [0.893750011920929, 0.15625, 0.05000000074505806, 0.05000000074505806], [0.90625, 0.15625, 0.02500000037252903, 0.02500000037252903], [0.90625, 0.15625, 0.05000000074505806, 0.05000000074505806], [0.918749988079071, 0.15625, 0.02500000037252903, 0.02500000037252903], [0.918749988079071, 0.15625, 0.05000000074505806, 0.05000000074505806], [0.9312499761581421, 0.15625, 0.02500000037252903, 0.02500000037252903], [0.9312499761581421, 0.15625, 0.05000000074505806, 0.05000000074505806], [0.9437500238418579, 0.15625, 0.02500000037252903, 0.02500000037252903], [0.9437500238418579, 0.15625, 0.05000000074505806, 0.05000000074505806], [0.956250011920929, 0.15625, 0.02500000037252903, 0.02500000037252903], [0.956250011920929, 0.15625, 0.05000000074505806, 0.05000000074505806], [0.96875, 0.15625, 0.02500000037252903, 0.02500000037252903], [0.96875, 0.15625, 0.05000000074505806, 0.05000000074505806], [0.981249988079071, 0.15625, 0.02500000037252903, 0.02500000037252903], [0.981249988079071, 0.15625, 0.05000000074505806, 0.05000000074505806], [0.9937499761581421, 0.15625, 0.02500000037252903, 0.02500000037252903], [0.9937499761581421, 0.15625, 0.05000000074505806, 0.05000000074505806], [0.0062500000931322575, 0.16875000298023224, 0.02500000037252903, 0.02500000037252903], [0.0062500000931322575, 0.16875000298023224, 0.05000000074505806, 0.05000000074505806], [0.01875000074505806, 0.16875000298023224, 0.02500000037252903, 0.02500000037252903], [0.01875000074505806, 0.16875000298023224, 0.05000000074505806, 0.05000000074505806], [0.03125, 0.16875000298023224, 0.02500000037252903, 0.02500000037252903], [0.03125, 0.16875000298023224, 0.05000000074505806, 0.05000000074505806], [0.04374999925494194, 0.16875000298023224, 0.02500000037252903, 0.02500000037252903], [0.04374999925494194, 0.16875000298023224, 0.05000000074505806, 0.05000000074505806], [0.05624999850988388, 0.16875000298023224, 0.02500000037252903, 0.02500000037252903], [0.05624999850988388, 0.16875000298023224, 0.05000000074505806, 0.05000000074505806], [0.06875000149011612, 0.16875000298023224, 0.02500000037252903, 0.02500000037252903], [0.06875000149011612, 0.16875000298023224, 0.05000000074505806, 0.05000000074505806], [0.08124999701976776, 0.16875000298023224, 0.02500000037252903, 0.02500000037252903], [0.08124999701976776, 0.16875000298023224, 0.05000000074505806, 0.05000000074505806], [0.09375, 0.16875000298023224, 0.02500000037252903, 0.02500000037252903], [0.09375, 0.16875000298023224, 0.05000000074505806, 0.05000000074505806], [0.10625000298023224, 0.16875000298023224, 0.02500000037252903, 0.02500000037252903], [0.10625000298023224, 0.16875000298023224, 0.05000000074505806, 0.05000000074505806], [0.11874999850988388, 0.16875000298023224, 0.02500000037252903, 0.02500000037252903], [0.11874999850988388, 0.16875000298023224, 0.05000000074505806, 0.05000000074505806], [0.13124999403953552, 0.16875000298023224, 0.02500000037252903, 0.02500000037252903], [0.13124999403953552, 0.16875000298023224, 0.05000000074505806, 0.05000000074505806], [0.14374999701976776, 0.16875000298023224, 0.02500000037252903, 0.02500000037252903], [0.14374999701976776, 0.16875000298023224, 0.05000000074505806, 0.05000000074505806], [0.15625, 0.16875000298023224, 0.02500000037252903, 0.02500000037252903], [0.15625, 0.16875000298023224, 0.05000000074505806, 0.05000000074505806], [0.16875000298023224, 0.16875000298023224, 0.02500000037252903, 0.02500000037252903], [0.16875000298023224, 0.16875000298023224, 0.05000000074505806, 0.05000000074505806], [0.18125000596046448, 0.16875000298023224, 0.02500000037252903, 0.02500000037252903], [0.18125000596046448, 0.16875000298023224, 0.05000000074505806, 0.05000000074505806], [0.19374999403953552, 0.16875000298023224, 0.02500000037252903, 0.02500000037252903], [0.19374999403953552, 0.16875000298023224, 0.05000000074505806, 0.05000000074505806], [0.20624999701976776, 0.16875000298023224, 0.02500000037252903, 0.02500000037252903], [0.20624999701976776, 0.16875000298023224, 0.05000000074505806, 0.05000000074505806], [0.21875, 0.16875000298023224, 0.02500000037252903, 0.02500000037252903], [0.21875, 0.16875000298023224, 0.05000000074505806, 0.05000000074505806], [0.23125000298023224, 0.16875000298023224, 0.02500000037252903, 0.02500000037252903], [0.23125000298023224, 0.16875000298023224, 0.05000000074505806, 0.05000000074505806], [0.24375000596046448, 0.16875000298023224, 0.02500000037252903, 0.02500000037252903], [0.24375000596046448, 0.16875000298023224, 0.05000000074505806, 0.05000000074505806], [0.2562499940395355, 0.16875000298023224, 0.02500000037252903, 0.02500000037252903], [0.2562499940395355, 0.16875000298023224, 0.05000000074505806, 0.05000000074505806], [0.26875001192092896, 0.16875000298023224, 0.02500000037252903, 0.02500000037252903], [0.26875001192092896, 0.16875000298023224, 0.05000000074505806, 0.05000000074505806], [0.28125, 0.16875000298023224, 0.02500000037252903, 0.02500000037252903], [0.28125, 0.16875000298023224, 0.05000000074505806, 0.05000000074505806], [0.29374998807907104, 0.16875000298023224, 0.02500000037252903, 0.02500000037252903], [0.29374998807907104, 0.16875000298023224, 0.05000000074505806, 0.05000000074505806], [0.3062500059604645, 0.16875000298023224, 0.02500000037252903, 0.02500000037252903], [0.3062500059604645, 0.16875000298023224, 0.05000000074505806, 0.05000000074505806], [0.3187499940395355, 0.16875000298023224, 0.02500000037252903, 0.02500000037252903], [0.3187499940395355, 0.16875000298023224, 0.05000000074505806, 0.05000000074505806], [0.33125001192092896, 0.16875000298023224, 0.02500000037252903, 0.02500000037252903], [0.33125001192092896, 0.16875000298023224, 0.05000000074505806, 0.05000000074505806], [0.34375, 0.16875000298023224, 0.02500000037252903, 0.02500000037252903], [0.34375, 0.16875000298023224, 0.05000000074505806, 0.05000000074505806], [0.35624998807907104, 0.16875000298023224, 0.02500000037252903, 0.02500000037252903], [0.35624998807907104, 0.16875000298023224, 0.05000000074505806, 0.05000000074505806], [0.3687500059604645, 0.16875000298023224, 0.02500000037252903, 0.02500000037252903], [0.3687500059604645, 0.16875000298023224, 0.05000000074505806, 0.05000000074505806], [0.3812499940395355, 0.16875000298023224, 0.02500000037252903, 0.02500000037252903], [0.3812499940395355, 0.16875000298023224, 0.05000000074505806, 0.05000000074505806], [0.39375001192092896, 0.16875000298023224, 0.02500000037252903, 0.02500000037252903], [0.39375001192092896, 0.16875000298023224, 0.05000000074505806, 0.05000000074505806], [0.40625, 0.16875000298023224, 0.02500000037252903, 0.02500000037252903], [0.40625, 0.16875000298023224, 0.05000000074505806, 0.05000000074505806], [0.41874998807907104, 0.16875000298023224, 0.02500000037252903, 0.02500000037252903], [0.41874998807907104, 0.16875000298023224, 0.05000000074505806, 0.05000000074505806], [0.4312500059604645, 0.16875000298023224, 0.02500000037252903, 0.02500000037252903], [0.4312500059604645, 0.16875000298023224, 0.05000000074505806, 0.05000000074505806], [0.4437499940395355, 0.16875000298023224, 0.02500000037252903, 0.02500000037252903], [0.4437499940395355, 0.16875000298023224, 0.05000000074505806, 0.05000000074505806], [0.45625001192092896, 0.16875000298023224, 0.02500000037252903, 0.02500000037252903], [0.45625001192092896, 0.16875000298023224, 0.05000000074505806, 0.05000000074505806], [0.46875, 0.16875000298023224, 0.02500000037252903, 0.02500000037252903], [0.46875, 0.16875000298023224, 0.05000000074505806, 0.05000000074505806], [0.48124998807907104, 0.16875000298023224, 0.02500000037252903, 0.02500000037252903], [0.48124998807907104, 0.16875000298023224, 0.05000000074505806, 0.05000000074505806], [0.4937500059604645, 0.16875000298023224, 0.02500000037252903, 0.02500000037252903], [0.4937500059604645, 0.16875000298023224, 0.05000000074505806, 0.05000000074505806], [0.5062500238418579, 0.16875000298023224, 0.02500000037252903, 0.02500000037252903], [0.5062500238418579, 0.16875000298023224, 0.05000000074505806, 0.05000000074505806], [0.518750011920929, 0.16875000298023224, 0.02500000037252903, 0.02500000037252903], [0.518750011920929, 0.16875000298023224, 0.05000000074505806, 0.05000000074505806], [0.53125, 0.16875000298023224, 0.02500000037252903, 0.02500000037252903], [0.53125, 0.16875000298023224, 0.05000000074505806, 0.05000000074505806], [0.543749988079071, 0.16875000298023224, 0.02500000037252903, 0.02500000037252903], [0.543749988079071, 0.16875000298023224, 0.05000000074505806, 0.05000000074505806], [0.5562499761581421, 0.16875000298023224, 0.02500000037252903, 0.02500000037252903], [0.5562499761581421, 0.16875000298023224, 0.05000000074505806, 0.05000000074505806], [0.5687500238418579, 0.16875000298023224, 0.02500000037252903, 0.02500000037252903], [0.5687500238418579, 0.16875000298023224, 0.05000000074505806, 0.05000000074505806], [0.581250011920929, 0.16875000298023224, 0.02500000037252903, 0.02500000037252903], [0.581250011920929, 0.16875000298023224, 0.05000000074505806, 0.05000000074505806], [0.59375, 0.16875000298023224, 0.02500000037252903, 0.02500000037252903], [0.59375, 0.16875000298023224, 0.05000000074505806, 0.05000000074505806], [0.606249988079071, 0.16875000298023224, 0.02500000037252903, 0.02500000037252903], [0.606249988079071, 0.16875000298023224, 0.05000000074505806, 0.05000000074505806], [0.6187499761581421, 0.16875000298023224, 0.02500000037252903, 0.02500000037252903], [0.6187499761581421, 0.16875000298023224, 0.05000000074505806, 0.05000000074505806], [0.6312500238418579, 0.16875000298023224, 0.02500000037252903, 0.02500000037252903], [0.6312500238418579, 0.16875000298023224, 0.05000000074505806, 0.05000000074505806], [0.643750011920929, 0.16875000298023224, 0.02500000037252903, 0.02500000037252903], [0.643750011920929, 0.16875000298023224, 0.05000000074505806, 0.05000000074505806], [0.65625, 0.16875000298023224, 0.02500000037252903, 0.02500000037252903], [0.65625, 0.16875000298023224, 0.05000000074505806, 0.05000000074505806], [0.668749988079071, 0.16875000298023224, 0.02500000037252903, 0.02500000037252903], [0.668749988079071, 0.16875000298023224, 0.05000000074505806, 0.05000000074505806], [0.6812499761581421, 0.16875000298023224, 0.02500000037252903, 0.02500000037252903], [0.6812499761581421, 0.16875000298023224, 0.05000000074505806, 0.05000000074505806], [0.6937500238418579, 0.16875000298023224, 0.02500000037252903, 0.02500000037252903], [0.6937500238418579, 0.16875000298023224, 0.05000000074505806, 0.05000000074505806], [0.706250011920929, 0.16875000298023224, 0.02500000037252903, 0.02500000037252903], [0.706250011920929, 0.16875000298023224, 0.05000000074505806, 0.05000000074505806], [0.71875, 0.16875000298023224, 0.02500000037252903, 0.02500000037252903], [0.71875, 0.16875000298023224, 0.05000000074505806, 0.05000000074505806], [0.731249988079071, 0.16875000298023224, 0.02500000037252903, 0.02500000037252903], [0.731249988079071, 0.16875000298023224, 0.05000000074505806, 0.05000000074505806], [0.7437499761581421, 0.16875000298023224, 0.02500000037252903, 0.02500000037252903], [0.7437499761581421, 0.16875000298023224, 0.05000000074505806, 0.05000000074505806], [0.7562500238418579, 0.16875000298023224, 0.02500000037252903, 0.02500000037252903], [0.7562500238418579, 0.16875000298023224, 0.05000000074505806, 0.05000000074505806], [0.768750011920929, 0.16875000298023224, 0.02500000037252903, 0.02500000037252903], [0.768750011920929, 0.16875000298023224, 0.05000000074505806, 0.05000000074505806], [0.78125, 0.16875000298023224, 0.02500000037252903, 0.02500000037252903], [0.78125, 0.16875000298023224, 0.05000000074505806, 0.05000000074505806], [0.793749988079071, 0.16875000298023224, 0.02500000037252903, 0.02500000037252903], [0.793749988079071, 0.16875000298023224, 0.05000000074505806, 0.05000000074505806], [0.8062499761581421, 0.16875000298023224, 0.02500000037252903, 0.02500000037252903], [0.8062499761581421, 0.16875000298023224, 0.05000000074505806, 0.05000000074505806], [0.8187500238418579, 0.16875000298023224, 0.02500000037252903, 0.02500000037252903], [0.8187500238418579, 0.16875000298023224, 0.05000000074505806, 0.05000000074505806], [0.831250011920929, 0.16875000298023224, 0.02500000037252903, 0.02500000037252903], [0.831250011920929, 0.16875000298023224, 0.05000000074505806, 0.05000000074505806], [0.84375, 0.16875000298023224, 0.02500000037252903, 0.02500000037252903], [0.84375, 0.16875000298023224, 0.05000000074505806, 0.05000000074505806], [0.856249988079071, 0.16875000298023224, 0.02500000037252903, 0.02500000037252903], [0.856249988079071, 0.16875000298023224, 0.05000000074505806, 0.05000000074505806], [0.8687499761581421, 0.16875000298023224, 0.02500000037252903, 0.02500000037252903], [0.8687499761581421, 0.16875000298023224, 0.05000000074505806, 0.05000000074505806], [0.8812500238418579, 0.16875000298023224, 0.02500000037252903, 0.02500000037252903], [0.8812500238418579, 0.16875000298023224, 0.05000000074505806, 0.05000000074505806], [0.893750011920929, 0.16875000298023224, 0.02500000037252903, 0.02500000037252903], [0.893750011920929, 0.16875000298023224, 0.05000000074505806, 0.05000000074505806], [0.90625, 0.16875000298023224, 0.02500000037252903, 0.02500000037252903], [0.90625, 0.16875000298023224, 0.05000000074505806, 0.05000000074505806], [0.918749988079071, 0.16875000298023224, 0.02500000037252903, 0.02500000037252903], [0.918749988079071, 0.16875000298023224, 0.05000000074505806, 0.05000000074505806], [0.9312499761581421, 0.16875000298023224, 0.02500000037252903, 0.02500000037252903], [0.9312499761581421, 0.16875000298023224, 0.05000000074505806, 0.05000000074505806], [0.9437500238418579, 0.16875000298023224, 0.02500000037252903, 0.02500000037252903], [0.9437500238418579, 0.16875000298023224, 0.05000000074505806, 0.05000000074505806], [0.956250011920929, 0.16875000298023224, 0.02500000037252903, 0.02500000037252903], [0.956250011920929, 0.16875000298023224, 0.05000000074505806, 0.05000000074505806], [0.96875, 0.16875000298023224, 0.02500000037252903, 0.02500000037252903], [0.96875, 0.16875000298023224, 0.05000000074505806, 0.05000000074505806], [0.981249988079071, 0.16875000298023224, 0.02500000037252903, 0.02500000037252903], [0.981249988079071, 0.16875000298023224, 0.05000000074505806, 0.05000000074505806], [0.9937499761581421, 0.16875000298023224, 0.02500000037252903, 0.02500000037252903], [0.9937499761581421, 0.16875000298023224, 0.05000000074505806, 0.05000000074505806], [0.0062500000931322575, 0.18125000596046448, 0.02500000037252903, 0.02500000037252903], [0.0062500000931322575, 0.18125000596046448, 0.05000000074505806, 0.05000000074505806], [0.01875000074505806, 0.18125000596046448, 0.02500000037252903, 0.02500000037252903], [0.01875000074505806, 0.18125000596046448, 0.05000000074505806, 0.05000000074505806], [0.03125, 0.18125000596046448, 0.02500000037252903, 0.02500000037252903], [0.03125, 0.18125000596046448, 0.05000000074505806, 0.05000000074505806], [0.04374999925494194, 0.18125000596046448, 0.02500000037252903, 0.02500000037252903], [0.04374999925494194, 0.18125000596046448, 0.05000000074505806, 0.05000000074505806], [0.05624999850988388, 0.18125000596046448, 0.02500000037252903, 0.02500000037252903], [0.05624999850988388, 0.18125000596046448, 0.05000000074505806, 0.05000000074505806], [0.06875000149011612, 0.18125000596046448, 0.02500000037252903, 0.02500000037252903], [0.06875000149011612, 0.18125000596046448, 0.05000000074505806, 0.05000000074505806], [0.08124999701976776, 0.18125000596046448, 0.02500000037252903, 0.02500000037252903], [0.08124999701976776, 0.18125000596046448, 0.05000000074505806, 0.05000000074505806], [0.09375, 0.18125000596046448, 0.02500000037252903, 0.02500000037252903], [0.09375, 0.18125000596046448, 0.05000000074505806, 0.05000000074505806], [0.10625000298023224, 0.18125000596046448, 0.02500000037252903, 0.02500000037252903], [0.10625000298023224, 0.18125000596046448, 0.05000000074505806, 0.05000000074505806], [0.11874999850988388, 0.18125000596046448, 0.02500000037252903, 0.02500000037252903], [0.11874999850988388, 0.18125000596046448, 0.05000000074505806, 0.05000000074505806], [0.13124999403953552, 0.18125000596046448, 0.02500000037252903, 0.02500000037252903], [0.13124999403953552, 0.18125000596046448, 0.05000000074505806, 0.05000000074505806], [0.14374999701976776, 0.18125000596046448, 0.02500000037252903, 0.02500000037252903], [0.14374999701976776, 0.18125000596046448, 0.05000000074505806, 0.05000000074505806], [0.15625, 0.18125000596046448, 0.02500000037252903, 0.02500000037252903], [0.15625, 0.18125000596046448, 0.05000000074505806, 0.05000000074505806], [0.16875000298023224, 0.18125000596046448, 0.02500000037252903, 0.02500000037252903], [0.16875000298023224, 0.18125000596046448, 0.05000000074505806, 0.05000000074505806], [0.18125000596046448, 0.18125000596046448, 0.02500000037252903, 0.02500000037252903], [0.18125000596046448, 0.18125000596046448, 0.05000000074505806, 0.05000000074505806], [0.19374999403953552, 0.18125000596046448, 0.02500000037252903, 0.02500000037252903], [0.19374999403953552, 0.18125000596046448, 0.05000000074505806, 0.05000000074505806], [0.20624999701976776, 0.18125000596046448, 0.02500000037252903, 0.02500000037252903], [0.20624999701976776, 0.18125000596046448, 0.05000000074505806, 0.05000000074505806], [0.21875, 0.18125000596046448, 0.02500000037252903, 0.02500000037252903], [0.21875, 0.18125000596046448, 0.05000000074505806, 0.05000000074505806], [0.23125000298023224, 0.18125000596046448, 0.02500000037252903, 0.02500000037252903], [0.23125000298023224, 0.18125000596046448, 0.05000000074505806, 0.05000000074505806], [0.24375000596046448, 0.18125000596046448, 0.02500000037252903, 0.02500000037252903], [0.24375000596046448, 0.18125000596046448, 0.05000000074505806, 0.05000000074505806], [0.2562499940395355, 0.18125000596046448, 0.02500000037252903, 0.02500000037252903], [0.2562499940395355, 0.18125000596046448, 0.05000000074505806, 0.05000000074505806], [0.26875001192092896, 0.18125000596046448, 0.02500000037252903, 0.02500000037252903], [0.26875001192092896, 0.18125000596046448, 0.05000000074505806, 0.05000000074505806], [0.28125, 0.18125000596046448, 0.02500000037252903, 0.02500000037252903], [0.28125, 0.18125000596046448, 0.05000000074505806, 0.05000000074505806], [0.29374998807907104, 0.18125000596046448, 0.02500000037252903, 0.02500000037252903], [0.29374998807907104, 0.18125000596046448, 0.05000000074505806, 0.05000000074505806], [0.3062500059604645, 0.18125000596046448, 0.02500000037252903, 0.02500000037252903], [0.3062500059604645, 0.18125000596046448, 0.05000000074505806, 0.05000000074505806], [0.3187499940395355, 0.18125000596046448, 0.02500000037252903, 0.02500000037252903], [0.3187499940395355, 0.18125000596046448, 0.05000000074505806, 0.05000000074505806], [0.33125001192092896, 0.18125000596046448, 0.02500000037252903, 0.02500000037252903], [0.33125001192092896, 0.18125000596046448, 0.05000000074505806, 0.05000000074505806], [0.34375, 0.18125000596046448, 0.02500000037252903, 0.02500000037252903], [0.34375, 0.18125000596046448, 0.05000000074505806, 0.05000000074505806], [0.35624998807907104, 0.18125000596046448, 0.02500000037252903, 0.02500000037252903], [0.35624998807907104, 0.18125000596046448, 0.05000000074505806, 0.05000000074505806], [0.3687500059604645, 0.18125000596046448, 0.02500000037252903, 0.02500000037252903], [0.3687500059604645, 0.18125000596046448, 0.05000000074505806, 0.05000000074505806], [0.3812499940395355, 0.18125000596046448, 0.02500000037252903, 0.02500000037252903], [0.3812499940395355, 0.18125000596046448, 0.05000000074505806, 0.05000000074505806], [0.39375001192092896, 0.18125000596046448, 0.02500000037252903, 0.02500000037252903], [0.39375001192092896, 0.18125000596046448, 0.05000000074505806, 0.05000000074505806], [0.40625, 0.18125000596046448, 0.02500000037252903, 0.02500000037252903], [0.40625, 0.18125000596046448, 0.05000000074505806, 0.05000000074505806], [0.41874998807907104, 0.18125000596046448, 0.02500000037252903, 0.02500000037252903], [0.41874998807907104, 0.18125000596046448, 0.05000000074505806, 0.05000000074505806], [0.4312500059604645, 0.18125000596046448, 0.02500000037252903, 0.02500000037252903], [0.4312500059604645, 0.18125000596046448, 0.05000000074505806, 0.05000000074505806], [0.4437499940395355, 0.18125000596046448, 0.02500000037252903, 0.02500000037252903], [0.4437499940395355, 0.18125000596046448, 0.05000000074505806, 0.05000000074505806], [0.45625001192092896, 0.18125000596046448, 0.02500000037252903, 0.02500000037252903], [0.45625001192092896, 0.18125000596046448, 0.05000000074505806, 0.05000000074505806], [0.46875, 0.18125000596046448, 0.02500000037252903, 0.02500000037252903], [0.46875, 0.18125000596046448, 0.05000000074505806, 0.05000000074505806], [0.48124998807907104, 0.18125000596046448, 0.02500000037252903, 0.02500000037252903], [0.48124998807907104, 0.18125000596046448, 0.05000000074505806, 0.05000000074505806], [0.4937500059604645, 0.18125000596046448, 0.02500000037252903, 0.02500000037252903], [0.4937500059604645, 0.18125000596046448, 0.05000000074505806, 0.05000000074505806], [0.5062500238418579, 0.18125000596046448, 0.02500000037252903, 0.02500000037252903], [0.5062500238418579, 0.18125000596046448, 0.05000000074505806, 0.05000000074505806], [0.518750011920929, 0.18125000596046448, 0.02500000037252903, 0.02500000037252903], [0.518750011920929, 0.18125000596046448, 0.05000000074505806, 0.05000000074505806], [0.53125, 0.18125000596046448, 0.02500000037252903, 0.02500000037252903], [0.53125, 0.18125000596046448, 0.05000000074505806, 0.05000000074505806], [0.543749988079071, 0.18125000596046448, 0.02500000037252903, 0.02500000037252903], [0.543749988079071, 0.18125000596046448, 0.05000000074505806, 0.05000000074505806], [0.5562499761581421, 0.18125000596046448, 0.02500000037252903, 0.02500000037252903], [0.5562499761581421, 0.18125000596046448, 0.05000000074505806, 0.05000000074505806], [0.5687500238418579, 0.18125000596046448, 0.02500000037252903, 0.02500000037252903], [0.5687500238418579, 0.18125000596046448, 0.05000000074505806, 0.05000000074505806], [0.581250011920929, 0.18125000596046448, 0.02500000037252903, 0.02500000037252903], [0.581250011920929, 0.18125000596046448, 0.05000000074505806, 0.05000000074505806], [0.59375, 0.18125000596046448, 0.02500000037252903, 0.02500000037252903], [0.59375, 0.18125000596046448, 0.05000000074505806, 0.05000000074505806], [0.606249988079071, 0.18125000596046448, 0.02500000037252903, 0.02500000037252903], [0.606249988079071, 0.18125000596046448, 0.05000000074505806, 0.05000000074505806], [0.6187499761581421, 0.18125000596046448, 0.02500000037252903, 0.02500000037252903], [0.6187499761581421, 0.18125000596046448, 0.05000000074505806, 0.05000000074505806], [0.6312500238418579, 0.18125000596046448, 0.02500000037252903, 0.02500000037252903], [0.6312500238418579, 0.18125000596046448, 0.05000000074505806, 0.05000000074505806], [0.643750011920929, 0.18125000596046448, 0.02500000037252903, 0.02500000037252903], [0.643750011920929, 0.18125000596046448, 0.05000000074505806, 0.05000000074505806], [0.65625, 0.18125000596046448, 0.02500000037252903, 0.02500000037252903], [0.65625, 0.18125000596046448, 0.05000000074505806, 0.05000000074505806], [0.668749988079071, 0.18125000596046448, 0.02500000037252903, 0.02500000037252903], [0.668749988079071, 0.18125000596046448, 0.05000000074505806, 0.05000000074505806], [0.6812499761581421, 0.18125000596046448, 0.02500000037252903, 0.02500000037252903], [0.6812499761581421, 0.18125000596046448, 0.05000000074505806, 0.05000000074505806], [0.6937500238418579, 0.18125000596046448, 0.02500000037252903, 0.02500000037252903], [0.6937500238418579, 0.18125000596046448, 0.05000000074505806, 0.05000000074505806], [0.706250011920929, 0.18125000596046448, 0.02500000037252903, 0.02500000037252903], [0.706250011920929, 0.18125000596046448, 0.05000000074505806, 0.05000000074505806], [0.71875, 0.18125000596046448, 0.02500000037252903, 0.02500000037252903], [0.71875, 0.18125000596046448, 0.05000000074505806, 0.05000000074505806], [0.731249988079071, 0.18125000596046448, 0.02500000037252903, 0.02500000037252903], [0.731249988079071, 0.18125000596046448, 0.05000000074505806, 0.05000000074505806], [0.7437499761581421, 0.18125000596046448, 0.02500000037252903, 0.02500000037252903], [0.7437499761581421, 0.18125000596046448, 0.05000000074505806, 0.05000000074505806], [0.7562500238418579, 0.18125000596046448, 0.02500000037252903, 0.02500000037252903], [0.7562500238418579, 0.18125000596046448, 0.05000000074505806, 0.05000000074505806], [0.768750011920929, 0.18125000596046448, 0.02500000037252903, 0.02500000037252903], [0.768750011920929, 0.18125000596046448, 0.05000000074505806, 0.05000000074505806], [0.78125, 0.18125000596046448, 0.02500000037252903, 0.02500000037252903], [0.78125, 0.18125000596046448, 0.05000000074505806, 0.05000000074505806], [0.793749988079071, 0.18125000596046448, 0.02500000037252903, 0.02500000037252903], [0.793749988079071, 0.18125000596046448, 0.05000000074505806, 0.05000000074505806], [0.8062499761581421, 0.18125000596046448, 0.02500000037252903, 0.02500000037252903], [0.8062499761581421, 0.18125000596046448, 0.05000000074505806, 0.05000000074505806], [0.8187500238418579, 0.18125000596046448, 0.02500000037252903, 0.02500000037252903], [0.8187500238418579, 0.18125000596046448, 0.05000000074505806, 0.05000000074505806], [0.831250011920929, 0.18125000596046448, 0.02500000037252903, 0.02500000037252903], [0.831250011920929, 0.18125000596046448, 0.05000000074505806, 0.05000000074505806], [0.84375, 0.18125000596046448, 0.02500000037252903, 0.02500000037252903], [0.84375, 0.18125000596046448, 0.05000000074505806, 0.05000000074505806], [0.856249988079071, 0.18125000596046448, 0.02500000037252903, 0.02500000037252903], [0.856249988079071, 0.18125000596046448, 0.05000000074505806, 0.05000000074505806], [0.8687499761581421, 0.18125000596046448, 0.02500000037252903, 0.02500000037252903], [0.8687499761581421, 0.18125000596046448, 0.05000000074505806, 0.05000000074505806], [0.8812500238418579, 0.18125000596046448, 0.02500000037252903, 0.02500000037252903], [0.8812500238418579, 0.18125000596046448, 0.05000000074505806, 0.05000000074505806], [0.893750011920929, 0.18125000596046448, 0.02500000037252903, 0.02500000037252903], [0.893750011920929, 0.18125000596046448, 0.05000000074505806, 0.05000000074505806], [0.90625, 0.18125000596046448, 0.02500000037252903, 0.02500000037252903], [0.90625, 0.18125000596046448, 0.05000000074505806, 0.05000000074505806], [0.918749988079071, 0.18125000596046448, 0.02500000037252903, 0.02500000037252903], [0.918749988079071, 0.18125000596046448, 0.05000000074505806, 0.05000000074505806], [0.9312499761581421, 0.18125000596046448, 0.02500000037252903, 0.02500000037252903], [0.9312499761581421, 0.18125000596046448, 0.05000000074505806, 0.05000000074505806], [0.9437500238418579, 0.18125000596046448, 0.02500000037252903, 0.02500000037252903], [0.9437500238418579, 0.18125000596046448, 0.05000000074505806, 0.05000000074505806], [0.956250011920929, 0.18125000596046448, 0.02500000037252903, 0.02500000037252903], [0.956250011920929, 0.18125000596046448, 0.05000000074505806, 0.05000000074505806], [0.96875, 0.18125000596046448, 0.02500000037252903, 0.02500000037252903], [0.96875, 0.18125000596046448, 0.05000000074505806, 0.05000000074505806], [0.981249988079071, 0.18125000596046448, 0.02500000037252903, 0.02500000037252903], [0.981249988079071, 0.18125000596046448, 0.05000000074505806, 0.05000000074505806], [0.9937499761581421, 0.18125000596046448, 0.02500000037252903, 0.02500000037252903], [0.9937499761581421, 0.18125000596046448, 0.05000000074505806, 0.05000000074505806], [0.0062500000931322575, 0.19374999403953552, 0.02500000037252903, 0.02500000037252903], [0.0062500000931322575, 0.19374999403953552, 0.05000000074505806, 0.05000000074505806], [0.01875000074505806, 0.19374999403953552, 0.02500000037252903, 0.02500000037252903], [0.01875000074505806, 0.19374999403953552, 0.05000000074505806, 0.05000000074505806], [0.03125, 0.19374999403953552, 0.02500000037252903, 0.02500000037252903], [0.03125, 0.19374999403953552, 0.05000000074505806, 0.05000000074505806], [0.04374999925494194, 0.19374999403953552, 0.02500000037252903, 0.02500000037252903], [0.04374999925494194, 0.19374999403953552, 0.05000000074505806, 0.05000000074505806], [0.05624999850988388, 0.19374999403953552, 0.02500000037252903, 0.02500000037252903], [0.05624999850988388, 0.19374999403953552, 0.05000000074505806, 0.05000000074505806], [0.06875000149011612, 0.19374999403953552, 0.02500000037252903, 0.02500000037252903], [0.06875000149011612, 0.19374999403953552, 0.05000000074505806, 0.05000000074505806], [0.08124999701976776, 0.19374999403953552, 0.02500000037252903, 0.02500000037252903], [0.08124999701976776, 0.19374999403953552, 0.05000000074505806, 0.05000000074505806], [0.09375, 0.19374999403953552, 0.02500000037252903, 0.02500000037252903], [0.09375, 0.19374999403953552, 0.05000000074505806, 0.05000000074505806], [0.10625000298023224, 0.19374999403953552, 0.02500000037252903, 0.02500000037252903], [0.10625000298023224, 0.19374999403953552, 0.05000000074505806, 0.05000000074505806], [0.11874999850988388, 0.19374999403953552, 0.02500000037252903, 0.02500000037252903], [0.11874999850988388, 0.19374999403953552, 0.05000000074505806, 0.05000000074505806], [0.13124999403953552, 0.19374999403953552, 0.02500000037252903, 0.02500000037252903], [0.13124999403953552, 0.19374999403953552, 0.05000000074505806, 0.05000000074505806], [0.14374999701976776, 0.19374999403953552, 0.02500000037252903, 0.02500000037252903], [0.14374999701976776, 0.19374999403953552, 0.05000000074505806, 0.05000000074505806], [0.15625, 0.19374999403953552, 0.02500000037252903, 0.02500000037252903], [0.15625, 0.19374999403953552, 0.05000000074505806, 0.05000000074505806], [0.16875000298023224, 0.19374999403953552, 0.02500000037252903, 0.02500000037252903], [0.16875000298023224, 0.19374999403953552, 0.05000000074505806, 0.05000000074505806], [0.18125000596046448, 0.19374999403953552, 0.02500000037252903, 0.02500000037252903], [0.18125000596046448, 0.19374999403953552, 0.05000000074505806, 0.05000000074505806], [0.19374999403953552, 0.19374999403953552, 0.02500000037252903, 0.02500000037252903], [0.19374999403953552, 0.19374999403953552, 0.05000000074505806, 0.05000000074505806], [0.20624999701976776, 0.19374999403953552, 0.02500000037252903, 0.02500000037252903], [0.20624999701976776, 0.19374999403953552, 0.05000000074505806, 0.05000000074505806], [0.21875, 0.19374999403953552, 0.02500000037252903, 0.02500000037252903], [0.21875, 0.19374999403953552, 0.05000000074505806, 0.05000000074505806], [0.23125000298023224, 0.19374999403953552, 0.02500000037252903, 0.02500000037252903], [0.23125000298023224, 0.19374999403953552, 0.05000000074505806, 0.05000000074505806], [0.24375000596046448, 0.19374999403953552, 0.02500000037252903, 0.02500000037252903], [0.24375000596046448, 0.19374999403953552, 0.05000000074505806, 0.05000000074505806], [0.2562499940395355, 0.19374999403953552, 0.02500000037252903, 0.02500000037252903], [0.2562499940395355, 0.19374999403953552, 0.05000000074505806, 0.05000000074505806], [0.26875001192092896, 0.19374999403953552, 0.02500000037252903, 0.02500000037252903], [0.26875001192092896, 0.19374999403953552, 0.05000000074505806, 0.05000000074505806], [0.28125, 0.19374999403953552, 0.02500000037252903, 0.02500000037252903], [0.28125, 0.19374999403953552, 0.05000000074505806, 0.05000000074505806], [0.29374998807907104, 0.19374999403953552, 0.02500000037252903, 0.02500000037252903], [0.29374998807907104, 0.19374999403953552, 0.05000000074505806, 0.05000000074505806], [0.3062500059604645, 0.19374999403953552, 0.02500000037252903, 0.02500000037252903], [0.3062500059604645, 0.19374999403953552, 0.05000000074505806, 0.05000000074505806], [0.3187499940395355, 0.19374999403953552, 0.02500000037252903, 0.02500000037252903], [0.3187499940395355, 0.19374999403953552, 0.05000000074505806, 0.05000000074505806], [0.33125001192092896, 0.19374999403953552, 0.02500000037252903, 0.02500000037252903], [0.33125001192092896, 0.19374999403953552, 0.05000000074505806, 0.05000000074505806], [0.34375, 0.19374999403953552, 0.02500000037252903, 0.02500000037252903], [0.34375, 0.19374999403953552, 0.05000000074505806, 0.05000000074505806], [0.35624998807907104, 0.19374999403953552, 0.02500000037252903, 0.02500000037252903], [0.35624998807907104, 0.19374999403953552, 0.05000000074505806, 0.05000000074505806], [0.3687500059604645, 0.19374999403953552, 0.02500000037252903, 0.02500000037252903], [0.3687500059604645, 0.19374999403953552, 0.05000000074505806, 0.05000000074505806], [0.3812499940395355, 0.19374999403953552, 0.02500000037252903, 0.02500000037252903], [0.3812499940395355, 0.19374999403953552, 0.05000000074505806, 0.05000000074505806], [0.39375001192092896, 0.19374999403953552, 0.02500000037252903, 0.02500000037252903], [0.39375001192092896, 0.19374999403953552, 0.05000000074505806, 0.05000000074505806], [0.40625, 0.19374999403953552, 0.02500000037252903, 0.02500000037252903], [0.40625, 0.19374999403953552, 0.05000000074505806, 0.05000000074505806], [0.41874998807907104, 0.19374999403953552, 0.02500000037252903, 0.02500000037252903], [0.41874998807907104, 0.19374999403953552, 0.05000000074505806, 0.05000000074505806], [0.4312500059604645, 0.19374999403953552, 0.02500000037252903, 0.02500000037252903], [0.4312500059604645, 0.19374999403953552, 0.05000000074505806, 0.05000000074505806], [0.4437499940395355, 0.19374999403953552, 0.02500000037252903, 0.02500000037252903], [0.4437499940395355, 0.19374999403953552, 0.05000000074505806, 0.05000000074505806], [0.45625001192092896, 0.19374999403953552, 0.02500000037252903, 0.02500000037252903], [0.45625001192092896, 0.19374999403953552, 0.05000000074505806, 0.05000000074505806], [0.46875, 0.19374999403953552, 0.02500000037252903, 0.02500000037252903], [0.46875, 0.19374999403953552, 0.05000000074505806, 0.05000000074505806], [0.48124998807907104, 0.19374999403953552, 0.02500000037252903, 0.02500000037252903], [0.48124998807907104, 0.19374999403953552, 0.05000000074505806, 0.05000000074505806], [0.4937500059604645, 0.19374999403953552, 0.02500000037252903, 0.02500000037252903], [0.4937500059604645, 0.19374999403953552, 0.05000000074505806, 0.05000000074505806], [0.5062500238418579, 0.19374999403953552, 0.02500000037252903, 0.02500000037252903], [0.5062500238418579, 0.19374999403953552, 0.05000000074505806, 0.05000000074505806], [0.518750011920929, 0.19374999403953552, 0.02500000037252903, 0.02500000037252903], [0.518750011920929, 0.19374999403953552, 0.05000000074505806, 0.05000000074505806], [0.53125, 0.19374999403953552, 0.02500000037252903, 0.02500000037252903], [0.53125, 0.19374999403953552, 0.05000000074505806, 0.05000000074505806], [0.543749988079071, 0.19374999403953552, 0.02500000037252903, 0.02500000037252903], [0.543749988079071, 0.19374999403953552, 0.05000000074505806, 0.05000000074505806], [0.5562499761581421, 0.19374999403953552, 0.02500000037252903, 0.02500000037252903], [0.5562499761581421, 0.19374999403953552, 0.05000000074505806, 0.05000000074505806], [0.5687500238418579, 0.19374999403953552, 0.02500000037252903, 0.02500000037252903], [0.5687500238418579, 0.19374999403953552, 0.05000000074505806, 0.05000000074505806], [0.581250011920929, 0.19374999403953552, 0.02500000037252903, 0.02500000037252903], [0.581250011920929, 0.19374999403953552, 0.05000000074505806, 0.05000000074505806], [0.59375, 0.19374999403953552, 0.02500000037252903, 0.02500000037252903], [0.59375, 0.19374999403953552, 0.05000000074505806, 0.05000000074505806], [0.606249988079071, 0.19374999403953552, 0.02500000037252903, 0.02500000037252903], [0.606249988079071, 0.19374999403953552, 0.05000000074505806, 0.05000000074505806], [0.6187499761581421, 0.19374999403953552, 0.02500000037252903, 0.02500000037252903], [0.6187499761581421, 0.19374999403953552, 0.05000000074505806, 0.05000000074505806], [0.6312500238418579, 0.19374999403953552, 0.02500000037252903, 0.02500000037252903], [0.6312500238418579, 0.19374999403953552, 0.05000000074505806, 0.05000000074505806], [0.643750011920929, 0.19374999403953552, 0.02500000037252903, 0.02500000037252903], [0.643750011920929, 0.19374999403953552, 0.05000000074505806, 0.05000000074505806], [0.65625, 0.19374999403953552, 0.02500000037252903, 0.02500000037252903], [0.65625, 0.19374999403953552, 0.05000000074505806, 0.05000000074505806], [0.668749988079071, 0.19374999403953552, 0.02500000037252903, 0.02500000037252903], [0.668749988079071, 0.19374999403953552, 0.05000000074505806, 0.05000000074505806], [0.6812499761581421, 0.19374999403953552, 0.02500000037252903, 0.02500000037252903], [0.6812499761581421, 0.19374999403953552, 0.05000000074505806, 0.05000000074505806], [0.6937500238418579, 0.19374999403953552, 0.02500000037252903, 0.02500000037252903], [0.6937500238418579, 0.19374999403953552, 0.05000000074505806, 0.05000000074505806], [0.706250011920929, 0.19374999403953552, 0.02500000037252903, 0.02500000037252903], [0.706250011920929, 0.19374999403953552, 0.05000000074505806, 0.05000000074505806], [0.71875, 0.19374999403953552, 0.02500000037252903, 0.02500000037252903], [0.71875, 0.19374999403953552, 0.05000000074505806, 0.05000000074505806], [0.731249988079071, 0.19374999403953552, 0.02500000037252903, 0.02500000037252903], [0.731249988079071, 0.19374999403953552, 0.05000000074505806, 0.05000000074505806], [0.7437499761581421, 0.19374999403953552, 0.02500000037252903, 0.02500000037252903], [0.7437499761581421, 0.19374999403953552, 0.05000000074505806, 0.05000000074505806], [0.7562500238418579, 0.19374999403953552, 0.02500000037252903, 0.02500000037252903], [0.7562500238418579, 0.19374999403953552, 0.05000000074505806, 0.05000000074505806], [0.768750011920929, 0.19374999403953552, 0.02500000037252903, 0.02500000037252903], [0.768750011920929, 0.19374999403953552, 0.05000000074505806, 0.05000000074505806], [0.78125, 0.19374999403953552, 0.02500000037252903, 0.02500000037252903], [0.78125, 0.19374999403953552, 0.05000000074505806, 0.05000000074505806], [0.793749988079071, 0.19374999403953552, 0.02500000037252903, 0.02500000037252903], [0.793749988079071, 0.19374999403953552, 0.05000000074505806, 0.05000000074505806], [0.8062499761581421, 0.19374999403953552, 0.02500000037252903, 0.02500000037252903], [0.8062499761581421, 0.19374999403953552, 0.05000000074505806, 0.05000000074505806], [0.8187500238418579, 0.19374999403953552, 0.02500000037252903, 0.02500000037252903], [0.8187500238418579, 0.19374999403953552, 0.05000000074505806, 0.05000000074505806], [0.831250011920929, 0.19374999403953552, 0.02500000037252903, 0.02500000037252903], [0.831250011920929, 0.19374999403953552, 0.05000000074505806, 0.05000000074505806], [0.84375, 0.19374999403953552, 0.02500000037252903, 0.02500000037252903], [0.84375, 0.19374999403953552, 0.05000000074505806, 0.05000000074505806], [0.856249988079071, 0.19374999403953552, 0.02500000037252903, 0.02500000037252903], [0.856249988079071, 0.19374999403953552, 0.05000000074505806, 0.05000000074505806], [0.8687499761581421, 0.19374999403953552, 0.02500000037252903, 0.02500000037252903], [0.8687499761581421, 0.19374999403953552, 0.05000000074505806, 0.05000000074505806], [0.8812500238418579, 0.19374999403953552, 0.02500000037252903, 0.02500000037252903], [0.8812500238418579, 0.19374999403953552, 0.05000000074505806, 0.05000000074505806], [0.893750011920929, 0.19374999403953552, 0.02500000037252903, 0.02500000037252903], [0.893750011920929, 0.19374999403953552, 0.05000000074505806, 0.05000000074505806], [0.90625, 0.19374999403953552, 0.02500000037252903, 0.02500000037252903], [0.90625, 0.19374999403953552, 0.05000000074505806, 0.05000000074505806], [0.918749988079071, 0.19374999403953552, 0.02500000037252903, 0.02500000037252903], [0.918749988079071, 0.19374999403953552, 0.05000000074505806, 0.05000000074505806], [0.9312499761581421, 0.19374999403953552, 0.02500000037252903, 0.02500000037252903], [0.9312499761581421, 0.19374999403953552, 0.05000000074505806, 0.05000000074505806], [0.9437500238418579, 0.19374999403953552, 0.02500000037252903, 0.02500000037252903], [0.9437500238418579, 0.19374999403953552, 0.05000000074505806, 0.05000000074505806], [0.956250011920929, 0.19374999403953552, 0.02500000037252903, 0.02500000037252903], [0.956250011920929, 0.19374999403953552, 0.05000000074505806, 0.05000000074505806], [0.96875, 0.19374999403953552, 0.02500000037252903, 0.02500000037252903], [0.96875, 0.19374999403953552, 0.05000000074505806, 0.05000000074505806], [0.981249988079071, 0.19374999403953552, 0.02500000037252903, 0.02500000037252903], [0.981249988079071, 0.19374999403953552, 0.05000000074505806, 0.05000000074505806], [0.9937499761581421, 0.19374999403953552, 0.02500000037252903, 0.02500000037252903], [0.9937499761581421, 0.19374999403953552, 0.05000000074505806, 0.05000000074505806], [0.0062500000931322575, 0.20624999701976776, 0.02500000037252903, 0.02500000037252903], [0.0062500000931322575, 0.20624999701976776, 0.05000000074505806, 0.05000000074505806], [0.01875000074505806, 0.20624999701976776, 0.02500000037252903, 0.02500000037252903], [0.01875000074505806, 0.20624999701976776, 0.05000000074505806, 0.05000000074505806], [0.03125, 0.20624999701976776, 0.02500000037252903, 0.02500000037252903], [0.03125, 0.20624999701976776, 0.05000000074505806, 0.05000000074505806], [0.04374999925494194, 0.20624999701976776, 0.02500000037252903, 0.02500000037252903], [0.04374999925494194, 0.20624999701976776, 0.05000000074505806, 0.05000000074505806], [0.05624999850988388, 0.20624999701976776, 0.02500000037252903, 0.02500000037252903], [0.05624999850988388, 0.20624999701976776, 0.05000000074505806, 0.05000000074505806], [0.06875000149011612, 0.20624999701976776, 0.02500000037252903, 0.02500000037252903], [0.06875000149011612, 0.20624999701976776, 0.05000000074505806, 0.05000000074505806], [0.08124999701976776, 0.20624999701976776, 0.02500000037252903, 0.02500000037252903], [0.08124999701976776, 0.20624999701976776, 0.05000000074505806, 0.05000000074505806], [0.09375, 0.20624999701976776, 0.02500000037252903, 0.02500000037252903], [0.09375, 0.20624999701976776, 0.05000000074505806, 0.05000000074505806], [0.10625000298023224, 0.20624999701976776, 0.02500000037252903, 0.02500000037252903], [0.10625000298023224, 0.20624999701976776, 0.05000000074505806, 0.05000000074505806], [0.11874999850988388, 0.20624999701976776, 0.02500000037252903, 0.02500000037252903], [0.11874999850988388, 0.20624999701976776, 0.05000000074505806, 0.05000000074505806], [0.13124999403953552, 0.20624999701976776, 0.02500000037252903, 0.02500000037252903], [0.13124999403953552, 0.20624999701976776, 0.05000000074505806, 0.05000000074505806], [0.14374999701976776, 0.20624999701976776, 0.02500000037252903, 0.02500000037252903], [0.14374999701976776, 0.20624999701976776, 0.05000000074505806, 0.05000000074505806], [0.15625, 0.20624999701976776, 0.02500000037252903, 0.02500000037252903], [0.15625, 0.20624999701976776, 0.05000000074505806, 0.05000000074505806], [0.16875000298023224, 0.20624999701976776, 0.02500000037252903, 0.02500000037252903], [0.16875000298023224, 0.20624999701976776, 0.05000000074505806, 0.05000000074505806], [0.18125000596046448, 0.20624999701976776, 0.02500000037252903, 0.02500000037252903], [0.18125000596046448, 0.20624999701976776, 0.05000000074505806, 0.05000000074505806], [0.19374999403953552, 0.20624999701976776, 0.02500000037252903, 0.02500000037252903], [0.19374999403953552, 0.20624999701976776, 0.05000000074505806, 0.05000000074505806], [0.20624999701976776, 0.20624999701976776, 0.02500000037252903, 0.02500000037252903], [0.20624999701976776, 0.20624999701976776, 0.05000000074505806, 0.05000000074505806], [0.21875, 0.20624999701976776, 0.02500000037252903, 0.02500000037252903], [0.21875, 0.20624999701976776, 0.05000000074505806, 0.05000000074505806], [0.23125000298023224, 0.20624999701976776, 0.02500000037252903, 0.02500000037252903], [0.23125000298023224, 0.20624999701976776, 0.05000000074505806, 0.05000000074505806], [0.24375000596046448, 0.20624999701976776, 0.02500000037252903, 0.02500000037252903], [0.24375000596046448, 0.20624999701976776, 0.05000000074505806, 0.05000000074505806], [0.2562499940395355, 0.20624999701976776, 0.02500000037252903, 0.02500000037252903], [0.2562499940395355, 0.20624999701976776, 0.05000000074505806, 0.05000000074505806], [0.26875001192092896, 0.20624999701976776, 0.02500000037252903, 0.02500000037252903], [0.26875001192092896, 0.20624999701976776, 0.05000000074505806, 0.05000000074505806], [0.28125, 0.20624999701976776, 0.02500000037252903, 0.02500000037252903], [0.28125, 0.20624999701976776, 0.05000000074505806, 0.05000000074505806], [0.29374998807907104, 0.20624999701976776, 0.02500000037252903, 0.02500000037252903], [0.29374998807907104, 0.20624999701976776, 0.05000000074505806, 0.05000000074505806], [0.3062500059604645, 0.20624999701976776, 0.02500000037252903, 0.02500000037252903], [0.3062500059604645, 0.20624999701976776, 0.05000000074505806, 0.05000000074505806], [0.3187499940395355, 0.20624999701976776, 0.02500000037252903, 0.02500000037252903], [0.3187499940395355, 0.20624999701976776, 0.05000000074505806, 0.05000000074505806], [0.33125001192092896, 0.20624999701976776, 0.02500000037252903, 0.02500000037252903], [0.33125001192092896, 0.20624999701976776, 0.05000000074505806, 0.05000000074505806], [0.34375, 0.20624999701976776, 0.02500000037252903, 0.02500000037252903], [0.34375, 0.20624999701976776, 0.05000000074505806, 0.05000000074505806], [0.35624998807907104, 0.20624999701976776, 0.02500000037252903, 0.02500000037252903], [0.35624998807907104, 0.20624999701976776, 0.05000000074505806, 0.05000000074505806], [0.3687500059604645, 0.20624999701976776, 0.02500000037252903, 0.02500000037252903], [0.3687500059604645, 0.20624999701976776, 0.05000000074505806, 0.05000000074505806], [0.3812499940395355, 0.20624999701976776, 0.02500000037252903, 0.02500000037252903], [0.3812499940395355, 0.20624999701976776, 0.05000000074505806, 0.05000000074505806], [0.39375001192092896, 0.20624999701976776, 0.02500000037252903, 0.02500000037252903], [0.39375001192092896, 0.20624999701976776, 0.05000000074505806, 0.05000000074505806], [0.40625, 0.20624999701976776, 0.02500000037252903, 0.02500000037252903], [0.40625, 0.20624999701976776, 0.05000000074505806, 0.05000000074505806], [0.41874998807907104, 0.20624999701976776, 0.02500000037252903, 0.02500000037252903], [0.41874998807907104, 0.20624999701976776, 0.05000000074505806, 0.05000000074505806], [0.4312500059604645, 0.20624999701976776, 0.02500000037252903, 0.02500000037252903], [0.4312500059604645, 0.20624999701976776, 0.05000000074505806, 0.05000000074505806], [0.4437499940395355, 0.20624999701976776, 0.02500000037252903, 0.02500000037252903], [0.4437499940395355, 0.20624999701976776, 0.05000000074505806, 0.05000000074505806], [0.45625001192092896, 0.20624999701976776, 0.02500000037252903, 0.02500000037252903], [0.45625001192092896, 0.20624999701976776, 0.05000000074505806, 0.05000000074505806], [0.46875, 0.20624999701976776, 0.02500000037252903, 0.02500000037252903], [0.46875, 0.20624999701976776, 0.05000000074505806, 0.05000000074505806], [0.48124998807907104, 0.20624999701976776, 0.02500000037252903, 0.02500000037252903], [0.48124998807907104, 0.20624999701976776, 0.05000000074505806, 0.05000000074505806], [0.4937500059604645, 0.20624999701976776, 0.02500000037252903, 0.02500000037252903], [0.4937500059604645, 0.20624999701976776, 0.05000000074505806, 0.05000000074505806], [0.5062500238418579, 0.20624999701976776, 0.02500000037252903, 0.02500000037252903], [0.5062500238418579, 0.20624999701976776, 0.05000000074505806, 0.05000000074505806], [0.518750011920929, 0.20624999701976776, 0.02500000037252903, 0.02500000037252903], [0.518750011920929, 0.20624999701976776, 0.05000000074505806, 0.05000000074505806], [0.53125, 0.20624999701976776, 0.02500000037252903, 0.02500000037252903], [0.53125, 0.20624999701976776, 0.05000000074505806, 0.05000000074505806], [0.543749988079071, 0.20624999701976776, 0.02500000037252903, 0.02500000037252903], [0.543749988079071, 0.20624999701976776, 0.05000000074505806, 0.05000000074505806], [0.5562499761581421, 0.20624999701976776, 0.02500000037252903, 0.02500000037252903], [0.5562499761581421, 0.20624999701976776, 0.05000000074505806, 0.05000000074505806], [0.5687500238418579, 0.20624999701976776, 0.02500000037252903, 0.02500000037252903], [0.5687500238418579, 0.20624999701976776, 0.05000000074505806, 0.05000000074505806], [0.581250011920929, 0.20624999701976776, 0.02500000037252903, 0.02500000037252903], [0.581250011920929, 0.20624999701976776, 0.05000000074505806, 0.05000000074505806], [0.59375, 0.20624999701976776, 0.02500000037252903, 0.02500000037252903], [0.59375, 0.20624999701976776, 0.05000000074505806, 0.05000000074505806], [0.606249988079071, 0.20624999701976776, 0.02500000037252903, 0.02500000037252903], [0.606249988079071, 0.20624999701976776, 0.05000000074505806, 0.05000000074505806], [0.6187499761581421, 0.20624999701976776, 0.02500000037252903, 0.02500000037252903], [0.6187499761581421, 0.20624999701976776, 0.05000000074505806, 0.05000000074505806], [0.6312500238418579, 0.20624999701976776, 0.02500000037252903, 0.02500000037252903], [0.6312500238418579, 0.20624999701976776, 0.05000000074505806, 0.05000000074505806], [0.643750011920929, 0.20624999701976776, 0.02500000037252903, 0.02500000037252903], [0.643750011920929, 0.20624999701976776, 0.05000000074505806, 0.05000000074505806], [0.65625, 0.20624999701976776, 0.02500000037252903, 0.02500000037252903], [0.65625, 0.20624999701976776, 0.05000000074505806, 0.05000000074505806], [0.668749988079071, 0.20624999701976776, 0.02500000037252903, 0.02500000037252903], [0.668749988079071, 0.20624999701976776, 0.05000000074505806, 0.05000000074505806], [0.6812499761581421, 0.20624999701976776, 0.02500000037252903, 0.02500000037252903], [0.6812499761581421, 0.20624999701976776, 0.05000000074505806, 0.05000000074505806], [0.6937500238418579, 0.20624999701976776, 0.02500000037252903, 0.02500000037252903], [0.6937500238418579, 0.20624999701976776, 0.05000000074505806, 0.05000000074505806], [0.706250011920929, 0.20624999701976776, 0.02500000037252903, 0.02500000037252903], [0.706250011920929, 0.20624999701976776, 0.05000000074505806, 0.05000000074505806], [0.71875, 0.20624999701976776, 0.02500000037252903, 0.02500000037252903], [0.71875, 0.20624999701976776, 0.05000000074505806, 0.05000000074505806], [0.731249988079071, 0.20624999701976776, 0.02500000037252903, 0.02500000037252903], [0.731249988079071, 0.20624999701976776, 0.05000000074505806, 0.05000000074505806], [0.7437499761581421, 0.20624999701976776, 0.02500000037252903, 0.02500000037252903], [0.7437499761581421, 0.20624999701976776, 0.05000000074505806, 0.05000000074505806], [0.7562500238418579, 0.20624999701976776, 0.02500000037252903, 0.02500000037252903], [0.7562500238418579, 0.20624999701976776, 0.05000000074505806, 0.05000000074505806], [0.768750011920929, 0.20624999701976776, 0.02500000037252903, 0.02500000037252903], [0.768750011920929, 0.20624999701976776, 0.05000000074505806, 0.05000000074505806], [0.78125, 0.20624999701976776, 0.02500000037252903, 0.02500000037252903], [0.78125, 0.20624999701976776, 0.05000000074505806, 0.05000000074505806], [0.793749988079071, 0.20624999701976776, 0.02500000037252903, 0.02500000037252903], [0.793749988079071, 0.20624999701976776, 0.05000000074505806, 0.05000000074505806], [0.8062499761581421, 0.20624999701976776, 0.02500000037252903, 0.02500000037252903], [0.8062499761581421, 0.20624999701976776, 0.05000000074505806, 0.05000000074505806], [0.8187500238418579, 0.20624999701976776, 0.02500000037252903, 0.02500000037252903], [0.8187500238418579, 0.20624999701976776, 0.05000000074505806, 0.05000000074505806], [0.831250011920929, 0.20624999701976776, 0.02500000037252903, 0.02500000037252903], [0.831250011920929, 0.20624999701976776, 0.05000000074505806, 0.05000000074505806], [0.84375, 0.20624999701976776, 0.02500000037252903, 0.02500000037252903], [0.84375, 0.20624999701976776, 0.05000000074505806, 0.05000000074505806], [0.856249988079071, 0.20624999701976776, 0.02500000037252903, 0.02500000037252903], [0.856249988079071, 0.20624999701976776, 0.05000000074505806, 0.05000000074505806], [0.8687499761581421, 0.20624999701976776, 0.02500000037252903, 0.02500000037252903], [0.8687499761581421, 0.20624999701976776, 0.05000000074505806, 0.05000000074505806], [0.8812500238418579, 0.20624999701976776, 0.02500000037252903, 0.02500000037252903], [0.8812500238418579, 0.20624999701976776, 0.05000000074505806, 0.05000000074505806], [0.893750011920929, 0.20624999701976776, 0.02500000037252903, 0.02500000037252903], [0.893750011920929, 0.20624999701976776, 0.05000000074505806, 0.05000000074505806], [0.90625, 0.20624999701976776, 0.02500000037252903, 0.02500000037252903], [0.90625, 0.20624999701976776, 0.05000000074505806, 0.05000000074505806], [0.918749988079071, 0.20624999701976776, 0.02500000037252903, 0.02500000037252903], [0.918749988079071, 0.20624999701976776, 0.05000000074505806, 0.05000000074505806], [0.9312499761581421, 0.20624999701976776, 0.02500000037252903, 0.02500000037252903], [0.9312499761581421, 0.20624999701976776, 0.05000000074505806, 0.05000000074505806], [0.9437500238418579, 0.20624999701976776, 0.02500000037252903, 0.02500000037252903], [0.9437500238418579, 0.20624999701976776, 0.05000000074505806, 0.05000000074505806], [0.956250011920929, 0.20624999701976776, 0.02500000037252903, 0.02500000037252903], [0.956250011920929, 0.20624999701976776, 0.05000000074505806, 0.05000000074505806], [0.96875, 0.20624999701976776, 0.02500000037252903, 0.02500000037252903], [0.96875, 0.20624999701976776, 0.05000000074505806, 0.05000000074505806], [0.981249988079071, 0.20624999701976776, 0.02500000037252903, 0.02500000037252903], [0.981249988079071, 0.20624999701976776, 0.05000000074505806, 0.05000000074505806], [0.9937499761581421, 0.20624999701976776, 0.02500000037252903, 0.02500000037252903], [0.9937499761581421, 0.20624999701976776, 0.05000000074505806, 0.05000000074505806], [0.0062500000931322575, 0.21875, 0.02500000037252903, 0.02500000037252903], [0.0062500000931322575, 0.21875, 0.05000000074505806, 0.05000000074505806], [0.01875000074505806, 0.21875, 0.02500000037252903, 0.02500000037252903], [0.01875000074505806, 0.21875, 0.05000000074505806, 0.05000000074505806], [0.03125, 0.21875, 0.02500000037252903, 0.02500000037252903], [0.03125, 0.21875, 0.05000000074505806, 0.05000000074505806], [0.04374999925494194, 0.21875, 0.02500000037252903, 0.02500000037252903], [0.04374999925494194, 0.21875, 0.05000000074505806, 0.05000000074505806], [0.05624999850988388, 0.21875, 0.02500000037252903, 0.02500000037252903], [0.05624999850988388, 0.21875, 0.05000000074505806, 0.05000000074505806], [0.06875000149011612, 0.21875, 0.02500000037252903, 0.02500000037252903], [0.06875000149011612, 0.21875, 0.05000000074505806, 0.05000000074505806], [0.08124999701976776, 0.21875, 0.02500000037252903, 0.02500000037252903], [0.08124999701976776, 0.21875, 0.05000000074505806, 0.05000000074505806], [0.09375, 0.21875, 0.02500000037252903, 0.02500000037252903], [0.09375, 0.21875, 0.05000000074505806, 0.05000000074505806], [0.10625000298023224, 0.21875, 0.02500000037252903, 0.02500000037252903], [0.10625000298023224, 0.21875, 0.05000000074505806, 0.05000000074505806], [0.11874999850988388, 0.21875, 0.02500000037252903, 0.02500000037252903], [0.11874999850988388, 0.21875, 0.05000000074505806, 0.05000000074505806], [0.13124999403953552, 0.21875, 0.02500000037252903, 0.02500000037252903], [0.13124999403953552, 0.21875, 0.05000000074505806, 0.05000000074505806], [0.14374999701976776, 0.21875, 0.02500000037252903, 0.02500000037252903], [0.14374999701976776, 0.21875, 0.05000000074505806, 0.05000000074505806], [0.15625, 0.21875, 0.02500000037252903, 0.02500000037252903], [0.15625, 0.21875, 0.05000000074505806, 0.05000000074505806], [0.16875000298023224, 0.21875, 0.02500000037252903, 0.02500000037252903], [0.16875000298023224, 0.21875, 0.05000000074505806, 0.05000000074505806], [0.18125000596046448, 0.21875, 0.02500000037252903, 0.02500000037252903], [0.18125000596046448, 0.21875, 0.05000000074505806, 0.05000000074505806], [0.19374999403953552, 0.21875, 0.02500000037252903, 0.02500000037252903], [0.19374999403953552, 0.21875, 0.05000000074505806, 0.05000000074505806], [0.20624999701976776, 0.21875, 0.02500000037252903, 0.02500000037252903], [0.20624999701976776, 0.21875, 0.05000000074505806, 0.05000000074505806], [0.21875, 0.21875, 0.02500000037252903, 0.02500000037252903], [0.21875, 0.21875, 0.05000000074505806, 0.05000000074505806], [0.23125000298023224, 0.21875, 0.02500000037252903, 0.02500000037252903], [0.23125000298023224, 0.21875, 0.05000000074505806, 0.05000000074505806], [0.24375000596046448, 0.21875, 0.02500000037252903, 0.02500000037252903], [0.24375000596046448, 0.21875, 0.05000000074505806, 0.05000000074505806], [0.2562499940395355, 0.21875, 0.02500000037252903, 0.02500000037252903], [0.2562499940395355, 0.21875, 0.05000000074505806, 0.05000000074505806], [0.26875001192092896, 0.21875, 0.02500000037252903, 0.02500000037252903], [0.26875001192092896, 0.21875, 0.05000000074505806, 0.05000000074505806], [0.28125, 0.21875, 0.02500000037252903, 0.02500000037252903], [0.28125, 0.21875, 0.05000000074505806, 0.05000000074505806], [0.29374998807907104, 0.21875, 0.02500000037252903, 0.02500000037252903], [0.29374998807907104, 0.21875, 0.05000000074505806, 0.05000000074505806], [0.3062500059604645, 0.21875, 0.02500000037252903, 0.02500000037252903], [0.3062500059604645, 0.21875, 0.05000000074505806, 0.05000000074505806], [0.3187499940395355, 0.21875, 0.02500000037252903, 0.02500000037252903], [0.3187499940395355, 0.21875, 0.05000000074505806, 0.05000000074505806], [0.33125001192092896, 0.21875, 0.02500000037252903, 0.02500000037252903], [0.33125001192092896, 0.21875, 0.05000000074505806, 0.05000000074505806], [0.34375, 0.21875, 0.02500000037252903, 0.02500000037252903], [0.34375, 0.21875, 0.05000000074505806, 0.05000000074505806], [0.35624998807907104, 0.21875, 0.02500000037252903, 0.02500000037252903], [0.35624998807907104, 0.21875, 0.05000000074505806, 0.05000000074505806], [0.3687500059604645, 0.21875, 0.02500000037252903, 0.02500000037252903], [0.3687500059604645, 0.21875, 0.05000000074505806, 0.05000000074505806], [0.3812499940395355, 0.21875, 0.02500000037252903, 0.02500000037252903], [0.3812499940395355, 0.21875, 0.05000000074505806, 0.05000000074505806], [0.39375001192092896, 0.21875, 0.02500000037252903, 0.02500000037252903], [0.39375001192092896, 0.21875, 0.05000000074505806, 0.05000000074505806], [0.40625, 0.21875, 0.02500000037252903, 0.02500000037252903], [0.40625, 0.21875, 0.05000000074505806, 0.05000000074505806], [0.41874998807907104, 0.21875, 0.02500000037252903, 0.02500000037252903], [0.41874998807907104, 0.21875, 0.05000000074505806, 0.05000000074505806], [0.4312500059604645, 0.21875, 0.02500000037252903, 0.02500000037252903], [0.4312500059604645, 0.21875, 0.05000000074505806, 0.05000000074505806], [0.4437499940395355, 0.21875, 0.02500000037252903, 0.02500000037252903], [0.4437499940395355, 0.21875, 0.05000000074505806, 0.05000000074505806], [0.45625001192092896, 0.21875, 0.02500000037252903, 0.02500000037252903], [0.45625001192092896, 0.21875, 0.05000000074505806, 0.05000000074505806], [0.46875, 0.21875, 0.02500000037252903, 0.02500000037252903], [0.46875, 0.21875, 0.05000000074505806, 0.05000000074505806], [0.48124998807907104, 0.21875, 0.02500000037252903, 0.02500000037252903], [0.48124998807907104, 0.21875, 0.05000000074505806, 0.05000000074505806], [0.4937500059604645, 0.21875, 0.02500000037252903, 0.02500000037252903], [0.4937500059604645, 0.21875, 0.05000000074505806, 0.05000000074505806], [0.5062500238418579, 0.21875, 0.02500000037252903, 0.02500000037252903], [0.5062500238418579, 0.21875, 0.05000000074505806, 0.05000000074505806], [0.518750011920929, 0.21875, 0.02500000037252903, 0.02500000037252903], [0.518750011920929, 0.21875, 0.05000000074505806, 0.05000000074505806], [0.53125, 0.21875, 0.02500000037252903, 0.02500000037252903], [0.53125, 0.21875, 0.05000000074505806, 0.05000000074505806], [0.543749988079071, 0.21875, 0.02500000037252903, 0.02500000037252903], [0.543749988079071, 0.21875, 0.05000000074505806, 0.05000000074505806], [0.5562499761581421, 0.21875, 0.02500000037252903, 0.02500000037252903], [0.5562499761581421, 0.21875, 0.05000000074505806, 0.05000000074505806], [0.5687500238418579, 0.21875, 0.02500000037252903, 0.02500000037252903], [0.5687500238418579, 0.21875, 0.05000000074505806, 0.05000000074505806], [0.581250011920929, 0.21875, 0.02500000037252903, 0.02500000037252903], [0.581250011920929, 0.21875, 0.05000000074505806, 0.05000000074505806], [0.59375, 0.21875, 0.02500000037252903, 0.02500000037252903], [0.59375, 0.21875, 0.05000000074505806, 0.05000000074505806], [0.606249988079071, 0.21875, 0.02500000037252903, 0.02500000037252903], [0.606249988079071, 0.21875, 0.05000000074505806, 0.05000000074505806], [0.6187499761581421, 0.21875, 0.02500000037252903, 0.02500000037252903], [0.6187499761581421, 0.21875, 0.05000000074505806, 0.05000000074505806], [0.6312500238418579, 0.21875, 0.02500000037252903, 0.02500000037252903], [0.6312500238418579, 0.21875, 0.05000000074505806, 0.05000000074505806], [0.643750011920929, 0.21875, 0.02500000037252903, 0.02500000037252903], [0.643750011920929, 0.21875, 0.05000000074505806, 0.05000000074505806], [0.65625, 0.21875, 0.02500000037252903, 0.02500000037252903], [0.65625, 0.21875, 0.05000000074505806, 0.05000000074505806], [0.668749988079071, 0.21875, 0.02500000037252903, 0.02500000037252903], [0.668749988079071, 0.21875, 0.05000000074505806, 0.05000000074505806], [0.6812499761581421, 0.21875, 0.02500000037252903, 0.02500000037252903], [0.6812499761581421, 0.21875, 0.05000000074505806, 0.05000000074505806], [0.6937500238418579, 0.21875, 0.02500000037252903, 0.02500000037252903], [0.6937500238418579, 0.21875, 0.05000000074505806, 0.05000000074505806], [0.706250011920929, 0.21875, 0.02500000037252903, 0.02500000037252903], [0.706250011920929, 0.21875, 0.05000000074505806, 0.05000000074505806], [0.71875, 0.21875, 0.02500000037252903, 0.02500000037252903], [0.71875, 0.21875, 0.05000000074505806, 0.05000000074505806], [0.731249988079071, 0.21875, 0.02500000037252903, 0.02500000037252903], [0.731249988079071, 0.21875, 0.05000000074505806, 0.05000000074505806], [0.7437499761581421, 0.21875, 0.02500000037252903, 0.02500000037252903], [0.7437499761581421, 0.21875, 0.05000000074505806, 0.05000000074505806], [0.7562500238418579, 0.21875, 0.02500000037252903, 0.02500000037252903], [0.7562500238418579, 0.21875, 0.05000000074505806, 0.05000000074505806], [0.768750011920929, 0.21875, 0.02500000037252903, 0.02500000037252903], [0.768750011920929, 0.21875, 0.05000000074505806, 0.05000000074505806], [0.78125, 0.21875, 0.02500000037252903, 0.02500000037252903], [0.78125, 0.21875, 0.05000000074505806, 0.05000000074505806], [0.793749988079071, 0.21875, 0.02500000037252903, 0.02500000037252903], [0.793749988079071, 0.21875, 0.05000000074505806, 0.05000000074505806], [0.8062499761581421, 0.21875, 0.02500000037252903, 0.02500000037252903], [0.8062499761581421, 0.21875, 0.05000000074505806, 0.05000000074505806], [0.8187500238418579, 0.21875, 0.02500000037252903, 0.02500000037252903], [0.8187500238418579, 0.21875, 0.05000000074505806, 0.05000000074505806], [0.831250011920929, 0.21875, 0.02500000037252903, 0.02500000037252903], [0.831250011920929, 0.21875, 0.05000000074505806, 0.05000000074505806], [0.84375, 0.21875, 0.02500000037252903, 0.02500000037252903], [0.84375, 0.21875, 0.05000000074505806, 0.05000000074505806], [0.856249988079071, 0.21875, 0.02500000037252903, 0.02500000037252903], [0.856249988079071, 0.21875, 0.05000000074505806, 0.05000000074505806], [0.8687499761581421, 0.21875, 0.02500000037252903, 0.02500000037252903], [0.8687499761581421, 0.21875, 0.05000000074505806, 0.05000000074505806], [0.8812500238418579, 0.21875, 0.02500000037252903, 0.02500000037252903], [0.8812500238418579, 0.21875, 0.05000000074505806, 0.05000000074505806], [0.893750011920929, 0.21875, 0.02500000037252903, 0.02500000037252903], [0.893750011920929, 0.21875, 0.05000000074505806, 0.05000000074505806], [0.90625, 0.21875, 0.02500000037252903, 0.02500000037252903], [0.90625, 0.21875, 0.05000000074505806, 0.05000000074505806], [0.918749988079071, 0.21875, 0.02500000037252903, 0.02500000037252903], [0.918749988079071, 0.21875, 0.05000000074505806, 0.05000000074505806], [0.9312499761581421, 0.21875, 0.02500000037252903, 0.02500000037252903], [0.9312499761581421, 0.21875, 0.05000000074505806, 0.05000000074505806], [0.9437500238418579, 0.21875, 0.02500000037252903, 0.02500000037252903], [0.9437500238418579, 0.21875, 0.05000000074505806, 0.05000000074505806], [0.956250011920929, 0.21875, 0.02500000037252903, 0.02500000037252903], [0.956250011920929, 0.21875, 0.05000000074505806, 0.05000000074505806], [0.96875, 0.21875, 0.02500000037252903, 0.02500000037252903], [0.96875, 0.21875, 0.05000000074505806, 0.05000000074505806], [0.981249988079071, 0.21875, 0.02500000037252903, 0.02500000037252903], [0.981249988079071, 0.21875, 0.05000000074505806, 0.05000000074505806], [0.9937499761581421, 0.21875, 0.02500000037252903, 0.02500000037252903], [0.9937499761581421, 0.21875, 0.05000000074505806, 0.05000000074505806], [0.0062500000931322575, 0.23125000298023224, 0.02500000037252903, 0.02500000037252903], [0.0062500000931322575, 0.23125000298023224, 0.05000000074505806, 0.05000000074505806], [0.01875000074505806, 0.23125000298023224, 0.02500000037252903, 0.02500000037252903], [0.01875000074505806, 0.23125000298023224, 0.05000000074505806, 0.05000000074505806], [0.03125, 0.23125000298023224, 0.02500000037252903, 0.02500000037252903], [0.03125, 0.23125000298023224, 0.05000000074505806, 0.05000000074505806], [0.04374999925494194, 0.23125000298023224, 0.02500000037252903, 0.02500000037252903], [0.04374999925494194, 0.23125000298023224, 0.05000000074505806, 0.05000000074505806], [0.05624999850988388, 0.23125000298023224, 0.02500000037252903, 0.02500000037252903], [0.05624999850988388, 0.23125000298023224, 0.05000000074505806, 0.05000000074505806], [0.06875000149011612, 0.23125000298023224, 0.02500000037252903, 0.02500000037252903], [0.06875000149011612, 0.23125000298023224, 0.05000000074505806, 0.05000000074505806], [0.08124999701976776, 0.23125000298023224, 0.02500000037252903, 0.02500000037252903], [0.08124999701976776, 0.23125000298023224, 0.05000000074505806, 0.05000000074505806], [0.09375, 0.23125000298023224, 0.02500000037252903, 0.02500000037252903], [0.09375, 0.23125000298023224, 0.05000000074505806, 0.05000000074505806], [0.10625000298023224, 0.23125000298023224, 0.02500000037252903, 0.02500000037252903], [0.10625000298023224, 0.23125000298023224, 0.05000000074505806, 0.05000000074505806], [0.11874999850988388, 0.23125000298023224, 0.02500000037252903, 0.02500000037252903], [0.11874999850988388, 0.23125000298023224, 0.05000000074505806, 0.05000000074505806], [0.13124999403953552, 0.23125000298023224, 0.02500000037252903, 0.02500000037252903], [0.13124999403953552, 0.23125000298023224, 0.05000000074505806, 0.05000000074505806], [0.14374999701976776, 0.23125000298023224, 0.02500000037252903, 0.02500000037252903], [0.14374999701976776, 0.23125000298023224, 0.05000000074505806, 0.05000000074505806], [0.15625, 0.23125000298023224, 0.02500000037252903, 0.02500000037252903], [0.15625, 0.23125000298023224, 0.05000000074505806, 0.05000000074505806], [0.16875000298023224, 0.23125000298023224, 0.02500000037252903, 0.02500000037252903], [0.16875000298023224, 0.23125000298023224, 0.05000000074505806, 0.05000000074505806], [0.18125000596046448, 0.23125000298023224, 0.02500000037252903, 0.02500000037252903], [0.18125000596046448, 0.23125000298023224, 0.05000000074505806, 0.05000000074505806], [0.19374999403953552, 0.23125000298023224, 0.02500000037252903, 0.02500000037252903], [0.19374999403953552, 0.23125000298023224, 0.05000000074505806, 0.05000000074505806], [0.20624999701976776, 0.23125000298023224, 0.02500000037252903, 0.02500000037252903], [0.20624999701976776, 0.23125000298023224, 0.05000000074505806, 0.05000000074505806], [0.21875, 0.23125000298023224, 0.02500000037252903, 0.02500000037252903], [0.21875, 0.23125000298023224, 0.05000000074505806, 0.05000000074505806], [0.23125000298023224, 0.23125000298023224, 0.02500000037252903, 0.02500000037252903], [0.23125000298023224, 0.23125000298023224, 0.05000000074505806, 0.05000000074505806], [0.24375000596046448, 0.23125000298023224, 0.02500000037252903, 0.02500000037252903], [0.24375000596046448, 0.23125000298023224, 0.05000000074505806, 0.05000000074505806], [0.2562499940395355, 0.23125000298023224, 0.02500000037252903, 0.02500000037252903], [0.2562499940395355, 0.23125000298023224, 0.05000000074505806, 0.05000000074505806], [0.26875001192092896, 0.23125000298023224, 0.02500000037252903, 0.02500000037252903], [0.26875001192092896, 0.23125000298023224, 0.05000000074505806, 0.05000000074505806], [0.28125, 0.23125000298023224, 0.02500000037252903, 0.02500000037252903], [0.28125, 0.23125000298023224, 0.05000000074505806, 0.05000000074505806], [0.29374998807907104, 0.23125000298023224, 0.02500000037252903, 0.02500000037252903], [0.29374998807907104, 0.23125000298023224, 0.05000000074505806, 0.05000000074505806], [0.3062500059604645, 0.23125000298023224, 0.02500000037252903, 0.02500000037252903], [0.3062500059604645, 0.23125000298023224, 0.05000000074505806, 0.05000000074505806], [0.3187499940395355, 0.23125000298023224, 0.02500000037252903, 0.02500000037252903], [0.3187499940395355, 0.23125000298023224, 0.05000000074505806, 0.05000000074505806], [0.33125001192092896, 0.23125000298023224, 0.02500000037252903, 0.02500000037252903], [0.33125001192092896, 0.23125000298023224, 0.05000000074505806, 0.05000000074505806], [0.34375, 0.23125000298023224, 0.02500000037252903, 0.02500000037252903], [0.34375, 0.23125000298023224, 0.05000000074505806, 0.05000000074505806], [0.35624998807907104, 0.23125000298023224, 0.02500000037252903, 0.02500000037252903], [0.35624998807907104, 0.23125000298023224, 0.05000000074505806, 0.05000000074505806], [0.3687500059604645, 0.23125000298023224, 0.02500000037252903, 0.02500000037252903], [0.3687500059604645, 0.23125000298023224, 0.05000000074505806, 0.05000000074505806], [0.3812499940395355, 0.23125000298023224, 0.02500000037252903, 0.02500000037252903], [0.3812499940395355, 0.23125000298023224, 0.05000000074505806, 0.05000000074505806], [0.39375001192092896, 0.23125000298023224, 0.02500000037252903, 0.02500000037252903], [0.39375001192092896, 0.23125000298023224, 0.05000000074505806, 0.05000000074505806], [0.40625, 0.23125000298023224, 0.02500000037252903, 0.02500000037252903], [0.40625, 0.23125000298023224, 0.05000000074505806, 0.05000000074505806], [0.41874998807907104, 0.23125000298023224, 0.02500000037252903, 0.02500000037252903], [0.41874998807907104, 0.23125000298023224, 0.05000000074505806, 0.05000000074505806], [0.4312500059604645, 0.23125000298023224, 0.02500000037252903, 0.02500000037252903], [0.4312500059604645, 0.23125000298023224, 0.05000000074505806, 0.05000000074505806], [0.4437499940395355, 0.23125000298023224, 0.02500000037252903, 0.02500000037252903], [0.4437499940395355, 0.23125000298023224, 0.05000000074505806, 0.05000000074505806], [0.45625001192092896, 0.23125000298023224, 0.02500000037252903, 0.02500000037252903], [0.45625001192092896, 0.23125000298023224, 0.05000000074505806, 0.05000000074505806], [0.46875, 0.23125000298023224, 0.02500000037252903, 0.02500000037252903], [0.46875, 0.23125000298023224, 0.05000000074505806, 0.05000000074505806], [0.48124998807907104, 0.23125000298023224, 0.02500000037252903, 0.02500000037252903], [0.48124998807907104, 0.23125000298023224, 0.05000000074505806, 0.05000000074505806], [0.4937500059604645, 0.23125000298023224, 0.02500000037252903, 0.02500000037252903], [0.4937500059604645, 0.23125000298023224, 0.05000000074505806, 0.05000000074505806], [0.5062500238418579, 0.23125000298023224, 0.02500000037252903, 0.02500000037252903], [0.5062500238418579, 0.23125000298023224, 0.05000000074505806, 0.05000000074505806], [0.518750011920929, 0.23125000298023224, 0.02500000037252903, 0.02500000037252903], [0.518750011920929, 0.23125000298023224, 0.05000000074505806, 0.05000000074505806], [0.53125, 0.23125000298023224, 0.02500000037252903, 0.02500000037252903], [0.53125, 0.23125000298023224, 0.05000000074505806, 0.05000000074505806], [0.543749988079071, 0.23125000298023224, 0.02500000037252903, 0.02500000037252903], [0.543749988079071, 0.23125000298023224, 0.05000000074505806, 0.05000000074505806], [0.5562499761581421, 0.23125000298023224, 0.02500000037252903, 0.02500000037252903], [0.5562499761581421, 0.23125000298023224, 0.05000000074505806, 0.05000000074505806], [0.5687500238418579, 0.23125000298023224, 0.02500000037252903, 0.02500000037252903], [0.5687500238418579, 0.23125000298023224, 0.05000000074505806, 0.05000000074505806], [0.581250011920929, 0.23125000298023224, 0.02500000037252903, 0.02500000037252903], [0.581250011920929, 0.23125000298023224, 0.05000000074505806, 0.05000000074505806], [0.59375, 0.23125000298023224, 0.02500000037252903, 0.02500000037252903], [0.59375, 0.23125000298023224, 0.05000000074505806, 0.05000000074505806], [0.606249988079071, 0.23125000298023224, 0.02500000037252903, 0.02500000037252903], [0.606249988079071, 0.23125000298023224, 0.05000000074505806, 0.05000000074505806], [0.6187499761581421, 0.23125000298023224, 0.02500000037252903, 0.02500000037252903], [0.6187499761581421, 0.23125000298023224, 0.05000000074505806, 0.05000000074505806], [0.6312500238418579, 0.23125000298023224, 0.02500000037252903, 0.02500000037252903], [0.6312500238418579, 0.23125000298023224, 0.05000000074505806, 0.05000000074505806], [0.643750011920929, 0.23125000298023224, 0.02500000037252903, 0.02500000037252903], [0.643750011920929, 0.23125000298023224, 0.05000000074505806, 0.05000000074505806], [0.65625, 0.23125000298023224, 0.02500000037252903, 0.02500000037252903], [0.65625, 0.23125000298023224, 0.05000000074505806, 0.05000000074505806], [0.668749988079071, 0.23125000298023224, 0.02500000037252903, 0.02500000037252903], [0.668749988079071, 0.23125000298023224, 0.05000000074505806, 0.05000000074505806], [0.6812499761581421, 0.23125000298023224, 0.02500000037252903, 0.02500000037252903], [0.6812499761581421, 0.23125000298023224, 0.05000000074505806, 0.05000000074505806], [0.6937500238418579, 0.23125000298023224, 0.02500000037252903, 0.02500000037252903], [0.6937500238418579, 0.23125000298023224, 0.05000000074505806, 0.05000000074505806], [0.706250011920929, 0.23125000298023224, 0.02500000037252903, 0.02500000037252903], [0.706250011920929, 0.23125000298023224, 0.05000000074505806, 0.05000000074505806], [0.71875, 0.23125000298023224, 0.02500000037252903, 0.02500000037252903], [0.71875, 0.23125000298023224, 0.05000000074505806, 0.05000000074505806], [0.731249988079071, 0.23125000298023224, 0.02500000037252903, 0.02500000037252903], [0.731249988079071, 0.23125000298023224, 0.05000000074505806, 0.05000000074505806], [0.7437499761581421, 0.23125000298023224, 0.02500000037252903, 0.02500000037252903], [0.7437499761581421, 0.23125000298023224, 0.05000000074505806, 0.05000000074505806], [0.7562500238418579, 0.23125000298023224, 0.02500000037252903, 0.02500000037252903], [0.7562500238418579, 0.23125000298023224, 0.05000000074505806, 0.05000000074505806], [0.768750011920929, 0.23125000298023224, 0.02500000037252903, 0.02500000037252903], [0.768750011920929, 0.23125000298023224, 0.05000000074505806, 0.05000000074505806], [0.78125, 0.23125000298023224, 0.02500000037252903, 0.02500000037252903], [0.78125, 0.23125000298023224, 0.05000000074505806, 0.05000000074505806], [0.793749988079071, 0.23125000298023224, 0.02500000037252903, 0.02500000037252903], [0.793749988079071, 0.23125000298023224, 0.05000000074505806, 0.05000000074505806], [0.8062499761581421, 0.23125000298023224, 0.02500000037252903, 0.02500000037252903], [0.8062499761581421, 0.23125000298023224, 0.05000000074505806, 0.05000000074505806], [0.8187500238418579, 0.23125000298023224, 0.02500000037252903, 0.02500000037252903], [0.8187500238418579, 0.23125000298023224, 0.05000000074505806, 0.05000000074505806], [0.831250011920929, 0.23125000298023224, 0.02500000037252903, 0.02500000037252903], [0.831250011920929, 0.23125000298023224, 0.05000000074505806, 0.05000000074505806], [0.84375, 0.23125000298023224, 0.02500000037252903, 0.02500000037252903], [0.84375, 0.23125000298023224, 0.05000000074505806, 0.05000000074505806], [0.856249988079071, 0.23125000298023224, 0.02500000037252903, 0.02500000037252903], [0.856249988079071, 0.23125000298023224, 0.05000000074505806, 0.05000000074505806], [0.8687499761581421, 0.23125000298023224, 0.02500000037252903, 0.02500000037252903], [0.8687499761581421, 0.23125000298023224, 0.05000000074505806, 0.05000000074505806], [0.8812500238418579, 0.23125000298023224, 0.02500000037252903, 0.02500000037252903], [0.8812500238418579, 0.23125000298023224, 0.05000000074505806, 0.05000000074505806], [0.893750011920929, 0.23125000298023224, 0.02500000037252903, 0.02500000037252903], [0.893750011920929, 0.23125000298023224, 0.05000000074505806, 0.05000000074505806], [0.90625, 0.23125000298023224, 0.02500000037252903, 0.02500000037252903], [0.90625, 0.23125000298023224, 0.05000000074505806, 0.05000000074505806], [0.918749988079071, 0.23125000298023224, 0.02500000037252903, 0.02500000037252903], [0.918749988079071, 0.23125000298023224, 0.05000000074505806, 0.05000000074505806], [0.9312499761581421, 0.23125000298023224, 0.02500000037252903, 0.02500000037252903], [0.9312499761581421, 0.23125000298023224, 0.05000000074505806, 0.05000000074505806], [0.9437500238418579, 0.23125000298023224, 0.02500000037252903, 0.02500000037252903], [0.9437500238418579, 0.23125000298023224, 0.05000000074505806, 0.05000000074505806], [0.956250011920929, 0.23125000298023224, 0.02500000037252903, 0.02500000037252903], [0.956250011920929, 0.23125000298023224, 0.05000000074505806, 0.05000000074505806], [0.96875, 0.23125000298023224, 0.02500000037252903, 0.02500000037252903], [0.96875, 0.23125000298023224, 0.05000000074505806, 0.05000000074505806], [0.981249988079071, 0.23125000298023224, 0.02500000037252903, 0.02500000037252903], [0.981249988079071, 0.23125000298023224, 0.05000000074505806, 0.05000000074505806], [0.9937499761581421, 0.23125000298023224, 0.02500000037252903, 0.02500000037252903], [0.9937499761581421, 0.23125000298023224, 0.05000000074505806, 0.05000000074505806], [0.0062500000931322575, 0.24375000596046448, 0.02500000037252903, 0.02500000037252903], [0.0062500000931322575, 0.24375000596046448, 0.05000000074505806, 0.05000000074505806], [0.01875000074505806, 0.24375000596046448, 0.02500000037252903, 0.02500000037252903], [0.01875000074505806, 0.24375000596046448, 0.05000000074505806, 0.05000000074505806], [0.03125, 0.24375000596046448, 0.02500000037252903, 0.02500000037252903], [0.03125, 0.24375000596046448, 0.05000000074505806, 0.05000000074505806], [0.04374999925494194, 0.24375000596046448, 0.02500000037252903, 0.02500000037252903], [0.04374999925494194, 0.24375000596046448, 0.05000000074505806, 0.05000000074505806], [0.05624999850988388, 0.24375000596046448, 0.02500000037252903, 0.02500000037252903], [0.05624999850988388, 0.24375000596046448, 0.05000000074505806, 0.05000000074505806], [0.06875000149011612, 0.24375000596046448, 0.02500000037252903, 0.02500000037252903], [0.06875000149011612, 0.24375000596046448, 0.05000000074505806, 0.05000000074505806], [0.08124999701976776, 0.24375000596046448, 0.02500000037252903, 0.02500000037252903], [0.08124999701976776, 0.24375000596046448, 0.05000000074505806, 0.05000000074505806], [0.09375, 0.24375000596046448, 0.02500000037252903, 0.02500000037252903], [0.09375, 0.24375000596046448, 0.05000000074505806, 0.05000000074505806], [0.10625000298023224, 0.24375000596046448, 0.02500000037252903, 0.02500000037252903], [0.10625000298023224, 0.24375000596046448, 0.05000000074505806, 0.05000000074505806], [0.11874999850988388, 0.24375000596046448, 0.02500000037252903, 0.02500000037252903], [0.11874999850988388, 0.24375000596046448, 0.05000000074505806, 0.05000000074505806], [0.13124999403953552, 0.24375000596046448, 0.02500000037252903, 0.02500000037252903], [0.13124999403953552, 0.24375000596046448, 0.05000000074505806, 0.05000000074505806], [0.14374999701976776, 0.24375000596046448, 0.02500000037252903, 0.02500000037252903], [0.14374999701976776, 0.24375000596046448, 0.05000000074505806, 0.05000000074505806], [0.15625, 0.24375000596046448, 0.02500000037252903, 0.02500000037252903], [0.15625, 0.24375000596046448, 0.05000000074505806, 0.05000000074505806], [0.16875000298023224, 0.24375000596046448, 0.02500000037252903, 0.02500000037252903], [0.16875000298023224, 0.24375000596046448, 0.05000000074505806, 0.05000000074505806], [0.18125000596046448, 0.24375000596046448, 0.02500000037252903, 0.02500000037252903], [0.18125000596046448, 0.24375000596046448, 0.05000000074505806, 0.05000000074505806], [0.19374999403953552, 0.24375000596046448, 0.02500000037252903, 0.02500000037252903], [0.19374999403953552, 0.24375000596046448, 0.05000000074505806, 0.05000000074505806], [0.20624999701976776, 0.24375000596046448, 0.02500000037252903, 0.02500000037252903], [0.20624999701976776, 0.24375000596046448, 0.05000000074505806, 0.05000000074505806], [0.21875, 0.24375000596046448, 0.02500000037252903, 0.02500000037252903], [0.21875, 0.24375000596046448, 0.05000000074505806, 0.05000000074505806], [0.23125000298023224, 0.24375000596046448, 0.02500000037252903, 0.02500000037252903], [0.23125000298023224, 0.24375000596046448, 0.05000000074505806, 0.05000000074505806], [0.24375000596046448, 0.24375000596046448, 0.02500000037252903, 0.02500000037252903], [0.24375000596046448, 0.24375000596046448, 0.05000000074505806, 0.05000000074505806], [0.2562499940395355, 0.24375000596046448, 0.02500000037252903, 0.02500000037252903], [0.2562499940395355, 0.24375000596046448, 0.05000000074505806, 0.05000000074505806], [0.26875001192092896, 0.24375000596046448, 0.02500000037252903, 0.02500000037252903], [0.26875001192092896, 0.24375000596046448, 0.05000000074505806, 0.05000000074505806], [0.28125, 0.24375000596046448, 0.02500000037252903, 0.02500000037252903], [0.28125, 0.24375000596046448, 0.05000000074505806, 0.05000000074505806], [0.29374998807907104, 0.24375000596046448, 0.02500000037252903, 0.02500000037252903], [0.29374998807907104, 0.24375000596046448, 0.05000000074505806, 0.05000000074505806], [0.3062500059604645, 0.24375000596046448, 0.02500000037252903, 0.02500000037252903], [0.3062500059604645, 0.24375000596046448, 0.05000000074505806, 0.05000000074505806], [0.3187499940395355, 0.24375000596046448, 0.02500000037252903, 0.02500000037252903], [0.3187499940395355, 0.24375000596046448, 0.05000000074505806, 0.05000000074505806], [0.33125001192092896, 0.24375000596046448, 0.02500000037252903, 0.02500000037252903], [0.33125001192092896, 0.24375000596046448, 0.05000000074505806, 0.05000000074505806], [0.34375, 0.24375000596046448, 0.02500000037252903, 0.02500000037252903], [0.34375, 0.24375000596046448, 0.05000000074505806, 0.05000000074505806], [0.35624998807907104, 0.24375000596046448, 0.02500000037252903, 0.02500000037252903], [0.35624998807907104, 0.24375000596046448, 0.05000000074505806, 0.05000000074505806], [0.3687500059604645, 0.24375000596046448, 0.02500000037252903, 0.02500000037252903], [0.3687500059604645, 0.24375000596046448, 0.05000000074505806, 0.05000000074505806], [0.3812499940395355, 0.24375000596046448, 0.02500000037252903, 0.02500000037252903], [0.3812499940395355, 0.24375000596046448, 0.05000000074505806, 0.05000000074505806], [0.39375001192092896, 0.24375000596046448, 0.02500000037252903, 0.02500000037252903], [0.39375001192092896, 0.24375000596046448, 0.05000000074505806, 0.05000000074505806], [0.40625, 0.24375000596046448, 0.02500000037252903, 0.02500000037252903], [0.40625, 0.24375000596046448, 0.05000000074505806, 0.05000000074505806], [0.41874998807907104, 0.24375000596046448, 0.02500000037252903, 0.02500000037252903], [0.41874998807907104, 0.24375000596046448, 0.05000000074505806, 0.05000000074505806], [0.4312500059604645, 0.24375000596046448, 0.02500000037252903, 0.02500000037252903], [0.4312500059604645, 0.24375000596046448, 0.05000000074505806, 0.05000000074505806], [0.4437499940395355, 0.24375000596046448, 0.02500000037252903, 0.02500000037252903], [0.4437499940395355, 0.24375000596046448, 0.05000000074505806, 0.05000000074505806], [0.45625001192092896, 0.24375000596046448, 0.02500000037252903, 0.02500000037252903], [0.45625001192092896, 0.24375000596046448, 0.05000000074505806, 0.05000000074505806], [0.46875, 0.24375000596046448, 0.02500000037252903, 0.02500000037252903], [0.46875, 0.24375000596046448, 0.05000000074505806, 0.05000000074505806], [0.48124998807907104, 0.24375000596046448, 0.02500000037252903, 0.02500000037252903], [0.48124998807907104, 0.24375000596046448, 0.05000000074505806, 0.05000000074505806], [0.4937500059604645, 0.24375000596046448, 0.02500000037252903, 0.02500000037252903], [0.4937500059604645, 0.24375000596046448, 0.05000000074505806, 0.05000000074505806], [0.5062500238418579, 0.24375000596046448, 0.02500000037252903, 0.02500000037252903], [0.5062500238418579, 0.24375000596046448, 0.05000000074505806, 0.05000000074505806], [0.518750011920929, 0.24375000596046448, 0.02500000037252903, 0.02500000037252903], [0.518750011920929, 0.24375000596046448, 0.05000000074505806, 0.05000000074505806], [0.53125, 0.24375000596046448, 0.02500000037252903, 0.02500000037252903], [0.53125, 0.24375000596046448, 0.05000000074505806, 0.05000000074505806], [0.543749988079071, 0.24375000596046448, 0.02500000037252903, 0.02500000037252903], [0.543749988079071, 0.24375000596046448, 0.05000000074505806, 0.05000000074505806], [0.5562499761581421, 0.24375000596046448, 0.02500000037252903, 0.02500000037252903], [0.5562499761581421, 0.24375000596046448, 0.05000000074505806, 0.05000000074505806], [0.5687500238418579, 0.24375000596046448, 0.02500000037252903, 0.02500000037252903], [0.5687500238418579, 0.24375000596046448, 0.05000000074505806, 0.05000000074505806], [0.581250011920929, 0.24375000596046448, 0.02500000037252903, 0.02500000037252903], [0.581250011920929, 0.24375000596046448, 0.05000000074505806, 0.05000000074505806], [0.59375, 0.24375000596046448, 0.02500000037252903, 0.02500000037252903], [0.59375, 0.24375000596046448, 0.05000000074505806, 0.05000000074505806], [0.606249988079071, 0.24375000596046448, 0.02500000037252903, 0.02500000037252903], [0.606249988079071, 0.24375000596046448, 0.05000000074505806, 0.05000000074505806], [0.6187499761581421, 0.24375000596046448, 0.02500000037252903, 0.02500000037252903], [0.6187499761581421, 0.24375000596046448, 0.05000000074505806, 0.05000000074505806], [0.6312500238418579, 0.24375000596046448, 0.02500000037252903, 0.02500000037252903], [0.6312500238418579, 0.24375000596046448, 0.05000000074505806, 0.05000000074505806], [0.643750011920929, 0.24375000596046448, 0.02500000037252903, 0.02500000037252903], [0.643750011920929, 0.24375000596046448, 0.05000000074505806, 0.05000000074505806], [0.65625, 0.24375000596046448, 0.02500000037252903, 0.02500000037252903], [0.65625, 0.24375000596046448, 0.05000000074505806, 0.05000000074505806], [0.668749988079071, 0.24375000596046448, 0.02500000037252903, 0.02500000037252903], [0.668749988079071, 0.24375000596046448, 0.05000000074505806, 0.05000000074505806], [0.6812499761581421, 0.24375000596046448, 0.02500000037252903, 0.02500000037252903], [0.6812499761581421, 0.24375000596046448, 0.05000000074505806, 0.05000000074505806], [0.6937500238418579, 0.24375000596046448, 0.02500000037252903, 0.02500000037252903], [0.6937500238418579, 0.24375000596046448, 0.05000000074505806, 0.05000000074505806], [0.706250011920929, 0.24375000596046448, 0.02500000037252903, 0.02500000037252903], [0.706250011920929, 0.24375000596046448, 0.05000000074505806, 0.05000000074505806], [0.71875, 0.24375000596046448, 0.02500000037252903, 0.02500000037252903], [0.71875, 0.24375000596046448, 0.05000000074505806, 0.05000000074505806], [0.731249988079071, 0.24375000596046448, 0.02500000037252903, 0.02500000037252903], [0.731249988079071, 0.24375000596046448, 0.05000000074505806, 0.05000000074505806], [0.7437499761581421, 0.24375000596046448, 0.02500000037252903, 0.02500000037252903], [0.7437499761581421, 0.24375000596046448, 0.05000000074505806, 0.05000000074505806], [0.7562500238418579, 0.24375000596046448, 0.02500000037252903, 0.02500000037252903], [0.7562500238418579, 0.24375000596046448, 0.05000000074505806, 0.05000000074505806], [0.768750011920929, 0.24375000596046448, 0.02500000037252903, 0.02500000037252903], [0.768750011920929, 0.24375000596046448, 0.05000000074505806, 0.05000000074505806], [0.78125, 0.24375000596046448, 0.02500000037252903, 0.02500000037252903], [0.78125, 0.24375000596046448, 0.05000000074505806, 0.05000000074505806], [0.793749988079071, 0.24375000596046448, 0.02500000037252903, 0.02500000037252903], [0.793749988079071, 0.24375000596046448, 0.05000000074505806, 0.05000000074505806], [0.8062499761581421, 0.24375000596046448, 0.02500000037252903, 0.02500000037252903], [0.8062499761581421, 0.24375000596046448, 0.05000000074505806, 0.05000000074505806], [0.8187500238418579, 0.24375000596046448, 0.02500000037252903, 0.02500000037252903], [0.8187500238418579, 0.24375000596046448, 0.05000000074505806, 0.05000000074505806], [0.831250011920929, 0.24375000596046448, 0.02500000037252903, 0.02500000037252903], [0.831250011920929, 0.24375000596046448, 0.05000000074505806, 0.05000000074505806], [0.84375, 0.24375000596046448, 0.02500000037252903, 0.02500000037252903], [0.84375, 0.24375000596046448, 0.05000000074505806, 0.05000000074505806], [0.856249988079071, 0.24375000596046448, 0.02500000037252903, 0.02500000037252903], [0.856249988079071, 0.24375000596046448, 0.05000000074505806, 0.05000000074505806], [0.8687499761581421, 0.24375000596046448, 0.02500000037252903, 0.02500000037252903], [0.8687499761581421, 0.24375000596046448, 0.05000000074505806, 0.05000000074505806], [0.8812500238418579, 0.24375000596046448, 0.02500000037252903, 0.02500000037252903], [0.8812500238418579, 0.24375000596046448, 0.05000000074505806, 0.05000000074505806], [0.893750011920929, 0.24375000596046448, 0.02500000037252903, 0.02500000037252903], [0.893750011920929, 0.24375000596046448, 0.05000000074505806, 0.05000000074505806], [0.90625, 0.24375000596046448, 0.02500000037252903, 0.02500000037252903], [0.90625, 0.24375000596046448, 0.05000000074505806, 0.05000000074505806], [0.918749988079071, 0.24375000596046448, 0.02500000037252903, 0.02500000037252903], [0.918749988079071, 0.24375000596046448, 0.05000000074505806, 0.05000000074505806], [0.9312499761581421, 0.24375000596046448, 0.02500000037252903, 0.02500000037252903], [0.9312499761581421, 0.24375000596046448, 0.05000000074505806, 0.05000000074505806], [0.9437500238418579, 0.24375000596046448, 0.02500000037252903, 0.02500000037252903], [0.9437500238418579, 0.24375000596046448, 0.05000000074505806, 0.05000000074505806], [0.956250011920929, 0.24375000596046448, 0.02500000037252903, 0.02500000037252903], [0.956250011920929, 0.24375000596046448, 0.05000000074505806, 0.05000000074505806], [0.96875, 0.24375000596046448, 0.02500000037252903, 0.02500000037252903], [0.96875, 0.24375000596046448, 0.05000000074505806, 0.05000000074505806], [0.981249988079071, 0.24375000596046448, 0.02500000037252903, 0.02500000037252903], [0.981249988079071, 0.24375000596046448, 0.05000000074505806, 0.05000000074505806], [0.9937499761581421, 0.24375000596046448, 0.02500000037252903, 0.02500000037252903], [0.9937499761581421, 0.24375000596046448, 0.05000000074505806, 0.05000000074505806], [0.0062500000931322575, 0.2562499940395355, 0.02500000037252903, 0.02500000037252903], [0.0062500000931322575, 0.2562499940395355, 0.05000000074505806, 0.05000000074505806], [0.01875000074505806, 0.2562499940395355, 0.02500000037252903, 0.02500000037252903], [0.01875000074505806, 0.2562499940395355, 0.05000000074505806, 0.05000000074505806], [0.03125, 0.2562499940395355, 0.02500000037252903, 0.02500000037252903], [0.03125, 0.2562499940395355, 0.05000000074505806, 0.05000000074505806], [0.04374999925494194, 0.2562499940395355, 0.02500000037252903, 0.02500000037252903], [0.04374999925494194, 0.2562499940395355, 0.05000000074505806, 0.05000000074505806], [0.05624999850988388, 0.2562499940395355, 0.02500000037252903, 0.02500000037252903], [0.05624999850988388, 0.2562499940395355, 0.05000000074505806, 0.05000000074505806], [0.06875000149011612, 0.2562499940395355, 0.02500000037252903, 0.02500000037252903], [0.06875000149011612, 0.2562499940395355, 0.05000000074505806, 0.05000000074505806], [0.08124999701976776, 0.2562499940395355, 0.02500000037252903, 0.02500000037252903], [0.08124999701976776, 0.2562499940395355, 0.05000000074505806, 0.05000000074505806], [0.09375, 0.2562499940395355, 0.02500000037252903, 0.02500000037252903], [0.09375, 0.2562499940395355, 0.05000000074505806, 0.05000000074505806], [0.10625000298023224, 0.2562499940395355, 0.02500000037252903, 0.02500000037252903], [0.10625000298023224, 0.2562499940395355, 0.05000000074505806, 0.05000000074505806], [0.11874999850988388, 0.2562499940395355, 0.02500000037252903, 0.02500000037252903], [0.11874999850988388, 0.2562499940395355, 0.05000000074505806, 0.05000000074505806], [0.13124999403953552, 0.2562499940395355, 0.02500000037252903, 0.02500000037252903], [0.13124999403953552, 0.2562499940395355, 0.05000000074505806, 0.05000000074505806], [0.14374999701976776, 0.2562499940395355, 0.02500000037252903, 0.02500000037252903], [0.14374999701976776, 0.2562499940395355, 0.05000000074505806, 0.05000000074505806], [0.15625, 0.2562499940395355, 0.02500000037252903, 0.02500000037252903], [0.15625, 0.2562499940395355, 0.05000000074505806, 0.05000000074505806], [0.16875000298023224, 0.2562499940395355, 0.02500000037252903, 0.02500000037252903], [0.16875000298023224, 0.2562499940395355, 0.05000000074505806, 0.05000000074505806], [0.18125000596046448, 0.2562499940395355, 0.02500000037252903, 0.02500000037252903], [0.18125000596046448, 0.2562499940395355, 0.05000000074505806, 0.05000000074505806], [0.19374999403953552, 0.2562499940395355, 0.02500000037252903, 0.02500000037252903], [0.19374999403953552, 0.2562499940395355, 0.05000000074505806, 0.05000000074505806], [0.20624999701976776, 0.2562499940395355, 0.02500000037252903, 0.02500000037252903], [0.20624999701976776, 0.2562499940395355, 0.05000000074505806, 0.05000000074505806], [0.21875, 0.2562499940395355, 0.02500000037252903, 0.02500000037252903], [0.21875, 0.2562499940395355, 0.05000000074505806, 0.05000000074505806], [0.23125000298023224, 0.2562499940395355, 0.02500000037252903, 0.02500000037252903], [0.23125000298023224, 0.2562499940395355, 0.05000000074505806, 0.05000000074505806], [0.24375000596046448, 0.2562499940395355, 0.02500000037252903, 0.02500000037252903], [0.24375000596046448, 0.2562499940395355, 0.05000000074505806, 0.05000000074505806], [0.2562499940395355, 0.2562499940395355, 0.02500000037252903, 0.02500000037252903], [0.2562499940395355, 0.2562499940395355, 0.05000000074505806, 0.05000000074505806], [0.26875001192092896, 0.2562499940395355, 0.02500000037252903, 0.02500000037252903], [0.26875001192092896, 0.2562499940395355, 0.05000000074505806, 0.05000000074505806], [0.28125, 0.2562499940395355, 0.02500000037252903, 0.02500000037252903], [0.28125, 0.2562499940395355, 0.05000000074505806, 0.05000000074505806], [0.29374998807907104, 0.2562499940395355, 0.02500000037252903, 0.02500000037252903], [0.29374998807907104, 0.2562499940395355, 0.05000000074505806, 0.05000000074505806], [0.3062500059604645, 0.2562499940395355, 0.02500000037252903, 0.02500000037252903], [0.3062500059604645, 0.2562499940395355, 0.05000000074505806, 0.05000000074505806], [0.3187499940395355, 0.2562499940395355, 0.02500000037252903, 0.02500000037252903], [0.3187499940395355, 0.2562499940395355, 0.05000000074505806, 0.05000000074505806], [0.33125001192092896, 0.2562499940395355, 0.02500000037252903, 0.02500000037252903], [0.33125001192092896, 0.2562499940395355, 0.05000000074505806, 0.05000000074505806], [0.34375, 0.2562499940395355, 0.02500000037252903, 0.02500000037252903], [0.34375, 0.2562499940395355, 0.05000000074505806, 0.05000000074505806], [0.35624998807907104, 0.2562499940395355, 0.02500000037252903, 0.02500000037252903], [0.35624998807907104, 0.2562499940395355, 0.05000000074505806, 0.05000000074505806], [0.3687500059604645, 0.2562499940395355, 0.02500000037252903, 0.02500000037252903], [0.3687500059604645, 0.2562499940395355, 0.05000000074505806, 0.05000000074505806], [0.3812499940395355, 0.2562499940395355, 0.02500000037252903, 0.02500000037252903], [0.3812499940395355, 0.2562499940395355, 0.05000000074505806, 0.05000000074505806], [0.39375001192092896, 0.2562499940395355, 0.02500000037252903, 0.02500000037252903], [0.39375001192092896, 0.2562499940395355, 0.05000000074505806, 0.05000000074505806], [0.40625, 0.2562499940395355, 0.02500000037252903, 0.02500000037252903], [0.40625, 0.2562499940395355, 0.05000000074505806, 0.05000000074505806], [0.41874998807907104, 0.2562499940395355, 0.02500000037252903, 0.02500000037252903], [0.41874998807907104, 0.2562499940395355, 0.05000000074505806, 0.05000000074505806], [0.4312500059604645, 0.2562499940395355, 0.02500000037252903, 0.02500000037252903], [0.4312500059604645, 0.2562499940395355, 0.05000000074505806, 0.05000000074505806], [0.4437499940395355, 0.2562499940395355, 0.02500000037252903, 0.02500000037252903], [0.4437499940395355, 0.2562499940395355, 0.05000000074505806, 0.05000000074505806], [0.45625001192092896, 0.2562499940395355, 0.02500000037252903, 0.02500000037252903], [0.45625001192092896, 0.2562499940395355, 0.05000000074505806, 0.05000000074505806], [0.46875, 0.2562499940395355, 0.02500000037252903, 0.02500000037252903], [0.46875, 0.2562499940395355, 0.05000000074505806, 0.05000000074505806], [0.48124998807907104, 0.2562499940395355, 0.02500000037252903, 0.02500000037252903], [0.48124998807907104, 0.2562499940395355, 0.05000000074505806, 0.05000000074505806], [0.4937500059604645, 0.2562499940395355, 0.02500000037252903, 0.02500000037252903], [0.4937500059604645, 0.2562499940395355, 0.05000000074505806, 0.05000000074505806], [0.5062500238418579, 0.2562499940395355, 0.02500000037252903, 0.02500000037252903], [0.5062500238418579, 0.2562499940395355, 0.05000000074505806, 0.05000000074505806], [0.518750011920929, 0.2562499940395355, 0.02500000037252903, 0.02500000037252903], [0.518750011920929, 0.2562499940395355, 0.05000000074505806, 0.05000000074505806], [0.53125, 0.2562499940395355, 0.02500000037252903, 0.02500000037252903], [0.53125, 0.2562499940395355, 0.05000000074505806, 0.05000000074505806], [0.543749988079071, 0.2562499940395355, 0.02500000037252903, 0.02500000037252903], [0.543749988079071, 0.2562499940395355, 0.05000000074505806, 0.05000000074505806], [0.5562499761581421, 0.2562499940395355, 0.02500000037252903, 0.02500000037252903], [0.5562499761581421, 0.2562499940395355, 0.05000000074505806, 0.05000000074505806], [0.5687500238418579, 0.2562499940395355, 0.02500000037252903, 0.02500000037252903], [0.5687500238418579, 0.2562499940395355, 0.05000000074505806, 0.05000000074505806], [0.581250011920929, 0.2562499940395355, 0.02500000037252903, 0.02500000037252903], [0.581250011920929, 0.2562499940395355, 0.05000000074505806, 0.05000000074505806], [0.59375, 0.2562499940395355, 0.02500000037252903, 0.02500000037252903], [0.59375, 0.2562499940395355, 0.05000000074505806, 0.05000000074505806], [0.606249988079071, 0.2562499940395355, 0.02500000037252903, 0.02500000037252903], [0.606249988079071, 0.2562499940395355, 0.05000000074505806, 0.05000000074505806], [0.6187499761581421, 0.2562499940395355, 0.02500000037252903, 0.02500000037252903], [0.6187499761581421, 0.2562499940395355, 0.05000000074505806, 0.05000000074505806], [0.6312500238418579, 0.2562499940395355, 0.02500000037252903, 0.02500000037252903], [0.6312500238418579, 0.2562499940395355, 0.05000000074505806, 0.05000000074505806], [0.643750011920929, 0.2562499940395355, 0.02500000037252903, 0.02500000037252903], [0.643750011920929, 0.2562499940395355, 0.05000000074505806, 0.05000000074505806], [0.65625, 0.2562499940395355, 0.02500000037252903, 0.02500000037252903], [0.65625, 0.2562499940395355, 0.05000000074505806, 0.05000000074505806], [0.668749988079071, 0.2562499940395355, 0.02500000037252903, 0.02500000037252903], [0.668749988079071, 0.2562499940395355, 0.05000000074505806, 0.05000000074505806], [0.6812499761581421, 0.2562499940395355, 0.02500000037252903, 0.02500000037252903], [0.6812499761581421, 0.2562499940395355, 0.05000000074505806, 0.05000000074505806], [0.6937500238418579, 0.2562499940395355, 0.02500000037252903, 0.02500000037252903], [0.6937500238418579, 0.2562499940395355, 0.05000000074505806, 0.05000000074505806], [0.706250011920929, 0.2562499940395355, 0.02500000037252903, 0.02500000037252903], [0.706250011920929, 0.2562499940395355, 0.05000000074505806, 0.05000000074505806], [0.71875, 0.2562499940395355, 0.02500000037252903, 0.02500000037252903], [0.71875, 0.2562499940395355, 0.05000000074505806, 0.05000000074505806], [0.731249988079071, 0.2562499940395355, 0.02500000037252903, 0.02500000037252903], [0.731249988079071, 0.2562499940395355, 0.05000000074505806, 0.05000000074505806], [0.7437499761581421, 0.2562499940395355, 0.02500000037252903, 0.02500000037252903], [0.7437499761581421, 0.2562499940395355, 0.05000000074505806, 0.05000000074505806], [0.7562500238418579, 0.2562499940395355, 0.02500000037252903, 0.02500000037252903], [0.7562500238418579, 0.2562499940395355, 0.05000000074505806, 0.05000000074505806], [0.768750011920929, 0.2562499940395355, 0.02500000037252903, 0.02500000037252903], [0.768750011920929, 0.2562499940395355, 0.05000000074505806, 0.05000000074505806], [0.78125, 0.2562499940395355, 0.02500000037252903, 0.02500000037252903], [0.78125, 0.2562499940395355, 0.05000000074505806, 0.05000000074505806], [0.793749988079071, 0.2562499940395355, 0.02500000037252903, 0.02500000037252903], [0.793749988079071, 0.2562499940395355, 0.05000000074505806, 0.05000000074505806], [0.8062499761581421, 0.2562499940395355, 0.02500000037252903, 0.02500000037252903], [0.8062499761581421, 0.2562499940395355, 0.05000000074505806, 0.05000000074505806], [0.8187500238418579, 0.2562499940395355, 0.02500000037252903, 0.02500000037252903], [0.8187500238418579, 0.2562499940395355, 0.05000000074505806, 0.05000000074505806], [0.831250011920929, 0.2562499940395355, 0.02500000037252903, 0.02500000037252903], [0.831250011920929, 0.2562499940395355, 0.05000000074505806, 0.05000000074505806], [0.84375, 0.2562499940395355, 0.02500000037252903, 0.02500000037252903], [0.84375, 0.2562499940395355, 0.05000000074505806, 0.05000000074505806], [0.856249988079071, 0.2562499940395355, 0.02500000037252903, 0.02500000037252903], [0.856249988079071, 0.2562499940395355, 0.05000000074505806, 0.05000000074505806], [0.8687499761581421, 0.2562499940395355, 0.02500000037252903, 0.02500000037252903], [0.8687499761581421, 0.2562499940395355, 0.05000000074505806, 0.05000000074505806], [0.8812500238418579, 0.2562499940395355, 0.02500000037252903, 0.02500000037252903], [0.8812500238418579, 0.2562499940395355, 0.05000000074505806, 0.05000000074505806], [0.893750011920929, 0.2562499940395355, 0.02500000037252903, 0.02500000037252903], [0.893750011920929, 0.2562499940395355, 0.05000000074505806, 0.05000000074505806], [0.90625, 0.2562499940395355, 0.02500000037252903, 0.02500000037252903], [0.90625, 0.2562499940395355, 0.05000000074505806, 0.05000000074505806], [0.918749988079071, 0.2562499940395355, 0.02500000037252903, 0.02500000037252903], [0.918749988079071, 0.2562499940395355, 0.05000000074505806, 0.05000000074505806], [0.9312499761581421, 0.2562499940395355, 0.02500000037252903, 0.02500000037252903], [0.9312499761581421, 0.2562499940395355, 0.05000000074505806, 0.05000000074505806], [0.9437500238418579, 0.2562499940395355, 0.02500000037252903, 0.02500000037252903], [0.9437500238418579, 0.2562499940395355, 0.05000000074505806, 0.05000000074505806], [0.956250011920929, 0.2562499940395355, 0.02500000037252903, 0.02500000037252903], [0.956250011920929, 0.2562499940395355, 0.05000000074505806, 0.05000000074505806], [0.96875, 0.2562499940395355, 0.02500000037252903, 0.02500000037252903], [0.96875, 0.2562499940395355, 0.05000000074505806, 0.05000000074505806], [0.981249988079071, 0.2562499940395355, 0.02500000037252903, 0.02500000037252903], [0.981249988079071, 0.2562499940395355, 0.05000000074505806, 0.05000000074505806], [0.9937499761581421, 0.2562499940395355, 0.02500000037252903, 0.02500000037252903], [0.9937499761581421, 0.2562499940395355, 0.05000000074505806, 0.05000000074505806], [0.0062500000931322575, 0.26875001192092896, 0.02500000037252903, 0.02500000037252903], [0.0062500000931322575, 0.26875001192092896, 0.05000000074505806, 0.05000000074505806], [0.01875000074505806, 0.26875001192092896, 0.02500000037252903, 0.02500000037252903], [0.01875000074505806, 0.26875001192092896, 0.05000000074505806, 0.05000000074505806], [0.03125, 0.26875001192092896, 0.02500000037252903, 0.02500000037252903], [0.03125, 0.26875001192092896, 0.05000000074505806, 0.05000000074505806], [0.04374999925494194, 0.26875001192092896, 0.02500000037252903, 0.02500000037252903], [0.04374999925494194, 0.26875001192092896, 0.05000000074505806, 0.05000000074505806], [0.05624999850988388, 0.26875001192092896, 0.02500000037252903, 0.02500000037252903], [0.05624999850988388, 0.26875001192092896, 0.05000000074505806, 0.05000000074505806], [0.06875000149011612, 0.26875001192092896, 0.02500000037252903, 0.02500000037252903], [0.06875000149011612, 0.26875001192092896, 0.05000000074505806, 0.05000000074505806], [0.08124999701976776, 0.26875001192092896, 0.02500000037252903, 0.02500000037252903], [0.08124999701976776, 0.26875001192092896, 0.05000000074505806, 0.05000000074505806], [0.09375, 0.26875001192092896, 0.02500000037252903, 0.02500000037252903], [0.09375, 0.26875001192092896, 0.05000000074505806, 0.05000000074505806], [0.10625000298023224, 0.26875001192092896, 0.02500000037252903, 0.02500000037252903], [0.10625000298023224, 0.26875001192092896, 0.05000000074505806, 0.05000000074505806], [0.11874999850988388, 0.26875001192092896, 0.02500000037252903, 0.02500000037252903], [0.11874999850988388, 0.26875001192092896, 0.05000000074505806, 0.05000000074505806], [0.13124999403953552, 0.26875001192092896, 0.02500000037252903, 0.02500000037252903], [0.13124999403953552, 0.26875001192092896, 0.05000000074505806, 0.05000000074505806], [0.14374999701976776, 0.26875001192092896, 0.02500000037252903, 0.02500000037252903], [0.14374999701976776, 0.26875001192092896, 0.05000000074505806, 0.05000000074505806], [0.15625, 0.26875001192092896, 0.02500000037252903, 0.02500000037252903], [0.15625, 0.26875001192092896, 0.05000000074505806, 0.05000000074505806], [0.16875000298023224, 0.26875001192092896, 0.02500000037252903, 0.02500000037252903], [0.16875000298023224, 0.26875001192092896, 0.05000000074505806, 0.05000000074505806], [0.18125000596046448, 0.26875001192092896, 0.02500000037252903, 0.02500000037252903], [0.18125000596046448, 0.26875001192092896, 0.05000000074505806, 0.05000000074505806], [0.19374999403953552, 0.26875001192092896, 0.02500000037252903, 0.02500000037252903], [0.19374999403953552, 0.26875001192092896, 0.05000000074505806, 0.05000000074505806], [0.20624999701976776, 0.26875001192092896, 0.02500000037252903, 0.02500000037252903], [0.20624999701976776, 0.26875001192092896, 0.05000000074505806, 0.05000000074505806], [0.21875, 0.26875001192092896, 0.02500000037252903, 0.02500000037252903], [0.21875, 0.26875001192092896, 0.05000000074505806, 0.05000000074505806], [0.23125000298023224, 0.26875001192092896, 0.02500000037252903, 0.02500000037252903], [0.23125000298023224, 0.26875001192092896, 0.05000000074505806, 0.05000000074505806], [0.24375000596046448, 0.26875001192092896, 0.02500000037252903, 0.02500000037252903], [0.24375000596046448, 0.26875001192092896, 0.05000000074505806, 0.05000000074505806], [0.2562499940395355, 0.26875001192092896, 0.02500000037252903, 0.02500000037252903], [0.2562499940395355, 0.26875001192092896, 0.05000000074505806, 0.05000000074505806], [0.26875001192092896, 0.26875001192092896, 0.02500000037252903, 0.02500000037252903], [0.26875001192092896, 0.26875001192092896, 0.05000000074505806, 0.05000000074505806], [0.28125, 0.26875001192092896, 0.02500000037252903, 0.02500000037252903], [0.28125, 0.26875001192092896, 0.05000000074505806, 0.05000000074505806], [0.29374998807907104, 0.26875001192092896, 0.02500000037252903, 0.02500000037252903], [0.29374998807907104, 0.26875001192092896, 0.05000000074505806, 0.05000000074505806], [0.3062500059604645, 0.26875001192092896, 0.02500000037252903, 0.02500000037252903], [0.3062500059604645, 0.26875001192092896, 0.05000000074505806, 0.05000000074505806], [0.3187499940395355, 0.26875001192092896, 0.02500000037252903, 0.02500000037252903], [0.3187499940395355, 0.26875001192092896, 0.05000000074505806, 0.05000000074505806], [0.33125001192092896, 0.26875001192092896, 0.02500000037252903, 0.02500000037252903], [0.33125001192092896, 0.26875001192092896, 0.05000000074505806, 0.05000000074505806], [0.34375, 0.26875001192092896, 0.02500000037252903, 0.02500000037252903], [0.34375, 0.26875001192092896, 0.05000000074505806, 0.05000000074505806], [0.35624998807907104, 0.26875001192092896, 0.02500000037252903, 0.02500000037252903], [0.35624998807907104, 0.26875001192092896, 0.05000000074505806, 0.05000000074505806], [0.3687500059604645, 0.26875001192092896, 0.02500000037252903, 0.02500000037252903], [0.3687500059604645, 0.26875001192092896, 0.05000000074505806, 0.05000000074505806], [0.3812499940395355, 0.26875001192092896, 0.02500000037252903, 0.02500000037252903], [0.3812499940395355, 0.26875001192092896, 0.05000000074505806, 0.05000000074505806], [0.39375001192092896, 0.26875001192092896, 0.02500000037252903, 0.02500000037252903], [0.39375001192092896, 0.26875001192092896, 0.05000000074505806, 0.05000000074505806], [0.40625, 0.26875001192092896, 0.02500000037252903, 0.02500000037252903], [0.40625, 0.26875001192092896, 0.05000000074505806, 0.05000000074505806], [0.41874998807907104, 0.26875001192092896, 0.02500000037252903, 0.02500000037252903], [0.41874998807907104, 0.26875001192092896, 0.05000000074505806, 0.05000000074505806], [0.4312500059604645, 0.26875001192092896, 0.02500000037252903, 0.02500000037252903], [0.4312500059604645, 0.26875001192092896, 0.05000000074505806, 0.05000000074505806], [0.4437499940395355, 0.26875001192092896, 0.02500000037252903, 0.02500000037252903], [0.4437499940395355, 0.26875001192092896, 0.05000000074505806, 0.05000000074505806], [0.45625001192092896, 0.26875001192092896, 0.02500000037252903, 0.02500000037252903], [0.45625001192092896, 0.26875001192092896, 0.05000000074505806, 0.05000000074505806], [0.46875, 0.26875001192092896, 0.02500000037252903, 0.02500000037252903], [0.46875, 0.26875001192092896, 0.05000000074505806, 0.05000000074505806], [0.48124998807907104, 0.26875001192092896, 0.02500000037252903, 0.02500000037252903], [0.48124998807907104, 0.26875001192092896, 0.05000000074505806, 0.05000000074505806], [0.4937500059604645, 0.26875001192092896, 0.02500000037252903, 0.02500000037252903], [0.4937500059604645, 0.26875001192092896, 0.05000000074505806, 0.05000000074505806], [0.5062500238418579, 0.26875001192092896, 0.02500000037252903, 0.02500000037252903], [0.5062500238418579, 0.26875001192092896, 0.05000000074505806, 0.05000000074505806], [0.518750011920929, 0.26875001192092896, 0.02500000037252903, 0.02500000037252903], [0.518750011920929, 0.26875001192092896, 0.05000000074505806, 0.05000000074505806], [0.53125, 0.26875001192092896, 0.02500000037252903, 0.02500000037252903], [0.53125, 0.26875001192092896, 0.05000000074505806, 0.05000000074505806], [0.543749988079071, 0.26875001192092896, 0.02500000037252903, 0.02500000037252903], [0.543749988079071, 0.26875001192092896, 0.05000000074505806, 0.05000000074505806], [0.5562499761581421, 0.26875001192092896, 0.02500000037252903, 0.02500000037252903], [0.5562499761581421, 0.26875001192092896, 0.05000000074505806, 0.05000000074505806], [0.5687500238418579, 0.26875001192092896, 0.02500000037252903, 0.02500000037252903], [0.5687500238418579, 0.26875001192092896, 0.05000000074505806, 0.05000000074505806], [0.581250011920929, 0.26875001192092896, 0.02500000037252903, 0.02500000037252903], [0.581250011920929, 0.26875001192092896, 0.05000000074505806, 0.05000000074505806], [0.59375, 0.26875001192092896, 0.02500000037252903, 0.02500000037252903], [0.59375, 0.26875001192092896, 0.05000000074505806, 0.05000000074505806], [0.606249988079071, 0.26875001192092896, 0.02500000037252903, 0.02500000037252903], [0.606249988079071, 0.26875001192092896, 0.05000000074505806, 0.05000000074505806], [0.6187499761581421, 0.26875001192092896, 0.02500000037252903, 0.02500000037252903], [0.6187499761581421, 0.26875001192092896, 0.05000000074505806, 0.05000000074505806], [0.6312500238418579, 0.26875001192092896, 0.02500000037252903, 0.02500000037252903], [0.6312500238418579, 0.26875001192092896, 0.05000000074505806, 0.05000000074505806], [0.643750011920929, 0.26875001192092896, 0.02500000037252903, 0.02500000037252903], [0.643750011920929, 0.26875001192092896, 0.05000000074505806, 0.05000000074505806], [0.65625, 0.26875001192092896, 0.02500000037252903, 0.02500000037252903], [0.65625, 0.26875001192092896, 0.05000000074505806, 0.05000000074505806], [0.668749988079071, 0.26875001192092896, 0.02500000037252903, 0.02500000037252903], [0.668749988079071, 0.26875001192092896, 0.05000000074505806, 0.05000000074505806], [0.6812499761581421, 0.26875001192092896, 0.02500000037252903, 0.02500000037252903], [0.6812499761581421, 0.26875001192092896, 0.05000000074505806, 0.05000000074505806], [0.6937500238418579, 0.26875001192092896, 0.02500000037252903, 0.02500000037252903], [0.6937500238418579, 0.26875001192092896, 0.05000000074505806, 0.05000000074505806], [0.706250011920929, 0.26875001192092896, 0.02500000037252903, 0.02500000037252903], [0.706250011920929, 0.26875001192092896, 0.05000000074505806, 0.05000000074505806], [0.71875, 0.26875001192092896, 0.02500000037252903, 0.02500000037252903], [0.71875, 0.26875001192092896, 0.05000000074505806, 0.05000000074505806], [0.731249988079071, 0.26875001192092896, 0.02500000037252903, 0.02500000037252903], [0.731249988079071, 0.26875001192092896, 0.05000000074505806, 0.05000000074505806], [0.7437499761581421, 0.26875001192092896, 0.02500000037252903, 0.02500000037252903], [0.7437499761581421, 0.26875001192092896, 0.05000000074505806, 0.05000000074505806], [0.7562500238418579, 0.26875001192092896, 0.02500000037252903, 0.02500000037252903], [0.7562500238418579, 0.26875001192092896, 0.05000000074505806, 0.05000000074505806], [0.768750011920929, 0.26875001192092896, 0.02500000037252903, 0.02500000037252903], [0.768750011920929, 0.26875001192092896, 0.05000000074505806, 0.05000000074505806], [0.78125, 0.26875001192092896, 0.02500000037252903, 0.02500000037252903], [0.78125, 0.26875001192092896, 0.05000000074505806, 0.05000000074505806], [0.793749988079071, 0.26875001192092896, 0.02500000037252903, 0.02500000037252903], [0.793749988079071, 0.26875001192092896, 0.05000000074505806, 0.05000000074505806], [0.8062499761581421, 0.26875001192092896, 0.02500000037252903, 0.02500000037252903], [0.8062499761581421, 0.26875001192092896, 0.05000000074505806, 0.05000000074505806], [0.8187500238418579, 0.26875001192092896, 0.02500000037252903, 0.02500000037252903], [0.8187500238418579, 0.26875001192092896, 0.05000000074505806, 0.05000000074505806], [0.831250011920929, 0.26875001192092896, 0.02500000037252903, 0.02500000037252903], [0.831250011920929, 0.26875001192092896, 0.05000000074505806, 0.05000000074505806], [0.84375, 0.26875001192092896, 0.02500000037252903, 0.02500000037252903], [0.84375, 0.26875001192092896, 0.05000000074505806, 0.05000000074505806], [0.856249988079071, 0.26875001192092896, 0.02500000037252903, 0.02500000037252903], [0.856249988079071, 0.26875001192092896, 0.05000000074505806, 0.05000000074505806], [0.8687499761581421, 0.26875001192092896, 0.02500000037252903, 0.02500000037252903], [0.8687499761581421, 0.26875001192092896, 0.05000000074505806, 0.05000000074505806], [0.8812500238418579, 0.26875001192092896, 0.02500000037252903, 0.02500000037252903], [0.8812500238418579, 0.26875001192092896, 0.05000000074505806, 0.05000000074505806], [0.893750011920929, 0.26875001192092896, 0.02500000037252903, 0.02500000037252903], [0.893750011920929, 0.26875001192092896, 0.05000000074505806, 0.05000000074505806], [0.90625, 0.26875001192092896, 0.02500000037252903, 0.02500000037252903], [0.90625, 0.26875001192092896, 0.05000000074505806, 0.05000000074505806], [0.918749988079071, 0.26875001192092896, 0.02500000037252903, 0.02500000037252903], [0.918749988079071, 0.26875001192092896, 0.05000000074505806, 0.05000000074505806], [0.9312499761581421, 0.26875001192092896, 0.02500000037252903, 0.02500000037252903], [0.9312499761581421, 0.26875001192092896, 0.05000000074505806, 0.05000000074505806], [0.9437500238418579, 0.26875001192092896, 0.02500000037252903, 0.02500000037252903], [0.9437500238418579, 0.26875001192092896, 0.05000000074505806, 0.05000000074505806], [0.956250011920929, 0.26875001192092896, 0.02500000037252903, 0.02500000037252903], [0.956250011920929, 0.26875001192092896, 0.05000000074505806, 0.05000000074505806], [0.96875, 0.26875001192092896, 0.02500000037252903, 0.02500000037252903], [0.96875, 0.26875001192092896, 0.05000000074505806, 0.05000000074505806], [0.981249988079071, 0.26875001192092896, 0.02500000037252903, 0.02500000037252903], [0.981249988079071, 0.26875001192092896, 0.05000000074505806, 0.05000000074505806], [0.9937499761581421, 0.26875001192092896, 0.02500000037252903, 0.02500000037252903], [0.9937499761581421, 0.26875001192092896, 0.05000000074505806, 0.05000000074505806], [0.0062500000931322575, 0.28125, 0.02500000037252903, 0.02500000037252903], [0.0062500000931322575, 0.28125, 0.05000000074505806, 0.05000000074505806], [0.01875000074505806, 0.28125, 0.02500000037252903, 0.02500000037252903], [0.01875000074505806, 0.28125, 0.05000000074505806, 0.05000000074505806], [0.03125, 0.28125, 0.02500000037252903, 0.02500000037252903], [0.03125, 0.28125, 0.05000000074505806, 0.05000000074505806], [0.04374999925494194, 0.28125, 0.02500000037252903, 0.02500000037252903], [0.04374999925494194, 0.28125, 0.05000000074505806, 0.05000000074505806], [0.05624999850988388, 0.28125, 0.02500000037252903, 0.02500000037252903], [0.05624999850988388, 0.28125, 0.05000000074505806, 0.05000000074505806], [0.06875000149011612, 0.28125, 0.02500000037252903, 0.02500000037252903], [0.06875000149011612, 0.28125, 0.05000000074505806, 0.05000000074505806], [0.08124999701976776, 0.28125, 0.02500000037252903, 0.02500000037252903], [0.08124999701976776, 0.28125, 0.05000000074505806, 0.05000000074505806], [0.09375, 0.28125, 0.02500000037252903, 0.02500000037252903], [0.09375, 0.28125, 0.05000000074505806, 0.05000000074505806], [0.10625000298023224, 0.28125, 0.02500000037252903, 0.02500000037252903], [0.10625000298023224, 0.28125, 0.05000000074505806, 0.05000000074505806], [0.11874999850988388, 0.28125, 0.02500000037252903, 0.02500000037252903], [0.11874999850988388, 0.28125, 0.05000000074505806, 0.05000000074505806], [0.13124999403953552, 0.28125, 0.02500000037252903, 0.02500000037252903], [0.13124999403953552, 0.28125, 0.05000000074505806, 0.05000000074505806], [0.14374999701976776, 0.28125, 0.02500000037252903, 0.02500000037252903], [0.14374999701976776, 0.28125, 0.05000000074505806, 0.05000000074505806], [0.15625, 0.28125, 0.02500000037252903, 0.02500000037252903], [0.15625, 0.28125, 0.05000000074505806, 0.05000000074505806], [0.16875000298023224, 0.28125, 0.02500000037252903, 0.02500000037252903], [0.16875000298023224, 0.28125, 0.05000000074505806, 0.05000000074505806], [0.18125000596046448, 0.28125, 0.02500000037252903, 0.02500000037252903], [0.18125000596046448, 0.28125, 0.05000000074505806, 0.05000000074505806], [0.19374999403953552, 0.28125, 0.02500000037252903, 0.02500000037252903], [0.19374999403953552, 0.28125, 0.05000000074505806, 0.05000000074505806], [0.20624999701976776, 0.28125, 0.02500000037252903, 0.02500000037252903], [0.20624999701976776, 0.28125, 0.05000000074505806, 0.05000000074505806], [0.21875, 0.28125, 0.02500000037252903, 0.02500000037252903], [0.21875, 0.28125, 0.05000000074505806, 0.05000000074505806], [0.23125000298023224, 0.28125, 0.02500000037252903, 0.02500000037252903], [0.23125000298023224, 0.28125, 0.05000000074505806, 0.05000000074505806], [0.24375000596046448, 0.28125, 0.02500000037252903, 0.02500000037252903], [0.24375000596046448, 0.28125, 0.05000000074505806, 0.05000000074505806], [0.2562499940395355, 0.28125, 0.02500000037252903, 0.02500000037252903], [0.2562499940395355, 0.28125, 0.05000000074505806, 0.05000000074505806], [0.26875001192092896, 0.28125, 0.02500000037252903, 0.02500000037252903], [0.26875001192092896, 0.28125, 0.05000000074505806, 0.05000000074505806], [0.28125, 0.28125, 0.02500000037252903, 0.02500000037252903], [0.28125, 0.28125, 0.05000000074505806, 0.05000000074505806], [0.29374998807907104, 0.28125, 0.02500000037252903, 0.02500000037252903], [0.29374998807907104, 0.28125, 0.05000000074505806, 0.05000000074505806], [0.3062500059604645, 0.28125, 0.02500000037252903, 0.02500000037252903], [0.3062500059604645, 0.28125, 0.05000000074505806, 0.05000000074505806], [0.3187499940395355, 0.28125, 0.02500000037252903, 0.02500000037252903], [0.3187499940395355, 0.28125, 0.05000000074505806, 0.05000000074505806], [0.33125001192092896, 0.28125, 0.02500000037252903, 0.02500000037252903], [0.33125001192092896, 0.28125, 0.05000000074505806, 0.05000000074505806], [0.34375, 0.28125, 0.02500000037252903, 0.02500000037252903], [0.34375, 0.28125, 0.05000000074505806, 0.05000000074505806], [0.35624998807907104, 0.28125, 0.02500000037252903, 0.02500000037252903], [0.35624998807907104, 0.28125, 0.05000000074505806, 0.05000000074505806], [0.3687500059604645, 0.28125, 0.02500000037252903, 0.02500000037252903], [0.3687500059604645, 0.28125, 0.05000000074505806, 0.05000000074505806], [0.3812499940395355, 0.28125, 0.02500000037252903, 0.02500000037252903], [0.3812499940395355, 0.28125, 0.05000000074505806, 0.05000000074505806], [0.39375001192092896, 0.28125, 0.02500000037252903, 0.02500000037252903], [0.39375001192092896, 0.28125, 0.05000000074505806, 0.05000000074505806], [0.40625, 0.28125, 0.02500000037252903, 0.02500000037252903], [0.40625, 0.28125, 0.05000000074505806, 0.05000000074505806], [0.41874998807907104, 0.28125, 0.02500000037252903, 0.02500000037252903], [0.41874998807907104, 0.28125, 0.05000000074505806, 0.05000000074505806], [0.4312500059604645, 0.28125, 0.02500000037252903, 0.02500000037252903], [0.4312500059604645, 0.28125, 0.05000000074505806, 0.05000000074505806], [0.4437499940395355, 0.28125, 0.02500000037252903, 0.02500000037252903], [0.4437499940395355, 0.28125, 0.05000000074505806, 0.05000000074505806], [0.45625001192092896, 0.28125, 0.02500000037252903, 0.02500000037252903], [0.45625001192092896, 0.28125, 0.05000000074505806, 0.05000000074505806], [0.46875, 0.28125, 0.02500000037252903, 0.02500000037252903], [0.46875, 0.28125, 0.05000000074505806, 0.05000000074505806], [0.48124998807907104, 0.28125, 0.02500000037252903, 0.02500000037252903], [0.48124998807907104, 0.28125, 0.05000000074505806, 0.05000000074505806], [0.4937500059604645, 0.28125, 0.02500000037252903, 0.02500000037252903], [0.4937500059604645, 0.28125, 0.05000000074505806, 0.05000000074505806], [0.5062500238418579, 0.28125, 0.02500000037252903, 0.02500000037252903], [0.5062500238418579, 0.28125, 0.05000000074505806, 0.05000000074505806], [0.518750011920929, 0.28125, 0.02500000037252903, 0.02500000037252903], [0.518750011920929, 0.28125, 0.05000000074505806, 0.05000000074505806], [0.53125, 0.28125, 0.02500000037252903, 0.02500000037252903], [0.53125, 0.28125, 0.05000000074505806, 0.05000000074505806], [0.543749988079071, 0.28125, 0.02500000037252903, 0.02500000037252903], [0.543749988079071, 0.28125, 0.05000000074505806, 0.05000000074505806], [0.5562499761581421, 0.28125, 0.02500000037252903, 0.02500000037252903], [0.5562499761581421, 0.28125, 0.05000000074505806, 0.05000000074505806], [0.5687500238418579, 0.28125, 0.02500000037252903, 0.02500000037252903], [0.5687500238418579, 0.28125, 0.05000000074505806, 0.05000000074505806], [0.581250011920929, 0.28125, 0.02500000037252903, 0.02500000037252903], [0.581250011920929, 0.28125, 0.05000000074505806, 0.05000000074505806], [0.59375, 0.28125, 0.02500000037252903, 0.02500000037252903], [0.59375, 0.28125, 0.05000000074505806, 0.05000000074505806], [0.606249988079071, 0.28125, 0.02500000037252903, 0.02500000037252903], [0.606249988079071, 0.28125, 0.05000000074505806, 0.05000000074505806], [0.6187499761581421, 0.28125, 0.02500000037252903, 0.02500000037252903], [0.6187499761581421, 0.28125, 0.05000000074505806, 0.05000000074505806], [0.6312500238418579, 0.28125, 0.02500000037252903, 0.02500000037252903], [0.6312500238418579, 0.28125, 0.05000000074505806, 0.05000000074505806], [0.643750011920929, 0.28125, 0.02500000037252903, 0.02500000037252903], [0.643750011920929, 0.28125, 0.05000000074505806, 0.05000000074505806], [0.65625, 0.28125, 0.02500000037252903, 0.02500000037252903], [0.65625, 0.28125, 0.05000000074505806, 0.05000000074505806], [0.668749988079071, 0.28125, 0.02500000037252903, 0.02500000037252903], [0.668749988079071, 0.28125, 0.05000000074505806, 0.05000000074505806], [0.6812499761581421, 0.28125, 0.02500000037252903, 0.02500000037252903], [0.6812499761581421, 0.28125, 0.05000000074505806, 0.05000000074505806], [0.6937500238418579, 0.28125, 0.02500000037252903, 0.02500000037252903], [0.6937500238418579, 0.28125, 0.05000000074505806, 0.05000000074505806], [0.706250011920929, 0.28125, 0.02500000037252903, 0.02500000037252903], [0.706250011920929, 0.28125, 0.05000000074505806, 0.05000000074505806], [0.71875, 0.28125, 0.02500000037252903, 0.02500000037252903], [0.71875, 0.28125, 0.05000000074505806, 0.05000000074505806], [0.731249988079071, 0.28125, 0.02500000037252903, 0.02500000037252903], [0.731249988079071, 0.28125, 0.05000000074505806, 0.05000000074505806], [0.7437499761581421, 0.28125, 0.02500000037252903, 0.02500000037252903], [0.7437499761581421, 0.28125, 0.05000000074505806, 0.05000000074505806], [0.7562500238418579, 0.28125, 0.02500000037252903, 0.02500000037252903], [0.7562500238418579, 0.28125, 0.05000000074505806, 0.05000000074505806], [0.768750011920929, 0.28125, 0.02500000037252903, 0.02500000037252903], [0.768750011920929, 0.28125, 0.05000000074505806, 0.05000000074505806], [0.78125, 0.28125, 0.02500000037252903, 0.02500000037252903], [0.78125, 0.28125, 0.05000000074505806, 0.05000000074505806], [0.793749988079071, 0.28125, 0.02500000037252903, 0.02500000037252903], [0.793749988079071, 0.28125, 0.05000000074505806, 0.05000000074505806], [0.8062499761581421, 0.28125, 0.02500000037252903, 0.02500000037252903], [0.8062499761581421, 0.28125, 0.05000000074505806, 0.05000000074505806], [0.8187500238418579, 0.28125, 0.02500000037252903, 0.02500000037252903], [0.8187500238418579, 0.28125, 0.05000000074505806, 0.05000000074505806], [0.831250011920929, 0.28125, 0.02500000037252903, 0.02500000037252903], [0.831250011920929, 0.28125, 0.05000000074505806, 0.05000000074505806], [0.84375, 0.28125, 0.02500000037252903, 0.02500000037252903], [0.84375, 0.28125, 0.05000000074505806, 0.05000000074505806], [0.856249988079071, 0.28125, 0.02500000037252903, 0.02500000037252903], [0.856249988079071, 0.28125, 0.05000000074505806, 0.05000000074505806], [0.8687499761581421, 0.28125, 0.02500000037252903, 0.02500000037252903], [0.8687499761581421, 0.28125, 0.05000000074505806, 0.05000000074505806], [0.8812500238418579, 0.28125, 0.02500000037252903, 0.02500000037252903], [0.8812500238418579, 0.28125, 0.05000000074505806, 0.05000000074505806], [0.893750011920929, 0.28125, 0.02500000037252903, 0.02500000037252903], [0.893750011920929, 0.28125, 0.05000000074505806, 0.05000000074505806], [0.90625, 0.28125, 0.02500000037252903, 0.02500000037252903], [0.90625, 0.28125, 0.05000000074505806, 0.05000000074505806], [0.918749988079071, 0.28125, 0.02500000037252903, 0.02500000037252903], [0.918749988079071, 0.28125, 0.05000000074505806, 0.05000000074505806], [0.9312499761581421, 0.28125, 0.02500000037252903, 0.02500000037252903], [0.9312499761581421, 0.28125, 0.05000000074505806, 0.05000000074505806], [0.9437500238418579, 0.28125, 0.02500000037252903, 0.02500000037252903], [0.9437500238418579, 0.28125, 0.05000000074505806, 0.05000000074505806], [0.956250011920929, 0.28125, 0.02500000037252903, 0.02500000037252903], [0.956250011920929, 0.28125, 0.05000000074505806, 0.05000000074505806], [0.96875, 0.28125, 0.02500000037252903, 0.02500000037252903], [0.96875, 0.28125, 0.05000000074505806, 0.05000000074505806], [0.981249988079071, 0.28125, 0.02500000037252903, 0.02500000037252903], [0.981249988079071, 0.28125, 0.05000000074505806, 0.05000000074505806], [0.9937499761581421, 0.28125, 0.02500000037252903, 0.02500000037252903], [0.9937499761581421, 0.28125, 0.05000000074505806, 0.05000000074505806], [0.0062500000931322575, 0.29374998807907104, 0.02500000037252903, 0.02500000037252903], [0.0062500000931322575, 0.29374998807907104, 0.05000000074505806, 0.05000000074505806], [0.01875000074505806, 0.29374998807907104, 0.02500000037252903, 0.02500000037252903], [0.01875000074505806, 0.29374998807907104, 0.05000000074505806, 0.05000000074505806], [0.03125, 0.29374998807907104, 0.02500000037252903, 0.02500000037252903], [0.03125, 0.29374998807907104, 0.05000000074505806, 0.05000000074505806], [0.04374999925494194, 0.29374998807907104, 0.02500000037252903, 0.02500000037252903], [0.04374999925494194, 0.29374998807907104, 0.05000000074505806, 0.05000000074505806], [0.05624999850988388, 0.29374998807907104, 0.02500000037252903, 0.02500000037252903], [0.05624999850988388, 0.29374998807907104, 0.05000000074505806, 0.05000000074505806], [0.06875000149011612, 0.29374998807907104, 0.02500000037252903, 0.02500000037252903], [0.06875000149011612, 0.29374998807907104, 0.05000000074505806, 0.05000000074505806], [0.08124999701976776, 0.29374998807907104, 0.02500000037252903, 0.02500000037252903], [0.08124999701976776, 0.29374998807907104, 0.05000000074505806, 0.05000000074505806], [0.09375, 0.29374998807907104, 0.02500000037252903, 0.02500000037252903], [0.09375, 0.29374998807907104, 0.05000000074505806, 0.05000000074505806], [0.10625000298023224, 0.29374998807907104, 0.02500000037252903, 0.02500000037252903], [0.10625000298023224, 0.29374998807907104, 0.05000000074505806, 0.05000000074505806], [0.11874999850988388, 0.29374998807907104, 0.02500000037252903, 0.02500000037252903], [0.11874999850988388, 0.29374998807907104, 0.05000000074505806, 0.05000000074505806], [0.13124999403953552, 0.29374998807907104, 0.02500000037252903, 0.02500000037252903], [0.13124999403953552, 0.29374998807907104, 0.05000000074505806, 0.05000000074505806], [0.14374999701976776, 0.29374998807907104, 0.02500000037252903, 0.02500000037252903], [0.14374999701976776, 0.29374998807907104, 0.05000000074505806, 0.05000000074505806], [0.15625, 0.29374998807907104, 0.02500000037252903, 0.02500000037252903], [0.15625, 0.29374998807907104, 0.05000000074505806, 0.05000000074505806], [0.16875000298023224, 0.29374998807907104, 0.02500000037252903, 0.02500000037252903], [0.16875000298023224, 0.29374998807907104, 0.05000000074505806, 0.05000000074505806], [0.18125000596046448, 0.29374998807907104, 0.02500000037252903, 0.02500000037252903], [0.18125000596046448, 0.29374998807907104, 0.05000000074505806, 0.05000000074505806], [0.19374999403953552, 0.29374998807907104, 0.02500000037252903, 0.02500000037252903], [0.19374999403953552, 0.29374998807907104, 0.05000000074505806, 0.05000000074505806], [0.20624999701976776, 0.29374998807907104, 0.02500000037252903, 0.02500000037252903], [0.20624999701976776, 0.29374998807907104, 0.05000000074505806, 0.05000000074505806], [0.21875, 0.29374998807907104, 0.02500000037252903, 0.02500000037252903], [0.21875, 0.29374998807907104, 0.05000000074505806, 0.05000000074505806], [0.23125000298023224, 0.29374998807907104, 0.02500000037252903, 0.02500000037252903], [0.23125000298023224, 0.29374998807907104, 0.05000000074505806, 0.05000000074505806], [0.24375000596046448, 0.29374998807907104, 0.02500000037252903, 0.02500000037252903], [0.24375000596046448, 0.29374998807907104, 0.05000000074505806, 0.05000000074505806], [0.2562499940395355, 0.29374998807907104, 0.02500000037252903, 0.02500000037252903], [0.2562499940395355, 0.29374998807907104, 0.05000000074505806, 0.05000000074505806], [0.26875001192092896, 0.29374998807907104, 0.02500000037252903, 0.02500000037252903], [0.26875001192092896, 0.29374998807907104, 0.05000000074505806, 0.05000000074505806], [0.28125, 0.29374998807907104, 0.02500000037252903, 0.02500000037252903], [0.28125, 0.29374998807907104, 0.05000000074505806, 0.05000000074505806], [0.29374998807907104, 0.29374998807907104, 0.02500000037252903, 0.02500000037252903], [0.29374998807907104, 0.29374998807907104, 0.05000000074505806, 0.05000000074505806], [0.3062500059604645, 0.29374998807907104, 0.02500000037252903, 0.02500000037252903], [0.3062500059604645, 0.29374998807907104, 0.05000000074505806, 0.05000000074505806], [0.3187499940395355, 0.29374998807907104, 0.02500000037252903, 0.02500000037252903], [0.3187499940395355, 0.29374998807907104, 0.05000000074505806, 0.05000000074505806], [0.33125001192092896, 0.29374998807907104, 0.02500000037252903, 0.02500000037252903], [0.33125001192092896, 0.29374998807907104, 0.05000000074505806, 0.05000000074505806], [0.34375, 0.29374998807907104, 0.02500000037252903, 0.02500000037252903], [0.34375, 0.29374998807907104, 0.05000000074505806, 0.05000000074505806], [0.35624998807907104, 0.29374998807907104, 0.02500000037252903, 0.02500000037252903], [0.35624998807907104, 0.29374998807907104, 0.05000000074505806, 0.05000000074505806], [0.3687500059604645, 0.29374998807907104, 0.02500000037252903, 0.02500000037252903], [0.3687500059604645, 0.29374998807907104, 0.05000000074505806, 0.05000000074505806], [0.3812499940395355, 0.29374998807907104, 0.02500000037252903, 0.02500000037252903], [0.3812499940395355, 0.29374998807907104, 0.05000000074505806, 0.05000000074505806], [0.39375001192092896, 0.29374998807907104, 0.02500000037252903, 0.02500000037252903], [0.39375001192092896, 0.29374998807907104, 0.05000000074505806, 0.05000000074505806], [0.40625, 0.29374998807907104, 0.02500000037252903, 0.02500000037252903], [0.40625, 0.29374998807907104, 0.05000000074505806, 0.05000000074505806], [0.41874998807907104, 0.29374998807907104, 0.02500000037252903, 0.02500000037252903], [0.41874998807907104, 0.29374998807907104, 0.05000000074505806, 0.05000000074505806], [0.4312500059604645, 0.29374998807907104, 0.02500000037252903, 0.02500000037252903], [0.4312500059604645, 0.29374998807907104, 0.05000000074505806, 0.05000000074505806], [0.4437499940395355, 0.29374998807907104, 0.02500000037252903, 0.02500000037252903], [0.4437499940395355, 0.29374998807907104, 0.05000000074505806, 0.05000000074505806], [0.45625001192092896, 0.29374998807907104, 0.02500000037252903, 0.02500000037252903], [0.45625001192092896, 0.29374998807907104, 0.05000000074505806, 0.05000000074505806], [0.46875, 0.29374998807907104, 0.02500000037252903, 0.02500000037252903], [0.46875, 0.29374998807907104, 0.05000000074505806, 0.05000000074505806], [0.48124998807907104, 0.29374998807907104, 0.02500000037252903, 0.02500000037252903], [0.48124998807907104, 0.29374998807907104, 0.05000000074505806, 0.05000000074505806], [0.4937500059604645, 0.29374998807907104, 0.02500000037252903, 0.02500000037252903], [0.4937500059604645, 0.29374998807907104, 0.05000000074505806, 0.05000000074505806], [0.5062500238418579, 0.29374998807907104, 0.02500000037252903, 0.02500000037252903], [0.5062500238418579, 0.29374998807907104, 0.05000000074505806, 0.05000000074505806], [0.518750011920929, 0.29374998807907104, 0.02500000037252903, 0.02500000037252903], [0.518750011920929, 0.29374998807907104, 0.05000000074505806, 0.05000000074505806], [0.53125, 0.29374998807907104, 0.02500000037252903, 0.02500000037252903], [0.53125, 0.29374998807907104, 0.05000000074505806, 0.05000000074505806], [0.543749988079071, 0.29374998807907104, 0.02500000037252903, 0.02500000037252903], [0.543749988079071, 0.29374998807907104, 0.05000000074505806, 0.05000000074505806], [0.5562499761581421, 0.29374998807907104, 0.02500000037252903, 0.02500000037252903], [0.5562499761581421, 0.29374998807907104, 0.05000000074505806, 0.05000000074505806], [0.5687500238418579, 0.29374998807907104, 0.02500000037252903, 0.02500000037252903], [0.5687500238418579, 0.29374998807907104, 0.05000000074505806, 0.05000000074505806], [0.581250011920929, 0.29374998807907104, 0.02500000037252903, 0.02500000037252903], [0.581250011920929, 0.29374998807907104, 0.05000000074505806, 0.05000000074505806], [0.59375, 0.29374998807907104, 0.02500000037252903, 0.02500000037252903], [0.59375, 0.29374998807907104, 0.05000000074505806, 0.05000000074505806], [0.606249988079071, 0.29374998807907104, 0.02500000037252903, 0.02500000037252903], [0.606249988079071, 0.29374998807907104, 0.05000000074505806, 0.05000000074505806], [0.6187499761581421, 0.29374998807907104, 0.02500000037252903, 0.02500000037252903], [0.6187499761581421, 0.29374998807907104, 0.05000000074505806, 0.05000000074505806], [0.6312500238418579, 0.29374998807907104, 0.02500000037252903, 0.02500000037252903], [0.6312500238418579, 0.29374998807907104, 0.05000000074505806, 0.05000000074505806], [0.643750011920929, 0.29374998807907104, 0.02500000037252903, 0.02500000037252903], [0.643750011920929, 0.29374998807907104, 0.05000000074505806, 0.05000000074505806], [0.65625, 0.29374998807907104, 0.02500000037252903, 0.02500000037252903], [0.65625, 0.29374998807907104, 0.05000000074505806, 0.05000000074505806], [0.668749988079071, 0.29374998807907104, 0.02500000037252903, 0.02500000037252903], [0.668749988079071, 0.29374998807907104, 0.05000000074505806, 0.05000000074505806], [0.6812499761581421, 0.29374998807907104, 0.02500000037252903, 0.02500000037252903], [0.6812499761581421, 0.29374998807907104, 0.05000000074505806, 0.05000000074505806], [0.6937500238418579, 0.29374998807907104, 0.02500000037252903, 0.02500000037252903], [0.6937500238418579, 0.29374998807907104, 0.05000000074505806, 0.05000000074505806], [0.706250011920929, 0.29374998807907104, 0.02500000037252903, 0.02500000037252903], [0.706250011920929, 0.29374998807907104, 0.05000000074505806, 0.05000000074505806], [0.71875, 0.29374998807907104, 0.02500000037252903, 0.02500000037252903], [0.71875, 0.29374998807907104, 0.05000000074505806, 0.05000000074505806], [0.731249988079071, 0.29374998807907104, 0.02500000037252903, 0.02500000037252903], [0.731249988079071, 0.29374998807907104, 0.05000000074505806, 0.05000000074505806], [0.7437499761581421, 0.29374998807907104, 0.02500000037252903, 0.02500000037252903], [0.7437499761581421, 0.29374998807907104, 0.05000000074505806, 0.05000000074505806], [0.7562500238418579, 0.29374998807907104, 0.02500000037252903, 0.02500000037252903], [0.7562500238418579, 0.29374998807907104, 0.05000000074505806, 0.05000000074505806], [0.768750011920929, 0.29374998807907104, 0.02500000037252903, 0.02500000037252903], [0.768750011920929, 0.29374998807907104, 0.05000000074505806, 0.05000000074505806], [0.78125, 0.29374998807907104, 0.02500000037252903, 0.02500000037252903], [0.78125, 0.29374998807907104, 0.05000000074505806, 0.05000000074505806], [0.793749988079071, 0.29374998807907104, 0.02500000037252903, 0.02500000037252903], [0.793749988079071, 0.29374998807907104, 0.05000000074505806, 0.05000000074505806], [0.8062499761581421, 0.29374998807907104, 0.02500000037252903, 0.02500000037252903], [0.8062499761581421, 0.29374998807907104, 0.05000000074505806, 0.05000000074505806], [0.8187500238418579, 0.29374998807907104, 0.02500000037252903, 0.02500000037252903], [0.8187500238418579, 0.29374998807907104, 0.05000000074505806, 0.05000000074505806], [0.831250011920929, 0.29374998807907104, 0.02500000037252903, 0.02500000037252903], [0.831250011920929, 0.29374998807907104, 0.05000000074505806, 0.05000000074505806], [0.84375, 0.29374998807907104, 0.02500000037252903, 0.02500000037252903], [0.84375, 0.29374998807907104, 0.05000000074505806, 0.05000000074505806], [0.856249988079071, 0.29374998807907104, 0.02500000037252903, 0.02500000037252903], [0.856249988079071, 0.29374998807907104, 0.05000000074505806, 0.05000000074505806], [0.8687499761581421, 0.29374998807907104, 0.02500000037252903, 0.02500000037252903], [0.8687499761581421, 0.29374998807907104, 0.05000000074505806, 0.05000000074505806], [0.8812500238418579, 0.29374998807907104, 0.02500000037252903, 0.02500000037252903], [0.8812500238418579, 0.29374998807907104, 0.05000000074505806, 0.05000000074505806], [0.893750011920929, 0.29374998807907104, 0.02500000037252903, 0.02500000037252903], [0.893750011920929, 0.29374998807907104, 0.05000000074505806, 0.05000000074505806], [0.90625, 0.29374998807907104, 0.02500000037252903, 0.02500000037252903], [0.90625, 0.29374998807907104, 0.05000000074505806, 0.05000000074505806], [0.918749988079071, 0.29374998807907104, 0.02500000037252903, 0.02500000037252903], [0.918749988079071, 0.29374998807907104, 0.05000000074505806, 0.05000000074505806], [0.9312499761581421, 0.29374998807907104, 0.02500000037252903, 0.02500000037252903], [0.9312499761581421, 0.29374998807907104, 0.05000000074505806, 0.05000000074505806], [0.9437500238418579, 0.29374998807907104, 0.02500000037252903, 0.02500000037252903], [0.9437500238418579, 0.29374998807907104, 0.05000000074505806, 0.05000000074505806], [0.956250011920929, 0.29374998807907104, 0.02500000037252903, 0.02500000037252903], [0.956250011920929, 0.29374998807907104, 0.05000000074505806, 0.05000000074505806], [0.96875, 0.29374998807907104, 0.02500000037252903, 0.02500000037252903], [0.96875, 0.29374998807907104, 0.05000000074505806, 0.05000000074505806], [0.981249988079071, 0.29374998807907104, 0.02500000037252903, 0.02500000037252903], [0.981249988079071, 0.29374998807907104, 0.05000000074505806, 0.05000000074505806], [0.9937499761581421, 0.29374998807907104, 0.02500000037252903, 0.02500000037252903], [0.9937499761581421, 0.29374998807907104, 0.05000000074505806, 0.05000000074505806], [0.0062500000931322575, 0.3062500059604645, 0.02500000037252903, 0.02500000037252903], [0.0062500000931322575, 0.3062500059604645, 0.05000000074505806, 0.05000000074505806], [0.01875000074505806, 0.3062500059604645, 0.02500000037252903, 0.02500000037252903], [0.01875000074505806, 0.3062500059604645, 0.05000000074505806, 0.05000000074505806], [0.03125, 0.3062500059604645, 0.02500000037252903, 0.02500000037252903], [0.03125, 0.3062500059604645, 0.05000000074505806, 0.05000000074505806], [0.04374999925494194, 0.3062500059604645, 0.02500000037252903, 0.02500000037252903], [0.04374999925494194, 0.3062500059604645, 0.05000000074505806, 0.05000000074505806], [0.05624999850988388, 0.3062500059604645, 0.02500000037252903, 0.02500000037252903], [0.05624999850988388, 0.3062500059604645, 0.05000000074505806, 0.05000000074505806], [0.06875000149011612, 0.3062500059604645, 0.02500000037252903, 0.02500000037252903], [0.06875000149011612, 0.3062500059604645, 0.05000000074505806, 0.05000000074505806], [0.08124999701976776, 0.3062500059604645, 0.02500000037252903, 0.02500000037252903], [0.08124999701976776, 0.3062500059604645, 0.05000000074505806, 0.05000000074505806], [0.09375, 0.3062500059604645, 0.02500000037252903, 0.02500000037252903], [0.09375, 0.3062500059604645, 0.05000000074505806, 0.05000000074505806], [0.10625000298023224, 0.3062500059604645, 0.02500000037252903, 0.02500000037252903], [0.10625000298023224, 0.3062500059604645, 0.05000000074505806, 0.05000000074505806], [0.11874999850988388, 0.3062500059604645, 0.02500000037252903, 0.02500000037252903], [0.11874999850988388, 0.3062500059604645, 0.05000000074505806, 0.05000000074505806], [0.13124999403953552, 0.3062500059604645, 0.02500000037252903, 0.02500000037252903], [0.13124999403953552, 0.3062500059604645, 0.05000000074505806, 0.05000000074505806], [0.14374999701976776, 0.3062500059604645, 0.02500000037252903, 0.02500000037252903], [0.14374999701976776, 0.3062500059604645, 0.05000000074505806, 0.05000000074505806], [0.15625, 0.3062500059604645, 0.02500000037252903, 0.02500000037252903], [0.15625, 0.3062500059604645, 0.05000000074505806, 0.05000000074505806], [0.16875000298023224, 0.3062500059604645, 0.02500000037252903, 0.02500000037252903], [0.16875000298023224, 0.3062500059604645, 0.05000000074505806, 0.05000000074505806], [0.18125000596046448, 0.3062500059604645, 0.02500000037252903, 0.02500000037252903], [0.18125000596046448, 0.3062500059604645, 0.05000000074505806, 0.05000000074505806], [0.19374999403953552, 0.3062500059604645, 0.02500000037252903, 0.02500000037252903], [0.19374999403953552, 0.3062500059604645, 0.05000000074505806, 0.05000000074505806], [0.20624999701976776, 0.3062500059604645, 0.02500000037252903, 0.02500000037252903], [0.20624999701976776, 0.3062500059604645, 0.05000000074505806, 0.05000000074505806], [0.21875, 0.3062500059604645, 0.02500000037252903, 0.02500000037252903], [0.21875, 0.3062500059604645, 0.05000000074505806, 0.05000000074505806], [0.23125000298023224, 0.3062500059604645, 0.02500000037252903, 0.02500000037252903], [0.23125000298023224, 0.3062500059604645, 0.05000000074505806, 0.05000000074505806], [0.24375000596046448, 0.3062500059604645, 0.02500000037252903, 0.02500000037252903], [0.24375000596046448, 0.3062500059604645, 0.05000000074505806, 0.05000000074505806], [0.2562499940395355, 0.3062500059604645, 0.02500000037252903, 0.02500000037252903], [0.2562499940395355, 0.3062500059604645, 0.05000000074505806, 0.05000000074505806], [0.26875001192092896, 0.3062500059604645, 0.02500000037252903, 0.02500000037252903], [0.26875001192092896, 0.3062500059604645, 0.05000000074505806, 0.05000000074505806], [0.28125, 0.3062500059604645, 0.02500000037252903, 0.02500000037252903], [0.28125, 0.3062500059604645, 0.05000000074505806, 0.05000000074505806], [0.29374998807907104, 0.3062500059604645, 0.02500000037252903, 0.02500000037252903], [0.29374998807907104, 0.3062500059604645, 0.05000000074505806, 0.05000000074505806], [0.3062500059604645, 0.3062500059604645, 0.02500000037252903, 0.02500000037252903], [0.3062500059604645, 0.3062500059604645, 0.05000000074505806, 0.05000000074505806], [0.3187499940395355, 0.3062500059604645, 0.02500000037252903, 0.02500000037252903], [0.3187499940395355, 0.3062500059604645, 0.05000000074505806, 0.05000000074505806], [0.33125001192092896, 0.3062500059604645, 0.02500000037252903, 0.02500000037252903], [0.33125001192092896, 0.3062500059604645, 0.05000000074505806, 0.05000000074505806], [0.34375, 0.3062500059604645, 0.02500000037252903, 0.02500000037252903], [0.34375, 0.3062500059604645, 0.05000000074505806, 0.05000000074505806], [0.35624998807907104, 0.3062500059604645, 0.02500000037252903, 0.02500000037252903], [0.35624998807907104, 0.3062500059604645, 0.05000000074505806, 0.05000000074505806], [0.3687500059604645, 0.3062500059604645, 0.02500000037252903, 0.02500000037252903], [0.3687500059604645, 0.3062500059604645, 0.05000000074505806, 0.05000000074505806], [0.3812499940395355, 0.3062500059604645, 0.02500000037252903, 0.02500000037252903], [0.3812499940395355, 0.3062500059604645, 0.05000000074505806, 0.05000000074505806], [0.39375001192092896, 0.3062500059604645, 0.02500000037252903, 0.02500000037252903], [0.39375001192092896, 0.3062500059604645, 0.05000000074505806, 0.05000000074505806], [0.40625, 0.3062500059604645, 0.02500000037252903, 0.02500000037252903], [0.40625, 0.3062500059604645, 0.05000000074505806, 0.05000000074505806], [0.41874998807907104, 0.3062500059604645, 0.02500000037252903, 0.02500000037252903], [0.41874998807907104, 0.3062500059604645, 0.05000000074505806, 0.05000000074505806], [0.4312500059604645, 0.3062500059604645, 0.02500000037252903, 0.02500000037252903], [0.4312500059604645, 0.3062500059604645, 0.05000000074505806, 0.05000000074505806], [0.4437499940395355, 0.3062500059604645, 0.02500000037252903, 0.02500000037252903], [0.4437499940395355, 0.3062500059604645, 0.05000000074505806, 0.05000000074505806], [0.45625001192092896, 0.3062500059604645, 0.02500000037252903, 0.02500000037252903], [0.45625001192092896, 0.3062500059604645, 0.05000000074505806, 0.05000000074505806], [0.46875, 0.3062500059604645, 0.02500000037252903, 0.02500000037252903], [0.46875, 0.3062500059604645, 0.05000000074505806, 0.05000000074505806], [0.48124998807907104, 0.3062500059604645, 0.02500000037252903, 0.02500000037252903], [0.48124998807907104, 0.3062500059604645, 0.05000000074505806, 0.05000000074505806], [0.4937500059604645, 0.3062500059604645, 0.02500000037252903, 0.02500000037252903], [0.4937500059604645, 0.3062500059604645, 0.05000000074505806, 0.05000000074505806], [0.5062500238418579, 0.3062500059604645, 0.02500000037252903, 0.02500000037252903], [0.5062500238418579, 0.3062500059604645, 0.05000000074505806, 0.05000000074505806], [0.518750011920929, 0.3062500059604645, 0.02500000037252903, 0.02500000037252903], [0.518750011920929, 0.3062500059604645, 0.05000000074505806, 0.05000000074505806], [0.53125, 0.3062500059604645, 0.02500000037252903, 0.02500000037252903], [0.53125, 0.3062500059604645, 0.05000000074505806, 0.05000000074505806], [0.543749988079071, 0.3062500059604645, 0.02500000037252903, 0.02500000037252903], [0.543749988079071, 0.3062500059604645, 0.05000000074505806, 0.05000000074505806], [0.5562499761581421, 0.3062500059604645, 0.02500000037252903, 0.02500000037252903], [0.5562499761581421, 0.3062500059604645, 0.05000000074505806, 0.05000000074505806], [0.5687500238418579, 0.3062500059604645, 0.02500000037252903, 0.02500000037252903], [0.5687500238418579, 0.3062500059604645, 0.05000000074505806, 0.05000000074505806], [0.581250011920929, 0.3062500059604645, 0.02500000037252903, 0.02500000037252903], [0.581250011920929, 0.3062500059604645, 0.05000000074505806, 0.05000000074505806], [0.59375, 0.3062500059604645, 0.02500000037252903, 0.02500000037252903], [0.59375, 0.3062500059604645, 0.05000000074505806, 0.05000000074505806], [0.606249988079071, 0.3062500059604645, 0.02500000037252903, 0.02500000037252903], [0.606249988079071, 0.3062500059604645, 0.05000000074505806, 0.05000000074505806], [0.6187499761581421, 0.3062500059604645, 0.02500000037252903, 0.02500000037252903], [0.6187499761581421, 0.3062500059604645, 0.05000000074505806, 0.05000000074505806], [0.6312500238418579, 0.3062500059604645, 0.02500000037252903, 0.02500000037252903], [0.6312500238418579, 0.3062500059604645, 0.05000000074505806, 0.05000000074505806], [0.643750011920929, 0.3062500059604645, 0.02500000037252903, 0.02500000037252903], [0.643750011920929, 0.3062500059604645, 0.05000000074505806, 0.05000000074505806], [0.65625, 0.3062500059604645, 0.02500000037252903, 0.02500000037252903], [0.65625, 0.3062500059604645, 0.05000000074505806, 0.05000000074505806], [0.668749988079071, 0.3062500059604645, 0.02500000037252903, 0.02500000037252903], [0.668749988079071, 0.3062500059604645, 0.05000000074505806, 0.05000000074505806], [0.6812499761581421, 0.3062500059604645, 0.02500000037252903, 0.02500000037252903], [0.6812499761581421, 0.3062500059604645, 0.05000000074505806, 0.05000000074505806], [0.6937500238418579, 0.3062500059604645, 0.02500000037252903, 0.02500000037252903], [0.6937500238418579, 0.3062500059604645, 0.05000000074505806, 0.05000000074505806], [0.706250011920929, 0.3062500059604645, 0.02500000037252903, 0.02500000037252903], [0.706250011920929, 0.3062500059604645, 0.05000000074505806, 0.05000000074505806], [0.71875, 0.3062500059604645, 0.02500000037252903, 0.02500000037252903], [0.71875, 0.3062500059604645, 0.05000000074505806, 0.05000000074505806], [0.731249988079071, 0.3062500059604645, 0.02500000037252903, 0.02500000037252903], [0.731249988079071, 0.3062500059604645, 0.05000000074505806, 0.05000000074505806], [0.7437499761581421, 0.3062500059604645, 0.02500000037252903, 0.02500000037252903], [0.7437499761581421, 0.3062500059604645, 0.05000000074505806, 0.05000000074505806], [0.7562500238418579, 0.3062500059604645, 0.02500000037252903, 0.02500000037252903], [0.7562500238418579, 0.3062500059604645, 0.05000000074505806, 0.05000000074505806], [0.768750011920929, 0.3062500059604645, 0.02500000037252903, 0.02500000037252903], [0.768750011920929, 0.3062500059604645, 0.05000000074505806, 0.05000000074505806], [0.78125, 0.3062500059604645, 0.02500000037252903, 0.02500000037252903], [0.78125, 0.3062500059604645, 0.05000000074505806, 0.05000000074505806], [0.793749988079071, 0.3062500059604645, 0.02500000037252903, 0.02500000037252903], [0.793749988079071, 0.3062500059604645, 0.05000000074505806, 0.05000000074505806], [0.8062499761581421, 0.3062500059604645, 0.02500000037252903, 0.02500000037252903], [0.8062499761581421, 0.3062500059604645, 0.05000000074505806, 0.05000000074505806], [0.8187500238418579, 0.3062500059604645, 0.02500000037252903, 0.02500000037252903], [0.8187500238418579, 0.3062500059604645, 0.05000000074505806, 0.05000000074505806], [0.831250011920929, 0.3062500059604645, 0.02500000037252903, 0.02500000037252903], [0.831250011920929, 0.3062500059604645, 0.05000000074505806, 0.05000000074505806], [0.84375, 0.3062500059604645, 0.02500000037252903, 0.02500000037252903], [0.84375, 0.3062500059604645, 0.05000000074505806, 0.05000000074505806], [0.856249988079071, 0.3062500059604645, 0.02500000037252903, 0.02500000037252903], [0.856249988079071, 0.3062500059604645, 0.05000000074505806, 0.05000000074505806], [0.8687499761581421, 0.3062500059604645, 0.02500000037252903, 0.02500000037252903], [0.8687499761581421, 0.3062500059604645, 0.05000000074505806, 0.05000000074505806], [0.8812500238418579, 0.3062500059604645, 0.02500000037252903, 0.02500000037252903], [0.8812500238418579, 0.3062500059604645, 0.05000000074505806, 0.05000000074505806], [0.893750011920929, 0.3062500059604645, 0.02500000037252903, 0.02500000037252903], [0.893750011920929, 0.3062500059604645, 0.05000000074505806, 0.05000000074505806], [0.90625, 0.3062500059604645, 0.02500000037252903, 0.02500000037252903], [0.90625, 0.3062500059604645, 0.05000000074505806, 0.05000000074505806], [0.918749988079071, 0.3062500059604645, 0.02500000037252903, 0.02500000037252903], [0.918749988079071, 0.3062500059604645, 0.05000000074505806, 0.05000000074505806], [0.9312499761581421, 0.3062500059604645, 0.02500000037252903, 0.02500000037252903], [0.9312499761581421, 0.3062500059604645, 0.05000000074505806, 0.05000000074505806], [0.9437500238418579, 0.3062500059604645, 0.02500000037252903, 0.02500000037252903], [0.9437500238418579, 0.3062500059604645, 0.05000000074505806, 0.05000000074505806], [0.956250011920929, 0.3062500059604645, 0.02500000037252903, 0.02500000037252903], [0.956250011920929, 0.3062500059604645, 0.05000000074505806, 0.05000000074505806], [0.96875, 0.3062500059604645, 0.02500000037252903, 0.02500000037252903], [0.96875, 0.3062500059604645, 0.05000000074505806, 0.05000000074505806], [0.981249988079071, 0.3062500059604645, 0.02500000037252903, 0.02500000037252903], [0.981249988079071, 0.3062500059604645, 0.05000000074505806, 0.05000000074505806], [0.9937499761581421, 0.3062500059604645, 0.02500000037252903, 0.02500000037252903], [0.9937499761581421, 0.3062500059604645, 0.05000000074505806, 0.05000000074505806], [0.0062500000931322575, 0.3187499940395355, 0.02500000037252903, 0.02500000037252903], [0.0062500000931322575, 0.3187499940395355, 0.05000000074505806, 0.05000000074505806], [0.01875000074505806, 0.3187499940395355, 0.02500000037252903, 0.02500000037252903], [0.01875000074505806, 0.3187499940395355, 0.05000000074505806, 0.05000000074505806], [0.03125, 0.3187499940395355, 0.02500000037252903, 0.02500000037252903], [0.03125, 0.3187499940395355, 0.05000000074505806, 0.05000000074505806], [0.04374999925494194, 0.3187499940395355, 0.02500000037252903, 0.02500000037252903], [0.04374999925494194, 0.3187499940395355, 0.05000000074505806, 0.05000000074505806], [0.05624999850988388, 0.3187499940395355, 0.02500000037252903, 0.02500000037252903], [0.05624999850988388, 0.3187499940395355, 0.05000000074505806, 0.05000000074505806], [0.06875000149011612, 0.3187499940395355, 0.02500000037252903, 0.02500000037252903], [0.06875000149011612, 0.3187499940395355, 0.05000000074505806, 0.05000000074505806], [0.08124999701976776, 0.3187499940395355, 0.02500000037252903, 0.02500000037252903], [0.08124999701976776, 0.3187499940395355, 0.05000000074505806, 0.05000000074505806], [0.09375, 0.3187499940395355, 0.02500000037252903, 0.02500000037252903], [0.09375, 0.3187499940395355, 0.05000000074505806, 0.05000000074505806], [0.10625000298023224, 0.3187499940395355, 0.02500000037252903, 0.02500000037252903], [0.10625000298023224, 0.3187499940395355, 0.05000000074505806, 0.05000000074505806], [0.11874999850988388, 0.3187499940395355, 0.02500000037252903, 0.02500000037252903], [0.11874999850988388, 0.3187499940395355, 0.05000000074505806, 0.05000000074505806], [0.13124999403953552, 0.3187499940395355, 0.02500000037252903, 0.02500000037252903], [0.13124999403953552, 0.3187499940395355, 0.05000000074505806, 0.05000000074505806], [0.14374999701976776, 0.3187499940395355, 0.02500000037252903, 0.02500000037252903], [0.14374999701976776, 0.3187499940395355, 0.05000000074505806, 0.05000000074505806], [0.15625, 0.3187499940395355, 0.02500000037252903, 0.02500000037252903], [0.15625, 0.3187499940395355, 0.05000000074505806, 0.05000000074505806], [0.16875000298023224, 0.3187499940395355, 0.02500000037252903, 0.02500000037252903], [0.16875000298023224, 0.3187499940395355, 0.05000000074505806, 0.05000000074505806], [0.18125000596046448, 0.3187499940395355, 0.02500000037252903, 0.02500000037252903], [0.18125000596046448, 0.3187499940395355, 0.05000000074505806, 0.05000000074505806], [0.19374999403953552, 0.3187499940395355, 0.02500000037252903, 0.02500000037252903], [0.19374999403953552, 0.3187499940395355, 0.05000000074505806, 0.05000000074505806], [0.20624999701976776, 0.3187499940395355, 0.02500000037252903, 0.02500000037252903], [0.20624999701976776, 0.3187499940395355, 0.05000000074505806, 0.05000000074505806], [0.21875, 0.3187499940395355, 0.02500000037252903, 0.02500000037252903], [0.21875, 0.3187499940395355, 0.05000000074505806, 0.05000000074505806], [0.23125000298023224, 0.3187499940395355, 0.02500000037252903, 0.02500000037252903], [0.23125000298023224, 0.3187499940395355, 0.05000000074505806, 0.05000000074505806], [0.24375000596046448, 0.3187499940395355, 0.02500000037252903, 0.02500000037252903], [0.24375000596046448, 0.3187499940395355, 0.05000000074505806, 0.05000000074505806], [0.2562499940395355, 0.3187499940395355, 0.02500000037252903, 0.02500000037252903], [0.2562499940395355, 0.3187499940395355, 0.05000000074505806, 0.05000000074505806], [0.26875001192092896, 0.3187499940395355, 0.02500000037252903, 0.02500000037252903], [0.26875001192092896, 0.3187499940395355, 0.05000000074505806, 0.05000000074505806], [0.28125, 0.3187499940395355, 0.02500000037252903, 0.02500000037252903], [0.28125, 0.3187499940395355, 0.05000000074505806, 0.05000000074505806], [0.29374998807907104, 0.3187499940395355, 0.02500000037252903, 0.02500000037252903], [0.29374998807907104, 0.3187499940395355, 0.05000000074505806, 0.05000000074505806], [0.3062500059604645, 0.3187499940395355, 0.02500000037252903, 0.02500000037252903], [0.3062500059604645, 0.3187499940395355, 0.05000000074505806, 0.05000000074505806], [0.3187499940395355, 0.3187499940395355, 0.02500000037252903, 0.02500000037252903], [0.3187499940395355, 0.3187499940395355, 0.05000000074505806, 0.05000000074505806], [0.33125001192092896, 0.3187499940395355, 0.02500000037252903, 0.02500000037252903], [0.33125001192092896, 0.3187499940395355, 0.05000000074505806, 0.05000000074505806], [0.34375, 0.3187499940395355, 0.02500000037252903, 0.02500000037252903], [0.34375, 0.3187499940395355, 0.05000000074505806, 0.05000000074505806], [0.35624998807907104, 0.3187499940395355, 0.02500000037252903, 0.02500000037252903], [0.35624998807907104, 0.3187499940395355, 0.05000000074505806, 0.05000000074505806], [0.3687500059604645, 0.3187499940395355, 0.02500000037252903, 0.02500000037252903], [0.3687500059604645, 0.3187499940395355, 0.05000000074505806, 0.05000000074505806], [0.3812499940395355, 0.3187499940395355, 0.02500000037252903, 0.02500000037252903], [0.3812499940395355, 0.3187499940395355, 0.05000000074505806, 0.05000000074505806], [0.39375001192092896, 0.3187499940395355, 0.02500000037252903, 0.02500000037252903], [0.39375001192092896, 0.3187499940395355, 0.05000000074505806, 0.05000000074505806], [0.40625, 0.3187499940395355, 0.02500000037252903, 0.02500000037252903], [0.40625, 0.3187499940395355, 0.05000000074505806, 0.05000000074505806], [0.41874998807907104, 0.3187499940395355, 0.02500000037252903, 0.02500000037252903], [0.41874998807907104, 0.3187499940395355, 0.05000000074505806, 0.05000000074505806], [0.4312500059604645, 0.3187499940395355, 0.02500000037252903, 0.02500000037252903], [0.4312500059604645, 0.3187499940395355, 0.05000000074505806, 0.05000000074505806], [0.4437499940395355, 0.3187499940395355, 0.02500000037252903, 0.02500000037252903], [0.4437499940395355, 0.3187499940395355, 0.05000000074505806, 0.05000000074505806], [0.45625001192092896, 0.3187499940395355, 0.02500000037252903, 0.02500000037252903], [0.45625001192092896, 0.3187499940395355, 0.05000000074505806, 0.05000000074505806], [0.46875, 0.3187499940395355, 0.02500000037252903, 0.02500000037252903], [0.46875, 0.3187499940395355, 0.05000000074505806, 0.05000000074505806], [0.48124998807907104, 0.3187499940395355, 0.02500000037252903, 0.02500000037252903], [0.48124998807907104, 0.3187499940395355, 0.05000000074505806, 0.05000000074505806], [0.4937500059604645, 0.3187499940395355, 0.02500000037252903, 0.02500000037252903], [0.4937500059604645, 0.3187499940395355, 0.05000000074505806, 0.05000000074505806], [0.5062500238418579, 0.3187499940395355, 0.02500000037252903, 0.02500000037252903], [0.5062500238418579, 0.3187499940395355, 0.05000000074505806, 0.05000000074505806], [0.518750011920929, 0.3187499940395355, 0.02500000037252903, 0.02500000037252903], [0.518750011920929, 0.3187499940395355, 0.05000000074505806, 0.05000000074505806], [0.53125, 0.3187499940395355, 0.02500000037252903, 0.02500000037252903], [0.53125, 0.3187499940395355, 0.05000000074505806, 0.05000000074505806], [0.543749988079071, 0.3187499940395355, 0.02500000037252903, 0.02500000037252903], [0.543749988079071, 0.3187499940395355, 0.05000000074505806, 0.05000000074505806], [0.5562499761581421, 0.3187499940395355, 0.02500000037252903, 0.02500000037252903], [0.5562499761581421, 0.3187499940395355, 0.05000000074505806, 0.05000000074505806], [0.5687500238418579, 0.3187499940395355, 0.02500000037252903, 0.02500000037252903], [0.5687500238418579, 0.3187499940395355, 0.05000000074505806, 0.05000000074505806], [0.581250011920929, 0.3187499940395355, 0.02500000037252903, 0.02500000037252903], [0.581250011920929, 0.3187499940395355, 0.05000000074505806, 0.05000000074505806], [0.59375, 0.3187499940395355, 0.02500000037252903, 0.02500000037252903], [0.59375, 0.3187499940395355, 0.05000000074505806, 0.05000000074505806], [0.606249988079071, 0.3187499940395355, 0.02500000037252903, 0.02500000037252903], [0.606249988079071, 0.3187499940395355, 0.05000000074505806, 0.05000000074505806], [0.6187499761581421, 0.3187499940395355, 0.02500000037252903, 0.02500000037252903], [0.6187499761581421, 0.3187499940395355, 0.05000000074505806, 0.05000000074505806], [0.6312500238418579, 0.3187499940395355, 0.02500000037252903, 0.02500000037252903], [0.6312500238418579, 0.3187499940395355, 0.05000000074505806, 0.05000000074505806], [0.643750011920929, 0.3187499940395355, 0.02500000037252903, 0.02500000037252903], [0.643750011920929, 0.3187499940395355, 0.05000000074505806, 0.05000000074505806], [0.65625, 0.3187499940395355, 0.02500000037252903, 0.02500000037252903], [0.65625, 0.3187499940395355, 0.05000000074505806, 0.05000000074505806], [0.668749988079071, 0.3187499940395355, 0.02500000037252903, 0.02500000037252903], [0.668749988079071, 0.3187499940395355, 0.05000000074505806, 0.05000000074505806], [0.6812499761581421, 0.3187499940395355, 0.02500000037252903, 0.02500000037252903], [0.6812499761581421, 0.3187499940395355, 0.05000000074505806, 0.05000000074505806], [0.6937500238418579, 0.3187499940395355, 0.02500000037252903, 0.02500000037252903], [0.6937500238418579, 0.3187499940395355, 0.05000000074505806, 0.05000000074505806], [0.706250011920929, 0.3187499940395355, 0.02500000037252903, 0.02500000037252903], [0.706250011920929, 0.3187499940395355, 0.05000000074505806, 0.05000000074505806], [0.71875, 0.3187499940395355, 0.02500000037252903, 0.02500000037252903], [0.71875, 0.3187499940395355, 0.05000000074505806, 0.05000000074505806], [0.731249988079071, 0.3187499940395355, 0.02500000037252903, 0.02500000037252903], [0.731249988079071, 0.3187499940395355, 0.05000000074505806, 0.05000000074505806], [0.7437499761581421, 0.3187499940395355, 0.02500000037252903, 0.02500000037252903], [0.7437499761581421, 0.3187499940395355, 0.05000000074505806, 0.05000000074505806], [0.7562500238418579, 0.3187499940395355, 0.02500000037252903, 0.02500000037252903], [0.7562500238418579, 0.3187499940395355, 0.05000000074505806, 0.05000000074505806], [0.768750011920929, 0.3187499940395355, 0.02500000037252903, 0.02500000037252903], [0.768750011920929, 0.3187499940395355, 0.05000000074505806, 0.05000000074505806], [0.78125, 0.3187499940395355, 0.02500000037252903, 0.02500000037252903], [0.78125, 0.3187499940395355, 0.05000000074505806, 0.05000000074505806], [0.793749988079071, 0.3187499940395355, 0.02500000037252903, 0.02500000037252903], [0.793749988079071, 0.3187499940395355, 0.05000000074505806, 0.05000000074505806], [0.8062499761581421, 0.3187499940395355, 0.02500000037252903, 0.02500000037252903], [0.8062499761581421, 0.3187499940395355, 0.05000000074505806, 0.05000000074505806], [0.8187500238418579, 0.3187499940395355, 0.02500000037252903, 0.02500000037252903], [0.8187500238418579, 0.3187499940395355, 0.05000000074505806, 0.05000000074505806], [0.831250011920929, 0.3187499940395355, 0.02500000037252903, 0.02500000037252903], [0.831250011920929, 0.3187499940395355, 0.05000000074505806, 0.05000000074505806], [0.84375, 0.3187499940395355, 0.02500000037252903, 0.02500000037252903], [0.84375, 0.3187499940395355, 0.05000000074505806, 0.05000000074505806], [0.856249988079071, 0.3187499940395355, 0.02500000037252903, 0.02500000037252903], [0.856249988079071, 0.3187499940395355, 0.05000000074505806, 0.05000000074505806], [0.8687499761581421, 0.3187499940395355, 0.02500000037252903, 0.02500000037252903], [0.8687499761581421, 0.3187499940395355, 0.05000000074505806, 0.05000000074505806], [0.8812500238418579, 0.3187499940395355, 0.02500000037252903, 0.02500000037252903], [0.8812500238418579, 0.3187499940395355, 0.05000000074505806, 0.05000000074505806], [0.893750011920929, 0.3187499940395355, 0.02500000037252903, 0.02500000037252903], [0.893750011920929, 0.3187499940395355, 0.05000000074505806, 0.05000000074505806], [0.90625, 0.3187499940395355, 0.02500000037252903, 0.02500000037252903], [0.90625, 0.3187499940395355, 0.05000000074505806, 0.05000000074505806], [0.918749988079071, 0.3187499940395355, 0.02500000037252903, 0.02500000037252903], [0.918749988079071, 0.3187499940395355, 0.05000000074505806, 0.05000000074505806], [0.9312499761581421, 0.3187499940395355, 0.02500000037252903, 0.02500000037252903], [0.9312499761581421, 0.3187499940395355, 0.05000000074505806, 0.05000000074505806], [0.9437500238418579, 0.3187499940395355, 0.02500000037252903, 0.02500000037252903], [0.9437500238418579, 0.3187499940395355, 0.05000000074505806, 0.05000000074505806], [0.956250011920929, 0.3187499940395355, 0.02500000037252903, 0.02500000037252903], [0.956250011920929, 0.3187499940395355, 0.05000000074505806, 0.05000000074505806], [0.96875, 0.3187499940395355, 0.02500000037252903, 0.02500000037252903], [0.96875, 0.3187499940395355, 0.05000000074505806, 0.05000000074505806], [0.981249988079071, 0.3187499940395355, 0.02500000037252903, 0.02500000037252903], [0.981249988079071, 0.3187499940395355, 0.05000000074505806, 0.05000000074505806], [0.9937499761581421, 0.3187499940395355, 0.02500000037252903, 0.02500000037252903], [0.9937499761581421, 0.3187499940395355, 0.05000000074505806, 0.05000000074505806], [0.0062500000931322575, 0.33125001192092896, 0.02500000037252903, 0.02500000037252903], [0.0062500000931322575, 0.33125001192092896, 0.05000000074505806, 0.05000000074505806], [0.01875000074505806, 0.33125001192092896, 0.02500000037252903, 0.02500000037252903], [0.01875000074505806, 0.33125001192092896, 0.05000000074505806, 0.05000000074505806], [0.03125, 0.33125001192092896, 0.02500000037252903, 0.02500000037252903], [0.03125, 0.33125001192092896, 0.05000000074505806, 0.05000000074505806], [0.04374999925494194, 0.33125001192092896, 0.02500000037252903, 0.02500000037252903], [0.04374999925494194, 0.33125001192092896, 0.05000000074505806, 0.05000000074505806], [0.05624999850988388, 0.33125001192092896, 0.02500000037252903, 0.02500000037252903], [0.05624999850988388, 0.33125001192092896, 0.05000000074505806, 0.05000000074505806], [0.06875000149011612, 0.33125001192092896, 0.02500000037252903, 0.02500000037252903], [0.06875000149011612, 0.33125001192092896, 0.05000000074505806, 0.05000000074505806], [0.08124999701976776, 0.33125001192092896, 0.02500000037252903, 0.02500000037252903], [0.08124999701976776, 0.33125001192092896, 0.05000000074505806, 0.05000000074505806], [0.09375, 0.33125001192092896, 0.02500000037252903, 0.02500000037252903], [0.09375, 0.33125001192092896, 0.05000000074505806, 0.05000000074505806], [0.10625000298023224, 0.33125001192092896, 0.02500000037252903, 0.02500000037252903], [0.10625000298023224, 0.33125001192092896, 0.05000000074505806, 0.05000000074505806], [0.11874999850988388, 0.33125001192092896, 0.02500000037252903, 0.02500000037252903], [0.11874999850988388, 0.33125001192092896, 0.05000000074505806, 0.05000000074505806], [0.13124999403953552, 0.33125001192092896, 0.02500000037252903, 0.02500000037252903], [0.13124999403953552, 0.33125001192092896, 0.05000000074505806, 0.05000000074505806], [0.14374999701976776, 0.33125001192092896, 0.02500000037252903, 0.02500000037252903], [0.14374999701976776, 0.33125001192092896, 0.05000000074505806, 0.05000000074505806], [0.15625, 0.33125001192092896, 0.02500000037252903, 0.02500000037252903], [0.15625, 0.33125001192092896, 0.05000000074505806, 0.05000000074505806], [0.16875000298023224, 0.33125001192092896, 0.02500000037252903, 0.02500000037252903], [0.16875000298023224, 0.33125001192092896, 0.05000000074505806, 0.05000000074505806], [0.18125000596046448, 0.33125001192092896, 0.02500000037252903, 0.02500000037252903], [0.18125000596046448, 0.33125001192092896, 0.05000000074505806, 0.05000000074505806], [0.19374999403953552, 0.33125001192092896, 0.02500000037252903, 0.02500000037252903], [0.19374999403953552, 0.33125001192092896, 0.05000000074505806, 0.05000000074505806], [0.20624999701976776, 0.33125001192092896, 0.02500000037252903, 0.02500000037252903], [0.20624999701976776, 0.33125001192092896, 0.05000000074505806, 0.05000000074505806], [0.21875, 0.33125001192092896, 0.02500000037252903, 0.02500000037252903], [0.21875, 0.33125001192092896, 0.05000000074505806, 0.05000000074505806], [0.23125000298023224, 0.33125001192092896, 0.02500000037252903, 0.02500000037252903], [0.23125000298023224, 0.33125001192092896, 0.05000000074505806, 0.05000000074505806], [0.24375000596046448, 0.33125001192092896, 0.02500000037252903, 0.02500000037252903], [0.24375000596046448, 0.33125001192092896, 0.05000000074505806, 0.05000000074505806], [0.2562499940395355, 0.33125001192092896, 0.02500000037252903, 0.02500000037252903], [0.2562499940395355, 0.33125001192092896, 0.05000000074505806, 0.05000000074505806], [0.26875001192092896, 0.33125001192092896, 0.02500000037252903, 0.02500000037252903], [0.26875001192092896, 0.33125001192092896, 0.05000000074505806, 0.05000000074505806], [0.28125, 0.33125001192092896, 0.02500000037252903, 0.02500000037252903], [0.28125, 0.33125001192092896, 0.05000000074505806, 0.05000000074505806], [0.29374998807907104, 0.33125001192092896, 0.02500000037252903, 0.02500000037252903], [0.29374998807907104, 0.33125001192092896, 0.05000000074505806, 0.05000000074505806], [0.3062500059604645, 0.33125001192092896, 0.02500000037252903, 0.02500000037252903], [0.3062500059604645, 0.33125001192092896, 0.05000000074505806, 0.05000000074505806], [0.3187499940395355, 0.33125001192092896, 0.02500000037252903, 0.02500000037252903], [0.3187499940395355, 0.33125001192092896, 0.05000000074505806, 0.05000000074505806], [0.33125001192092896, 0.33125001192092896, 0.02500000037252903, 0.02500000037252903], [0.33125001192092896, 0.33125001192092896, 0.05000000074505806, 0.05000000074505806], [0.34375, 0.33125001192092896, 0.02500000037252903, 0.02500000037252903], [0.34375, 0.33125001192092896, 0.05000000074505806, 0.05000000074505806], [0.35624998807907104, 0.33125001192092896, 0.02500000037252903, 0.02500000037252903], [0.35624998807907104, 0.33125001192092896, 0.05000000074505806, 0.05000000074505806], [0.3687500059604645, 0.33125001192092896, 0.02500000037252903, 0.02500000037252903], [0.3687500059604645, 0.33125001192092896, 0.05000000074505806, 0.05000000074505806], [0.3812499940395355, 0.33125001192092896, 0.02500000037252903, 0.02500000037252903], [0.3812499940395355, 0.33125001192092896, 0.05000000074505806, 0.05000000074505806], [0.39375001192092896, 0.33125001192092896, 0.02500000037252903, 0.02500000037252903], [0.39375001192092896, 0.33125001192092896, 0.05000000074505806, 0.05000000074505806], [0.40625, 0.33125001192092896, 0.02500000037252903, 0.02500000037252903], [0.40625, 0.33125001192092896, 0.05000000074505806, 0.05000000074505806], [0.41874998807907104, 0.33125001192092896, 0.02500000037252903, 0.02500000037252903], [0.41874998807907104, 0.33125001192092896, 0.05000000074505806, 0.05000000074505806], [0.4312500059604645, 0.33125001192092896, 0.02500000037252903, 0.02500000037252903], [0.4312500059604645, 0.33125001192092896, 0.05000000074505806, 0.05000000074505806], [0.4437499940395355, 0.33125001192092896, 0.02500000037252903, 0.02500000037252903], [0.4437499940395355, 0.33125001192092896, 0.05000000074505806, 0.05000000074505806], [0.45625001192092896, 0.33125001192092896, 0.02500000037252903, 0.02500000037252903], [0.45625001192092896, 0.33125001192092896, 0.05000000074505806, 0.05000000074505806], [0.46875, 0.33125001192092896, 0.02500000037252903, 0.02500000037252903], [0.46875, 0.33125001192092896, 0.05000000074505806, 0.05000000074505806], [0.48124998807907104, 0.33125001192092896, 0.02500000037252903, 0.02500000037252903], [0.48124998807907104, 0.33125001192092896, 0.05000000074505806, 0.05000000074505806], [0.4937500059604645, 0.33125001192092896, 0.02500000037252903, 0.02500000037252903], [0.4937500059604645, 0.33125001192092896, 0.05000000074505806, 0.05000000074505806], [0.5062500238418579, 0.33125001192092896, 0.02500000037252903, 0.02500000037252903], [0.5062500238418579, 0.33125001192092896, 0.05000000074505806, 0.05000000074505806], [0.518750011920929, 0.33125001192092896, 0.02500000037252903, 0.02500000037252903], [0.518750011920929, 0.33125001192092896, 0.05000000074505806, 0.05000000074505806], [0.53125, 0.33125001192092896, 0.02500000037252903, 0.02500000037252903], [0.53125, 0.33125001192092896, 0.05000000074505806, 0.05000000074505806], [0.543749988079071, 0.33125001192092896, 0.02500000037252903, 0.02500000037252903], [0.543749988079071, 0.33125001192092896, 0.05000000074505806, 0.05000000074505806], [0.5562499761581421, 0.33125001192092896, 0.02500000037252903, 0.02500000037252903], [0.5562499761581421, 0.33125001192092896, 0.05000000074505806, 0.05000000074505806], [0.5687500238418579, 0.33125001192092896, 0.02500000037252903, 0.02500000037252903], [0.5687500238418579, 0.33125001192092896, 0.05000000074505806, 0.05000000074505806], [0.581250011920929, 0.33125001192092896, 0.02500000037252903, 0.02500000037252903], [0.581250011920929, 0.33125001192092896, 0.05000000074505806, 0.05000000074505806], [0.59375, 0.33125001192092896, 0.02500000037252903, 0.02500000037252903], [0.59375, 0.33125001192092896, 0.05000000074505806, 0.05000000074505806], [0.606249988079071, 0.33125001192092896, 0.02500000037252903, 0.02500000037252903], [0.606249988079071, 0.33125001192092896, 0.05000000074505806, 0.05000000074505806], [0.6187499761581421, 0.33125001192092896, 0.02500000037252903, 0.02500000037252903], [0.6187499761581421, 0.33125001192092896, 0.05000000074505806, 0.05000000074505806], [0.6312500238418579, 0.33125001192092896, 0.02500000037252903, 0.02500000037252903], [0.6312500238418579, 0.33125001192092896, 0.05000000074505806, 0.05000000074505806], [0.643750011920929, 0.33125001192092896, 0.02500000037252903, 0.02500000037252903], [0.643750011920929, 0.33125001192092896, 0.05000000074505806, 0.05000000074505806], [0.65625, 0.33125001192092896, 0.02500000037252903, 0.02500000037252903], [0.65625, 0.33125001192092896, 0.05000000074505806, 0.05000000074505806], [0.668749988079071, 0.33125001192092896, 0.02500000037252903, 0.02500000037252903], [0.668749988079071, 0.33125001192092896, 0.05000000074505806, 0.05000000074505806], [0.6812499761581421, 0.33125001192092896, 0.02500000037252903, 0.02500000037252903], [0.6812499761581421, 0.33125001192092896, 0.05000000074505806, 0.05000000074505806], [0.6937500238418579, 0.33125001192092896, 0.02500000037252903, 0.02500000037252903], [0.6937500238418579, 0.33125001192092896, 0.05000000074505806, 0.05000000074505806], [0.706250011920929, 0.33125001192092896, 0.02500000037252903, 0.02500000037252903], [0.706250011920929, 0.33125001192092896, 0.05000000074505806, 0.05000000074505806], [0.71875, 0.33125001192092896, 0.02500000037252903, 0.02500000037252903], [0.71875, 0.33125001192092896, 0.05000000074505806, 0.05000000074505806], [0.731249988079071, 0.33125001192092896, 0.02500000037252903, 0.02500000037252903], [0.731249988079071, 0.33125001192092896, 0.05000000074505806, 0.05000000074505806], [0.7437499761581421, 0.33125001192092896, 0.02500000037252903, 0.02500000037252903], [0.7437499761581421, 0.33125001192092896, 0.05000000074505806, 0.05000000074505806], [0.7562500238418579, 0.33125001192092896, 0.02500000037252903, 0.02500000037252903], [0.7562500238418579, 0.33125001192092896, 0.05000000074505806, 0.05000000074505806], [0.768750011920929, 0.33125001192092896, 0.02500000037252903, 0.02500000037252903], [0.768750011920929, 0.33125001192092896, 0.05000000074505806, 0.05000000074505806], [0.78125, 0.33125001192092896, 0.02500000037252903, 0.02500000037252903], [0.78125, 0.33125001192092896, 0.05000000074505806, 0.05000000074505806], [0.793749988079071, 0.33125001192092896, 0.02500000037252903, 0.02500000037252903], [0.793749988079071, 0.33125001192092896, 0.05000000074505806, 0.05000000074505806], [0.8062499761581421, 0.33125001192092896, 0.02500000037252903, 0.02500000037252903], [0.8062499761581421, 0.33125001192092896, 0.05000000074505806, 0.05000000074505806], [0.8187500238418579, 0.33125001192092896, 0.02500000037252903, 0.02500000037252903], [0.8187500238418579, 0.33125001192092896, 0.05000000074505806, 0.05000000074505806], [0.831250011920929, 0.33125001192092896, 0.02500000037252903, 0.02500000037252903], [0.831250011920929, 0.33125001192092896, 0.05000000074505806, 0.05000000074505806], [0.84375, 0.33125001192092896, 0.02500000037252903, 0.02500000037252903], [0.84375, 0.33125001192092896, 0.05000000074505806, 0.05000000074505806], [0.856249988079071, 0.33125001192092896, 0.02500000037252903, 0.02500000037252903], [0.856249988079071, 0.33125001192092896, 0.05000000074505806, 0.05000000074505806], [0.8687499761581421, 0.33125001192092896, 0.02500000037252903, 0.02500000037252903], [0.8687499761581421, 0.33125001192092896, 0.05000000074505806, 0.05000000074505806], [0.8812500238418579, 0.33125001192092896, 0.02500000037252903, 0.02500000037252903], [0.8812500238418579, 0.33125001192092896, 0.05000000074505806, 0.05000000074505806], [0.893750011920929, 0.33125001192092896, 0.02500000037252903, 0.02500000037252903], [0.893750011920929, 0.33125001192092896, 0.05000000074505806, 0.05000000074505806], [0.90625, 0.33125001192092896, 0.02500000037252903, 0.02500000037252903], [0.90625, 0.33125001192092896, 0.05000000074505806, 0.05000000074505806], [0.918749988079071, 0.33125001192092896, 0.02500000037252903, 0.02500000037252903], [0.918749988079071, 0.33125001192092896, 0.05000000074505806, 0.05000000074505806], [0.9312499761581421, 0.33125001192092896, 0.02500000037252903, 0.02500000037252903], [0.9312499761581421, 0.33125001192092896, 0.05000000074505806, 0.05000000074505806], [0.9437500238418579, 0.33125001192092896, 0.02500000037252903, 0.02500000037252903], [0.9437500238418579, 0.33125001192092896, 0.05000000074505806, 0.05000000074505806], [0.956250011920929, 0.33125001192092896, 0.02500000037252903, 0.02500000037252903], [0.956250011920929, 0.33125001192092896, 0.05000000074505806, 0.05000000074505806], [0.96875, 0.33125001192092896, 0.02500000037252903, 0.02500000037252903], [0.96875, 0.33125001192092896, 0.05000000074505806, 0.05000000074505806], [0.981249988079071, 0.33125001192092896, 0.02500000037252903, 0.02500000037252903], [0.981249988079071, 0.33125001192092896, 0.05000000074505806, 0.05000000074505806], [0.9937499761581421, 0.33125001192092896, 0.02500000037252903, 0.02500000037252903], [0.9937499761581421, 0.33125001192092896, 0.05000000074505806, 0.05000000074505806], [0.0062500000931322575, 0.34375, 0.02500000037252903, 0.02500000037252903], [0.0062500000931322575, 0.34375, 0.05000000074505806, 0.05000000074505806], [0.01875000074505806, 0.34375, 0.02500000037252903, 0.02500000037252903], [0.01875000074505806, 0.34375, 0.05000000074505806, 0.05000000074505806], [0.03125, 0.34375, 0.02500000037252903, 0.02500000037252903], [0.03125, 0.34375, 0.05000000074505806, 0.05000000074505806], [0.04374999925494194, 0.34375, 0.02500000037252903, 0.02500000037252903], [0.04374999925494194, 0.34375, 0.05000000074505806, 0.05000000074505806], [0.05624999850988388, 0.34375, 0.02500000037252903, 0.02500000037252903], [0.05624999850988388, 0.34375, 0.05000000074505806, 0.05000000074505806], [0.06875000149011612, 0.34375, 0.02500000037252903, 0.02500000037252903], [0.06875000149011612, 0.34375, 0.05000000074505806, 0.05000000074505806], [0.08124999701976776, 0.34375, 0.02500000037252903, 0.02500000037252903], [0.08124999701976776, 0.34375, 0.05000000074505806, 0.05000000074505806], [0.09375, 0.34375, 0.02500000037252903, 0.02500000037252903], [0.09375, 0.34375, 0.05000000074505806, 0.05000000074505806], [0.10625000298023224, 0.34375, 0.02500000037252903, 0.02500000037252903], [0.10625000298023224, 0.34375, 0.05000000074505806, 0.05000000074505806], [0.11874999850988388, 0.34375, 0.02500000037252903, 0.02500000037252903], [0.11874999850988388, 0.34375, 0.05000000074505806, 0.05000000074505806], [0.13124999403953552, 0.34375, 0.02500000037252903, 0.02500000037252903], [0.13124999403953552, 0.34375, 0.05000000074505806, 0.05000000074505806], [0.14374999701976776, 0.34375, 0.02500000037252903, 0.02500000037252903], [0.14374999701976776, 0.34375, 0.05000000074505806, 0.05000000074505806], [0.15625, 0.34375, 0.02500000037252903, 0.02500000037252903], [0.15625, 0.34375, 0.05000000074505806, 0.05000000074505806], [0.16875000298023224, 0.34375, 0.02500000037252903, 0.02500000037252903], [0.16875000298023224, 0.34375, 0.05000000074505806, 0.05000000074505806], [0.18125000596046448, 0.34375, 0.02500000037252903, 0.02500000037252903], [0.18125000596046448, 0.34375, 0.05000000074505806, 0.05000000074505806], [0.19374999403953552, 0.34375, 0.02500000037252903, 0.02500000037252903], [0.19374999403953552, 0.34375, 0.05000000074505806, 0.05000000074505806], [0.20624999701976776, 0.34375, 0.02500000037252903, 0.02500000037252903], [0.20624999701976776, 0.34375, 0.05000000074505806, 0.05000000074505806], [0.21875, 0.34375, 0.02500000037252903, 0.02500000037252903], [0.21875, 0.34375, 0.05000000074505806, 0.05000000074505806], [0.23125000298023224, 0.34375, 0.02500000037252903, 0.02500000037252903], [0.23125000298023224, 0.34375, 0.05000000074505806, 0.05000000074505806], [0.24375000596046448, 0.34375, 0.02500000037252903, 0.02500000037252903], [0.24375000596046448, 0.34375, 0.05000000074505806, 0.05000000074505806], [0.2562499940395355, 0.34375, 0.02500000037252903, 0.02500000037252903], [0.2562499940395355, 0.34375, 0.05000000074505806, 0.05000000074505806], [0.26875001192092896, 0.34375, 0.02500000037252903, 0.02500000037252903], [0.26875001192092896, 0.34375, 0.05000000074505806, 0.05000000074505806], [0.28125, 0.34375, 0.02500000037252903, 0.02500000037252903], [0.28125, 0.34375, 0.05000000074505806, 0.05000000074505806], [0.29374998807907104, 0.34375, 0.02500000037252903, 0.02500000037252903], [0.29374998807907104, 0.34375, 0.05000000074505806, 0.05000000074505806], [0.3062500059604645, 0.34375, 0.02500000037252903, 0.02500000037252903], [0.3062500059604645, 0.34375, 0.05000000074505806, 0.05000000074505806], [0.3187499940395355, 0.34375, 0.02500000037252903, 0.02500000037252903], [0.3187499940395355, 0.34375, 0.05000000074505806, 0.05000000074505806], [0.33125001192092896, 0.34375, 0.02500000037252903, 0.02500000037252903], [0.33125001192092896, 0.34375, 0.05000000074505806, 0.05000000074505806], [0.34375, 0.34375, 0.02500000037252903, 0.02500000037252903], [0.34375, 0.34375, 0.05000000074505806, 0.05000000074505806], [0.35624998807907104, 0.34375, 0.02500000037252903, 0.02500000037252903], [0.35624998807907104, 0.34375, 0.05000000074505806, 0.05000000074505806], [0.3687500059604645, 0.34375, 0.02500000037252903, 0.02500000037252903], [0.3687500059604645, 0.34375, 0.05000000074505806, 0.05000000074505806], [0.3812499940395355, 0.34375, 0.02500000037252903, 0.02500000037252903], [0.3812499940395355, 0.34375, 0.05000000074505806, 0.05000000074505806], [0.39375001192092896, 0.34375, 0.02500000037252903, 0.02500000037252903], [0.39375001192092896, 0.34375, 0.05000000074505806, 0.05000000074505806], [0.40625, 0.34375, 0.02500000037252903, 0.02500000037252903], [0.40625, 0.34375, 0.05000000074505806, 0.05000000074505806], [0.41874998807907104, 0.34375, 0.02500000037252903, 0.02500000037252903], [0.41874998807907104, 0.34375, 0.05000000074505806, 0.05000000074505806], [0.4312500059604645, 0.34375, 0.02500000037252903, 0.02500000037252903], [0.4312500059604645, 0.34375, 0.05000000074505806, 0.05000000074505806], [0.4437499940395355, 0.34375, 0.02500000037252903, 0.02500000037252903], [0.4437499940395355, 0.34375, 0.05000000074505806, 0.05000000074505806], [0.45625001192092896, 0.34375, 0.02500000037252903, 0.02500000037252903], [0.45625001192092896, 0.34375, 0.05000000074505806, 0.05000000074505806], [0.46875, 0.34375, 0.02500000037252903, 0.02500000037252903], [0.46875, 0.34375, 0.05000000074505806, 0.05000000074505806], [0.48124998807907104, 0.34375, 0.02500000037252903, 0.02500000037252903], [0.48124998807907104, 0.34375, 0.05000000074505806, 0.05000000074505806], [0.4937500059604645, 0.34375, 0.02500000037252903, 0.02500000037252903], [0.4937500059604645, 0.34375, 0.05000000074505806, 0.05000000074505806], [0.5062500238418579, 0.34375, 0.02500000037252903, 0.02500000037252903], [0.5062500238418579, 0.34375, 0.05000000074505806, 0.05000000074505806], [0.518750011920929, 0.34375, 0.02500000037252903, 0.02500000037252903], [0.518750011920929, 0.34375, 0.05000000074505806, 0.05000000074505806], [0.53125, 0.34375, 0.02500000037252903, 0.02500000037252903], [0.53125, 0.34375, 0.05000000074505806, 0.05000000074505806], [0.543749988079071, 0.34375, 0.02500000037252903, 0.02500000037252903], [0.543749988079071, 0.34375, 0.05000000074505806, 0.05000000074505806], [0.5562499761581421, 0.34375, 0.02500000037252903, 0.02500000037252903], [0.5562499761581421, 0.34375, 0.05000000074505806, 0.05000000074505806], [0.5687500238418579, 0.34375, 0.02500000037252903, 0.02500000037252903], [0.5687500238418579, 0.34375, 0.05000000074505806, 0.05000000074505806], [0.581250011920929, 0.34375, 0.02500000037252903, 0.02500000037252903], [0.581250011920929, 0.34375, 0.05000000074505806, 0.05000000074505806], [0.59375, 0.34375, 0.02500000037252903, 0.02500000037252903], [0.59375, 0.34375, 0.05000000074505806, 0.05000000074505806], [0.606249988079071, 0.34375, 0.02500000037252903, 0.02500000037252903], [0.606249988079071, 0.34375, 0.05000000074505806, 0.05000000074505806], [0.6187499761581421, 0.34375, 0.02500000037252903, 0.02500000037252903], [0.6187499761581421, 0.34375, 0.05000000074505806, 0.05000000074505806], [0.6312500238418579, 0.34375, 0.02500000037252903, 0.02500000037252903], [0.6312500238418579, 0.34375, 0.05000000074505806, 0.05000000074505806], [0.643750011920929, 0.34375, 0.02500000037252903, 0.02500000037252903], [0.643750011920929, 0.34375, 0.05000000074505806, 0.05000000074505806], [0.65625, 0.34375, 0.02500000037252903, 0.02500000037252903], [0.65625, 0.34375, 0.05000000074505806, 0.05000000074505806], [0.668749988079071, 0.34375, 0.02500000037252903, 0.02500000037252903], [0.668749988079071, 0.34375, 0.05000000074505806, 0.05000000074505806], [0.6812499761581421, 0.34375, 0.02500000037252903, 0.02500000037252903], [0.6812499761581421, 0.34375, 0.05000000074505806, 0.05000000074505806], [0.6937500238418579, 0.34375, 0.02500000037252903, 0.02500000037252903], [0.6937500238418579, 0.34375, 0.05000000074505806, 0.05000000074505806], [0.706250011920929, 0.34375, 0.02500000037252903, 0.02500000037252903], [0.706250011920929, 0.34375, 0.05000000074505806, 0.05000000074505806], [0.71875, 0.34375, 0.02500000037252903, 0.02500000037252903], [0.71875, 0.34375, 0.05000000074505806, 0.05000000074505806], [0.731249988079071, 0.34375, 0.02500000037252903, 0.02500000037252903], [0.731249988079071, 0.34375, 0.05000000074505806, 0.05000000074505806], [0.7437499761581421, 0.34375, 0.02500000037252903, 0.02500000037252903], [0.7437499761581421, 0.34375, 0.05000000074505806, 0.05000000074505806], [0.7562500238418579, 0.34375, 0.02500000037252903, 0.02500000037252903], [0.7562500238418579, 0.34375, 0.05000000074505806, 0.05000000074505806], [0.768750011920929, 0.34375, 0.02500000037252903, 0.02500000037252903], [0.768750011920929, 0.34375, 0.05000000074505806, 0.05000000074505806], [0.78125, 0.34375, 0.02500000037252903, 0.02500000037252903], [0.78125, 0.34375, 0.05000000074505806, 0.05000000074505806], [0.793749988079071, 0.34375, 0.02500000037252903, 0.02500000037252903], [0.793749988079071, 0.34375, 0.05000000074505806, 0.05000000074505806], [0.8062499761581421, 0.34375, 0.02500000037252903, 0.02500000037252903], [0.8062499761581421, 0.34375, 0.05000000074505806, 0.05000000074505806], [0.8187500238418579, 0.34375, 0.02500000037252903, 0.02500000037252903], [0.8187500238418579, 0.34375, 0.05000000074505806, 0.05000000074505806], [0.831250011920929, 0.34375, 0.02500000037252903, 0.02500000037252903], [0.831250011920929, 0.34375, 0.05000000074505806, 0.05000000074505806], [0.84375, 0.34375, 0.02500000037252903, 0.02500000037252903], [0.84375, 0.34375, 0.05000000074505806, 0.05000000074505806], [0.856249988079071, 0.34375, 0.02500000037252903, 0.02500000037252903], [0.856249988079071, 0.34375, 0.05000000074505806, 0.05000000074505806], [0.8687499761581421, 0.34375, 0.02500000037252903, 0.02500000037252903], [0.8687499761581421, 0.34375, 0.05000000074505806, 0.05000000074505806], [0.8812500238418579, 0.34375, 0.02500000037252903, 0.02500000037252903], [0.8812500238418579, 0.34375, 0.05000000074505806, 0.05000000074505806], [0.893750011920929, 0.34375, 0.02500000037252903, 0.02500000037252903], [0.893750011920929, 0.34375, 0.05000000074505806, 0.05000000074505806], [0.90625, 0.34375, 0.02500000037252903, 0.02500000037252903], [0.90625, 0.34375, 0.05000000074505806, 0.05000000074505806], [0.918749988079071, 0.34375, 0.02500000037252903, 0.02500000037252903], [0.918749988079071, 0.34375, 0.05000000074505806, 0.05000000074505806], [0.9312499761581421, 0.34375, 0.02500000037252903, 0.02500000037252903], [0.9312499761581421, 0.34375, 0.05000000074505806, 0.05000000074505806], [0.9437500238418579, 0.34375, 0.02500000037252903, 0.02500000037252903], [0.9437500238418579, 0.34375, 0.05000000074505806, 0.05000000074505806], [0.956250011920929, 0.34375, 0.02500000037252903, 0.02500000037252903], [0.956250011920929, 0.34375, 0.05000000074505806, 0.05000000074505806], [0.96875, 0.34375, 0.02500000037252903, 0.02500000037252903], [0.96875, 0.34375, 0.05000000074505806, 0.05000000074505806], [0.981249988079071, 0.34375, 0.02500000037252903, 0.02500000037252903], [0.981249988079071, 0.34375, 0.05000000074505806, 0.05000000074505806], [0.9937499761581421, 0.34375, 0.02500000037252903, 0.02500000037252903], [0.9937499761581421, 0.34375, 0.05000000074505806, 0.05000000074505806], [0.0062500000931322575, 0.35624998807907104, 0.02500000037252903, 0.02500000037252903], [0.0062500000931322575, 0.35624998807907104, 0.05000000074505806, 0.05000000074505806], [0.01875000074505806, 0.35624998807907104, 0.02500000037252903, 0.02500000037252903], [0.01875000074505806, 0.35624998807907104, 0.05000000074505806, 0.05000000074505806], [0.03125, 0.35624998807907104, 0.02500000037252903, 0.02500000037252903], [0.03125, 0.35624998807907104, 0.05000000074505806, 0.05000000074505806], [0.04374999925494194, 0.35624998807907104, 0.02500000037252903, 0.02500000037252903], [0.04374999925494194, 0.35624998807907104, 0.05000000074505806, 0.05000000074505806], [0.05624999850988388, 0.35624998807907104, 0.02500000037252903, 0.02500000037252903], [0.05624999850988388, 0.35624998807907104, 0.05000000074505806, 0.05000000074505806], [0.06875000149011612, 0.35624998807907104, 0.02500000037252903, 0.02500000037252903], [0.06875000149011612, 0.35624998807907104, 0.05000000074505806, 0.05000000074505806], [0.08124999701976776, 0.35624998807907104, 0.02500000037252903, 0.02500000037252903], [0.08124999701976776, 0.35624998807907104, 0.05000000074505806, 0.05000000074505806], [0.09375, 0.35624998807907104, 0.02500000037252903, 0.02500000037252903], [0.09375, 0.35624998807907104, 0.05000000074505806, 0.05000000074505806], [0.10625000298023224, 0.35624998807907104, 0.02500000037252903, 0.02500000037252903], [0.10625000298023224, 0.35624998807907104, 0.05000000074505806, 0.05000000074505806], [0.11874999850988388, 0.35624998807907104, 0.02500000037252903, 0.02500000037252903], [0.11874999850988388, 0.35624998807907104, 0.05000000074505806, 0.05000000074505806], [0.13124999403953552, 0.35624998807907104, 0.02500000037252903, 0.02500000037252903], [0.13124999403953552, 0.35624998807907104, 0.05000000074505806, 0.05000000074505806], [0.14374999701976776, 0.35624998807907104, 0.02500000037252903, 0.02500000037252903], [0.14374999701976776, 0.35624998807907104, 0.05000000074505806, 0.05000000074505806], [0.15625, 0.35624998807907104, 0.02500000037252903, 0.02500000037252903], [0.15625, 0.35624998807907104, 0.05000000074505806, 0.05000000074505806], [0.16875000298023224, 0.35624998807907104, 0.02500000037252903, 0.02500000037252903], [0.16875000298023224, 0.35624998807907104, 0.05000000074505806, 0.05000000074505806], [0.18125000596046448, 0.35624998807907104, 0.02500000037252903, 0.02500000037252903], [0.18125000596046448, 0.35624998807907104, 0.05000000074505806, 0.05000000074505806], [0.19374999403953552, 0.35624998807907104, 0.02500000037252903, 0.02500000037252903], [0.19374999403953552, 0.35624998807907104, 0.05000000074505806, 0.05000000074505806], [0.20624999701976776, 0.35624998807907104, 0.02500000037252903, 0.02500000037252903], [0.20624999701976776, 0.35624998807907104, 0.05000000074505806, 0.05000000074505806], [0.21875, 0.35624998807907104, 0.02500000037252903, 0.02500000037252903], [0.21875, 0.35624998807907104, 0.05000000074505806, 0.05000000074505806], [0.23125000298023224, 0.35624998807907104, 0.02500000037252903, 0.02500000037252903], [0.23125000298023224, 0.35624998807907104, 0.05000000074505806, 0.05000000074505806], [0.24375000596046448, 0.35624998807907104, 0.02500000037252903, 0.02500000037252903], [0.24375000596046448, 0.35624998807907104, 0.05000000074505806, 0.05000000074505806], [0.2562499940395355, 0.35624998807907104, 0.02500000037252903, 0.02500000037252903], [0.2562499940395355, 0.35624998807907104, 0.05000000074505806, 0.05000000074505806], [0.26875001192092896, 0.35624998807907104, 0.02500000037252903, 0.02500000037252903], [0.26875001192092896, 0.35624998807907104, 0.05000000074505806, 0.05000000074505806], [0.28125, 0.35624998807907104, 0.02500000037252903, 0.02500000037252903], [0.28125, 0.35624998807907104, 0.05000000074505806, 0.05000000074505806], [0.29374998807907104, 0.35624998807907104, 0.02500000037252903, 0.02500000037252903], [0.29374998807907104, 0.35624998807907104, 0.05000000074505806, 0.05000000074505806], [0.3062500059604645, 0.35624998807907104, 0.02500000037252903, 0.02500000037252903], [0.3062500059604645, 0.35624998807907104, 0.05000000074505806, 0.05000000074505806], [0.3187499940395355, 0.35624998807907104, 0.02500000037252903, 0.02500000037252903], [0.3187499940395355, 0.35624998807907104, 0.05000000074505806, 0.05000000074505806], [0.33125001192092896, 0.35624998807907104, 0.02500000037252903, 0.02500000037252903], [0.33125001192092896, 0.35624998807907104, 0.05000000074505806, 0.05000000074505806], [0.34375, 0.35624998807907104, 0.02500000037252903, 0.02500000037252903], [0.34375, 0.35624998807907104, 0.05000000074505806, 0.05000000074505806], [0.35624998807907104, 0.35624998807907104, 0.02500000037252903, 0.02500000037252903], [0.35624998807907104, 0.35624998807907104, 0.05000000074505806, 0.05000000074505806], [0.3687500059604645, 0.35624998807907104, 0.02500000037252903, 0.02500000037252903], [0.3687500059604645, 0.35624998807907104, 0.05000000074505806, 0.05000000074505806], [0.3812499940395355, 0.35624998807907104, 0.02500000037252903, 0.02500000037252903], [0.3812499940395355, 0.35624998807907104, 0.05000000074505806, 0.05000000074505806], [0.39375001192092896, 0.35624998807907104, 0.02500000037252903, 0.02500000037252903], [0.39375001192092896, 0.35624998807907104, 0.05000000074505806, 0.05000000074505806], [0.40625, 0.35624998807907104, 0.02500000037252903, 0.02500000037252903], [0.40625, 0.35624998807907104, 0.05000000074505806, 0.05000000074505806], [0.41874998807907104, 0.35624998807907104, 0.02500000037252903, 0.02500000037252903], [0.41874998807907104, 0.35624998807907104, 0.05000000074505806, 0.05000000074505806], [0.4312500059604645, 0.35624998807907104, 0.02500000037252903, 0.02500000037252903], [0.4312500059604645, 0.35624998807907104, 0.05000000074505806, 0.05000000074505806], [0.4437499940395355, 0.35624998807907104, 0.02500000037252903, 0.02500000037252903], [0.4437499940395355, 0.35624998807907104, 0.05000000074505806, 0.05000000074505806], [0.45625001192092896, 0.35624998807907104, 0.02500000037252903, 0.02500000037252903], [0.45625001192092896, 0.35624998807907104, 0.05000000074505806, 0.05000000074505806], [0.46875, 0.35624998807907104, 0.02500000037252903, 0.02500000037252903], [0.46875, 0.35624998807907104, 0.05000000074505806, 0.05000000074505806], [0.48124998807907104, 0.35624998807907104, 0.02500000037252903, 0.02500000037252903], [0.48124998807907104, 0.35624998807907104, 0.05000000074505806, 0.05000000074505806], [0.4937500059604645, 0.35624998807907104, 0.02500000037252903, 0.02500000037252903], [0.4937500059604645, 0.35624998807907104, 0.05000000074505806, 0.05000000074505806], [0.5062500238418579, 0.35624998807907104, 0.02500000037252903, 0.02500000037252903], [0.5062500238418579, 0.35624998807907104, 0.05000000074505806, 0.05000000074505806], [0.518750011920929, 0.35624998807907104, 0.02500000037252903, 0.02500000037252903], [0.518750011920929, 0.35624998807907104, 0.05000000074505806, 0.05000000074505806], [0.53125, 0.35624998807907104, 0.02500000037252903, 0.02500000037252903], [0.53125, 0.35624998807907104, 0.05000000074505806, 0.05000000074505806], [0.543749988079071, 0.35624998807907104, 0.02500000037252903, 0.02500000037252903], [0.543749988079071, 0.35624998807907104, 0.05000000074505806, 0.05000000074505806], [0.5562499761581421, 0.35624998807907104, 0.02500000037252903, 0.02500000037252903], [0.5562499761581421, 0.35624998807907104, 0.05000000074505806, 0.05000000074505806], [0.5687500238418579, 0.35624998807907104, 0.02500000037252903, 0.02500000037252903], [0.5687500238418579, 0.35624998807907104, 0.05000000074505806, 0.05000000074505806], [0.581250011920929, 0.35624998807907104, 0.02500000037252903, 0.02500000037252903], [0.581250011920929, 0.35624998807907104, 0.05000000074505806, 0.05000000074505806], [0.59375, 0.35624998807907104, 0.02500000037252903, 0.02500000037252903], [0.59375, 0.35624998807907104, 0.05000000074505806, 0.05000000074505806], [0.606249988079071, 0.35624998807907104, 0.02500000037252903, 0.02500000037252903], [0.606249988079071, 0.35624998807907104, 0.05000000074505806, 0.05000000074505806], [0.6187499761581421, 0.35624998807907104, 0.02500000037252903, 0.02500000037252903], [0.6187499761581421, 0.35624998807907104, 0.05000000074505806, 0.05000000074505806], [0.6312500238418579, 0.35624998807907104, 0.02500000037252903, 0.02500000037252903], [0.6312500238418579, 0.35624998807907104, 0.05000000074505806, 0.05000000074505806], [0.643750011920929, 0.35624998807907104, 0.02500000037252903, 0.02500000037252903], [0.643750011920929, 0.35624998807907104, 0.05000000074505806, 0.05000000074505806], [0.65625, 0.35624998807907104, 0.02500000037252903, 0.02500000037252903], [0.65625, 0.35624998807907104, 0.05000000074505806, 0.05000000074505806], [0.668749988079071, 0.35624998807907104, 0.02500000037252903, 0.02500000037252903], [0.668749988079071, 0.35624998807907104, 0.05000000074505806, 0.05000000074505806], [0.6812499761581421, 0.35624998807907104, 0.02500000037252903, 0.02500000037252903], [0.6812499761581421, 0.35624998807907104, 0.05000000074505806, 0.05000000074505806], [0.6937500238418579, 0.35624998807907104, 0.02500000037252903, 0.02500000037252903], [0.6937500238418579, 0.35624998807907104, 0.05000000074505806, 0.05000000074505806], [0.706250011920929, 0.35624998807907104, 0.02500000037252903, 0.02500000037252903], [0.706250011920929, 0.35624998807907104, 0.05000000074505806, 0.05000000074505806], [0.71875, 0.35624998807907104, 0.02500000037252903, 0.02500000037252903], [0.71875, 0.35624998807907104, 0.05000000074505806, 0.05000000074505806], [0.731249988079071, 0.35624998807907104, 0.02500000037252903, 0.02500000037252903], [0.731249988079071, 0.35624998807907104, 0.05000000074505806, 0.05000000074505806], [0.7437499761581421, 0.35624998807907104, 0.02500000037252903, 0.02500000037252903], [0.7437499761581421, 0.35624998807907104, 0.05000000074505806, 0.05000000074505806], [0.7562500238418579, 0.35624998807907104, 0.02500000037252903, 0.02500000037252903], [0.7562500238418579, 0.35624998807907104, 0.05000000074505806, 0.05000000074505806], [0.768750011920929, 0.35624998807907104, 0.02500000037252903, 0.02500000037252903], [0.768750011920929, 0.35624998807907104, 0.05000000074505806, 0.05000000074505806], [0.78125, 0.35624998807907104, 0.02500000037252903, 0.02500000037252903], [0.78125, 0.35624998807907104, 0.05000000074505806, 0.05000000074505806], [0.793749988079071, 0.35624998807907104, 0.02500000037252903, 0.02500000037252903], [0.793749988079071, 0.35624998807907104, 0.05000000074505806, 0.05000000074505806], [0.8062499761581421, 0.35624998807907104, 0.02500000037252903, 0.02500000037252903], [0.8062499761581421, 0.35624998807907104, 0.05000000074505806, 0.05000000074505806], [0.8187500238418579, 0.35624998807907104, 0.02500000037252903, 0.02500000037252903], [0.8187500238418579, 0.35624998807907104, 0.05000000074505806, 0.05000000074505806], [0.831250011920929, 0.35624998807907104, 0.02500000037252903, 0.02500000037252903], [0.831250011920929, 0.35624998807907104, 0.05000000074505806, 0.05000000074505806], [0.84375, 0.35624998807907104, 0.02500000037252903, 0.02500000037252903], [0.84375, 0.35624998807907104, 0.05000000074505806, 0.05000000074505806], [0.856249988079071, 0.35624998807907104, 0.02500000037252903, 0.02500000037252903], [0.856249988079071, 0.35624998807907104, 0.05000000074505806, 0.05000000074505806], [0.8687499761581421, 0.35624998807907104, 0.02500000037252903, 0.02500000037252903], [0.8687499761581421, 0.35624998807907104, 0.05000000074505806, 0.05000000074505806], [0.8812500238418579, 0.35624998807907104, 0.02500000037252903, 0.02500000037252903], [0.8812500238418579, 0.35624998807907104, 0.05000000074505806, 0.05000000074505806], [0.893750011920929, 0.35624998807907104, 0.02500000037252903, 0.02500000037252903], [0.893750011920929, 0.35624998807907104, 0.05000000074505806, 0.05000000074505806], [0.90625, 0.35624998807907104, 0.02500000037252903, 0.02500000037252903], [0.90625, 0.35624998807907104, 0.05000000074505806, 0.05000000074505806], [0.918749988079071, 0.35624998807907104, 0.02500000037252903, 0.02500000037252903], [0.918749988079071, 0.35624998807907104, 0.05000000074505806, 0.05000000074505806], [0.9312499761581421, 0.35624998807907104, 0.02500000037252903, 0.02500000037252903], [0.9312499761581421, 0.35624998807907104, 0.05000000074505806, 0.05000000074505806], [0.9437500238418579, 0.35624998807907104, 0.02500000037252903, 0.02500000037252903], [0.9437500238418579, 0.35624998807907104, 0.05000000074505806, 0.05000000074505806], [0.956250011920929, 0.35624998807907104, 0.02500000037252903, 0.02500000037252903], [0.956250011920929, 0.35624998807907104, 0.05000000074505806, 0.05000000074505806], [0.96875, 0.35624998807907104, 0.02500000037252903, 0.02500000037252903], [0.96875, 0.35624998807907104, 0.05000000074505806, 0.05000000074505806], [0.981249988079071, 0.35624998807907104, 0.02500000037252903, 0.02500000037252903], [0.981249988079071, 0.35624998807907104, 0.05000000074505806, 0.05000000074505806], [0.9937499761581421, 0.35624998807907104, 0.02500000037252903, 0.02500000037252903], [0.9937499761581421, 0.35624998807907104, 0.05000000074505806, 0.05000000074505806], [0.0062500000931322575, 0.3687500059604645, 0.02500000037252903, 0.02500000037252903], [0.0062500000931322575, 0.3687500059604645, 0.05000000074505806, 0.05000000074505806], [0.01875000074505806, 0.3687500059604645, 0.02500000037252903, 0.02500000037252903], [0.01875000074505806, 0.3687500059604645, 0.05000000074505806, 0.05000000074505806], [0.03125, 0.3687500059604645, 0.02500000037252903, 0.02500000037252903], [0.03125, 0.3687500059604645, 0.05000000074505806, 0.05000000074505806], [0.04374999925494194, 0.3687500059604645, 0.02500000037252903, 0.02500000037252903], [0.04374999925494194, 0.3687500059604645, 0.05000000074505806, 0.05000000074505806], [0.05624999850988388, 0.3687500059604645, 0.02500000037252903, 0.02500000037252903], [0.05624999850988388, 0.3687500059604645, 0.05000000074505806, 0.05000000074505806], [0.06875000149011612, 0.3687500059604645, 0.02500000037252903, 0.02500000037252903], [0.06875000149011612, 0.3687500059604645, 0.05000000074505806, 0.05000000074505806], [0.08124999701976776, 0.3687500059604645, 0.02500000037252903, 0.02500000037252903], [0.08124999701976776, 0.3687500059604645, 0.05000000074505806, 0.05000000074505806], [0.09375, 0.3687500059604645, 0.02500000037252903, 0.02500000037252903], [0.09375, 0.3687500059604645, 0.05000000074505806, 0.05000000074505806], [0.10625000298023224, 0.3687500059604645, 0.02500000037252903, 0.02500000037252903], [0.10625000298023224, 0.3687500059604645, 0.05000000074505806, 0.05000000074505806], [0.11874999850988388, 0.3687500059604645, 0.02500000037252903, 0.02500000037252903], [0.11874999850988388, 0.3687500059604645, 0.05000000074505806, 0.05000000074505806], [0.13124999403953552, 0.3687500059604645, 0.02500000037252903, 0.02500000037252903], [0.13124999403953552, 0.3687500059604645, 0.05000000074505806, 0.05000000074505806], [0.14374999701976776, 0.3687500059604645, 0.02500000037252903, 0.02500000037252903], [0.14374999701976776, 0.3687500059604645, 0.05000000074505806, 0.05000000074505806], [0.15625, 0.3687500059604645, 0.02500000037252903, 0.02500000037252903], [0.15625, 0.3687500059604645, 0.05000000074505806, 0.05000000074505806], [0.16875000298023224, 0.3687500059604645, 0.02500000037252903, 0.02500000037252903], [0.16875000298023224, 0.3687500059604645, 0.05000000074505806, 0.05000000074505806], [0.18125000596046448, 0.3687500059604645, 0.02500000037252903, 0.02500000037252903], [0.18125000596046448, 0.3687500059604645, 0.05000000074505806, 0.05000000074505806], [0.19374999403953552, 0.3687500059604645, 0.02500000037252903, 0.02500000037252903], [0.19374999403953552, 0.3687500059604645, 0.05000000074505806, 0.05000000074505806], [0.20624999701976776, 0.3687500059604645, 0.02500000037252903, 0.02500000037252903], [0.20624999701976776, 0.3687500059604645, 0.05000000074505806, 0.05000000074505806], [0.21875, 0.3687500059604645, 0.02500000037252903, 0.02500000037252903], [0.21875, 0.3687500059604645, 0.05000000074505806, 0.05000000074505806], [0.23125000298023224, 0.3687500059604645, 0.02500000037252903, 0.02500000037252903], [0.23125000298023224, 0.3687500059604645, 0.05000000074505806, 0.05000000074505806], [0.24375000596046448, 0.3687500059604645, 0.02500000037252903, 0.02500000037252903], [0.24375000596046448, 0.3687500059604645, 0.05000000074505806, 0.05000000074505806], [0.2562499940395355, 0.3687500059604645, 0.02500000037252903, 0.02500000037252903], [0.2562499940395355, 0.3687500059604645, 0.05000000074505806, 0.05000000074505806], [0.26875001192092896, 0.3687500059604645, 0.02500000037252903, 0.02500000037252903], [0.26875001192092896, 0.3687500059604645, 0.05000000074505806, 0.05000000074505806], [0.28125, 0.3687500059604645, 0.02500000037252903, 0.02500000037252903], [0.28125, 0.3687500059604645, 0.05000000074505806, 0.05000000074505806], [0.29374998807907104, 0.3687500059604645, 0.02500000037252903, 0.02500000037252903], [0.29374998807907104, 0.3687500059604645, 0.05000000074505806, 0.05000000074505806], [0.3062500059604645, 0.3687500059604645, 0.02500000037252903, 0.02500000037252903], [0.3062500059604645, 0.3687500059604645, 0.05000000074505806, 0.05000000074505806], [0.3187499940395355, 0.3687500059604645, 0.02500000037252903, 0.02500000037252903], [0.3187499940395355, 0.3687500059604645, 0.05000000074505806, 0.05000000074505806], [0.33125001192092896, 0.3687500059604645, 0.02500000037252903, 0.02500000037252903], [0.33125001192092896, 0.3687500059604645, 0.05000000074505806, 0.05000000074505806], [0.34375, 0.3687500059604645, 0.02500000037252903, 0.02500000037252903], [0.34375, 0.3687500059604645, 0.05000000074505806, 0.05000000074505806], [0.35624998807907104, 0.3687500059604645, 0.02500000037252903, 0.02500000037252903], [0.35624998807907104, 0.3687500059604645, 0.05000000074505806, 0.05000000074505806], [0.3687500059604645, 0.3687500059604645, 0.02500000037252903, 0.02500000037252903], [0.3687500059604645, 0.3687500059604645, 0.05000000074505806, 0.05000000074505806], [0.3812499940395355, 0.3687500059604645, 0.02500000037252903, 0.02500000037252903], [0.3812499940395355, 0.3687500059604645, 0.05000000074505806, 0.05000000074505806], [0.39375001192092896, 0.3687500059604645, 0.02500000037252903, 0.02500000037252903], [0.39375001192092896, 0.3687500059604645, 0.05000000074505806, 0.05000000074505806], [0.40625, 0.3687500059604645, 0.02500000037252903, 0.02500000037252903], [0.40625, 0.3687500059604645, 0.05000000074505806, 0.05000000074505806], [0.41874998807907104, 0.3687500059604645, 0.02500000037252903, 0.02500000037252903], [0.41874998807907104, 0.3687500059604645, 0.05000000074505806, 0.05000000074505806], [0.4312500059604645, 0.3687500059604645, 0.02500000037252903, 0.02500000037252903], [0.4312500059604645, 0.3687500059604645, 0.05000000074505806, 0.05000000074505806], [0.4437499940395355, 0.3687500059604645, 0.02500000037252903, 0.02500000037252903], [0.4437499940395355, 0.3687500059604645, 0.05000000074505806, 0.05000000074505806], [0.45625001192092896, 0.3687500059604645, 0.02500000037252903, 0.02500000037252903], [0.45625001192092896, 0.3687500059604645, 0.05000000074505806, 0.05000000074505806], [0.46875, 0.3687500059604645, 0.02500000037252903, 0.02500000037252903], [0.46875, 0.3687500059604645, 0.05000000074505806, 0.05000000074505806], [0.48124998807907104, 0.3687500059604645, 0.02500000037252903, 0.02500000037252903], [0.48124998807907104, 0.3687500059604645, 0.05000000074505806, 0.05000000074505806], [0.4937500059604645, 0.3687500059604645, 0.02500000037252903, 0.02500000037252903], [0.4937500059604645, 0.3687500059604645, 0.05000000074505806, 0.05000000074505806], [0.5062500238418579, 0.3687500059604645, 0.02500000037252903, 0.02500000037252903], [0.5062500238418579, 0.3687500059604645, 0.05000000074505806, 0.05000000074505806], [0.518750011920929, 0.3687500059604645, 0.02500000037252903, 0.02500000037252903], [0.518750011920929, 0.3687500059604645, 0.05000000074505806, 0.05000000074505806], [0.53125, 0.3687500059604645, 0.02500000037252903, 0.02500000037252903], [0.53125, 0.3687500059604645, 0.05000000074505806, 0.05000000074505806], [0.543749988079071, 0.3687500059604645, 0.02500000037252903, 0.02500000037252903], [0.543749988079071, 0.3687500059604645, 0.05000000074505806, 0.05000000074505806], [0.5562499761581421, 0.3687500059604645, 0.02500000037252903, 0.02500000037252903], [0.5562499761581421, 0.3687500059604645, 0.05000000074505806, 0.05000000074505806], [0.5687500238418579, 0.3687500059604645, 0.02500000037252903, 0.02500000037252903], [0.5687500238418579, 0.3687500059604645, 0.05000000074505806, 0.05000000074505806], [0.581250011920929, 0.3687500059604645, 0.02500000037252903, 0.02500000037252903], [0.581250011920929, 0.3687500059604645, 0.05000000074505806, 0.05000000074505806], [0.59375, 0.3687500059604645, 0.02500000037252903, 0.02500000037252903], [0.59375, 0.3687500059604645, 0.05000000074505806, 0.05000000074505806], [0.606249988079071, 0.3687500059604645, 0.02500000037252903, 0.02500000037252903], [0.606249988079071, 0.3687500059604645, 0.05000000074505806, 0.05000000074505806], [0.6187499761581421, 0.3687500059604645, 0.02500000037252903, 0.02500000037252903], [0.6187499761581421, 0.3687500059604645, 0.05000000074505806, 0.05000000074505806], [0.6312500238418579, 0.3687500059604645, 0.02500000037252903, 0.02500000037252903], [0.6312500238418579, 0.3687500059604645, 0.05000000074505806, 0.05000000074505806], [0.643750011920929, 0.3687500059604645, 0.02500000037252903, 0.02500000037252903], [0.643750011920929, 0.3687500059604645, 0.05000000074505806, 0.05000000074505806], [0.65625, 0.3687500059604645, 0.02500000037252903, 0.02500000037252903], [0.65625, 0.3687500059604645, 0.05000000074505806, 0.05000000074505806], [0.668749988079071, 0.3687500059604645, 0.02500000037252903, 0.02500000037252903], [0.668749988079071, 0.3687500059604645, 0.05000000074505806, 0.05000000074505806], [0.6812499761581421, 0.3687500059604645, 0.02500000037252903, 0.02500000037252903], [0.6812499761581421, 0.3687500059604645, 0.05000000074505806, 0.05000000074505806], [0.6937500238418579, 0.3687500059604645, 0.02500000037252903, 0.02500000037252903], [0.6937500238418579, 0.3687500059604645, 0.05000000074505806, 0.05000000074505806], [0.706250011920929, 0.3687500059604645, 0.02500000037252903, 0.02500000037252903], [0.706250011920929, 0.3687500059604645, 0.05000000074505806, 0.05000000074505806], [0.71875, 0.3687500059604645, 0.02500000037252903, 0.02500000037252903], [0.71875, 0.3687500059604645, 0.05000000074505806, 0.05000000074505806], [0.731249988079071, 0.3687500059604645, 0.02500000037252903, 0.02500000037252903], [0.731249988079071, 0.3687500059604645, 0.05000000074505806, 0.05000000074505806], [0.7437499761581421, 0.3687500059604645, 0.02500000037252903, 0.02500000037252903], [0.7437499761581421, 0.3687500059604645, 0.05000000074505806, 0.05000000074505806], [0.7562500238418579, 0.3687500059604645, 0.02500000037252903, 0.02500000037252903], [0.7562500238418579, 0.3687500059604645, 0.05000000074505806, 0.05000000074505806], [0.768750011920929, 0.3687500059604645, 0.02500000037252903, 0.02500000037252903], [0.768750011920929, 0.3687500059604645, 0.05000000074505806, 0.05000000074505806], [0.78125, 0.3687500059604645, 0.02500000037252903, 0.02500000037252903], [0.78125, 0.3687500059604645, 0.05000000074505806, 0.05000000074505806], [0.793749988079071, 0.3687500059604645, 0.02500000037252903, 0.02500000037252903], [0.793749988079071, 0.3687500059604645, 0.05000000074505806, 0.05000000074505806], [0.8062499761581421, 0.3687500059604645, 0.02500000037252903, 0.02500000037252903], [0.8062499761581421, 0.3687500059604645, 0.05000000074505806, 0.05000000074505806], [0.8187500238418579, 0.3687500059604645, 0.02500000037252903, 0.02500000037252903], [0.8187500238418579, 0.3687500059604645, 0.05000000074505806, 0.05000000074505806], [0.831250011920929, 0.3687500059604645, 0.02500000037252903, 0.02500000037252903], [0.831250011920929, 0.3687500059604645, 0.05000000074505806, 0.05000000074505806], [0.84375, 0.3687500059604645, 0.02500000037252903, 0.02500000037252903], [0.84375, 0.3687500059604645, 0.05000000074505806, 0.05000000074505806], [0.856249988079071, 0.3687500059604645, 0.02500000037252903, 0.02500000037252903], [0.856249988079071, 0.3687500059604645, 0.05000000074505806, 0.05000000074505806], [0.8687499761581421, 0.3687500059604645, 0.02500000037252903, 0.02500000037252903], [0.8687499761581421, 0.3687500059604645, 0.05000000074505806, 0.05000000074505806], [0.8812500238418579, 0.3687500059604645, 0.02500000037252903, 0.02500000037252903], [0.8812500238418579, 0.3687500059604645, 0.05000000074505806, 0.05000000074505806], [0.893750011920929, 0.3687500059604645, 0.02500000037252903, 0.02500000037252903], [0.893750011920929, 0.3687500059604645, 0.05000000074505806, 0.05000000074505806], [0.90625, 0.3687500059604645, 0.02500000037252903, 0.02500000037252903], [0.90625, 0.3687500059604645, 0.05000000074505806, 0.05000000074505806], [0.918749988079071, 0.3687500059604645, 0.02500000037252903, 0.02500000037252903], [0.918749988079071, 0.3687500059604645, 0.05000000074505806, 0.05000000074505806], [0.9312499761581421, 0.3687500059604645, 0.02500000037252903, 0.02500000037252903], [0.9312499761581421, 0.3687500059604645, 0.05000000074505806, 0.05000000074505806], [0.9437500238418579, 0.3687500059604645, 0.02500000037252903, 0.02500000037252903], [0.9437500238418579, 0.3687500059604645, 0.05000000074505806, 0.05000000074505806], [0.956250011920929, 0.3687500059604645, 0.02500000037252903, 0.02500000037252903], [0.956250011920929, 0.3687500059604645, 0.05000000074505806, 0.05000000074505806], [0.96875, 0.3687500059604645, 0.02500000037252903, 0.02500000037252903], [0.96875, 0.3687500059604645, 0.05000000074505806, 0.05000000074505806], [0.981249988079071, 0.3687500059604645, 0.02500000037252903, 0.02500000037252903], [0.981249988079071, 0.3687500059604645, 0.05000000074505806, 0.05000000074505806], [0.9937499761581421, 0.3687500059604645, 0.02500000037252903, 0.02500000037252903], [0.9937499761581421, 0.3687500059604645, 0.05000000074505806, 0.05000000074505806], [0.0062500000931322575, 0.3812499940395355, 0.02500000037252903, 0.02500000037252903], [0.0062500000931322575, 0.3812499940395355, 0.05000000074505806, 0.05000000074505806], [0.01875000074505806, 0.3812499940395355, 0.02500000037252903, 0.02500000037252903], [0.01875000074505806, 0.3812499940395355, 0.05000000074505806, 0.05000000074505806], [0.03125, 0.3812499940395355, 0.02500000037252903, 0.02500000037252903], [0.03125, 0.3812499940395355, 0.05000000074505806, 0.05000000074505806], [0.04374999925494194, 0.3812499940395355, 0.02500000037252903, 0.02500000037252903], [0.04374999925494194, 0.3812499940395355, 0.05000000074505806, 0.05000000074505806], [0.05624999850988388, 0.3812499940395355, 0.02500000037252903, 0.02500000037252903], [0.05624999850988388, 0.3812499940395355, 0.05000000074505806, 0.05000000074505806], [0.06875000149011612, 0.3812499940395355, 0.02500000037252903, 0.02500000037252903], [0.06875000149011612, 0.3812499940395355, 0.05000000074505806, 0.05000000074505806], [0.08124999701976776, 0.3812499940395355, 0.02500000037252903, 0.02500000037252903], [0.08124999701976776, 0.3812499940395355, 0.05000000074505806, 0.05000000074505806], [0.09375, 0.3812499940395355, 0.02500000037252903, 0.02500000037252903], [0.09375, 0.3812499940395355, 0.05000000074505806, 0.05000000074505806], [0.10625000298023224, 0.3812499940395355, 0.02500000037252903, 0.02500000037252903], [0.10625000298023224, 0.3812499940395355, 0.05000000074505806, 0.05000000074505806], [0.11874999850988388, 0.3812499940395355, 0.02500000037252903, 0.02500000037252903], [0.11874999850988388, 0.3812499940395355, 0.05000000074505806, 0.05000000074505806], [0.13124999403953552, 0.3812499940395355, 0.02500000037252903, 0.02500000037252903], [0.13124999403953552, 0.3812499940395355, 0.05000000074505806, 0.05000000074505806], [0.14374999701976776, 0.3812499940395355, 0.02500000037252903, 0.02500000037252903], [0.14374999701976776, 0.3812499940395355, 0.05000000074505806, 0.05000000074505806], [0.15625, 0.3812499940395355, 0.02500000037252903, 0.02500000037252903], [0.15625, 0.3812499940395355, 0.05000000074505806, 0.05000000074505806], [0.16875000298023224, 0.3812499940395355, 0.02500000037252903, 0.02500000037252903], [0.16875000298023224, 0.3812499940395355, 0.05000000074505806, 0.05000000074505806], [0.18125000596046448, 0.3812499940395355, 0.02500000037252903, 0.02500000037252903], [0.18125000596046448, 0.3812499940395355, 0.05000000074505806, 0.05000000074505806], [0.19374999403953552, 0.3812499940395355, 0.02500000037252903, 0.02500000037252903], [0.19374999403953552, 0.3812499940395355, 0.05000000074505806, 0.05000000074505806], [0.20624999701976776, 0.3812499940395355, 0.02500000037252903, 0.02500000037252903], [0.20624999701976776, 0.3812499940395355, 0.05000000074505806, 0.05000000074505806], [0.21875, 0.3812499940395355, 0.02500000037252903, 0.02500000037252903], [0.21875, 0.3812499940395355, 0.05000000074505806, 0.05000000074505806], [0.23125000298023224, 0.3812499940395355, 0.02500000037252903, 0.02500000037252903], [0.23125000298023224, 0.3812499940395355, 0.05000000074505806, 0.05000000074505806], [0.24375000596046448, 0.3812499940395355, 0.02500000037252903, 0.02500000037252903], [0.24375000596046448, 0.3812499940395355, 0.05000000074505806, 0.05000000074505806], [0.2562499940395355, 0.3812499940395355, 0.02500000037252903, 0.02500000037252903], [0.2562499940395355, 0.3812499940395355, 0.05000000074505806, 0.05000000074505806], [0.26875001192092896, 0.3812499940395355, 0.02500000037252903, 0.02500000037252903], [0.26875001192092896, 0.3812499940395355, 0.05000000074505806, 0.05000000074505806], [0.28125, 0.3812499940395355, 0.02500000037252903, 0.02500000037252903], [0.28125, 0.3812499940395355, 0.05000000074505806, 0.05000000074505806], [0.29374998807907104, 0.3812499940395355, 0.02500000037252903, 0.02500000037252903], [0.29374998807907104, 0.3812499940395355, 0.05000000074505806, 0.05000000074505806], [0.3062500059604645, 0.3812499940395355, 0.02500000037252903, 0.02500000037252903], [0.3062500059604645, 0.3812499940395355, 0.05000000074505806, 0.05000000074505806], [0.3187499940395355, 0.3812499940395355, 0.02500000037252903, 0.02500000037252903], [0.3187499940395355, 0.3812499940395355, 0.05000000074505806, 0.05000000074505806], [0.33125001192092896, 0.3812499940395355, 0.02500000037252903, 0.02500000037252903], [0.33125001192092896, 0.3812499940395355, 0.05000000074505806, 0.05000000074505806], [0.34375, 0.3812499940395355, 0.02500000037252903, 0.02500000037252903], [0.34375, 0.3812499940395355, 0.05000000074505806, 0.05000000074505806], [0.35624998807907104, 0.3812499940395355, 0.02500000037252903, 0.02500000037252903], [0.35624998807907104, 0.3812499940395355, 0.05000000074505806, 0.05000000074505806], [0.3687500059604645, 0.3812499940395355, 0.02500000037252903, 0.02500000037252903], [0.3687500059604645, 0.3812499940395355, 0.05000000074505806, 0.05000000074505806], [0.3812499940395355, 0.3812499940395355, 0.02500000037252903, 0.02500000037252903], [0.3812499940395355, 0.3812499940395355, 0.05000000074505806, 0.05000000074505806], [0.39375001192092896, 0.3812499940395355, 0.02500000037252903, 0.02500000037252903], [0.39375001192092896, 0.3812499940395355, 0.05000000074505806, 0.05000000074505806], [0.40625, 0.3812499940395355, 0.02500000037252903, 0.02500000037252903], [0.40625, 0.3812499940395355, 0.05000000074505806, 0.05000000074505806], [0.41874998807907104, 0.3812499940395355, 0.02500000037252903, 0.02500000037252903], [0.41874998807907104, 0.3812499940395355, 0.05000000074505806, 0.05000000074505806], [0.4312500059604645, 0.3812499940395355, 0.02500000037252903, 0.02500000037252903], [0.4312500059604645, 0.3812499940395355, 0.05000000074505806, 0.05000000074505806], [0.4437499940395355, 0.3812499940395355, 0.02500000037252903, 0.02500000037252903], [0.4437499940395355, 0.3812499940395355, 0.05000000074505806, 0.05000000074505806], [0.45625001192092896, 0.3812499940395355, 0.02500000037252903, 0.02500000037252903], [0.45625001192092896, 0.3812499940395355, 0.05000000074505806, 0.05000000074505806], [0.46875, 0.3812499940395355, 0.02500000037252903, 0.02500000037252903], [0.46875, 0.3812499940395355, 0.05000000074505806, 0.05000000074505806], [0.48124998807907104, 0.3812499940395355, 0.02500000037252903, 0.02500000037252903], [0.48124998807907104, 0.3812499940395355, 0.05000000074505806, 0.05000000074505806], [0.4937500059604645, 0.3812499940395355, 0.02500000037252903, 0.02500000037252903], [0.4937500059604645, 0.3812499940395355, 0.05000000074505806, 0.05000000074505806], [0.5062500238418579, 0.3812499940395355, 0.02500000037252903, 0.02500000037252903], [0.5062500238418579, 0.3812499940395355, 0.05000000074505806, 0.05000000074505806], [0.518750011920929, 0.3812499940395355, 0.02500000037252903, 0.02500000037252903], [0.518750011920929, 0.3812499940395355, 0.05000000074505806, 0.05000000074505806], [0.53125, 0.3812499940395355, 0.02500000037252903, 0.02500000037252903], [0.53125, 0.3812499940395355, 0.05000000074505806, 0.05000000074505806], [0.543749988079071, 0.3812499940395355, 0.02500000037252903, 0.02500000037252903], [0.543749988079071, 0.3812499940395355, 0.05000000074505806, 0.05000000074505806], [0.5562499761581421, 0.3812499940395355, 0.02500000037252903, 0.02500000037252903], [0.5562499761581421, 0.3812499940395355, 0.05000000074505806, 0.05000000074505806], [0.5687500238418579, 0.3812499940395355, 0.02500000037252903, 0.02500000037252903], [0.5687500238418579, 0.3812499940395355, 0.05000000074505806, 0.05000000074505806], [0.581250011920929, 0.3812499940395355, 0.02500000037252903, 0.02500000037252903], [0.581250011920929, 0.3812499940395355, 0.05000000074505806, 0.05000000074505806], [0.59375, 0.3812499940395355, 0.02500000037252903, 0.02500000037252903], [0.59375, 0.3812499940395355, 0.05000000074505806, 0.05000000074505806], [0.606249988079071, 0.3812499940395355, 0.02500000037252903, 0.02500000037252903], [0.606249988079071, 0.3812499940395355, 0.05000000074505806, 0.05000000074505806], [0.6187499761581421, 0.3812499940395355, 0.02500000037252903, 0.02500000037252903], [0.6187499761581421, 0.3812499940395355, 0.05000000074505806, 0.05000000074505806], [0.6312500238418579, 0.3812499940395355, 0.02500000037252903, 0.02500000037252903], [0.6312500238418579, 0.3812499940395355, 0.05000000074505806, 0.05000000074505806], [0.643750011920929, 0.3812499940395355, 0.02500000037252903, 0.02500000037252903], [0.643750011920929, 0.3812499940395355, 0.05000000074505806, 0.05000000074505806], [0.65625, 0.3812499940395355, 0.02500000037252903, 0.02500000037252903], [0.65625, 0.3812499940395355, 0.05000000074505806, 0.05000000074505806], [0.668749988079071, 0.3812499940395355, 0.02500000037252903, 0.02500000037252903], [0.668749988079071, 0.3812499940395355, 0.05000000074505806, 0.05000000074505806], [0.6812499761581421, 0.3812499940395355, 0.02500000037252903, 0.02500000037252903], [0.6812499761581421, 0.3812499940395355, 0.05000000074505806, 0.05000000074505806], [0.6937500238418579, 0.3812499940395355, 0.02500000037252903, 0.02500000037252903], [0.6937500238418579, 0.3812499940395355, 0.05000000074505806, 0.05000000074505806], [0.706250011920929, 0.3812499940395355, 0.02500000037252903, 0.02500000037252903], [0.706250011920929, 0.3812499940395355, 0.05000000074505806, 0.05000000074505806], [0.71875, 0.3812499940395355, 0.02500000037252903, 0.02500000037252903], [0.71875, 0.3812499940395355, 0.05000000074505806, 0.05000000074505806], [0.731249988079071, 0.3812499940395355, 0.02500000037252903, 0.02500000037252903], [0.731249988079071, 0.3812499940395355, 0.05000000074505806, 0.05000000074505806], [0.7437499761581421, 0.3812499940395355, 0.02500000037252903, 0.02500000037252903], [0.7437499761581421, 0.3812499940395355, 0.05000000074505806, 0.05000000074505806], [0.7562500238418579, 0.3812499940395355, 0.02500000037252903, 0.02500000037252903], [0.7562500238418579, 0.3812499940395355, 0.05000000074505806, 0.05000000074505806], [0.768750011920929, 0.3812499940395355, 0.02500000037252903, 0.02500000037252903], [0.768750011920929, 0.3812499940395355, 0.05000000074505806, 0.05000000074505806], [0.78125, 0.3812499940395355, 0.02500000037252903, 0.02500000037252903], [0.78125, 0.3812499940395355, 0.05000000074505806, 0.05000000074505806], [0.793749988079071, 0.3812499940395355, 0.02500000037252903, 0.02500000037252903], [0.793749988079071, 0.3812499940395355, 0.05000000074505806, 0.05000000074505806], [0.8062499761581421, 0.3812499940395355, 0.02500000037252903, 0.02500000037252903], [0.8062499761581421, 0.3812499940395355, 0.05000000074505806, 0.05000000074505806], [0.8187500238418579, 0.3812499940395355, 0.02500000037252903, 0.02500000037252903], [0.8187500238418579, 0.3812499940395355, 0.05000000074505806, 0.05000000074505806], [0.831250011920929, 0.3812499940395355, 0.02500000037252903, 0.02500000037252903], [0.831250011920929, 0.3812499940395355, 0.05000000074505806, 0.05000000074505806], [0.84375, 0.3812499940395355, 0.02500000037252903, 0.02500000037252903], [0.84375, 0.3812499940395355, 0.05000000074505806, 0.05000000074505806], [0.856249988079071, 0.3812499940395355, 0.02500000037252903, 0.02500000037252903], [0.856249988079071, 0.3812499940395355, 0.05000000074505806, 0.05000000074505806], [0.8687499761581421, 0.3812499940395355, 0.02500000037252903, 0.02500000037252903], [0.8687499761581421, 0.3812499940395355, 0.05000000074505806, 0.05000000074505806], [0.8812500238418579, 0.3812499940395355, 0.02500000037252903, 0.02500000037252903], [0.8812500238418579, 0.3812499940395355, 0.05000000074505806, 0.05000000074505806], [0.893750011920929, 0.3812499940395355, 0.02500000037252903, 0.02500000037252903], [0.893750011920929, 0.3812499940395355, 0.05000000074505806, 0.05000000074505806], [0.90625, 0.3812499940395355, 0.02500000037252903, 0.02500000037252903], [0.90625, 0.3812499940395355, 0.05000000074505806, 0.05000000074505806], [0.918749988079071, 0.3812499940395355, 0.02500000037252903, 0.02500000037252903], [0.918749988079071, 0.3812499940395355, 0.05000000074505806, 0.05000000074505806], [0.9312499761581421, 0.3812499940395355, 0.02500000037252903, 0.02500000037252903], [0.9312499761581421, 0.3812499940395355, 0.05000000074505806, 0.05000000074505806], [0.9437500238418579, 0.3812499940395355, 0.02500000037252903, 0.02500000037252903], [0.9437500238418579, 0.3812499940395355, 0.05000000074505806, 0.05000000074505806], [0.956250011920929, 0.3812499940395355, 0.02500000037252903, 0.02500000037252903], [0.956250011920929, 0.3812499940395355, 0.05000000074505806, 0.05000000074505806], [0.96875, 0.3812499940395355, 0.02500000037252903, 0.02500000037252903], [0.96875, 0.3812499940395355, 0.05000000074505806, 0.05000000074505806], [0.981249988079071, 0.3812499940395355, 0.02500000037252903, 0.02500000037252903], [0.981249988079071, 0.3812499940395355, 0.05000000074505806, 0.05000000074505806], [0.9937499761581421, 0.3812499940395355, 0.02500000037252903, 0.02500000037252903], [0.9937499761581421, 0.3812499940395355, 0.05000000074505806, 0.05000000074505806], [0.0062500000931322575, 0.39375001192092896, 0.02500000037252903, 0.02500000037252903], [0.0062500000931322575, 0.39375001192092896, 0.05000000074505806, 0.05000000074505806], [0.01875000074505806, 0.39375001192092896, 0.02500000037252903, 0.02500000037252903], [0.01875000074505806, 0.39375001192092896, 0.05000000074505806, 0.05000000074505806], [0.03125, 0.39375001192092896, 0.02500000037252903, 0.02500000037252903], [0.03125, 0.39375001192092896, 0.05000000074505806, 0.05000000074505806], [0.04374999925494194, 0.39375001192092896, 0.02500000037252903, 0.02500000037252903], [0.04374999925494194, 0.39375001192092896, 0.05000000074505806, 0.05000000074505806], [0.05624999850988388, 0.39375001192092896, 0.02500000037252903, 0.02500000037252903], [0.05624999850988388, 0.39375001192092896, 0.05000000074505806, 0.05000000074505806], [0.06875000149011612, 0.39375001192092896, 0.02500000037252903, 0.02500000037252903], [0.06875000149011612, 0.39375001192092896, 0.05000000074505806, 0.05000000074505806], [0.08124999701976776, 0.39375001192092896, 0.02500000037252903, 0.02500000037252903], [0.08124999701976776, 0.39375001192092896, 0.05000000074505806, 0.05000000074505806], [0.09375, 0.39375001192092896, 0.02500000037252903, 0.02500000037252903], [0.09375, 0.39375001192092896, 0.05000000074505806, 0.05000000074505806], [0.10625000298023224, 0.39375001192092896, 0.02500000037252903, 0.02500000037252903], [0.10625000298023224, 0.39375001192092896, 0.05000000074505806, 0.05000000074505806], [0.11874999850988388, 0.39375001192092896, 0.02500000037252903, 0.02500000037252903], [0.11874999850988388, 0.39375001192092896, 0.05000000074505806, 0.05000000074505806], [0.13124999403953552, 0.39375001192092896, 0.02500000037252903, 0.02500000037252903], [0.13124999403953552, 0.39375001192092896, 0.05000000074505806, 0.05000000074505806], [0.14374999701976776, 0.39375001192092896, 0.02500000037252903, 0.02500000037252903], [0.14374999701976776, 0.39375001192092896, 0.05000000074505806, 0.05000000074505806], [0.15625, 0.39375001192092896, 0.02500000037252903, 0.02500000037252903], [0.15625, 0.39375001192092896, 0.05000000074505806, 0.05000000074505806], [0.16875000298023224, 0.39375001192092896, 0.02500000037252903, 0.02500000037252903], [0.16875000298023224, 0.39375001192092896, 0.05000000074505806, 0.05000000074505806], [0.18125000596046448, 0.39375001192092896, 0.02500000037252903, 0.02500000037252903], [0.18125000596046448, 0.39375001192092896, 0.05000000074505806, 0.05000000074505806], [0.19374999403953552, 0.39375001192092896, 0.02500000037252903, 0.02500000037252903], [0.19374999403953552, 0.39375001192092896, 0.05000000074505806, 0.05000000074505806], [0.20624999701976776, 0.39375001192092896, 0.02500000037252903, 0.02500000037252903], [0.20624999701976776, 0.39375001192092896, 0.05000000074505806, 0.05000000074505806], [0.21875, 0.39375001192092896, 0.02500000037252903, 0.02500000037252903], [0.21875, 0.39375001192092896, 0.05000000074505806, 0.05000000074505806], [0.23125000298023224, 0.39375001192092896, 0.02500000037252903, 0.02500000037252903], [0.23125000298023224, 0.39375001192092896, 0.05000000074505806, 0.05000000074505806], [0.24375000596046448, 0.39375001192092896, 0.02500000037252903, 0.02500000037252903], [0.24375000596046448, 0.39375001192092896, 0.05000000074505806, 0.05000000074505806], [0.2562499940395355, 0.39375001192092896, 0.02500000037252903, 0.02500000037252903], [0.2562499940395355, 0.39375001192092896, 0.05000000074505806, 0.05000000074505806], [0.26875001192092896, 0.39375001192092896, 0.02500000037252903, 0.02500000037252903], [0.26875001192092896, 0.39375001192092896, 0.05000000074505806, 0.05000000074505806], [0.28125, 0.39375001192092896, 0.02500000037252903, 0.02500000037252903], [0.28125, 0.39375001192092896, 0.05000000074505806, 0.05000000074505806], [0.29374998807907104, 0.39375001192092896, 0.02500000037252903, 0.02500000037252903], [0.29374998807907104, 0.39375001192092896, 0.05000000074505806, 0.05000000074505806], [0.3062500059604645, 0.39375001192092896, 0.02500000037252903, 0.02500000037252903], [0.3062500059604645, 0.39375001192092896, 0.05000000074505806, 0.05000000074505806], [0.3187499940395355, 0.39375001192092896, 0.02500000037252903, 0.02500000037252903], [0.3187499940395355, 0.39375001192092896, 0.05000000074505806, 0.05000000074505806], [0.33125001192092896, 0.39375001192092896, 0.02500000037252903, 0.02500000037252903], [0.33125001192092896, 0.39375001192092896, 0.05000000074505806, 0.05000000074505806], [0.34375, 0.39375001192092896, 0.02500000037252903, 0.02500000037252903], [0.34375, 0.39375001192092896, 0.05000000074505806, 0.05000000074505806], [0.35624998807907104, 0.39375001192092896, 0.02500000037252903, 0.02500000037252903], [0.35624998807907104, 0.39375001192092896, 0.05000000074505806, 0.05000000074505806], [0.3687500059604645, 0.39375001192092896, 0.02500000037252903, 0.02500000037252903], [0.3687500059604645, 0.39375001192092896, 0.05000000074505806, 0.05000000074505806], [0.3812499940395355, 0.39375001192092896, 0.02500000037252903, 0.02500000037252903], [0.3812499940395355, 0.39375001192092896, 0.05000000074505806, 0.05000000074505806], [0.39375001192092896, 0.39375001192092896, 0.02500000037252903, 0.02500000037252903], [0.39375001192092896, 0.39375001192092896, 0.05000000074505806, 0.05000000074505806], [0.40625, 0.39375001192092896, 0.02500000037252903, 0.02500000037252903], [0.40625, 0.39375001192092896, 0.05000000074505806, 0.05000000074505806], [0.41874998807907104, 0.39375001192092896, 0.02500000037252903, 0.02500000037252903], [0.41874998807907104, 0.39375001192092896, 0.05000000074505806, 0.05000000074505806], [0.4312500059604645, 0.39375001192092896, 0.02500000037252903, 0.02500000037252903], [0.4312500059604645, 0.39375001192092896, 0.05000000074505806, 0.05000000074505806], [0.4437499940395355, 0.39375001192092896, 0.02500000037252903, 0.02500000037252903], [0.4437499940395355, 0.39375001192092896, 0.05000000074505806, 0.05000000074505806], [0.45625001192092896, 0.39375001192092896, 0.02500000037252903, 0.02500000037252903], [0.45625001192092896, 0.39375001192092896, 0.05000000074505806, 0.05000000074505806], [0.46875, 0.39375001192092896, 0.02500000037252903, 0.02500000037252903], [0.46875, 0.39375001192092896, 0.05000000074505806, 0.05000000074505806], [0.48124998807907104, 0.39375001192092896, 0.02500000037252903, 0.02500000037252903], [0.48124998807907104, 0.39375001192092896, 0.05000000074505806, 0.05000000074505806], [0.4937500059604645, 0.39375001192092896, 0.02500000037252903, 0.02500000037252903], [0.4937500059604645, 0.39375001192092896, 0.05000000074505806, 0.05000000074505806], [0.5062500238418579, 0.39375001192092896, 0.02500000037252903, 0.02500000037252903], [0.5062500238418579, 0.39375001192092896, 0.05000000074505806, 0.05000000074505806], [0.518750011920929, 0.39375001192092896, 0.02500000037252903, 0.02500000037252903], [0.518750011920929, 0.39375001192092896, 0.05000000074505806, 0.05000000074505806], [0.53125, 0.39375001192092896, 0.02500000037252903, 0.02500000037252903], [0.53125, 0.39375001192092896, 0.05000000074505806, 0.05000000074505806], [0.543749988079071, 0.39375001192092896, 0.02500000037252903, 0.02500000037252903], [0.543749988079071, 0.39375001192092896, 0.05000000074505806, 0.05000000074505806], [0.5562499761581421, 0.39375001192092896, 0.02500000037252903, 0.02500000037252903], [0.5562499761581421, 0.39375001192092896, 0.05000000074505806, 0.05000000074505806], [0.5687500238418579, 0.39375001192092896, 0.02500000037252903, 0.02500000037252903], [0.5687500238418579, 0.39375001192092896, 0.05000000074505806, 0.05000000074505806], [0.581250011920929, 0.39375001192092896, 0.02500000037252903, 0.02500000037252903], [0.581250011920929, 0.39375001192092896, 0.05000000074505806, 0.05000000074505806], [0.59375, 0.39375001192092896, 0.02500000037252903, 0.02500000037252903], [0.59375, 0.39375001192092896, 0.05000000074505806, 0.05000000074505806], [0.606249988079071, 0.39375001192092896, 0.02500000037252903, 0.02500000037252903], [0.606249988079071, 0.39375001192092896, 0.05000000074505806, 0.05000000074505806], [0.6187499761581421, 0.39375001192092896, 0.02500000037252903, 0.02500000037252903], [0.6187499761581421, 0.39375001192092896, 0.05000000074505806, 0.05000000074505806], [0.6312500238418579, 0.39375001192092896, 0.02500000037252903, 0.02500000037252903], [0.6312500238418579, 0.39375001192092896, 0.05000000074505806, 0.05000000074505806], [0.643750011920929, 0.39375001192092896, 0.02500000037252903, 0.02500000037252903], [0.643750011920929, 0.39375001192092896, 0.05000000074505806, 0.05000000074505806], [0.65625, 0.39375001192092896, 0.02500000037252903, 0.02500000037252903], [0.65625, 0.39375001192092896, 0.05000000074505806, 0.05000000074505806], [0.668749988079071, 0.39375001192092896, 0.02500000037252903, 0.02500000037252903], [0.668749988079071, 0.39375001192092896, 0.05000000074505806, 0.05000000074505806], [0.6812499761581421, 0.39375001192092896, 0.02500000037252903, 0.02500000037252903], [0.6812499761581421, 0.39375001192092896, 0.05000000074505806, 0.05000000074505806], [0.6937500238418579, 0.39375001192092896, 0.02500000037252903, 0.02500000037252903], [0.6937500238418579, 0.39375001192092896, 0.05000000074505806, 0.05000000074505806], [0.706250011920929, 0.39375001192092896, 0.02500000037252903, 0.02500000037252903], [0.706250011920929, 0.39375001192092896, 0.05000000074505806, 0.05000000074505806], [0.71875, 0.39375001192092896, 0.02500000037252903, 0.02500000037252903], [0.71875, 0.39375001192092896, 0.05000000074505806, 0.05000000074505806], [0.731249988079071, 0.39375001192092896, 0.02500000037252903, 0.02500000037252903], [0.731249988079071, 0.39375001192092896, 0.05000000074505806, 0.05000000074505806], [0.7437499761581421, 0.39375001192092896, 0.02500000037252903, 0.02500000037252903], [0.7437499761581421, 0.39375001192092896, 0.05000000074505806, 0.05000000074505806], [0.7562500238418579, 0.39375001192092896, 0.02500000037252903, 0.02500000037252903], [0.7562500238418579, 0.39375001192092896, 0.05000000074505806, 0.05000000074505806], [0.768750011920929, 0.39375001192092896, 0.02500000037252903, 0.02500000037252903], [0.768750011920929, 0.39375001192092896, 0.05000000074505806, 0.05000000074505806], [0.78125, 0.39375001192092896, 0.02500000037252903, 0.02500000037252903], [0.78125, 0.39375001192092896, 0.05000000074505806, 0.05000000074505806], [0.793749988079071, 0.39375001192092896, 0.02500000037252903, 0.02500000037252903], [0.793749988079071, 0.39375001192092896, 0.05000000074505806, 0.05000000074505806], [0.8062499761581421, 0.39375001192092896, 0.02500000037252903, 0.02500000037252903], [0.8062499761581421, 0.39375001192092896, 0.05000000074505806, 0.05000000074505806], [0.8187500238418579, 0.39375001192092896, 0.02500000037252903, 0.02500000037252903], [0.8187500238418579, 0.39375001192092896, 0.05000000074505806, 0.05000000074505806], [0.831250011920929, 0.39375001192092896, 0.02500000037252903, 0.02500000037252903], [0.831250011920929, 0.39375001192092896, 0.05000000074505806, 0.05000000074505806], [0.84375, 0.39375001192092896, 0.02500000037252903, 0.02500000037252903], [0.84375, 0.39375001192092896, 0.05000000074505806, 0.05000000074505806], [0.856249988079071, 0.39375001192092896, 0.02500000037252903, 0.02500000037252903], [0.856249988079071, 0.39375001192092896, 0.05000000074505806, 0.05000000074505806], [0.8687499761581421, 0.39375001192092896, 0.02500000037252903, 0.02500000037252903], [0.8687499761581421, 0.39375001192092896, 0.05000000074505806, 0.05000000074505806], [0.8812500238418579, 0.39375001192092896, 0.02500000037252903, 0.02500000037252903], [0.8812500238418579, 0.39375001192092896, 0.05000000074505806, 0.05000000074505806], [0.893750011920929, 0.39375001192092896, 0.02500000037252903, 0.02500000037252903], [0.893750011920929, 0.39375001192092896, 0.05000000074505806, 0.05000000074505806], [0.90625, 0.39375001192092896, 0.02500000037252903, 0.02500000037252903], [0.90625, 0.39375001192092896, 0.05000000074505806, 0.05000000074505806], [0.918749988079071, 0.39375001192092896, 0.02500000037252903, 0.02500000037252903], [0.918749988079071, 0.39375001192092896, 0.05000000074505806, 0.05000000074505806], [0.9312499761581421, 0.39375001192092896, 0.02500000037252903, 0.02500000037252903], [0.9312499761581421, 0.39375001192092896, 0.05000000074505806, 0.05000000074505806], [0.9437500238418579, 0.39375001192092896, 0.02500000037252903, 0.02500000037252903], [0.9437500238418579, 0.39375001192092896, 0.05000000074505806, 0.05000000074505806], [0.956250011920929, 0.39375001192092896, 0.02500000037252903, 0.02500000037252903], [0.956250011920929, 0.39375001192092896, 0.05000000074505806, 0.05000000074505806], [0.96875, 0.39375001192092896, 0.02500000037252903, 0.02500000037252903], [0.96875, 0.39375001192092896, 0.05000000074505806, 0.05000000074505806], [0.981249988079071, 0.39375001192092896, 0.02500000037252903, 0.02500000037252903], [0.981249988079071, 0.39375001192092896, 0.05000000074505806, 0.05000000074505806], [0.9937499761581421, 0.39375001192092896, 0.02500000037252903, 0.02500000037252903], [0.9937499761581421, 0.39375001192092896, 0.05000000074505806, 0.05000000074505806], [0.0062500000931322575, 0.40625, 0.02500000037252903, 0.02500000037252903], [0.0062500000931322575, 0.40625, 0.05000000074505806, 0.05000000074505806], [0.01875000074505806, 0.40625, 0.02500000037252903, 0.02500000037252903], [0.01875000074505806, 0.40625, 0.05000000074505806, 0.05000000074505806], [0.03125, 0.40625, 0.02500000037252903, 0.02500000037252903], [0.03125, 0.40625, 0.05000000074505806, 0.05000000074505806], [0.04374999925494194, 0.40625, 0.02500000037252903, 0.02500000037252903], [0.04374999925494194, 0.40625, 0.05000000074505806, 0.05000000074505806], [0.05624999850988388, 0.40625, 0.02500000037252903, 0.02500000037252903], [0.05624999850988388, 0.40625, 0.05000000074505806, 0.05000000074505806], [0.06875000149011612, 0.40625, 0.02500000037252903, 0.02500000037252903], [0.06875000149011612, 0.40625, 0.05000000074505806, 0.05000000074505806], [0.08124999701976776, 0.40625, 0.02500000037252903, 0.02500000037252903], [0.08124999701976776, 0.40625, 0.05000000074505806, 0.05000000074505806], [0.09375, 0.40625, 0.02500000037252903, 0.02500000037252903], [0.09375, 0.40625, 0.05000000074505806, 0.05000000074505806], [0.10625000298023224, 0.40625, 0.02500000037252903, 0.02500000037252903], [0.10625000298023224, 0.40625, 0.05000000074505806, 0.05000000074505806], [0.11874999850988388, 0.40625, 0.02500000037252903, 0.02500000037252903], [0.11874999850988388, 0.40625, 0.05000000074505806, 0.05000000074505806], [0.13124999403953552, 0.40625, 0.02500000037252903, 0.02500000037252903], [0.13124999403953552, 0.40625, 0.05000000074505806, 0.05000000074505806], [0.14374999701976776, 0.40625, 0.02500000037252903, 0.02500000037252903], [0.14374999701976776, 0.40625, 0.05000000074505806, 0.05000000074505806], [0.15625, 0.40625, 0.02500000037252903, 0.02500000037252903], [0.15625, 0.40625, 0.05000000074505806, 0.05000000074505806], [0.16875000298023224, 0.40625, 0.02500000037252903, 0.02500000037252903], [0.16875000298023224, 0.40625, 0.05000000074505806, 0.05000000074505806], [0.18125000596046448, 0.40625, 0.02500000037252903, 0.02500000037252903], [0.18125000596046448, 0.40625, 0.05000000074505806, 0.05000000074505806], [0.19374999403953552, 0.40625, 0.02500000037252903, 0.02500000037252903], [0.19374999403953552, 0.40625, 0.05000000074505806, 0.05000000074505806], [0.20624999701976776, 0.40625, 0.02500000037252903, 0.02500000037252903], [0.20624999701976776, 0.40625, 0.05000000074505806, 0.05000000074505806], [0.21875, 0.40625, 0.02500000037252903, 0.02500000037252903], [0.21875, 0.40625, 0.05000000074505806, 0.05000000074505806], [0.23125000298023224, 0.40625, 0.02500000037252903, 0.02500000037252903], [0.23125000298023224, 0.40625, 0.05000000074505806, 0.05000000074505806], [0.24375000596046448, 0.40625, 0.02500000037252903, 0.02500000037252903], [0.24375000596046448, 0.40625, 0.05000000074505806, 0.05000000074505806], [0.2562499940395355, 0.40625, 0.02500000037252903, 0.02500000037252903], [0.2562499940395355, 0.40625, 0.05000000074505806, 0.05000000074505806], [0.26875001192092896, 0.40625, 0.02500000037252903, 0.02500000037252903], [0.26875001192092896, 0.40625, 0.05000000074505806, 0.05000000074505806], [0.28125, 0.40625, 0.02500000037252903, 0.02500000037252903], [0.28125, 0.40625, 0.05000000074505806, 0.05000000074505806], [0.29374998807907104, 0.40625, 0.02500000037252903, 0.02500000037252903], [0.29374998807907104, 0.40625, 0.05000000074505806, 0.05000000074505806], [0.3062500059604645, 0.40625, 0.02500000037252903, 0.02500000037252903], [0.3062500059604645, 0.40625, 0.05000000074505806, 0.05000000074505806], [0.3187499940395355, 0.40625, 0.02500000037252903, 0.02500000037252903], [0.3187499940395355, 0.40625, 0.05000000074505806, 0.05000000074505806], [0.33125001192092896, 0.40625, 0.02500000037252903, 0.02500000037252903], [0.33125001192092896, 0.40625, 0.05000000074505806, 0.05000000074505806], [0.34375, 0.40625, 0.02500000037252903, 0.02500000037252903], [0.34375, 0.40625, 0.05000000074505806, 0.05000000074505806], [0.35624998807907104, 0.40625, 0.02500000037252903, 0.02500000037252903], [0.35624998807907104, 0.40625, 0.05000000074505806, 0.05000000074505806], [0.3687500059604645, 0.40625, 0.02500000037252903, 0.02500000037252903], [0.3687500059604645, 0.40625, 0.05000000074505806, 0.05000000074505806], [0.3812499940395355, 0.40625, 0.02500000037252903, 0.02500000037252903], [0.3812499940395355, 0.40625, 0.05000000074505806, 0.05000000074505806], [0.39375001192092896, 0.40625, 0.02500000037252903, 0.02500000037252903], [0.39375001192092896, 0.40625, 0.05000000074505806, 0.05000000074505806], [0.40625, 0.40625, 0.02500000037252903, 0.02500000037252903], [0.40625, 0.40625, 0.05000000074505806, 0.05000000074505806], [0.41874998807907104, 0.40625, 0.02500000037252903, 0.02500000037252903], [0.41874998807907104, 0.40625, 0.05000000074505806, 0.05000000074505806], [0.4312500059604645, 0.40625, 0.02500000037252903, 0.02500000037252903], [0.4312500059604645, 0.40625, 0.05000000074505806, 0.05000000074505806], [0.4437499940395355, 0.40625, 0.02500000037252903, 0.02500000037252903], [0.4437499940395355, 0.40625, 0.05000000074505806, 0.05000000074505806], [0.45625001192092896, 0.40625, 0.02500000037252903, 0.02500000037252903], [0.45625001192092896, 0.40625, 0.05000000074505806, 0.05000000074505806], [0.46875, 0.40625, 0.02500000037252903, 0.02500000037252903], [0.46875, 0.40625, 0.05000000074505806, 0.05000000074505806], [0.48124998807907104, 0.40625, 0.02500000037252903, 0.02500000037252903], [0.48124998807907104, 0.40625, 0.05000000074505806, 0.05000000074505806], [0.4937500059604645, 0.40625, 0.02500000037252903, 0.02500000037252903], [0.4937500059604645, 0.40625, 0.05000000074505806, 0.05000000074505806], [0.5062500238418579, 0.40625, 0.02500000037252903, 0.02500000037252903], [0.5062500238418579, 0.40625, 0.05000000074505806, 0.05000000074505806], [0.518750011920929, 0.40625, 0.02500000037252903, 0.02500000037252903], [0.518750011920929, 0.40625, 0.05000000074505806, 0.05000000074505806], [0.53125, 0.40625, 0.02500000037252903, 0.02500000037252903], [0.53125, 0.40625, 0.05000000074505806, 0.05000000074505806], [0.543749988079071, 0.40625, 0.02500000037252903, 0.02500000037252903], [0.543749988079071, 0.40625, 0.05000000074505806, 0.05000000074505806], [0.5562499761581421, 0.40625, 0.02500000037252903, 0.02500000037252903], [0.5562499761581421, 0.40625, 0.05000000074505806, 0.05000000074505806], [0.5687500238418579, 0.40625, 0.02500000037252903, 0.02500000037252903], [0.5687500238418579, 0.40625, 0.05000000074505806, 0.05000000074505806], [0.581250011920929, 0.40625, 0.02500000037252903, 0.02500000037252903], [0.581250011920929, 0.40625, 0.05000000074505806, 0.05000000074505806], [0.59375, 0.40625, 0.02500000037252903, 0.02500000037252903], [0.59375, 0.40625, 0.05000000074505806, 0.05000000074505806], [0.606249988079071, 0.40625, 0.02500000037252903, 0.02500000037252903], [0.606249988079071, 0.40625, 0.05000000074505806, 0.05000000074505806], [0.6187499761581421, 0.40625, 0.02500000037252903, 0.02500000037252903], [0.6187499761581421, 0.40625, 0.05000000074505806, 0.05000000074505806], [0.6312500238418579, 0.40625, 0.02500000037252903, 0.02500000037252903], [0.6312500238418579, 0.40625, 0.05000000074505806, 0.05000000074505806], [0.643750011920929, 0.40625, 0.02500000037252903, 0.02500000037252903], [0.643750011920929, 0.40625, 0.05000000074505806, 0.05000000074505806], [0.65625, 0.40625, 0.02500000037252903, 0.02500000037252903], [0.65625, 0.40625, 0.05000000074505806, 0.05000000074505806], [0.668749988079071, 0.40625, 0.02500000037252903, 0.02500000037252903], [0.668749988079071, 0.40625, 0.05000000074505806, 0.05000000074505806], [0.6812499761581421, 0.40625, 0.02500000037252903, 0.02500000037252903], [0.6812499761581421, 0.40625, 0.05000000074505806, 0.05000000074505806], [0.6937500238418579, 0.40625, 0.02500000037252903, 0.02500000037252903], [0.6937500238418579, 0.40625, 0.05000000074505806, 0.05000000074505806], [0.706250011920929, 0.40625, 0.02500000037252903, 0.02500000037252903], [0.706250011920929, 0.40625, 0.05000000074505806, 0.05000000074505806], [0.71875, 0.40625, 0.02500000037252903, 0.02500000037252903], [0.71875, 0.40625, 0.05000000074505806, 0.05000000074505806], [0.731249988079071, 0.40625, 0.02500000037252903, 0.02500000037252903], [0.731249988079071, 0.40625, 0.05000000074505806, 0.05000000074505806], [0.7437499761581421, 0.40625, 0.02500000037252903, 0.02500000037252903], [0.7437499761581421, 0.40625, 0.05000000074505806, 0.05000000074505806], [0.7562500238418579, 0.40625, 0.02500000037252903, 0.02500000037252903], [0.7562500238418579, 0.40625, 0.05000000074505806, 0.05000000074505806], [0.768750011920929, 0.40625, 0.02500000037252903, 0.02500000037252903], [0.768750011920929, 0.40625, 0.05000000074505806, 0.05000000074505806], [0.78125, 0.40625, 0.02500000037252903, 0.02500000037252903], [0.78125, 0.40625, 0.05000000074505806, 0.05000000074505806], [0.793749988079071, 0.40625, 0.02500000037252903, 0.02500000037252903], [0.793749988079071, 0.40625, 0.05000000074505806, 0.05000000074505806], [0.8062499761581421, 0.40625, 0.02500000037252903, 0.02500000037252903], [0.8062499761581421, 0.40625, 0.05000000074505806, 0.05000000074505806], [0.8187500238418579, 0.40625, 0.02500000037252903, 0.02500000037252903], [0.8187500238418579, 0.40625, 0.05000000074505806, 0.05000000074505806], [0.831250011920929, 0.40625, 0.02500000037252903, 0.02500000037252903], [0.831250011920929, 0.40625, 0.05000000074505806, 0.05000000074505806], [0.84375, 0.40625, 0.02500000037252903, 0.02500000037252903], [0.84375, 0.40625, 0.05000000074505806, 0.05000000074505806], [0.856249988079071, 0.40625, 0.02500000037252903, 0.02500000037252903], [0.856249988079071, 0.40625, 0.05000000074505806, 0.05000000074505806], [0.8687499761581421, 0.40625, 0.02500000037252903, 0.02500000037252903], [0.8687499761581421, 0.40625, 0.05000000074505806, 0.05000000074505806], [0.8812500238418579, 0.40625, 0.02500000037252903, 0.02500000037252903], [0.8812500238418579, 0.40625, 0.05000000074505806, 0.05000000074505806], [0.893750011920929, 0.40625, 0.02500000037252903, 0.02500000037252903], [0.893750011920929, 0.40625, 0.05000000074505806, 0.05000000074505806], [0.90625, 0.40625, 0.02500000037252903, 0.02500000037252903], [0.90625, 0.40625, 0.05000000074505806, 0.05000000074505806], [0.918749988079071, 0.40625, 0.02500000037252903, 0.02500000037252903], [0.918749988079071, 0.40625, 0.05000000074505806, 0.05000000074505806], [0.9312499761581421, 0.40625, 0.02500000037252903, 0.02500000037252903], [0.9312499761581421, 0.40625, 0.05000000074505806, 0.05000000074505806], [0.9437500238418579, 0.40625, 0.02500000037252903, 0.02500000037252903], [0.9437500238418579, 0.40625, 0.05000000074505806, 0.05000000074505806], [0.956250011920929, 0.40625, 0.02500000037252903, 0.02500000037252903], [0.956250011920929, 0.40625, 0.05000000074505806, 0.05000000074505806], [0.96875, 0.40625, 0.02500000037252903, 0.02500000037252903], [0.96875, 0.40625, 0.05000000074505806, 0.05000000074505806], [0.981249988079071, 0.40625, 0.02500000037252903, 0.02500000037252903], [0.981249988079071, 0.40625, 0.05000000074505806, 0.05000000074505806], [0.9937499761581421, 0.40625, 0.02500000037252903, 0.02500000037252903], [0.9937499761581421, 0.40625, 0.05000000074505806, 0.05000000074505806], [0.0062500000931322575, 0.41874998807907104, 0.02500000037252903, 0.02500000037252903], [0.0062500000931322575, 0.41874998807907104, 0.05000000074505806, 0.05000000074505806], [0.01875000074505806, 0.41874998807907104, 0.02500000037252903, 0.02500000037252903], [0.01875000074505806, 0.41874998807907104, 0.05000000074505806, 0.05000000074505806], [0.03125, 0.41874998807907104, 0.02500000037252903, 0.02500000037252903], [0.03125, 0.41874998807907104, 0.05000000074505806, 0.05000000074505806], [0.04374999925494194, 0.41874998807907104, 0.02500000037252903, 0.02500000037252903], [0.04374999925494194, 0.41874998807907104, 0.05000000074505806, 0.05000000074505806], [0.05624999850988388, 0.41874998807907104, 0.02500000037252903, 0.02500000037252903], [0.05624999850988388, 0.41874998807907104, 0.05000000074505806, 0.05000000074505806], [0.06875000149011612, 0.41874998807907104, 0.02500000037252903, 0.02500000037252903], [0.06875000149011612, 0.41874998807907104, 0.05000000074505806, 0.05000000074505806], [0.08124999701976776, 0.41874998807907104, 0.02500000037252903, 0.02500000037252903], [0.08124999701976776, 0.41874998807907104, 0.05000000074505806, 0.05000000074505806], [0.09375, 0.41874998807907104, 0.02500000037252903, 0.02500000037252903], [0.09375, 0.41874998807907104, 0.05000000074505806, 0.05000000074505806], [0.10625000298023224, 0.41874998807907104, 0.02500000037252903, 0.02500000037252903], [0.10625000298023224, 0.41874998807907104, 0.05000000074505806, 0.05000000074505806], [0.11874999850988388, 0.41874998807907104, 0.02500000037252903, 0.02500000037252903], [0.11874999850988388, 0.41874998807907104, 0.05000000074505806, 0.05000000074505806], [0.13124999403953552, 0.41874998807907104, 0.02500000037252903, 0.02500000037252903], [0.13124999403953552, 0.41874998807907104, 0.05000000074505806, 0.05000000074505806], [0.14374999701976776, 0.41874998807907104, 0.02500000037252903, 0.02500000037252903], [0.14374999701976776, 0.41874998807907104, 0.05000000074505806, 0.05000000074505806], [0.15625, 0.41874998807907104, 0.02500000037252903, 0.02500000037252903], [0.15625, 0.41874998807907104, 0.05000000074505806, 0.05000000074505806], [0.16875000298023224, 0.41874998807907104, 0.02500000037252903, 0.02500000037252903], [0.16875000298023224, 0.41874998807907104, 0.05000000074505806, 0.05000000074505806], [0.18125000596046448, 0.41874998807907104, 0.02500000037252903, 0.02500000037252903], [0.18125000596046448, 0.41874998807907104, 0.05000000074505806, 0.05000000074505806], [0.19374999403953552, 0.41874998807907104, 0.02500000037252903, 0.02500000037252903], [0.19374999403953552, 0.41874998807907104, 0.05000000074505806, 0.05000000074505806], [0.20624999701976776, 0.41874998807907104, 0.02500000037252903, 0.02500000037252903], [0.20624999701976776, 0.41874998807907104, 0.05000000074505806, 0.05000000074505806], [0.21875, 0.41874998807907104, 0.02500000037252903, 0.02500000037252903], [0.21875, 0.41874998807907104, 0.05000000074505806, 0.05000000074505806], [0.23125000298023224, 0.41874998807907104, 0.02500000037252903, 0.02500000037252903], [0.23125000298023224, 0.41874998807907104, 0.05000000074505806, 0.05000000074505806], [0.24375000596046448, 0.41874998807907104, 0.02500000037252903, 0.02500000037252903], [0.24375000596046448, 0.41874998807907104, 0.05000000074505806, 0.05000000074505806], [0.2562499940395355, 0.41874998807907104, 0.02500000037252903, 0.02500000037252903], [0.2562499940395355, 0.41874998807907104, 0.05000000074505806, 0.05000000074505806], [0.26875001192092896, 0.41874998807907104, 0.02500000037252903, 0.02500000037252903], [0.26875001192092896, 0.41874998807907104, 0.05000000074505806, 0.05000000074505806], [0.28125, 0.41874998807907104, 0.02500000037252903, 0.02500000037252903], [0.28125, 0.41874998807907104, 0.05000000074505806, 0.05000000074505806], [0.29374998807907104, 0.41874998807907104, 0.02500000037252903, 0.02500000037252903], [0.29374998807907104, 0.41874998807907104, 0.05000000074505806, 0.05000000074505806], [0.3062500059604645, 0.41874998807907104, 0.02500000037252903, 0.02500000037252903], [0.3062500059604645, 0.41874998807907104, 0.05000000074505806, 0.05000000074505806], [0.3187499940395355, 0.41874998807907104, 0.02500000037252903, 0.02500000037252903], [0.3187499940395355, 0.41874998807907104, 0.05000000074505806, 0.05000000074505806], [0.33125001192092896, 0.41874998807907104, 0.02500000037252903, 0.02500000037252903], [0.33125001192092896, 0.41874998807907104, 0.05000000074505806, 0.05000000074505806], [0.34375, 0.41874998807907104, 0.02500000037252903, 0.02500000037252903], [0.34375, 0.41874998807907104, 0.05000000074505806, 0.05000000074505806], [0.35624998807907104, 0.41874998807907104, 0.02500000037252903, 0.02500000037252903], [0.35624998807907104, 0.41874998807907104, 0.05000000074505806, 0.05000000074505806], [0.3687500059604645, 0.41874998807907104, 0.02500000037252903, 0.02500000037252903], [0.3687500059604645, 0.41874998807907104, 0.05000000074505806, 0.05000000074505806], [0.3812499940395355, 0.41874998807907104, 0.02500000037252903, 0.02500000037252903], [0.3812499940395355, 0.41874998807907104, 0.05000000074505806, 0.05000000074505806], [0.39375001192092896, 0.41874998807907104, 0.02500000037252903, 0.02500000037252903], [0.39375001192092896, 0.41874998807907104, 0.05000000074505806, 0.05000000074505806], [0.40625, 0.41874998807907104, 0.02500000037252903, 0.02500000037252903], [0.40625, 0.41874998807907104, 0.05000000074505806, 0.05000000074505806], [0.41874998807907104, 0.41874998807907104, 0.02500000037252903, 0.02500000037252903], [0.41874998807907104, 0.41874998807907104, 0.05000000074505806, 0.05000000074505806], [0.4312500059604645, 0.41874998807907104, 0.02500000037252903, 0.02500000037252903], [0.4312500059604645, 0.41874998807907104, 0.05000000074505806, 0.05000000074505806], [0.4437499940395355, 0.41874998807907104, 0.02500000037252903, 0.02500000037252903], [0.4437499940395355, 0.41874998807907104, 0.05000000074505806, 0.05000000074505806], [0.45625001192092896, 0.41874998807907104, 0.02500000037252903, 0.02500000037252903], [0.45625001192092896, 0.41874998807907104, 0.05000000074505806, 0.05000000074505806], [0.46875, 0.41874998807907104, 0.02500000037252903, 0.02500000037252903], [0.46875, 0.41874998807907104, 0.05000000074505806, 0.05000000074505806], [0.48124998807907104, 0.41874998807907104, 0.02500000037252903, 0.02500000037252903], [0.48124998807907104, 0.41874998807907104, 0.05000000074505806, 0.05000000074505806], [0.4937500059604645, 0.41874998807907104, 0.02500000037252903, 0.02500000037252903], [0.4937500059604645, 0.41874998807907104, 0.05000000074505806, 0.05000000074505806], [0.5062500238418579, 0.41874998807907104, 0.02500000037252903, 0.02500000037252903], [0.5062500238418579, 0.41874998807907104, 0.05000000074505806, 0.05000000074505806], [0.518750011920929, 0.41874998807907104, 0.02500000037252903, 0.02500000037252903], [0.518750011920929, 0.41874998807907104, 0.05000000074505806, 0.05000000074505806], [0.53125, 0.41874998807907104, 0.02500000037252903, 0.02500000037252903], [0.53125, 0.41874998807907104, 0.05000000074505806, 0.05000000074505806], [0.543749988079071, 0.41874998807907104, 0.02500000037252903, 0.02500000037252903], [0.543749988079071, 0.41874998807907104, 0.05000000074505806, 0.05000000074505806], [0.5562499761581421, 0.41874998807907104, 0.02500000037252903, 0.02500000037252903], [0.5562499761581421, 0.41874998807907104, 0.05000000074505806, 0.05000000074505806], [0.5687500238418579, 0.41874998807907104, 0.02500000037252903, 0.02500000037252903], [0.5687500238418579, 0.41874998807907104, 0.05000000074505806, 0.05000000074505806], [0.581250011920929, 0.41874998807907104, 0.02500000037252903, 0.02500000037252903], [0.581250011920929, 0.41874998807907104, 0.05000000074505806, 0.05000000074505806], [0.59375, 0.41874998807907104, 0.02500000037252903, 0.02500000037252903], [0.59375, 0.41874998807907104, 0.05000000074505806, 0.05000000074505806], [0.606249988079071, 0.41874998807907104, 0.02500000037252903, 0.02500000037252903], [0.606249988079071, 0.41874998807907104, 0.05000000074505806, 0.05000000074505806], [0.6187499761581421, 0.41874998807907104, 0.02500000037252903, 0.02500000037252903], [0.6187499761581421, 0.41874998807907104, 0.05000000074505806, 0.05000000074505806], [0.6312500238418579, 0.41874998807907104, 0.02500000037252903, 0.02500000037252903], [0.6312500238418579, 0.41874998807907104, 0.05000000074505806, 0.05000000074505806], [0.643750011920929, 0.41874998807907104, 0.02500000037252903, 0.02500000037252903], [0.643750011920929, 0.41874998807907104, 0.05000000074505806, 0.05000000074505806], [0.65625, 0.41874998807907104, 0.02500000037252903, 0.02500000037252903], [0.65625, 0.41874998807907104, 0.05000000074505806, 0.05000000074505806], [0.668749988079071, 0.41874998807907104, 0.02500000037252903, 0.02500000037252903], [0.668749988079071, 0.41874998807907104, 0.05000000074505806, 0.05000000074505806], [0.6812499761581421, 0.41874998807907104, 0.02500000037252903, 0.02500000037252903], [0.6812499761581421, 0.41874998807907104, 0.05000000074505806, 0.05000000074505806], [0.6937500238418579, 0.41874998807907104, 0.02500000037252903, 0.02500000037252903], [0.6937500238418579, 0.41874998807907104, 0.05000000074505806, 0.05000000074505806], [0.706250011920929, 0.41874998807907104, 0.02500000037252903, 0.02500000037252903], [0.706250011920929, 0.41874998807907104, 0.05000000074505806, 0.05000000074505806], [0.71875, 0.41874998807907104, 0.02500000037252903, 0.02500000037252903], [0.71875, 0.41874998807907104, 0.05000000074505806, 0.05000000074505806], [0.731249988079071, 0.41874998807907104, 0.02500000037252903, 0.02500000037252903], [0.731249988079071, 0.41874998807907104, 0.05000000074505806, 0.05000000074505806], [0.7437499761581421, 0.41874998807907104, 0.02500000037252903, 0.02500000037252903], [0.7437499761581421, 0.41874998807907104, 0.05000000074505806, 0.05000000074505806], [0.7562500238418579, 0.41874998807907104, 0.02500000037252903, 0.02500000037252903], [0.7562500238418579, 0.41874998807907104, 0.05000000074505806, 0.05000000074505806], [0.768750011920929, 0.41874998807907104, 0.02500000037252903, 0.02500000037252903], [0.768750011920929, 0.41874998807907104, 0.05000000074505806, 0.05000000074505806], [0.78125, 0.41874998807907104, 0.02500000037252903, 0.02500000037252903], [0.78125, 0.41874998807907104, 0.05000000074505806, 0.05000000074505806], [0.793749988079071, 0.41874998807907104, 0.02500000037252903, 0.02500000037252903], [0.793749988079071, 0.41874998807907104, 0.05000000074505806, 0.05000000074505806], [0.8062499761581421, 0.41874998807907104, 0.02500000037252903, 0.02500000037252903], [0.8062499761581421, 0.41874998807907104, 0.05000000074505806, 0.05000000074505806], [0.8187500238418579, 0.41874998807907104, 0.02500000037252903, 0.02500000037252903], [0.8187500238418579, 0.41874998807907104, 0.05000000074505806, 0.05000000074505806], [0.831250011920929, 0.41874998807907104, 0.02500000037252903, 0.02500000037252903], [0.831250011920929, 0.41874998807907104, 0.05000000074505806, 0.05000000074505806], [0.84375, 0.41874998807907104, 0.02500000037252903, 0.02500000037252903], [0.84375, 0.41874998807907104, 0.05000000074505806, 0.05000000074505806], [0.856249988079071, 0.41874998807907104, 0.02500000037252903, 0.02500000037252903], [0.856249988079071, 0.41874998807907104, 0.05000000074505806, 0.05000000074505806], [0.8687499761581421, 0.41874998807907104, 0.02500000037252903, 0.02500000037252903], [0.8687499761581421, 0.41874998807907104, 0.05000000074505806, 0.05000000074505806], [0.8812500238418579, 0.41874998807907104, 0.02500000037252903, 0.02500000037252903], [0.8812500238418579, 0.41874998807907104, 0.05000000074505806, 0.05000000074505806], [0.893750011920929, 0.41874998807907104, 0.02500000037252903, 0.02500000037252903], [0.893750011920929, 0.41874998807907104, 0.05000000074505806, 0.05000000074505806], [0.90625, 0.41874998807907104, 0.02500000037252903, 0.02500000037252903], [0.90625, 0.41874998807907104, 0.05000000074505806, 0.05000000074505806], [0.918749988079071, 0.41874998807907104, 0.02500000037252903, 0.02500000037252903], [0.918749988079071, 0.41874998807907104, 0.05000000074505806, 0.05000000074505806], [0.9312499761581421, 0.41874998807907104, 0.02500000037252903, 0.02500000037252903], [0.9312499761581421, 0.41874998807907104, 0.05000000074505806, 0.05000000074505806], [0.9437500238418579, 0.41874998807907104, 0.02500000037252903, 0.02500000037252903], [0.9437500238418579, 0.41874998807907104, 0.05000000074505806, 0.05000000074505806], [0.956250011920929, 0.41874998807907104, 0.02500000037252903, 0.02500000037252903], [0.956250011920929, 0.41874998807907104, 0.05000000074505806, 0.05000000074505806], [0.96875, 0.41874998807907104, 0.02500000037252903, 0.02500000037252903], [0.96875, 0.41874998807907104, 0.05000000074505806, 0.05000000074505806], [0.981249988079071, 0.41874998807907104, 0.02500000037252903, 0.02500000037252903], [0.981249988079071, 0.41874998807907104, 0.05000000074505806, 0.05000000074505806], [0.9937499761581421, 0.41874998807907104, 0.02500000037252903, 0.02500000037252903], [0.9937499761581421, 0.41874998807907104, 0.05000000074505806, 0.05000000074505806], [0.0062500000931322575, 0.4312500059604645, 0.02500000037252903, 0.02500000037252903], [0.0062500000931322575, 0.4312500059604645, 0.05000000074505806, 0.05000000074505806], [0.01875000074505806, 0.4312500059604645, 0.02500000037252903, 0.02500000037252903], [0.01875000074505806, 0.4312500059604645, 0.05000000074505806, 0.05000000074505806], [0.03125, 0.4312500059604645, 0.02500000037252903, 0.02500000037252903], [0.03125, 0.4312500059604645, 0.05000000074505806, 0.05000000074505806], [0.04374999925494194, 0.4312500059604645, 0.02500000037252903, 0.02500000037252903], [0.04374999925494194, 0.4312500059604645, 0.05000000074505806, 0.05000000074505806], [0.05624999850988388, 0.4312500059604645, 0.02500000037252903, 0.02500000037252903], [0.05624999850988388, 0.4312500059604645, 0.05000000074505806, 0.05000000074505806], [0.06875000149011612, 0.4312500059604645, 0.02500000037252903, 0.02500000037252903], [0.06875000149011612, 0.4312500059604645, 0.05000000074505806, 0.05000000074505806], [0.08124999701976776, 0.4312500059604645, 0.02500000037252903, 0.02500000037252903], [0.08124999701976776, 0.4312500059604645, 0.05000000074505806, 0.05000000074505806], [0.09375, 0.4312500059604645, 0.02500000037252903, 0.02500000037252903], [0.09375, 0.4312500059604645, 0.05000000074505806, 0.05000000074505806], [0.10625000298023224, 0.4312500059604645, 0.02500000037252903, 0.02500000037252903], [0.10625000298023224, 0.4312500059604645, 0.05000000074505806, 0.05000000074505806], [0.11874999850988388, 0.4312500059604645, 0.02500000037252903, 0.02500000037252903], [0.11874999850988388, 0.4312500059604645, 0.05000000074505806, 0.05000000074505806], [0.13124999403953552, 0.4312500059604645, 0.02500000037252903, 0.02500000037252903], [0.13124999403953552, 0.4312500059604645, 0.05000000074505806, 0.05000000074505806], [0.14374999701976776, 0.4312500059604645, 0.02500000037252903, 0.02500000037252903], [0.14374999701976776, 0.4312500059604645, 0.05000000074505806, 0.05000000074505806], [0.15625, 0.4312500059604645, 0.02500000037252903, 0.02500000037252903], [0.15625, 0.4312500059604645, 0.05000000074505806, 0.05000000074505806], [0.16875000298023224, 0.4312500059604645, 0.02500000037252903, 0.02500000037252903], [0.16875000298023224, 0.4312500059604645, 0.05000000074505806, 0.05000000074505806], [0.18125000596046448, 0.4312500059604645, 0.02500000037252903, 0.02500000037252903], [0.18125000596046448, 0.4312500059604645, 0.05000000074505806, 0.05000000074505806], [0.19374999403953552, 0.4312500059604645, 0.02500000037252903, 0.02500000037252903], [0.19374999403953552, 0.4312500059604645, 0.05000000074505806, 0.05000000074505806], [0.20624999701976776, 0.4312500059604645, 0.02500000037252903, 0.02500000037252903], [0.20624999701976776, 0.4312500059604645, 0.05000000074505806, 0.05000000074505806], [0.21875, 0.4312500059604645, 0.02500000037252903, 0.02500000037252903], [0.21875, 0.4312500059604645, 0.05000000074505806, 0.05000000074505806], [0.23125000298023224, 0.4312500059604645, 0.02500000037252903, 0.02500000037252903], [0.23125000298023224, 0.4312500059604645, 0.05000000074505806, 0.05000000074505806], [0.24375000596046448, 0.4312500059604645, 0.02500000037252903, 0.02500000037252903], [0.24375000596046448, 0.4312500059604645, 0.05000000074505806, 0.05000000074505806], [0.2562499940395355, 0.4312500059604645, 0.02500000037252903, 0.02500000037252903], [0.2562499940395355, 0.4312500059604645, 0.05000000074505806, 0.05000000074505806], [0.26875001192092896, 0.4312500059604645, 0.02500000037252903, 0.02500000037252903], [0.26875001192092896, 0.4312500059604645, 0.05000000074505806, 0.05000000074505806], [0.28125, 0.4312500059604645, 0.02500000037252903, 0.02500000037252903], [0.28125, 0.4312500059604645, 0.05000000074505806, 0.05000000074505806], [0.29374998807907104, 0.4312500059604645, 0.02500000037252903, 0.02500000037252903], [0.29374998807907104, 0.4312500059604645, 0.05000000074505806, 0.05000000074505806], [0.3062500059604645, 0.4312500059604645, 0.02500000037252903, 0.02500000037252903], [0.3062500059604645, 0.4312500059604645, 0.05000000074505806, 0.05000000074505806], [0.3187499940395355, 0.4312500059604645, 0.02500000037252903, 0.02500000037252903], [0.3187499940395355, 0.4312500059604645, 0.05000000074505806, 0.05000000074505806], [0.33125001192092896, 0.4312500059604645, 0.02500000037252903, 0.02500000037252903], [0.33125001192092896, 0.4312500059604645, 0.05000000074505806, 0.05000000074505806], [0.34375, 0.4312500059604645, 0.02500000037252903, 0.02500000037252903], [0.34375, 0.4312500059604645, 0.05000000074505806, 0.05000000074505806], [0.35624998807907104, 0.4312500059604645, 0.02500000037252903, 0.02500000037252903], [0.35624998807907104, 0.4312500059604645, 0.05000000074505806, 0.05000000074505806], [0.3687500059604645, 0.4312500059604645, 0.02500000037252903, 0.02500000037252903], [0.3687500059604645, 0.4312500059604645, 0.05000000074505806, 0.05000000074505806], [0.3812499940395355, 0.4312500059604645, 0.02500000037252903, 0.02500000037252903], [0.3812499940395355, 0.4312500059604645, 0.05000000074505806, 0.05000000074505806], [0.39375001192092896, 0.4312500059604645, 0.02500000037252903, 0.02500000037252903], [0.39375001192092896, 0.4312500059604645, 0.05000000074505806, 0.05000000074505806], [0.40625, 0.4312500059604645, 0.02500000037252903, 0.02500000037252903], [0.40625, 0.4312500059604645, 0.05000000074505806, 0.05000000074505806], [0.41874998807907104, 0.4312500059604645, 0.02500000037252903, 0.02500000037252903], [0.41874998807907104, 0.4312500059604645, 0.05000000074505806, 0.05000000074505806], [0.4312500059604645, 0.4312500059604645, 0.02500000037252903, 0.02500000037252903], [0.4312500059604645, 0.4312500059604645, 0.05000000074505806, 0.05000000074505806], [0.4437499940395355, 0.4312500059604645, 0.02500000037252903, 0.02500000037252903], [0.4437499940395355, 0.4312500059604645, 0.05000000074505806, 0.05000000074505806], [0.45625001192092896, 0.4312500059604645, 0.02500000037252903, 0.02500000037252903], [0.45625001192092896, 0.4312500059604645, 0.05000000074505806, 0.05000000074505806], [0.46875, 0.4312500059604645, 0.02500000037252903, 0.02500000037252903], [0.46875, 0.4312500059604645, 0.05000000074505806, 0.05000000074505806], [0.48124998807907104, 0.4312500059604645, 0.02500000037252903, 0.02500000037252903], [0.48124998807907104, 0.4312500059604645, 0.05000000074505806, 0.05000000074505806], [0.4937500059604645, 0.4312500059604645, 0.02500000037252903, 0.02500000037252903], [0.4937500059604645, 0.4312500059604645, 0.05000000074505806, 0.05000000074505806], [0.5062500238418579, 0.4312500059604645, 0.02500000037252903, 0.02500000037252903], [0.5062500238418579, 0.4312500059604645, 0.05000000074505806, 0.05000000074505806], [0.518750011920929, 0.4312500059604645, 0.02500000037252903, 0.02500000037252903], [0.518750011920929, 0.4312500059604645, 0.05000000074505806, 0.05000000074505806], [0.53125, 0.4312500059604645, 0.02500000037252903, 0.02500000037252903], [0.53125, 0.4312500059604645, 0.05000000074505806, 0.05000000074505806], [0.543749988079071, 0.4312500059604645, 0.02500000037252903, 0.02500000037252903], [0.543749988079071, 0.4312500059604645, 0.05000000074505806, 0.05000000074505806], [0.5562499761581421, 0.4312500059604645, 0.02500000037252903, 0.02500000037252903], [0.5562499761581421, 0.4312500059604645, 0.05000000074505806, 0.05000000074505806], [0.5687500238418579, 0.4312500059604645, 0.02500000037252903, 0.02500000037252903], [0.5687500238418579, 0.4312500059604645, 0.05000000074505806, 0.05000000074505806], [0.581250011920929, 0.4312500059604645, 0.02500000037252903, 0.02500000037252903], [0.581250011920929, 0.4312500059604645, 0.05000000074505806, 0.05000000074505806], [0.59375, 0.4312500059604645, 0.02500000037252903, 0.02500000037252903], [0.59375, 0.4312500059604645, 0.05000000074505806, 0.05000000074505806], [0.606249988079071, 0.4312500059604645, 0.02500000037252903, 0.02500000037252903], [0.606249988079071, 0.4312500059604645, 0.05000000074505806, 0.05000000074505806], [0.6187499761581421, 0.4312500059604645, 0.02500000037252903, 0.02500000037252903], [0.6187499761581421, 0.4312500059604645, 0.05000000074505806, 0.05000000074505806], [0.6312500238418579, 0.4312500059604645, 0.02500000037252903, 0.02500000037252903], [0.6312500238418579, 0.4312500059604645, 0.05000000074505806, 0.05000000074505806], [0.643750011920929, 0.4312500059604645, 0.02500000037252903, 0.02500000037252903], [0.643750011920929, 0.4312500059604645, 0.05000000074505806, 0.05000000074505806], [0.65625, 0.4312500059604645, 0.02500000037252903, 0.02500000037252903], [0.65625, 0.4312500059604645, 0.05000000074505806, 0.05000000074505806], [0.668749988079071, 0.4312500059604645, 0.02500000037252903, 0.02500000037252903], [0.668749988079071, 0.4312500059604645, 0.05000000074505806, 0.05000000074505806], [0.6812499761581421, 0.4312500059604645, 0.02500000037252903, 0.02500000037252903], [0.6812499761581421, 0.4312500059604645, 0.05000000074505806, 0.05000000074505806], [0.6937500238418579, 0.4312500059604645, 0.02500000037252903, 0.02500000037252903], [0.6937500238418579, 0.4312500059604645, 0.05000000074505806, 0.05000000074505806], [0.706250011920929, 0.4312500059604645, 0.02500000037252903, 0.02500000037252903], [0.706250011920929, 0.4312500059604645, 0.05000000074505806, 0.05000000074505806], [0.71875, 0.4312500059604645, 0.02500000037252903, 0.02500000037252903], [0.71875, 0.4312500059604645, 0.05000000074505806, 0.05000000074505806], [0.731249988079071, 0.4312500059604645, 0.02500000037252903, 0.02500000037252903], [0.731249988079071, 0.4312500059604645, 0.05000000074505806, 0.05000000074505806], [0.7437499761581421, 0.4312500059604645, 0.02500000037252903, 0.02500000037252903], [0.7437499761581421, 0.4312500059604645, 0.05000000074505806, 0.05000000074505806], [0.7562500238418579, 0.4312500059604645, 0.02500000037252903, 0.02500000037252903], [0.7562500238418579, 0.4312500059604645, 0.05000000074505806, 0.05000000074505806], [0.768750011920929, 0.4312500059604645, 0.02500000037252903, 0.02500000037252903], [0.768750011920929, 0.4312500059604645, 0.05000000074505806, 0.05000000074505806], [0.78125, 0.4312500059604645, 0.02500000037252903, 0.02500000037252903], [0.78125, 0.4312500059604645, 0.05000000074505806, 0.05000000074505806], [0.793749988079071, 0.4312500059604645, 0.02500000037252903, 0.02500000037252903], [0.793749988079071, 0.4312500059604645, 0.05000000074505806, 0.05000000074505806], [0.8062499761581421, 0.4312500059604645, 0.02500000037252903, 0.02500000037252903], [0.8062499761581421, 0.4312500059604645, 0.05000000074505806, 0.05000000074505806], [0.8187500238418579, 0.4312500059604645, 0.02500000037252903, 0.02500000037252903], [0.8187500238418579, 0.4312500059604645, 0.05000000074505806, 0.05000000074505806], [0.831250011920929, 0.4312500059604645, 0.02500000037252903, 0.02500000037252903], [0.831250011920929, 0.4312500059604645, 0.05000000074505806, 0.05000000074505806], [0.84375, 0.4312500059604645, 0.02500000037252903, 0.02500000037252903], [0.84375, 0.4312500059604645, 0.05000000074505806, 0.05000000074505806], [0.856249988079071, 0.4312500059604645, 0.02500000037252903, 0.02500000037252903], [0.856249988079071, 0.4312500059604645, 0.05000000074505806, 0.05000000074505806], [0.8687499761581421, 0.4312500059604645, 0.02500000037252903, 0.02500000037252903], [0.8687499761581421, 0.4312500059604645, 0.05000000074505806, 0.05000000074505806], [0.8812500238418579, 0.4312500059604645, 0.02500000037252903, 0.02500000037252903], [0.8812500238418579, 0.4312500059604645, 0.05000000074505806, 0.05000000074505806], [0.893750011920929, 0.4312500059604645, 0.02500000037252903, 0.02500000037252903], [0.893750011920929, 0.4312500059604645, 0.05000000074505806, 0.05000000074505806], [0.90625, 0.4312500059604645, 0.02500000037252903, 0.02500000037252903], [0.90625, 0.4312500059604645, 0.05000000074505806, 0.05000000074505806], [0.918749988079071, 0.4312500059604645, 0.02500000037252903, 0.02500000037252903], [0.918749988079071, 0.4312500059604645, 0.05000000074505806, 0.05000000074505806], [0.9312499761581421, 0.4312500059604645, 0.02500000037252903, 0.02500000037252903], [0.9312499761581421, 0.4312500059604645, 0.05000000074505806, 0.05000000074505806], [0.9437500238418579, 0.4312500059604645, 0.02500000037252903, 0.02500000037252903], [0.9437500238418579, 0.4312500059604645, 0.05000000074505806, 0.05000000074505806], [0.956250011920929, 0.4312500059604645, 0.02500000037252903, 0.02500000037252903], [0.956250011920929, 0.4312500059604645, 0.05000000074505806, 0.05000000074505806], [0.96875, 0.4312500059604645, 0.02500000037252903, 0.02500000037252903], [0.96875, 0.4312500059604645, 0.05000000074505806, 0.05000000074505806], [0.981249988079071, 0.4312500059604645, 0.02500000037252903, 0.02500000037252903], [0.981249988079071, 0.4312500059604645, 0.05000000074505806, 0.05000000074505806], [0.9937499761581421, 0.4312500059604645, 0.02500000037252903, 0.02500000037252903], [0.9937499761581421, 0.4312500059604645, 0.05000000074505806, 0.05000000074505806], [0.0062500000931322575, 0.4437499940395355, 0.02500000037252903, 0.02500000037252903], [0.0062500000931322575, 0.4437499940395355, 0.05000000074505806, 0.05000000074505806], [0.01875000074505806, 0.4437499940395355, 0.02500000037252903, 0.02500000037252903], [0.01875000074505806, 0.4437499940395355, 0.05000000074505806, 0.05000000074505806], [0.03125, 0.4437499940395355, 0.02500000037252903, 0.02500000037252903], [0.03125, 0.4437499940395355, 0.05000000074505806, 0.05000000074505806], [0.04374999925494194, 0.4437499940395355, 0.02500000037252903, 0.02500000037252903], [0.04374999925494194, 0.4437499940395355, 0.05000000074505806, 0.05000000074505806], [0.05624999850988388, 0.4437499940395355, 0.02500000037252903, 0.02500000037252903], [0.05624999850988388, 0.4437499940395355, 0.05000000074505806, 0.05000000074505806], [0.06875000149011612, 0.4437499940395355, 0.02500000037252903, 0.02500000037252903], [0.06875000149011612, 0.4437499940395355, 0.05000000074505806, 0.05000000074505806], [0.08124999701976776, 0.4437499940395355, 0.02500000037252903, 0.02500000037252903], [0.08124999701976776, 0.4437499940395355, 0.05000000074505806, 0.05000000074505806], [0.09375, 0.4437499940395355, 0.02500000037252903, 0.02500000037252903], [0.09375, 0.4437499940395355, 0.05000000074505806, 0.05000000074505806], [0.10625000298023224, 0.4437499940395355, 0.02500000037252903, 0.02500000037252903], [0.10625000298023224, 0.4437499940395355, 0.05000000074505806, 0.05000000074505806], [0.11874999850988388, 0.4437499940395355, 0.02500000037252903, 0.02500000037252903], [0.11874999850988388, 0.4437499940395355, 0.05000000074505806, 0.05000000074505806], [0.13124999403953552, 0.4437499940395355, 0.02500000037252903, 0.02500000037252903], [0.13124999403953552, 0.4437499940395355, 0.05000000074505806, 0.05000000074505806], [0.14374999701976776, 0.4437499940395355, 0.02500000037252903, 0.02500000037252903], [0.14374999701976776, 0.4437499940395355, 0.05000000074505806, 0.05000000074505806], [0.15625, 0.4437499940395355, 0.02500000037252903, 0.02500000037252903], [0.15625, 0.4437499940395355, 0.05000000074505806, 0.05000000074505806], [0.16875000298023224, 0.4437499940395355, 0.02500000037252903, 0.02500000037252903], [0.16875000298023224, 0.4437499940395355, 0.05000000074505806, 0.05000000074505806], [0.18125000596046448, 0.4437499940395355, 0.02500000037252903, 0.02500000037252903], [0.18125000596046448, 0.4437499940395355, 0.05000000074505806, 0.05000000074505806], [0.19374999403953552, 0.4437499940395355, 0.02500000037252903, 0.02500000037252903], [0.19374999403953552, 0.4437499940395355, 0.05000000074505806, 0.05000000074505806], [0.20624999701976776, 0.4437499940395355, 0.02500000037252903, 0.02500000037252903], [0.20624999701976776, 0.4437499940395355, 0.05000000074505806, 0.05000000074505806], [0.21875, 0.4437499940395355, 0.02500000037252903, 0.02500000037252903], [0.21875, 0.4437499940395355, 0.05000000074505806, 0.05000000074505806], [0.23125000298023224, 0.4437499940395355, 0.02500000037252903, 0.02500000037252903], [0.23125000298023224, 0.4437499940395355, 0.05000000074505806, 0.05000000074505806], [0.24375000596046448, 0.4437499940395355, 0.02500000037252903, 0.02500000037252903], [0.24375000596046448, 0.4437499940395355, 0.05000000074505806, 0.05000000074505806], [0.2562499940395355, 0.4437499940395355, 0.02500000037252903, 0.02500000037252903], [0.2562499940395355, 0.4437499940395355, 0.05000000074505806, 0.05000000074505806], [0.26875001192092896, 0.4437499940395355, 0.02500000037252903, 0.02500000037252903], [0.26875001192092896, 0.4437499940395355, 0.05000000074505806, 0.05000000074505806], [0.28125, 0.4437499940395355, 0.02500000037252903, 0.02500000037252903], [0.28125, 0.4437499940395355, 0.05000000074505806, 0.05000000074505806], [0.29374998807907104, 0.4437499940395355, 0.02500000037252903, 0.02500000037252903], [0.29374998807907104, 0.4437499940395355, 0.05000000074505806, 0.05000000074505806], [0.3062500059604645, 0.4437499940395355, 0.02500000037252903, 0.02500000037252903], [0.3062500059604645, 0.4437499940395355, 0.05000000074505806, 0.05000000074505806], [0.3187499940395355, 0.4437499940395355, 0.02500000037252903, 0.02500000037252903], [0.3187499940395355, 0.4437499940395355, 0.05000000074505806, 0.05000000074505806], [0.33125001192092896, 0.4437499940395355, 0.02500000037252903, 0.02500000037252903], [0.33125001192092896, 0.4437499940395355, 0.05000000074505806, 0.05000000074505806], [0.34375, 0.4437499940395355, 0.02500000037252903, 0.02500000037252903], [0.34375, 0.4437499940395355, 0.05000000074505806, 0.05000000074505806], [0.35624998807907104, 0.4437499940395355, 0.02500000037252903, 0.02500000037252903], [0.35624998807907104, 0.4437499940395355, 0.05000000074505806, 0.05000000074505806], [0.3687500059604645, 0.4437499940395355, 0.02500000037252903, 0.02500000037252903], [0.3687500059604645, 0.4437499940395355, 0.05000000074505806, 0.05000000074505806], [0.3812499940395355, 0.4437499940395355, 0.02500000037252903, 0.02500000037252903], [0.3812499940395355, 0.4437499940395355, 0.05000000074505806, 0.05000000074505806], [0.39375001192092896, 0.4437499940395355, 0.02500000037252903, 0.02500000037252903], [0.39375001192092896, 0.4437499940395355, 0.05000000074505806, 0.05000000074505806], [0.40625, 0.4437499940395355, 0.02500000037252903, 0.02500000037252903], [0.40625, 0.4437499940395355, 0.05000000074505806, 0.05000000074505806], [0.41874998807907104, 0.4437499940395355, 0.02500000037252903, 0.02500000037252903], [0.41874998807907104, 0.4437499940395355, 0.05000000074505806, 0.05000000074505806], [0.4312500059604645, 0.4437499940395355, 0.02500000037252903, 0.02500000037252903], [0.4312500059604645, 0.4437499940395355, 0.05000000074505806, 0.05000000074505806], [0.4437499940395355, 0.4437499940395355, 0.02500000037252903, 0.02500000037252903], [0.4437499940395355, 0.4437499940395355, 0.05000000074505806, 0.05000000074505806], [0.45625001192092896, 0.4437499940395355, 0.02500000037252903, 0.02500000037252903], [0.45625001192092896, 0.4437499940395355, 0.05000000074505806, 0.05000000074505806], [0.46875, 0.4437499940395355, 0.02500000037252903, 0.02500000037252903], [0.46875, 0.4437499940395355, 0.05000000074505806, 0.05000000074505806], [0.48124998807907104, 0.4437499940395355, 0.02500000037252903, 0.02500000037252903], [0.48124998807907104, 0.4437499940395355, 0.05000000074505806, 0.05000000074505806], [0.4937500059604645, 0.4437499940395355, 0.02500000037252903, 0.02500000037252903], [0.4937500059604645, 0.4437499940395355, 0.05000000074505806, 0.05000000074505806], [0.5062500238418579, 0.4437499940395355, 0.02500000037252903, 0.02500000037252903], [0.5062500238418579, 0.4437499940395355, 0.05000000074505806, 0.05000000074505806], [0.518750011920929, 0.4437499940395355, 0.02500000037252903, 0.02500000037252903], [0.518750011920929, 0.4437499940395355, 0.05000000074505806, 0.05000000074505806], [0.53125, 0.4437499940395355, 0.02500000037252903, 0.02500000037252903], [0.53125, 0.4437499940395355, 0.05000000074505806, 0.05000000074505806], [0.543749988079071, 0.4437499940395355, 0.02500000037252903, 0.02500000037252903], [0.543749988079071, 0.4437499940395355, 0.05000000074505806, 0.05000000074505806], [0.5562499761581421, 0.4437499940395355, 0.02500000037252903, 0.02500000037252903], [0.5562499761581421, 0.4437499940395355, 0.05000000074505806, 0.05000000074505806], [0.5687500238418579, 0.4437499940395355, 0.02500000037252903, 0.02500000037252903], [0.5687500238418579, 0.4437499940395355, 0.05000000074505806, 0.05000000074505806], [0.581250011920929, 0.4437499940395355, 0.02500000037252903, 0.02500000037252903], [0.581250011920929, 0.4437499940395355, 0.05000000074505806, 0.05000000074505806], [0.59375, 0.4437499940395355, 0.02500000037252903, 0.02500000037252903], [0.59375, 0.4437499940395355, 0.05000000074505806, 0.05000000074505806], [0.606249988079071, 0.4437499940395355, 0.02500000037252903, 0.02500000037252903], [0.606249988079071, 0.4437499940395355, 0.05000000074505806, 0.05000000074505806], [0.6187499761581421, 0.4437499940395355, 0.02500000037252903, 0.02500000037252903], [0.6187499761581421, 0.4437499940395355, 0.05000000074505806, 0.05000000074505806], [0.6312500238418579, 0.4437499940395355, 0.02500000037252903, 0.02500000037252903], [0.6312500238418579, 0.4437499940395355, 0.05000000074505806, 0.05000000074505806], [0.643750011920929, 0.4437499940395355, 0.02500000037252903, 0.02500000037252903], [0.643750011920929, 0.4437499940395355, 0.05000000074505806, 0.05000000074505806], [0.65625, 0.4437499940395355, 0.02500000037252903, 0.02500000037252903], [0.65625, 0.4437499940395355, 0.05000000074505806, 0.05000000074505806], [0.668749988079071, 0.4437499940395355, 0.02500000037252903, 0.02500000037252903], [0.668749988079071, 0.4437499940395355, 0.05000000074505806, 0.05000000074505806], [0.6812499761581421, 0.4437499940395355, 0.02500000037252903, 0.02500000037252903], [0.6812499761581421, 0.4437499940395355, 0.05000000074505806, 0.05000000074505806], [0.6937500238418579, 0.4437499940395355, 0.02500000037252903, 0.02500000037252903], [0.6937500238418579, 0.4437499940395355, 0.05000000074505806, 0.05000000074505806], [0.706250011920929, 0.4437499940395355, 0.02500000037252903, 0.02500000037252903], [0.706250011920929, 0.4437499940395355, 0.05000000074505806, 0.05000000074505806], [0.71875, 0.4437499940395355, 0.02500000037252903, 0.02500000037252903], [0.71875, 0.4437499940395355, 0.05000000074505806, 0.05000000074505806], [0.731249988079071, 0.4437499940395355, 0.02500000037252903, 0.02500000037252903], [0.731249988079071, 0.4437499940395355, 0.05000000074505806, 0.05000000074505806], [0.7437499761581421, 0.4437499940395355, 0.02500000037252903, 0.02500000037252903], [0.7437499761581421, 0.4437499940395355, 0.05000000074505806, 0.05000000074505806], [0.7562500238418579, 0.4437499940395355, 0.02500000037252903, 0.02500000037252903], [0.7562500238418579, 0.4437499940395355, 0.05000000074505806, 0.05000000074505806], [0.768750011920929, 0.4437499940395355, 0.02500000037252903, 0.02500000037252903], [0.768750011920929, 0.4437499940395355, 0.05000000074505806, 0.05000000074505806], [0.78125, 0.4437499940395355, 0.02500000037252903, 0.02500000037252903], [0.78125, 0.4437499940395355, 0.05000000074505806, 0.05000000074505806], [0.793749988079071, 0.4437499940395355, 0.02500000037252903, 0.02500000037252903], [0.793749988079071, 0.4437499940395355, 0.05000000074505806, 0.05000000074505806], [0.8062499761581421, 0.4437499940395355, 0.02500000037252903, 0.02500000037252903], [0.8062499761581421, 0.4437499940395355, 0.05000000074505806, 0.05000000074505806], [0.8187500238418579, 0.4437499940395355, 0.02500000037252903, 0.02500000037252903], [0.8187500238418579, 0.4437499940395355, 0.05000000074505806, 0.05000000074505806], [0.831250011920929, 0.4437499940395355, 0.02500000037252903, 0.02500000037252903], [0.831250011920929, 0.4437499940395355, 0.05000000074505806, 0.05000000074505806], [0.84375, 0.4437499940395355, 0.02500000037252903, 0.02500000037252903], [0.84375, 0.4437499940395355, 0.05000000074505806, 0.05000000074505806], [0.856249988079071, 0.4437499940395355, 0.02500000037252903, 0.02500000037252903], [0.856249988079071, 0.4437499940395355, 0.05000000074505806, 0.05000000074505806], [0.8687499761581421, 0.4437499940395355, 0.02500000037252903, 0.02500000037252903], [0.8687499761581421, 0.4437499940395355, 0.05000000074505806, 0.05000000074505806], [0.8812500238418579, 0.4437499940395355, 0.02500000037252903, 0.02500000037252903], [0.8812500238418579, 0.4437499940395355, 0.05000000074505806, 0.05000000074505806], [0.893750011920929, 0.4437499940395355, 0.02500000037252903, 0.02500000037252903], [0.893750011920929, 0.4437499940395355, 0.05000000074505806, 0.05000000074505806], [0.90625, 0.4437499940395355, 0.02500000037252903, 0.02500000037252903], [0.90625, 0.4437499940395355, 0.05000000074505806, 0.05000000074505806], [0.918749988079071, 0.4437499940395355, 0.02500000037252903, 0.02500000037252903], [0.918749988079071, 0.4437499940395355, 0.05000000074505806, 0.05000000074505806], [0.9312499761581421, 0.4437499940395355, 0.02500000037252903, 0.02500000037252903], [0.9312499761581421, 0.4437499940395355, 0.05000000074505806, 0.05000000074505806], [0.9437500238418579, 0.4437499940395355, 0.02500000037252903, 0.02500000037252903], [0.9437500238418579, 0.4437499940395355, 0.05000000074505806, 0.05000000074505806], [0.956250011920929, 0.4437499940395355, 0.02500000037252903, 0.02500000037252903], [0.956250011920929, 0.4437499940395355, 0.05000000074505806, 0.05000000074505806], [0.96875, 0.4437499940395355, 0.02500000037252903, 0.02500000037252903], [0.96875, 0.4437499940395355, 0.05000000074505806, 0.05000000074505806], [0.981249988079071, 0.4437499940395355, 0.02500000037252903, 0.02500000037252903], [0.981249988079071, 0.4437499940395355, 0.05000000074505806, 0.05000000074505806], [0.9937499761581421, 0.4437499940395355, 0.02500000037252903, 0.02500000037252903], [0.9937499761581421, 0.4437499940395355, 0.05000000074505806, 0.05000000074505806], [0.0062500000931322575, 0.45625001192092896, 0.02500000037252903, 0.02500000037252903], [0.0062500000931322575, 0.45625001192092896, 0.05000000074505806, 0.05000000074505806], [0.01875000074505806, 0.45625001192092896, 0.02500000037252903, 0.02500000037252903], [0.01875000074505806, 0.45625001192092896, 0.05000000074505806, 0.05000000074505806], [0.03125, 0.45625001192092896, 0.02500000037252903, 0.02500000037252903], [0.03125, 0.45625001192092896, 0.05000000074505806, 0.05000000074505806], [0.04374999925494194, 0.45625001192092896, 0.02500000037252903, 0.02500000037252903], [0.04374999925494194, 0.45625001192092896, 0.05000000074505806, 0.05000000074505806], [0.05624999850988388, 0.45625001192092896, 0.02500000037252903, 0.02500000037252903], [0.05624999850988388, 0.45625001192092896, 0.05000000074505806, 0.05000000074505806], [0.06875000149011612, 0.45625001192092896, 0.02500000037252903, 0.02500000037252903], [0.06875000149011612, 0.45625001192092896, 0.05000000074505806, 0.05000000074505806], [0.08124999701976776, 0.45625001192092896, 0.02500000037252903, 0.02500000037252903], [0.08124999701976776, 0.45625001192092896, 0.05000000074505806, 0.05000000074505806], [0.09375, 0.45625001192092896, 0.02500000037252903, 0.02500000037252903], [0.09375, 0.45625001192092896, 0.05000000074505806, 0.05000000074505806], [0.10625000298023224, 0.45625001192092896, 0.02500000037252903, 0.02500000037252903], [0.10625000298023224, 0.45625001192092896, 0.05000000074505806, 0.05000000074505806], [0.11874999850988388, 0.45625001192092896, 0.02500000037252903, 0.02500000037252903], [0.11874999850988388, 0.45625001192092896, 0.05000000074505806, 0.05000000074505806], [0.13124999403953552, 0.45625001192092896, 0.02500000037252903, 0.02500000037252903], [0.13124999403953552, 0.45625001192092896, 0.05000000074505806, 0.05000000074505806], [0.14374999701976776, 0.45625001192092896, 0.02500000037252903, 0.02500000037252903], [0.14374999701976776, 0.45625001192092896, 0.05000000074505806, 0.05000000074505806], [0.15625, 0.45625001192092896, 0.02500000037252903, 0.02500000037252903], [0.15625, 0.45625001192092896, 0.05000000074505806, 0.05000000074505806], [0.16875000298023224, 0.45625001192092896, 0.02500000037252903, 0.02500000037252903], [0.16875000298023224, 0.45625001192092896, 0.05000000074505806, 0.05000000074505806], [0.18125000596046448, 0.45625001192092896, 0.02500000037252903, 0.02500000037252903], [0.18125000596046448, 0.45625001192092896, 0.05000000074505806, 0.05000000074505806], [0.19374999403953552, 0.45625001192092896, 0.02500000037252903, 0.02500000037252903], [0.19374999403953552, 0.45625001192092896, 0.05000000074505806, 0.05000000074505806], [0.20624999701976776, 0.45625001192092896, 0.02500000037252903, 0.02500000037252903], [0.20624999701976776, 0.45625001192092896, 0.05000000074505806, 0.05000000074505806], [0.21875, 0.45625001192092896, 0.02500000037252903, 0.02500000037252903], [0.21875, 0.45625001192092896, 0.05000000074505806, 0.05000000074505806], [0.23125000298023224, 0.45625001192092896, 0.02500000037252903, 0.02500000037252903], [0.23125000298023224, 0.45625001192092896, 0.05000000074505806, 0.05000000074505806], [0.24375000596046448, 0.45625001192092896, 0.02500000037252903, 0.02500000037252903], [0.24375000596046448, 0.45625001192092896, 0.05000000074505806, 0.05000000074505806], [0.2562499940395355, 0.45625001192092896, 0.02500000037252903, 0.02500000037252903], [0.2562499940395355, 0.45625001192092896, 0.05000000074505806, 0.05000000074505806], [0.26875001192092896, 0.45625001192092896, 0.02500000037252903, 0.02500000037252903], [0.26875001192092896, 0.45625001192092896, 0.05000000074505806, 0.05000000074505806], [0.28125, 0.45625001192092896, 0.02500000037252903, 0.02500000037252903], [0.28125, 0.45625001192092896, 0.05000000074505806, 0.05000000074505806], [0.29374998807907104, 0.45625001192092896, 0.02500000037252903, 0.02500000037252903], [0.29374998807907104, 0.45625001192092896, 0.05000000074505806, 0.05000000074505806], [0.3062500059604645, 0.45625001192092896, 0.02500000037252903, 0.02500000037252903], [0.3062500059604645, 0.45625001192092896, 0.05000000074505806, 0.05000000074505806], [0.3187499940395355, 0.45625001192092896, 0.02500000037252903, 0.02500000037252903], [0.3187499940395355, 0.45625001192092896, 0.05000000074505806, 0.05000000074505806], [0.33125001192092896, 0.45625001192092896, 0.02500000037252903, 0.02500000037252903], [0.33125001192092896, 0.45625001192092896, 0.05000000074505806, 0.05000000074505806], [0.34375, 0.45625001192092896, 0.02500000037252903, 0.02500000037252903], [0.34375, 0.45625001192092896, 0.05000000074505806, 0.05000000074505806], [0.35624998807907104, 0.45625001192092896, 0.02500000037252903, 0.02500000037252903], [0.35624998807907104, 0.45625001192092896, 0.05000000074505806, 0.05000000074505806], [0.3687500059604645, 0.45625001192092896, 0.02500000037252903, 0.02500000037252903], [0.3687500059604645, 0.45625001192092896, 0.05000000074505806, 0.05000000074505806], [0.3812499940395355, 0.45625001192092896, 0.02500000037252903, 0.02500000037252903], [0.3812499940395355, 0.45625001192092896, 0.05000000074505806, 0.05000000074505806], [0.39375001192092896, 0.45625001192092896, 0.02500000037252903, 0.02500000037252903], [0.39375001192092896, 0.45625001192092896, 0.05000000074505806, 0.05000000074505806], [0.40625, 0.45625001192092896, 0.02500000037252903, 0.02500000037252903], [0.40625, 0.45625001192092896, 0.05000000074505806, 0.05000000074505806], [0.41874998807907104, 0.45625001192092896, 0.02500000037252903, 0.02500000037252903], [0.41874998807907104, 0.45625001192092896, 0.05000000074505806, 0.05000000074505806], [0.4312500059604645, 0.45625001192092896, 0.02500000037252903, 0.02500000037252903], [0.4312500059604645, 0.45625001192092896, 0.05000000074505806, 0.05000000074505806], [0.4437499940395355, 0.45625001192092896, 0.02500000037252903, 0.02500000037252903], [0.4437499940395355, 0.45625001192092896, 0.05000000074505806, 0.05000000074505806], [0.45625001192092896, 0.45625001192092896, 0.02500000037252903, 0.02500000037252903], [0.45625001192092896, 0.45625001192092896, 0.05000000074505806, 0.05000000074505806], [0.46875, 0.45625001192092896, 0.02500000037252903, 0.02500000037252903], [0.46875, 0.45625001192092896, 0.05000000074505806, 0.05000000074505806], [0.48124998807907104, 0.45625001192092896, 0.02500000037252903, 0.02500000037252903], [0.48124998807907104, 0.45625001192092896, 0.05000000074505806, 0.05000000074505806], [0.4937500059604645, 0.45625001192092896, 0.02500000037252903, 0.02500000037252903], [0.4937500059604645, 0.45625001192092896, 0.05000000074505806, 0.05000000074505806], [0.5062500238418579, 0.45625001192092896, 0.02500000037252903, 0.02500000037252903], [0.5062500238418579, 0.45625001192092896, 0.05000000074505806, 0.05000000074505806], [0.518750011920929, 0.45625001192092896, 0.02500000037252903, 0.02500000037252903], [0.518750011920929, 0.45625001192092896, 0.05000000074505806, 0.05000000074505806], [0.53125, 0.45625001192092896, 0.02500000037252903, 0.02500000037252903], [0.53125, 0.45625001192092896, 0.05000000074505806, 0.05000000074505806], [0.543749988079071, 0.45625001192092896, 0.02500000037252903, 0.02500000037252903], [0.543749988079071, 0.45625001192092896, 0.05000000074505806, 0.05000000074505806], [0.5562499761581421, 0.45625001192092896, 0.02500000037252903, 0.02500000037252903], [0.5562499761581421, 0.45625001192092896, 0.05000000074505806, 0.05000000074505806], [0.5687500238418579, 0.45625001192092896, 0.02500000037252903, 0.02500000037252903], [0.5687500238418579, 0.45625001192092896, 0.05000000074505806, 0.05000000074505806], [0.581250011920929, 0.45625001192092896, 0.02500000037252903, 0.02500000037252903], [0.581250011920929, 0.45625001192092896, 0.05000000074505806, 0.05000000074505806], [0.59375, 0.45625001192092896, 0.02500000037252903, 0.02500000037252903], [0.59375, 0.45625001192092896, 0.05000000074505806, 0.05000000074505806], [0.606249988079071, 0.45625001192092896, 0.02500000037252903, 0.02500000037252903], [0.606249988079071, 0.45625001192092896, 0.05000000074505806, 0.05000000074505806], [0.6187499761581421, 0.45625001192092896, 0.02500000037252903, 0.02500000037252903], [0.6187499761581421, 0.45625001192092896, 0.05000000074505806, 0.05000000074505806], [0.6312500238418579, 0.45625001192092896, 0.02500000037252903, 0.02500000037252903], [0.6312500238418579, 0.45625001192092896, 0.05000000074505806, 0.05000000074505806], [0.643750011920929, 0.45625001192092896, 0.02500000037252903, 0.02500000037252903], [0.643750011920929, 0.45625001192092896, 0.05000000074505806, 0.05000000074505806], [0.65625, 0.45625001192092896, 0.02500000037252903, 0.02500000037252903], [0.65625, 0.45625001192092896, 0.05000000074505806, 0.05000000074505806], [0.668749988079071, 0.45625001192092896, 0.02500000037252903, 0.02500000037252903], [0.668749988079071, 0.45625001192092896, 0.05000000074505806, 0.05000000074505806], [0.6812499761581421, 0.45625001192092896, 0.02500000037252903, 0.02500000037252903], [0.6812499761581421, 0.45625001192092896, 0.05000000074505806, 0.05000000074505806], [0.6937500238418579, 0.45625001192092896, 0.02500000037252903, 0.02500000037252903], [0.6937500238418579, 0.45625001192092896, 0.05000000074505806, 0.05000000074505806], [0.706250011920929, 0.45625001192092896, 0.02500000037252903, 0.02500000037252903], [0.706250011920929, 0.45625001192092896, 0.05000000074505806, 0.05000000074505806], [0.71875, 0.45625001192092896, 0.02500000037252903, 0.02500000037252903], [0.71875, 0.45625001192092896, 0.05000000074505806, 0.05000000074505806], [0.731249988079071, 0.45625001192092896, 0.02500000037252903, 0.02500000037252903], [0.731249988079071, 0.45625001192092896, 0.05000000074505806, 0.05000000074505806], [0.7437499761581421, 0.45625001192092896, 0.02500000037252903, 0.02500000037252903], [0.7437499761581421, 0.45625001192092896, 0.05000000074505806, 0.05000000074505806], [0.7562500238418579, 0.45625001192092896, 0.02500000037252903, 0.02500000037252903], [0.7562500238418579, 0.45625001192092896, 0.05000000074505806, 0.05000000074505806], [0.768750011920929, 0.45625001192092896, 0.02500000037252903, 0.02500000037252903], [0.768750011920929, 0.45625001192092896, 0.05000000074505806, 0.05000000074505806], [0.78125, 0.45625001192092896, 0.02500000037252903, 0.02500000037252903], [0.78125, 0.45625001192092896, 0.05000000074505806, 0.05000000074505806], [0.793749988079071, 0.45625001192092896, 0.02500000037252903, 0.02500000037252903], [0.793749988079071, 0.45625001192092896, 0.05000000074505806, 0.05000000074505806], [0.8062499761581421, 0.45625001192092896, 0.02500000037252903, 0.02500000037252903], [0.8062499761581421, 0.45625001192092896, 0.05000000074505806, 0.05000000074505806], [0.8187500238418579, 0.45625001192092896, 0.02500000037252903, 0.02500000037252903], [0.8187500238418579, 0.45625001192092896, 0.05000000074505806, 0.05000000074505806], [0.831250011920929, 0.45625001192092896, 0.02500000037252903, 0.02500000037252903], [0.831250011920929, 0.45625001192092896, 0.05000000074505806, 0.05000000074505806], [0.84375, 0.45625001192092896, 0.02500000037252903, 0.02500000037252903], [0.84375, 0.45625001192092896, 0.05000000074505806, 0.05000000074505806], [0.856249988079071, 0.45625001192092896, 0.02500000037252903, 0.02500000037252903], [0.856249988079071, 0.45625001192092896, 0.05000000074505806, 0.05000000074505806], [0.8687499761581421, 0.45625001192092896, 0.02500000037252903, 0.02500000037252903], [0.8687499761581421, 0.45625001192092896, 0.05000000074505806, 0.05000000074505806], [0.8812500238418579, 0.45625001192092896, 0.02500000037252903, 0.02500000037252903], [0.8812500238418579, 0.45625001192092896, 0.05000000074505806, 0.05000000074505806], [0.893750011920929, 0.45625001192092896, 0.02500000037252903, 0.02500000037252903], [0.893750011920929, 0.45625001192092896, 0.05000000074505806, 0.05000000074505806], [0.90625, 0.45625001192092896, 0.02500000037252903, 0.02500000037252903], [0.90625, 0.45625001192092896, 0.05000000074505806, 0.05000000074505806], [0.918749988079071, 0.45625001192092896, 0.02500000037252903, 0.02500000037252903], [0.918749988079071, 0.45625001192092896, 0.05000000074505806, 0.05000000074505806], [0.9312499761581421, 0.45625001192092896, 0.02500000037252903, 0.02500000037252903], [0.9312499761581421, 0.45625001192092896, 0.05000000074505806, 0.05000000074505806], [0.9437500238418579, 0.45625001192092896, 0.02500000037252903, 0.02500000037252903], [0.9437500238418579, 0.45625001192092896, 0.05000000074505806, 0.05000000074505806], [0.956250011920929, 0.45625001192092896, 0.02500000037252903, 0.02500000037252903], [0.956250011920929, 0.45625001192092896, 0.05000000074505806, 0.05000000074505806], [0.96875, 0.45625001192092896, 0.02500000037252903, 0.02500000037252903], [0.96875, 0.45625001192092896, 0.05000000074505806, 0.05000000074505806], [0.981249988079071, 0.45625001192092896, 0.02500000037252903, 0.02500000037252903], [0.981249988079071, 0.45625001192092896, 0.05000000074505806, 0.05000000074505806], [0.9937499761581421, 0.45625001192092896, 0.02500000037252903, 0.02500000037252903], [0.9937499761581421, 0.45625001192092896, 0.05000000074505806, 0.05000000074505806], [0.0062500000931322575, 0.46875, 0.02500000037252903, 0.02500000037252903], [0.0062500000931322575, 0.46875, 0.05000000074505806, 0.05000000074505806], [0.01875000074505806, 0.46875, 0.02500000037252903, 0.02500000037252903], [0.01875000074505806, 0.46875, 0.05000000074505806, 0.05000000074505806], [0.03125, 0.46875, 0.02500000037252903, 0.02500000037252903], [0.03125, 0.46875, 0.05000000074505806, 0.05000000074505806], [0.04374999925494194, 0.46875, 0.02500000037252903, 0.02500000037252903], [0.04374999925494194, 0.46875, 0.05000000074505806, 0.05000000074505806], [0.05624999850988388, 0.46875, 0.02500000037252903, 0.02500000037252903], [0.05624999850988388, 0.46875, 0.05000000074505806, 0.05000000074505806], [0.06875000149011612, 0.46875, 0.02500000037252903, 0.02500000037252903], [0.06875000149011612, 0.46875, 0.05000000074505806, 0.05000000074505806], [0.08124999701976776, 0.46875, 0.02500000037252903, 0.02500000037252903], [0.08124999701976776, 0.46875, 0.05000000074505806, 0.05000000074505806], [0.09375, 0.46875, 0.02500000037252903, 0.02500000037252903], [0.09375, 0.46875, 0.05000000074505806, 0.05000000074505806], [0.10625000298023224, 0.46875, 0.02500000037252903, 0.02500000037252903], [0.10625000298023224, 0.46875, 0.05000000074505806, 0.05000000074505806], [0.11874999850988388, 0.46875, 0.02500000037252903, 0.02500000037252903], [0.11874999850988388, 0.46875, 0.05000000074505806, 0.05000000074505806], [0.13124999403953552, 0.46875, 0.02500000037252903, 0.02500000037252903], [0.13124999403953552, 0.46875, 0.05000000074505806, 0.05000000074505806], [0.14374999701976776, 0.46875, 0.02500000037252903, 0.02500000037252903], [0.14374999701976776, 0.46875, 0.05000000074505806, 0.05000000074505806], [0.15625, 0.46875, 0.02500000037252903, 0.02500000037252903], [0.15625, 0.46875, 0.05000000074505806, 0.05000000074505806], [0.16875000298023224, 0.46875, 0.02500000037252903, 0.02500000037252903], [0.16875000298023224, 0.46875, 0.05000000074505806, 0.05000000074505806], [0.18125000596046448, 0.46875, 0.02500000037252903, 0.02500000037252903], [0.18125000596046448, 0.46875, 0.05000000074505806, 0.05000000074505806], [0.19374999403953552, 0.46875, 0.02500000037252903, 0.02500000037252903], [0.19374999403953552, 0.46875, 0.05000000074505806, 0.05000000074505806], [0.20624999701976776, 0.46875, 0.02500000037252903, 0.02500000037252903], [0.20624999701976776, 0.46875, 0.05000000074505806, 0.05000000074505806], [0.21875, 0.46875, 0.02500000037252903, 0.02500000037252903], [0.21875, 0.46875, 0.05000000074505806, 0.05000000074505806], [0.23125000298023224, 0.46875, 0.02500000037252903, 0.02500000037252903], [0.23125000298023224, 0.46875, 0.05000000074505806, 0.05000000074505806], [0.24375000596046448, 0.46875, 0.02500000037252903, 0.02500000037252903], [0.24375000596046448, 0.46875, 0.05000000074505806, 0.05000000074505806], [0.2562499940395355, 0.46875, 0.02500000037252903, 0.02500000037252903], [0.2562499940395355, 0.46875, 0.05000000074505806, 0.05000000074505806], [0.26875001192092896, 0.46875, 0.02500000037252903, 0.02500000037252903], [0.26875001192092896, 0.46875, 0.05000000074505806, 0.05000000074505806], [0.28125, 0.46875, 0.02500000037252903, 0.02500000037252903], [0.28125, 0.46875, 0.05000000074505806, 0.05000000074505806], [0.29374998807907104, 0.46875, 0.02500000037252903, 0.02500000037252903], [0.29374998807907104, 0.46875, 0.05000000074505806, 0.05000000074505806], [0.3062500059604645, 0.46875, 0.02500000037252903, 0.02500000037252903], [0.3062500059604645, 0.46875, 0.05000000074505806, 0.05000000074505806], [0.3187499940395355, 0.46875, 0.02500000037252903, 0.02500000037252903], [0.3187499940395355, 0.46875, 0.05000000074505806, 0.05000000074505806], [0.33125001192092896, 0.46875, 0.02500000037252903, 0.02500000037252903], [0.33125001192092896, 0.46875, 0.05000000074505806, 0.05000000074505806], [0.34375, 0.46875, 0.02500000037252903, 0.02500000037252903], [0.34375, 0.46875, 0.05000000074505806, 0.05000000074505806], [0.35624998807907104, 0.46875, 0.02500000037252903, 0.02500000037252903], [0.35624998807907104, 0.46875, 0.05000000074505806, 0.05000000074505806], [0.3687500059604645, 0.46875, 0.02500000037252903, 0.02500000037252903], [0.3687500059604645, 0.46875, 0.05000000074505806, 0.05000000074505806], [0.3812499940395355, 0.46875, 0.02500000037252903, 0.02500000037252903], [0.3812499940395355, 0.46875, 0.05000000074505806, 0.05000000074505806], [0.39375001192092896, 0.46875, 0.02500000037252903, 0.02500000037252903], [0.39375001192092896, 0.46875, 0.05000000074505806, 0.05000000074505806], [0.40625, 0.46875, 0.02500000037252903, 0.02500000037252903], [0.40625, 0.46875, 0.05000000074505806, 0.05000000074505806], [0.41874998807907104, 0.46875, 0.02500000037252903, 0.02500000037252903], [0.41874998807907104, 0.46875, 0.05000000074505806, 0.05000000074505806], [0.4312500059604645, 0.46875, 0.02500000037252903, 0.02500000037252903], [0.4312500059604645, 0.46875, 0.05000000074505806, 0.05000000074505806], [0.4437499940395355, 0.46875, 0.02500000037252903, 0.02500000037252903], [0.4437499940395355, 0.46875, 0.05000000074505806, 0.05000000074505806], [0.45625001192092896, 0.46875, 0.02500000037252903, 0.02500000037252903], [0.45625001192092896, 0.46875, 0.05000000074505806, 0.05000000074505806], [0.46875, 0.46875, 0.02500000037252903, 0.02500000037252903], [0.46875, 0.46875, 0.05000000074505806, 0.05000000074505806], [0.48124998807907104, 0.46875, 0.02500000037252903, 0.02500000037252903], [0.48124998807907104, 0.46875, 0.05000000074505806, 0.05000000074505806], [0.4937500059604645, 0.46875, 0.02500000037252903, 0.02500000037252903], [0.4937500059604645, 0.46875, 0.05000000074505806, 0.05000000074505806], [0.5062500238418579, 0.46875, 0.02500000037252903, 0.02500000037252903], [0.5062500238418579, 0.46875, 0.05000000074505806, 0.05000000074505806], [0.518750011920929, 0.46875, 0.02500000037252903, 0.02500000037252903], [0.518750011920929, 0.46875, 0.05000000074505806, 0.05000000074505806], [0.53125, 0.46875, 0.02500000037252903, 0.02500000037252903], [0.53125, 0.46875, 0.05000000074505806, 0.05000000074505806], [0.543749988079071, 0.46875, 0.02500000037252903, 0.02500000037252903], [0.543749988079071, 0.46875, 0.05000000074505806, 0.05000000074505806], [0.5562499761581421, 0.46875, 0.02500000037252903, 0.02500000037252903], [0.5562499761581421, 0.46875, 0.05000000074505806, 0.05000000074505806], [0.5687500238418579, 0.46875, 0.02500000037252903, 0.02500000037252903], [0.5687500238418579, 0.46875, 0.05000000074505806, 0.05000000074505806], [0.581250011920929, 0.46875, 0.02500000037252903, 0.02500000037252903], [0.581250011920929, 0.46875, 0.05000000074505806, 0.05000000074505806], [0.59375, 0.46875, 0.02500000037252903, 0.02500000037252903], [0.59375, 0.46875, 0.05000000074505806, 0.05000000074505806], [0.606249988079071, 0.46875, 0.02500000037252903, 0.02500000037252903], [0.606249988079071, 0.46875, 0.05000000074505806, 0.05000000074505806], [0.6187499761581421, 0.46875, 0.02500000037252903, 0.02500000037252903], [0.6187499761581421, 0.46875, 0.05000000074505806, 0.05000000074505806], [0.6312500238418579, 0.46875, 0.02500000037252903, 0.02500000037252903], [0.6312500238418579, 0.46875, 0.05000000074505806, 0.05000000074505806], [0.643750011920929, 0.46875, 0.02500000037252903, 0.02500000037252903], [0.643750011920929, 0.46875, 0.05000000074505806, 0.05000000074505806], [0.65625, 0.46875, 0.02500000037252903, 0.02500000037252903], [0.65625, 0.46875, 0.05000000074505806, 0.05000000074505806], [0.668749988079071, 0.46875, 0.02500000037252903, 0.02500000037252903], [0.668749988079071, 0.46875, 0.05000000074505806, 0.05000000074505806], [0.6812499761581421, 0.46875, 0.02500000037252903, 0.02500000037252903], [0.6812499761581421, 0.46875, 0.05000000074505806, 0.05000000074505806], [0.6937500238418579, 0.46875, 0.02500000037252903, 0.02500000037252903], [0.6937500238418579, 0.46875, 0.05000000074505806, 0.05000000074505806], [0.706250011920929, 0.46875, 0.02500000037252903, 0.02500000037252903], [0.706250011920929, 0.46875, 0.05000000074505806, 0.05000000074505806], [0.71875, 0.46875, 0.02500000037252903, 0.02500000037252903], [0.71875, 0.46875, 0.05000000074505806, 0.05000000074505806], [0.731249988079071, 0.46875, 0.02500000037252903, 0.02500000037252903], [0.731249988079071, 0.46875, 0.05000000074505806, 0.05000000074505806], [0.7437499761581421, 0.46875, 0.02500000037252903, 0.02500000037252903], [0.7437499761581421, 0.46875, 0.05000000074505806, 0.05000000074505806], [0.7562500238418579, 0.46875, 0.02500000037252903, 0.02500000037252903], [0.7562500238418579, 0.46875, 0.05000000074505806, 0.05000000074505806], [0.768750011920929, 0.46875, 0.02500000037252903, 0.02500000037252903], [0.768750011920929, 0.46875, 0.05000000074505806, 0.05000000074505806], [0.78125, 0.46875, 0.02500000037252903, 0.02500000037252903], [0.78125, 0.46875, 0.05000000074505806, 0.05000000074505806], [0.793749988079071, 0.46875, 0.02500000037252903, 0.02500000037252903], [0.793749988079071, 0.46875, 0.05000000074505806, 0.05000000074505806], [0.8062499761581421, 0.46875, 0.02500000037252903, 0.02500000037252903], [0.8062499761581421, 0.46875, 0.05000000074505806, 0.05000000074505806], [0.8187500238418579, 0.46875, 0.02500000037252903, 0.02500000037252903], [0.8187500238418579, 0.46875, 0.05000000074505806, 0.05000000074505806], [0.831250011920929, 0.46875, 0.02500000037252903, 0.02500000037252903], [0.831250011920929, 0.46875, 0.05000000074505806, 0.05000000074505806], [0.84375, 0.46875, 0.02500000037252903, 0.02500000037252903], [0.84375, 0.46875, 0.05000000074505806, 0.05000000074505806], [0.856249988079071, 0.46875, 0.02500000037252903, 0.02500000037252903], [0.856249988079071, 0.46875, 0.05000000074505806, 0.05000000074505806], [0.8687499761581421, 0.46875, 0.02500000037252903, 0.02500000037252903], [0.8687499761581421, 0.46875, 0.05000000074505806, 0.05000000074505806], [0.8812500238418579, 0.46875, 0.02500000037252903, 0.02500000037252903], [0.8812500238418579, 0.46875, 0.05000000074505806, 0.05000000074505806], [0.893750011920929, 0.46875, 0.02500000037252903, 0.02500000037252903], [0.893750011920929, 0.46875, 0.05000000074505806, 0.05000000074505806], [0.90625, 0.46875, 0.02500000037252903, 0.02500000037252903], [0.90625, 0.46875, 0.05000000074505806, 0.05000000074505806], [0.918749988079071, 0.46875, 0.02500000037252903, 0.02500000037252903], [0.918749988079071, 0.46875, 0.05000000074505806, 0.05000000074505806], [0.9312499761581421, 0.46875, 0.02500000037252903, 0.02500000037252903], [0.9312499761581421, 0.46875, 0.05000000074505806, 0.05000000074505806], [0.9437500238418579, 0.46875, 0.02500000037252903, 0.02500000037252903], [0.9437500238418579, 0.46875, 0.05000000074505806, 0.05000000074505806], [0.956250011920929, 0.46875, 0.02500000037252903, 0.02500000037252903], [0.956250011920929, 0.46875, 0.05000000074505806, 0.05000000074505806], [0.96875, 0.46875, 0.02500000037252903, 0.02500000037252903], [0.96875, 0.46875, 0.05000000074505806, 0.05000000074505806], [0.981249988079071, 0.46875, 0.02500000037252903, 0.02500000037252903], [0.981249988079071, 0.46875, 0.05000000074505806, 0.05000000074505806], [0.9937499761581421, 0.46875, 0.02500000037252903, 0.02500000037252903], [0.9937499761581421, 0.46875, 0.05000000074505806, 0.05000000074505806], [0.0062500000931322575, 0.48124998807907104, 0.02500000037252903, 0.02500000037252903], [0.0062500000931322575, 0.48124998807907104, 0.05000000074505806, 0.05000000074505806], [0.01875000074505806, 0.48124998807907104, 0.02500000037252903, 0.02500000037252903], [0.01875000074505806, 0.48124998807907104, 0.05000000074505806, 0.05000000074505806], [0.03125, 0.48124998807907104, 0.02500000037252903, 0.02500000037252903], [0.03125, 0.48124998807907104, 0.05000000074505806, 0.05000000074505806], [0.04374999925494194, 0.48124998807907104, 0.02500000037252903, 0.02500000037252903], [0.04374999925494194, 0.48124998807907104, 0.05000000074505806, 0.05000000074505806], [0.05624999850988388, 0.48124998807907104, 0.02500000037252903, 0.02500000037252903], [0.05624999850988388, 0.48124998807907104, 0.05000000074505806, 0.05000000074505806], [0.06875000149011612, 0.48124998807907104, 0.02500000037252903, 0.02500000037252903], [0.06875000149011612, 0.48124998807907104, 0.05000000074505806, 0.05000000074505806], [0.08124999701976776, 0.48124998807907104, 0.02500000037252903, 0.02500000037252903], [0.08124999701976776, 0.48124998807907104, 0.05000000074505806, 0.05000000074505806], [0.09375, 0.48124998807907104, 0.02500000037252903, 0.02500000037252903], [0.09375, 0.48124998807907104, 0.05000000074505806, 0.05000000074505806], [0.10625000298023224, 0.48124998807907104, 0.02500000037252903, 0.02500000037252903], [0.10625000298023224, 0.48124998807907104, 0.05000000074505806, 0.05000000074505806], [0.11874999850988388, 0.48124998807907104, 0.02500000037252903, 0.02500000037252903], [0.11874999850988388, 0.48124998807907104, 0.05000000074505806, 0.05000000074505806], [0.13124999403953552, 0.48124998807907104, 0.02500000037252903, 0.02500000037252903], [0.13124999403953552, 0.48124998807907104, 0.05000000074505806, 0.05000000074505806], [0.14374999701976776, 0.48124998807907104, 0.02500000037252903, 0.02500000037252903], [0.14374999701976776, 0.48124998807907104, 0.05000000074505806, 0.05000000074505806], [0.15625, 0.48124998807907104, 0.02500000037252903, 0.02500000037252903], [0.15625, 0.48124998807907104, 0.05000000074505806, 0.05000000074505806], [0.16875000298023224, 0.48124998807907104, 0.02500000037252903, 0.02500000037252903], [0.16875000298023224, 0.48124998807907104, 0.05000000074505806, 0.05000000074505806], [0.18125000596046448, 0.48124998807907104, 0.02500000037252903, 0.02500000037252903], [0.18125000596046448, 0.48124998807907104, 0.05000000074505806, 0.05000000074505806], [0.19374999403953552, 0.48124998807907104, 0.02500000037252903, 0.02500000037252903], [0.19374999403953552, 0.48124998807907104, 0.05000000074505806, 0.05000000074505806], [0.20624999701976776, 0.48124998807907104, 0.02500000037252903, 0.02500000037252903], [0.20624999701976776, 0.48124998807907104, 0.05000000074505806, 0.05000000074505806], [0.21875, 0.48124998807907104, 0.02500000037252903, 0.02500000037252903], [0.21875, 0.48124998807907104, 0.05000000074505806, 0.05000000074505806], [0.23125000298023224, 0.48124998807907104, 0.02500000037252903, 0.02500000037252903], [0.23125000298023224, 0.48124998807907104, 0.05000000074505806, 0.05000000074505806], [0.24375000596046448, 0.48124998807907104, 0.02500000037252903, 0.02500000037252903], [0.24375000596046448, 0.48124998807907104, 0.05000000074505806, 0.05000000074505806], [0.2562499940395355, 0.48124998807907104, 0.02500000037252903, 0.02500000037252903], [0.2562499940395355, 0.48124998807907104, 0.05000000074505806, 0.05000000074505806], [0.26875001192092896, 0.48124998807907104, 0.02500000037252903, 0.02500000037252903], [0.26875001192092896, 0.48124998807907104, 0.05000000074505806, 0.05000000074505806], [0.28125, 0.48124998807907104, 0.02500000037252903, 0.02500000037252903], [0.28125, 0.48124998807907104, 0.05000000074505806, 0.05000000074505806], [0.29374998807907104, 0.48124998807907104, 0.02500000037252903, 0.02500000037252903], [0.29374998807907104, 0.48124998807907104, 0.05000000074505806, 0.05000000074505806], [0.3062500059604645, 0.48124998807907104, 0.02500000037252903, 0.02500000037252903], [0.3062500059604645, 0.48124998807907104, 0.05000000074505806, 0.05000000074505806], [0.3187499940395355, 0.48124998807907104, 0.02500000037252903, 0.02500000037252903], [0.3187499940395355, 0.48124998807907104, 0.05000000074505806, 0.05000000074505806], [0.33125001192092896, 0.48124998807907104, 0.02500000037252903, 0.02500000037252903], [0.33125001192092896, 0.48124998807907104, 0.05000000074505806, 0.05000000074505806], [0.34375, 0.48124998807907104, 0.02500000037252903, 0.02500000037252903], [0.34375, 0.48124998807907104, 0.05000000074505806, 0.05000000074505806], [0.35624998807907104, 0.48124998807907104, 0.02500000037252903, 0.02500000037252903], [0.35624998807907104, 0.48124998807907104, 0.05000000074505806, 0.05000000074505806], [0.3687500059604645, 0.48124998807907104, 0.02500000037252903, 0.02500000037252903], [0.3687500059604645, 0.48124998807907104, 0.05000000074505806, 0.05000000074505806], [0.3812499940395355, 0.48124998807907104, 0.02500000037252903, 0.02500000037252903], [0.3812499940395355, 0.48124998807907104, 0.05000000074505806, 0.05000000074505806], [0.39375001192092896, 0.48124998807907104, 0.02500000037252903, 0.02500000037252903], [0.39375001192092896, 0.48124998807907104, 0.05000000074505806, 0.05000000074505806], [0.40625, 0.48124998807907104, 0.02500000037252903, 0.02500000037252903], [0.40625, 0.48124998807907104, 0.05000000074505806, 0.05000000074505806], [0.41874998807907104, 0.48124998807907104, 0.02500000037252903, 0.02500000037252903], [0.41874998807907104, 0.48124998807907104, 0.05000000074505806, 0.05000000074505806], [0.4312500059604645, 0.48124998807907104, 0.02500000037252903, 0.02500000037252903], [0.4312500059604645, 0.48124998807907104, 0.05000000074505806, 0.05000000074505806], [0.4437499940395355, 0.48124998807907104, 0.02500000037252903, 0.02500000037252903], [0.4437499940395355, 0.48124998807907104, 0.05000000074505806, 0.05000000074505806], [0.45625001192092896, 0.48124998807907104, 0.02500000037252903, 0.02500000037252903], [0.45625001192092896, 0.48124998807907104, 0.05000000074505806, 0.05000000074505806], [0.46875, 0.48124998807907104, 0.02500000037252903, 0.02500000037252903], [0.46875, 0.48124998807907104, 0.05000000074505806, 0.05000000074505806], [0.48124998807907104, 0.48124998807907104, 0.02500000037252903, 0.02500000037252903], [0.48124998807907104, 0.48124998807907104, 0.05000000074505806, 0.05000000074505806], [0.4937500059604645, 0.48124998807907104, 0.02500000037252903, 0.02500000037252903], [0.4937500059604645, 0.48124998807907104, 0.05000000074505806, 0.05000000074505806], [0.5062500238418579, 0.48124998807907104, 0.02500000037252903, 0.02500000037252903], [0.5062500238418579, 0.48124998807907104, 0.05000000074505806, 0.05000000074505806], [0.518750011920929, 0.48124998807907104, 0.02500000037252903, 0.02500000037252903], [0.518750011920929, 0.48124998807907104, 0.05000000074505806, 0.05000000074505806], [0.53125, 0.48124998807907104, 0.02500000037252903, 0.02500000037252903], [0.53125, 0.48124998807907104, 0.05000000074505806, 0.05000000074505806], [0.543749988079071, 0.48124998807907104, 0.02500000037252903, 0.02500000037252903], [0.543749988079071, 0.48124998807907104, 0.05000000074505806, 0.05000000074505806], [0.5562499761581421, 0.48124998807907104, 0.02500000037252903, 0.02500000037252903], [0.5562499761581421, 0.48124998807907104, 0.05000000074505806, 0.05000000074505806], [0.5687500238418579, 0.48124998807907104, 0.02500000037252903, 0.02500000037252903], [0.5687500238418579, 0.48124998807907104, 0.05000000074505806, 0.05000000074505806], [0.581250011920929, 0.48124998807907104, 0.02500000037252903, 0.02500000037252903], [0.581250011920929, 0.48124998807907104, 0.05000000074505806, 0.05000000074505806], [0.59375, 0.48124998807907104, 0.02500000037252903, 0.02500000037252903], [0.59375, 0.48124998807907104, 0.05000000074505806, 0.05000000074505806], [0.606249988079071, 0.48124998807907104, 0.02500000037252903, 0.02500000037252903], [0.606249988079071, 0.48124998807907104, 0.05000000074505806, 0.05000000074505806], [0.6187499761581421, 0.48124998807907104, 0.02500000037252903, 0.02500000037252903], [0.6187499761581421, 0.48124998807907104, 0.05000000074505806, 0.05000000074505806], [0.6312500238418579, 0.48124998807907104, 0.02500000037252903, 0.02500000037252903], [0.6312500238418579, 0.48124998807907104, 0.05000000074505806, 0.05000000074505806], [0.643750011920929, 0.48124998807907104, 0.02500000037252903, 0.02500000037252903], [0.643750011920929, 0.48124998807907104, 0.05000000074505806, 0.05000000074505806], [0.65625, 0.48124998807907104, 0.02500000037252903, 0.02500000037252903], [0.65625, 0.48124998807907104, 0.05000000074505806, 0.05000000074505806], [0.668749988079071, 0.48124998807907104, 0.02500000037252903, 0.02500000037252903], [0.668749988079071, 0.48124998807907104, 0.05000000074505806, 0.05000000074505806], [0.6812499761581421, 0.48124998807907104, 0.02500000037252903, 0.02500000037252903], [0.6812499761581421, 0.48124998807907104, 0.05000000074505806, 0.05000000074505806], [0.6937500238418579, 0.48124998807907104, 0.02500000037252903, 0.02500000037252903], [0.6937500238418579, 0.48124998807907104, 0.05000000074505806, 0.05000000074505806], [0.706250011920929, 0.48124998807907104, 0.02500000037252903, 0.02500000037252903], [0.706250011920929, 0.48124998807907104, 0.05000000074505806, 0.05000000074505806], [0.71875, 0.48124998807907104, 0.02500000037252903, 0.02500000037252903], [0.71875, 0.48124998807907104, 0.05000000074505806, 0.05000000074505806], [0.731249988079071, 0.48124998807907104, 0.02500000037252903, 0.02500000037252903], [0.731249988079071, 0.48124998807907104, 0.05000000074505806, 0.05000000074505806], [0.7437499761581421, 0.48124998807907104, 0.02500000037252903, 0.02500000037252903], [0.7437499761581421, 0.48124998807907104, 0.05000000074505806, 0.05000000074505806], [0.7562500238418579, 0.48124998807907104, 0.02500000037252903, 0.02500000037252903], [0.7562500238418579, 0.48124998807907104, 0.05000000074505806, 0.05000000074505806], [0.768750011920929, 0.48124998807907104, 0.02500000037252903, 0.02500000037252903], [0.768750011920929, 0.48124998807907104, 0.05000000074505806, 0.05000000074505806], [0.78125, 0.48124998807907104, 0.02500000037252903, 0.02500000037252903], [0.78125, 0.48124998807907104, 0.05000000074505806, 0.05000000074505806], [0.793749988079071, 0.48124998807907104, 0.02500000037252903, 0.02500000037252903], [0.793749988079071, 0.48124998807907104, 0.05000000074505806, 0.05000000074505806], [0.8062499761581421, 0.48124998807907104, 0.02500000037252903, 0.02500000037252903], [0.8062499761581421, 0.48124998807907104, 0.05000000074505806, 0.05000000074505806], [0.8187500238418579, 0.48124998807907104, 0.02500000037252903, 0.02500000037252903], [0.8187500238418579, 0.48124998807907104, 0.05000000074505806, 0.05000000074505806], [0.831250011920929, 0.48124998807907104, 0.02500000037252903, 0.02500000037252903], [0.831250011920929, 0.48124998807907104, 0.05000000074505806, 0.05000000074505806], [0.84375, 0.48124998807907104, 0.02500000037252903, 0.02500000037252903], [0.84375, 0.48124998807907104, 0.05000000074505806, 0.05000000074505806], [0.856249988079071, 0.48124998807907104, 0.02500000037252903, 0.02500000037252903], [0.856249988079071, 0.48124998807907104, 0.05000000074505806, 0.05000000074505806], [0.8687499761581421, 0.48124998807907104, 0.02500000037252903, 0.02500000037252903], [0.8687499761581421, 0.48124998807907104, 0.05000000074505806, 0.05000000074505806], [0.8812500238418579, 0.48124998807907104, 0.02500000037252903, 0.02500000037252903], [0.8812500238418579, 0.48124998807907104, 0.05000000074505806, 0.05000000074505806], [0.893750011920929, 0.48124998807907104, 0.02500000037252903, 0.02500000037252903], [0.893750011920929, 0.48124998807907104, 0.05000000074505806, 0.05000000074505806], [0.90625, 0.48124998807907104, 0.02500000037252903, 0.02500000037252903], [0.90625, 0.48124998807907104, 0.05000000074505806, 0.05000000074505806], [0.918749988079071, 0.48124998807907104, 0.02500000037252903, 0.02500000037252903], [0.918749988079071, 0.48124998807907104, 0.05000000074505806, 0.05000000074505806], [0.9312499761581421, 0.48124998807907104, 0.02500000037252903, 0.02500000037252903], [0.9312499761581421, 0.48124998807907104, 0.05000000074505806, 0.05000000074505806], [0.9437500238418579, 0.48124998807907104, 0.02500000037252903, 0.02500000037252903], [0.9437500238418579, 0.48124998807907104, 0.05000000074505806, 0.05000000074505806], [0.956250011920929, 0.48124998807907104, 0.02500000037252903, 0.02500000037252903], [0.956250011920929, 0.48124998807907104, 0.05000000074505806, 0.05000000074505806], [0.96875, 0.48124998807907104, 0.02500000037252903, 0.02500000037252903], [0.96875, 0.48124998807907104, 0.05000000074505806, 0.05000000074505806], [0.981249988079071, 0.48124998807907104, 0.02500000037252903, 0.02500000037252903], [0.981249988079071, 0.48124998807907104, 0.05000000074505806, 0.05000000074505806], [0.9937499761581421, 0.48124998807907104, 0.02500000037252903, 0.02500000037252903], [0.9937499761581421, 0.48124998807907104, 0.05000000074505806, 0.05000000074505806], [0.0062500000931322575, 0.4937500059604645, 0.02500000037252903, 0.02500000037252903], [0.0062500000931322575, 0.4937500059604645, 0.05000000074505806, 0.05000000074505806], [0.01875000074505806, 0.4937500059604645, 0.02500000037252903, 0.02500000037252903], [0.01875000074505806, 0.4937500059604645, 0.05000000074505806, 0.05000000074505806], [0.03125, 0.4937500059604645, 0.02500000037252903, 0.02500000037252903], [0.03125, 0.4937500059604645, 0.05000000074505806, 0.05000000074505806], [0.04374999925494194, 0.4937500059604645, 0.02500000037252903, 0.02500000037252903], [0.04374999925494194, 0.4937500059604645, 0.05000000074505806, 0.05000000074505806], [0.05624999850988388, 0.4937500059604645, 0.02500000037252903, 0.02500000037252903], [0.05624999850988388, 0.4937500059604645, 0.05000000074505806, 0.05000000074505806], [0.06875000149011612, 0.4937500059604645, 0.02500000037252903, 0.02500000037252903], [0.06875000149011612, 0.4937500059604645, 0.05000000074505806, 0.05000000074505806], [0.08124999701976776, 0.4937500059604645, 0.02500000037252903, 0.02500000037252903], [0.08124999701976776, 0.4937500059604645, 0.05000000074505806, 0.05000000074505806], [0.09375, 0.4937500059604645, 0.02500000037252903, 0.02500000037252903], [0.09375, 0.4937500059604645, 0.05000000074505806, 0.05000000074505806], [0.10625000298023224, 0.4937500059604645, 0.02500000037252903, 0.02500000037252903], [0.10625000298023224, 0.4937500059604645, 0.05000000074505806, 0.05000000074505806], [0.11874999850988388, 0.4937500059604645, 0.02500000037252903, 0.02500000037252903], [0.11874999850988388, 0.4937500059604645, 0.05000000074505806, 0.05000000074505806], [0.13124999403953552, 0.4937500059604645, 0.02500000037252903, 0.02500000037252903], [0.13124999403953552, 0.4937500059604645, 0.05000000074505806, 0.05000000074505806], [0.14374999701976776, 0.4937500059604645, 0.02500000037252903, 0.02500000037252903], [0.14374999701976776, 0.4937500059604645, 0.05000000074505806, 0.05000000074505806], [0.15625, 0.4937500059604645, 0.02500000037252903, 0.02500000037252903], [0.15625, 0.4937500059604645, 0.05000000074505806, 0.05000000074505806], [0.16875000298023224, 0.4937500059604645, 0.02500000037252903, 0.02500000037252903], [0.16875000298023224, 0.4937500059604645, 0.05000000074505806, 0.05000000074505806], [0.18125000596046448, 0.4937500059604645, 0.02500000037252903, 0.02500000037252903], [0.18125000596046448, 0.4937500059604645, 0.05000000074505806, 0.05000000074505806], [0.19374999403953552, 0.4937500059604645, 0.02500000037252903, 0.02500000037252903], [0.19374999403953552, 0.4937500059604645, 0.05000000074505806, 0.05000000074505806], [0.20624999701976776, 0.4937500059604645, 0.02500000037252903, 0.02500000037252903], [0.20624999701976776, 0.4937500059604645, 0.05000000074505806, 0.05000000074505806], [0.21875, 0.4937500059604645, 0.02500000037252903, 0.02500000037252903], [0.21875, 0.4937500059604645, 0.05000000074505806, 0.05000000074505806], [0.23125000298023224, 0.4937500059604645, 0.02500000037252903, 0.02500000037252903], [0.23125000298023224, 0.4937500059604645, 0.05000000074505806, 0.05000000074505806], [0.24375000596046448, 0.4937500059604645, 0.02500000037252903, 0.02500000037252903], [0.24375000596046448, 0.4937500059604645, 0.05000000074505806, 0.05000000074505806], [0.2562499940395355, 0.4937500059604645, 0.02500000037252903, 0.02500000037252903], [0.2562499940395355, 0.4937500059604645, 0.05000000074505806, 0.05000000074505806], [0.26875001192092896, 0.4937500059604645, 0.02500000037252903, 0.02500000037252903], [0.26875001192092896, 0.4937500059604645, 0.05000000074505806, 0.05000000074505806], [0.28125, 0.4937500059604645, 0.02500000037252903, 0.02500000037252903], [0.28125, 0.4937500059604645, 0.05000000074505806, 0.05000000074505806], [0.29374998807907104, 0.4937500059604645, 0.02500000037252903, 0.02500000037252903], [0.29374998807907104, 0.4937500059604645, 0.05000000074505806, 0.05000000074505806], [0.3062500059604645, 0.4937500059604645, 0.02500000037252903, 0.02500000037252903], [0.3062500059604645, 0.4937500059604645, 0.05000000074505806, 0.05000000074505806], [0.3187499940395355, 0.4937500059604645, 0.02500000037252903, 0.02500000037252903], [0.3187499940395355, 0.4937500059604645, 0.05000000074505806, 0.05000000074505806], [0.33125001192092896, 0.4937500059604645, 0.02500000037252903, 0.02500000037252903], [0.33125001192092896, 0.4937500059604645, 0.05000000074505806, 0.05000000074505806], [0.34375, 0.4937500059604645, 0.02500000037252903, 0.02500000037252903], [0.34375, 0.4937500059604645, 0.05000000074505806, 0.05000000074505806], [0.35624998807907104, 0.4937500059604645, 0.02500000037252903, 0.02500000037252903], [0.35624998807907104, 0.4937500059604645, 0.05000000074505806, 0.05000000074505806], [0.3687500059604645, 0.4937500059604645, 0.02500000037252903, 0.02500000037252903], [0.3687500059604645, 0.4937500059604645, 0.05000000074505806, 0.05000000074505806], [0.3812499940395355, 0.4937500059604645, 0.02500000037252903, 0.02500000037252903], [0.3812499940395355, 0.4937500059604645, 0.05000000074505806, 0.05000000074505806], [0.39375001192092896, 0.4937500059604645, 0.02500000037252903, 0.02500000037252903], [0.39375001192092896, 0.4937500059604645, 0.05000000074505806, 0.05000000074505806], [0.40625, 0.4937500059604645, 0.02500000037252903, 0.02500000037252903], [0.40625, 0.4937500059604645, 0.05000000074505806, 0.05000000074505806], [0.41874998807907104, 0.4937500059604645, 0.02500000037252903, 0.02500000037252903], [0.41874998807907104, 0.4937500059604645, 0.05000000074505806, 0.05000000074505806], [0.4312500059604645, 0.4937500059604645, 0.02500000037252903, 0.02500000037252903], [0.4312500059604645, 0.4937500059604645, 0.05000000074505806, 0.05000000074505806], [0.4437499940395355, 0.4937500059604645, 0.02500000037252903, 0.02500000037252903], [0.4437499940395355, 0.4937500059604645, 0.05000000074505806, 0.05000000074505806], [0.45625001192092896, 0.4937500059604645, 0.02500000037252903, 0.02500000037252903], [0.45625001192092896, 0.4937500059604645, 0.05000000074505806, 0.05000000074505806], [0.46875, 0.4937500059604645, 0.02500000037252903, 0.02500000037252903], [0.46875, 0.4937500059604645, 0.05000000074505806, 0.05000000074505806], [0.48124998807907104, 0.4937500059604645, 0.02500000037252903, 0.02500000037252903], [0.48124998807907104, 0.4937500059604645, 0.05000000074505806, 0.05000000074505806], [0.4937500059604645, 0.4937500059604645, 0.02500000037252903, 0.02500000037252903], [0.4937500059604645, 0.4937500059604645, 0.05000000074505806, 0.05000000074505806], [0.5062500238418579, 0.4937500059604645, 0.02500000037252903, 0.02500000037252903], [0.5062500238418579, 0.4937500059604645, 0.05000000074505806, 0.05000000074505806], [0.518750011920929, 0.4937500059604645, 0.02500000037252903, 0.02500000037252903], [0.518750011920929, 0.4937500059604645, 0.05000000074505806, 0.05000000074505806], [0.53125, 0.4937500059604645, 0.02500000037252903, 0.02500000037252903], [0.53125, 0.4937500059604645, 0.05000000074505806, 0.05000000074505806], [0.543749988079071, 0.4937500059604645, 0.02500000037252903, 0.02500000037252903], [0.543749988079071, 0.4937500059604645, 0.05000000074505806, 0.05000000074505806], [0.5562499761581421, 0.4937500059604645, 0.02500000037252903, 0.02500000037252903], [0.5562499761581421, 0.4937500059604645, 0.05000000074505806, 0.05000000074505806], [0.5687500238418579, 0.4937500059604645, 0.02500000037252903, 0.02500000037252903], [0.5687500238418579, 0.4937500059604645, 0.05000000074505806, 0.05000000074505806], [0.581250011920929, 0.4937500059604645, 0.02500000037252903, 0.02500000037252903], [0.581250011920929, 0.4937500059604645, 0.05000000074505806, 0.05000000074505806], [0.59375, 0.4937500059604645, 0.02500000037252903, 0.02500000037252903], [0.59375, 0.4937500059604645, 0.05000000074505806, 0.05000000074505806], [0.606249988079071, 0.4937500059604645, 0.02500000037252903, 0.02500000037252903], [0.606249988079071, 0.4937500059604645, 0.05000000074505806, 0.05000000074505806], [0.6187499761581421, 0.4937500059604645, 0.02500000037252903, 0.02500000037252903], [0.6187499761581421, 0.4937500059604645, 0.05000000074505806, 0.05000000074505806], [0.6312500238418579, 0.4937500059604645, 0.02500000037252903, 0.02500000037252903], [0.6312500238418579, 0.4937500059604645, 0.05000000074505806, 0.05000000074505806], [0.643750011920929, 0.4937500059604645, 0.02500000037252903, 0.02500000037252903], [0.643750011920929, 0.4937500059604645, 0.05000000074505806, 0.05000000074505806], [0.65625, 0.4937500059604645, 0.02500000037252903, 0.02500000037252903], [0.65625, 0.4937500059604645, 0.05000000074505806, 0.05000000074505806], [0.668749988079071, 0.4937500059604645, 0.02500000037252903, 0.02500000037252903], [0.668749988079071, 0.4937500059604645, 0.05000000074505806, 0.05000000074505806], [0.6812499761581421, 0.4937500059604645, 0.02500000037252903, 0.02500000037252903], [0.6812499761581421, 0.4937500059604645, 0.05000000074505806, 0.05000000074505806], [0.6937500238418579, 0.4937500059604645, 0.02500000037252903, 0.02500000037252903], [0.6937500238418579, 0.4937500059604645, 0.05000000074505806, 0.05000000074505806], [0.706250011920929, 0.4937500059604645, 0.02500000037252903, 0.02500000037252903], [0.706250011920929, 0.4937500059604645, 0.05000000074505806, 0.05000000074505806], [0.71875, 0.4937500059604645, 0.02500000037252903, 0.02500000037252903], [0.71875, 0.4937500059604645, 0.05000000074505806, 0.05000000074505806], [0.731249988079071, 0.4937500059604645, 0.02500000037252903, 0.02500000037252903], [0.731249988079071, 0.4937500059604645, 0.05000000074505806, 0.05000000074505806], [0.7437499761581421, 0.4937500059604645, 0.02500000037252903, 0.02500000037252903], [0.7437499761581421, 0.4937500059604645, 0.05000000074505806, 0.05000000074505806], [0.7562500238418579, 0.4937500059604645, 0.02500000037252903, 0.02500000037252903], [0.7562500238418579, 0.4937500059604645, 0.05000000074505806, 0.05000000074505806], [0.768750011920929, 0.4937500059604645, 0.02500000037252903, 0.02500000037252903], [0.768750011920929, 0.4937500059604645, 0.05000000074505806, 0.05000000074505806], [0.78125, 0.4937500059604645, 0.02500000037252903, 0.02500000037252903], [0.78125, 0.4937500059604645, 0.05000000074505806, 0.05000000074505806], [0.793749988079071, 0.4937500059604645, 0.02500000037252903, 0.02500000037252903], [0.793749988079071, 0.4937500059604645, 0.05000000074505806, 0.05000000074505806], [0.8062499761581421, 0.4937500059604645, 0.02500000037252903, 0.02500000037252903], [0.8062499761581421, 0.4937500059604645, 0.05000000074505806, 0.05000000074505806], [0.8187500238418579, 0.4937500059604645, 0.02500000037252903, 0.02500000037252903], [0.8187500238418579, 0.4937500059604645, 0.05000000074505806, 0.05000000074505806], [0.831250011920929, 0.4937500059604645, 0.02500000037252903, 0.02500000037252903], [0.831250011920929, 0.4937500059604645, 0.05000000074505806, 0.05000000074505806], [0.84375, 0.4937500059604645, 0.02500000037252903, 0.02500000037252903], [0.84375, 0.4937500059604645, 0.05000000074505806, 0.05000000074505806], [0.856249988079071, 0.4937500059604645, 0.02500000037252903, 0.02500000037252903], [0.856249988079071, 0.4937500059604645, 0.05000000074505806, 0.05000000074505806], [0.8687499761581421, 0.4937500059604645, 0.02500000037252903, 0.02500000037252903], [0.8687499761581421, 0.4937500059604645, 0.05000000074505806, 0.05000000074505806], [0.8812500238418579, 0.4937500059604645, 0.02500000037252903, 0.02500000037252903], [0.8812500238418579, 0.4937500059604645, 0.05000000074505806, 0.05000000074505806], [0.893750011920929, 0.4937500059604645, 0.02500000037252903, 0.02500000037252903], [0.893750011920929, 0.4937500059604645, 0.05000000074505806, 0.05000000074505806], [0.90625, 0.4937500059604645, 0.02500000037252903, 0.02500000037252903], [0.90625, 0.4937500059604645, 0.05000000074505806, 0.05000000074505806], [0.918749988079071, 0.4937500059604645, 0.02500000037252903, 0.02500000037252903], [0.918749988079071, 0.4937500059604645, 0.05000000074505806, 0.05000000074505806], [0.9312499761581421, 0.4937500059604645, 0.02500000037252903, 0.02500000037252903], [0.9312499761581421, 0.4937500059604645, 0.05000000074505806, 0.05000000074505806], [0.9437500238418579, 0.4937500059604645, 0.02500000037252903, 0.02500000037252903], [0.9437500238418579, 0.4937500059604645, 0.05000000074505806, 0.05000000074505806], [0.956250011920929, 0.4937500059604645, 0.02500000037252903, 0.02500000037252903], [0.956250011920929, 0.4937500059604645, 0.05000000074505806, 0.05000000074505806], [0.96875, 0.4937500059604645, 0.02500000037252903, 0.02500000037252903], [0.96875, 0.4937500059604645, 0.05000000074505806, 0.05000000074505806], [0.981249988079071, 0.4937500059604645, 0.02500000037252903, 0.02500000037252903], [0.981249988079071, 0.4937500059604645, 0.05000000074505806, 0.05000000074505806], [0.9937499761581421, 0.4937500059604645, 0.02500000037252903, 0.02500000037252903], [0.9937499761581421, 0.4937500059604645, 0.05000000074505806, 0.05000000074505806], [0.0062500000931322575, 0.5062500238418579, 0.02500000037252903, 0.02500000037252903], [0.0062500000931322575, 0.5062500238418579, 0.05000000074505806, 0.05000000074505806], [0.01875000074505806, 0.5062500238418579, 0.02500000037252903, 0.02500000037252903], [0.01875000074505806, 0.5062500238418579, 0.05000000074505806, 0.05000000074505806], [0.03125, 0.5062500238418579, 0.02500000037252903, 0.02500000037252903], [0.03125, 0.5062500238418579, 0.05000000074505806, 0.05000000074505806], [0.04374999925494194, 0.5062500238418579, 0.02500000037252903, 0.02500000037252903], [0.04374999925494194, 0.5062500238418579, 0.05000000074505806, 0.05000000074505806], [0.05624999850988388, 0.5062500238418579, 0.02500000037252903, 0.02500000037252903], [0.05624999850988388, 0.5062500238418579, 0.05000000074505806, 0.05000000074505806], [0.06875000149011612, 0.5062500238418579, 0.02500000037252903, 0.02500000037252903], [0.06875000149011612, 0.5062500238418579, 0.05000000074505806, 0.05000000074505806], [0.08124999701976776, 0.5062500238418579, 0.02500000037252903, 0.02500000037252903], [0.08124999701976776, 0.5062500238418579, 0.05000000074505806, 0.05000000074505806], [0.09375, 0.5062500238418579, 0.02500000037252903, 0.02500000037252903], [0.09375, 0.5062500238418579, 0.05000000074505806, 0.05000000074505806], [0.10625000298023224, 0.5062500238418579, 0.02500000037252903, 0.02500000037252903], [0.10625000298023224, 0.5062500238418579, 0.05000000074505806, 0.05000000074505806], [0.11874999850988388, 0.5062500238418579, 0.02500000037252903, 0.02500000037252903], [0.11874999850988388, 0.5062500238418579, 0.05000000074505806, 0.05000000074505806], [0.13124999403953552, 0.5062500238418579, 0.02500000037252903, 0.02500000037252903], [0.13124999403953552, 0.5062500238418579, 0.05000000074505806, 0.05000000074505806], [0.14374999701976776, 0.5062500238418579, 0.02500000037252903, 0.02500000037252903], [0.14374999701976776, 0.5062500238418579, 0.05000000074505806, 0.05000000074505806], [0.15625, 0.5062500238418579, 0.02500000037252903, 0.02500000037252903], [0.15625, 0.5062500238418579, 0.05000000074505806, 0.05000000074505806], [0.16875000298023224, 0.5062500238418579, 0.02500000037252903, 0.02500000037252903], [0.16875000298023224, 0.5062500238418579, 0.05000000074505806, 0.05000000074505806], [0.18125000596046448, 0.5062500238418579, 0.02500000037252903, 0.02500000037252903], [0.18125000596046448, 0.5062500238418579, 0.05000000074505806, 0.05000000074505806], [0.19374999403953552, 0.5062500238418579, 0.02500000037252903, 0.02500000037252903], [0.19374999403953552, 0.5062500238418579, 0.05000000074505806, 0.05000000074505806], [0.20624999701976776, 0.5062500238418579, 0.02500000037252903, 0.02500000037252903], [0.20624999701976776, 0.5062500238418579, 0.05000000074505806, 0.05000000074505806], [0.21875, 0.5062500238418579, 0.02500000037252903, 0.02500000037252903], [0.21875, 0.5062500238418579, 0.05000000074505806, 0.05000000074505806], [0.23125000298023224, 0.5062500238418579, 0.02500000037252903, 0.02500000037252903], [0.23125000298023224, 0.5062500238418579, 0.05000000074505806, 0.05000000074505806], [0.24375000596046448, 0.5062500238418579, 0.02500000037252903, 0.02500000037252903], [0.24375000596046448, 0.5062500238418579, 0.05000000074505806, 0.05000000074505806], [0.2562499940395355, 0.5062500238418579, 0.02500000037252903, 0.02500000037252903], [0.2562499940395355, 0.5062500238418579, 0.05000000074505806, 0.05000000074505806], [0.26875001192092896, 0.5062500238418579, 0.02500000037252903, 0.02500000037252903], [0.26875001192092896, 0.5062500238418579, 0.05000000074505806, 0.05000000074505806], [0.28125, 0.5062500238418579, 0.02500000037252903, 0.02500000037252903], [0.28125, 0.5062500238418579, 0.05000000074505806, 0.05000000074505806], [0.29374998807907104, 0.5062500238418579, 0.02500000037252903, 0.02500000037252903], [0.29374998807907104, 0.5062500238418579, 0.05000000074505806, 0.05000000074505806], [0.3062500059604645, 0.5062500238418579, 0.02500000037252903, 0.02500000037252903], [0.3062500059604645, 0.5062500238418579, 0.05000000074505806, 0.05000000074505806], [0.3187499940395355, 0.5062500238418579, 0.02500000037252903, 0.02500000037252903], [0.3187499940395355, 0.5062500238418579, 0.05000000074505806, 0.05000000074505806], [0.33125001192092896, 0.5062500238418579, 0.02500000037252903, 0.02500000037252903], [0.33125001192092896, 0.5062500238418579, 0.05000000074505806, 0.05000000074505806], [0.34375, 0.5062500238418579, 0.02500000037252903, 0.02500000037252903], [0.34375, 0.5062500238418579, 0.05000000074505806, 0.05000000074505806], [0.35624998807907104, 0.5062500238418579, 0.02500000037252903, 0.02500000037252903], [0.35624998807907104, 0.5062500238418579, 0.05000000074505806, 0.05000000074505806], [0.3687500059604645, 0.5062500238418579, 0.02500000037252903, 0.02500000037252903], [0.3687500059604645, 0.5062500238418579, 0.05000000074505806, 0.05000000074505806], [0.3812499940395355, 0.5062500238418579, 0.02500000037252903, 0.02500000037252903], [0.3812499940395355, 0.5062500238418579, 0.05000000074505806, 0.05000000074505806], [0.39375001192092896, 0.5062500238418579, 0.02500000037252903, 0.02500000037252903], [0.39375001192092896, 0.5062500238418579, 0.05000000074505806, 0.05000000074505806], [0.40625, 0.5062500238418579, 0.02500000037252903, 0.02500000037252903], [0.40625, 0.5062500238418579, 0.05000000074505806, 0.05000000074505806], [0.41874998807907104, 0.5062500238418579, 0.02500000037252903, 0.02500000037252903], [0.41874998807907104, 0.5062500238418579, 0.05000000074505806, 0.05000000074505806], [0.4312500059604645, 0.5062500238418579, 0.02500000037252903, 0.02500000037252903], [0.4312500059604645, 0.5062500238418579, 0.05000000074505806, 0.05000000074505806], [0.4437499940395355, 0.5062500238418579, 0.02500000037252903, 0.02500000037252903], [0.4437499940395355, 0.5062500238418579, 0.05000000074505806, 0.05000000074505806], [0.45625001192092896, 0.5062500238418579, 0.02500000037252903, 0.02500000037252903], [0.45625001192092896, 0.5062500238418579, 0.05000000074505806, 0.05000000074505806], [0.46875, 0.5062500238418579, 0.02500000037252903, 0.02500000037252903], [0.46875, 0.5062500238418579, 0.05000000074505806, 0.05000000074505806], [0.48124998807907104, 0.5062500238418579, 0.02500000037252903, 0.02500000037252903], [0.48124998807907104, 0.5062500238418579, 0.05000000074505806, 0.05000000074505806], [0.4937500059604645, 0.5062500238418579, 0.02500000037252903, 0.02500000037252903], [0.4937500059604645, 0.5062500238418579, 0.05000000074505806, 0.05000000074505806], [0.5062500238418579, 0.5062500238418579, 0.02500000037252903, 0.02500000037252903], [0.5062500238418579, 0.5062500238418579, 0.05000000074505806, 0.05000000074505806], [0.518750011920929, 0.5062500238418579, 0.02500000037252903, 0.02500000037252903], [0.518750011920929, 0.5062500238418579, 0.05000000074505806, 0.05000000074505806], [0.53125, 0.5062500238418579, 0.02500000037252903, 0.02500000037252903], [0.53125, 0.5062500238418579, 0.05000000074505806, 0.05000000074505806], [0.543749988079071, 0.5062500238418579, 0.02500000037252903, 0.02500000037252903], [0.543749988079071, 0.5062500238418579, 0.05000000074505806, 0.05000000074505806], [0.5562499761581421, 0.5062500238418579, 0.02500000037252903, 0.02500000037252903], [0.5562499761581421, 0.5062500238418579, 0.05000000074505806, 0.05000000074505806], [0.5687500238418579, 0.5062500238418579, 0.02500000037252903, 0.02500000037252903], [0.5687500238418579, 0.5062500238418579, 0.05000000074505806, 0.05000000074505806], [0.581250011920929, 0.5062500238418579, 0.02500000037252903, 0.02500000037252903], [0.581250011920929, 0.5062500238418579, 0.05000000074505806, 0.05000000074505806], [0.59375, 0.5062500238418579, 0.02500000037252903, 0.02500000037252903], [0.59375, 0.5062500238418579, 0.05000000074505806, 0.05000000074505806], [0.606249988079071, 0.5062500238418579, 0.02500000037252903, 0.02500000037252903], [0.606249988079071, 0.5062500238418579, 0.05000000074505806, 0.05000000074505806], [0.6187499761581421, 0.5062500238418579, 0.02500000037252903, 0.02500000037252903], [0.6187499761581421, 0.5062500238418579, 0.05000000074505806, 0.05000000074505806], [0.6312500238418579, 0.5062500238418579, 0.02500000037252903, 0.02500000037252903], [0.6312500238418579, 0.5062500238418579, 0.05000000074505806, 0.05000000074505806], [0.643750011920929, 0.5062500238418579, 0.02500000037252903, 0.02500000037252903], [0.643750011920929, 0.5062500238418579, 0.05000000074505806, 0.05000000074505806], [0.65625, 0.5062500238418579, 0.02500000037252903, 0.02500000037252903], [0.65625, 0.5062500238418579, 0.05000000074505806, 0.05000000074505806], [0.668749988079071, 0.5062500238418579, 0.02500000037252903, 0.02500000037252903], [0.668749988079071, 0.5062500238418579, 0.05000000074505806, 0.05000000074505806], [0.6812499761581421, 0.5062500238418579, 0.02500000037252903, 0.02500000037252903], [0.6812499761581421, 0.5062500238418579, 0.05000000074505806, 0.05000000074505806], [0.6937500238418579, 0.5062500238418579, 0.02500000037252903, 0.02500000037252903], [0.6937500238418579, 0.5062500238418579, 0.05000000074505806, 0.05000000074505806], [0.706250011920929, 0.5062500238418579, 0.02500000037252903, 0.02500000037252903], [0.706250011920929, 0.5062500238418579, 0.05000000074505806, 0.05000000074505806], [0.71875, 0.5062500238418579, 0.02500000037252903, 0.02500000037252903], [0.71875, 0.5062500238418579, 0.05000000074505806, 0.05000000074505806], [0.731249988079071, 0.5062500238418579, 0.02500000037252903, 0.02500000037252903], [0.731249988079071, 0.5062500238418579, 0.05000000074505806, 0.05000000074505806], [0.7437499761581421, 0.5062500238418579, 0.02500000037252903, 0.02500000037252903], [0.7437499761581421, 0.5062500238418579, 0.05000000074505806, 0.05000000074505806], [0.7562500238418579, 0.5062500238418579, 0.02500000037252903, 0.02500000037252903], [0.7562500238418579, 0.5062500238418579, 0.05000000074505806, 0.05000000074505806], [0.768750011920929, 0.5062500238418579, 0.02500000037252903, 0.02500000037252903], [0.768750011920929, 0.5062500238418579, 0.05000000074505806, 0.05000000074505806], [0.78125, 0.5062500238418579, 0.02500000037252903, 0.02500000037252903], [0.78125, 0.5062500238418579, 0.05000000074505806, 0.05000000074505806], [0.793749988079071, 0.5062500238418579, 0.02500000037252903, 0.02500000037252903], [0.793749988079071, 0.5062500238418579, 0.05000000074505806, 0.05000000074505806], [0.8062499761581421, 0.5062500238418579, 0.02500000037252903, 0.02500000037252903], [0.8062499761581421, 0.5062500238418579, 0.05000000074505806, 0.05000000074505806], [0.8187500238418579, 0.5062500238418579, 0.02500000037252903, 0.02500000037252903], [0.8187500238418579, 0.5062500238418579, 0.05000000074505806, 0.05000000074505806], [0.831250011920929, 0.5062500238418579, 0.02500000037252903, 0.02500000037252903], [0.831250011920929, 0.5062500238418579, 0.05000000074505806, 0.05000000074505806], [0.84375, 0.5062500238418579, 0.02500000037252903, 0.02500000037252903], [0.84375, 0.5062500238418579, 0.05000000074505806, 0.05000000074505806], [0.856249988079071, 0.5062500238418579, 0.02500000037252903, 0.02500000037252903], [0.856249988079071, 0.5062500238418579, 0.05000000074505806, 0.05000000074505806], [0.8687499761581421, 0.5062500238418579, 0.02500000037252903, 0.02500000037252903], [0.8687499761581421, 0.5062500238418579, 0.05000000074505806, 0.05000000074505806], [0.8812500238418579, 0.5062500238418579, 0.02500000037252903, 0.02500000037252903], [0.8812500238418579, 0.5062500238418579, 0.05000000074505806, 0.05000000074505806], [0.893750011920929, 0.5062500238418579, 0.02500000037252903, 0.02500000037252903], [0.893750011920929, 0.5062500238418579, 0.05000000074505806, 0.05000000074505806], [0.90625, 0.5062500238418579, 0.02500000037252903, 0.02500000037252903], [0.90625, 0.5062500238418579, 0.05000000074505806, 0.05000000074505806], [0.918749988079071, 0.5062500238418579, 0.02500000037252903, 0.02500000037252903], [0.918749988079071, 0.5062500238418579, 0.05000000074505806, 0.05000000074505806], [0.9312499761581421, 0.5062500238418579, 0.02500000037252903, 0.02500000037252903], [0.9312499761581421, 0.5062500238418579, 0.05000000074505806, 0.05000000074505806], [0.9437500238418579, 0.5062500238418579, 0.02500000037252903, 0.02500000037252903], [0.9437500238418579, 0.5062500238418579, 0.05000000074505806, 0.05000000074505806], [0.956250011920929, 0.5062500238418579, 0.02500000037252903, 0.02500000037252903], [0.956250011920929, 0.5062500238418579, 0.05000000074505806, 0.05000000074505806], [0.96875, 0.5062500238418579, 0.02500000037252903, 0.02500000037252903], [0.96875, 0.5062500238418579, 0.05000000074505806, 0.05000000074505806], [0.981249988079071, 0.5062500238418579, 0.02500000037252903, 0.02500000037252903], [0.981249988079071, 0.5062500238418579, 0.05000000074505806, 0.05000000074505806], [0.9937499761581421, 0.5062500238418579, 0.02500000037252903, 0.02500000037252903], [0.9937499761581421, 0.5062500238418579, 0.05000000074505806, 0.05000000074505806], [0.0062500000931322575, 0.518750011920929, 0.02500000037252903, 0.02500000037252903], [0.0062500000931322575, 0.518750011920929, 0.05000000074505806, 0.05000000074505806], [0.01875000074505806, 0.518750011920929, 0.02500000037252903, 0.02500000037252903], [0.01875000074505806, 0.518750011920929, 0.05000000074505806, 0.05000000074505806], [0.03125, 0.518750011920929, 0.02500000037252903, 0.02500000037252903], [0.03125, 0.518750011920929, 0.05000000074505806, 0.05000000074505806], [0.04374999925494194, 0.518750011920929, 0.02500000037252903, 0.02500000037252903], [0.04374999925494194, 0.518750011920929, 0.05000000074505806, 0.05000000074505806], [0.05624999850988388, 0.518750011920929, 0.02500000037252903, 0.02500000037252903], [0.05624999850988388, 0.518750011920929, 0.05000000074505806, 0.05000000074505806], [0.06875000149011612, 0.518750011920929, 0.02500000037252903, 0.02500000037252903], [0.06875000149011612, 0.518750011920929, 0.05000000074505806, 0.05000000074505806], [0.08124999701976776, 0.518750011920929, 0.02500000037252903, 0.02500000037252903], [0.08124999701976776, 0.518750011920929, 0.05000000074505806, 0.05000000074505806], [0.09375, 0.518750011920929, 0.02500000037252903, 0.02500000037252903], [0.09375, 0.518750011920929, 0.05000000074505806, 0.05000000074505806], [0.10625000298023224, 0.518750011920929, 0.02500000037252903, 0.02500000037252903], [0.10625000298023224, 0.518750011920929, 0.05000000074505806, 0.05000000074505806], [0.11874999850988388, 0.518750011920929, 0.02500000037252903, 0.02500000037252903], [0.11874999850988388, 0.518750011920929, 0.05000000074505806, 0.05000000074505806], [0.13124999403953552, 0.518750011920929, 0.02500000037252903, 0.02500000037252903], [0.13124999403953552, 0.518750011920929, 0.05000000074505806, 0.05000000074505806], [0.14374999701976776, 0.518750011920929, 0.02500000037252903, 0.02500000037252903], [0.14374999701976776, 0.518750011920929, 0.05000000074505806, 0.05000000074505806], [0.15625, 0.518750011920929, 0.02500000037252903, 0.02500000037252903], [0.15625, 0.518750011920929, 0.05000000074505806, 0.05000000074505806], [0.16875000298023224, 0.518750011920929, 0.02500000037252903, 0.02500000037252903], [0.16875000298023224, 0.518750011920929, 0.05000000074505806, 0.05000000074505806], [0.18125000596046448, 0.518750011920929, 0.02500000037252903, 0.02500000037252903], [0.18125000596046448, 0.518750011920929, 0.05000000074505806, 0.05000000074505806], [0.19374999403953552, 0.518750011920929, 0.02500000037252903, 0.02500000037252903], [0.19374999403953552, 0.518750011920929, 0.05000000074505806, 0.05000000074505806], [0.20624999701976776, 0.518750011920929, 0.02500000037252903, 0.02500000037252903], [0.20624999701976776, 0.518750011920929, 0.05000000074505806, 0.05000000074505806], [0.21875, 0.518750011920929, 0.02500000037252903, 0.02500000037252903], [0.21875, 0.518750011920929, 0.05000000074505806, 0.05000000074505806], [0.23125000298023224, 0.518750011920929, 0.02500000037252903, 0.02500000037252903], [0.23125000298023224, 0.518750011920929, 0.05000000074505806, 0.05000000074505806], [0.24375000596046448, 0.518750011920929, 0.02500000037252903, 0.02500000037252903], [0.24375000596046448, 0.518750011920929, 0.05000000074505806, 0.05000000074505806], [0.2562499940395355, 0.518750011920929, 0.02500000037252903, 0.02500000037252903], [0.2562499940395355, 0.518750011920929, 0.05000000074505806, 0.05000000074505806], [0.26875001192092896, 0.518750011920929, 0.02500000037252903, 0.02500000037252903], [0.26875001192092896, 0.518750011920929, 0.05000000074505806, 0.05000000074505806], [0.28125, 0.518750011920929, 0.02500000037252903, 0.02500000037252903], [0.28125, 0.518750011920929, 0.05000000074505806, 0.05000000074505806], [0.29374998807907104, 0.518750011920929, 0.02500000037252903, 0.02500000037252903], [0.29374998807907104, 0.518750011920929, 0.05000000074505806, 0.05000000074505806], [0.3062500059604645, 0.518750011920929, 0.02500000037252903, 0.02500000037252903], [0.3062500059604645, 0.518750011920929, 0.05000000074505806, 0.05000000074505806], [0.3187499940395355, 0.518750011920929, 0.02500000037252903, 0.02500000037252903], [0.3187499940395355, 0.518750011920929, 0.05000000074505806, 0.05000000074505806], [0.33125001192092896, 0.518750011920929, 0.02500000037252903, 0.02500000037252903], [0.33125001192092896, 0.518750011920929, 0.05000000074505806, 0.05000000074505806], [0.34375, 0.518750011920929, 0.02500000037252903, 0.02500000037252903], [0.34375, 0.518750011920929, 0.05000000074505806, 0.05000000074505806], [0.35624998807907104, 0.518750011920929, 0.02500000037252903, 0.02500000037252903], [0.35624998807907104, 0.518750011920929, 0.05000000074505806, 0.05000000074505806], [0.3687500059604645, 0.518750011920929, 0.02500000037252903, 0.02500000037252903], [0.3687500059604645, 0.518750011920929, 0.05000000074505806, 0.05000000074505806], [0.3812499940395355, 0.518750011920929, 0.02500000037252903, 0.02500000037252903], [0.3812499940395355, 0.518750011920929, 0.05000000074505806, 0.05000000074505806], [0.39375001192092896, 0.518750011920929, 0.02500000037252903, 0.02500000037252903], [0.39375001192092896, 0.518750011920929, 0.05000000074505806, 0.05000000074505806], [0.40625, 0.518750011920929, 0.02500000037252903, 0.02500000037252903], [0.40625, 0.518750011920929, 0.05000000074505806, 0.05000000074505806], [0.41874998807907104, 0.518750011920929, 0.02500000037252903, 0.02500000037252903], [0.41874998807907104, 0.518750011920929, 0.05000000074505806, 0.05000000074505806], [0.4312500059604645, 0.518750011920929, 0.02500000037252903, 0.02500000037252903], [0.4312500059604645, 0.518750011920929, 0.05000000074505806, 0.05000000074505806], [0.4437499940395355, 0.518750011920929, 0.02500000037252903, 0.02500000037252903], [0.4437499940395355, 0.518750011920929, 0.05000000074505806, 0.05000000074505806], [0.45625001192092896, 0.518750011920929, 0.02500000037252903, 0.02500000037252903], [0.45625001192092896, 0.518750011920929, 0.05000000074505806, 0.05000000074505806], [0.46875, 0.518750011920929, 0.02500000037252903, 0.02500000037252903], [0.46875, 0.518750011920929, 0.05000000074505806, 0.05000000074505806], [0.48124998807907104, 0.518750011920929, 0.02500000037252903, 0.02500000037252903], [0.48124998807907104, 0.518750011920929, 0.05000000074505806, 0.05000000074505806], [0.4937500059604645, 0.518750011920929, 0.02500000037252903, 0.02500000037252903], [0.4937500059604645, 0.518750011920929, 0.05000000074505806, 0.05000000074505806], [0.5062500238418579, 0.518750011920929, 0.02500000037252903, 0.02500000037252903], [0.5062500238418579, 0.518750011920929, 0.05000000074505806, 0.05000000074505806], [0.518750011920929, 0.518750011920929, 0.02500000037252903, 0.02500000037252903], [0.518750011920929, 0.518750011920929, 0.05000000074505806, 0.05000000074505806], [0.53125, 0.518750011920929, 0.02500000037252903, 0.02500000037252903], [0.53125, 0.518750011920929, 0.05000000074505806, 0.05000000074505806], [0.543749988079071, 0.518750011920929, 0.02500000037252903, 0.02500000037252903], [0.543749988079071, 0.518750011920929, 0.05000000074505806, 0.05000000074505806], [0.5562499761581421, 0.518750011920929, 0.02500000037252903, 0.02500000037252903], [0.5562499761581421, 0.518750011920929, 0.05000000074505806, 0.05000000074505806], [0.5687500238418579, 0.518750011920929, 0.02500000037252903, 0.02500000037252903], [0.5687500238418579, 0.518750011920929, 0.05000000074505806, 0.05000000074505806], [0.581250011920929, 0.518750011920929, 0.02500000037252903, 0.02500000037252903], [0.581250011920929, 0.518750011920929, 0.05000000074505806, 0.05000000074505806], [0.59375, 0.518750011920929, 0.02500000037252903, 0.02500000037252903], [0.59375, 0.518750011920929, 0.05000000074505806, 0.05000000074505806], [0.606249988079071, 0.518750011920929, 0.02500000037252903, 0.02500000037252903], [0.606249988079071, 0.518750011920929, 0.05000000074505806, 0.05000000074505806], [0.6187499761581421, 0.518750011920929, 0.02500000037252903, 0.02500000037252903], [0.6187499761581421, 0.518750011920929, 0.05000000074505806, 0.05000000074505806], [0.6312500238418579, 0.518750011920929, 0.02500000037252903, 0.02500000037252903], [0.6312500238418579, 0.518750011920929, 0.05000000074505806, 0.05000000074505806], [0.643750011920929, 0.518750011920929, 0.02500000037252903, 0.02500000037252903], [0.643750011920929, 0.518750011920929, 0.05000000074505806, 0.05000000074505806], [0.65625, 0.518750011920929, 0.02500000037252903, 0.02500000037252903], [0.65625, 0.518750011920929, 0.05000000074505806, 0.05000000074505806], [0.668749988079071, 0.518750011920929, 0.02500000037252903, 0.02500000037252903], [0.668749988079071, 0.518750011920929, 0.05000000074505806, 0.05000000074505806], [0.6812499761581421, 0.518750011920929, 0.02500000037252903, 0.02500000037252903], [0.6812499761581421, 0.518750011920929, 0.05000000074505806, 0.05000000074505806], [0.6937500238418579, 0.518750011920929, 0.02500000037252903, 0.02500000037252903], [0.6937500238418579, 0.518750011920929, 0.05000000074505806, 0.05000000074505806], [0.706250011920929, 0.518750011920929, 0.02500000037252903, 0.02500000037252903], [0.706250011920929, 0.518750011920929, 0.05000000074505806, 0.05000000074505806], [0.71875, 0.518750011920929, 0.02500000037252903, 0.02500000037252903], [0.71875, 0.518750011920929, 0.05000000074505806, 0.05000000074505806], [0.731249988079071, 0.518750011920929, 0.02500000037252903, 0.02500000037252903], [0.731249988079071, 0.518750011920929, 0.05000000074505806, 0.05000000074505806], [0.7437499761581421, 0.518750011920929, 0.02500000037252903, 0.02500000037252903], [0.7437499761581421, 0.518750011920929, 0.05000000074505806, 0.05000000074505806], [0.7562500238418579, 0.518750011920929, 0.02500000037252903, 0.02500000037252903], [0.7562500238418579, 0.518750011920929, 0.05000000074505806, 0.05000000074505806], [0.768750011920929, 0.518750011920929, 0.02500000037252903, 0.02500000037252903], [0.768750011920929, 0.518750011920929, 0.05000000074505806, 0.05000000074505806], [0.78125, 0.518750011920929, 0.02500000037252903, 0.02500000037252903], [0.78125, 0.518750011920929, 0.05000000074505806, 0.05000000074505806], [0.793749988079071, 0.518750011920929, 0.02500000037252903, 0.02500000037252903], [0.793749988079071, 0.518750011920929, 0.05000000074505806, 0.05000000074505806], [0.8062499761581421, 0.518750011920929, 0.02500000037252903, 0.02500000037252903], [0.8062499761581421, 0.518750011920929, 0.05000000074505806, 0.05000000074505806], [0.8187500238418579, 0.518750011920929, 0.02500000037252903, 0.02500000037252903], [0.8187500238418579, 0.518750011920929, 0.05000000074505806, 0.05000000074505806], [0.831250011920929, 0.518750011920929, 0.02500000037252903, 0.02500000037252903], [0.831250011920929, 0.518750011920929, 0.05000000074505806, 0.05000000074505806], [0.84375, 0.518750011920929, 0.02500000037252903, 0.02500000037252903], [0.84375, 0.518750011920929, 0.05000000074505806, 0.05000000074505806], [0.856249988079071, 0.518750011920929, 0.02500000037252903, 0.02500000037252903], [0.856249988079071, 0.518750011920929, 0.05000000074505806, 0.05000000074505806], [0.8687499761581421, 0.518750011920929, 0.02500000037252903, 0.02500000037252903], [0.8687499761581421, 0.518750011920929, 0.05000000074505806, 0.05000000074505806], [0.8812500238418579, 0.518750011920929, 0.02500000037252903, 0.02500000037252903], [0.8812500238418579, 0.518750011920929, 0.05000000074505806, 0.05000000074505806], [0.893750011920929, 0.518750011920929, 0.02500000037252903, 0.02500000037252903], [0.893750011920929, 0.518750011920929, 0.05000000074505806, 0.05000000074505806], [0.90625, 0.518750011920929, 0.02500000037252903, 0.02500000037252903], [0.90625, 0.518750011920929, 0.05000000074505806, 0.05000000074505806], [0.918749988079071, 0.518750011920929, 0.02500000037252903, 0.02500000037252903], [0.918749988079071, 0.518750011920929, 0.05000000074505806, 0.05000000074505806], [0.9312499761581421, 0.518750011920929, 0.02500000037252903, 0.02500000037252903], [0.9312499761581421, 0.518750011920929, 0.05000000074505806, 0.05000000074505806], [0.9437500238418579, 0.518750011920929, 0.02500000037252903, 0.02500000037252903], [0.9437500238418579, 0.518750011920929, 0.05000000074505806, 0.05000000074505806], [0.956250011920929, 0.518750011920929, 0.02500000037252903, 0.02500000037252903], [0.956250011920929, 0.518750011920929, 0.05000000074505806, 0.05000000074505806], [0.96875, 0.518750011920929, 0.02500000037252903, 0.02500000037252903], [0.96875, 0.518750011920929, 0.05000000074505806, 0.05000000074505806], [0.981249988079071, 0.518750011920929, 0.02500000037252903, 0.02500000037252903], [0.981249988079071, 0.518750011920929, 0.05000000074505806, 0.05000000074505806], [0.9937499761581421, 0.518750011920929, 0.02500000037252903, 0.02500000037252903], [0.9937499761581421, 0.518750011920929, 0.05000000074505806, 0.05000000074505806], [0.0062500000931322575, 0.53125, 0.02500000037252903, 0.02500000037252903], [0.0062500000931322575, 0.53125, 0.05000000074505806, 0.05000000074505806], [0.01875000074505806, 0.53125, 0.02500000037252903, 0.02500000037252903], [0.01875000074505806, 0.53125, 0.05000000074505806, 0.05000000074505806], [0.03125, 0.53125, 0.02500000037252903, 0.02500000037252903], [0.03125, 0.53125, 0.05000000074505806, 0.05000000074505806], [0.04374999925494194, 0.53125, 0.02500000037252903, 0.02500000037252903], [0.04374999925494194, 0.53125, 0.05000000074505806, 0.05000000074505806], [0.05624999850988388, 0.53125, 0.02500000037252903, 0.02500000037252903], [0.05624999850988388, 0.53125, 0.05000000074505806, 0.05000000074505806], [0.06875000149011612, 0.53125, 0.02500000037252903, 0.02500000037252903], [0.06875000149011612, 0.53125, 0.05000000074505806, 0.05000000074505806], [0.08124999701976776, 0.53125, 0.02500000037252903, 0.02500000037252903], [0.08124999701976776, 0.53125, 0.05000000074505806, 0.05000000074505806], [0.09375, 0.53125, 0.02500000037252903, 0.02500000037252903], [0.09375, 0.53125, 0.05000000074505806, 0.05000000074505806], [0.10625000298023224, 0.53125, 0.02500000037252903, 0.02500000037252903], [0.10625000298023224, 0.53125, 0.05000000074505806, 0.05000000074505806], [0.11874999850988388, 0.53125, 0.02500000037252903, 0.02500000037252903], [0.11874999850988388, 0.53125, 0.05000000074505806, 0.05000000074505806], [0.13124999403953552, 0.53125, 0.02500000037252903, 0.02500000037252903], [0.13124999403953552, 0.53125, 0.05000000074505806, 0.05000000074505806], [0.14374999701976776, 0.53125, 0.02500000037252903, 0.02500000037252903], [0.14374999701976776, 0.53125, 0.05000000074505806, 0.05000000074505806], [0.15625, 0.53125, 0.02500000037252903, 0.02500000037252903], [0.15625, 0.53125, 0.05000000074505806, 0.05000000074505806], [0.16875000298023224, 0.53125, 0.02500000037252903, 0.02500000037252903], [0.16875000298023224, 0.53125, 0.05000000074505806, 0.05000000074505806], [0.18125000596046448, 0.53125, 0.02500000037252903, 0.02500000037252903], [0.18125000596046448, 0.53125, 0.05000000074505806, 0.05000000074505806], [0.19374999403953552, 0.53125, 0.02500000037252903, 0.02500000037252903], [0.19374999403953552, 0.53125, 0.05000000074505806, 0.05000000074505806], [0.20624999701976776, 0.53125, 0.02500000037252903, 0.02500000037252903], [0.20624999701976776, 0.53125, 0.05000000074505806, 0.05000000074505806], [0.21875, 0.53125, 0.02500000037252903, 0.02500000037252903], [0.21875, 0.53125, 0.05000000074505806, 0.05000000074505806], [0.23125000298023224, 0.53125, 0.02500000037252903, 0.02500000037252903], [0.23125000298023224, 0.53125, 0.05000000074505806, 0.05000000074505806], [0.24375000596046448, 0.53125, 0.02500000037252903, 0.02500000037252903], [0.24375000596046448, 0.53125, 0.05000000074505806, 0.05000000074505806], [0.2562499940395355, 0.53125, 0.02500000037252903, 0.02500000037252903], [0.2562499940395355, 0.53125, 0.05000000074505806, 0.05000000074505806], [0.26875001192092896, 0.53125, 0.02500000037252903, 0.02500000037252903], [0.26875001192092896, 0.53125, 0.05000000074505806, 0.05000000074505806], [0.28125, 0.53125, 0.02500000037252903, 0.02500000037252903], [0.28125, 0.53125, 0.05000000074505806, 0.05000000074505806], [0.29374998807907104, 0.53125, 0.02500000037252903, 0.02500000037252903], [0.29374998807907104, 0.53125, 0.05000000074505806, 0.05000000074505806], [0.3062500059604645, 0.53125, 0.02500000037252903, 0.02500000037252903], [0.3062500059604645, 0.53125, 0.05000000074505806, 0.05000000074505806], [0.3187499940395355, 0.53125, 0.02500000037252903, 0.02500000037252903], [0.3187499940395355, 0.53125, 0.05000000074505806, 0.05000000074505806], [0.33125001192092896, 0.53125, 0.02500000037252903, 0.02500000037252903], [0.33125001192092896, 0.53125, 0.05000000074505806, 0.05000000074505806], [0.34375, 0.53125, 0.02500000037252903, 0.02500000037252903], [0.34375, 0.53125, 0.05000000074505806, 0.05000000074505806], [0.35624998807907104, 0.53125, 0.02500000037252903, 0.02500000037252903], [0.35624998807907104, 0.53125, 0.05000000074505806, 0.05000000074505806], [0.3687500059604645, 0.53125, 0.02500000037252903, 0.02500000037252903], [0.3687500059604645, 0.53125, 0.05000000074505806, 0.05000000074505806], [0.3812499940395355, 0.53125, 0.02500000037252903, 0.02500000037252903], [0.3812499940395355, 0.53125, 0.05000000074505806, 0.05000000074505806], [0.39375001192092896, 0.53125, 0.02500000037252903, 0.02500000037252903], [0.39375001192092896, 0.53125, 0.05000000074505806, 0.05000000074505806], [0.40625, 0.53125, 0.02500000037252903, 0.02500000037252903], [0.40625, 0.53125, 0.05000000074505806, 0.05000000074505806], [0.41874998807907104, 0.53125, 0.02500000037252903, 0.02500000037252903], [0.41874998807907104, 0.53125, 0.05000000074505806, 0.05000000074505806], [0.4312500059604645, 0.53125, 0.02500000037252903, 0.02500000037252903], [0.4312500059604645, 0.53125, 0.05000000074505806, 0.05000000074505806], [0.4437499940395355, 0.53125, 0.02500000037252903, 0.02500000037252903], [0.4437499940395355, 0.53125, 0.05000000074505806, 0.05000000074505806], [0.45625001192092896, 0.53125, 0.02500000037252903, 0.02500000037252903], [0.45625001192092896, 0.53125, 0.05000000074505806, 0.05000000074505806], [0.46875, 0.53125, 0.02500000037252903, 0.02500000037252903], [0.46875, 0.53125, 0.05000000074505806, 0.05000000074505806], [0.48124998807907104, 0.53125, 0.02500000037252903, 0.02500000037252903], [0.48124998807907104, 0.53125, 0.05000000074505806, 0.05000000074505806], [0.4937500059604645, 0.53125, 0.02500000037252903, 0.02500000037252903], [0.4937500059604645, 0.53125, 0.05000000074505806, 0.05000000074505806], [0.5062500238418579, 0.53125, 0.02500000037252903, 0.02500000037252903], [0.5062500238418579, 0.53125, 0.05000000074505806, 0.05000000074505806], [0.518750011920929, 0.53125, 0.02500000037252903, 0.02500000037252903], [0.518750011920929, 0.53125, 0.05000000074505806, 0.05000000074505806], [0.53125, 0.53125, 0.02500000037252903, 0.02500000037252903], [0.53125, 0.53125, 0.05000000074505806, 0.05000000074505806], [0.543749988079071, 0.53125, 0.02500000037252903, 0.02500000037252903], [0.543749988079071, 0.53125, 0.05000000074505806, 0.05000000074505806], [0.5562499761581421, 0.53125, 0.02500000037252903, 0.02500000037252903], [0.5562499761581421, 0.53125, 0.05000000074505806, 0.05000000074505806], [0.5687500238418579, 0.53125, 0.02500000037252903, 0.02500000037252903], [0.5687500238418579, 0.53125, 0.05000000074505806, 0.05000000074505806], [0.581250011920929, 0.53125, 0.02500000037252903, 0.02500000037252903], [0.581250011920929, 0.53125, 0.05000000074505806, 0.05000000074505806], [0.59375, 0.53125, 0.02500000037252903, 0.02500000037252903], [0.59375, 0.53125, 0.05000000074505806, 0.05000000074505806], [0.606249988079071, 0.53125, 0.02500000037252903, 0.02500000037252903], [0.606249988079071, 0.53125, 0.05000000074505806, 0.05000000074505806], [0.6187499761581421, 0.53125, 0.02500000037252903, 0.02500000037252903], [0.6187499761581421, 0.53125, 0.05000000074505806, 0.05000000074505806], [0.6312500238418579, 0.53125, 0.02500000037252903, 0.02500000037252903], [0.6312500238418579, 0.53125, 0.05000000074505806, 0.05000000074505806], [0.643750011920929, 0.53125, 0.02500000037252903, 0.02500000037252903], [0.643750011920929, 0.53125, 0.05000000074505806, 0.05000000074505806], [0.65625, 0.53125, 0.02500000037252903, 0.02500000037252903], [0.65625, 0.53125, 0.05000000074505806, 0.05000000074505806], [0.668749988079071, 0.53125, 0.02500000037252903, 0.02500000037252903], [0.668749988079071, 0.53125, 0.05000000074505806, 0.05000000074505806], [0.6812499761581421, 0.53125, 0.02500000037252903, 0.02500000037252903], [0.6812499761581421, 0.53125, 0.05000000074505806, 0.05000000074505806], [0.6937500238418579, 0.53125, 0.02500000037252903, 0.02500000037252903], [0.6937500238418579, 0.53125, 0.05000000074505806, 0.05000000074505806], [0.706250011920929, 0.53125, 0.02500000037252903, 0.02500000037252903], [0.706250011920929, 0.53125, 0.05000000074505806, 0.05000000074505806], [0.71875, 0.53125, 0.02500000037252903, 0.02500000037252903], [0.71875, 0.53125, 0.05000000074505806, 0.05000000074505806], [0.731249988079071, 0.53125, 0.02500000037252903, 0.02500000037252903], [0.731249988079071, 0.53125, 0.05000000074505806, 0.05000000074505806], [0.7437499761581421, 0.53125, 0.02500000037252903, 0.02500000037252903], [0.7437499761581421, 0.53125, 0.05000000074505806, 0.05000000074505806], [0.7562500238418579, 0.53125, 0.02500000037252903, 0.02500000037252903], [0.7562500238418579, 0.53125, 0.05000000074505806, 0.05000000074505806], [0.768750011920929, 0.53125, 0.02500000037252903, 0.02500000037252903], [0.768750011920929, 0.53125, 0.05000000074505806, 0.05000000074505806], [0.78125, 0.53125, 0.02500000037252903, 0.02500000037252903], [0.78125, 0.53125, 0.05000000074505806, 0.05000000074505806], [0.793749988079071, 0.53125, 0.02500000037252903, 0.02500000037252903], [0.793749988079071, 0.53125, 0.05000000074505806, 0.05000000074505806], [0.8062499761581421, 0.53125, 0.02500000037252903, 0.02500000037252903], [0.8062499761581421, 0.53125, 0.05000000074505806, 0.05000000074505806], [0.8187500238418579, 0.53125, 0.02500000037252903, 0.02500000037252903], [0.8187500238418579, 0.53125, 0.05000000074505806, 0.05000000074505806], [0.831250011920929, 0.53125, 0.02500000037252903, 0.02500000037252903], [0.831250011920929, 0.53125, 0.05000000074505806, 0.05000000074505806], [0.84375, 0.53125, 0.02500000037252903, 0.02500000037252903], [0.84375, 0.53125, 0.05000000074505806, 0.05000000074505806], [0.856249988079071, 0.53125, 0.02500000037252903, 0.02500000037252903], [0.856249988079071, 0.53125, 0.05000000074505806, 0.05000000074505806], [0.8687499761581421, 0.53125, 0.02500000037252903, 0.02500000037252903], [0.8687499761581421, 0.53125, 0.05000000074505806, 0.05000000074505806], [0.8812500238418579, 0.53125, 0.02500000037252903, 0.02500000037252903], [0.8812500238418579, 0.53125, 0.05000000074505806, 0.05000000074505806], [0.893750011920929, 0.53125, 0.02500000037252903, 0.02500000037252903], [0.893750011920929, 0.53125, 0.05000000074505806, 0.05000000074505806], [0.90625, 0.53125, 0.02500000037252903, 0.02500000037252903], [0.90625, 0.53125, 0.05000000074505806, 0.05000000074505806], [0.918749988079071, 0.53125, 0.02500000037252903, 0.02500000037252903], [0.918749988079071, 0.53125, 0.05000000074505806, 0.05000000074505806], [0.9312499761581421, 0.53125, 0.02500000037252903, 0.02500000037252903], [0.9312499761581421, 0.53125, 0.05000000074505806, 0.05000000074505806], [0.9437500238418579, 0.53125, 0.02500000037252903, 0.02500000037252903], [0.9437500238418579, 0.53125, 0.05000000074505806, 0.05000000074505806], [0.956250011920929, 0.53125, 0.02500000037252903, 0.02500000037252903], [0.956250011920929, 0.53125, 0.05000000074505806, 0.05000000074505806], [0.96875, 0.53125, 0.02500000037252903, 0.02500000037252903], [0.96875, 0.53125, 0.05000000074505806, 0.05000000074505806], [0.981249988079071, 0.53125, 0.02500000037252903, 0.02500000037252903], [0.981249988079071, 0.53125, 0.05000000074505806, 0.05000000074505806], [0.9937499761581421, 0.53125, 0.02500000037252903, 0.02500000037252903], [0.9937499761581421, 0.53125, 0.05000000074505806, 0.05000000074505806], [0.0062500000931322575, 0.543749988079071, 0.02500000037252903, 0.02500000037252903], [0.0062500000931322575, 0.543749988079071, 0.05000000074505806, 0.05000000074505806], [0.01875000074505806, 0.543749988079071, 0.02500000037252903, 0.02500000037252903], [0.01875000074505806, 0.543749988079071, 0.05000000074505806, 0.05000000074505806], [0.03125, 0.543749988079071, 0.02500000037252903, 0.02500000037252903], [0.03125, 0.543749988079071, 0.05000000074505806, 0.05000000074505806], [0.04374999925494194, 0.543749988079071, 0.02500000037252903, 0.02500000037252903], [0.04374999925494194, 0.543749988079071, 0.05000000074505806, 0.05000000074505806], [0.05624999850988388, 0.543749988079071, 0.02500000037252903, 0.02500000037252903], [0.05624999850988388, 0.543749988079071, 0.05000000074505806, 0.05000000074505806], [0.06875000149011612, 0.543749988079071, 0.02500000037252903, 0.02500000037252903], [0.06875000149011612, 0.543749988079071, 0.05000000074505806, 0.05000000074505806], [0.08124999701976776, 0.543749988079071, 0.02500000037252903, 0.02500000037252903], [0.08124999701976776, 0.543749988079071, 0.05000000074505806, 0.05000000074505806], [0.09375, 0.543749988079071, 0.02500000037252903, 0.02500000037252903], [0.09375, 0.543749988079071, 0.05000000074505806, 0.05000000074505806], [0.10625000298023224, 0.543749988079071, 0.02500000037252903, 0.02500000037252903], [0.10625000298023224, 0.543749988079071, 0.05000000074505806, 0.05000000074505806], [0.11874999850988388, 0.543749988079071, 0.02500000037252903, 0.02500000037252903], [0.11874999850988388, 0.543749988079071, 0.05000000074505806, 0.05000000074505806], [0.13124999403953552, 0.543749988079071, 0.02500000037252903, 0.02500000037252903], [0.13124999403953552, 0.543749988079071, 0.05000000074505806, 0.05000000074505806], [0.14374999701976776, 0.543749988079071, 0.02500000037252903, 0.02500000037252903], [0.14374999701976776, 0.543749988079071, 0.05000000074505806, 0.05000000074505806], [0.15625, 0.543749988079071, 0.02500000037252903, 0.02500000037252903], [0.15625, 0.543749988079071, 0.05000000074505806, 0.05000000074505806], [0.16875000298023224, 0.543749988079071, 0.02500000037252903, 0.02500000037252903], [0.16875000298023224, 0.543749988079071, 0.05000000074505806, 0.05000000074505806], [0.18125000596046448, 0.543749988079071, 0.02500000037252903, 0.02500000037252903], [0.18125000596046448, 0.543749988079071, 0.05000000074505806, 0.05000000074505806], [0.19374999403953552, 0.543749988079071, 0.02500000037252903, 0.02500000037252903], [0.19374999403953552, 0.543749988079071, 0.05000000074505806, 0.05000000074505806], [0.20624999701976776, 0.543749988079071, 0.02500000037252903, 0.02500000037252903], [0.20624999701976776, 0.543749988079071, 0.05000000074505806, 0.05000000074505806], [0.21875, 0.543749988079071, 0.02500000037252903, 0.02500000037252903], [0.21875, 0.543749988079071, 0.05000000074505806, 0.05000000074505806], [0.23125000298023224, 0.543749988079071, 0.02500000037252903, 0.02500000037252903], [0.23125000298023224, 0.543749988079071, 0.05000000074505806, 0.05000000074505806], [0.24375000596046448, 0.543749988079071, 0.02500000037252903, 0.02500000037252903], [0.24375000596046448, 0.543749988079071, 0.05000000074505806, 0.05000000074505806], [0.2562499940395355, 0.543749988079071, 0.02500000037252903, 0.02500000037252903], [0.2562499940395355, 0.543749988079071, 0.05000000074505806, 0.05000000074505806], [0.26875001192092896, 0.543749988079071, 0.02500000037252903, 0.02500000037252903], [0.26875001192092896, 0.543749988079071, 0.05000000074505806, 0.05000000074505806], [0.28125, 0.543749988079071, 0.02500000037252903, 0.02500000037252903], [0.28125, 0.543749988079071, 0.05000000074505806, 0.05000000074505806], [0.29374998807907104, 0.543749988079071, 0.02500000037252903, 0.02500000037252903], [0.29374998807907104, 0.543749988079071, 0.05000000074505806, 0.05000000074505806], [0.3062500059604645, 0.543749988079071, 0.02500000037252903, 0.02500000037252903], [0.3062500059604645, 0.543749988079071, 0.05000000074505806, 0.05000000074505806], [0.3187499940395355, 0.543749988079071, 0.02500000037252903, 0.02500000037252903], [0.3187499940395355, 0.543749988079071, 0.05000000074505806, 0.05000000074505806], [0.33125001192092896, 0.543749988079071, 0.02500000037252903, 0.02500000037252903], [0.33125001192092896, 0.543749988079071, 0.05000000074505806, 0.05000000074505806], [0.34375, 0.543749988079071, 0.02500000037252903, 0.02500000037252903], [0.34375, 0.543749988079071, 0.05000000074505806, 0.05000000074505806], [0.35624998807907104, 0.543749988079071, 0.02500000037252903, 0.02500000037252903], [0.35624998807907104, 0.543749988079071, 0.05000000074505806, 0.05000000074505806], [0.3687500059604645, 0.543749988079071, 0.02500000037252903, 0.02500000037252903], [0.3687500059604645, 0.543749988079071, 0.05000000074505806, 0.05000000074505806], [0.3812499940395355, 0.543749988079071, 0.02500000037252903, 0.02500000037252903], [0.3812499940395355, 0.543749988079071, 0.05000000074505806, 0.05000000074505806], [0.39375001192092896, 0.543749988079071, 0.02500000037252903, 0.02500000037252903], [0.39375001192092896, 0.543749988079071, 0.05000000074505806, 0.05000000074505806], [0.40625, 0.543749988079071, 0.02500000037252903, 0.02500000037252903], [0.40625, 0.543749988079071, 0.05000000074505806, 0.05000000074505806], [0.41874998807907104, 0.543749988079071, 0.02500000037252903, 0.02500000037252903], [0.41874998807907104, 0.543749988079071, 0.05000000074505806, 0.05000000074505806], [0.4312500059604645, 0.543749988079071, 0.02500000037252903, 0.02500000037252903], [0.4312500059604645, 0.543749988079071, 0.05000000074505806, 0.05000000074505806], [0.4437499940395355, 0.543749988079071, 0.02500000037252903, 0.02500000037252903], [0.4437499940395355, 0.543749988079071, 0.05000000074505806, 0.05000000074505806], [0.45625001192092896, 0.543749988079071, 0.02500000037252903, 0.02500000037252903], [0.45625001192092896, 0.543749988079071, 0.05000000074505806, 0.05000000074505806], [0.46875, 0.543749988079071, 0.02500000037252903, 0.02500000037252903], [0.46875, 0.543749988079071, 0.05000000074505806, 0.05000000074505806], [0.48124998807907104, 0.543749988079071, 0.02500000037252903, 0.02500000037252903], [0.48124998807907104, 0.543749988079071, 0.05000000074505806, 0.05000000074505806], [0.4937500059604645, 0.543749988079071, 0.02500000037252903, 0.02500000037252903], [0.4937500059604645, 0.543749988079071, 0.05000000074505806, 0.05000000074505806], [0.5062500238418579, 0.543749988079071, 0.02500000037252903, 0.02500000037252903], [0.5062500238418579, 0.543749988079071, 0.05000000074505806, 0.05000000074505806], [0.518750011920929, 0.543749988079071, 0.02500000037252903, 0.02500000037252903], [0.518750011920929, 0.543749988079071, 0.05000000074505806, 0.05000000074505806], [0.53125, 0.543749988079071, 0.02500000037252903, 0.02500000037252903], [0.53125, 0.543749988079071, 0.05000000074505806, 0.05000000074505806], [0.543749988079071, 0.543749988079071, 0.02500000037252903, 0.02500000037252903], [0.543749988079071, 0.543749988079071, 0.05000000074505806, 0.05000000074505806], [0.5562499761581421, 0.543749988079071, 0.02500000037252903, 0.02500000037252903], [0.5562499761581421, 0.543749988079071, 0.05000000074505806, 0.05000000074505806], [0.5687500238418579, 0.543749988079071, 0.02500000037252903, 0.02500000037252903], [0.5687500238418579, 0.543749988079071, 0.05000000074505806, 0.05000000074505806], [0.581250011920929, 0.543749988079071, 0.02500000037252903, 0.02500000037252903], [0.581250011920929, 0.543749988079071, 0.05000000074505806, 0.05000000074505806], [0.59375, 0.543749988079071, 0.02500000037252903, 0.02500000037252903], [0.59375, 0.543749988079071, 0.05000000074505806, 0.05000000074505806], [0.606249988079071, 0.543749988079071, 0.02500000037252903, 0.02500000037252903], [0.606249988079071, 0.543749988079071, 0.05000000074505806, 0.05000000074505806], [0.6187499761581421, 0.543749988079071, 0.02500000037252903, 0.02500000037252903], [0.6187499761581421, 0.543749988079071, 0.05000000074505806, 0.05000000074505806], [0.6312500238418579, 0.543749988079071, 0.02500000037252903, 0.02500000037252903], [0.6312500238418579, 0.543749988079071, 0.05000000074505806, 0.05000000074505806], [0.643750011920929, 0.543749988079071, 0.02500000037252903, 0.02500000037252903], [0.643750011920929, 0.543749988079071, 0.05000000074505806, 0.05000000074505806], [0.65625, 0.543749988079071, 0.02500000037252903, 0.02500000037252903], [0.65625, 0.543749988079071, 0.05000000074505806, 0.05000000074505806], [0.668749988079071, 0.543749988079071, 0.02500000037252903, 0.02500000037252903], [0.668749988079071, 0.543749988079071, 0.05000000074505806, 0.05000000074505806], [0.6812499761581421, 0.543749988079071, 0.02500000037252903, 0.02500000037252903], [0.6812499761581421, 0.543749988079071, 0.05000000074505806, 0.05000000074505806], [0.6937500238418579, 0.543749988079071, 0.02500000037252903, 0.02500000037252903], [0.6937500238418579, 0.543749988079071, 0.05000000074505806, 0.05000000074505806], [0.706250011920929, 0.543749988079071, 0.02500000037252903, 0.02500000037252903], [0.706250011920929, 0.543749988079071, 0.05000000074505806, 0.05000000074505806], [0.71875, 0.543749988079071, 0.02500000037252903, 0.02500000037252903], [0.71875, 0.543749988079071, 0.05000000074505806, 0.05000000074505806], [0.731249988079071, 0.543749988079071, 0.02500000037252903, 0.02500000037252903], [0.731249988079071, 0.543749988079071, 0.05000000074505806, 0.05000000074505806], [0.7437499761581421, 0.543749988079071, 0.02500000037252903, 0.02500000037252903], [0.7437499761581421, 0.543749988079071, 0.05000000074505806, 0.05000000074505806], [0.7562500238418579, 0.543749988079071, 0.02500000037252903, 0.02500000037252903], [0.7562500238418579, 0.543749988079071, 0.05000000074505806, 0.05000000074505806], [0.768750011920929, 0.543749988079071, 0.02500000037252903, 0.02500000037252903], [0.768750011920929, 0.543749988079071, 0.05000000074505806, 0.05000000074505806], [0.78125, 0.543749988079071, 0.02500000037252903, 0.02500000037252903], [0.78125, 0.543749988079071, 0.05000000074505806, 0.05000000074505806], [0.793749988079071, 0.543749988079071, 0.02500000037252903, 0.02500000037252903], [0.793749988079071, 0.543749988079071, 0.05000000074505806, 0.05000000074505806], [0.8062499761581421, 0.543749988079071, 0.02500000037252903, 0.02500000037252903], [0.8062499761581421, 0.543749988079071, 0.05000000074505806, 0.05000000074505806], [0.8187500238418579, 0.543749988079071, 0.02500000037252903, 0.02500000037252903], [0.8187500238418579, 0.543749988079071, 0.05000000074505806, 0.05000000074505806], [0.831250011920929, 0.543749988079071, 0.02500000037252903, 0.02500000037252903], [0.831250011920929, 0.543749988079071, 0.05000000074505806, 0.05000000074505806], [0.84375, 0.543749988079071, 0.02500000037252903, 0.02500000037252903], [0.84375, 0.543749988079071, 0.05000000074505806, 0.05000000074505806], [0.856249988079071, 0.543749988079071, 0.02500000037252903, 0.02500000037252903], [0.856249988079071, 0.543749988079071, 0.05000000074505806, 0.05000000074505806], [0.8687499761581421, 0.543749988079071, 0.02500000037252903, 0.02500000037252903], [0.8687499761581421, 0.543749988079071, 0.05000000074505806, 0.05000000074505806], [0.8812500238418579, 0.543749988079071, 0.02500000037252903, 0.02500000037252903], [0.8812500238418579, 0.543749988079071, 0.05000000074505806, 0.05000000074505806], [0.893750011920929, 0.543749988079071, 0.02500000037252903, 0.02500000037252903], [0.893750011920929, 0.543749988079071, 0.05000000074505806, 0.05000000074505806], [0.90625, 0.543749988079071, 0.02500000037252903, 0.02500000037252903], [0.90625, 0.543749988079071, 0.05000000074505806, 0.05000000074505806], [0.918749988079071, 0.543749988079071, 0.02500000037252903, 0.02500000037252903], [0.918749988079071, 0.543749988079071, 0.05000000074505806, 0.05000000074505806], [0.9312499761581421, 0.543749988079071, 0.02500000037252903, 0.02500000037252903], [0.9312499761581421, 0.543749988079071, 0.05000000074505806, 0.05000000074505806], [0.9437500238418579, 0.543749988079071, 0.02500000037252903, 0.02500000037252903], [0.9437500238418579, 0.543749988079071, 0.05000000074505806, 0.05000000074505806], [0.956250011920929, 0.543749988079071, 0.02500000037252903, 0.02500000037252903], [0.956250011920929, 0.543749988079071, 0.05000000074505806, 0.05000000074505806], [0.96875, 0.543749988079071, 0.02500000037252903, 0.02500000037252903], [0.96875, 0.543749988079071, 0.05000000074505806, 0.05000000074505806], [0.981249988079071, 0.543749988079071, 0.02500000037252903, 0.02500000037252903], [0.981249988079071, 0.543749988079071, 0.05000000074505806, 0.05000000074505806], [0.9937499761581421, 0.543749988079071, 0.02500000037252903, 0.02500000037252903], [0.9937499761581421, 0.543749988079071, 0.05000000074505806, 0.05000000074505806], [0.0062500000931322575, 0.5562499761581421, 0.02500000037252903, 0.02500000037252903], [0.0062500000931322575, 0.5562499761581421, 0.05000000074505806, 0.05000000074505806], [0.01875000074505806, 0.5562499761581421, 0.02500000037252903, 0.02500000037252903], [0.01875000074505806, 0.5562499761581421, 0.05000000074505806, 0.05000000074505806], [0.03125, 0.5562499761581421, 0.02500000037252903, 0.02500000037252903], [0.03125, 0.5562499761581421, 0.05000000074505806, 0.05000000074505806], [0.04374999925494194, 0.5562499761581421, 0.02500000037252903, 0.02500000037252903], [0.04374999925494194, 0.5562499761581421, 0.05000000074505806, 0.05000000074505806], [0.05624999850988388, 0.5562499761581421, 0.02500000037252903, 0.02500000037252903], [0.05624999850988388, 0.5562499761581421, 0.05000000074505806, 0.05000000074505806], [0.06875000149011612, 0.5562499761581421, 0.02500000037252903, 0.02500000037252903], [0.06875000149011612, 0.5562499761581421, 0.05000000074505806, 0.05000000074505806], [0.08124999701976776, 0.5562499761581421, 0.02500000037252903, 0.02500000037252903], [0.08124999701976776, 0.5562499761581421, 0.05000000074505806, 0.05000000074505806], [0.09375, 0.5562499761581421, 0.02500000037252903, 0.02500000037252903], [0.09375, 0.5562499761581421, 0.05000000074505806, 0.05000000074505806], [0.10625000298023224, 0.5562499761581421, 0.02500000037252903, 0.02500000037252903], [0.10625000298023224, 0.5562499761581421, 0.05000000074505806, 0.05000000074505806], [0.11874999850988388, 0.5562499761581421, 0.02500000037252903, 0.02500000037252903], [0.11874999850988388, 0.5562499761581421, 0.05000000074505806, 0.05000000074505806], [0.13124999403953552, 0.5562499761581421, 0.02500000037252903, 0.02500000037252903], [0.13124999403953552, 0.5562499761581421, 0.05000000074505806, 0.05000000074505806], [0.14374999701976776, 0.5562499761581421, 0.02500000037252903, 0.02500000037252903], [0.14374999701976776, 0.5562499761581421, 0.05000000074505806, 0.05000000074505806], [0.15625, 0.5562499761581421, 0.02500000037252903, 0.02500000037252903], [0.15625, 0.5562499761581421, 0.05000000074505806, 0.05000000074505806], [0.16875000298023224, 0.5562499761581421, 0.02500000037252903, 0.02500000037252903], [0.16875000298023224, 0.5562499761581421, 0.05000000074505806, 0.05000000074505806], [0.18125000596046448, 0.5562499761581421, 0.02500000037252903, 0.02500000037252903], [0.18125000596046448, 0.5562499761581421, 0.05000000074505806, 0.05000000074505806], [0.19374999403953552, 0.5562499761581421, 0.02500000037252903, 0.02500000037252903], [0.19374999403953552, 0.5562499761581421, 0.05000000074505806, 0.05000000074505806], [0.20624999701976776, 0.5562499761581421, 0.02500000037252903, 0.02500000037252903], [0.20624999701976776, 0.5562499761581421, 0.05000000074505806, 0.05000000074505806], [0.21875, 0.5562499761581421, 0.02500000037252903, 0.02500000037252903], [0.21875, 0.5562499761581421, 0.05000000074505806, 0.05000000074505806], [0.23125000298023224, 0.5562499761581421, 0.02500000037252903, 0.02500000037252903], [0.23125000298023224, 0.5562499761581421, 0.05000000074505806, 0.05000000074505806], [0.24375000596046448, 0.5562499761581421, 0.02500000037252903, 0.02500000037252903], [0.24375000596046448, 0.5562499761581421, 0.05000000074505806, 0.05000000074505806], [0.2562499940395355, 0.5562499761581421, 0.02500000037252903, 0.02500000037252903], [0.2562499940395355, 0.5562499761581421, 0.05000000074505806, 0.05000000074505806], [0.26875001192092896, 0.5562499761581421, 0.02500000037252903, 0.02500000037252903], [0.26875001192092896, 0.5562499761581421, 0.05000000074505806, 0.05000000074505806], [0.28125, 0.5562499761581421, 0.02500000037252903, 0.02500000037252903], [0.28125, 0.5562499761581421, 0.05000000074505806, 0.05000000074505806], [0.29374998807907104, 0.5562499761581421, 0.02500000037252903, 0.02500000037252903], [0.29374998807907104, 0.5562499761581421, 0.05000000074505806, 0.05000000074505806], [0.3062500059604645, 0.5562499761581421, 0.02500000037252903, 0.02500000037252903], [0.3062500059604645, 0.5562499761581421, 0.05000000074505806, 0.05000000074505806], [0.3187499940395355, 0.5562499761581421, 0.02500000037252903, 0.02500000037252903], [0.3187499940395355, 0.5562499761581421, 0.05000000074505806, 0.05000000074505806], [0.33125001192092896, 0.5562499761581421, 0.02500000037252903, 0.02500000037252903], [0.33125001192092896, 0.5562499761581421, 0.05000000074505806, 0.05000000074505806], [0.34375, 0.5562499761581421, 0.02500000037252903, 0.02500000037252903], [0.34375, 0.5562499761581421, 0.05000000074505806, 0.05000000074505806], [0.35624998807907104, 0.5562499761581421, 0.02500000037252903, 0.02500000037252903], [0.35624998807907104, 0.5562499761581421, 0.05000000074505806, 0.05000000074505806], [0.3687500059604645, 0.5562499761581421, 0.02500000037252903, 0.02500000037252903], [0.3687500059604645, 0.5562499761581421, 0.05000000074505806, 0.05000000074505806], [0.3812499940395355, 0.5562499761581421, 0.02500000037252903, 0.02500000037252903], [0.3812499940395355, 0.5562499761581421, 0.05000000074505806, 0.05000000074505806], [0.39375001192092896, 0.5562499761581421, 0.02500000037252903, 0.02500000037252903], [0.39375001192092896, 0.5562499761581421, 0.05000000074505806, 0.05000000074505806], [0.40625, 0.5562499761581421, 0.02500000037252903, 0.02500000037252903], [0.40625, 0.5562499761581421, 0.05000000074505806, 0.05000000074505806], [0.41874998807907104, 0.5562499761581421, 0.02500000037252903, 0.02500000037252903], [0.41874998807907104, 0.5562499761581421, 0.05000000074505806, 0.05000000074505806], [0.4312500059604645, 0.5562499761581421, 0.02500000037252903, 0.02500000037252903], [0.4312500059604645, 0.5562499761581421, 0.05000000074505806, 0.05000000074505806], [0.4437499940395355, 0.5562499761581421, 0.02500000037252903, 0.02500000037252903], [0.4437499940395355, 0.5562499761581421, 0.05000000074505806, 0.05000000074505806], [0.45625001192092896, 0.5562499761581421, 0.02500000037252903, 0.02500000037252903], [0.45625001192092896, 0.5562499761581421, 0.05000000074505806, 0.05000000074505806], [0.46875, 0.5562499761581421, 0.02500000037252903, 0.02500000037252903], [0.46875, 0.5562499761581421, 0.05000000074505806, 0.05000000074505806], [0.48124998807907104, 0.5562499761581421, 0.02500000037252903, 0.02500000037252903], [0.48124998807907104, 0.5562499761581421, 0.05000000074505806, 0.05000000074505806], [0.4937500059604645, 0.5562499761581421, 0.02500000037252903, 0.02500000037252903], [0.4937500059604645, 0.5562499761581421, 0.05000000074505806, 0.05000000074505806], [0.5062500238418579, 0.5562499761581421, 0.02500000037252903, 0.02500000037252903], [0.5062500238418579, 0.5562499761581421, 0.05000000074505806, 0.05000000074505806], [0.518750011920929, 0.5562499761581421, 0.02500000037252903, 0.02500000037252903], [0.518750011920929, 0.5562499761581421, 0.05000000074505806, 0.05000000074505806], [0.53125, 0.5562499761581421, 0.02500000037252903, 0.02500000037252903], [0.53125, 0.5562499761581421, 0.05000000074505806, 0.05000000074505806], [0.543749988079071, 0.5562499761581421, 0.02500000037252903, 0.02500000037252903], [0.543749988079071, 0.5562499761581421, 0.05000000074505806, 0.05000000074505806], [0.5562499761581421, 0.5562499761581421, 0.02500000037252903, 0.02500000037252903], [0.5562499761581421, 0.5562499761581421, 0.05000000074505806, 0.05000000074505806], [0.5687500238418579, 0.5562499761581421, 0.02500000037252903, 0.02500000037252903], [0.5687500238418579, 0.5562499761581421, 0.05000000074505806, 0.05000000074505806], [0.581250011920929, 0.5562499761581421, 0.02500000037252903, 0.02500000037252903], [0.581250011920929, 0.5562499761581421, 0.05000000074505806, 0.05000000074505806], [0.59375, 0.5562499761581421, 0.02500000037252903, 0.02500000037252903], [0.59375, 0.5562499761581421, 0.05000000074505806, 0.05000000074505806], [0.606249988079071, 0.5562499761581421, 0.02500000037252903, 0.02500000037252903], [0.606249988079071, 0.5562499761581421, 0.05000000074505806, 0.05000000074505806], [0.6187499761581421, 0.5562499761581421, 0.02500000037252903, 0.02500000037252903], [0.6187499761581421, 0.5562499761581421, 0.05000000074505806, 0.05000000074505806], [0.6312500238418579, 0.5562499761581421, 0.02500000037252903, 0.02500000037252903], [0.6312500238418579, 0.5562499761581421, 0.05000000074505806, 0.05000000074505806], [0.643750011920929, 0.5562499761581421, 0.02500000037252903, 0.02500000037252903], [0.643750011920929, 0.5562499761581421, 0.05000000074505806, 0.05000000074505806], [0.65625, 0.5562499761581421, 0.02500000037252903, 0.02500000037252903], [0.65625, 0.5562499761581421, 0.05000000074505806, 0.05000000074505806], [0.668749988079071, 0.5562499761581421, 0.02500000037252903, 0.02500000037252903], [0.668749988079071, 0.5562499761581421, 0.05000000074505806, 0.05000000074505806], [0.6812499761581421, 0.5562499761581421, 0.02500000037252903, 0.02500000037252903], [0.6812499761581421, 0.5562499761581421, 0.05000000074505806, 0.05000000074505806], [0.6937500238418579, 0.5562499761581421, 0.02500000037252903, 0.02500000037252903], [0.6937500238418579, 0.5562499761581421, 0.05000000074505806, 0.05000000074505806], [0.706250011920929, 0.5562499761581421, 0.02500000037252903, 0.02500000037252903], [0.706250011920929, 0.5562499761581421, 0.05000000074505806, 0.05000000074505806], [0.71875, 0.5562499761581421, 0.02500000037252903, 0.02500000037252903], [0.71875, 0.5562499761581421, 0.05000000074505806, 0.05000000074505806], [0.731249988079071, 0.5562499761581421, 0.02500000037252903, 0.02500000037252903], [0.731249988079071, 0.5562499761581421, 0.05000000074505806, 0.05000000074505806], [0.7437499761581421, 0.5562499761581421, 0.02500000037252903, 0.02500000037252903], [0.7437499761581421, 0.5562499761581421, 0.05000000074505806, 0.05000000074505806], [0.7562500238418579, 0.5562499761581421, 0.02500000037252903, 0.02500000037252903], [0.7562500238418579, 0.5562499761581421, 0.05000000074505806, 0.05000000074505806], [0.768750011920929, 0.5562499761581421, 0.02500000037252903, 0.02500000037252903], [0.768750011920929, 0.5562499761581421, 0.05000000074505806, 0.05000000074505806], [0.78125, 0.5562499761581421, 0.02500000037252903, 0.02500000037252903], [0.78125, 0.5562499761581421, 0.05000000074505806, 0.05000000074505806], [0.793749988079071, 0.5562499761581421, 0.02500000037252903, 0.02500000037252903], [0.793749988079071, 0.5562499761581421, 0.05000000074505806, 0.05000000074505806], [0.8062499761581421, 0.5562499761581421, 0.02500000037252903, 0.02500000037252903], [0.8062499761581421, 0.5562499761581421, 0.05000000074505806, 0.05000000074505806], [0.8187500238418579, 0.5562499761581421, 0.02500000037252903, 0.02500000037252903], [0.8187500238418579, 0.5562499761581421, 0.05000000074505806, 0.05000000074505806], [0.831250011920929, 0.5562499761581421, 0.02500000037252903, 0.02500000037252903], [0.831250011920929, 0.5562499761581421, 0.05000000074505806, 0.05000000074505806], [0.84375, 0.5562499761581421, 0.02500000037252903, 0.02500000037252903], [0.84375, 0.5562499761581421, 0.05000000074505806, 0.05000000074505806], [0.856249988079071, 0.5562499761581421, 0.02500000037252903, 0.02500000037252903], [0.856249988079071, 0.5562499761581421, 0.05000000074505806, 0.05000000074505806], [0.8687499761581421, 0.5562499761581421, 0.02500000037252903, 0.02500000037252903], [0.8687499761581421, 0.5562499761581421, 0.05000000074505806, 0.05000000074505806], [0.8812500238418579, 0.5562499761581421, 0.02500000037252903, 0.02500000037252903], [0.8812500238418579, 0.5562499761581421, 0.05000000074505806, 0.05000000074505806], [0.893750011920929, 0.5562499761581421, 0.02500000037252903, 0.02500000037252903], [0.893750011920929, 0.5562499761581421, 0.05000000074505806, 0.05000000074505806], [0.90625, 0.5562499761581421, 0.02500000037252903, 0.02500000037252903], [0.90625, 0.5562499761581421, 0.05000000074505806, 0.05000000074505806], [0.918749988079071, 0.5562499761581421, 0.02500000037252903, 0.02500000037252903], [0.918749988079071, 0.5562499761581421, 0.05000000074505806, 0.05000000074505806], [0.9312499761581421, 0.5562499761581421, 0.02500000037252903, 0.02500000037252903], [0.9312499761581421, 0.5562499761581421, 0.05000000074505806, 0.05000000074505806], [0.9437500238418579, 0.5562499761581421, 0.02500000037252903, 0.02500000037252903], [0.9437500238418579, 0.5562499761581421, 0.05000000074505806, 0.05000000074505806], [0.956250011920929, 0.5562499761581421, 0.02500000037252903, 0.02500000037252903], [0.956250011920929, 0.5562499761581421, 0.05000000074505806, 0.05000000074505806], [0.96875, 0.5562499761581421, 0.02500000037252903, 0.02500000037252903], [0.96875, 0.5562499761581421, 0.05000000074505806, 0.05000000074505806], [0.981249988079071, 0.5562499761581421, 0.02500000037252903, 0.02500000037252903], [0.981249988079071, 0.5562499761581421, 0.05000000074505806, 0.05000000074505806], [0.9937499761581421, 0.5562499761581421, 0.02500000037252903, 0.02500000037252903], [0.9937499761581421, 0.5562499761581421, 0.05000000074505806, 0.05000000074505806], [0.0062500000931322575, 0.5687500238418579, 0.02500000037252903, 0.02500000037252903], [0.0062500000931322575, 0.5687500238418579, 0.05000000074505806, 0.05000000074505806], [0.01875000074505806, 0.5687500238418579, 0.02500000037252903, 0.02500000037252903], [0.01875000074505806, 0.5687500238418579, 0.05000000074505806, 0.05000000074505806], [0.03125, 0.5687500238418579, 0.02500000037252903, 0.02500000037252903], [0.03125, 0.5687500238418579, 0.05000000074505806, 0.05000000074505806], [0.04374999925494194, 0.5687500238418579, 0.02500000037252903, 0.02500000037252903], [0.04374999925494194, 0.5687500238418579, 0.05000000074505806, 0.05000000074505806], [0.05624999850988388, 0.5687500238418579, 0.02500000037252903, 0.02500000037252903], [0.05624999850988388, 0.5687500238418579, 0.05000000074505806, 0.05000000074505806], [0.06875000149011612, 0.5687500238418579, 0.02500000037252903, 0.02500000037252903], [0.06875000149011612, 0.5687500238418579, 0.05000000074505806, 0.05000000074505806], [0.08124999701976776, 0.5687500238418579, 0.02500000037252903, 0.02500000037252903], [0.08124999701976776, 0.5687500238418579, 0.05000000074505806, 0.05000000074505806], [0.09375, 0.5687500238418579, 0.02500000037252903, 0.02500000037252903], [0.09375, 0.5687500238418579, 0.05000000074505806, 0.05000000074505806], [0.10625000298023224, 0.5687500238418579, 0.02500000037252903, 0.02500000037252903], [0.10625000298023224, 0.5687500238418579, 0.05000000074505806, 0.05000000074505806], [0.11874999850988388, 0.5687500238418579, 0.02500000037252903, 0.02500000037252903], [0.11874999850988388, 0.5687500238418579, 0.05000000074505806, 0.05000000074505806], [0.13124999403953552, 0.5687500238418579, 0.02500000037252903, 0.02500000037252903], [0.13124999403953552, 0.5687500238418579, 0.05000000074505806, 0.05000000074505806], [0.14374999701976776, 0.5687500238418579, 0.02500000037252903, 0.02500000037252903], [0.14374999701976776, 0.5687500238418579, 0.05000000074505806, 0.05000000074505806], [0.15625, 0.5687500238418579, 0.02500000037252903, 0.02500000037252903], [0.15625, 0.5687500238418579, 0.05000000074505806, 0.05000000074505806], [0.16875000298023224, 0.5687500238418579, 0.02500000037252903, 0.02500000037252903], [0.16875000298023224, 0.5687500238418579, 0.05000000074505806, 0.05000000074505806], [0.18125000596046448, 0.5687500238418579, 0.02500000037252903, 0.02500000037252903], [0.18125000596046448, 0.5687500238418579, 0.05000000074505806, 0.05000000074505806], [0.19374999403953552, 0.5687500238418579, 0.02500000037252903, 0.02500000037252903], [0.19374999403953552, 0.5687500238418579, 0.05000000074505806, 0.05000000074505806], [0.20624999701976776, 0.5687500238418579, 0.02500000037252903, 0.02500000037252903], [0.20624999701976776, 0.5687500238418579, 0.05000000074505806, 0.05000000074505806], [0.21875, 0.5687500238418579, 0.02500000037252903, 0.02500000037252903], [0.21875, 0.5687500238418579, 0.05000000074505806, 0.05000000074505806], [0.23125000298023224, 0.5687500238418579, 0.02500000037252903, 0.02500000037252903], [0.23125000298023224, 0.5687500238418579, 0.05000000074505806, 0.05000000074505806], [0.24375000596046448, 0.5687500238418579, 0.02500000037252903, 0.02500000037252903], [0.24375000596046448, 0.5687500238418579, 0.05000000074505806, 0.05000000074505806], [0.2562499940395355, 0.5687500238418579, 0.02500000037252903, 0.02500000037252903], [0.2562499940395355, 0.5687500238418579, 0.05000000074505806, 0.05000000074505806], [0.26875001192092896, 0.5687500238418579, 0.02500000037252903, 0.02500000037252903], [0.26875001192092896, 0.5687500238418579, 0.05000000074505806, 0.05000000074505806], [0.28125, 0.5687500238418579, 0.02500000037252903, 0.02500000037252903], [0.28125, 0.5687500238418579, 0.05000000074505806, 0.05000000074505806], [0.29374998807907104, 0.5687500238418579, 0.02500000037252903, 0.02500000037252903], [0.29374998807907104, 0.5687500238418579, 0.05000000074505806, 0.05000000074505806], [0.3062500059604645, 0.5687500238418579, 0.02500000037252903, 0.02500000037252903], [0.3062500059604645, 0.5687500238418579, 0.05000000074505806, 0.05000000074505806], [0.3187499940395355, 0.5687500238418579, 0.02500000037252903, 0.02500000037252903], [0.3187499940395355, 0.5687500238418579, 0.05000000074505806, 0.05000000074505806], [0.33125001192092896, 0.5687500238418579, 0.02500000037252903, 0.02500000037252903], [0.33125001192092896, 0.5687500238418579, 0.05000000074505806, 0.05000000074505806], [0.34375, 0.5687500238418579, 0.02500000037252903, 0.02500000037252903], [0.34375, 0.5687500238418579, 0.05000000074505806, 0.05000000074505806], [0.35624998807907104, 0.5687500238418579, 0.02500000037252903, 0.02500000037252903], [0.35624998807907104, 0.5687500238418579, 0.05000000074505806, 0.05000000074505806], [0.3687500059604645, 0.5687500238418579, 0.02500000037252903, 0.02500000037252903], [0.3687500059604645, 0.5687500238418579, 0.05000000074505806, 0.05000000074505806], [0.3812499940395355, 0.5687500238418579, 0.02500000037252903, 0.02500000037252903], [0.3812499940395355, 0.5687500238418579, 0.05000000074505806, 0.05000000074505806], [0.39375001192092896, 0.5687500238418579, 0.02500000037252903, 0.02500000037252903], [0.39375001192092896, 0.5687500238418579, 0.05000000074505806, 0.05000000074505806], [0.40625, 0.5687500238418579, 0.02500000037252903, 0.02500000037252903], [0.40625, 0.5687500238418579, 0.05000000074505806, 0.05000000074505806], [0.41874998807907104, 0.5687500238418579, 0.02500000037252903, 0.02500000037252903], [0.41874998807907104, 0.5687500238418579, 0.05000000074505806, 0.05000000074505806], [0.4312500059604645, 0.5687500238418579, 0.02500000037252903, 0.02500000037252903], [0.4312500059604645, 0.5687500238418579, 0.05000000074505806, 0.05000000074505806], [0.4437499940395355, 0.5687500238418579, 0.02500000037252903, 0.02500000037252903], [0.4437499940395355, 0.5687500238418579, 0.05000000074505806, 0.05000000074505806], [0.45625001192092896, 0.5687500238418579, 0.02500000037252903, 0.02500000037252903], [0.45625001192092896, 0.5687500238418579, 0.05000000074505806, 0.05000000074505806], [0.46875, 0.5687500238418579, 0.02500000037252903, 0.02500000037252903], [0.46875, 0.5687500238418579, 0.05000000074505806, 0.05000000074505806], [0.48124998807907104, 0.5687500238418579, 0.02500000037252903, 0.02500000037252903], [0.48124998807907104, 0.5687500238418579, 0.05000000074505806, 0.05000000074505806], [0.4937500059604645, 0.5687500238418579, 0.02500000037252903, 0.02500000037252903], [0.4937500059604645, 0.5687500238418579, 0.05000000074505806, 0.05000000074505806], [0.5062500238418579, 0.5687500238418579, 0.02500000037252903, 0.02500000037252903], [0.5062500238418579, 0.5687500238418579, 0.05000000074505806, 0.05000000074505806], [0.518750011920929, 0.5687500238418579, 0.02500000037252903, 0.02500000037252903], [0.518750011920929, 0.5687500238418579, 0.05000000074505806, 0.05000000074505806], [0.53125, 0.5687500238418579, 0.02500000037252903, 0.02500000037252903], [0.53125, 0.5687500238418579, 0.05000000074505806, 0.05000000074505806], [0.543749988079071, 0.5687500238418579, 0.02500000037252903, 0.02500000037252903], [0.543749988079071, 0.5687500238418579, 0.05000000074505806, 0.05000000074505806], [0.5562499761581421, 0.5687500238418579, 0.02500000037252903, 0.02500000037252903], [0.5562499761581421, 0.5687500238418579, 0.05000000074505806, 0.05000000074505806], [0.5687500238418579, 0.5687500238418579, 0.02500000037252903, 0.02500000037252903], [0.5687500238418579, 0.5687500238418579, 0.05000000074505806, 0.05000000074505806], [0.581250011920929, 0.5687500238418579, 0.02500000037252903, 0.02500000037252903], [0.581250011920929, 0.5687500238418579, 0.05000000074505806, 0.05000000074505806], [0.59375, 0.5687500238418579, 0.02500000037252903, 0.02500000037252903], [0.59375, 0.5687500238418579, 0.05000000074505806, 0.05000000074505806], [0.606249988079071, 0.5687500238418579, 0.02500000037252903, 0.02500000037252903], [0.606249988079071, 0.5687500238418579, 0.05000000074505806, 0.05000000074505806], [0.6187499761581421, 0.5687500238418579, 0.02500000037252903, 0.02500000037252903], [0.6187499761581421, 0.5687500238418579, 0.05000000074505806, 0.05000000074505806], [0.6312500238418579, 0.5687500238418579, 0.02500000037252903, 0.02500000037252903], [0.6312500238418579, 0.5687500238418579, 0.05000000074505806, 0.05000000074505806], [0.643750011920929, 0.5687500238418579, 0.02500000037252903, 0.02500000037252903], [0.643750011920929, 0.5687500238418579, 0.05000000074505806, 0.05000000074505806], [0.65625, 0.5687500238418579, 0.02500000037252903, 0.02500000037252903], [0.65625, 0.5687500238418579, 0.05000000074505806, 0.05000000074505806], [0.668749988079071, 0.5687500238418579, 0.02500000037252903, 0.02500000037252903], [0.668749988079071, 0.5687500238418579, 0.05000000074505806, 0.05000000074505806], [0.6812499761581421, 0.5687500238418579, 0.02500000037252903, 0.02500000037252903], [0.6812499761581421, 0.5687500238418579, 0.05000000074505806, 0.05000000074505806], [0.6937500238418579, 0.5687500238418579, 0.02500000037252903, 0.02500000037252903], [0.6937500238418579, 0.5687500238418579, 0.05000000074505806, 0.05000000074505806], [0.706250011920929, 0.5687500238418579, 0.02500000037252903, 0.02500000037252903], [0.706250011920929, 0.5687500238418579, 0.05000000074505806, 0.05000000074505806], [0.71875, 0.5687500238418579, 0.02500000037252903, 0.02500000037252903], [0.71875, 0.5687500238418579, 0.05000000074505806, 0.05000000074505806], [0.731249988079071, 0.5687500238418579, 0.02500000037252903, 0.02500000037252903], [0.731249988079071, 0.5687500238418579, 0.05000000074505806, 0.05000000074505806], [0.7437499761581421, 0.5687500238418579, 0.02500000037252903, 0.02500000037252903], [0.7437499761581421, 0.5687500238418579, 0.05000000074505806, 0.05000000074505806], [0.7562500238418579, 0.5687500238418579, 0.02500000037252903, 0.02500000037252903], [0.7562500238418579, 0.5687500238418579, 0.05000000074505806, 0.05000000074505806], [0.768750011920929, 0.5687500238418579, 0.02500000037252903, 0.02500000037252903], [0.768750011920929, 0.5687500238418579, 0.05000000074505806, 0.05000000074505806], [0.78125, 0.5687500238418579, 0.02500000037252903, 0.02500000037252903], [0.78125, 0.5687500238418579, 0.05000000074505806, 0.05000000074505806], [0.793749988079071, 0.5687500238418579, 0.02500000037252903, 0.02500000037252903], [0.793749988079071, 0.5687500238418579, 0.05000000074505806, 0.05000000074505806], [0.8062499761581421, 0.5687500238418579, 0.02500000037252903, 0.02500000037252903], [0.8062499761581421, 0.5687500238418579, 0.05000000074505806, 0.05000000074505806], [0.8187500238418579, 0.5687500238418579, 0.02500000037252903, 0.02500000037252903], [0.8187500238418579, 0.5687500238418579, 0.05000000074505806, 0.05000000074505806], [0.831250011920929, 0.5687500238418579, 0.02500000037252903, 0.02500000037252903], [0.831250011920929, 0.5687500238418579, 0.05000000074505806, 0.05000000074505806], [0.84375, 0.5687500238418579, 0.02500000037252903, 0.02500000037252903], [0.84375, 0.5687500238418579, 0.05000000074505806, 0.05000000074505806], [0.856249988079071, 0.5687500238418579, 0.02500000037252903, 0.02500000037252903], [0.856249988079071, 0.5687500238418579, 0.05000000074505806, 0.05000000074505806], [0.8687499761581421, 0.5687500238418579, 0.02500000037252903, 0.02500000037252903], [0.8687499761581421, 0.5687500238418579, 0.05000000074505806, 0.05000000074505806], [0.8812500238418579, 0.5687500238418579, 0.02500000037252903, 0.02500000037252903], [0.8812500238418579, 0.5687500238418579, 0.05000000074505806, 0.05000000074505806], [0.893750011920929, 0.5687500238418579, 0.02500000037252903, 0.02500000037252903], [0.893750011920929, 0.5687500238418579, 0.05000000074505806, 0.05000000074505806], [0.90625, 0.5687500238418579, 0.02500000037252903, 0.02500000037252903], [0.90625, 0.5687500238418579, 0.05000000074505806, 0.05000000074505806], [0.918749988079071, 0.5687500238418579, 0.02500000037252903, 0.02500000037252903], [0.918749988079071, 0.5687500238418579, 0.05000000074505806, 0.05000000074505806], [0.9312499761581421, 0.5687500238418579, 0.02500000037252903, 0.02500000037252903], [0.9312499761581421, 0.5687500238418579, 0.05000000074505806, 0.05000000074505806], [0.9437500238418579, 0.5687500238418579, 0.02500000037252903, 0.02500000037252903], [0.9437500238418579, 0.5687500238418579, 0.05000000074505806, 0.05000000074505806], [0.956250011920929, 0.5687500238418579, 0.02500000037252903, 0.02500000037252903], [0.956250011920929, 0.5687500238418579, 0.05000000074505806, 0.05000000074505806], [0.96875, 0.5687500238418579, 0.02500000037252903, 0.02500000037252903], [0.96875, 0.5687500238418579, 0.05000000074505806, 0.05000000074505806], [0.981249988079071, 0.5687500238418579, 0.02500000037252903, 0.02500000037252903], [0.981249988079071, 0.5687500238418579, 0.05000000074505806, 0.05000000074505806], [0.9937499761581421, 0.5687500238418579, 0.02500000037252903, 0.02500000037252903], [0.9937499761581421, 0.5687500238418579, 0.05000000074505806, 0.05000000074505806], [0.0062500000931322575, 0.581250011920929, 0.02500000037252903, 0.02500000037252903], [0.0062500000931322575, 0.581250011920929, 0.05000000074505806, 0.05000000074505806], [0.01875000074505806, 0.581250011920929, 0.02500000037252903, 0.02500000037252903], [0.01875000074505806, 0.581250011920929, 0.05000000074505806, 0.05000000074505806], [0.03125, 0.581250011920929, 0.02500000037252903, 0.02500000037252903], [0.03125, 0.581250011920929, 0.05000000074505806, 0.05000000074505806], [0.04374999925494194, 0.581250011920929, 0.02500000037252903, 0.02500000037252903], [0.04374999925494194, 0.581250011920929, 0.05000000074505806, 0.05000000074505806], [0.05624999850988388, 0.581250011920929, 0.02500000037252903, 0.02500000037252903], [0.05624999850988388, 0.581250011920929, 0.05000000074505806, 0.05000000074505806], [0.06875000149011612, 0.581250011920929, 0.02500000037252903, 0.02500000037252903], [0.06875000149011612, 0.581250011920929, 0.05000000074505806, 0.05000000074505806], [0.08124999701976776, 0.581250011920929, 0.02500000037252903, 0.02500000037252903], [0.08124999701976776, 0.581250011920929, 0.05000000074505806, 0.05000000074505806], [0.09375, 0.581250011920929, 0.02500000037252903, 0.02500000037252903], [0.09375, 0.581250011920929, 0.05000000074505806, 0.05000000074505806], [0.10625000298023224, 0.581250011920929, 0.02500000037252903, 0.02500000037252903], [0.10625000298023224, 0.581250011920929, 0.05000000074505806, 0.05000000074505806], [0.11874999850988388, 0.581250011920929, 0.02500000037252903, 0.02500000037252903], [0.11874999850988388, 0.581250011920929, 0.05000000074505806, 0.05000000074505806], [0.13124999403953552, 0.581250011920929, 0.02500000037252903, 0.02500000037252903], [0.13124999403953552, 0.581250011920929, 0.05000000074505806, 0.05000000074505806], [0.14374999701976776, 0.581250011920929, 0.02500000037252903, 0.02500000037252903], [0.14374999701976776, 0.581250011920929, 0.05000000074505806, 0.05000000074505806], [0.15625, 0.581250011920929, 0.02500000037252903, 0.02500000037252903], [0.15625, 0.581250011920929, 0.05000000074505806, 0.05000000074505806], [0.16875000298023224, 0.581250011920929, 0.02500000037252903, 0.02500000037252903], [0.16875000298023224, 0.581250011920929, 0.05000000074505806, 0.05000000074505806], [0.18125000596046448, 0.581250011920929, 0.02500000037252903, 0.02500000037252903], [0.18125000596046448, 0.581250011920929, 0.05000000074505806, 0.05000000074505806], [0.19374999403953552, 0.581250011920929, 0.02500000037252903, 0.02500000037252903], [0.19374999403953552, 0.581250011920929, 0.05000000074505806, 0.05000000074505806], [0.20624999701976776, 0.581250011920929, 0.02500000037252903, 0.02500000037252903], [0.20624999701976776, 0.581250011920929, 0.05000000074505806, 0.05000000074505806], [0.21875, 0.581250011920929, 0.02500000037252903, 0.02500000037252903], [0.21875, 0.581250011920929, 0.05000000074505806, 0.05000000074505806], [0.23125000298023224, 0.581250011920929, 0.02500000037252903, 0.02500000037252903], [0.23125000298023224, 0.581250011920929, 0.05000000074505806, 0.05000000074505806], [0.24375000596046448, 0.581250011920929, 0.02500000037252903, 0.02500000037252903], [0.24375000596046448, 0.581250011920929, 0.05000000074505806, 0.05000000074505806], [0.2562499940395355, 0.581250011920929, 0.02500000037252903, 0.02500000037252903], [0.2562499940395355, 0.581250011920929, 0.05000000074505806, 0.05000000074505806], [0.26875001192092896, 0.581250011920929, 0.02500000037252903, 0.02500000037252903], [0.26875001192092896, 0.581250011920929, 0.05000000074505806, 0.05000000074505806], [0.28125, 0.581250011920929, 0.02500000037252903, 0.02500000037252903], [0.28125, 0.581250011920929, 0.05000000074505806, 0.05000000074505806], [0.29374998807907104, 0.581250011920929, 0.02500000037252903, 0.02500000037252903], [0.29374998807907104, 0.581250011920929, 0.05000000074505806, 0.05000000074505806], [0.3062500059604645, 0.581250011920929, 0.02500000037252903, 0.02500000037252903], [0.3062500059604645, 0.581250011920929, 0.05000000074505806, 0.05000000074505806], [0.3187499940395355, 0.581250011920929, 0.02500000037252903, 0.02500000037252903], [0.3187499940395355, 0.581250011920929, 0.05000000074505806, 0.05000000074505806], [0.33125001192092896, 0.581250011920929, 0.02500000037252903, 0.02500000037252903], [0.33125001192092896, 0.581250011920929, 0.05000000074505806, 0.05000000074505806], [0.34375, 0.581250011920929, 0.02500000037252903, 0.02500000037252903], [0.34375, 0.581250011920929, 0.05000000074505806, 0.05000000074505806], [0.35624998807907104, 0.581250011920929, 0.02500000037252903, 0.02500000037252903], [0.35624998807907104, 0.581250011920929, 0.05000000074505806, 0.05000000074505806], [0.3687500059604645, 0.581250011920929, 0.02500000037252903, 0.02500000037252903], [0.3687500059604645, 0.581250011920929, 0.05000000074505806, 0.05000000074505806], [0.3812499940395355, 0.581250011920929, 0.02500000037252903, 0.02500000037252903], [0.3812499940395355, 0.581250011920929, 0.05000000074505806, 0.05000000074505806], [0.39375001192092896, 0.581250011920929, 0.02500000037252903, 0.02500000037252903], [0.39375001192092896, 0.581250011920929, 0.05000000074505806, 0.05000000074505806], [0.40625, 0.581250011920929, 0.02500000037252903, 0.02500000037252903], [0.40625, 0.581250011920929, 0.05000000074505806, 0.05000000074505806], [0.41874998807907104, 0.581250011920929, 0.02500000037252903, 0.02500000037252903], [0.41874998807907104, 0.581250011920929, 0.05000000074505806, 0.05000000074505806], [0.4312500059604645, 0.581250011920929, 0.02500000037252903, 0.02500000037252903], [0.4312500059604645, 0.581250011920929, 0.05000000074505806, 0.05000000074505806], [0.4437499940395355, 0.581250011920929, 0.02500000037252903, 0.02500000037252903], [0.4437499940395355, 0.581250011920929, 0.05000000074505806, 0.05000000074505806], [0.45625001192092896, 0.581250011920929, 0.02500000037252903, 0.02500000037252903], [0.45625001192092896, 0.581250011920929, 0.05000000074505806, 0.05000000074505806], [0.46875, 0.581250011920929, 0.02500000037252903, 0.02500000037252903], [0.46875, 0.581250011920929, 0.05000000074505806, 0.05000000074505806], [0.48124998807907104, 0.581250011920929, 0.02500000037252903, 0.02500000037252903], [0.48124998807907104, 0.581250011920929, 0.05000000074505806, 0.05000000074505806], [0.4937500059604645, 0.581250011920929, 0.02500000037252903, 0.02500000037252903], [0.4937500059604645, 0.581250011920929, 0.05000000074505806, 0.05000000074505806], [0.5062500238418579, 0.581250011920929, 0.02500000037252903, 0.02500000037252903], [0.5062500238418579, 0.581250011920929, 0.05000000074505806, 0.05000000074505806], [0.518750011920929, 0.581250011920929, 0.02500000037252903, 0.02500000037252903], [0.518750011920929, 0.581250011920929, 0.05000000074505806, 0.05000000074505806], [0.53125, 0.581250011920929, 0.02500000037252903, 0.02500000037252903], [0.53125, 0.581250011920929, 0.05000000074505806, 0.05000000074505806], [0.543749988079071, 0.581250011920929, 0.02500000037252903, 0.02500000037252903], [0.543749988079071, 0.581250011920929, 0.05000000074505806, 0.05000000074505806], [0.5562499761581421, 0.581250011920929, 0.02500000037252903, 0.02500000037252903], [0.5562499761581421, 0.581250011920929, 0.05000000074505806, 0.05000000074505806], [0.5687500238418579, 0.581250011920929, 0.02500000037252903, 0.02500000037252903], [0.5687500238418579, 0.581250011920929, 0.05000000074505806, 0.05000000074505806], [0.581250011920929, 0.581250011920929, 0.02500000037252903, 0.02500000037252903], [0.581250011920929, 0.581250011920929, 0.05000000074505806, 0.05000000074505806], [0.59375, 0.581250011920929, 0.02500000037252903, 0.02500000037252903], [0.59375, 0.581250011920929, 0.05000000074505806, 0.05000000074505806], [0.606249988079071, 0.581250011920929, 0.02500000037252903, 0.02500000037252903], [0.606249988079071, 0.581250011920929, 0.05000000074505806, 0.05000000074505806], [0.6187499761581421, 0.581250011920929, 0.02500000037252903, 0.02500000037252903], [0.6187499761581421, 0.581250011920929, 0.05000000074505806, 0.05000000074505806], [0.6312500238418579, 0.581250011920929, 0.02500000037252903, 0.02500000037252903], [0.6312500238418579, 0.581250011920929, 0.05000000074505806, 0.05000000074505806], [0.643750011920929, 0.581250011920929, 0.02500000037252903, 0.02500000037252903], [0.643750011920929, 0.581250011920929, 0.05000000074505806, 0.05000000074505806], [0.65625, 0.581250011920929, 0.02500000037252903, 0.02500000037252903], [0.65625, 0.581250011920929, 0.05000000074505806, 0.05000000074505806], [0.668749988079071, 0.581250011920929, 0.02500000037252903, 0.02500000037252903], [0.668749988079071, 0.581250011920929, 0.05000000074505806, 0.05000000074505806], [0.6812499761581421, 0.581250011920929, 0.02500000037252903, 0.02500000037252903], [0.6812499761581421, 0.581250011920929, 0.05000000074505806, 0.05000000074505806], [0.6937500238418579, 0.581250011920929, 0.02500000037252903, 0.02500000037252903], [0.6937500238418579, 0.581250011920929, 0.05000000074505806, 0.05000000074505806], [0.706250011920929, 0.581250011920929, 0.02500000037252903, 0.02500000037252903], [0.706250011920929, 0.581250011920929, 0.05000000074505806, 0.05000000074505806], [0.71875, 0.581250011920929, 0.02500000037252903, 0.02500000037252903], [0.71875, 0.581250011920929, 0.05000000074505806, 0.05000000074505806], [0.731249988079071, 0.581250011920929, 0.02500000037252903, 0.02500000037252903], [0.731249988079071, 0.581250011920929, 0.05000000074505806, 0.05000000074505806], [0.7437499761581421, 0.581250011920929, 0.02500000037252903, 0.02500000037252903], [0.7437499761581421, 0.581250011920929, 0.05000000074505806, 0.05000000074505806], [0.7562500238418579, 0.581250011920929, 0.02500000037252903, 0.02500000037252903], [0.7562500238418579, 0.581250011920929, 0.05000000074505806, 0.05000000074505806], [0.768750011920929, 0.581250011920929, 0.02500000037252903, 0.02500000037252903], [0.768750011920929, 0.581250011920929, 0.05000000074505806, 0.05000000074505806], [0.78125, 0.581250011920929, 0.02500000037252903, 0.02500000037252903], [0.78125, 0.581250011920929, 0.05000000074505806, 0.05000000074505806], [0.793749988079071, 0.581250011920929, 0.02500000037252903, 0.02500000037252903], [0.793749988079071, 0.581250011920929, 0.05000000074505806, 0.05000000074505806], [0.8062499761581421, 0.581250011920929, 0.02500000037252903, 0.02500000037252903], [0.8062499761581421, 0.581250011920929, 0.05000000074505806, 0.05000000074505806], [0.8187500238418579, 0.581250011920929, 0.02500000037252903, 0.02500000037252903], [0.8187500238418579, 0.581250011920929, 0.05000000074505806, 0.05000000074505806], [0.831250011920929, 0.581250011920929, 0.02500000037252903, 0.02500000037252903], [0.831250011920929, 0.581250011920929, 0.05000000074505806, 0.05000000074505806], [0.84375, 0.581250011920929, 0.02500000037252903, 0.02500000037252903], [0.84375, 0.581250011920929, 0.05000000074505806, 0.05000000074505806], [0.856249988079071, 0.581250011920929, 0.02500000037252903, 0.02500000037252903], [0.856249988079071, 0.581250011920929, 0.05000000074505806, 0.05000000074505806], [0.8687499761581421, 0.581250011920929, 0.02500000037252903, 0.02500000037252903], [0.8687499761581421, 0.581250011920929, 0.05000000074505806, 0.05000000074505806], [0.8812500238418579, 0.581250011920929, 0.02500000037252903, 0.02500000037252903], [0.8812500238418579, 0.581250011920929, 0.05000000074505806, 0.05000000074505806], [0.893750011920929, 0.581250011920929, 0.02500000037252903, 0.02500000037252903], [0.893750011920929, 0.581250011920929, 0.05000000074505806, 0.05000000074505806], [0.90625, 0.581250011920929, 0.02500000037252903, 0.02500000037252903], [0.90625, 0.581250011920929, 0.05000000074505806, 0.05000000074505806], [0.918749988079071, 0.581250011920929, 0.02500000037252903, 0.02500000037252903], [0.918749988079071, 0.581250011920929, 0.05000000074505806, 0.05000000074505806], [0.9312499761581421, 0.581250011920929, 0.02500000037252903, 0.02500000037252903], [0.9312499761581421, 0.581250011920929, 0.05000000074505806, 0.05000000074505806], [0.9437500238418579, 0.581250011920929, 0.02500000037252903, 0.02500000037252903], [0.9437500238418579, 0.581250011920929, 0.05000000074505806, 0.05000000074505806], [0.956250011920929, 0.581250011920929, 0.02500000037252903, 0.02500000037252903], [0.956250011920929, 0.581250011920929, 0.05000000074505806, 0.05000000074505806], [0.96875, 0.581250011920929, 0.02500000037252903, 0.02500000037252903], [0.96875, 0.581250011920929, 0.05000000074505806, 0.05000000074505806], [0.981249988079071, 0.581250011920929, 0.02500000037252903, 0.02500000037252903], [0.981249988079071, 0.581250011920929, 0.05000000074505806, 0.05000000074505806], [0.9937499761581421, 0.581250011920929, 0.02500000037252903, 0.02500000037252903], [0.9937499761581421, 0.581250011920929, 0.05000000074505806, 0.05000000074505806], [0.0062500000931322575, 0.59375, 0.02500000037252903, 0.02500000037252903], [0.0062500000931322575, 0.59375, 0.05000000074505806, 0.05000000074505806], [0.01875000074505806, 0.59375, 0.02500000037252903, 0.02500000037252903], [0.01875000074505806, 0.59375, 0.05000000074505806, 0.05000000074505806], [0.03125, 0.59375, 0.02500000037252903, 0.02500000037252903], [0.03125, 0.59375, 0.05000000074505806, 0.05000000074505806], [0.04374999925494194, 0.59375, 0.02500000037252903, 0.02500000037252903], [0.04374999925494194, 0.59375, 0.05000000074505806, 0.05000000074505806], [0.05624999850988388, 0.59375, 0.02500000037252903, 0.02500000037252903], [0.05624999850988388, 0.59375, 0.05000000074505806, 0.05000000074505806], [0.06875000149011612, 0.59375, 0.02500000037252903, 0.02500000037252903], [0.06875000149011612, 0.59375, 0.05000000074505806, 0.05000000074505806], [0.08124999701976776, 0.59375, 0.02500000037252903, 0.02500000037252903], [0.08124999701976776, 0.59375, 0.05000000074505806, 0.05000000074505806], [0.09375, 0.59375, 0.02500000037252903, 0.02500000037252903], [0.09375, 0.59375, 0.05000000074505806, 0.05000000074505806], [0.10625000298023224, 0.59375, 0.02500000037252903, 0.02500000037252903], [0.10625000298023224, 0.59375, 0.05000000074505806, 0.05000000074505806], [0.11874999850988388, 0.59375, 0.02500000037252903, 0.02500000037252903], [0.11874999850988388, 0.59375, 0.05000000074505806, 0.05000000074505806], [0.13124999403953552, 0.59375, 0.02500000037252903, 0.02500000037252903], [0.13124999403953552, 0.59375, 0.05000000074505806, 0.05000000074505806], [0.14374999701976776, 0.59375, 0.02500000037252903, 0.02500000037252903], [0.14374999701976776, 0.59375, 0.05000000074505806, 0.05000000074505806], [0.15625, 0.59375, 0.02500000037252903, 0.02500000037252903], [0.15625, 0.59375, 0.05000000074505806, 0.05000000074505806], [0.16875000298023224, 0.59375, 0.02500000037252903, 0.02500000037252903], [0.16875000298023224, 0.59375, 0.05000000074505806, 0.05000000074505806], [0.18125000596046448, 0.59375, 0.02500000037252903, 0.02500000037252903], [0.18125000596046448, 0.59375, 0.05000000074505806, 0.05000000074505806], [0.19374999403953552, 0.59375, 0.02500000037252903, 0.02500000037252903], [0.19374999403953552, 0.59375, 0.05000000074505806, 0.05000000074505806], [0.20624999701976776, 0.59375, 0.02500000037252903, 0.02500000037252903], [0.20624999701976776, 0.59375, 0.05000000074505806, 0.05000000074505806], [0.21875, 0.59375, 0.02500000037252903, 0.02500000037252903], [0.21875, 0.59375, 0.05000000074505806, 0.05000000074505806], [0.23125000298023224, 0.59375, 0.02500000037252903, 0.02500000037252903], [0.23125000298023224, 0.59375, 0.05000000074505806, 0.05000000074505806], [0.24375000596046448, 0.59375, 0.02500000037252903, 0.02500000037252903], [0.24375000596046448, 0.59375, 0.05000000074505806, 0.05000000074505806], [0.2562499940395355, 0.59375, 0.02500000037252903, 0.02500000037252903], [0.2562499940395355, 0.59375, 0.05000000074505806, 0.05000000074505806], [0.26875001192092896, 0.59375, 0.02500000037252903, 0.02500000037252903], [0.26875001192092896, 0.59375, 0.05000000074505806, 0.05000000074505806], [0.28125, 0.59375, 0.02500000037252903, 0.02500000037252903], [0.28125, 0.59375, 0.05000000074505806, 0.05000000074505806], [0.29374998807907104, 0.59375, 0.02500000037252903, 0.02500000037252903], [0.29374998807907104, 0.59375, 0.05000000074505806, 0.05000000074505806], [0.3062500059604645, 0.59375, 0.02500000037252903, 0.02500000037252903], [0.3062500059604645, 0.59375, 0.05000000074505806, 0.05000000074505806], [0.3187499940395355, 0.59375, 0.02500000037252903, 0.02500000037252903], [0.3187499940395355, 0.59375, 0.05000000074505806, 0.05000000074505806], [0.33125001192092896, 0.59375, 0.02500000037252903, 0.02500000037252903], [0.33125001192092896, 0.59375, 0.05000000074505806, 0.05000000074505806], [0.34375, 0.59375, 0.02500000037252903, 0.02500000037252903], [0.34375, 0.59375, 0.05000000074505806, 0.05000000074505806], [0.35624998807907104, 0.59375, 0.02500000037252903, 0.02500000037252903], [0.35624998807907104, 0.59375, 0.05000000074505806, 0.05000000074505806], [0.3687500059604645, 0.59375, 0.02500000037252903, 0.02500000037252903], [0.3687500059604645, 0.59375, 0.05000000074505806, 0.05000000074505806], [0.3812499940395355, 0.59375, 0.02500000037252903, 0.02500000037252903], [0.3812499940395355, 0.59375, 0.05000000074505806, 0.05000000074505806], [0.39375001192092896, 0.59375, 0.02500000037252903, 0.02500000037252903], [0.39375001192092896, 0.59375, 0.05000000074505806, 0.05000000074505806], [0.40625, 0.59375, 0.02500000037252903, 0.02500000037252903], [0.40625, 0.59375, 0.05000000074505806, 0.05000000074505806], [0.41874998807907104, 0.59375, 0.02500000037252903, 0.02500000037252903], [0.41874998807907104, 0.59375, 0.05000000074505806, 0.05000000074505806], [0.4312500059604645, 0.59375, 0.02500000037252903, 0.02500000037252903], [0.4312500059604645, 0.59375, 0.05000000074505806, 0.05000000074505806], [0.4437499940395355, 0.59375, 0.02500000037252903, 0.02500000037252903], [0.4437499940395355, 0.59375, 0.05000000074505806, 0.05000000074505806], [0.45625001192092896, 0.59375, 0.02500000037252903, 0.02500000037252903], [0.45625001192092896, 0.59375, 0.05000000074505806, 0.05000000074505806], [0.46875, 0.59375, 0.02500000037252903, 0.02500000037252903], [0.46875, 0.59375, 0.05000000074505806, 0.05000000074505806], [0.48124998807907104, 0.59375, 0.02500000037252903, 0.02500000037252903], [0.48124998807907104, 0.59375, 0.05000000074505806, 0.05000000074505806], [0.4937500059604645, 0.59375, 0.02500000037252903, 0.02500000037252903], [0.4937500059604645, 0.59375, 0.05000000074505806, 0.05000000074505806], [0.5062500238418579, 0.59375, 0.02500000037252903, 0.02500000037252903], [0.5062500238418579, 0.59375, 0.05000000074505806, 0.05000000074505806], [0.518750011920929, 0.59375, 0.02500000037252903, 0.02500000037252903], [0.518750011920929, 0.59375, 0.05000000074505806, 0.05000000074505806], [0.53125, 0.59375, 0.02500000037252903, 0.02500000037252903], [0.53125, 0.59375, 0.05000000074505806, 0.05000000074505806], [0.543749988079071, 0.59375, 0.02500000037252903, 0.02500000037252903], [0.543749988079071, 0.59375, 0.05000000074505806, 0.05000000074505806], [0.5562499761581421, 0.59375, 0.02500000037252903, 0.02500000037252903], [0.5562499761581421, 0.59375, 0.05000000074505806, 0.05000000074505806], [0.5687500238418579, 0.59375, 0.02500000037252903, 0.02500000037252903], [0.5687500238418579, 0.59375, 0.05000000074505806, 0.05000000074505806], [0.581250011920929, 0.59375, 0.02500000037252903, 0.02500000037252903], [0.581250011920929, 0.59375, 0.05000000074505806, 0.05000000074505806], [0.59375, 0.59375, 0.02500000037252903, 0.02500000037252903], [0.59375, 0.59375, 0.05000000074505806, 0.05000000074505806], [0.606249988079071, 0.59375, 0.02500000037252903, 0.02500000037252903], [0.606249988079071, 0.59375, 0.05000000074505806, 0.05000000074505806], [0.6187499761581421, 0.59375, 0.02500000037252903, 0.02500000037252903], [0.6187499761581421, 0.59375, 0.05000000074505806, 0.05000000074505806], [0.6312500238418579, 0.59375, 0.02500000037252903, 0.02500000037252903], [0.6312500238418579, 0.59375, 0.05000000074505806, 0.05000000074505806], [0.643750011920929, 0.59375, 0.02500000037252903, 0.02500000037252903], [0.643750011920929, 0.59375, 0.05000000074505806, 0.05000000074505806], [0.65625, 0.59375, 0.02500000037252903, 0.02500000037252903], [0.65625, 0.59375, 0.05000000074505806, 0.05000000074505806], [0.668749988079071, 0.59375, 0.02500000037252903, 0.02500000037252903], [0.668749988079071, 0.59375, 0.05000000074505806, 0.05000000074505806], [0.6812499761581421, 0.59375, 0.02500000037252903, 0.02500000037252903], [0.6812499761581421, 0.59375, 0.05000000074505806, 0.05000000074505806], [0.6937500238418579, 0.59375, 0.02500000037252903, 0.02500000037252903], [0.6937500238418579, 0.59375, 0.05000000074505806, 0.05000000074505806], [0.706250011920929, 0.59375, 0.02500000037252903, 0.02500000037252903], [0.706250011920929, 0.59375, 0.05000000074505806, 0.05000000074505806], [0.71875, 0.59375, 0.02500000037252903, 0.02500000037252903], [0.71875, 0.59375, 0.05000000074505806, 0.05000000074505806], [0.731249988079071, 0.59375, 0.02500000037252903, 0.02500000037252903], [0.731249988079071, 0.59375, 0.05000000074505806, 0.05000000074505806], [0.7437499761581421, 0.59375, 0.02500000037252903, 0.02500000037252903], [0.7437499761581421, 0.59375, 0.05000000074505806, 0.05000000074505806], [0.7562500238418579, 0.59375, 0.02500000037252903, 0.02500000037252903], [0.7562500238418579, 0.59375, 0.05000000074505806, 0.05000000074505806], [0.768750011920929, 0.59375, 0.02500000037252903, 0.02500000037252903], [0.768750011920929, 0.59375, 0.05000000074505806, 0.05000000074505806], [0.78125, 0.59375, 0.02500000037252903, 0.02500000037252903], [0.78125, 0.59375, 0.05000000074505806, 0.05000000074505806], [0.793749988079071, 0.59375, 0.02500000037252903, 0.02500000037252903], [0.793749988079071, 0.59375, 0.05000000074505806, 0.05000000074505806], [0.8062499761581421, 0.59375, 0.02500000037252903, 0.02500000037252903], [0.8062499761581421, 0.59375, 0.05000000074505806, 0.05000000074505806], [0.8187500238418579, 0.59375, 0.02500000037252903, 0.02500000037252903], [0.8187500238418579, 0.59375, 0.05000000074505806, 0.05000000074505806], [0.831250011920929, 0.59375, 0.02500000037252903, 0.02500000037252903], [0.831250011920929, 0.59375, 0.05000000074505806, 0.05000000074505806], [0.84375, 0.59375, 0.02500000037252903, 0.02500000037252903], [0.84375, 0.59375, 0.05000000074505806, 0.05000000074505806], [0.856249988079071, 0.59375, 0.02500000037252903, 0.02500000037252903], [0.856249988079071, 0.59375, 0.05000000074505806, 0.05000000074505806], [0.8687499761581421, 0.59375, 0.02500000037252903, 0.02500000037252903], [0.8687499761581421, 0.59375, 0.05000000074505806, 0.05000000074505806], [0.8812500238418579, 0.59375, 0.02500000037252903, 0.02500000037252903], [0.8812500238418579, 0.59375, 0.05000000074505806, 0.05000000074505806], [0.893750011920929, 0.59375, 0.02500000037252903, 0.02500000037252903], [0.893750011920929, 0.59375, 0.05000000074505806, 0.05000000074505806], [0.90625, 0.59375, 0.02500000037252903, 0.02500000037252903], [0.90625, 0.59375, 0.05000000074505806, 0.05000000074505806], [0.918749988079071, 0.59375, 0.02500000037252903, 0.02500000037252903], [0.918749988079071, 0.59375, 0.05000000074505806, 0.05000000074505806], [0.9312499761581421, 0.59375, 0.02500000037252903, 0.02500000037252903], [0.9312499761581421, 0.59375, 0.05000000074505806, 0.05000000074505806], [0.9437500238418579, 0.59375, 0.02500000037252903, 0.02500000037252903], [0.9437500238418579, 0.59375, 0.05000000074505806, 0.05000000074505806], [0.956250011920929, 0.59375, 0.02500000037252903, 0.02500000037252903], [0.956250011920929, 0.59375, 0.05000000074505806, 0.05000000074505806], [0.96875, 0.59375, 0.02500000037252903, 0.02500000037252903], [0.96875, 0.59375, 0.05000000074505806, 0.05000000074505806], [0.981249988079071, 0.59375, 0.02500000037252903, 0.02500000037252903], [0.981249988079071, 0.59375, 0.05000000074505806, 0.05000000074505806], [0.9937499761581421, 0.59375, 0.02500000037252903, 0.02500000037252903], [0.9937499761581421, 0.59375, 0.05000000074505806, 0.05000000074505806], [0.0062500000931322575, 0.606249988079071, 0.02500000037252903, 0.02500000037252903], [0.0062500000931322575, 0.606249988079071, 0.05000000074505806, 0.05000000074505806], [0.01875000074505806, 0.606249988079071, 0.02500000037252903, 0.02500000037252903], [0.01875000074505806, 0.606249988079071, 0.05000000074505806, 0.05000000074505806], [0.03125, 0.606249988079071, 0.02500000037252903, 0.02500000037252903], [0.03125, 0.606249988079071, 0.05000000074505806, 0.05000000074505806], [0.04374999925494194, 0.606249988079071, 0.02500000037252903, 0.02500000037252903], [0.04374999925494194, 0.606249988079071, 0.05000000074505806, 0.05000000074505806], [0.05624999850988388, 0.606249988079071, 0.02500000037252903, 0.02500000037252903], [0.05624999850988388, 0.606249988079071, 0.05000000074505806, 0.05000000074505806], [0.06875000149011612, 0.606249988079071, 0.02500000037252903, 0.02500000037252903], [0.06875000149011612, 0.606249988079071, 0.05000000074505806, 0.05000000074505806], [0.08124999701976776, 0.606249988079071, 0.02500000037252903, 0.02500000037252903], [0.08124999701976776, 0.606249988079071, 0.05000000074505806, 0.05000000074505806], [0.09375, 0.606249988079071, 0.02500000037252903, 0.02500000037252903], [0.09375, 0.606249988079071, 0.05000000074505806, 0.05000000074505806], [0.10625000298023224, 0.606249988079071, 0.02500000037252903, 0.02500000037252903], [0.10625000298023224, 0.606249988079071, 0.05000000074505806, 0.05000000074505806], [0.11874999850988388, 0.606249988079071, 0.02500000037252903, 0.02500000037252903], [0.11874999850988388, 0.606249988079071, 0.05000000074505806, 0.05000000074505806], [0.13124999403953552, 0.606249988079071, 0.02500000037252903, 0.02500000037252903], [0.13124999403953552, 0.606249988079071, 0.05000000074505806, 0.05000000074505806], [0.14374999701976776, 0.606249988079071, 0.02500000037252903, 0.02500000037252903], [0.14374999701976776, 0.606249988079071, 0.05000000074505806, 0.05000000074505806], [0.15625, 0.606249988079071, 0.02500000037252903, 0.02500000037252903], [0.15625, 0.606249988079071, 0.05000000074505806, 0.05000000074505806], [0.16875000298023224, 0.606249988079071, 0.02500000037252903, 0.02500000037252903], [0.16875000298023224, 0.606249988079071, 0.05000000074505806, 0.05000000074505806], [0.18125000596046448, 0.606249988079071, 0.02500000037252903, 0.02500000037252903], [0.18125000596046448, 0.606249988079071, 0.05000000074505806, 0.05000000074505806], [0.19374999403953552, 0.606249988079071, 0.02500000037252903, 0.02500000037252903], [0.19374999403953552, 0.606249988079071, 0.05000000074505806, 0.05000000074505806], [0.20624999701976776, 0.606249988079071, 0.02500000037252903, 0.02500000037252903], [0.20624999701976776, 0.606249988079071, 0.05000000074505806, 0.05000000074505806], [0.21875, 0.606249988079071, 0.02500000037252903, 0.02500000037252903], [0.21875, 0.606249988079071, 0.05000000074505806, 0.05000000074505806], [0.23125000298023224, 0.606249988079071, 0.02500000037252903, 0.02500000037252903], [0.23125000298023224, 0.606249988079071, 0.05000000074505806, 0.05000000074505806], [0.24375000596046448, 0.606249988079071, 0.02500000037252903, 0.02500000037252903], [0.24375000596046448, 0.606249988079071, 0.05000000074505806, 0.05000000074505806], [0.2562499940395355, 0.606249988079071, 0.02500000037252903, 0.02500000037252903], [0.2562499940395355, 0.606249988079071, 0.05000000074505806, 0.05000000074505806], [0.26875001192092896, 0.606249988079071, 0.02500000037252903, 0.02500000037252903], [0.26875001192092896, 0.606249988079071, 0.05000000074505806, 0.05000000074505806], [0.28125, 0.606249988079071, 0.02500000037252903, 0.02500000037252903], [0.28125, 0.606249988079071, 0.05000000074505806, 0.05000000074505806], [0.29374998807907104, 0.606249988079071, 0.02500000037252903, 0.02500000037252903], [0.29374998807907104, 0.606249988079071, 0.05000000074505806, 0.05000000074505806], [0.3062500059604645, 0.606249988079071, 0.02500000037252903, 0.02500000037252903], [0.3062500059604645, 0.606249988079071, 0.05000000074505806, 0.05000000074505806], [0.3187499940395355, 0.606249988079071, 0.02500000037252903, 0.02500000037252903], [0.3187499940395355, 0.606249988079071, 0.05000000074505806, 0.05000000074505806], [0.33125001192092896, 0.606249988079071, 0.02500000037252903, 0.02500000037252903], [0.33125001192092896, 0.606249988079071, 0.05000000074505806, 0.05000000074505806], [0.34375, 0.606249988079071, 0.02500000037252903, 0.02500000037252903], [0.34375, 0.606249988079071, 0.05000000074505806, 0.05000000074505806], [0.35624998807907104, 0.606249988079071, 0.02500000037252903, 0.02500000037252903], [0.35624998807907104, 0.606249988079071, 0.05000000074505806, 0.05000000074505806], [0.3687500059604645, 0.606249988079071, 0.02500000037252903, 0.02500000037252903], [0.3687500059604645, 0.606249988079071, 0.05000000074505806, 0.05000000074505806], [0.3812499940395355, 0.606249988079071, 0.02500000037252903, 0.02500000037252903], [0.3812499940395355, 0.606249988079071, 0.05000000074505806, 0.05000000074505806], [0.39375001192092896, 0.606249988079071, 0.02500000037252903, 0.02500000037252903], [0.39375001192092896, 0.606249988079071, 0.05000000074505806, 0.05000000074505806], [0.40625, 0.606249988079071, 0.02500000037252903, 0.02500000037252903], [0.40625, 0.606249988079071, 0.05000000074505806, 0.05000000074505806], [0.41874998807907104, 0.606249988079071, 0.02500000037252903, 0.02500000037252903], [0.41874998807907104, 0.606249988079071, 0.05000000074505806, 0.05000000074505806], [0.4312500059604645, 0.606249988079071, 0.02500000037252903, 0.02500000037252903], [0.4312500059604645, 0.606249988079071, 0.05000000074505806, 0.05000000074505806], [0.4437499940395355, 0.606249988079071, 0.02500000037252903, 0.02500000037252903], [0.4437499940395355, 0.606249988079071, 0.05000000074505806, 0.05000000074505806], [0.45625001192092896, 0.606249988079071, 0.02500000037252903, 0.02500000037252903], [0.45625001192092896, 0.606249988079071, 0.05000000074505806, 0.05000000074505806], [0.46875, 0.606249988079071, 0.02500000037252903, 0.02500000037252903], [0.46875, 0.606249988079071, 0.05000000074505806, 0.05000000074505806], [0.48124998807907104, 0.606249988079071, 0.02500000037252903, 0.02500000037252903], [0.48124998807907104, 0.606249988079071, 0.05000000074505806, 0.05000000074505806], [0.4937500059604645, 0.606249988079071, 0.02500000037252903, 0.02500000037252903], [0.4937500059604645, 0.606249988079071, 0.05000000074505806, 0.05000000074505806], [0.5062500238418579, 0.606249988079071, 0.02500000037252903, 0.02500000037252903], [0.5062500238418579, 0.606249988079071, 0.05000000074505806, 0.05000000074505806], [0.518750011920929, 0.606249988079071, 0.02500000037252903, 0.02500000037252903], [0.518750011920929, 0.606249988079071, 0.05000000074505806, 0.05000000074505806], [0.53125, 0.606249988079071, 0.02500000037252903, 0.02500000037252903], [0.53125, 0.606249988079071, 0.05000000074505806, 0.05000000074505806], [0.543749988079071, 0.606249988079071, 0.02500000037252903, 0.02500000037252903], [0.543749988079071, 0.606249988079071, 0.05000000074505806, 0.05000000074505806], [0.5562499761581421, 0.606249988079071, 0.02500000037252903, 0.02500000037252903], [0.5562499761581421, 0.606249988079071, 0.05000000074505806, 0.05000000074505806], [0.5687500238418579, 0.606249988079071, 0.02500000037252903, 0.02500000037252903], [0.5687500238418579, 0.606249988079071, 0.05000000074505806, 0.05000000074505806], [0.581250011920929, 0.606249988079071, 0.02500000037252903, 0.02500000037252903], [0.581250011920929, 0.606249988079071, 0.05000000074505806, 0.05000000074505806], [0.59375, 0.606249988079071, 0.02500000037252903, 0.02500000037252903], [0.59375, 0.606249988079071, 0.05000000074505806, 0.05000000074505806], [0.606249988079071, 0.606249988079071, 0.02500000037252903, 0.02500000037252903], [0.606249988079071, 0.606249988079071, 0.05000000074505806, 0.05000000074505806], [0.6187499761581421, 0.606249988079071, 0.02500000037252903, 0.02500000037252903], [0.6187499761581421, 0.606249988079071, 0.05000000074505806, 0.05000000074505806], [0.6312500238418579, 0.606249988079071, 0.02500000037252903, 0.02500000037252903], [0.6312500238418579, 0.606249988079071, 0.05000000074505806, 0.05000000074505806], [0.643750011920929, 0.606249988079071, 0.02500000037252903, 0.02500000037252903], [0.643750011920929, 0.606249988079071, 0.05000000074505806, 0.05000000074505806], [0.65625, 0.606249988079071, 0.02500000037252903, 0.02500000037252903], [0.65625, 0.606249988079071, 0.05000000074505806, 0.05000000074505806], [0.668749988079071, 0.606249988079071, 0.02500000037252903, 0.02500000037252903], [0.668749988079071, 0.606249988079071, 0.05000000074505806, 0.05000000074505806], [0.6812499761581421, 0.606249988079071, 0.02500000037252903, 0.02500000037252903], [0.6812499761581421, 0.606249988079071, 0.05000000074505806, 0.05000000074505806], [0.6937500238418579, 0.606249988079071, 0.02500000037252903, 0.02500000037252903], [0.6937500238418579, 0.606249988079071, 0.05000000074505806, 0.05000000074505806], [0.706250011920929, 0.606249988079071, 0.02500000037252903, 0.02500000037252903], [0.706250011920929, 0.606249988079071, 0.05000000074505806, 0.05000000074505806], [0.71875, 0.606249988079071, 0.02500000037252903, 0.02500000037252903], [0.71875, 0.606249988079071, 0.05000000074505806, 0.05000000074505806], [0.731249988079071, 0.606249988079071, 0.02500000037252903, 0.02500000037252903], [0.731249988079071, 0.606249988079071, 0.05000000074505806, 0.05000000074505806], [0.7437499761581421, 0.606249988079071, 0.02500000037252903, 0.02500000037252903], [0.7437499761581421, 0.606249988079071, 0.05000000074505806, 0.05000000074505806], [0.7562500238418579, 0.606249988079071, 0.02500000037252903, 0.02500000037252903], [0.7562500238418579, 0.606249988079071, 0.05000000074505806, 0.05000000074505806], [0.768750011920929, 0.606249988079071, 0.02500000037252903, 0.02500000037252903], [0.768750011920929, 0.606249988079071, 0.05000000074505806, 0.05000000074505806], [0.78125, 0.606249988079071, 0.02500000037252903, 0.02500000037252903], [0.78125, 0.606249988079071, 0.05000000074505806, 0.05000000074505806], [0.793749988079071, 0.606249988079071, 0.02500000037252903, 0.02500000037252903], [0.793749988079071, 0.606249988079071, 0.05000000074505806, 0.05000000074505806], [0.8062499761581421, 0.606249988079071, 0.02500000037252903, 0.02500000037252903], [0.8062499761581421, 0.606249988079071, 0.05000000074505806, 0.05000000074505806], [0.8187500238418579, 0.606249988079071, 0.02500000037252903, 0.02500000037252903], [0.8187500238418579, 0.606249988079071, 0.05000000074505806, 0.05000000074505806], [0.831250011920929, 0.606249988079071, 0.02500000037252903, 0.02500000037252903], [0.831250011920929, 0.606249988079071, 0.05000000074505806, 0.05000000074505806], [0.84375, 0.606249988079071, 0.02500000037252903, 0.02500000037252903], [0.84375, 0.606249988079071, 0.05000000074505806, 0.05000000074505806], [0.856249988079071, 0.606249988079071, 0.02500000037252903, 0.02500000037252903], [0.856249988079071, 0.606249988079071, 0.05000000074505806, 0.05000000074505806], [0.8687499761581421, 0.606249988079071, 0.02500000037252903, 0.02500000037252903], [0.8687499761581421, 0.606249988079071, 0.05000000074505806, 0.05000000074505806], [0.8812500238418579, 0.606249988079071, 0.02500000037252903, 0.02500000037252903], [0.8812500238418579, 0.606249988079071, 0.05000000074505806, 0.05000000074505806], [0.893750011920929, 0.606249988079071, 0.02500000037252903, 0.02500000037252903], [0.893750011920929, 0.606249988079071, 0.05000000074505806, 0.05000000074505806], [0.90625, 0.606249988079071, 0.02500000037252903, 0.02500000037252903], [0.90625, 0.606249988079071, 0.05000000074505806, 0.05000000074505806], [0.918749988079071, 0.606249988079071, 0.02500000037252903, 0.02500000037252903], [0.918749988079071, 0.606249988079071, 0.05000000074505806, 0.05000000074505806], [0.9312499761581421, 0.606249988079071, 0.02500000037252903, 0.02500000037252903], [0.9312499761581421, 0.606249988079071, 0.05000000074505806, 0.05000000074505806], [0.9437500238418579, 0.606249988079071, 0.02500000037252903, 0.02500000037252903], [0.9437500238418579, 0.606249988079071, 0.05000000074505806, 0.05000000074505806], [0.956250011920929, 0.606249988079071, 0.02500000037252903, 0.02500000037252903], [0.956250011920929, 0.606249988079071, 0.05000000074505806, 0.05000000074505806], [0.96875, 0.606249988079071, 0.02500000037252903, 0.02500000037252903], [0.96875, 0.606249988079071, 0.05000000074505806, 0.05000000074505806], [0.981249988079071, 0.606249988079071, 0.02500000037252903, 0.02500000037252903], [0.981249988079071, 0.606249988079071, 0.05000000074505806, 0.05000000074505806], [0.9937499761581421, 0.606249988079071, 0.02500000037252903, 0.02500000037252903], [0.9937499761581421, 0.606249988079071, 0.05000000074505806, 0.05000000074505806], [0.0062500000931322575, 0.6187499761581421, 0.02500000037252903, 0.02500000037252903], [0.0062500000931322575, 0.6187499761581421, 0.05000000074505806, 0.05000000074505806], [0.01875000074505806, 0.6187499761581421, 0.02500000037252903, 0.02500000037252903], [0.01875000074505806, 0.6187499761581421, 0.05000000074505806, 0.05000000074505806], [0.03125, 0.6187499761581421, 0.02500000037252903, 0.02500000037252903], [0.03125, 0.6187499761581421, 0.05000000074505806, 0.05000000074505806], [0.04374999925494194, 0.6187499761581421, 0.02500000037252903, 0.02500000037252903], [0.04374999925494194, 0.6187499761581421, 0.05000000074505806, 0.05000000074505806], [0.05624999850988388, 0.6187499761581421, 0.02500000037252903, 0.02500000037252903], [0.05624999850988388, 0.6187499761581421, 0.05000000074505806, 0.05000000074505806], [0.06875000149011612, 0.6187499761581421, 0.02500000037252903, 0.02500000037252903], [0.06875000149011612, 0.6187499761581421, 0.05000000074505806, 0.05000000074505806], [0.08124999701976776, 0.6187499761581421, 0.02500000037252903, 0.02500000037252903], [0.08124999701976776, 0.6187499761581421, 0.05000000074505806, 0.05000000074505806], [0.09375, 0.6187499761581421, 0.02500000037252903, 0.02500000037252903], [0.09375, 0.6187499761581421, 0.05000000074505806, 0.05000000074505806], [0.10625000298023224, 0.6187499761581421, 0.02500000037252903, 0.02500000037252903], [0.10625000298023224, 0.6187499761581421, 0.05000000074505806, 0.05000000074505806], [0.11874999850988388, 0.6187499761581421, 0.02500000037252903, 0.02500000037252903], [0.11874999850988388, 0.6187499761581421, 0.05000000074505806, 0.05000000074505806], [0.13124999403953552, 0.6187499761581421, 0.02500000037252903, 0.02500000037252903], [0.13124999403953552, 0.6187499761581421, 0.05000000074505806, 0.05000000074505806], [0.14374999701976776, 0.6187499761581421, 0.02500000037252903, 0.02500000037252903], [0.14374999701976776, 0.6187499761581421, 0.05000000074505806, 0.05000000074505806], [0.15625, 0.6187499761581421, 0.02500000037252903, 0.02500000037252903], [0.15625, 0.6187499761581421, 0.05000000074505806, 0.05000000074505806], [0.16875000298023224, 0.6187499761581421, 0.02500000037252903, 0.02500000037252903], [0.16875000298023224, 0.6187499761581421, 0.05000000074505806, 0.05000000074505806], [0.18125000596046448, 0.6187499761581421, 0.02500000037252903, 0.02500000037252903], [0.18125000596046448, 0.6187499761581421, 0.05000000074505806, 0.05000000074505806], [0.19374999403953552, 0.6187499761581421, 0.02500000037252903, 0.02500000037252903], [0.19374999403953552, 0.6187499761581421, 0.05000000074505806, 0.05000000074505806], [0.20624999701976776, 0.6187499761581421, 0.02500000037252903, 0.02500000037252903], [0.20624999701976776, 0.6187499761581421, 0.05000000074505806, 0.05000000074505806], [0.21875, 0.6187499761581421, 0.02500000037252903, 0.02500000037252903], [0.21875, 0.6187499761581421, 0.05000000074505806, 0.05000000074505806], [0.23125000298023224, 0.6187499761581421, 0.02500000037252903, 0.02500000037252903], [0.23125000298023224, 0.6187499761581421, 0.05000000074505806, 0.05000000074505806], [0.24375000596046448, 0.6187499761581421, 0.02500000037252903, 0.02500000037252903], [0.24375000596046448, 0.6187499761581421, 0.05000000074505806, 0.05000000074505806], [0.2562499940395355, 0.6187499761581421, 0.02500000037252903, 0.02500000037252903], [0.2562499940395355, 0.6187499761581421, 0.05000000074505806, 0.05000000074505806], [0.26875001192092896, 0.6187499761581421, 0.02500000037252903, 0.02500000037252903], [0.26875001192092896, 0.6187499761581421, 0.05000000074505806, 0.05000000074505806], [0.28125, 0.6187499761581421, 0.02500000037252903, 0.02500000037252903], [0.28125, 0.6187499761581421, 0.05000000074505806, 0.05000000074505806], [0.29374998807907104, 0.6187499761581421, 0.02500000037252903, 0.02500000037252903], [0.29374998807907104, 0.6187499761581421, 0.05000000074505806, 0.05000000074505806], [0.3062500059604645, 0.6187499761581421, 0.02500000037252903, 0.02500000037252903], [0.3062500059604645, 0.6187499761581421, 0.05000000074505806, 0.05000000074505806], [0.3187499940395355, 0.6187499761581421, 0.02500000037252903, 0.02500000037252903], [0.3187499940395355, 0.6187499761581421, 0.05000000074505806, 0.05000000074505806], [0.33125001192092896, 0.6187499761581421, 0.02500000037252903, 0.02500000037252903], [0.33125001192092896, 0.6187499761581421, 0.05000000074505806, 0.05000000074505806], [0.34375, 0.6187499761581421, 0.02500000037252903, 0.02500000037252903], [0.34375, 0.6187499761581421, 0.05000000074505806, 0.05000000074505806], [0.35624998807907104, 0.6187499761581421, 0.02500000037252903, 0.02500000037252903], [0.35624998807907104, 0.6187499761581421, 0.05000000074505806, 0.05000000074505806], [0.3687500059604645, 0.6187499761581421, 0.02500000037252903, 0.02500000037252903], [0.3687500059604645, 0.6187499761581421, 0.05000000074505806, 0.05000000074505806], [0.3812499940395355, 0.6187499761581421, 0.02500000037252903, 0.02500000037252903], [0.3812499940395355, 0.6187499761581421, 0.05000000074505806, 0.05000000074505806], [0.39375001192092896, 0.6187499761581421, 0.02500000037252903, 0.02500000037252903], [0.39375001192092896, 0.6187499761581421, 0.05000000074505806, 0.05000000074505806], [0.40625, 0.6187499761581421, 0.02500000037252903, 0.02500000037252903], [0.40625, 0.6187499761581421, 0.05000000074505806, 0.05000000074505806], [0.41874998807907104, 0.6187499761581421, 0.02500000037252903, 0.02500000037252903], [0.41874998807907104, 0.6187499761581421, 0.05000000074505806, 0.05000000074505806], [0.4312500059604645, 0.6187499761581421, 0.02500000037252903, 0.02500000037252903], [0.4312500059604645, 0.6187499761581421, 0.05000000074505806, 0.05000000074505806], [0.4437499940395355, 0.6187499761581421, 0.02500000037252903, 0.02500000037252903], [0.4437499940395355, 0.6187499761581421, 0.05000000074505806, 0.05000000074505806], [0.45625001192092896, 0.6187499761581421, 0.02500000037252903, 0.02500000037252903], [0.45625001192092896, 0.6187499761581421, 0.05000000074505806, 0.05000000074505806], [0.46875, 0.6187499761581421, 0.02500000037252903, 0.02500000037252903], [0.46875, 0.6187499761581421, 0.05000000074505806, 0.05000000074505806], [0.48124998807907104, 0.6187499761581421, 0.02500000037252903, 0.02500000037252903], [0.48124998807907104, 0.6187499761581421, 0.05000000074505806, 0.05000000074505806], [0.4937500059604645, 0.6187499761581421, 0.02500000037252903, 0.02500000037252903], [0.4937500059604645, 0.6187499761581421, 0.05000000074505806, 0.05000000074505806], [0.5062500238418579, 0.6187499761581421, 0.02500000037252903, 0.02500000037252903], [0.5062500238418579, 0.6187499761581421, 0.05000000074505806, 0.05000000074505806], [0.518750011920929, 0.6187499761581421, 0.02500000037252903, 0.02500000037252903], [0.518750011920929, 0.6187499761581421, 0.05000000074505806, 0.05000000074505806], [0.53125, 0.6187499761581421, 0.02500000037252903, 0.02500000037252903], [0.53125, 0.6187499761581421, 0.05000000074505806, 0.05000000074505806], [0.543749988079071, 0.6187499761581421, 0.02500000037252903, 0.02500000037252903], [0.543749988079071, 0.6187499761581421, 0.05000000074505806, 0.05000000074505806], [0.5562499761581421, 0.6187499761581421, 0.02500000037252903, 0.02500000037252903], [0.5562499761581421, 0.6187499761581421, 0.05000000074505806, 0.05000000074505806], [0.5687500238418579, 0.6187499761581421, 0.02500000037252903, 0.02500000037252903], [0.5687500238418579, 0.6187499761581421, 0.05000000074505806, 0.05000000074505806], [0.581250011920929, 0.6187499761581421, 0.02500000037252903, 0.02500000037252903], [0.581250011920929, 0.6187499761581421, 0.05000000074505806, 0.05000000074505806], [0.59375, 0.6187499761581421, 0.02500000037252903, 0.02500000037252903], [0.59375, 0.6187499761581421, 0.05000000074505806, 0.05000000074505806], [0.606249988079071, 0.6187499761581421, 0.02500000037252903, 0.02500000037252903], [0.606249988079071, 0.6187499761581421, 0.05000000074505806, 0.05000000074505806], [0.6187499761581421, 0.6187499761581421, 0.02500000037252903, 0.02500000037252903], [0.6187499761581421, 0.6187499761581421, 0.05000000074505806, 0.05000000074505806], [0.6312500238418579, 0.6187499761581421, 0.02500000037252903, 0.02500000037252903], [0.6312500238418579, 0.6187499761581421, 0.05000000074505806, 0.05000000074505806], [0.643750011920929, 0.6187499761581421, 0.02500000037252903, 0.02500000037252903], [0.643750011920929, 0.6187499761581421, 0.05000000074505806, 0.05000000074505806], [0.65625, 0.6187499761581421, 0.02500000037252903, 0.02500000037252903], [0.65625, 0.6187499761581421, 0.05000000074505806, 0.05000000074505806], [0.668749988079071, 0.6187499761581421, 0.02500000037252903, 0.02500000037252903], [0.668749988079071, 0.6187499761581421, 0.05000000074505806, 0.05000000074505806], [0.6812499761581421, 0.6187499761581421, 0.02500000037252903, 0.02500000037252903], [0.6812499761581421, 0.6187499761581421, 0.05000000074505806, 0.05000000074505806], [0.6937500238418579, 0.6187499761581421, 0.02500000037252903, 0.02500000037252903], [0.6937500238418579, 0.6187499761581421, 0.05000000074505806, 0.05000000074505806], [0.706250011920929, 0.6187499761581421, 0.02500000037252903, 0.02500000037252903], [0.706250011920929, 0.6187499761581421, 0.05000000074505806, 0.05000000074505806], [0.71875, 0.6187499761581421, 0.02500000037252903, 0.02500000037252903], [0.71875, 0.6187499761581421, 0.05000000074505806, 0.05000000074505806], [0.731249988079071, 0.6187499761581421, 0.02500000037252903, 0.02500000037252903], [0.731249988079071, 0.6187499761581421, 0.05000000074505806, 0.05000000074505806], [0.7437499761581421, 0.6187499761581421, 0.02500000037252903, 0.02500000037252903], [0.7437499761581421, 0.6187499761581421, 0.05000000074505806, 0.05000000074505806], [0.7562500238418579, 0.6187499761581421, 0.02500000037252903, 0.02500000037252903], [0.7562500238418579, 0.6187499761581421, 0.05000000074505806, 0.05000000074505806], [0.768750011920929, 0.6187499761581421, 0.02500000037252903, 0.02500000037252903], [0.768750011920929, 0.6187499761581421, 0.05000000074505806, 0.05000000074505806], [0.78125, 0.6187499761581421, 0.02500000037252903, 0.02500000037252903], [0.78125, 0.6187499761581421, 0.05000000074505806, 0.05000000074505806], [0.793749988079071, 0.6187499761581421, 0.02500000037252903, 0.02500000037252903], [0.793749988079071, 0.6187499761581421, 0.05000000074505806, 0.05000000074505806], [0.8062499761581421, 0.6187499761581421, 0.02500000037252903, 0.02500000037252903], [0.8062499761581421, 0.6187499761581421, 0.05000000074505806, 0.05000000074505806], [0.8187500238418579, 0.6187499761581421, 0.02500000037252903, 0.02500000037252903], [0.8187500238418579, 0.6187499761581421, 0.05000000074505806, 0.05000000074505806], [0.831250011920929, 0.6187499761581421, 0.02500000037252903, 0.02500000037252903], [0.831250011920929, 0.6187499761581421, 0.05000000074505806, 0.05000000074505806], [0.84375, 0.6187499761581421, 0.02500000037252903, 0.02500000037252903], [0.84375, 0.6187499761581421, 0.05000000074505806, 0.05000000074505806], [0.856249988079071, 0.6187499761581421, 0.02500000037252903, 0.02500000037252903], [0.856249988079071, 0.6187499761581421, 0.05000000074505806, 0.05000000074505806], [0.8687499761581421, 0.6187499761581421, 0.02500000037252903, 0.02500000037252903], [0.8687499761581421, 0.6187499761581421, 0.05000000074505806, 0.05000000074505806], [0.8812500238418579, 0.6187499761581421, 0.02500000037252903, 0.02500000037252903], [0.8812500238418579, 0.6187499761581421, 0.05000000074505806, 0.05000000074505806], [0.893750011920929, 0.6187499761581421, 0.02500000037252903, 0.02500000037252903], [0.893750011920929, 0.6187499761581421, 0.05000000074505806, 0.05000000074505806], [0.90625, 0.6187499761581421, 0.02500000037252903, 0.02500000037252903], [0.90625, 0.6187499761581421, 0.05000000074505806, 0.05000000074505806], [0.918749988079071, 0.6187499761581421, 0.02500000037252903, 0.02500000037252903], [0.918749988079071, 0.6187499761581421, 0.05000000074505806, 0.05000000074505806], [0.9312499761581421, 0.6187499761581421, 0.02500000037252903, 0.02500000037252903], [0.9312499761581421, 0.6187499761581421, 0.05000000074505806, 0.05000000074505806], [0.9437500238418579, 0.6187499761581421, 0.02500000037252903, 0.02500000037252903], [0.9437500238418579, 0.6187499761581421, 0.05000000074505806, 0.05000000074505806], [0.956250011920929, 0.6187499761581421, 0.02500000037252903, 0.02500000037252903], [0.956250011920929, 0.6187499761581421, 0.05000000074505806, 0.05000000074505806], [0.96875, 0.6187499761581421, 0.02500000037252903, 0.02500000037252903], [0.96875, 0.6187499761581421, 0.05000000074505806, 0.05000000074505806], [0.981249988079071, 0.6187499761581421, 0.02500000037252903, 0.02500000037252903], [0.981249988079071, 0.6187499761581421, 0.05000000074505806, 0.05000000074505806], [0.9937499761581421, 0.6187499761581421, 0.02500000037252903, 0.02500000037252903], [0.9937499761581421, 0.6187499761581421, 0.05000000074505806, 0.05000000074505806], [0.0062500000931322575, 0.6312500238418579, 0.02500000037252903, 0.02500000037252903], [0.0062500000931322575, 0.6312500238418579, 0.05000000074505806, 0.05000000074505806], [0.01875000074505806, 0.6312500238418579, 0.02500000037252903, 0.02500000037252903], [0.01875000074505806, 0.6312500238418579, 0.05000000074505806, 0.05000000074505806], [0.03125, 0.6312500238418579, 0.02500000037252903, 0.02500000037252903], [0.03125, 0.6312500238418579, 0.05000000074505806, 0.05000000074505806], [0.04374999925494194, 0.6312500238418579, 0.02500000037252903, 0.02500000037252903], [0.04374999925494194, 0.6312500238418579, 0.05000000074505806, 0.05000000074505806], [0.05624999850988388, 0.6312500238418579, 0.02500000037252903, 0.02500000037252903], [0.05624999850988388, 0.6312500238418579, 0.05000000074505806, 0.05000000074505806], [0.06875000149011612, 0.6312500238418579, 0.02500000037252903, 0.02500000037252903], [0.06875000149011612, 0.6312500238418579, 0.05000000074505806, 0.05000000074505806], [0.08124999701976776, 0.6312500238418579, 0.02500000037252903, 0.02500000037252903], [0.08124999701976776, 0.6312500238418579, 0.05000000074505806, 0.05000000074505806], [0.09375, 0.6312500238418579, 0.02500000037252903, 0.02500000037252903], [0.09375, 0.6312500238418579, 0.05000000074505806, 0.05000000074505806], [0.10625000298023224, 0.6312500238418579, 0.02500000037252903, 0.02500000037252903], [0.10625000298023224, 0.6312500238418579, 0.05000000074505806, 0.05000000074505806], [0.11874999850988388, 0.6312500238418579, 0.02500000037252903, 0.02500000037252903], [0.11874999850988388, 0.6312500238418579, 0.05000000074505806, 0.05000000074505806], [0.13124999403953552, 0.6312500238418579, 0.02500000037252903, 0.02500000037252903], [0.13124999403953552, 0.6312500238418579, 0.05000000074505806, 0.05000000074505806], [0.14374999701976776, 0.6312500238418579, 0.02500000037252903, 0.02500000037252903], [0.14374999701976776, 0.6312500238418579, 0.05000000074505806, 0.05000000074505806], [0.15625, 0.6312500238418579, 0.02500000037252903, 0.02500000037252903], [0.15625, 0.6312500238418579, 0.05000000074505806, 0.05000000074505806], [0.16875000298023224, 0.6312500238418579, 0.02500000037252903, 0.02500000037252903], [0.16875000298023224, 0.6312500238418579, 0.05000000074505806, 0.05000000074505806], [0.18125000596046448, 0.6312500238418579, 0.02500000037252903, 0.02500000037252903], [0.18125000596046448, 0.6312500238418579, 0.05000000074505806, 0.05000000074505806], [0.19374999403953552, 0.6312500238418579, 0.02500000037252903, 0.02500000037252903], [0.19374999403953552, 0.6312500238418579, 0.05000000074505806, 0.05000000074505806], [0.20624999701976776, 0.6312500238418579, 0.02500000037252903, 0.02500000037252903], [0.20624999701976776, 0.6312500238418579, 0.05000000074505806, 0.05000000074505806], [0.21875, 0.6312500238418579, 0.02500000037252903, 0.02500000037252903], [0.21875, 0.6312500238418579, 0.05000000074505806, 0.05000000074505806], [0.23125000298023224, 0.6312500238418579, 0.02500000037252903, 0.02500000037252903], [0.23125000298023224, 0.6312500238418579, 0.05000000074505806, 0.05000000074505806], [0.24375000596046448, 0.6312500238418579, 0.02500000037252903, 0.02500000037252903], [0.24375000596046448, 0.6312500238418579, 0.05000000074505806, 0.05000000074505806], [0.2562499940395355, 0.6312500238418579, 0.02500000037252903, 0.02500000037252903], [0.2562499940395355, 0.6312500238418579, 0.05000000074505806, 0.05000000074505806], [0.26875001192092896, 0.6312500238418579, 0.02500000037252903, 0.02500000037252903], [0.26875001192092896, 0.6312500238418579, 0.05000000074505806, 0.05000000074505806], [0.28125, 0.6312500238418579, 0.02500000037252903, 0.02500000037252903], [0.28125, 0.6312500238418579, 0.05000000074505806, 0.05000000074505806], [0.29374998807907104, 0.6312500238418579, 0.02500000037252903, 0.02500000037252903], [0.29374998807907104, 0.6312500238418579, 0.05000000074505806, 0.05000000074505806], [0.3062500059604645, 0.6312500238418579, 0.02500000037252903, 0.02500000037252903], [0.3062500059604645, 0.6312500238418579, 0.05000000074505806, 0.05000000074505806], [0.3187499940395355, 0.6312500238418579, 0.02500000037252903, 0.02500000037252903], [0.3187499940395355, 0.6312500238418579, 0.05000000074505806, 0.05000000074505806], [0.33125001192092896, 0.6312500238418579, 0.02500000037252903, 0.02500000037252903], [0.33125001192092896, 0.6312500238418579, 0.05000000074505806, 0.05000000074505806], [0.34375, 0.6312500238418579, 0.02500000037252903, 0.02500000037252903], [0.34375, 0.6312500238418579, 0.05000000074505806, 0.05000000074505806], [0.35624998807907104, 0.6312500238418579, 0.02500000037252903, 0.02500000037252903], [0.35624998807907104, 0.6312500238418579, 0.05000000074505806, 0.05000000074505806], [0.3687500059604645, 0.6312500238418579, 0.02500000037252903, 0.02500000037252903], [0.3687500059604645, 0.6312500238418579, 0.05000000074505806, 0.05000000074505806], [0.3812499940395355, 0.6312500238418579, 0.02500000037252903, 0.02500000037252903], [0.3812499940395355, 0.6312500238418579, 0.05000000074505806, 0.05000000074505806], [0.39375001192092896, 0.6312500238418579, 0.02500000037252903, 0.02500000037252903], [0.39375001192092896, 0.6312500238418579, 0.05000000074505806, 0.05000000074505806], [0.40625, 0.6312500238418579, 0.02500000037252903, 0.02500000037252903], [0.40625, 0.6312500238418579, 0.05000000074505806, 0.05000000074505806], [0.41874998807907104, 0.6312500238418579, 0.02500000037252903, 0.02500000037252903], [0.41874998807907104, 0.6312500238418579, 0.05000000074505806, 0.05000000074505806], [0.4312500059604645, 0.6312500238418579, 0.02500000037252903, 0.02500000037252903], [0.4312500059604645, 0.6312500238418579, 0.05000000074505806, 0.05000000074505806], [0.4437499940395355, 0.6312500238418579, 0.02500000037252903, 0.02500000037252903], [0.4437499940395355, 0.6312500238418579, 0.05000000074505806, 0.05000000074505806], [0.45625001192092896, 0.6312500238418579, 0.02500000037252903, 0.02500000037252903], [0.45625001192092896, 0.6312500238418579, 0.05000000074505806, 0.05000000074505806], [0.46875, 0.6312500238418579, 0.02500000037252903, 0.02500000037252903], [0.46875, 0.6312500238418579, 0.05000000074505806, 0.05000000074505806], [0.48124998807907104, 0.6312500238418579, 0.02500000037252903, 0.02500000037252903], [0.48124998807907104, 0.6312500238418579, 0.05000000074505806, 0.05000000074505806], [0.4937500059604645, 0.6312500238418579, 0.02500000037252903, 0.02500000037252903], [0.4937500059604645, 0.6312500238418579, 0.05000000074505806, 0.05000000074505806], [0.5062500238418579, 0.6312500238418579, 0.02500000037252903, 0.02500000037252903], [0.5062500238418579, 0.6312500238418579, 0.05000000074505806, 0.05000000074505806], [0.518750011920929, 0.6312500238418579, 0.02500000037252903, 0.02500000037252903], [0.518750011920929, 0.6312500238418579, 0.05000000074505806, 0.05000000074505806], [0.53125, 0.6312500238418579, 0.02500000037252903, 0.02500000037252903], [0.53125, 0.6312500238418579, 0.05000000074505806, 0.05000000074505806], [0.543749988079071, 0.6312500238418579, 0.02500000037252903, 0.02500000037252903], [0.543749988079071, 0.6312500238418579, 0.05000000074505806, 0.05000000074505806], [0.5562499761581421, 0.6312500238418579, 0.02500000037252903, 0.02500000037252903], [0.5562499761581421, 0.6312500238418579, 0.05000000074505806, 0.05000000074505806], [0.5687500238418579, 0.6312500238418579, 0.02500000037252903, 0.02500000037252903], [0.5687500238418579, 0.6312500238418579, 0.05000000074505806, 0.05000000074505806], [0.581250011920929, 0.6312500238418579, 0.02500000037252903, 0.02500000037252903], [0.581250011920929, 0.6312500238418579, 0.05000000074505806, 0.05000000074505806], [0.59375, 0.6312500238418579, 0.02500000037252903, 0.02500000037252903], [0.59375, 0.6312500238418579, 0.05000000074505806, 0.05000000074505806], [0.606249988079071, 0.6312500238418579, 0.02500000037252903, 0.02500000037252903], [0.606249988079071, 0.6312500238418579, 0.05000000074505806, 0.05000000074505806], [0.6187499761581421, 0.6312500238418579, 0.02500000037252903, 0.02500000037252903], [0.6187499761581421, 0.6312500238418579, 0.05000000074505806, 0.05000000074505806], [0.6312500238418579, 0.6312500238418579, 0.02500000037252903, 0.02500000037252903], [0.6312500238418579, 0.6312500238418579, 0.05000000074505806, 0.05000000074505806], [0.643750011920929, 0.6312500238418579, 0.02500000037252903, 0.02500000037252903], [0.643750011920929, 0.6312500238418579, 0.05000000074505806, 0.05000000074505806], [0.65625, 0.6312500238418579, 0.02500000037252903, 0.02500000037252903], [0.65625, 0.6312500238418579, 0.05000000074505806, 0.05000000074505806], [0.668749988079071, 0.6312500238418579, 0.02500000037252903, 0.02500000037252903], [0.668749988079071, 0.6312500238418579, 0.05000000074505806, 0.05000000074505806], [0.6812499761581421, 0.6312500238418579, 0.02500000037252903, 0.02500000037252903], [0.6812499761581421, 0.6312500238418579, 0.05000000074505806, 0.05000000074505806], [0.6937500238418579, 0.6312500238418579, 0.02500000037252903, 0.02500000037252903], [0.6937500238418579, 0.6312500238418579, 0.05000000074505806, 0.05000000074505806], [0.706250011920929, 0.6312500238418579, 0.02500000037252903, 0.02500000037252903], [0.706250011920929, 0.6312500238418579, 0.05000000074505806, 0.05000000074505806], [0.71875, 0.6312500238418579, 0.02500000037252903, 0.02500000037252903], [0.71875, 0.6312500238418579, 0.05000000074505806, 0.05000000074505806], [0.731249988079071, 0.6312500238418579, 0.02500000037252903, 0.02500000037252903], [0.731249988079071, 0.6312500238418579, 0.05000000074505806, 0.05000000074505806], [0.7437499761581421, 0.6312500238418579, 0.02500000037252903, 0.02500000037252903], [0.7437499761581421, 0.6312500238418579, 0.05000000074505806, 0.05000000074505806], [0.7562500238418579, 0.6312500238418579, 0.02500000037252903, 0.02500000037252903], [0.7562500238418579, 0.6312500238418579, 0.05000000074505806, 0.05000000074505806], [0.768750011920929, 0.6312500238418579, 0.02500000037252903, 0.02500000037252903], [0.768750011920929, 0.6312500238418579, 0.05000000074505806, 0.05000000074505806], [0.78125, 0.6312500238418579, 0.02500000037252903, 0.02500000037252903], [0.78125, 0.6312500238418579, 0.05000000074505806, 0.05000000074505806], [0.793749988079071, 0.6312500238418579, 0.02500000037252903, 0.02500000037252903], [0.793749988079071, 0.6312500238418579, 0.05000000074505806, 0.05000000074505806], [0.8062499761581421, 0.6312500238418579, 0.02500000037252903, 0.02500000037252903], [0.8062499761581421, 0.6312500238418579, 0.05000000074505806, 0.05000000074505806], [0.8187500238418579, 0.6312500238418579, 0.02500000037252903, 0.02500000037252903], [0.8187500238418579, 0.6312500238418579, 0.05000000074505806, 0.05000000074505806], [0.831250011920929, 0.6312500238418579, 0.02500000037252903, 0.02500000037252903], [0.831250011920929, 0.6312500238418579, 0.05000000074505806, 0.05000000074505806], [0.84375, 0.6312500238418579, 0.02500000037252903, 0.02500000037252903], [0.84375, 0.6312500238418579, 0.05000000074505806, 0.05000000074505806], [0.856249988079071, 0.6312500238418579, 0.02500000037252903, 0.02500000037252903], [0.856249988079071, 0.6312500238418579, 0.05000000074505806, 0.05000000074505806], [0.8687499761581421, 0.6312500238418579, 0.02500000037252903, 0.02500000037252903], [0.8687499761581421, 0.6312500238418579, 0.05000000074505806, 0.05000000074505806], [0.8812500238418579, 0.6312500238418579, 0.02500000037252903, 0.02500000037252903], [0.8812500238418579, 0.6312500238418579, 0.05000000074505806, 0.05000000074505806], [0.893750011920929, 0.6312500238418579, 0.02500000037252903, 0.02500000037252903], [0.893750011920929, 0.6312500238418579, 0.05000000074505806, 0.05000000074505806], [0.90625, 0.6312500238418579, 0.02500000037252903, 0.02500000037252903], [0.90625, 0.6312500238418579, 0.05000000074505806, 0.05000000074505806], [0.918749988079071, 0.6312500238418579, 0.02500000037252903, 0.02500000037252903], [0.918749988079071, 0.6312500238418579, 0.05000000074505806, 0.05000000074505806], [0.9312499761581421, 0.6312500238418579, 0.02500000037252903, 0.02500000037252903], [0.9312499761581421, 0.6312500238418579, 0.05000000074505806, 0.05000000074505806], [0.9437500238418579, 0.6312500238418579, 0.02500000037252903, 0.02500000037252903], [0.9437500238418579, 0.6312500238418579, 0.05000000074505806, 0.05000000074505806], [0.956250011920929, 0.6312500238418579, 0.02500000037252903, 0.02500000037252903], [0.956250011920929, 0.6312500238418579, 0.05000000074505806, 0.05000000074505806], [0.96875, 0.6312500238418579, 0.02500000037252903, 0.02500000037252903], [0.96875, 0.6312500238418579, 0.05000000074505806, 0.05000000074505806], [0.981249988079071, 0.6312500238418579, 0.02500000037252903, 0.02500000037252903], [0.981249988079071, 0.6312500238418579, 0.05000000074505806, 0.05000000074505806], [0.9937499761581421, 0.6312500238418579, 0.02500000037252903, 0.02500000037252903], [0.9937499761581421, 0.6312500238418579, 0.05000000074505806, 0.05000000074505806], [0.0062500000931322575, 0.643750011920929, 0.02500000037252903, 0.02500000037252903], [0.0062500000931322575, 0.643750011920929, 0.05000000074505806, 0.05000000074505806], [0.01875000074505806, 0.643750011920929, 0.02500000037252903, 0.02500000037252903], [0.01875000074505806, 0.643750011920929, 0.05000000074505806, 0.05000000074505806], [0.03125, 0.643750011920929, 0.02500000037252903, 0.02500000037252903], [0.03125, 0.643750011920929, 0.05000000074505806, 0.05000000074505806], [0.04374999925494194, 0.643750011920929, 0.02500000037252903, 0.02500000037252903], [0.04374999925494194, 0.643750011920929, 0.05000000074505806, 0.05000000074505806], [0.05624999850988388, 0.643750011920929, 0.02500000037252903, 0.02500000037252903], [0.05624999850988388, 0.643750011920929, 0.05000000074505806, 0.05000000074505806], [0.06875000149011612, 0.643750011920929, 0.02500000037252903, 0.02500000037252903], [0.06875000149011612, 0.643750011920929, 0.05000000074505806, 0.05000000074505806], [0.08124999701976776, 0.643750011920929, 0.02500000037252903, 0.02500000037252903], [0.08124999701976776, 0.643750011920929, 0.05000000074505806, 0.05000000074505806], [0.09375, 0.643750011920929, 0.02500000037252903, 0.02500000037252903], [0.09375, 0.643750011920929, 0.05000000074505806, 0.05000000074505806], [0.10625000298023224, 0.643750011920929, 0.02500000037252903, 0.02500000037252903], [0.10625000298023224, 0.643750011920929, 0.05000000074505806, 0.05000000074505806], [0.11874999850988388, 0.643750011920929, 0.02500000037252903, 0.02500000037252903], [0.11874999850988388, 0.643750011920929, 0.05000000074505806, 0.05000000074505806], [0.13124999403953552, 0.643750011920929, 0.02500000037252903, 0.02500000037252903], [0.13124999403953552, 0.643750011920929, 0.05000000074505806, 0.05000000074505806], [0.14374999701976776, 0.643750011920929, 0.02500000037252903, 0.02500000037252903], [0.14374999701976776, 0.643750011920929, 0.05000000074505806, 0.05000000074505806], [0.15625, 0.643750011920929, 0.02500000037252903, 0.02500000037252903], [0.15625, 0.643750011920929, 0.05000000074505806, 0.05000000074505806], [0.16875000298023224, 0.643750011920929, 0.02500000037252903, 0.02500000037252903], [0.16875000298023224, 0.643750011920929, 0.05000000074505806, 0.05000000074505806], [0.18125000596046448, 0.643750011920929, 0.02500000037252903, 0.02500000037252903], [0.18125000596046448, 0.643750011920929, 0.05000000074505806, 0.05000000074505806], [0.19374999403953552, 0.643750011920929, 0.02500000037252903, 0.02500000037252903], [0.19374999403953552, 0.643750011920929, 0.05000000074505806, 0.05000000074505806], [0.20624999701976776, 0.643750011920929, 0.02500000037252903, 0.02500000037252903], [0.20624999701976776, 0.643750011920929, 0.05000000074505806, 0.05000000074505806], [0.21875, 0.643750011920929, 0.02500000037252903, 0.02500000037252903], [0.21875, 0.643750011920929, 0.05000000074505806, 0.05000000074505806], [0.23125000298023224, 0.643750011920929, 0.02500000037252903, 0.02500000037252903], [0.23125000298023224, 0.643750011920929, 0.05000000074505806, 0.05000000074505806], [0.24375000596046448, 0.643750011920929, 0.02500000037252903, 0.02500000037252903], [0.24375000596046448, 0.643750011920929, 0.05000000074505806, 0.05000000074505806], [0.2562499940395355, 0.643750011920929, 0.02500000037252903, 0.02500000037252903], [0.2562499940395355, 0.643750011920929, 0.05000000074505806, 0.05000000074505806], [0.26875001192092896, 0.643750011920929, 0.02500000037252903, 0.02500000037252903], [0.26875001192092896, 0.643750011920929, 0.05000000074505806, 0.05000000074505806], [0.28125, 0.643750011920929, 0.02500000037252903, 0.02500000037252903], [0.28125, 0.643750011920929, 0.05000000074505806, 0.05000000074505806], [0.29374998807907104, 0.643750011920929, 0.02500000037252903, 0.02500000037252903], [0.29374998807907104, 0.643750011920929, 0.05000000074505806, 0.05000000074505806], [0.3062500059604645, 0.643750011920929, 0.02500000037252903, 0.02500000037252903], [0.3062500059604645, 0.643750011920929, 0.05000000074505806, 0.05000000074505806], [0.3187499940395355, 0.643750011920929, 0.02500000037252903, 0.02500000037252903], [0.3187499940395355, 0.643750011920929, 0.05000000074505806, 0.05000000074505806], [0.33125001192092896, 0.643750011920929, 0.02500000037252903, 0.02500000037252903], [0.33125001192092896, 0.643750011920929, 0.05000000074505806, 0.05000000074505806], [0.34375, 0.643750011920929, 0.02500000037252903, 0.02500000037252903], [0.34375, 0.643750011920929, 0.05000000074505806, 0.05000000074505806], [0.35624998807907104, 0.643750011920929, 0.02500000037252903, 0.02500000037252903], [0.35624998807907104, 0.643750011920929, 0.05000000074505806, 0.05000000074505806], [0.3687500059604645, 0.643750011920929, 0.02500000037252903, 0.02500000037252903], [0.3687500059604645, 0.643750011920929, 0.05000000074505806, 0.05000000074505806], [0.3812499940395355, 0.643750011920929, 0.02500000037252903, 0.02500000037252903], [0.3812499940395355, 0.643750011920929, 0.05000000074505806, 0.05000000074505806], [0.39375001192092896, 0.643750011920929, 0.02500000037252903, 0.02500000037252903], [0.39375001192092896, 0.643750011920929, 0.05000000074505806, 0.05000000074505806], [0.40625, 0.643750011920929, 0.02500000037252903, 0.02500000037252903], [0.40625, 0.643750011920929, 0.05000000074505806, 0.05000000074505806], [0.41874998807907104, 0.643750011920929, 0.02500000037252903, 0.02500000037252903], [0.41874998807907104, 0.643750011920929, 0.05000000074505806, 0.05000000074505806], [0.4312500059604645, 0.643750011920929, 0.02500000037252903, 0.02500000037252903], [0.4312500059604645, 0.643750011920929, 0.05000000074505806, 0.05000000074505806], [0.4437499940395355, 0.643750011920929, 0.02500000037252903, 0.02500000037252903], [0.4437499940395355, 0.643750011920929, 0.05000000074505806, 0.05000000074505806], [0.45625001192092896, 0.643750011920929, 0.02500000037252903, 0.02500000037252903], [0.45625001192092896, 0.643750011920929, 0.05000000074505806, 0.05000000074505806], [0.46875, 0.643750011920929, 0.02500000037252903, 0.02500000037252903], [0.46875, 0.643750011920929, 0.05000000074505806, 0.05000000074505806], [0.48124998807907104, 0.643750011920929, 0.02500000037252903, 0.02500000037252903], [0.48124998807907104, 0.643750011920929, 0.05000000074505806, 0.05000000074505806], [0.4937500059604645, 0.643750011920929, 0.02500000037252903, 0.02500000037252903], [0.4937500059604645, 0.643750011920929, 0.05000000074505806, 0.05000000074505806], [0.5062500238418579, 0.643750011920929, 0.02500000037252903, 0.02500000037252903], [0.5062500238418579, 0.643750011920929, 0.05000000074505806, 0.05000000074505806], [0.518750011920929, 0.643750011920929, 0.02500000037252903, 0.02500000037252903], [0.518750011920929, 0.643750011920929, 0.05000000074505806, 0.05000000074505806], [0.53125, 0.643750011920929, 0.02500000037252903, 0.02500000037252903], [0.53125, 0.643750011920929, 0.05000000074505806, 0.05000000074505806], [0.543749988079071, 0.643750011920929, 0.02500000037252903, 0.02500000037252903], [0.543749988079071, 0.643750011920929, 0.05000000074505806, 0.05000000074505806], [0.5562499761581421, 0.643750011920929, 0.02500000037252903, 0.02500000037252903], [0.5562499761581421, 0.643750011920929, 0.05000000074505806, 0.05000000074505806], [0.5687500238418579, 0.643750011920929, 0.02500000037252903, 0.02500000037252903], [0.5687500238418579, 0.643750011920929, 0.05000000074505806, 0.05000000074505806], [0.581250011920929, 0.643750011920929, 0.02500000037252903, 0.02500000037252903], [0.581250011920929, 0.643750011920929, 0.05000000074505806, 0.05000000074505806], [0.59375, 0.643750011920929, 0.02500000037252903, 0.02500000037252903], [0.59375, 0.643750011920929, 0.05000000074505806, 0.05000000074505806], [0.606249988079071, 0.643750011920929, 0.02500000037252903, 0.02500000037252903], [0.606249988079071, 0.643750011920929, 0.05000000074505806, 0.05000000074505806], [0.6187499761581421, 0.643750011920929, 0.02500000037252903, 0.02500000037252903], [0.6187499761581421, 0.643750011920929, 0.05000000074505806, 0.05000000074505806], [0.6312500238418579, 0.643750011920929, 0.02500000037252903, 0.02500000037252903], [0.6312500238418579, 0.643750011920929, 0.05000000074505806, 0.05000000074505806], [0.643750011920929, 0.643750011920929, 0.02500000037252903, 0.02500000037252903], [0.643750011920929, 0.643750011920929, 0.05000000074505806, 0.05000000074505806], [0.65625, 0.643750011920929, 0.02500000037252903, 0.02500000037252903], [0.65625, 0.643750011920929, 0.05000000074505806, 0.05000000074505806], [0.668749988079071, 0.643750011920929, 0.02500000037252903, 0.02500000037252903], [0.668749988079071, 0.643750011920929, 0.05000000074505806, 0.05000000074505806], [0.6812499761581421, 0.643750011920929, 0.02500000037252903, 0.02500000037252903], [0.6812499761581421, 0.643750011920929, 0.05000000074505806, 0.05000000074505806], [0.6937500238418579, 0.643750011920929, 0.02500000037252903, 0.02500000037252903], [0.6937500238418579, 0.643750011920929, 0.05000000074505806, 0.05000000074505806], [0.706250011920929, 0.643750011920929, 0.02500000037252903, 0.02500000037252903], [0.706250011920929, 0.643750011920929, 0.05000000074505806, 0.05000000074505806], [0.71875, 0.643750011920929, 0.02500000037252903, 0.02500000037252903], [0.71875, 0.643750011920929, 0.05000000074505806, 0.05000000074505806], [0.731249988079071, 0.643750011920929, 0.02500000037252903, 0.02500000037252903], [0.731249988079071, 0.643750011920929, 0.05000000074505806, 0.05000000074505806], [0.7437499761581421, 0.643750011920929, 0.02500000037252903, 0.02500000037252903], [0.7437499761581421, 0.643750011920929, 0.05000000074505806, 0.05000000074505806], [0.7562500238418579, 0.643750011920929, 0.02500000037252903, 0.02500000037252903], [0.7562500238418579, 0.643750011920929, 0.05000000074505806, 0.05000000074505806], [0.768750011920929, 0.643750011920929, 0.02500000037252903, 0.02500000037252903], [0.768750011920929, 0.643750011920929, 0.05000000074505806, 0.05000000074505806], [0.78125, 0.643750011920929, 0.02500000037252903, 0.02500000037252903], [0.78125, 0.643750011920929, 0.05000000074505806, 0.05000000074505806], [0.793749988079071, 0.643750011920929, 0.02500000037252903, 0.02500000037252903], [0.793749988079071, 0.643750011920929, 0.05000000074505806, 0.05000000074505806], [0.8062499761581421, 0.643750011920929, 0.02500000037252903, 0.02500000037252903], [0.8062499761581421, 0.643750011920929, 0.05000000074505806, 0.05000000074505806], [0.8187500238418579, 0.643750011920929, 0.02500000037252903, 0.02500000037252903], [0.8187500238418579, 0.643750011920929, 0.05000000074505806, 0.05000000074505806], [0.831250011920929, 0.643750011920929, 0.02500000037252903, 0.02500000037252903], [0.831250011920929, 0.643750011920929, 0.05000000074505806, 0.05000000074505806], [0.84375, 0.643750011920929, 0.02500000037252903, 0.02500000037252903], [0.84375, 0.643750011920929, 0.05000000074505806, 0.05000000074505806], [0.856249988079071, 0.643750011920929, 0.02500000037252903, 0.02500000037252903], [0.856249988079071, 0.643750011920929, 0.05000000074505806, 0.05000000074505806], [0.8687499761581421, 0.643750011920929, 0.02500000037252903, 0.02500000037252903], [0.8687499761581421, 0.643750011920929, 0.05000000074505806, 0.05000000074505806], [0.8812500238418579, 0.643750011920929, 0.02500000037252903, 0.02500000037252903], [0.8812500238418579, 0.643750011920929, 0.05000000074505806, 0.05000000074505806], [0.893750011920929, 0.643750011920929, 0.02500000037252903, 0.02500000037252903], [0.893750011920929, 0.643750011920929, 0.05000000074505806, 0.05000000074505806], [0.90625, 0.643750011920929, 0.02500000037252903, 0.02500000037252903], [0.90625, 0.643750011920929, 0.05000000074505806, 0.05000000074505806], [0.918749988079071, 0.643750011920929, 0.02500000037252903, 0.02500000037252903], [0.918749988079071, 0.643750011920929, 0.05000000074505806, 0.05000000074505806], [0.9312499761581421, 0.643750011920929, 0.02500000037252903, 0.02500000037252903], [0.9312499761581421, 0.643750011920929, 0.05000000074505806, 0.05000000074505806], [0.9437500238418579, 0.643750011920929, 0.02500000037252903, 0.02500000037252903], [0.9437500238418579, 0.643750011920929, 0.05000000074505806, 0.05000000074505806], [0.956250011920929, 0.643750011920929, 0.02500000037252903, 0.02500000037252903], [0.956250011920929, 0.643750011920929, 0.05000000074505806, 0.05000000074505806], [0.96875, 0.643750011920929, 0.02500000037252903, 0.02500000037252903], [0.96875, 0.643750011920929, 0.05000000074505806, 0.05000000074505806], [0.981249988079071, 0.643750011920929, 0.02500000037252903, 0.02500000037252903], [0.981249988079071, 0.643750011920929, 0.05000000074505806, 0.05000000074505806], [0.9937499761581421, 0.643750011920929, 0.02500000037252903, 0.02500000037252903], [0.9937499761581421, 0.643750011920929, 0.05000000074505806, 0.05000000074505806], [0.0062500000931322575, 0.65625, 0.02500000037252903, 0.02500000037252903], [0.0062500000931322575, 0.65625, 0.05000000074505806, 0.05000000074505806], [0.01875000074505806, 0.65625, 0.02500000037252903, 0.02500000037252903], [0.01875000074505806, 0.65625, 0.05000000074505806, 0.05000000074505806], [0.03125, 0.65625, 0.02500000037252903, 0.02500000037252903], [0.03125, 0.65625, 0.05000000074505806, 0.05000000074505806], [0.04374999925494194, 0.65625, 0.02500000037252903, 0.02500000037252903], [0.04374999925494194, 0.65625, 0.05000000074505806, 0.05000000074505806], [0.05624999850988388, 0.65625, 0.02500000037252903, 0.02500000037252903], [0.05624999850988388, 0.65625, 0.05000000074505806, 0.05000000074505806], [0.06875000149011612, 0.65625, 0.02500000037252903, 0.02500000037252903], [0.06875000149011612, 0.65625, 0.05000000074505806, 0.05000000074505806], [0.08124999701976776, 0.65625, 0.02500000037252903, 0.02500000037252903], [0.08124999701976776, 0.65625, 0.05000000074505806, 0.05000000074505806], [0.09375, 0.65625, 0.02500000037252903, 0.02500000037252903], [0.09375, 0.65625, 0.05000000074505806, 0.05000000074505806], [0.10625000298023224, 0.65625, 0.02500000037252903, 0.02500000037252903], [0.10625000298023224, 0.65625, 0.05000000074505806, 0.05000000074505806], [0.11874999850988388, 0.65625, 0.02500000037252903, 0.02500000037252903], [0.11874999850988388, 0.65625, 0.05000000074505806, 0.05000000074505806], [0.13124999403953552, 0.65625, 0.02500000037252903, 0.02500000037252903], [0.13124999403953552, 0.65625, 0.05000000074505806, 0.05000000074505806], [0.14374999701976776, 0.65625, 0.02500000037252903, 0.02500000037252903], [0.14374999701976776, 0.65625, 0.05000000074505806, 0.05000000074505806], [0.15625, 0.65625, 0.02500000037252903, 0.02500000037252903], [0.15625, 0.65625, 0.05000000074505806, 0.05000000074505806], [0.16875000298023224, 0.65625, 0.02500000037252903, 0.02500000037252903], [0.16875000298023224, 0.65625, 0.05000000074505806, 0.05000000074505806], [0.18125000596046448, 0.65625, 0.02500000037252903, 0.02500000037252903], [0.18125000596046448, 0.65625, 0.05000000074505806, 0.05000000074505806], [0.19374999403953552, 0.65625, 0.02500000037252903, 0.02500000037252903], [0.19374999403953552, 0.65625, 0.05000000074505806, 0.05000000074505806], [0.20624999701976776, 0.65625, 0.02500000037252903, 0.02500000037252903], [0.20624999701976776, 0.65625, 0.05000000074505806, 0.05000000074505806], [0.21875, 0.65625, 0.02500000037252903, 0.02500000037252903], [0.21875, 0.65625, 0.05000000074505806, 0.05000000074505806], [0.23125000298023224, 0.65625, 0.02500000037252903, 0.02500000037252903], [0.23125000298023224, 0.65625, 0.05000000074505806, 0.05000000074505806], [0.24375000596046448, 0.65625, 0.02500000037252903, 0.02500000037252903], [0.24375000596046448, 0.65625, 0.05000000074505806, 0.05000000074505806], [0.2562499940395355, 0.65625, 0.02500000037252903, 0.02500000037252903], [0.2562499940395355, 0.65625, 0.05000000074505806, 0.05000000074505806], [0.26875001192092896, 0.65625, 0.02500000037252903, 0.02500000037252903], [0.26875001192092896, 0.65625, 0.05000000074505806, 0.05000000074505806], [0.28125, 0.65625, 0.02500000037252903, 0.02500000037252903], [0.28125, 0.65625, 0.05000000074505806, 0.05000000074505806], [0.29374998807907104, 0.65625, 0.02500000037252903, 0.02500000037252903], [0.29374998807907104, 0.65625, 0.05000000074505806, 0.05000000074505806], [0.3062500059604645, 0.65625, 0.02500000037252903, 0.02500000037252903], [0.3062500059604645, 0.65625, 0.05000000074505806, 0.05000000074505806], [0.3187499940395355, 0.65625, 0.02500000037252903, 0.02500000037252903], [0.3187499940395355, 0.65625, 0.05000000074505806, 0.05000000074505806], [0.33125001192092896, 0.65625, 0.02500000037252903, 0.02500000037252903], [0.33125001192092896, 0.65625, 0.05000000074505806, 0.05000000074505806], [0.34375, 0.65625, 0.02500000037252903, 0.02500000037252903], [0.34375, 0.65625, 0.05000000074505806, 0.05000000074505806], [0.35624998807907104, 0.65625, 0.02500000037252903, 0.02500000037252903], [0.35624998807907104, 0.65625, 0.05000000074505806, 0.05000000074505806], [0.3687500059604645, 0.65625, 0.02500000037252903, 0.02500000037252903], [0.3687500059604645, 0.65625, 0.05000000074505806, 0.05000000074505806], [0.3812499940395355, 0.65625, 0.02500000037252903, 0.02500000037252903], [0.3812499940395355, 0.65625, 0.05000000074505806, 0.05000000074505806], [0.39375001192092896, 0.65625, 0.02500000037252903, 0.02500000037252903], [0.39375001192092896, 0.65625, 0.05000000074505806, 0.05000000074505806], [0.40625, 0.65625, 0.02500000037252903, 0.02500000037252903], [0.40625, 0.65625, 0.05000000074505806, 0.05000000074505806], [0.41874998807907104, 0.65625, 0.02500000037252903, 0.02500000037252903], [0.41874998807907104, 0.65625, 0.05000000074505806, 0.05000000074505806], [0.4312500059604645, 0.65625, 0.02500000037252903, 0.02500000037252903], [0.4312500059604645, 0.65625, 0.05000000074505806, 0.05000000074505806], [0.4437499940395355, 0.65625, 0.02500000037252903, 0.02500000037252903], [0.4437499940395355, 0.65625, 0.05000000074505806, 0.05000000074505806], [0.45625001192092896, 0.65625, 0.02500000037252903, 0.02500000037252903], [0.45625001192092896, 0.65625, 0.05000000074505806, 0.05000000074505806], [0.46875, 0.65625, 0.02500000037252903, 0.02500000037252903], [0.46875, 0.65625, 0.05000000074505806, 0.05000000074505806], [0.48124998807907104, 0.65625, 0.02500000037252903, 0.02500000037252903], [0.48124998807907104, 0.65625, 0.05000000074505806, 0.05000000074505806], [0.4937500059604645, 0.65625, 0.02500000037252903, 0.02500000037252903], [0.4937500059604645, 0.65625, 0.05000000074505806, 0.05000000074505806], [0.5062500238418579, 0.65625, 0.02500000037252903, 0.02500000037252903], [0.5062500238418579, 0.65625, 0.05000000074505806, 0.05000000074505806], [0.518750011920929, 0.65625, 0.02500000037252903, 0.02500000037252903], [0.518750011920929, 0.65625, 0.05000000074505806, 0.05000000074505806], [0.53125, 0.65625, 0.02500000037252903, 0.02500000037252903], [0.53125, 0.65625, 0.05000000074505806, 0.05000000074505806], [0.543749988079071, 0.65625, 0.02500000037252903, 0.02500000037252903], [0.543749988079071, 0.65625, 0.05000000074505806, 0.05000000074505806], [0.5562499761581421, 0.65625, 0.02500000037252903, 0.02500000037252903], [0.5562499761581421, 0.65625, 0.05000000074505806, 0.05000000074505806], [0.5687500238418579, 0.65625, 0.02500000037252903, 0.02500000037252903], [0.5687500238418579, 0.65625, 0.05000000074505806, 0.05000000074505806], [0.581250011920929, 0.65625, 0.02500000037252903, 0.02500000037252903], [0.581250011920929, 0.65625, 0.05000000074505806, 0.05000000074505806], [0.59375, 0.65625, 0.02500000037252903, 0.02500000037252903], [0.59375, 0.65625, 0.05000000074505806, 0.05000000074505806], [0.606249988079071, 0.65625, 0.02500000037252903, 0.02500000037252903], [0.606249988079071, 0.65625, 0.05000000074505806, 0.05000000074505806], [0.6187499761581421, 0.65625, 0.02500000037252903, 0.02500000037252903], [0.6187499761581421, 0.65625, 0.05000000074505806, 0.05000000074505806], [0.6312500238418579, 0.65625, 0.02500000037252903, 0.02500000037252903], [0.6312500238418579, 0.65625, 0.05000000074505806, 0.05000000074505806], [0.643750011920929, 0.65625, 0.02500000037252903, 0.02500000037252903], [0.643750011920929, 0.65625, 0.05000000074505806, 0.05000000074505806], [0.65625, 0.65625, 0.02500000037252903, 0.02500000037252903], [0.65625, 0.65625, 0.05000000074505806, 0.05000000074505806], [0.668749988079071, 0.65625, 0.02500000037252903, 0.02500000037252903], [0.668749988079071, 0.65625, 0.05000000074505806, 0.05000000074505806], [0.6812499761581421, 0.65625, 0.02500000037252903, 0.02500000037252903], [0.6812499761581421, 0.65625, 0.05000000074505806, 0.05000000074505806], [0.6937500238418579, 0.65625, 0.02500000037252903, 0.02500000037252903], [0.6937500238418579, 0.65625, 0.05000000074505806, 0.05000000074505806], [0.706250011920929, 0.65625, 0.02500000037252903, 0.02500000037252903], [0.706250011920929, 0.65625, 0.05000000074505806, 0.05000000074505806], [0.71875, 0.65625, 0.02500000037252903, 0.02500000037252903], [0.71875, 0.65625, 0.05000000074505806, 0.05000000074505806], [0.731249988079071, 0.65625, 0.02500000037252903, 0.02500000037252903], [0.731249988079071, 0.65625, 0.05000000074505806, 0.05000000074505806], [0.7437499761581421, 0.65625, 0.02500000037252903, 0.02500000037252903], [0.7437499761581421, 0.65625, 0.05000000074505806, 0.05000000074505806], [0.7562500238418579, 0.65625, 0.02500000037252903, 0.02500000037252903], [0.7562500238418579, 0.65625, 0.05000000074505806, 0.05000000074505806], [0.768750011920929, 0.65625, 0.02500000037252903, 0.02500000037252903], [0.768750011920929, 0.65625, 0.05000000074505806, 0.05000000074505806], [0.78125, 0.65625, 0.02500000037252903, 0.02500000037252903], [0.78125, 0.65625, 0.05000000074505806, 0.05000000074505806], [0.793749988079071, 0.65625, 0.02500000037252903, 0.02500000037252903], [0.793749988079071, 0.65625, 0.05000000074505806, 0.05000000074505806], [0.8062499761581421, 0.65625, 0.02500000037252903, 0.02500000037252903], [0.8062499761581421, 0.65625, 0.05000000074505806, 0.05000000074505806], [0.8187500238418579, 0.65625, 0.02500000037252903, 0.02500000037252903], [0.8187500238418579, 0.65625, 0.05000000074505806, 0.05000000074505806], [0.831250011920929, 0.65625, 0.02500000037252903, 0.02500000037252903], [0.831250011920929, 0.65625, 0.05000000074505806, 0.05000000074505806], [0.84375, 0.65625, 0.02500000037252903, 0.02500000037252903], [0.84375, 0.65625, 0.05000000074505806, 0.05000000074505806], [0.856249988079071, 0.65625, 0.02500000037252903, 0.02500000037252903], [0.856249988079071, 0.65625, 0.05000000074505806, 0.05000000074505806], [0.8687499761581421, 0.65625, 0.02500000037252903, 0.02500000037252903], [0.8687499761581421, 0.65625, 0.05000000074505806, 0.05000000074505806], [0.8812500238418579, 0.65625, 0.02500000037252903, 0.02500000037252903], [0.8812500238418579, 0.65625, 0.05000000074505806, 0.05000000074505806], [0.893750011920929, 0.65625, 0.02500000037252903, 0.02500000037252903], [0.893750011920929, 0.65625, 0.05000000074505806, 0.05000000074505806], [0.90625, 0.65625, 0.02500000037252903, 0.02500000037252903], [0.90625, 0.65625, 0.05000000074505806, 0.05000000074505806], [0.918749988079071, 0.65625, 0.02500000037252903, 0.02500000037252903], [0.918749988079071, 0.65625, 0.05000000074505806, 0.05000000074505806], [0.9312499761581421, 0.65625, 0.02500000037252903, 0.02500000037252903], [0.9312499761581421, 0.65625, 0.05000000074505806, 0.05000000074505806], [0.9437500238418579, 0.65625, 0.02500000037252903, 0.02500000037252903], [0.9437500238418579, 0.65625, 0.05000000074505806, 0.05000000074505806], [0.956250011920929, 0.65625, 0.02500000037252903, 0.02500000037252903], [0.956250011920929, 0.65625, 0.05000000074505806, 0.05000000074505806], [0.96875, 0.65625, 0.02500000037252903, 0.02500000037252903], [0.96875, 0.65625, 0.05000000074505806, 0.05000000074505806], [0.981249988079071, 0.65625, 0.02500000037252903, 0.02500000037252903], [0.981249988079071, 0.65625, 0.05000000074505806, 0.05000000074505806], [0.9937499761581421, 0.65625, 0.02500000037252903, 0.02500000037252903], [0.9937499761581421, 0.65625, 0.05000000074505806, 0.05000000074505806], [0.0062500000931322575, 0.668749988079071, 0.02500000037252903, 0.02500000037252903], [0.0062500000931322575, 0.668749988079071, 0.05000000074505806, 0.05000000074505806], [0.01875000074505806, 0.668749988079071, 0.02500000037252903, 0.02500000037252903], [0.01875000074505806, 0.668749988079071, 0.05000000074505806, 0.05000000074505806], [0.03125, 0.668749988079071, 0.02500000037252903, 0.02500000037252903], [0.03125, 0.668749988079071, 0.05000000074505806, 0.05000000074505806], [0.04374999925494194, 0.668749988079071, 0.02500000037252903, 0.02500000037252903], [0.04374999925494194, 0.668749988079071, 0.05000000074505806, 0.05000000074505806], [0.05624999850988388, 0.668749988079071, 0.02500000037252903, 0.02500000037252903], [0.05624999850988388, 0.668749988079071, 0.05000000074505806, 0.05000000074505806], [0.06875000149011612, 0.668749988079071, 0.02500000037252903, 0.02500000037252903], [0.06875000149011612, 0.668749988079071, 0.05000000074505806, 0.05000000074505806], [0.08124999701976776, 0.668749988079071, 0.02500000037252903, 0.02500000037252903], [0.08124999701976776, 0.668749988079071, 0.05000000074505806, 0.05000000074505806], [0.09375, 0.668749988079071, 0.02500000037252903, 0.02500000037252903], [0.09375, 0.668749988079071, 0.05000000074505806, 0.05000000074505806], [0.10625000298023224, 0.668749988079071, 0.02500000037252903, 0.02500000037252903], [0.10625000298023224, 0.668749988079071, 0.05000000074505806, 0.05000000074505806], [0.11874999850988388, 0.668749988079071, 0.02500000037252903, 0.02500000037252903], [0.11874999850988388, 0.668749988079071, 0.05000000074505806, 0.05000000074505806], [0.13124999403953552, 0.668749988079071, 0.02500000037252903, 0.02500000037252903], [0.13124999403953552, 0.668749988079071, 0.05000000074505806, 0.05000000074505806], [0.14374999701976776, 0.668749988079071, 0.02500000037252903, 0.02500000037252903], [0.14374999701976776, 0.668749988079071, 0.05000000074505806, 0.05000000074505806], [0.15625, 0.668749988079071, 0.02500000037252903, 0.02500000037252903], [0.15625, 0.668749988079071, 0.05000000074505806, 0.05000000074505806], [0.16875000298023224, 0.668749988079071, 0.02500000037252903, 0.02500000037252903], [0.16875000298023224, 0.668749988079071, 0.05000000074505806, 0.05000000074505806], [0.18125000596046448, 0.668749988079071, 0.02500000037252903, 0.02500000037252903], [0.18125000596046448, 0.668749988079071, 0.05000000074505806, 0.05000000074505806], [0.19374999403953552, 0.668749988079071, 0.02500000037252903, 0.02500000037252903], [0.19374999403953552, 0.668749988079071, 0.05000000074505806, 0.05000000074505806], [0.20624999701976776, 0.668749988079071, 0.02500000037252903, 0.02500000037252903], [0.20624999701976776, 0.668749988079071, 0.05000000074505806, 0.05000000074505806], [0.21875, 0.668749988079071, 0.02500000037252903, 0.02500000037252903], [0.21875, 0.668749988079071, 0.05000000074505806, 0.05000000074505806], [0.23125000298023224, 0.668749988079071, 0.02500000037252903, 0.02500000037252903], [0.23125000298023224, 0.668749988079071, 0.05000000074505806, 0.05000000074505806], [0.24375000596046448, 0.668749988079071, 0.02500000037252903, 0.02500000037252903], [0.24375000596046448, 0.668749988079071, 0.05000000074505806, 0.05000000074505806], [0.2562499940395355, 0.668749988079071, 0.02500000037252903, 0.02500000037252903], [0.2562499940395355, 0.668749988079071, 0.05000000074505806, 0.05000000074505806], [0.26875001192092896, 0.668749988079071, 0.02500000037252903, 0.02500000037252903], [0.26875001192092896, 0.668749988079071, 0.05000000074505806, 0.05000000074505806], [0.28125, 0.668749988079071, 0.02500000037252903, 0.02500000037252903], [0.28125, 0.668749988079071, 0.05000000074505806, 0.05000000074505806], [0.29374998807907104, 0.668749988079071, 0.02500000037252903, 0.02500000037252903], [0.29374998807907104, 0.668749988079071, 0.05000000074505806, 0.05000000074505806], [0.3062500059604645, 0.668749988079071, 0.02500000037252903, 0.02500000037252903], [0.3062500059604645, 0.668749988079071, 0.05000000074505806, 0.05000000074505806], [0.3187499940395355, 0.668749988079071, 0.02500000037252903, 0.02500000037252903], [0.3187499940395355, 0.668749988079071, 0.05000000074505806, 0.05000000074505806], [0.33125001192092896, 0.668749988079071, 0.02500000037252903, 0.02500000037252903], [0.33125001192092896, 0.668749988079071, 0.05000000074505806, 0.05000000074505806], [0.34375, 0.668749988079071, 0.02500000037252903, 0.02500000037252903], [0.34375, 0.668749988079071, 0.05000000074505806, 0.05000000074505806], [0.35624998807907104, 0.668749988079071, 0.02500000037252903, 0.02500000037252903], [0.35624998807907104, 0.668749988079071, 0.05000000074505806, 0.05000000074505806], [0.3687500059604645, 0.668749988079071, 0.02500000037252903, 0.02500000037252903], [0.3687500059604645, 0.668749988079071, 0.05000000074505806, 0.05000000074505806], [0.3812499940395355, 0.668749988079071, 0.02500000037252903, 0.02500000037252903], [0.3812499940395355, 0.668749988079071, 0.05000000074505806, 0.05000000074505806], [0.39375001192092896, 0.668749988079071, 0.02500000037252903, 0.02500000037252903], [0.39375001192092896, 0.668749988079071, 0.05000000074505806, 0.05000000074505806], [0.40625, 0.668749988079071, 0.02500000037252903, 0.02500000037252903], [0.40625, 0.668749988079071, 0.05000000074505806, 0.05000000074505806], [0.41874998807907104, 0.668749988079071, 0.02500000037252903, 0.02500000037252903], [0.41874998807907104, 0.668749988079071, 0.05000000074505806, 0.05000000074505806], [0.4312500059604645, 0.668749988079071, 0.02500000037252903, 0.02500000037252903], [0.4312500059604645, 0.668749988079071, 0.05000000074505806, 0.05000000074505806], [0.4437499940395355, 0.668749988079071, 0.02500000037252903, 0.02500000037252903], [0.4437499940395355, 0.668749988079071, 0.05000000074505806, 0.05000000074505806], [0.45625001192092896, 0.668749988079071, 0.02500000037252903, 0.02500000037252903], [0.45625001192092896, 0.668749988079071, 0.05000000074505806, 0.05000000074505806], [0.46875, 0.668749988079071, 0.02500000037252903, 0.02500000037252903], [0.46875, 0.668749988079071, 0.05000000074505806, 0.05000000074505806], [0.48124998807907104, 0.668749988079071, 0.02500000037252903, 0.02500000037252903], [0.48124998807907104, 0.668749988079071, 0.05000000074505806, 0.05000000074505806], [0.4937500059604645, 0.668749988079071, 0.02500000037252903, 0.02500000037252903], [0.4937500059604645, 0.668749988079071, 0.05000000074505806, 0.05000000074505806], [0.5062500238418579, 0.668749988079071, 0.02500000037252903, 0.02500000037252903], [0.5062500238418579, 0.668749988079071, 0.05000000074505806, 0.05000000074505806], [0.518750011920929, 0.668749988079071, 0.02500000037252903, 0.02500000037252903], [0.518750011920929, 0.668749988079071, 0.05000000074505806, 0.05000000074505806], [0.53125, 0.668749988079071, 0.02500000037252903, 0.02500000037252903], [0.53125, 0.668749988079071, 0.05000000074505806, 0.05000000074505806], [0.543749988079071, 0.668749988079071, 0.02500000037252903, 0.02500000037252903], [0.543749988079071, 0.668749988079071, 0.05000000074505806, 0.05000000074505806], [0.5562499761581421, 0.668749988079071, 0.02500000037252903, 0.02500000037252903], [0.5562499761581421, 0.668749988079071, 0.05000000074505806, 0.05000000074505806], [0.5687500238418579, 0.668749988079071, 0.02500000037252903, 0.02500000037252903], [0.5687500238418579, 0.668749988079071, 0.05000000074505806, 0.05000000074505806], [0.581250011920929, 0.668749988079071, 0.02500000037252903, 0.02500000037252903], [0.581250011920929, 0.668749988079071, 0.05000000074505806, 0.05000000074505806], [0.59375, 0.668749988079071, 0.02500000037252903, 0.02500000037252903], [0.59375, 0.668749988079071, 0.05000000074505806, 0.05000000074505806], [0.606249988079071, 0.668749988079071, 0.02500000037252903, 0.02500000037252903], [0.606249988079071, 0.668749988079071, 0.05000000074505806, 0.05000000074505806], [0.6187499761581421, 0.668749988079071, 0.02500000037252903, 0.02500000037252903], [0.6187499761581421, 0.668749988079071, 0.05000000074505806, 0.05000000074505806], [0.6312500238418579, 0.668749988079071, 0.02500000037252903, 0.02500000037252903], [0.6312500238418579, 0.668749988079071, 0.05000000074505806, 0.05000000074505806], [0.643750011920929, 0.668749988079071, 0.02500000037252903, 0.02500000037252903], [0.643750011920929, 0.668749988079071, 0.05000000074505806, 0.05000000074505806], [0.65625, 0.668749988079071, 0.02500000037252903, 0.02500000037252903], [0.65625, 0.668749988079071, 0.05000000074505806, 0.05000000074505806], [0.668749988079071, 0.668749988079071, 0.02500000037252903, 0.02500000037252903], [0.668749988079071, 0.668749988079071, 0.05000000074505806, 0.05000000074505806], [0.6812499761581421, 0.668749988079071, 0.02500000037252903, 0.02500000037252903], [0.6812499761581421, 0.668749988079071, 0.05000000074505806, 0.05000000074505806], [0.6937500238418579, 0.668749988079071, 0.02500000037252903, 0.02500000037252903], [0.6937500238418579, 0.668749988079071, 0.05000000074505806, 0.05000000074505806], [0.706250011920929, 0.668749988079071, 0.02500000037252903, 0.02500000037252903], [0.706250011920929, 0.668749988079071, 0.05000000074505806, 0.05000000074505806], [0.71875, 0.668749988079071, 0.02500000037252903, 0.02500000037252903], [0.71875, 0.668749988079071, 0.05000000074505806, 0.05000000074505806], [0.731249988079071, 0.668749988079071, 0.02500000037252903, 0.02500000037252903], [0.731249988079071, 0.668749988079071, 0.05000000074505806, 0.05000000074505806], [0.7437499761581421, 0.668749988079071, 0.02500000037252903, 0.02500000037252903], [0.7437499761581421, 0.668749988079071, 0.05000000074505806, 0.05000000074505806], [0.7562500238418579, 0.668749988079071, 0.02500000037252903, 0.02500000037252903], [0.7562500238418579, 0.668749988079071, 0.05000000074505806, 0.05000000074505806], [0.768750011920929, 0.668749988079071, 0.02500000037252903, 0.02500000037252903], [0.768750011920929, 0.668749988079071, 0.05000000074505806, 0.05000000074505806], [0.78125, 0.668749988079071, 0.02500000037252903, 0.02500000037252903], [0.78125, 0.668749988079071, 0.05000000074505806, 0.05000000074505806], [0.793749988079071, 0.668749988079071, 0.02500000037252903, 0.02500000037252903], [0.793749988079071, 0.668749988079071, 0.05000000074505806, 0.05000000074505806], [0.8062499761581421, 0.668749988079071, 0.02500000037252903, 0.02500000037252903], [0.8062499761581421, 0.668749988079071, 0.05000000074505806, 0.05000000074505806], [0.8187500238418579, 0.668749988079071, 0.02500000037252903, 0.02500000037252903], [0.8187500238418579, 0.668749988079071, 0.05000000074505806, 0.05000000074505806], [0.831250011920929, 0.668749988079071, 0.02500000037252903, 0.02500000037252903], [0.831250011920929, 0.668749988079071, 0.05000000074505806, 0.05000000074505806], [0.84375, 0.668749988079071, 0.02500000037252903, 0.02500000037252903], [0.84375, 0.668749988079071, 0.05000000074505806, 0.05000000074505806], [0.856249988079071, 0.668749988079071, 0.02500000037252903, 0.02500000037252903], [0.856249988079071, 0.668749988079071, 0.05000000074505806, 0.05000000074505806], [0.8687499761581421, 0.668749988079071, 0.02500000037252903, 0.02500000037252903], [0.8687499761581421, 0.668749988079071, 0.05000000074505806, 0.05000000074505806], [0.8812500238418579, 0.668749988079071, 0.02500000037252903, 0.02500000037252903], [0.8812500238418579, 0.668749988079071, 0.05000000074505806, 0.05000000074505806], [0.893750011920929, 0.668749988079071, 0.02500000037252903, 0.02500000037252903], [0.893750011920929, 0.668749988079071, 0.05000000074505806, 0.05000000074505806], [0.90625, 0.668749988079071, 0.02500000037252903, 0.02500000037252903], [0.90625, 0.668749988079071, 0.05000000074505806, 0.05000000074505806], [0.918749988079071, 0.668749988079071, 0.02500000037252903, 0.02500000037252903], [0.918749988079071, 0.668749988079071, 0.05000000074505806, 0.05000000074505806], [0.9312499761581421, 0.668749988079071, 0.02500000037252903, 0.02500000037252903], [0.9312499761581421, 0.668749988079071, 0.05000000074505806, 0.05000000074505806], [0.9437500238418579, 0.668749988079071, 0.02500000037252903, 0.02500000037252903], [0.9437500238418579, 0.668749988079071, 0.05000000074505806, 0.05000000074505806], [0.956250011920929, 0.668749988079071, 0.02500000037252903, 0.02500000037252903], [0.956250011920929, 0.668749988079071, 0.05000000074505806, 0.05000000074505806], [0.96875, 0.668749988079071, 0.02500000037252903, 0.02500000037252903], [0.96875, 0.668749988079071, 0.05000000074505806, 0.05000000074505806], [0.981249988079071, 0.668749988079071, 0.02500000037252903, 0.02500000037252903], [0.981249988079071, 0.668749988079071, 0.05000000074505806, 0.05000000074505806], [0.9937499761581421, 0.668749988079071, 0.02500000037252903, 0.02500000037252903], [0.9937499761581421, 0.668749988079071, 0.05000000074505806, 0.05000000074505806], [0.0062500000931322575, 0.6812499761581421, 0.02500000037252903, 0.02500000037252903], [0.0062500000931322575, 0.6812499761581421, 0.05000000074505806, 0.05000000074505806], [0.01875000074505806, 0.6812499761581421, 0.02500000037252903, 0.02500000037252903], [0.01875000074505806, 0.6812499761581421, 0.05000000074505806, 0.05000000074505806], [0.03125, 0.6812499761581421, 0.02500000037252903, 0.02500000037252903], [0.03125, 0.6812499761581421, 0.05000000074505806, 0.05000000074505806], [0.04374999925494194, 0.6812499761581421, 0.02500000037252903, 0.02500000037252903], [0.04374999925494194, 0.6812499761581421, 0.05000000074505806, 0.05000000074505806], [0.05624999850988388, 0.6812499761581421, 0.02500000037252903, 0.02500000037252903], [0.05624999850988388, 0.6812499761581421, 0.05000000074505806, 0.05000000074505806], [0.06875000149011612, 0.6812499761581421, 0.02500000037252903, 0.02500000037252903], [0.06875000149011612, 0.6812499761581421, 0.05000000074505806, 0.05000000074505806], [0.08124999701976776, 0.6812499761581421, 0.02500000037252903, 0.02500000037252903], [0.08124999701976776, 0.6812499761581421, 0.05000000074505806, 0.05000000074505806], [0.09375, 0.6812499761581421, 0.02500000037252903, 0.02500000037252903], [0.09375, 0.6812499761581421, 0.05000000074505806, 0.05000000074505806], [0.10625000298023224, 0.6812499761581421, 0.02500000037252903, 0.02500000037252903], [0.10625000298023224, 0.6812499761581421, 0.05000000074505806, 0.05000000074505806], [0.11874999850988388, 0.6812499761581421, 0.02500000037252903, 0.02500000037252903], [0.11874999850988388, 0.6812499761581421, 0.05000000074505806, 0.05000000074505806], [0.13124999403953552, 0.6812499761581421, 0.02500000037252903, 0.02500000037252903], [0.13124999403953552, 0.6812499761581421, 0.05000000074505806, 0.05000000074505806], [0.14374999701976776, 0.6812499761581421, 0.02500000037252903, 0.02500000037252903], [0.14374999701976776, 0.6812499761581421, 0.05000000074505806, 0.05000000074505806], [0.15625, 0.6812499761581421, 0.02500000037252903, 0.02500000037252903], [0.15625, 0.6812499761581421, 0.05000000074505806, 0.05000000074505806], [0.16875000298023224, 0.6812499761581421, 0.02500000037252903, 0.02500000037252903], [0.16875000298023224, 0.6812499761581421, 0.05000000074505806, 0.05000000074505806], [0.18125000596046448, 0.6812499761581421, 0.02500000037252903, 0.02500000037252903], [0.18125000596046448, 0.6812499761581421, 0.05000000074505806, 0.05000000074505806], [0.19374999403953552, 0.6812499761581421, 0.02500000037252903, 0.02500000037252903], [0.19374999403953552, 0.6812499761581421, 0.05000000074505806, 0.05000000074505806], [0.20624999701976776, 0.6812499761581421, 0.02500000037252903, 0.02500000037252903], [0.20624999701976776, 0.6812499761581421, 0.05000000074505806, 0.05000000074505806], [0.21875, 0.6812499761581421, 0.02500000037252903, 0.02500000037252903], [0.21875, 0.6812499761581421, 0.05000000074505806, 0.05000000074505806], [0.23125000298023224, 0.6812499761581421, 0.02500000037252903, 0.02500000037252903], [0.23125000298023224, 0.6812499761581421, 0.05000000074505806, 0.05000000074505806], [0.24375000596046448, 0.6812499761581421, 0.02500000037252903, 0.02500000037252903], [0.24375000596046448, 0.6812499761581421, 0.05000000074505806, 0.05000000074505806], [0.2562499940395355, 0.6812499761581421, 0.02500000037252903, 0.02500000037252903], [0.2562499940395355, 0.6812499761581421, 0.05000000074505806, 0.05000000074505806], [0.26875001192092896, 0.6812499761581421, 0.02500000037252903, 0.02500000037252903], [0.26875001192092896, 0.6812499761581421, 0.05000000074505806, 0.05000000074505806], [0.28125, 0.6812499761581421, 0.02500000037252903, 0.02500000037252903], [0.28125, 0.6812499761581421, 0.05000000074505806, 0.05000000074505806], [0.29374998807907104, 0.6812499761581421, 0.02500000037252903, 0.02500000037252903], [0.29374998807907104, 0.6812499761581421, 0.05000000074505806, 0.05000000074505806], [0.3062500059604645, 0.6812499761581421, 0.02500000037252903, 0.02500000037252903], [0.3062500059604645, 0.6812499761581421, 0.05000000074505806, 0.05000000074505806], [0.3187499940395355, 0.6812499761581421, 0.02500000037252903, 0.02500000037252903], [0.3187499940395355, 0.6812499761581421, 0.05000000074505806, 0.05000000074505806], [0.33125001192092896, 0.6812499761581421, 0.02500000037252903, 0.02500000037252903], [0.33125001192092896, 0.6812499761581421, 0.05000000074505806, 0.05000000074505806], [0.34375, 0.6812499761581421, 0.02500000037252903, 0.02500000037252903], [0.34375, 0.6812499761581421, 0.05000000074505806, 0.05000000074505806], [0.35624998807907104, 0.6812499761581421, 0.02500000037252903, 0.02500000037252903], [0.35624998807907104, 0.6812499761581421, 0.05000000074505806, 0.05000000074505806], [0.3687500059604645, 0.6812499761581421, 0.02500000037252903, 0.02500000037252903], [0.3687500059604645, 0.6812499761581421, 0.05000000074505806, 0.05000000074505806], [0.3812499940395355, 0.6812499761581421, 0.02500000037252903, 0.02500000037252903], [0.3812499940395355, 0.6812499761581421, 0.05000000074505806, 0.05000000074505806], [0.39375001192092896, 0.6812499761581421, 0.02500000037252903, 0.02500000037252903], [0.39375001192092896, 0.6812499761581421, 0.05000000074505806, 0.05000000074505806], [0.40625, 0.6812499761581421, 0.02500000037252903, 0.02500000037252903], [0.40625, 0.6812499761581421, 0.05000000074505806, 0.05000000074505806], [0.41874998807907104, 0.6812499761581421, 0.02500000037252903, 0.02500000037252903], [0.41874998807907104, 0.6812499761581421, 0.05000000074505806, 0.05000000074505806], [0.4312500059604645, 0.6812499761581421, 0.02500000037252903, 0.02500000037252903], [0.4312500059604645, 0.6812499761581421, 0.05000000074505806, 0.05000000074505806], [0.4437499940395355, 0.6812499761581421, 0.02500000037252903, 0.02500000037252903], [0.4437499940395355, 0.6812499761581421, 0.05000000074505806, 0.05000000074505806], [0.45625001192092896, 0.6812499761581421, 0.02500000037252903, 0.02500000037252903], [0.45625001192092896, 0.6812499761581421, 0.05000000074505806, 0.05000000074505806], [0.46875, 0.6812499761581421, 0.02500000037252903, 0.02500000037252903], [0.46875, 0.6812499761581421, 0.05000000074505806, 0.05000000074505806], [0.48124998807907104, 0.6812499761581421, 0.02500000037252903, 0.02500000037252903], [0.48124998807907104, 0.6812499761581421, 0.05000000074505806, 0.05000000074505806], [0.4937500059604645, 0.6812499761581421, 0.02500000037252903, 0.02500000037252903], [0.4937500059604645, 0.6812499761581421, 0.05000000074505806, 0.05000000074505806], [0.5062500238418579, 0.6812499761581421, 0.02500000037252903, 0.02500000037252903], [0.5062500238418579, 0.6812499761581421, 0.05000000074505806, 0.05000000074505806], [0.518750011920929, 0.6812499761581421, 0.02500000037252903, 0.02500000037252903], [0.518750011920929, 0.6812499761581421, 0.05000000074505806, 0.05000000074505806], [0.53125, 0.6812499761581421, 0.02500000037252903, 0.02500000037252903], [0.53125, 0.6812499761581421, 0.05000000074505806, 0.05000000074505806], [0.543749988079071, 0.6812499761581421, 0.02500000037252903, 0.02500000037252903], [0.543749988079071, 0.6812499761581421, 0.05000000074505806, 0.05000000074505806], [0.5562499761581421, 0.6812499761581421, 0.02500000037252903, 0.02500000037252903], [0.5562499761581421, 0.6812499761581421, 0.05000000074505806, 0.05000000074505806], [0.5687500238418579, 0.6812499761581421, 0.02500000037252903, 0.02500000037252903], [0.5687500238418579, 0.6812499761581421, 0.05000000074505806, 0.05000000074505806], [0.581250011920929, 0.6812499761581421, 0.02500000037252903, 0.02500000037252903], [0.581250011920929, 0.6812499761581421, 0.05000000074505806, 0.05000000074505806], [0.59375, 0.6812499761581421, 0.02500000037252903, 0.02500000037252903], [0.59375, 0.6812499761581421, 0.05000000074505806, 0.05000000074505806], [0.606249988079071, 0.6812499761581421, 0.02500000037252903, 0.02500000037252903], [0.606249988079071, 0.6812499761581421, 0.05000000074505806, 0.05000000074505806], [0.6187499761581421, 0.6812499761581421, 0.02500000037252903, 0.02500000037252903], [0.6187499761581421, 0.6812499761581421, 0.05000000074505806, 0.05000000074505806], [0.6312500238418579, 0.6812499761581421, 0.02500000037252903, 0.02500000037252903], [0.6312500238418579, 0.6812499761581421, 0.05000000074505806, 0.05000000074505806], [0.643750011920929, 0.6812499761581421, 0.02500000037252903, 0.02500000037252903], [0.643750011920929, 0.6812499761581421, 0.05000000074505806, 0.05000000074505806], [0.65625, 0.6812499761581421, 0.02500000037252903, 0.02500000037252903], [0.65625, 0.6812499761581421, 0.05000000074505806, 0.05000000074505806], [0.668749988079071, 0.6812499761581421, 0.02500000037252903, 0.02500000037252903], [0.668749988079071, 0.6812499761581421, 0.05000000074505806, 0.05000000074505806], [0.6812499761581421, 0.6812499761581421, 0.02500000037252903, 0.02500000037252903], [0.6812499761581421, 0.6812499761581421, 0.05000000074505806, 0.05000000074505806], [0.6937500238418579, 0.6812499761581421, 0.02500000037252903, 0.02500000037252903], [0.6937500238418579, 0.6812499761581421, 0.05000000074505806, 0.05000000074505806], [0.706250011920929, 0.6812499761581421, 0.02500000037252903, 0.02500000037252903], [0.706250011920929, 0.6812499761581421, 0.05000000074505806, 0.05000000074505806], [0.71875, 0.6812499761581421, 0.02500000037252903, 0.02500000037252903], [0.71875, 0.6812499761581421, 0.05000000074505806, 0.05000000074505806], [0.731249988079071, 0.6812499761581421, 0.02500000037252903, 0.02500000037252903], [0.731249988079071, 0.6812499761581421, 0.05000000074505806, 0.05000000074505806], [0.7437499761581421, 0.6812499761581421, 0.02500000037252903, 0.02500000037252903], [0.7437499761581421, 0.6812499761581421, 0.05000000074505806, 0.05000000074505806], [0.7562500238418579, 0.6812499761581421, 0.02500000037252903, 0.02500000037252903], [0.7562500238418579, 0.6812499761581421, 0.05000000074505806, 0.05000000074505806], [0.768750011920929, 0.6812499761581421, 0.02500000037252903, 0.02500000037252903], [0.768750011920929, 0.6812499761581421, 0.05000000074505806, 0.05000000074505806], [0.78125, 0.6812499761581421, 0.02500000037252903, 0.02500000037252903], [0.78125, 0.6812499761581421, 0.05000000074505806, 0.05000000074505806], [0.793749988079071, 0.6812499761581421, 0.02500000037252903, 0.02500000037252903], [0.793749988079071, 0.6812499761581421, 0.05000000074505806, 0.05000000074505806], [0.8062499761581421, 0.6812499761581421, 0.02500000037252903, 0.02500000037252903], [0.8062499761581421, 0.6812499761581421, 0.05000000074505806, 0.05000000074505806], [0.8187500238418579, 0.6812499761581421, 0.02500000037252903, 0.02500000037252903], [0.8187500238418579, 0.6812499761581421, 0.05000000074505806, 0.05000000074505806], [0.831250011920929, 0.6812499761581421, 0.02500000037252903, 0.02500000037252903], [0.831250011920929, 0.6812499761581421, 0.05000000074505806, 0.05000000074505806], [0.84375, 0.6812499761581421, 0.02500000037252903, 0.02500000037252903], [0.84375, 0.6812499761581421, 0.05000000074505806, 0.05000000074505806], [0.856249988079071, 0.6812499761581421, 0.02500000037252903, 0.02500000037252903], [0.856249988079071, 0.6812499761581421, 0.05000000074505806, 0.05000000074505806], [0.8687499761581421, 0.6812499761581421, 0.02500000037252903, 0.02500000037252903], [0.8687499761581421, 0.6812499761581421, 0.05000000074505806, 0.05000000074505806], [0.8812500238418579, 0.6812499761581421, 0.02500000037252903, 0.02500000037252903], [0.8812500238418579, 0.6812499761581421, 0.05000000074505806, 0.05000000074505806], [0.893750011920929, 0.6812499761581421, 0.02500000037252903, 0.02500000037252903], [0.893750011920929, 0.6812499761581421, 0.05000000074505806, 0.05000000074505806], [0.90625, 0.6812499761581421, 0.02500000037252903, 0.02500000037252903], [0.90625, 0.6812499761581421, 0.05000000074505806, 0.05000000074505806], [0.918749988079071, 0.6812499761581421, 0.02500000037252903, 0.02500000037252903], [0.918749988079071, 0.6812499761581421, 0.05000000074505806, 0.05000000074505806], [0.9312499761581421, 0.6812499761581421, 0.02500000037252903, 0.02500000037252903], [0.9312499761581421, 0.6812499761581421, 0.05000000074505806, 0.05000000074505806], [0.9437500238418579, 0.6812499761581421, 0.02500000037252903, 0.02500000037252903], [0.9437500238418579, 0.6812499761581421, 0.05000000074505806, 0.05000000074505806], [0.956250011920929, 0.6812499761581421, 0.02500000037252903, 0.02500000037252903], [0.956250011920929, 0.6812499761581421, 0.05000000074505806, 0.05000000074505806], [0.96875, 0.6812499761581421, 0.02500000037252903, 0.02500000037252903], [0.96875, 0.6812499761581421, 0.05000000074505806, 0.05000000074505806], [0.981249988079071, 0.6812499761581421, 0.02500000037252903, 0.02500000037252903], [0.981249988079071, 0.6812499761581421, 0.05000000074505806, 0.05000000074505806], [0.9937499761581421, 0.6812499761581421, 0.02500000037252903, 0.02500000037252903], [0.9937499761581421, 0.6812499761581421, 0.05000000074505806, 0.05000000074505806], [0.0062500000931322575, 0.6937500238418579, 0.02500000037252903, 0.02500000037252903], [0.0062500000931322575, 0.6937500238418579, 0.05000000074505806, 0.05000000074505806], [0.01875000074505806, 0.6937500238418579, 0.02500000037252903, 0.02500000037252903], [0.01875000074505806, 0.6937500238418579, 0.05000000074505806, 0.05000000074505806], [0.03125, 0.6937500238418579, 0.02500000037252903, 0.02500000037252903], [0.03125, 0.6937500238418579, 0.05000000074505806, 0.05000000074505806], [0.04374999925494194, 0.6937500238418579, 0.02500000037252903, 0.02500000037252903], [0.04374999925494194, 0.6937500238418579, 0.05000000074505806, 0.05000000074505806], [0.05624999850988388, 0.6937500238418579, 0.02500000037252903, 0.02500000037252903], [0.05624999850988388, 0.6937500238418579, 0.05000000074505806, 0.05000000074505806], [0.06875000149011612, 0.6937500238418579, 0.02500000037252903, 0.02500000037252903], [0.06875000149011612, 0.6937500238418579, 0.05000000074505806, 0.05000000074505806], [0.08124999701976776, 0.6937500238418579, 0.02500000037252903, 0.02500000037252903], [0.08124999701976776, 0.6937500238418579, 0.05000000074505806, 0.05000000074505806], [0.09375, 0.6937500238418579, 0.02500000037252903, 0.02500000037252903], [0.09375, 0.6937500238418579, 0.05000000074505806, 0.05000000074505806], [0.10625000298023224, 0.6937500238418579, 0.02500000037252903, 0.02500000037252903], [0.10625000298023224, 0.6937500238418579, 0.05000000074505806, 0.05000000074505806], [0.11874999850988388, 0.6937500238418579, 0.02500000037252903, 0.02500000037252903], [0.11874999850988388, 0.6937500238418579, 0.05000000074505806, 0.05000000074505806], [0.13124999403953552, 0.6937500238418579, 0.02500000037252903, 0.02500000037252903], [0.13124999403953552, 0.6937500238418579, 0.05000000074505806, 0.05000000074505806], [0.14374999701976776, 0.6937500238418579, 0.02500000037252903, 0.02500000037252903], [0.14374999701976776, 0.6937500238418579, 0.05000000074505806, 0.05000000074505806], [0.15625, 0.6937500238418579, 0.02500000037252903, 0.02500000037252903], [0.15625, 0.6937500238418579, 0.05000000074505806, 0.05000000074505806], [0.16875000298023224, 0.6937500238418579, 0.02500000037252903, 0.02500000037252903], [0.16875000298023224, 0.6937500238418579, 0.05000000074505806, 0.05000000074505806], [0.18125000596046448, 0.6937500238418579, 0.02500000037252903, 0.02500000037252903], [0.18125000596046448, 0.6937500238418579, 0.05000000074505806, 0.05000000074505806], [0.19374999403953552, 0.6937500238418579, 0.02500000037252903, 0.02500000037252903], [0.19374999403953552, 0.6937500238418579, 0.05000000074505806, 0.05000000074505806], [0.20624999701976776, 0.6937500238418579, 0.02500000037252903, 0.02500000037252903], [0.20624999701976776, 0.6937500238418579, 0.05000000074505806, 0.05000000074505806], [0.21875, 0.6937500238418579, 0.02500000037252903, 0.02500000037252903], [0.21875, 0.6937500238418579, 0.05000000074505806, 0.05000000074505806], [0.23125000298023224, 0.6937500238418579, 0.02500000037252903, 0.02500000037252903], [0.23125000298023224, 0.6937500238418579, 0.05000000074505806, 0.05000000074505806], [0.24375000596046448, 0.6937500238418579, 0.02500000037252903, 0.02500000037252903], [0.24375000596046448, 0.6937500238418579, 0.05000000074505806, 0.05000000074505806], [0.2562499940395355, 0.6937500238418579, 0.02500000037252903, 0.02500000037252903], [0.2562499940395355, 0.6937500238418579, 0.05000000074505806, 0.05000000074505806], [0.26875001192092896, 0.6937500238418579, 0.02500000037252903, 0.02500000037252903], [0.26875001192092896, 0.6937500238418579, 0.05000000074505806, 0.05000000074505806], [0.28125, 0.6937500238418579, 0.02500000037252903, 0.02500000037252903], [0.28125, 0.6937500238418579, 0.05000000074505806, 0.05000000074505806], [0.29374998807907104, 0.6937500238418579, 0.02500000037252903, 0.02500000037252903], [0.29374998807907104, 0.6937500238418579, 0.05000000074505806, 0.05000000074505806], [0.3062500059604645, 0.6937500238418579, 0.02500000037252903, 0.02500000037252903], [0.3062500059604645, 0.6937500238418579, 0.05000000074505806, 0.05000000074505806], [0.3187499940395355, 0.6937500238418579, 0.02500000037252903, 0.02500000037252903], [0.3187499940395355, 0.6937500238418579, 0.05000000074505806, 0.05000000074505806], [0.33125001192092896, 0.6937500238418579, 0.02500000037252903, 0.02500000037252903], [0.33125001192092896, 0.6937500238418579, 0.05000000074505806, 0.05000000074505806], [0.34375, 0.6937500238418579, 0.02500000037252903, 0.02500000037252903], [0.34375, 0.6937500238418579, 0.05000000074505806, 0.05000000074505806], [0.35624998807907104, 0.6937500238418579, 0.02500000037252903, 0.02500000037252903], [0.35624998807907104, 0.6937500238418579, 0.05000000074505806, 0.05000000074505806], [0.3687500059604645, 0.6937500238418579, 0.02500000037252903, 0.02500000037252903], [0.3687500059604645, 0.6937500238418579, 0.05000000074505806, 0.05000000074505806], [0.3812499940395355, 0.6937500238418579, 0.02500000037252903, 0.02500000037252903], [0.3812499940395355, 0.6937500238418579, 0.05000000074505806, 0.05000000074505806], [0.39375001192092896, 0.6937500238418579, 0.02500000037252903, 0.02500000037252903], [0.39375001192092896, 0.6937500238418579, 0.05000000074505806, 0.05000000074505806], [0.40625, 0.6937500238418579, 0.02500000037252903, 0.02500000037252903], [0.40625, 0.6937500238418579, 0.05000000074505806, 0.05000000074505806], [0.41874998807907104, 0.6937500238418579, 0.02500000037252903, 0.02500000037252903], [0.41874998807907104, 0.6937500238418579, 0.05000000074505806, 0.05000000074505806], [0.4312500059604645, 0.6937500238418579, 0.02500000037252903, 0.02500000037252903], [0.4312500059604645, 0.6937500238418579, 0.05000000074505806, 0.05000000074505806], [0.4437499940395355, 0.6937500238418579, 0.02500000037252903, 0.02500000037252903], [0.4437499940395355, 0.6937500238418579, 0.05000000074505806, 0.05000000074505806], [0.45625001192092896, 0.6937500238418579, 0.02500000037252903, 0.02500000037252903], [0.45625001192092896, 0.6937500238418579, 0.05000000074505806, 0.05000000074505806], [0.46875, 0.6937500238418579, 0.02500000037252903, 0.02500000037252903], [0.46875, 0.6937500238418579, 0.05000000074505806, 0.05000000074505806], [0.48124998807907104, 0.6937500238418579, 0.02500000037252903, 0.02500000037252903], [0.48124998807907104, 0.6937500238418579, 0.05000000074505806, 0.05000000074505806], [0.4937500059604645, 0.6937500238418579, 0.02500000037252903, 0.02500000037252903], [0.4937500059604645, 0.6937500238418579, 0.05000000074505806, 0.05000000074505806], [0.5062500238418579, 0.6937500238418579, 0.02500000037252903, 0.02500000037252903], [0.5062500238418579, 0.6937500238418579, 0.05000000074505806, 0.05000000074505806], [0.518750011920929, 0.6937500238418579, 0.02500000037252903, 0.02500000037252903], [0.518750011920929, 0.6937500238418579, 0.05000000074505806, 0.05000000074505806], [0.53125, 0.6937500238418579, 0.02500000037252903, 0.02500000037252903], [0.53125, 0.6937500238418579, 0.05000000074505806, 0.05000000074505806], [0.543749988079071, 0.6937500238418579, 0.02500000037252903, 0.02500000037252903], [0.543749988079071, 0.6937500238418579, 0.05000000074505806, 0.05000000074505806], [0.5562499761581421, 0.6937500238418579, 0.02500000037252903, 0.02500000037252903], [0.5562499761581421, 0.6937500238418579, 0.05000000074505806, 0.05000000074505806], [0.5687500238418579, 0.6937500238418579, 0.02500000037252903, 0.02500000037252903], [0.5687500238418579, 0.6937500238418579, 0.05000000074505806, 0.05000000074505806], [0.581250011920929, 0.6937500238418579, 0.02500000037252903, 0.02500000037252903], [0.581250011920929, 0.6937500238418579, 0.05000000074505806, 0.05000000074505806], [0.59375, 0.6937500238418579, 0.02500000037252903, 0.02500000037252903], [0.59375, 0.6937500238418579, 0.05000000074505806, 0.05000000074505806], [0.606249988079071, 0.6937500238418579, 0.02500000037252903, 0.02500000037252903], [0.606249988079071, 0.6937500238418579, 0.05000000074505806, 0.05000000074505806], [0.6187499761581421, 0.6937500238418579, 0.02500000037252903, 0.02500000037252903], [0.6187499761581421, 0.6937500238418579, 0.05000000074505806, 0.05000000074505806], [0.6312500238418579, 0.6937500238418579, 0.02500000037252903, 0.02500000037252903], [0.6312500238418579, 0.6937500238418579, 0.05000000074505806, 0.05000000074505806], [0.643750011920929, 0.6937500238418579, 0.02500000037252903, 0.02500000037252903], [0.643750011920929, 0.6937500238418579, 0.05000000074505806, 0.05000000074505806], [0.65625, 0.6937500238418579, 0.02500000037252903, 0.02500000037252903], [0.65625, 0.6937500238418579, 0.05000000074505806, 0.05000000074505806], [0.668749988079071, 0.6937500238418579, 0.02500000037252903, 0.02500000037252903], [0.668749988079071, 0.6937500238418579, 0.05000000074505806, 0.05000000074505806], [0.6812499761581421, 0.6937500238418579, 0.02500000037252903, 0.02500000037252903], [0.6812499761581421, 0.6937500238418579, 0.05000000074505806, 0.05000000074505806], [0.6937500238418579, 0.6937500238418579, 0.02500000037252903, 0.02500000037252903], [0.6937500238418579, 0.6937500238418579, 0.05000000074505806, 0.05000000074505806], [0.706250011920929, 0.6937500238418579, 0.02500000037252903, 0.02500000037252903], [0.706250011920929, 0.6937500238418579, 0.05000000074505806, 0.05000000074505806], [0.71875, 0.6937500238418579, 0.02500000037252903, 0.02500000037252903], [0.71875, 0.6937500238418579, 0.05000000074505806, 0.05000000074505806], [0.731249988079071, 0.6937500238418579, 0.02500000037252903, 0.02500000037252903], [0.731249988079071, 0.6937500238418579, 0.05000000074505806, 0.05000000074505806], [0.7437499761581421, 0.6937500238418579, 0.02500000037252903, 0.02500000037252903], [0.7437499761581421, 0.6937500238418579, 0.05000000074505806, 0.05000000074505806], [0.7562500238418579, 0.6937500238418579, 0.02500000037252903, 0.02500000037252903], [0.7562500238418579, 0.6937500238418579, 0.05000000074505806, 0.05000000074505806], [0.768750011920929, 0.6937500238418579, 0.02500000037252903, 0.02500000037252903], [0.768750011920929, 0.6937500238418579, 0.05000000074505806, 0.05000000074505806], [0.78125, 0.6937500238418579, 0.02500000037252903, 0.02500000037252903], [0.78125, 0.6937500238418579, 0.05000000074505806, 0.05000000074505806], [0.793749988079071, 0.6937500238418579, 0.02500000037252903, 0.02500000037252903], [0.793749988079071, 0.6937500238418579, 0.05000000074505806, 0.05000000074505806], [0.8062499761581421, 0.6937500238418579, 0.02500000037252903, 0.02500000037252903], [0.8062499761581421, 0.6937500238418579, 0.05000000074505806, 0.05000000074505806], [0.8187500238418579, 0.6937500238418579, 0.02500000037252903, 0.02500000037252903], [0.8187500238418579, 0.6937500238418579, 0.05000000074505806, 0.05000000074505806], [0.831250011920929, 0.6937500238418579, 0.02500000037252903, 0.02500000037252903], [0.831250011920929, 0.6937500238418579, 0.05000000074505806, 0.05000000074505806], [0.84375, 0.6937500238418579, 0.02500000037252903, 0.02500000037252903], [0.84375, 0.6937500238418579, 0.05000000074505806, 0.05000000074505806], [0.856249988079071, 0.6937500238418579, 0.02500000037252903, 0.02500000037252903], [0.856249988079071, 0.6937500238418579, 0.05000000074505806, 0.05000000074505806], [0.8687499761581421, 0.6937500238418579, 0.02500000037252903, 0.02500000037252903], [0.8687499761581421, 0.6937500238418579, 0.05000000074505806, 0.05000000074505806], [0.8812500238418579, 0.6937500238418579, 0.02500000037252903, 0.02500000037252903], [0.8812500238418579, 0.6937500238418579, 0.05000000074505806, 0.05000000074505806], [0.893750011920929, 0.6937500238418579, 0.02500000037252903, 0.02500000037252903], [0.893750011920929, 0.6937500238418579, 0.05000000074505806, 0.05000000074505806], [0.90625, 0.6937500238418579, 0.02500000037252903, 0.02500000037252903], [0.90625, 0.6937500238418579, 0.05000000074505806, 0.05000000074505806], [0.918749988079071, 0.6937500238418579, 0.02500000037252903, 0.02500000037252903], [0.918749988079071, 0.6937500238418579, 0.05000000074505806, 0.05000000074505806], [0.9312499761581421, 0.6937500238418579, 0.02500000037252903, 0.02500000037252903], [0.9312499761581421, 0.6937500238418579, 0.05000000074505806, 0.05000000074505806], [0.9437500238418579, 0.6937500238418579, 0.02500000037252903, 0.02500000037252903], [0.9437500238418579, 0.6937500238418579, 0.05000000074505806, 0.05000000074505806], [0.956250011920929, 0.6937500238418579, 0.02500000037252903, 0.02500000037252903], [0.956250011920929, 0.6937500238418579, 0.05000000074505806, 0.05000000074505806], [0.96875, 0.6937500238418579, 0.02500000037252903, 0.02500000037252903], [0.96875, 0.6937500238418579, 0.05000000074505806, 0.05000000074505806], [0.981249988079071, 0.6937500238418579, 0.02500000037252903, 0.02500000037252903], [0.981249988079071, 0.6937500238418579, 0.05000000074505806, 0.05000000074505806], [0.9937499761581421, 0.6937500238418579, 0.02500000037252903, 0.02500000037252903], [0.9937499761581421, 0.6937500238418579, 0.05000000074505806, 0.05000000074505806], [0.0062500000931322575, 0.706250011920929, 0.02500000037252903, 0.02500000037252903], [0.0062500000931322575, 0.706250011920929, 0.05000000074505806, 0.05000000074505806], [0.01875000074505806, 0.706250011920929, 0.02500000037252903, 0.02500000037252903], [0.01875000074505806, 0.706250011920929, 0.05000000074505806, 0.05000000074505806], [0.03125, 0.706250011920929, 0.02500000037252903, 0.02500000037252903], [0.03125, 0.706250011920929, 0.05000000074505806, 0.05000000074505806], [0.04374999925494194, 0.706250011920929, 0.02500000037252903, 0.02500000037252903], [0.04374999925494194, 0.706250011920929, 0.05000000074505806, 0.05000000074505806], [0.05624999850988388, 0.706250011920929, 0.02500000037252903, 0.02500000037252903], [0.05624999850988388, 0.706250011920929, 0.05000000074505806, 0.05000000074505806], [0.06875000149011612, 0.706250011920929, 0.02500000037252903, 0.02500000037252903], [0.06875000149011612, 0.706250011920929, 0.05000000074505806, 0.05000000074505806], [0.08124999701976776, 0.706250011920929, 0.02500000037252903, 0.02500000037252903], [0.08124999701976776, 0.706250011920929, 0.05000000074505806, 0.05000000074505806], [0.09375, 0.706250011920929, 0.02500000037252903, 0.02500000037252903], [0.09375, 0.706250011920929, 0.05000000074505806, 0.05000000074505806], [0.10625000298023224, 0.706250011920929, 0.02500000037252903, 0.02500000037252903], [0.10625000298023224, 0.706250011920929, 0.05000000074505806, 0.05000000074505806], [0.11874999850988388, 0.706250011920929, 0.02500000037252903, 0.02500000037252903], [0.11874999850988388, 0.706250011920929, 0.05000000074505806, 0.05000000074505806], [0.13124999403953552, 0.706250011920929, 0.02500000037252903, 0.02500000037252903], [0.13124999403953552, 0.706250011920929, 0.05000000074505806, 0.05000000074505806], [0.14374999701976776, 0.706250011920929, 0.02500000037252903, 0.02500000037252903], [0.14374999701976776, 0.706250011920929, 0.05000000074505806, 0.05000000074505806], [0.15625, 0.706250011920929, 0.02500000037252903, 0.02500000037252903], [0.15625, 0.706250011920929, 0.05000000074505806, 0.05000000074505806], [0.16875000298023224, 0.706250011920929, 0.02500000037252903, 0.02500000037252903], [0.16875000298023224, 0.706250011920929, 0.05000000074505806, 0.05000000074505806], [0.18125000596046448, 0.706250011920929, 0.02500000037252903, 0.02500000037252903], [0.18125000596046448, 0.706250011920929, 0.05000000074505806, 0.05000000074505806], [0.19374999403953552, 0.706250011920929, 0.02500000037252903, 0.02500000037252903], [0.19374999403953552, 0.706250011920929, 0.05000000074505806, 0.05000000074505806], [0.20624999701976776, 0.706250011920929, 0.02500000037252903, 0.02500000037252903], [0.20624999701976776, 0.706250011920929, 0.05000000074505806, 0.05000000074505806], [0.21875, 0.706250011920929, 0.02500000037252903, 0.02500000037252903], [0.21875, 0.706250011920929, 0.05000000074505806, 0.05000000074505806], [0.23125000298023224, 0.706250011920929, 0.02500000037252903, 0.02500000037252903], [0.23125000298023224, 0.706250011920929, 0.05000000074505806, 0.05000000074505806], [0.24375000596046448, 0.706250011920929, 0.02500000037252903, 0.02500000037252903], [0.24375000596046448, 0.706250011920929, 0.05000000074505806, 0.05000000074505806], [0.2562499940395355, 0.706250011920929, 0.02500000037252903, 0.02500000037252903], [0.2562499940395355, 0.706250011920929, 0.05000000074505806, 0.05000000074505806], [0.26875001192092896, 0.706250011920929, 0.02500000037252903, 0.02500000037252903], [0.26875001192092896, 0.706250011920929, 0.05000000074505806, 0.05000000074505806], [0.28125, 0.706250011920929, 0.02500000037252903, 0.02500000037252903], [0.28125, 0.706250011920929, 0.05000000074505806, 0.05000000074505806], [0.29374998807907104, 0.706250011920929, 0.02500000037252903, 0.02500000037252903], [0.29374998807907104, 0.706250011920929, 0.05000000074505806, 0.05000000074505806], [0.3062500059604645, 0.706250011920929, 0.02500000037252903, 0.02500000037252903], [0.3062500059604645, 0.706250011920929, 0.05000000074505806, 0.05000000074505806], [0.3187499940395355, 0.706250011920929, 0.02500000037252903, 0.02500000037252903], [0.3187499940395355, 0.706250011920929, 0.05000000074505806, 0.05000000074505806], [0.33125001192092896, 0.706250011920929, 0.02500000037252903, 0.02500000037252903], [0.33125001192092896, 0.706250011920929, 0.05000000074505806, 0.05000000074505806], [0.34375, 0.706250011920929, 0.02500000037252903, 0.02500000037252903], [0.34375, 0.706250011920929, 0.05000000074505806, 0.05000000074505806], [0.35624998807907104, 0.706250011920929, 0.02500000037252903, 0.02500000037252903], [0.35624998807907104, 0.706250011920929, 0.05000000074505806, 0.05000000074505806], [0.3687500059604645, 0.706250011920929, 0.02500000037252903, 0.02500000037252903], [0.3687500059604645, 0.706250011920929, 0.05000000074505806, 0.05000000074505806], [0.3812499940395355, 0.706250011920929, 0.02500000037252903, 0.02500000037252903], [0.3812499940395355, 0.706250011920929, 0.05000000074505806, 0.05000000074505806], [0.39375001192092896, 0.706250011920929, 0.02500000037252903, 0.02500000037252903], [0.39375001192092896, 0.706250011920929, 0.05000000074505806, 0.05000000074505806], [0.40625, 0.706250011920929, 0.02500000037252903, 0.02500000037252903], [0.40625, 0.706250011920929, 0.05000000074505806, 0.05000000074505806], [0.41874998807907104, 0.706250011920929, 0.02500000037252903, 0.02500000037252903], [0.41874998807907104, 0.706250011920929, 0.05000000074505806, 0.05000000074505806], [0.4312500059604645, 0.706250011920929, 0.02500000037252903, 0.02500000037252903], [0.4312500059604645, 0.706250011920929, 0.05000000074505806, 0.05000000074505806], [0.4437499940395355, 0.706250011920929, 0.02500000037252903, 0.02500000037252903], [0.4437499940395355, 0.706250011920929, 0.05000000074505806, 0.05000000074505806], [0.45625001192092896, 0.706250011920929, 0.02500000037252903, 0.02500000037252903], [0.45625001192092896, 0.706250011920929, 0.05000000074505806, 0.05000000074505806], [0.46875, 0.706250011920929, 0.02500000037252903, 0.02500000037252903], [0.46875, 0.706250011920929, 0.05000000074505806, 0.05000000074505806], [0.48124998807907104, 0.706250011920929, 0.02500000037252903, 0.02500000037252903], [0.48124998807907104, 0.706250011920929, 0.05000000074505806, 0.05000000074505806], [0.4937500059604645, 0.706250011920929, 0.02500000037252903, 0.02500000037252903], [0.4937500059604645, 0.706250011920929, 0.05000000074505806, 0.05000000074505806], [0.5062500238418579, 0.706250011920929, 0.02500000037252903, 0.02500000037252903], [0.5062500238418579, 0.706250011920929, 0.05000000074505806, 0.05000000074505806], [0.518750011920929, 0.706250011920929, 0.02500000037252903, 0.02500000037252903], [0.518750011920929, 0.706250011920929, 0.05000000074505806, 0.05000000074505806], [0.53125, 0.706250011920929, 0.02500000037252903, 0.02500000037252903], [0.53125, 0.706250011920929, 0.05000000074505806, 0.05000000074505806], [0.543749988079071, 0.706250011920929, 0.02500000037252903, 0.02500000037252903], [0.543749988079071, 0.706250011920929, 0.05000000074505806, 0.05000000074505806], [0.5562499761581421, 0.706250011920929, 0.02500000037252903, 0.02500000037252903], [0.5562499761581421, 0.706250011920929, 0.05000000074505806, 0.05000000074505806], [0.5687500238418579, 0.706250011920929, 0.02500000037252903, 0.02500000037252903], [0.5687500238418579, 0.706250011920929, 0.05000000074505806, 0.05000000074505806], [0.581250011920929, 0.706250011920929, 0.02500000037252903, 0.02500000037252903], [0.581250011920929, 0.706250011920929, 0.05000000074505806, 0.05000000074505806], [0.59375, 0.706250011920929, 0.02500000037252903, 0.02500000037252903], [0.59375, 0.706250011920929, 0.05000000074505806, 0.05000000074505806], [0.606249988079071, 0.706250011920929, 0.02500000037252903, 0.02500000037252903], [0.606249988079071, 0.706250011920929, 0.05000000074505806, 0.05000000074505806], [0.6187499761581421, 0.706250011920929, 0.02500000037252903, 0.02500000037252903], [0.6187499761581421, 0.706250011920929, 0.05000000074505806, 0.05000000074505806], [0.6312500238418579, 0.706250011920929, 0.02500000037252903, 0.02500000037252903], [0.6312500238418579, 0.706250011920929, 0.05000000074505806, 0.05000000074505806], [0.643750011920929, 0.706250011920929, 0.02500000037252903, 0.02500000037252903], [0.643750011920929, 0.706250011920929, 0.05000000074505806, 0.05000000074505806], [0.65625, 0.706250011920929, 0.02500000037252903, 0.02500000037252903], [0.65625, 0.706250011920929, 0.05000000074505806, 0.05000000074505806], [0.668749988079071, 0.706250011920929, 0.02500000037252903, 0.02500000037252903], [0.668749988079071, 0.706250011920929, 0.05000000074505806, 0.05000000074505806], [0.6812499761581421, 0.706250011920929, 0.02500000037252903, 0.02500000037252903], [0.6812499761581421, 0.706250011920929, 0.05000000074505806, 0.05000000074505806], [0.6937500238418579, 0.706250011920929, 0.02500000037252903, 0.02500000037252903], [0.6937500238418579, 0.706250011920929, 0.05000000074505806, 0.05000000074505806], [0.706250011920929, 0.706250011920929, 0.02500000037252903, 0.02500000037252903], [0.706250011920929, 0.706250011920929, 0.05000000074505806, 0.05000000074505806], [0.71875, 0.706250011920929, 0.02500000037252903, 0.02500000037252903], [0.71875, 0.706250011920929, 0.05000000074505806, 0.05000000074505806], [0.731249988079071, 0.706250011920929, 0.02500000037252903, 0.02500000037252903], [0.731249988079071, 0.706250011920929, 0.05000000074505806, 0.05000000074505806], [0.7437499761581421, 0.706250011920929, 0.02500000037252903, 0.02500000037252903], [0.7437499761581421, 0.706250011920929, 0.05000000074505806, 0.05000000074505806], [0.7562500238418579, 0.706250011920929, 0.02500000037252903, 0.02500000037252903], [0.7562500238418579, 0.706250011920929, 0.05000000074505806, 0.05000000074505806], [0.768750011920929, 0.706250011920929, 0.02500000037252903, 0.02500000037252903], [0.768750011920929, 0.706250011920929, 0.05000000074505806, 0.05000000074505806], [0.78125, 0.706250011920929, 0.02500000037252903, 0.02500000037252903], [0.78125, 0.706250011920929, 0.05000000074505806, 0.05000000074505806], [0.793749988079071, 0.706250011920929, 0.02500000037252903, 0.02500000037252903], [0.793749988079071, 0.706250011920929, 0.05000000074505806, 0.05000000074505806], [0.8062499761581421, 0.706250011920929, 0.02500000037252903, 0.02500000037252903], [0.8062499761581421, 0.706250011920929, 0.05000000074505806, 0.05000000074505806], [0.8187500238418579, 0.706250011920929, 0.02500000037252903, 0.02500000037252903], [0.8187500238418579, 0.706250011920929, 0.05000000074505806, 0.05000000074505806], [0.831250011920929, 0.706250011920929, 0.02500000037252903, 0.02500000037252903], [0.831250011920929, 0.706250011920929, 0.05000000074505806, 0.05000000074505806], [0.84375, 0.706250011920929, 0.02500000037252903, 0.02500000037252903], [0.84375, 0.706250011920929, 0.05000000074505806, 0.05000000074505806], [0.856249988079071, 0.706250011920929, 0.02500000037252903, 0.02500000037252903], [0.856249988079071, 0.706250011920929, 0.05000000074505806, 0.05000000074505806], [0.8687499761581421, 0.706250011920929, 0.02500000037252903, 0.02500000037252903], [0.8687499761581421, 0.706250011920929, 0.05000000074505806, 0.05000000074505806], [0.8812500238418579, 0.706250011920929, 0.02500000037252903, 0.02500000037252903], [0.8812500238418579, 0.706250011920929, 0.05000000074505806, 0.05000000074505806], [0.893750011920929, 0.706250011920929, 0.02500000037252903, 0.02500000037252903], [0.893750011920929, 0.706250011920929, 0.05000000074505806, 0.05000000074505806], [0.90625, 0.706250011920929, 0.02500000037252903, 0.02500000037252903], [0.90625, 0.706250011920929, 0.05000000074505806, 0.05000000074505806], [0.918749988079071, 0.706250011920929, 0.02500000037252903, 0.02500000037252903], [0.918749988079071, 0.706250011920929, 0.05000000074505806, 0.05000000074505806], [0.9312499761581421, 0.706250011920929, 0.02500000037252903, 0.02500000037252903], [0.9312499761581421, 0.706250011920929, 0.05000000074505806, 0.05000000074505806], [0.9437500238418579, 0.706250011920929, 0.02500000037252903, 0.02500000037252903], [0.9437500238418579, 0.706250011920929, 0.05000000074505806, 0.05000000074505806], [0.956250011920929, 0.706250011920929, 0.02500000037252903, 0.02500000037252903], [0.956250011920929, 0.706250011920929, 0.05000000074505806, 0.05000000074505806], [0.96875, 0.706250011920929, 0.02500000037252903, 0.02500000037252903], [0.96875, 0.706250011920929, 0.05000000074505806, 0.05000000074505806], [0.981249988079071, 0.706250011920929, 0.02500000037252903, 0.02500000037252903], [0.981249988079071, 0.706250011920929, 0.05000000074505806, 0.05000000074505806], [0.9937499761581421, 0.706250011920929, 0.02500000037252903, 0.02500000037252903], [0.9937499761581421, 0.706250011920929, 0.05000000074505806, 0.05000000074505806], [0.0062500000931322575, 0.71875, 0.02500000037252903, 0.02500000037252903], [0.0062500000931322575, 0.71875, 0.05000000074505806, 0.05000000074505806], [0.01875000074505806, 0.71875, 0.02500000037252903, 0.02500000037252903], [0.01875000074505806, 0.71875, 0.05000000074505806, 0.05000000074505806], [0.03125, 0.71875, 0.02500000037252903, 0.02500000037252903], [0.03125, 0.71875, 0.05000000074505806, 0.05000000074505806], [0.04374999925494194, 0.71875, 0.02500000037252903, 0.02500000037252903], [0.04374999925494194, 0.71875, 0.05000000074505806, 0.05000000074505806], [0.05624999850988388, 0.71875, 0.02500000037252903, 0.02500000037252903], [0.05624999850988388, 0.71875, 0.05000000074505806, 0.05000000074505806], [0.06875000149011612, 0.71875, 0.02500000037252903, 0.02500000037252903], [0.06875000149011612, 0.71875, 0.05000000074505806, 0.05000000074505806], [0.08124999701976776, 0.71875, 0.02500000037252903, 0.02500000037252903], [0.08124999701976776, 0.71875, 0.05000000074505806, 0.05000000074505806], [0.09375, 0.71875, 0.02500000037252903, 0.02500000037252903], [0.09375, 0.71875, 0.05000000074505806, 0.05000000074505806], [0.10625000298023224, 0.71875, 0.02500000037252903, 0.02500000037252903], [0.10625000298023224, 0.71875, 0.05000000074505806, 0.05000000074505806], [0.11874999850988388, 0.71875, 0.02500000037252903, 0.02500000037252903], [0.11874999850988388, 0.71875, 0.05000000074505806, 0.05000000074505806], [0.13124999403953552, 0.71875, 0.02500000037252903, 0.02500000037252903], [0.13124999403953552, 0.71875, 0.05000000074505806, 0.05000000074505806], [0.14374999701976776, 0.71875, 0.02500000037252903, 0.02500000037252903], [0.14374999701976776, 0.71875, 0.05000000074505806, 0.05000000074505806], [0.15625, 0.71875, 0.02500000037252903, 0.02500000037252903], [0.15625, 0.71875, 0.05000000074505806, 0.05000000074505806], [0.16875000298023224, 0.71875, 0.02500000037252903, 0.02500000037252903], [0.16875000298023224, 0.71875, 0.05000000074505806, 0.05000000074505806], [0.18125000596046448, 0.71875, 0.02500000037252903, 0.02500000037252903], [0.18125000596046448, 0.71875, 0.05000000074505806, 0.05000000074505806], [0.19374999403953552, 0.71875, 0.02500000037252903, 0.02500000037252903], [0.19374999403953552, 0.71875, 0.05000000074505806, 0.05000000074505806], [0.20624999701976776, 0.71875, 0.02500000037252903, 0.02500000037252903], [0.20624999701976776, 0.71875, 0.05000000074505806, 0.05000000074505806], [0.21875, 0.71875, 0.02500000037252903, 0.02500000037252903], [0.21875, 0.71875, 0.05000000074505806, 0.05000000074505806], [0.23125000298023224, 0.71875, 0.02500000037252903, 0.02500000037252903], [0.23125000298023224, 0.71875, 0.05000000074505806, 0.05000000074505806], [0.24375000596046448, 0.71875, 0.02500000037252903, 0.02500000037252903], [0.24375000596046448, 0.71875, 0.05000000074505806, 0.05000000074505806], [0.2562499940395355, 0.71875, 0.02500000037252903, 0.02500000037252903], [0.2562499940395355, 0.71875, 0.05000000074505806, 0.05000000074505806], [0.26875001192092896, 0.71875, 0.02500000037252903, 0.02500000037252903], [0.26875001192092896, 0.71875, 0.05000000074505806, 0.05000000074505806], [0.28125, 0.71875, 0.02500000037252903, 0.02500000037252903], [0.28125, 0.71875, 0.05000000074505806, 0.05000000074505806], [0.29374998807907104, 0.71875, 0.02500000037252903, 0.02500000037252903], [0.29374998807907104, 0.71875, 0.05000000074505806, 0.05000000074505806], [0.3062500059604645, 0.71875, 0.02500000037252903, 0.02500000037252903], [0.3062500059604645, 0.71875, 0.05000000074505806, 0.05000000074505806], [0.3187499940395355, 0.71875, 0.02500000037252903, 0.02500000037252903], [0.3187499940395355, 0.71875, 0.05000000074505806, 0.05000000074505806], [0.33125001192092896, 0.71875, 0.02500000037252903, 0.02500000037252903], [0.33125001192092896, 0.71875, 0.05000000074505806, 0.05000000074505806], [0.34375, 0.71875, 0.02500000037252903, 0.02500000037252903], [0.34375, 0.71875, 0.05000000074505806, 0.05000000074505806], [0.35624998807907104, 0.71875, 0.02500000037252903, 0.02500000037252903], [0.35624998807907104, 0.71875, 0.05000000074505806, 0.05000000074505806], [0.3687500059604645, 0.71875, 0.02500000037252903, 0.02500000037252903], [0.3687500059604645, 0.71875, 0.05000000074505806, 0.05000000074505806], [0.3812499940395355, 0.71875, 0.02500000037252903, 0.02500000037252903], [0.3812499940395355, 0.71875, 0.05000000074505806, 0.05000000074505806], [0.39375001192092896, 0.71875, 0.02500000037252903, 0.02500000037252903], [0.39375001192092896, 0.71875, 0.05000000074505806, 0.05000000074505806], [0.40625, 0.71875, 0.02500000037252903, 0.02500000037252903], [0.40625, 0.71875, 0.05000000074505806, 0.05000000074505806], [0.41874998807907104, 0.71875, 0.02500000037252903, 0.02500000037252903], [0.41874998807907104, 0.71875, 0.05000000074505806, 0.05000000074505806], [0.4312500059604645, 0.71875, 0.02500000037252903, 0.02500000037252903], [0.4312500059604645, 0.71875, 0.05000000074505806, 0.05000000074505806], [0.4437499940395355, 0.71875, 0.02500000037252903, 0.02500000037252903], [0.4437499940395355, 0.71875, 0.05000000074505806, 0.05000000074505806], [0.45625001192092896, 0.71875, 0.02500000037252903, 0.02500000037252903], [0.45625001192092896, 0.71875, 0.05000000074505806, 0.05000000074505806], [0.46875, 0.71875, 0.02500000037252903, 0.02500000037252903], [0.46875, 0.71875, 0.05000000074505806, 0.05000000074505806], [0.48124998807907104, 0.71875, 0.02500000037252903, 0.02500000037252903], [0.48124998807907104, 0.71875, 0.05000000074505806, 0.05000000074505806], [0.4937500059604645, 0.71875, 0.02500000037252903, 0.02500000037252903], [0.4937500059604645, 0.71875, 0.05000000074505806, 0.05000000074505806], [0.5062500238418579, 0.71875, 0.02500000037252903, 0.02500000037252903], [0.5062500238418579, 0.71875, 0.05000000074505806, 0.05000000074505806], [0.518750011920929, 0.71875, 0.02500000037252903, 0.02500000037252903], [0.518750011920929, 0.71875, 0.05000000074505806, 0.05000000074505806], [0.53125, 0.71875, 0.02500000037252903, 0.02500000037252903], [0.53125, 0.71875, 0.05000000074505806, 0.05000000074505806], [0.543749988079071, 0.71875, 0.02500000037252903, 0.02500000037252903], [0.543749988079071, 0.71875, 0.05000000074505806, 0.05000000074505806], [0.5562499761581421, 0.71875, 0.02500000037252903, 0.02500000037252903], [0.5562499761581421, 0.71875, 0.05000000074505806, 0.05000000074505806], [0.5687500238418579, 0.71875, 0.02500000037252903, 0.02500000037252903], [0.5687500238418579, 0.71875, 0.05000000074505806, 0.05000000074505806], [0.581250011920929, 0.71875, 0.02500000037252903, 0.02500000037252903], [0.581250011920929, 0.71875, 0.05000000074505806, 0.05000000074505806], [0.59375, 0.71875, 0.02500000037252903, 0.02500000037252903], [0.59375, 0.71875, 0.05000000074505806, 0.05000000074505806], [0.606249988079071, 0.71875, 0.02500000037252903, 0.02500000037252903], [0.606249988079071, 0.71875, 0.05000000074505806, 0.05000000074505806], [0.6187499761581421, 0.71875, 0.02500000037252903, 0.02500000037252903], [0.6187499761581421, 0.71875, 0.05000000074505806, 0.05000000074505806], [0.6312500238418579, 0.71875, 0.02500000037252903, 0.02500000037252903], [0.6312500238418579, 0.71875, 0.05000000074505806, 0.05000000074505806], [0.643750011920929, 0.71875, 0.02500000037252903, 0.02500000037252903], [0.643750011920929, 0.71875, 0.05000000074505806, 0.05000000074505806], [0.65625, 0.71875, 0.02500000037252903, 0.02500000037252903], [0.65625, 0.71875, 0.05000000074505806, 0.05000000074505806], [0.668749988079071, 0.71875, 0.02500000037252903, 0.02500000037252903], [0.668749988079071, 0.71875, 0.05000000074505806, 0.05000000074505806], [0.6812499761581421, 0.71875, 0.02500000037252903, 0.02500000037252903], [0.6812499761581421, 0.71875, 0.05000000074505806, 0.05000000074505806], [0.6937500238418579, 0.71875, 0.02500000037252903, 0.02500000037252903], [0.6937500238418579, 0.71875, 0.05000000074505806, 0.05000000074505806], [0.706250011920929, 0.71875, 0.02500000037252903, 0.02500000037252903], [0.706250011920929, 0.71875, 0.05000000074505806, 0.05000000074505806], [0.71875, 0.71875, 0.02500000037252903, 0.02500000037252903], [0.71875, 0.71875, 0.05000000074505806, 0.05000000074505806], [0.731249988079071, 0.71875, 0.02500000037252903, 0.02500000037252903], [0.731249988079071, 0.71875, 0.05000000074505806, 0.05000000074505806], [0.7437499761581421, 0.71875, 0.02500000037252903, 0.02500000037252903], [0.7437499761581421, 0.71875, 0.05000000074505806, 0.05000000074505806], [0.7562500238418579, 0.71875, 0.02500000037252903, 0.02500000037252903], [0.7562500238418579, 0.71875, 0.05000000074505806, 0.05000000074505806], [0.768750011920929, 0.71875, 0.02500000037252903, 0.02500000037252903], [0.768750011920929, 0.71875, 0.05000000074505806, 0.05000000074505806], [0.78125, 0.71875, 0.02500000037252903, 0.02500000037252903], [0.78125, 0.71875, 0.05000000074505806, 0.05000000074505806], [0.793749988079071, 0.71875, 0.02500000037252903, 0.02500000037252903], [0.793749988079071, 0.71875, 0.05000000074505806, 0.05000000074505806], [0.8062499761581421, 0.71875, 0.02500000037252903, 0.02500000037252903], [0.8062499761581421, 0.71875, 0.05000000074505806, 0.05000000074505806], [0.8187500238418579, 0.71875, 0.02500000037252903, 0.02500000037252903], [0.8187500238418579, 0.71875, 0.05000000074505806, 0.05000000074505806], [0.831250011920929, 0.71875, 0.02500000037252903, 0.02500000037252903], [0.831250011920929, 0.71875, 0.05000000074505806, 0.05000000074505806], [0.84375, 0.71875, 0.02500000037252903, 0.02500000037252903], [0.84375, 0.71875, 0.05000000074505806, 0.05000000074505806], [0.856249988079071, 0.71875, 0.02500000037252903, 0.02500000037252903], [0.856249988079071, 0.71875, 0.05000000074505806, 0.05000000074505806], [0.8687499761581421, 0.71875, 0.02500000037252903, 0.02500000037252903], [0.8687499761581421, 0.71875, 0.05000000074505806, 0.05000000074505806], [0.8812500238418579, 0.71875, 0.02500000037252903, 0.02500000037252903], [0.8812500238418579, 0.71875, 0.05000000074505806, 0.05000000074505806], [0.893750011920929, 0.71875, 0.02500000037252903, 0.02500000037252903], [0.893750011920929, 0.71875, 0.05000000074505806, 0.05000000074505806], [0.90625, 0.71875, 0.02500000037252903, 0.02500000037252903], [0.90625, 0.71875, 0.05000000074505806, 0.05000000074505806], [0.918749988079071, 0.71875, 0.02500000037252903, 0.02500000037252903], [0.918749988079071, 0.71875, 0.05000000074505806, 0.05000000074505806], [0.9312499761581421, 0.71875, 0.02500000037252903, 0.02500000037252903], [0.9312499761581421, 0.71875, 0.05000000074505806, 0.05000000074505806], [0.9437500238418579, 0.71875, 0.02500000037252903, 0.02500000037252903], [0.9437500238418579, 0.71875, 0.05000000074505806, 0.05000000074505806], [0.956250011920929, 0.71875, 0.02500000037252903, 0.02500000037252903], [0.956250011920929, 0.71875, 0.05000000074505806, 0.05000000074505806], [0.96875, 0.71875, 0.02500000037252903, 0.02500000037252903], [0.96875, 0.71875, 0.05000000074505806, 0.05000000074505806], [0.981249988079071, 0.71875, 0.02500000037252903, 0.02500000037252903], [0.981249988079071, 0.71875, 0.05000000074505806, 0.05000000074505806], [0.9937499761581421, 0.71875, 0.02500000037252903, 0.02500000037252903], [0.9937499761581421, 0.71875, 0.05000000074505806, 0.05000000074505806], [0.0062500000931322575, 0.731249988079071, 0.02500000037252903, 0.02500000037252903], [0.0062500000931322575, 0.731249988079071, 0.05000000074505806, 0.05000000074505806], [0.01875000074505806, 0.731249988079071, 0.02500000037252903, 0.02500000037252903], [0.01875000074505806, 0.731249988079071, 0.05000000074505806, 0.05000000074505806], [0.03125, 0.731249988079071, 0.02500000037252903, 0.02500000037252903], [0.03125, 0.731249988079071, 0.05000000074505806, 0.05000000074505806], [0.04374999925494194, 0.731249988079071, 0.02500000037252903, 0.02500000037252903], [0.04374999925494194, 0.731249988079071, 0.05000000074505806, 0.05000000074505806], [0.05624999850988388, 0.731249988079071, 0.02500000037252903, 0.02500000037252903], [0.05624999850988388, 0.731249988079071, 0.05000000074505806, 0.05000000074505806], [0.06875000149011612, 0.731249988079071, 0.02500000037252903, 0.02500000037252903], [0.06875000149011612, 0.731249988079071, 0.05000000074505806, 0.05000000074505806], [0.08124999701976776, 0.731249988079071, 0.02500000037252903, 0.02500000037252903], [0.08124999701976776, 0.731249988079071, 0.05000000074505806, 0.05000000074505806], [0.09375, 0.731249988079071, 0.02500000037252903, 0.02500000037252903], [0.09375, 0.731249988079071, 0.05000000074505806, 0.05000000074505806], [0.10625000298023224, 0.731249988079071, 0.02500000037252903, 0.02500000037252903], [0.10625000298023224, 0.731249988079071, 0.05000000074505806, 0.05000000074505806], [0.11874999850988388, 0.731249988079071, 0.02500000037252903, 0.02500000037252903], [0.11874999850988388, 0.731249988079071, 0.05000000074505806, 0.05000000074505806], [0.13124999403953552, 0.731249988079071, 0.02500000037252903, 0.02500000037252903], [0.13124999403953552, 0.731249988079071, 0.05000000074505806, 0.05000000074505806], [0.14374999701976776, 0.731249988079071, 0.02500000037252903, 0.02500000037252903], [0.14374999701976776, 0.731249988079071, 0.05000000074505806, 0.05000000074505806], [0.15625, 0.731249988079071, 0.02500000037252903, 0.02500000037252903], [0.15625, 0.731249988079071, 0.05000000074505806, 0.05000000074505806], [0.16875000298023224, 0.731249988079071, 0.02500000037252903, 0.02500000037252903], [0.16875000298023224, 0.731249988079071, 0.05000000074505806, 0.05000000074505806], [0.18125000596046448, 0.731249988079071, 0.02500000037252903, 0.02500000037252903], [0.18125000596046448, 0.731249988079071, 0.05000000074505806, 0.05000000074505806], [0.19374999403953552, 0.731249988079071, 0.02500000037252903, 0.02500000037252903], [0.19374999403953552, 0.731249988079071, 0.05000000074505806, 0.05000000074505806], [0.20624999701976776, 0.731249988079071, 0.02500000037252903, 0.02500000037252903], [0.20624999701976776, 0.731249988079071, 0.05000000074505806, 0.05000000074505806], [0.21875, 0.731249988079071, 0.02500000037252903, 0.02500000037252903], [0.21875, 0.731249988079071, 0.05000000074505806, 0.05000000074505806], [0.23125000298023224, 0.731249988079071, 0.02500000037252903, 0.02500000037252903], [0.23125000298023224, 0.731249988079071, 0.05000000074505806, 0.05000000074505806], [0.24375000596046448, 0.731249988079071, 0.02500000037252903, 0.02500000037252903], [0.24375000596046448, 0.731249988079071, 0.05000000074505806, 0.05000000074505806], [0.2562499940395355, 0.731249988079071, 0.02500000037252903, 0.02500000037252903], [0.2562499940395355, 0.731249988079071, 0.05000000074505806, 0.05000000074505806], [0.26875001192092896, 0.731249988079071, 0.02500000037252903, 0.02500000037252903], [0.26875001192092896, 0.731249988079071, 0.05000000074505806, 0.05000000074505806], [0.28125, 0.731249988079071, 0.02500000037252903, 0.02500000037252903], [0.28125, 0.731249988079071, 0.05000000074505806, 0.05000000074505806], [0.29374998807907104, 0.731249988079071, 0.02500000037252903, 0.02500000037252903], [0.29374998807907104, 0.731249988079071, 0.05000000074505806, 0.05000000074505806], [0.3062500059604645, 0.731249988079071, 0.02500000037252903, 0.02500000037252903], [0.3062500059604645, 0.731249988079071, 0.05000000074505806, 0.05000000074505806], [0.3187499940395355, 0.731249988079071, 0.02500000037252903, 0.02500000037252903], [0.3187499940395355, 0.731249988079071, 0.05000000074505806, 0.05000000074505806], [0.33125001192092896, 0.731249988079071, 0.02500000037252903, 0.02500000037252903], [0.33125001192092896, 0.731249988079071, 0.05000000074505806, 0.05000000074505806], [0.34375, 0.731249988079071, 0.02500000037252903, 0.02500000037252903], [0.34375, 0.731249988079071, 0.05000000074505806, 0.05000000074505806], [0.35624998807907104, 0.731249988079071, 0.02500000037252903, 0.02500000037252903], [0.35624998807907104, 0.731249988079071, 0.05000000074505806, 0.05000000074505806], [0.3687500059604645, 0.731249988079071, 0.02500000037252903, 0.02500000037252903], [0.3687500059604645, 0.731249988079071, 0.05000000074505806, 0.05000000074505806], [0.3812499940395355, 0.731249988079071, 0.02500000037252903, 0.02500000037252903], [0.3812499940395355, 0.731249988079071, 0.05000000074505806, 0.05000000074505806], [0.39375001192092896, 0.731249988079071, 0.02500000037252903, 0.02500000037252903], [0.39375001192092896, 0.731249988079071, 0.05000000074505806, 0.05000000074505806], [0.40625, 0.731249988079071, 0.02500000037252903, 0.02500000037252903], [0.40625, 0.731249988079071, 0.05000000074505806, 0.05000000074505806], [0.41874998807907104, 0.731249988079071, 0.02500000037252903, 0.02500000037252903], [0.41874998807907104, 0.731249988079071, 0.05000000074505806, 0.05000000074505806], [0.4312500059604645, 0.731249988079071, 0.02500000037252903, 0.02500000037252903], [0.4312500059604645, 0.731249988079071, 0.05000000074505806, 0.05000000074505806], [0.4437499940395355, 0.731249988079071, 0.02500000037252903, 0.02500000037252903], [0.4437499940395355, 0.731249988079071, 0.05000000074505806, 0.05000000074505806], [0.45625001192092896, 0.731249988079071, 0.02500000037252903, 0.02500000037252903], [0.45625001192092896, 0.731249988079071, 0.05000000074505806, 0.05000000074505806], [0.46875, 0.731249988079071, 0.02500000037252903, 0.02500000037252903], [0.46875, 0.731249988079071, 0.05000000074505806, 0.05000000074505806], [0.48124998807907104, 0.731249988079071, 0.02500000037252903, 0.02500000037252903], [0.48124998807907104, 0.731249988079071, 0.05000000074505806, 0.05000000074505806], [0.4937500059604645, 0.731249988079071, 0.02500000037252903, 0.02500000037252903], [0.4937500059604645, 0.731249988079071, 0.05000000074505806, 0.05000000074505806], [0.5062500238418579, 0.731249988079071, 0.02500000037252903, 0.02500000037252903], [0.5062500238418579, 0.731249988079071, 0.05000000074505806, 0.05000000074505806], [0.518750011920929, 0.731249988079071, 0.02500000037252903, 0.02500000037252903], [0.518750011920929, 0.731249988079071, 0.05000000074505806, 0.05000000074505806], [0.53125, 0.731249988079071, 0.02500000037252903, 0.02500000037252903], [0.53125, 0.731249988079071, 0.05000000074505806, 0.05000000074505806], [0.543749988079071, 0.731249988079071, 0.02500000037252903, 0.02500000037252903], [0.543749988079071, 0.731249988079071, 0.05000000074505806, 0.05000000074505806], [0.5562499761581421, 0.731249988079071, 0.02500000037252903, 0.02500000037252903], [0.5562499761581421, 0.731249988079071, 0.05000000074505806, 0.05000000074505806], [0.5687500238418579, 0.731249988079071, 0.02500000037252903, 0.02500000037252903], [0.5687500238418579, 0.731249988079071, 0.05000000074505806, 0.05000000074505806], [0.581250011920929, 0.731249988079071, 0.02500000037252903, 0.02500000037252903], [0.581250011920929, 0.731249988079071, 0.05000000074505806, 0.05000000074505806], [0.59375, 0.731249988079071, 0.02500000037252903, 0.02500000037252903], [0.59375, 0.731249988079071, 0.05000000074505806, 0.05000000074505806], [0.606249988079071, 0.731249988079071, 0.02500000037252903, 0.02500000037252903], [0.606249988079071, 0.731249988079071, 0.05000000074505806, 0.05000000074505806], [0.6187499761581421, 0.731249988079071, 0.02500000037252903, 0.02500000037252903], [0.6187499761581421, 0.731249988079071, 0.05000000074505806, 0.05000000074505806], [0.6312500238418579, 0.731249988079071, 0.02500000037252903, 0.02500000037252903], [0.6312500238418579, 0.731249988079071, 0.05000000074505806, 0.05000000074505806], [0.643750011920929, 0.731249988079071, 0.02500000037252903, 0.02500000037252903], [0.643750011920929, 0.731249988079071, 0.05000000074505806, 0.05000000074505806], [0.65625, 0.731249988079071, 0.02500000037252903, 0.02500000037252903], [0.65625, 0.731249988079071, 0.05000000074505806, 0.05000000074505806], [0.668749988079071, 0.731249988079071, 0.02500000037252903, 0.02500000037252903], [0.668749988079071, 0.731249988079071, 0.05000000074505806, 0.05000000074505806], [0.6812499761581421, 0.731249988079071, 0.02500000037252903, 0.02500000037252903], [0.6812499761581421, 0.731249988079071, 0.05000000074505806, 0.05000000074505806], [0.6937500238418579, 0.731249988079071, 0.02500000037252903, 0.02500000037252903], [0.6937500238418579, 0.731249988079071, 0.05000000074505806, 0.05000000074505806], [0.706250011920929, 0.731249988079071, 0.02500000037252903, 0.02500000037252903], [0.706250011920929, 0.731249988079071, 0.05000000074505806, 0.05000000074505806], [0.71875, 0.731249988079071, 0.02500000037252903, 0.02500000037252903], [0.71875, 0.731249988079071, 0.05000000074505806, 0.05000000074505806], [0.731249988079071, 0.731249988079071, 0.02500000037252903, 0.02500000037252903], [0.731249988079071, 0.731249988079071, 0.05000000074505806, 0.05000000074505806], [0.7437499761581421, 0.731249988079071, 0.02500000037252903, 0.02500000037252903], [0.7437499761581421, 0.731249988079071, 0.05000000074505806, 0.05000000074505806], [0.7562500238418579, 0.731249988079071, 0.02500000037252903, 0.02500000037252903], [0.7562500238418579, 0.731249988079071, 0.05000000074505806, 0.05000000074505806], [0.768750011920929, 0.731249988079071, 0.02500000037252903, 0.02500000037252903], [0.768750011920929, 0.731249988079071, 0.05000000074505806, 0.05000000074505806], [0.78125, 0.731249988079071, 0.02500000037252903, 0.02500000037252903], [0.78125, 0.731249988079071, 0.05000000074505806, 0.05000000074505806], [0.793749988079071, 0.731249988079071, 0.02500000037252903, 0.02500000037252903], [0.793749988079071, 0.731249988079071, 0.05000000074505806, 0.05000000074505806], [0.8062499761581421, 0.731249988079071, 0.02500000037252903, 0.02500000037252903], [0.8062499761581421, 0.731249988079071, 0.05000000074505806, 0.05000000074505806], [0.8187500238418579, 0.731249988079071, 0.02500000037252903, 0.02500000037252903], [0.8187500238418579, 0.731249988079071, 0.05000000074505806, 0.05000000074505806], [0.831250011920929, 0.731249988079071, 0.02500000037252903, 0.02500000037252903], [0.831250011920929, 0.731249988079071, 0.05000000074505806, 0.05000000074505806], [0.84375, 0.731249988079071, 0.02500000037252903, 0.02500000037252903], [0.84375, 0.731249988079071, 0.05000000074505806, 0.05000000074505806], [0.856249988079071, 0.731249988079071, 0.02500000037252903, 0.02500000037252903], [0.856249988079071, 0.731249988079071, 0.05000000074505806, 0.05000000074505806], [0.8687499761581421, 0.731249988079071, 0.02500000037252903, 0.02500000037252903], [0.8687499761581421, 0.731249988079071, 0.05000000074505806, 0.05000000074505806], [0.8812500238418579, 0.731249988079071, 0.02500000037252903, 0.02500000037252903], [0.8812500238418579, 0.731249988079071, 0.05000000074505806, 0.05000000074505806], [0.893750011920929, 0.731249988079071, 0.02500000037252903, 0.02500000037252903], [0.893750011920929, 0.731249988079071, 0.05000000074505806, 0.05000000074505806], [0.90625, 0.731249988079071, 0.02500000037252903, 0.02500000037252903], [0.90625, 0.731249988079071, 0.05000000074505806, 0.05000000074505806], [0.918749988079071, 0.731249988079071, 0.02500000037252903, 0.02500000037252903], [0.918749988079071, 0.731249988079071, 0.05000000074505806, 0.05000000074505806], [0.9312499761581421, 0.731249988079071, 0.02500000037252903, 0.02500000037252903], [0.9312499761581421, 0.731249988079071, 0.05000000074505806, 0.05000000074505806], [0.9437500238418579, 0.731249988079071, 0.02500000037252903, 0.02500000037252903], [0.9437500238418579, 0.731249988079071, 0.05000000074505806, 0.05000000074505806], [0.956250011920929, 0.731249988079071, 0.02500000037252903, 0.02500000037252903], [0.956250011920929, 0.731249988079071, 0.05000000074505806, 0.05000000074505806], [0.96875, 0.731249988079071, 0.02500000037252903, 0.02500000037252903], [0.96875, 0.731249988079071, 0.05000000074505806, 0.05000000074505806], [0.981249988079071, 0.731249988079071, 0.02500000037252903, 0.02500000037252903], [0.981249988079071, 0.731249988079071, 0.05000000074505806, 0.05000000074505806], [0.9937499761581421, 0.731249988079071, 0.02500000037252903, 0.02500000037252903], [0.9937499761581421, 0.731249988079071, 0.05000000074505806, 0.05000000074505806], [0.0062500000931322575, 0.7437499761581421, 0.02500000037252903, 0.02500000037252903], [0.0062500000931322575, 0.7437499761581421, 0.05000000074505806, 0.05000000074505806], [0.01875000074505806, 0.7437499761581421, 0.02500000037252903, 0.02500000037252903], [0.01875000074505806, 0.7437499761581421, 0.05000000074505806, 0.05000000074505806], [0.03125, 0.7437499761581421, 0.02500000037252903, 0.02500000037252903], [0.03125, 0.7437499761581421, 0.05000000074505806, 0.05000000074505806], [0.04374999925494194, 0.7437499761581421, 0.02500000037252903, 0.02500000037252903], [0.04374999925494194, 0.7437499761581421, 0.05000000074505806, 0.05000000074505806], [0.05624999850988388, 0.7437499761581421, 0.02500000037252903, 0.02500000037252903], [0.05624999850988388, 0.7437499761581421, 0.05000000074505806, 0.05000000074505806], [0.06875000149011612, 0.7437499761581421, 0.02500000037252903, 0.02500000037252903], [0.06875000149011612, 0.7437499761581421, 0.05000000074505806, 0.05000000074505806], [0.08124999701976776, 0.7437499761581421, 0.02500000037252903, 0.02500000037252903], [0.08124999701976776, 0.7437499761581421, 0.05000000074505806, 0.05000000074505806], [0.09375, 0.7437499761581421, 0.02500000037252903, 0.02500000037252903], [0.09375, 0.7437499761581421, 0.05000000074505806, 0.05000000074505806], [0.10625000298023224, 0.7437499761581421, 0.02500000037252903, 0.02500000037252903], [0.10625000298023224, 0.7437499761581421, 0.05000000074505806, 0.05000000074505806], [0.11874999850988388, 0.7437499761581421, 0.02500000037252903, 0.02500000037252903], [0.11874999850988388, 0.7437499761581421, 0.05000000074505806, 0.05000000074505806], [0.13124999403953552, 0.7437499761581421, 0.02500000037252903, 0.02500000037252903], [0.13124999403953552, 0.7437499761581421, 0.05000000074505806, 0.05000000074505806], [0.14374999701976776, 0.7437499761581421, 0.02500000037252903, 0.02500000037252903], [0.14374999701976776, 0.7437499761581421, 0.05000000074505806, 0.05000000074505806], [0.15625, 0.7437499761581421, 0.02500000037252903, 0.02500000037252903], [0.15625, 0.7437499761581421, 0.05000000074505806, 0.05000000074505806], [0.16875000298023224, 0.7437499761581421, 0.02500000037252903, 0.02500000037252903], [0.16875000298023224, 0.7437499761581421, 0.05000000074505806, 0.05000000074505806], [0.18125000596046448, 0.7437499761581421, 0.02500000037252903, 0.02500000037252903], [0.18125000596046448, 0.7437499761581421, 0.05000000074505806, 0.05000000074505806], [0.19374999403953552, 0.7437499761581421, 0.02500000037252903, 0.02500000037252903], [0.19374999403953552, 0.7437499761581421, 0.05000000074505806, 0.05000000074505806], [0.20624999701976776, 0.7437499761581421, 0.02500000037252903, 0.02500000037252903], [0.20624999701976776, 0.7437499761581421, 0.05000000074505806, 0.05000000074505806], [0.21875, 0.7437499761581421, 0.02500000037252903, 0.02500000037252903], [0.21875, 0.7437499761581421, 0.05000000074505806, 0.05000000074505806], [0.23125000298023224, 0.7437499761581421, 0.02500000037252903, 0.02500000037252903], [0.23125000298023224, 0.7437499761581421, 0.05000000074505806, 0.05000000074505806], [0.24375000596046448, 0.7437499761581421, 0.02500000037252903, 0.02500000037252903], [0.24375000596046448, 0.7437499761581421, 0.05000000074505806, 0.05000000074505806], [0.2562499940395355, 0.7437499761581421, 0.02500000037252903, 0.02500000037252903], [0.2562499940395355, 0.7437499761581421, 0.05000000074505806, 0.05000000074505806], [0.26875001192092896, 0.7437499761581421, 0.02500000037252903, 0.02500000037252903], [0.26875001192092896, 0.7437499761581421, 0.05000000074505806, 0.05000000074505806], [0.28125, 0.7437499761581421, 0.02500000037252903, 0.02500000037252903], [0.28125, 0.7437499761581421, 0.05000000074505806, 0.05000000074505806], [0.29374998807907104, 0.7437499761581421, 0.02500000037252903, 0.02500000037252903], [0.29374998807907104, 0.7437499761581421, 0.05000000074505806, 0.05000000074505806], [0.3062500059604645, 0.7437499761581421, 0.02500000037252903, 0.02500000037252903], [0.3062500059604645, 0.7437499761581421, 0.05000000074505806, 0.05000000074505806], [0.3187499940395355, 0.7437499761581421, 0.02500000037252903, 0.02500000037252903], [0.3187499940395355, 0.7437499761581421, 0.05000000074505806, 0.05000000074505806], [0.33125001192092896, 0.7437499761581421, 0.02500000037252903, 0.02500000037252903], [0.33125001192092896, 0.7437499761581421, 0.05000000074505806, 0.05000000074505806], [0.34375, 0.7437499761581421, 0.02500000037252903, 0.02500000037252903], [0.34375, 0.7437499761581421, 0.05000000074505806, 0.05000000074505806], [0.35624998807907104, 0.7437499761581421, 0.02500000037252903, 0.02500000037252903], [0.35624998807907104, 0.7437499761581421, 0.05000000074505806, 0.05000000074505806], [0.3687500059604645, 0.7437499761581421, 0.02500000037252903, 0.02500000037252903], [0.3687500059604645, 0.7437499761581421, 0.05000000074505806, 0.05000000074505806], [0.3812499940395355, 0.7437499761581421, 0.02500000037252903, 0.02500000037252903], [0.3812499940395355, 0.7437499761581421, 0.05000000074505806, 0.05000000074505806], [0.39375001192092896, 0.7437499761581421, 0.02500000037252903, 0.02500000037252903], [0.39375001192092896, 0.7437499761581421, 0.05000000074505806, 0.05000000074505806], [0.40625, 0.7437499761581421, 0.02500000037252903, 0.02500000037252903], [0.40625, 0.7437499761581421, 0.05000000074505806, 0.05000000074505806], [0.41874998807907104, 0.7437499761581421, 0.02500000037252903, 0.02500000037252903], [0.41874998807907104, 0.7437499761581421, 0.05000000074505806, 0.05000000074505806], [0.4312500059604645, 0.7437499761581421, 0.02500000037252903, 0.02500000037252903], [0.4312500059604645, 0.7437499761581421, 0.05000000074505806, 0.05000000074505806], [0.4437499940395355, 0.7437499761581421, 0.02500000037252903, 0.02500000037252903], [0.4437499940395355, 0.7437499761581421, 0.05000000074505806, 0.05000000074505806], [0.45625001192092896, 0.7437499761581421, 0.02500000037252903, 0.02500000037252903], [0.45625001192092896, 0.7437499761581421, 0.05000000074505806, 0.05000000074505806], [0.46875, 0.7437499761581421, 0.02500000037252903, 0.02500000037252903], [0.46875, 0.7437499761581421, 0.05000000074505806, 0.05000000074505806], [0.48124998807907104, 0.7437499761581421, 0.02500000037252903, 0.02500000037252903], [0.48124998807907104, 0.7437499761581421, 0.05000000074505806, 0.05000000074505806], [0.4937500059604645, 0.7437499761581421, 0.02500000037252903, 0.02500000037252903], [0.4937500059604645, 0.7437499761581421, 0.05000000074505806, 0.05000000074505806], [0.5062500238418579, 0.7437499761581421, 0.02500000037252903, 0.02500000037252903], [0.5062500238418579, 0.7437499761581421, 0.05000000074505806, 0.05000000074505806], [0.518750011920929, 0.7437499761581421, 0.02500000037252903, 0.02500000037252903], [0.518750011920929, 0.7437499761581421, 0.05000000074505806, 0.05000000074505806], [0.53125, 0.7437499761581421, 0.02500000037252903, 0.02500000037252903], [0.53125, 0.7437499761581421, 0.05000000074505806, 0.05000000074505806], [0.543749988079071, 0.7437499761581421, 0.02500000037252903, 0.02500000037252903], [0.543749988079071, 0.7437499761581421, 0.05000000074505806, 0.05000000074505806], [0.5562499761581421, 0.7437499761581421, 0.02500000037252903, 0.02500000037252903], [0.5562499761581421, 0.7437499761581421, 0.05000000074505806, 0.05000000074505806], [0.5687500238418579, 0.7437499761581421, 0.02500000037252903, 0.02500000037252903], [0.5687500238418579, 0.7437499761581421, 0.05000000074505806, 0.05000000074505806], [0.581250011920929, 0.7437499761581421, 0.02500000037252903, 0.02500000037252903], [0.581250011920929, 0.7437499761581421, 0.05000000074505806, 0.05000000074505806], [0.59375, 0.7437499761581421, 0.02500000037252903, 0.02500000037252903], [0.59375, 0.7437499761581421, 0.05000000074505806, 0.05000000074505806], [0.606249988079071, 0.7437499761581421, 0.02500000037252903, 0.02500000037252903], [0.606249988079071, 0.7437499761581421, 0.05000000074505806, 0.05000000074505806], [0.6187499761581421, 0.7437499761581421, 0.02500000037252903, 0.02500000037252903], [0.6187499761581421, 0.7437499761581421, 0.05000000074505806, 0.05000000074505806], [0.6312500238418579, 0.7437499761581421, 0.02500000037252903, 0.02500000037252903], [0.6312500238418579, 0.7437499761581421, 0.05000000074505806, 0.05000000074505806], [0.643750011920929, 0.7437499761581421, 0.02500000037252903, 0.02500000037252903], [0.643750011920929, 0.7437499761581421, 0.05000000074505806, 0.05000000074505806], [0.65625, 0.7437499761581421, 0.02500000037252903, 0.02500000037252903], [0.65625, 0.7437499761581421, 0.05000000074505806, 0.05000000074505806], [0.668749988079071, 0.7437499761581421, 0.02500000037252903, 0.02500000037252903], [0.668749988079071, 0.7437499761581421, 0.05000000074505806, 0.05000000074505806], [0.6812499761581421, 0.7437499761581421, 0.02500000037252903, 0.02500000037252903], [0.6812499761581421, 0.7437499761581421, 0.05000000074505806, 0.05000000074505806], [0.6937500238418579, 0.7437499761581421, 0.02500000037252903, 0.02500000037252903], [0.6937500238418579, 0.7437499761581421, 0.05000000074505806, 0.05000000074505806], [0.706250011920929, 0.7437499761581421, 0.02500000037252903, 0.02500000037252903], [0.706250011920929, 0.7437499761581421, 0.05000000074505806, 0.05000000074505806], [0.71875, 0.7437499761581421, 0.02500000037252903, 0.02500000037252903], [0.71875, 0.7437499761581421, 0.05000000074505806, 0.05000000074505806], [0.731249988079071, 0.7437499761581421, 0.02500000037252903, 0.02500000037252903], [0.731249988079071, 0.7437499761581421, 0.05000000074505806, 0.05000000074505806], [0.7437499761581421, 0.7437499761581421, 0.02500000037252903, 0.02500000037252903], [0.7437499761581421, 0.7437499761581421, 0.05000000074505806, 0.05000000074505806], [0.7562500238418579, 0.7437499761581421, 0.02500000037252903, 0.02500000037252903], [0.7562500238418579, 0.7437499761581421, 0.05000000074505806, 0.05000000074505806], [0.768750011920929, 0.7437499761581421, 0.02500000037252903, 0.02500000037252903], [0.768750011920929, 0.7437499761581421, 0.05000000074505806, 0.05000000074505806], [0.78125, 0.7437499761581421, 0.02500000037252903, 0.02500000037252903], [0.78125, 0.7437499761581421, 0.05000000074505806, 0.05000000074505806], [0.793749988079071, 0.7437499761581421, 0.02500000037252903, 0.02500000037252903], [0.793749988079071, 0.7437499761581421, 0.05000000074505806, 0.05000000074505806], [0.8062499761581421, 0.7437499761581421, 0.02500000037252903, 0.02500000037252903], [0.8062499761581421, 0.7437499761581421, 0.05000000074505806, 0.05000000074505806], [0.8187500238418579, 0.7437499761581421, 0.02500000037252903, 0.02500000037252903], [0.8187500238418579, 0.7437499761581421, 0.05000000074505806, 0.05000000074505806], [0.831250011920929, 0.7437499761581421, 0.02500000037252903, 0.02500000037252903], [0.831250011920929, 0.7437499761581421, 0.05000000074505806, 0.05000000074505806], [0.84375, 0.7437499761581421, 0.02500000037252903, 0.02500000037252903], [0.84375, 0.7437499761581421, 0.05000000074505806, 0.05000000074505806], [0.856249988079071, 0.7437499761581421, 0.02500000037252903, 0.02500000037252903], [0.856249988079071, 0.7437499761581421, 0.05000000074505806, 0.05000000074505806], [0.8687499761581421, 0.7437499761581421, 0.02500000037252903, 0.02500000037252903], [0.8687499761581421, 0.7437499761581421, 0.05000000074505806, 0.05000000074505806], [0.8812500238418579, 0.7437499761581421, 0.02500000037252903, 0.02500000037252903], [0.8812500238418579, 0.7437499761581421, 0.05000000074505806, 0.05000000074505806], [0.893750011920929, 0.7437499761581421, 0.02500000037252903, 0.02500000037252903], [0.893750011920929, 0.7437499761581421, 0.05000000074505806, 0.05000000074505806], [0.90625, 0.7437499761581421, 0.02500000037252903, 0.02500000037252903], [0.90625, 0.7437499761581421, 0.05000000074505806, 0.05000000074505806], [0.918749988079071, 0.7437499761581421, 0.02500000037252903, 0.02500000037252903], [0.918749988079071, 0.7437499761581421, 0.05000000074505806, 0.05000000074505806], [0.9312499761581421, 0.7437499761581421, 0.02500000037252903, 0.02500000037252903], [0.9312499761581421, 0.7437499761581421, 0.05000000074505806, 0.05000000074505806], [0.9437500238418579, 0.7437499761581421, 0.02500000037252903, 0.02500000037252903], [0.9437500238418579, 0.7437499761581421, 0.05000000074505806, 0.05000000074505806], [0.956250011920929, 0.7437499761581421, 0.02500000037252903, 0.02500000037252903], [0.956250011920929, 0.7437499761581421, 0.05000000074505806, 0.05000000074505806], [0.96875, 0.7437499761581421, 0.02500000037252903, 0.02500000037252903], [0.96875, 0.7437499761581421, 0.05000000074505806, 0.05000000074505806], [0.981249988079071, 0.7437499761581421, 0.02500000037252903, 0.02500000037252903], [0.981249988079071, 0.7437499761581421, 0.05000000074505806, 0.05000000074505806], [0.9937499761581421, 0.7437499761581421, 0.02500000037252903, 0.02500000037252903], [0.9937499761581421, 0.7437499761581421, 0.05000000074505806, 0.05000000074505806], [0.0062500000931322575, 0.7562500238418579, 0.02500000037252903, 0.02500000037252903], [0.0062500000931322575, 0.7562500238418579, 0.05000000074505806, 0.05000000074505806], [0.01875000074505806, 0.7562500238418579, 0.02500000037252903, 0.02500000037252903], [0.01875000074505806, 0.7562500238418579, 0.05000000074505806, 0.05000000074505806], [0.03125, 0.7562500238418579, 0.02500000037252903, 0.02500000037252903], [0.03125, 0.7562500238418579, 0.05000000074505806, 0.05000000074505806], [0.04374999925494194, 0.7562500238418579, 0.02500000037252903, 0.02500000037252903], [0.04374999925494194, 0.7562500238418579, 0.05000000074505806, 0.05000000074505806], [0.05624999850988388, 0.7562500238418579, 0.02500000037252903, 0.02500000037252903], [0.05624999850988388, 0.7562500238418579, 0.05000000074505806, 0.05000000074505806], [0.06875000149011612, 0.7562500238418579, 0.02500000037252903, 0.02500000037252903], [0.06875000149011612, 0.7562500238418579, 0.05000000074505806, 0.05000000074505806], [0.08124999701976776, 0.7562500238418579, 0.02500000037252903, 0.02500000037252903], [0.08124999701976776, 0.7562500238418579, 0.05000000074505806, 0.05000000074505806], [0.09375, 0.7562500238418579, 0.02500000037252903, 0.02500000037252903], [0.09375, 0.7562500238418579, 0.05000000074505806, 0.05000000074505806], [0.10625000298023224, 0.7562500238418579, 0.02500000037252903, 0.02500000037252903], [0.10625000298023224, 0.7562500238418579, 0.05000000074505806, 0.05000000074505806], [0.11874999850988388, 0.7562500238418579, 0.02500000037252903, 0.02500000037252903], [0.11874999850988388, 0.7562500238418579, 0.05000000074505806, 0.05000000074505806], [0.13124999403953552, 0.7562500238418579, 0.02500000037252903, 0.02500000037252903], [0.13124999403953552, 0.7562500238418579, 0.05000000074505806, 0.05000000074505806], [0.14374999701976776, 0.7562500238418579, 0.02500000037252903, 0.02500000037252903], [0.14374999701976776, 0.7562500238418579, 0.05000000074505806, 0.05000000074505806], [0.15625, 0.7562500238418579, 0.02500000037252903, 0.02500000037252903], [0.15625, 0.7562500238418579, 0.05000000074505806, 0.05000000074505806], [0.16875000298023224, 0.7562500238418579, 0.02500000037252903, 0.02500000037252903], [0.16875000298023224, 0.7562500238418579, 0.05000000074505806, 0.05000000074505806], [0.18125000596046448, 0.7562500238418579, 0.02500000037252903, 0.02500000037252903], [0.18125000596046448, 0.7562500238418579, 0.05000000074505806, 0.05000000074505806], [0.19374999403953552, 0.7562500238418579, 0.02500000037252903, 0.02500000037252903], [0.19374999403953552, 0.7562500238418579, 0.05000000074505806, 0.05000000074505806], [0.20624999701976776, 0.7562500238418579, 0.02500000037252903, 0.02500000037252903], [0.20624999701976776, 0.7562500238418579, 0.05000000074505806, 0.05000000074505806], [0.21875, 0.7562500238418579, 0.02500000037252903, 0.02500000037252903], [0.21875, 0.7562500238418579, 0.05000000074505806, 0.05000000074505806], [0.23125000298023224, 0.7562500238418579, 0.02500000037252903, 0.02500000037252903], [0.23125000298023224, 0.7562500238418579, 0.05000000074505806, 0.05000000074505806], [0.24375000596046448, 0.7562500238418579, 0.02500000037252903, 0.02500000037252903], [0.24375000596046448, 0.7562500238418579, 0.05000000074505806, 0.05000000074505806], [0.2562499940395355, 0.7562500238418579, 0.02500000037252903, 0.02500000037252903], [0.2562499940395355, 0.7562500238418579, 0.05000000074505806, 0.05000000074505806], [0.26875001192092896, 0.7562500238418579, 0.02500000037252903, 0.02500000037252903], [0.26875001192092896, 0.7562500238418579, 0.05000000074505806, 0.05000000074505806], [0.28125, 0.7562500238418579, 0.02500000037252903, 0.02500000037252903], [0.28125, 0.7562500238418579, 0.05000000074505806, 0.05000000074505806], [0.29374998807907104, 0.7562500238418579, 0.02500000037252903, 0.02500000037252903], [0.29374998807907104, 0.7562500238418579, 0.05000000074505806, 0.05000000074505806], [0.3062500059604645, 0.7562500238418579, 0.02500000037252903, 0.02500000037252903], [0.3062500059604645, 0.7562500238418579, 0.05000000074505806, 0.05000000074505806], [0.3187499940395355, 0.7562500238418579, 0.02500000037252903, 0.02500000037252903], [0.3187499940395355, 0.7562500238418579, 0.05000000074505806, 0.05000000074505806], [0.33125001192092896, 0.7562500238418579, 0.02500000037252903, 0.02500000037252903], [0.33125001192092896, 0.7562500238418579, 0.05000000074505806, 0.05000000074505806], [0.34375, 0.7562500238418579, 0.02500000037252903, 0.02500000037252903], [0.34375, 0.7562500238418579, 0.05000000074505806, 0.05000000074505806], [0.35624998807907104, 0.7562500238418579, 0.02500000037252903, 0.02500000037252903], [0.35624998807907104, 0.7562500238418579, 0.05000000074505806, 0.05000000074505806], [0.3687500059604645, 0.7562500238418579, 0.02500000037252903, 0.02500000037252903], [0.3687500059604645, 0.7562500238418579, 0.05000000074505806, 0.05000000074505806], [0.3812499940395355, 0.7562500238418579, 0.02500000037252903, 0.02500000037252903], [0.3812499940395355, 0.7562500238418579, 0.05000000074505806, 0.05000000074505806], [0.39375001192092896, 0.7562500238418579, 0.02500000037252903, 0.02500000037252903], [0.39375001192092896, 0.7562500238418579, 0.05000000074505806, 0.05000000074505806], [0.40625, 0.7562500238418579, 0.02500000037252903, 0.02500000037252903], [0.40625, 0.7562500238418579, 0.05000000074505806, 0.05000000074505806], [0.41874998807907104, 0.7562500238418579, 0.02500000037252903, 0.02500000037252903], [0.41874998807907104, 0.7562500238418579, 0.05000000074505806, 0.05000000074505806], [0.4312500059604645, 0.7562500238418579, 0.02500000037252903, 0.02500000037252903], [0.4312500059604645, 0.7562500238418579, 0.05000000074505806, 0.05000000074505806], [0.4437499940395355, 0.7562500238418579, 0.02500000037252903, 0.02500000037252903], [0.4437499940395355, 0.7562500238418579, 0.05000000074505806, 0.05000000074505806], [0.45625001192092896, 0.7562500238418579, 0.02500000037252903, 0.02500000037252903], [0.45625001192092896, 0.7562500238418579, 0.05000000074505806, 0.05000000074505806], [0.46875, 0.7562500238418579, 0.02500000037252903, 0.02500000037252903], [0.46875, 0.7562500238418579, 0.05000000074505806, 0.05000000074505806], [0.48124998807907104, 0.7562500238418579, 0.02500000037252903, 0.02500000037252903], [0.48124998807907104, 0.7562500238418579, 0.05000000074505806, 0.05000000074505806], [0.4937500059604645, 0.7562500238418579, 0.02500000037252903, 0.02500000037252903], [0.4937500059604645, 0.7562500238418579, 0.05000000074505806, 0.05000000074505806], [0.5062500238418579, 0.7562500238418579, 0.02500000037252903, 0.02500000037252903], [0.5062500238418579, 0.7562500238418579, 0.05000000074505806, 0.05000000074505806], [0.518750011920929, 0.7562500238418579, 0.02500000037252903, 0.02500000037252903], [0.518750011920929, 0.7562500238418579, 0.05000000074505806, 0.05000000074505806], [0.53125, 0.7562500238418579, 0.02500000037252903, 0.02500000037252903], [0.53125, 0.7562500238418579, 0.05000000074505806, 0.05000000074505806], [0.543749988079071, 0.7562500238418579, 0.02500000037252903, 0.02500000037252903], [0.543749988079071, 0.7562500238418579, 0.05000000074505806, 0.05000000074505806], [0.5562499761581421, 0.7562500238418579, 0.02500000037252903, 0.02500000037252903], [0.5562499761581421, 0.7562500238418579, 0.05000000074505806, 0.05000000074505806], [0.5687500238418579, 0.7562500238418579, 0.02500000037252903, 0.02500000037252903], [0.5687500238418579, 0.7562500238418579, 0.05000000074505806, 0.05000000074505806], [0.581250011920929, 0.7562500238418579, 0.02500000037252903, 0.02500000037252903], [0.581250011920929, 0.7562500238418579, 0.05000000074505806, 0.05000000074505806], [0.59375, 0.7562500238418579, 0.02500000037252903, 0.02500000037252903], [0.59375, 0.7562500238418579, 0.05000000074505806, 0.05000000074505806], [0.606249988079071, 0.7562500238418579, 0.02500000037252903, 0.02500000037252903], [0.606249988079071, 0.7562500238418579, 0.05000000074505806, 0.05000000074505806], [0.6187499761581421, 0.7562500238418579, 0.02500000037252903, 0.02500000037252903], [0.6187499761581421, 0.7562500238418579, 0.05000000074505806, 0.05000000074505806], [0.6312500238418579, 0.7562500238418579, 0.02500000037252903, 0.02500000037252903], [0.6312500238418579, 0.7562500238418579, 0.05000000074505806, 0.05000000074505806], [0.643750011920929, 0.7562500238418579, 0.02500000037252903, 0.02500000037252903], [0.643750011920929, 0.7562500238418579, 0.05000000074505806, 0.05000000074505806], [0.65625, 0.7562500238418579, 0.02500000037252903, 0.02500000037252903], [0.65625, 0.7562500238418579, 0.05000000074505806, 0.05000000074505806], [0.668749988079071, 0.7562500238418579, 0.02500000037252903, 0.02500000037252903], [0.668749988079071, 0.7562500238418579, 0.05000000074505806, 0.05000000074505806], [0.6812499761581421, 0.7562500238418579, 0.02500000037252903, 0.02500000037252903], [0.6812499761581421, 0.7562500238418579, 0.05000000074505806, 0.05000000074505806], [0.6937500238418579, 0.7562500238418579, 0.02500000037252903, 0.02500000037252903], [0.6937500238418579, 0.7562500238418579, 0.05000000074505806, 0.05000000074505806], [0.706250011920929, 0.7562500238418579, 0.02500000037252903, 0.02500000037252903], [0.706250011920929, 0.7562500238418579, 0.05000000074505806, 0.05000000074505806], [0.71875, 0.7562500238418579, 0.02500000037252903, 0.02500000037252903], [0.71875, 0.7562500238418579, 0.05000000074505806, 0.05000000074505806], [0.731249988079071, 0.7562500238418579, 0.02500000037252903, 0.02500000037252903], [0.731249988079071, 0.7562500238418579, 0.05000000074505806, 0.05000000074505806], [0.7437499761581421, 0.7562500238418579, 0.02500000037252903, 0.02500000037252903], [0.7437499761581421, 0.7562500238418579, 0.05000000074505806, 0.05000000074505806], [0.7562500238418579, 0.7562500238418579, 0.02500000037252903, 0.02500000037252903], [0.7562500238418579, 0.7562500238418579, 0.05000000074505806, 0.05000000074505806], [0.768750011920929, 0.7562500238418579, 0.02500000037252903, 0.02500000037252903], [0.768750011920929, 0.7562500238418579, 0.05000000074505806, 0.05000000074505806], [0.78125, 0.7562500238418579, 0.02500000037252903, 0.02500000037252903], [0.78125, 0.7562500238418579, 0.05000000074505806, 0.05000000074505806], [0.793749988079071, 0.7562500238418579, 0.02500000037252903, 0.02500000037252903], [0.793749988079071, 0.7562500238418579, 0.05000000074505806, 0.05000000074505806], [0.8062499761581421, 0.7562500238418579, 0.02500000037252903, 0.02500000037252903], [0.8062499761581421, 0.7562500238418579, 0.05000000074505806, 0.05000000074505806], [0.8187500238418579, 0.7562500238418579, 0.02500000037252903, 0.02500000037252903], [0.8187500238418579, 0.7562500238418579, 0.05000000074505806, 0.05000000074505806], [0.831250011920929, 0.7562500238418579, 0.02500000037252903, 0.02500000037252903], [0.831250011920929, 0.7562500238418579, 0.05000000074505806, 0.05000000074505806], [0.84375, 0.7562500238418579, 0.02500000037252903, 0.02500000037252903], [0.84375, 0.7562500238418579, 0.05000000074505806, 0.05000000074505806], [0.856249988079071, 0.7562500238418579, 0.02500000037252903, 0.02500000037252903], [0.856249988079071, 0.7562500238418579, 0.05000000074505806, 0.05000000074505806], [0.8687499761581421, 0.7562500238418579, 0.02500000037252903, 0.02500000037252903], [0.8687499761581421, 0.7562500238418579, 0.05000000074505806, 0.05000000074505806], [0.8812500238418579, 0.7562500238418579, 0.02500000037252903, 0.02500000037252903], [0.8812500238418579, 0.7562500238418579, 0.05000000074505806, 0.05000000074505806], [0.893750011920929, 0.7562500238418579, 0.02500000037252903, 0.02500000037252903], [0.893750011920929, 0.7562500238418579, 0.05000000074505806, 0.05000000074505806], [0.90625, 0.7562500238418579, 0.02500000037252903, 0.02500000037252903], [0.90625, 0.7562500238418579, 0.05000000074505806, 0.05000000074505806], [0.918749988079071, 0.7562500238418579, 0.02500000037252903, 0.02500000037252903], [0.918749988079071, 0.7562500238418579, 0.05000000074505806, 0.05000000074505806], [0.9312499761581421, 0.7562500238418579, 0.02500000037252903, 0.02500000037252903], [0.9312499761581421, 0.7562500238418579, 0.05000000074505806, 0.05000000074505806], [0.9437500238418579, 0.7562500238418579, 0.02500000037252903, 0.02500000037252903], [0.9437500238418579, 0.7562500238418579, 0.05000000074505806, 0.05000000074505806], [0.956250011920929, 0.7562500238418579, 0.02500000037252903, 0.02500000037252903], [0.956250011920929, 0.7562500238418579, 0.05000000074505806, 0.05000000074505806], [0.96875, 0.7562500238418579, 0.02500000037252903, 0.02500000037252903], [0.96875, 0.7562500238418579, 0.05000000074505806, 0.05000000074505806], [0.981249988079071, 0.7562500238418579, 0.02500000037252903, 0.02500000037252903], [0.981249988079071, 0.7562500238418579, 0.05000000074505806, 0.05000000074505806], [0.9937499761581421, 0.7562500238418579, 0.02500000037252903, 0.02500000037252903], [0.9937499761581421, 0.7562500238418579, 0.05000000074505806, 0.05000000074505806], [0.0062500000931322575, 0.768750011920929, 0.02500000037252903, 0.02500000037252903], [0.0062500000931322575, 0.768750011920929, 0.05000000074505806, 0.05000000074505806], [0.01875000074505806, 0.768750011920929, 0.02500000037252903, 0.02500000037252903], [0.01875000074505806, 0.768750011920929, 0.05000000074505806, 0.05000000074505806], [0.03125, 0.768750011920929, 0.02500000037252903, 0.02500000037252903], [0.03125, 0.768750011920929, 0.05000000074505806, 0.05000000074505806], [0.04374999925494194, 0.768750011920929, 0.02500000037252903, 0.02500000037252903], [0.04374999925494194, 0.768750011920929, 0.05000000074505806, 0.05000000074505806], [0.05624999850988388, 0.768750011920929, 0.02500000037252903, 0.02500000037252903], [0.05624999850988388, 0.768750011920929, 0.05000000074505806, 0.05000000074505806], [0.06875000149011612, 0.768750011920929, 0.02500000037252903, 0.02500000037252903], [0.06875000149011612, 0.768750011920929, 0.05000000074505806, 0.05000000074505806], [0.08124999701976776, 0.768750011920929, 0.02500000037252903, 0.02500000037252903], [0.08124999701976776, 0.768750011920929, 0.05000000074505806, 0.05000000074505806], [0.09375, 0.768750011920929, 0.02500000037252903, 0.02500000037252903], [0.09375, 0.768750011920929, 0.05000000074505806, 0.05000000074505806], [0.10625000298023224, 0.768750011920929, 0.02500000037252903, 0.02500000037252903], [0.10625000298023224, 0.768750011920929, 0.05000000074505806, 0.05000000074505806], [0.11874999850988388, 0.768750011920929, 0.02500000037252903, 0.02500000037252903], [0.11874999850988388, 0.768750011920929, 0.05000000074505806, 0.05000000074505806], [0.13124999403953552, 0.768750011920929, 0.02500000037252903, 0.02500000037252903], [0.13124999403953552, 0.768750011920929, 0.05000000074505806, 0.05000000074505806], [0.14374999701976776, 0.768750011920929, 0.02500000037252903, 0.02500000037252903], [0.14374999701976776, 0.768750011920929, 0.05000000074505806, 0.05000000074505806], [0.15625, 0.768750011920929, 0.02500000037252903, 0.02500000037252903], [0.15625, 0.768750011920929, 0.05000000074505806, 0.05000000074505806], [0.16875000298023224, 0.768750011920929, 0.02500000037252903, 0.02500000037252903], [0.16875000298023224, 0.768750011920929, 0.05000000074505806, 0.05000000074505806], [0.18125000596046448, 0.768750011920929, 0.02500000037252903, 0.02500000037252903], [0.18125000596046448, 0.768750011920929, 0.05000000074505806, 0.05000000074505806], [0.19374999403953552, 0.768750011920929, 0.02500000037252903, 0.02500000037252903], [0.19374999403953552, 0.768750011920929, 0.05000000074505806, 0.05000000074505806], [0.20624999701976776, 0.768750011920929, 0.02500000037252903, 0.02500000037252903], [0.20624999701976776, 0.768750011920929, 0.05000000074505806, 0.05000000074505806], [0.21875, 0.768750011920929, 0.02500000037252903, 0.02500000037252903], [0.21875, 0.768750011920929, 0.05000000074505806, 0.05000000074505806], [0.23125000298023224, 0.768750011920929, 0.02500000037252903, 0.02500000037252903], [0.23125000298023224, 0.768750011920929, 0.05000000074505806, 0.05000000074505806], [0.24375000596046448, 0.768750011920929, 0.02500000037252903, 0.02500000037252903], [0.24375000596046448, 0.768750011920929, 0.05000000074505806, 0.05000000074505806], [0.2562499940395355, 0.768750011920929, 0.02500000037252903, 0.02500000037252903], [0.2562499940395355, 0.768750011920929, 0.05000000074505806, 0.05000000074505806], [0.26875001192092896, 0.768750011920929, 0.02500000037252903, 0.02500000037252903], [0.26875001192092896, 0.768750011920929, 0.05000000074505806, 0.05000000074505806], [0.28125, 0.768750011920929, 0.02500000037252903, 0.02500000037252903], [0.28125, 0.768750011920929, 0.05000000074505806, 0.05000000074505806], [0.29374998807907104, 0.768750011920929, 0.02500000037252903, 0.02500000037252903], [0.29374998807907104, 0.768750011920929, 0.05000000074505806, 0.05000000074505806], [0.3062500059604645, 0.768750011920929, 0.02500000037252903, 0.02500000037252903], [0.3062500059604645, 0.768750011920929, 0.05000000074505806, 0.05000000074505806], [0.3187499940395355, 0.768750011920929, 0.02500000037252903, 0.02500000037252903], [0.3187499940395355, 0.768750011920929, 0.05000000074505806, 0.05000000074505806], [0.33125001192092896, 0.768750011920929, 0.02500000037252903, 0.02500000037252903], [0.33125001192092896, 0.768750011920929, 0.05000000074505806, 0.05000000074505806], [0.34375, 0.768750011920929, 0.02500000037252903, 0.02500000037252903], [0.34375, 0.768750011920929, 0.05000000074505806, 0.05000000074505806], [0.35624998807907104, 0.768750011920929, 0.02500000037252903, 0.02500000037252903], [0.35624998807907104, 0.768750011920929, 0.05000000074505806, 0.05000000074505806], [0.3687500059604645, 0.768750011920929, 0.02500000037252903, 0.02500000037252903], [0.3687500059604645, 0.768750011920929, 0.05000000074505806, 0.05000000074505806], [0.3812499940395355, 0.768750011920929, 0.02500000037252903, 0.02500000037252903], [0.3812499940395355, 0.768750011920929, 0.05000000074505806, 0.05000000074505806], [0.39375001192092896, 0.768750011920929, 0.02500000037252903, 0.02500000037252903], [0.39375001192092896, 0.768750011920929, 0.05000000074505806, 0.05000000074505806], [0.40625, 0.768750011920929, 0.02500000037252903, 0.02500000037252903], [0.40625, 0.768750011920929, 0.05000000074505806, 0.05000000074505806], [0.41874998807907104, 0.768750011920929, 0.02500000037252903, 0.02500000037252903], [0.41874998807907104, 0.768750011920929, 0.05000000074505806, 0.05000000074505806], [0.4312500059604645, 0.768750011920929, 0.02500000037252903, 0.02500000037252903], [0.4312500059604645, 0.768750011920929, 0.05000000074505806, 0.05000000074505806], [0.4437499940395355, 0.768750011920929, 0.02500000037252903, 0.02500000037252903], [0.4437499940395355, 0.768750011920929, 0.05000000074505806, 0.05000000074505806], [0.45625001192092896, 0.768750011920929, 0.02500000037252903, 0.02500000037252903], [0.45625001192092896, 0.768750011920929, 0.05000000074505806, 0.05000000074505806], [0.46875, 0.768750011920929, 0.02500000037252903, 0.02500000037252903], [0.46875, 0.768750011920929, 0.05000000074505806, 0.05000000074505806], [0.48124998807907104, 0.768750011920929, 0.02500000037252903, 0.02500000037252903], [0.48124998807907104, 0.768750011920929, 0.05000000074505806, 0.05000000074505806], [0.4937500059604645, 0.768750011920929, 0.02500000037252903, 0.02500000037252903], [0.4937500059604645, 0.768750011920929, 0.05000000074505806, 0.05000000074505806], [0.5062500238418579, 0.768750011920929, 0.02500000037252903, 0.02500000037252903], [0.5062500238418579, 0.768750011920929, 0.05000000074505806, 0.05000000074505806], [0.518750011920929, 0.768750011920929, 0.02500000037252903, 0.02500000037252903], [0.518750011920929, 0.768750011920929, 0.05000000074505806, 0.05000000074505806], [0.53125, 0.768750011920929, 0.02500000037252903, 0.02500000037252903], [0.53125, 0.768750011920929, 0.05000000074505806, 0.05000000074505806], [0.543749988079071, 0.768750011920929, 0.02500000037252903, 0.02500000037252903], [0.543749988079071, 0.768750011920929, 0.05000000074505806, 0.05000000074505806], [0.5562499761581421, 0.768750011920929, 0.02500000037252903, 0.02500000037252903], [0.5562499761581421, 0.768750011920929, 0.05000000074505806, 0.05000000074505806], [0.5687500238418579, 0.768750011920929, 0.02500000037252903, 0.02500000037252903], [0.5687500238418579, 0.768750011920929, 0.05000000074505806, 0.05000000074505806], [0.581250011920929, 0.768750011920929, 0.02500000037252903, 0.02500000037252903], [0.581250011920929, 0.768750011920929, 0.05000000074505806, 0.05000000074505806], [0.59375, 0.768750011920929, 0.02500000037252903, 0.02500000037252903], [0.59375, 0.768750011920929, 0.05000000074505806, 0.05000000074505806], [0.606249988079071, 0.768750011920929, 0.02500000037252903, 0.02500000037252903], [0.606249988079071, 0.768750011920929, 0.05000000074505806, 0.05000000074505806], [0.6187499761581421, 0.768750011920929, 0.02500000037252903, 0.02500000037252903], [0.6187499761581421, 0.768750011920929, 0.05000000074505806, 0.05000000074505806], [0.6312500238418579, 0.768750011920929, 0.02500000037252903, 0.02500000037252903], [0.6312500238418579, 0.768750011920929, 0.05000000074505806, 0.05000000074505806], [0.643750011920929, 0.768750011920929, 0.02500000037252903, 0.02500000037252903], [0.643750011920929, 0.768750011920929, 0.05000000074505806, 0.05000000074505806], [0.65625, 0.768750011920929, 0.02500000037252903, 0.02500000037252903], [0.65625, 0.768750011920929, 0.05000000074505806, 0.05000000074505806], [0.668749988079071, 0.768750011920929, 0.02500000037252903, 0.02500000037252903], [0.668749988079071, 0.768750011920929, 0.05000000074505806, 0.05000000074505806], [0.6812499761581421, 0.768750011920929, 0.02500000037252903, 0.02500000037252903], [0.6812499761581421, 0.768750011920929, 0.05000000074505806, 0.05000000074505806], [0.6937500238418579, 0.768750011920929, 0.02500000037252903, 0.02500000037252903], [0.6937500238418579, 0.768750011920929, 0.05000000074505806, 0.05000000074505806], [0.706250011920929, 0.768750011920929, 0.02500000037252903, 0.02500000037252903], [0.706250011920929, 0.768750011920929, 0.05000000074505806, 0.05000000074505806], [0.71875, 0.768750011920929, 0.02500000037252903, 0.02500000037252903], [0.71875, 0.768750011920929, 0.05000000074505806, 0.05000000074505806], [0.731249988079071, 0.768750011920929, 0.02500000037252903, 0.02500000037252903], [0.731249988079071, 0.768750011920929, 0.05000000074505806, 0.05000000074505806], [0.7437499761581421, 0.768750011920929, 0.02500000037252903, 0.02500000037252903], [0.7437499761581421, 0.768750011920929, 0.05000000074505806, 0.05000000074505806], [0.7562500238418579, 0.768750011920929, 0.02500000037252903, 0.02500000037252903], [0.7562500238418579, 0.768750011920929, 0.05000000074505806, 0.05000000074505806], [0.768750011920929, 0.768750011920929, 0.02500000037252903, 0.02500000037252903], [0.768750011920929, 0.768750011920929, 0.05000000074505806, 0.05000000074505806], [0.78125, 0.768750011920929, 0.02500000037252903, 0.02500000037252903], [0.78125, 0.768750011920929, 0.05000000074505806, 0.05000000074505806], [0.793749988079071, 0.768750011920929, 0.02500000037252903, 0.02500000037252903], [0.793749988079071, 0.768750011920929, 0.05000000074505806, 0.05000000074505806], [0.8062499761581421, 0.768750011920929, 0.02500000037252903, 0.02500000037252903], [0.8062499761581421, 0.768750011920929, 0.05000000074505806, 0.05000000074505806], [0.8187500238418579, 0.768750011920929, 0.02500000037252903, 0.02500000037252903], [0.8187500238418579, 0.768750011920929, 0.05000000074505806, 0.05000000074505806], [0.831250011920929, 0.768750011920929, 0.02500000037252903, 0.02500000037252903], [0.831250011920929, 0.768750011920929, 0.05000000074505806, 0.05000000074505806], [0.84375, 0.768750011920929, 0.02500000037252903, 0.02500000037252903], [0.84375, 0.768750011920929, 0.05000000074505806, 0.05000000074505806], [0.856249988079071, 0.768750011920929, 0.02500000037252903, 0.02500000037252903], [0.856249988079071, 0.768750011920929, 0.05000000074505806, 0.05000000074505806], [0.8687499761581421, 0.768750011920929, 0.02500000037252903, 0.02500000037252903], [0.8687499761581421, 0.768750011920929, 0.05000000074505806, 0.05000000074505806], [0.8812500238418579, 0.768750011920929, 0.02500000037252903, 0.02500000037252903], [0.8812500238418579, 0.768750011920929, 0.05000000074505806, 0.05000000074505806], [0.893750011920929, 0.768750011920929, 0.02500000037252903, 0.02500000037252903], [0.893750011920929, 0.768750011920929, 0.05000000074505806, 0.05000000074505806], [0.90625, 0.768750011920929, 0.02500000037252903, 0.02500000037252903], [0.90625, 0.768750011920929, 0.05000000074505806, 0.05000000074505806], [0.918749988079071, 0.768750011920929, 0.02500000037252903, 0.02500000037252903], [0.918749988079071, 0.768750011920929, 0.05000000074505806, 0.05000000074505806], [0.9312499761581421, 0.768750011920929, 0.02500000037252903, 0.02500000037252903], [0.9312499761581421, 0.768750011920929, 0.05000000074505806, 0.05000000074505806], [0.9437500238418579, 0.768750011920929, 0.02500000037252903, 0.02500000037252903], [0.9437500238418579, 0.768750011920929, 0.05000000074505806, 0.05000000074505806], [0.956250011920929, 0.768750011920929, 0.02500000037252903, 0.02500000037252903], [0.956250011920929, 0.768750011920929, 0.05000000074505806, 0.05000000074505806], [0.96875, 0.768750011920929, 0.02500000037252903, 0.02500000037252903], [0.96875, 0.768750011920929, 0.05000000074505806, 0.05000000074505806], [0.981249988079071, 0.768750011920929, 0.02500000037252903, 0.02500000037252903], [0.981249988079071, 0.768750011920929, 0.05000000074505806, 0.05000000074505806], [0.9937499761581421, 0.768750011920929, 0.02500000037252903, 0.02500000037252903], [0.9937499761581421, 0.768750011920929, 0.05000000074505806, 0.05000000074505806], [0.0062500000931322575, 0.78125, 0.02500000037252903, 0.02500000037252903], [0.0062500000931322575, 0.78125, 0.05000000074505806, 0.05000000074505806], [0.01875000074505806, 0.78125, 0.02500000037252903, 0.02500000037252903], [0.01875000074505806, 0.78125, 0.05000000074505806, 0.05000000074505806], [0.03125, 0.78125, 0.02500000037252903, 0.02500000037252903], [0.03125, 0.78125, 0.05000000074505806, 0.05000000074505806], [0.04374999925494194, 0.78125, 0.02500000037252903, 0.02500000037252903], [0.04374999925494194, 0.78125, 0.05000000074505806, 0.05000000074505806], [0.05624999850988388, 0.78125, 0.02500000037252903, 0.02500000037252903], [0.05624999850988388, 0.78125, 0.05000000074505806, 0.05000000074505806], [0.06875000149011612, 0.78125, 0.02500000037252903, 0.02500000037252903], [0.06875000149011612, 0.78125, 0.05000000074505806, 0.05000000074505806], [0.08124999701976776, 0.78125, 0.02500000037252903, 0.02500000037252903], [0.08124999701976776, 0.78125, 0.05000000074505806, 0.05000000074505806], [0.09375, 0.78125, 0.02500000037252903, 0.02500000037252903], [0.09375, 0.78125, 0.05000000074505806, 0.05000000074505806], [0.10625000298023224, 0.78125, 0.02500000037252903, 0.02500000037252903], [0.10625000298023224, 0.78125, 0.05000000074505806, 0.05000000074505806], [0.11874999850988388, 0.78125, 0.02500000037252903, 0.02500000037252903], [0.11874999850988388, 0.78125, 0.05000000074505806, 0.05000000074505806], [0.13124999403953552, 0.78125, 0.02500000037252903, 0.02500000037252903], [0.13124999403953552, 0.78125, 0.05000000074505806, 0.05000000074505806], [0.14374999701976776, 0.78125, 0.02500000037252903, 0.02500000037252903], [0.14374999701976776, 0.78125, 0.05000000074505806, 0.05000000074505806], [0.15625, 0.78125, 0.02500000037252903, 0.02500000037252903], [0.15625, 0.78125, 0.05000000074505806, 0.05000000074505806], [0.16875000298023224, 0.78125, 0.02500000037252903, 0.02500000037252903], [0.16875000298023224, 0.78125, 0.05000000074505806, 0.05000000074505806], [0.18125000596046448, 0.78125, 0.02500000037252903, 0.02500000037252903], [0.18125000596046448, 0.78125, 0.05000000074505806, 0.05000000074505806], [0.19374999403953552, 0.78125, 0.02500000037252903, 0.02500000037252903], [0.19374999403953552, 0.78125, 0.05000000074505806, 0.05000000074505806], [0.20624999701976776, 0.78125, 0.02500000037252903, 0.02500000037252903], [0.20624999701976776, 0.78125, 0.05000000074505806, 0.05000000074505806], [0.21875, 0.78125, 0.02500000037252903, 0.02500000037252903], [0.21875, 0.78125, 0.05000000074505806, 0.05000000074505806], [0.23125000298023224, 0.78125, 0.02500000037252903, 0.02500000037252903], [0.23125000298023224, 0.78125, 0.05000000074505806, 0.05000000074505806], [0.24375000596046448, 0.78125, 0.02500000037252903, 0.02500000037252903], [0.24375000596046448, 0.78125, 0.05000000074505806, 0.05000000074505806], [0.2562499940395355, 0.78125, 0.02500000037252903, 0.02500000037252903], [0.2562499940395355, 0.78125, 0.05000000074505806, 0.05000000074505806], [0.26875001192092896, 0.78125, 0.02500000037252903, 0.02500000037252903], [0.26875001192092896, 0.78125, 0.05000000074505806, 0.05000000074505806], [0.28125, 0.78125, 0.02500000037252903, 0.02500000037252903], [0.28125, 0.78125, 0.05000000074505806, 0.05000000074505806], [0.29374998807907104, 0.78125, 0.02500000037252903, 0.02500000037252903], [0.29374998807907104, 0.78125, 0.05000000074505806, 0.05000000074505806], [0.3062500059604645, 0.78125, 0.02500000037252903, 0.02500000037252903], [0.3062500059604645, 0.78125, 0.05000000074505806, 0.05000000074505806], [0.3187499940395355, 0.78125, 0.02500000037252903, 0.02500000037252903], [0.3187499940395355, 0.78125, 0.05000000074505806, 0.05000000074505806], [0.33125001192092896, 0.78125, 0.02500000037252903, 0.02500000037252903], [0.33125001192092896, 0.78125, 0.05000000074505806, 0.05000000074505806], [0.34375, 0.78125, 0.02500000037252903, 0.02500000037252903], [0.34375, 0.78125, 0.05000000074505806, 0.05000000074505806], [0.35624998807907104, 0.78125, 0.02500000037252903, 0.02500000037252903], [0.35624998807907104, 0.78125, 0.05000000074505806, 0.05000000074505806], [0.3687500059604645, 0.78125, 0.02500000037252903, 0.02500000037252903], [0.3687500059604645, 0.78125, 0.05000000074505806, 0.05000000074505806], [0.3812499940395355, 0.78125, 0.02500000037252903, 0.02500000037252903], [0.3812499940395355, 0.78125, 0.05000000074505806, 0.05000000074505806], [0.39375001192092896, 0.78125, 0.02500000037252903, 0.02500000037252903], [0.39375001192092896, 0.78125, 0.05000000074505806, 0.05000000074505806], [0.40625, 0.78125, 0.02500000037252903, 0.02500000037252903], [0.40625, 0.78125, 0.05000000074505806, 0.05000000074505806], [0.41874998807907104, 0.78125, 0.02500000037252903, 0.02500000037252903], [0.41874998807907104, 0.78125, 0.05000000074505806, 0.05000000074505806], [0.4312500059604645, 0.78125, 0.02500000037252903, 0.02500000037252903], [0.4312500059604645, 0.78125, 0.05000000074505806, 0.05000000074505806], [0.4437499940395355, 0.78125, 0.02500000037252903, 0.02500000037252903], [0.4437499940395355, 0.78125, 0.05000000074505806, 0.05000000074505806], [0.45625001192092896, 0.78125, 0.02500000037252903, 0.02500000037252903], [0.45625001192092896, 0.78125, 0.05000000074505806, 0.05000000074505806], [0.46875, 0.78125, 0.02500000037252903, 0.02500000037252903], [0.46875, 0.78125, 0.05000000074505806, 0.05000000074505806], [0.48124998807907104, 0.78125, 0.02500000037252903, 0.02500000037252903], [0.48124998807907104, 0.78125, 0.05000000074505806, 0.05000000074505806], [0.4937500059604645, 0.78125, 0.02500000037252903, 0.02500000037252903], [0.4937500059604645, 0.78125, 0.05000000074505806, 0.05000000074505806], [0.5062500238418579, 0.78125, 0.02500000037252903, 0.02500000037252903], [0.5062500238418579, 0.78125, 0.05000000074505806, 0.05000000074505806], [0.518750011920929, 0.78125, 0.02500000037252903, 0.02500000037252903], [0.518750011920929, 0.78125, 0.05000000074505806, 0.05000000074505806], [0.53125, 0.78125, 0.02500000037252903, 0.02500000037252903], [0.53125, 0.78125, 0.05000000074505806, 0.05000000074505806], [0.543749988079071, 0.78125, 0.02500000037252903, 0.02500000037252903], [0.543749988079071, 0.78125, 0.05000000074505806, 0.05000000074505806], [0.5562499761581421, 0.78125, 0.02500000037252903, 0.02500000037252903], [0.5562499761581421, 0.78125, 0.05000000074505806, 0.05000000074505806], [0.5687500238418579, 0.78125, 0.02500000037252903, 0.02500000037252903], [0.5687500238418579, 0.78125, 0.05000000074505806, 0.05000000074505806], [0.581250011920929, 0.78125, 0.02500000037252903, 0.02500000037252903], [0.581250011920929, 0.78125, 0.05000000074505806, 0.05000000074505806], [0.59375, 0.78125, 0.02500000037252903, 0.02500000037252903], [0.59375, 0.78125, 0.05000000074505806, 0.05000000074505806], [0.606249988079071, 0.78125, 0.02500000037252903, 0.02500000037252903], [0.606249988079071, 0.78125, 0.05000000074505806, 0.05000000074505806], [0.6187499761581421, 0.78125, 0.02500000037252903, 0.02500000037252903], [0.6187499761581421, 0.78125, 0.05000000074505806, 0.05000000074505806], [0.6312500238418579, 0.78125, 0.02500000037252903, 0.02500000037252903], [0.6312500238418579, 0.78125, 0.05000000074505806, 0.05000000074505806], [0.643750011920929, 0.78125, 0.02500000037252903, 0.02500000037252903], [0.643750011920929, 0.78125, 0.05000000074505806, 0.05000000074505806], [0.65625, 0.78125, 0.02500000037252903, 0.02500000037252903], [0.65625, 0.78125, 0.05000000074505806, 0.05000000074505806], [0.668749988079071, 0.78125, 0.02500000037252903, 0.02500000037252903], [0.668749988079071, 0.78125, 0.05000000074505806, 0.05000000074505806], [0.6812499761581421, 0.78125, 0.02500000037252903, 0.02500000037252903], [0.6812499761581421, 0.78125, 0.05000000074505806, 0.05000000074505806], [0.6937500238418579, 0.78125, 0.02500000037252903, 0.02500000037252903], [0.6937500238418579, 0.78125, 0.05000000074505806, 0.05000000074505806], [0.706250011920929, 0.78125, 0.02500000037252903, 0.02500000037252903], [0.706250011920929, 0.78125, 0.05000000074505806, 0.05000000074505806], [0.71875, 0.78125, 0.02500000037252903, 0.02500000037252903], [0.71875, 0.78125, 0.05000000074505806, 0.05000000074505806], [0.731249988079071, 0.78125, 0.02500000037252903, 0.02500000037252903], [0.731249988079071, 0.78125, 0.05000000074505806, 0.05000000074505806], [0.7437499761581421, 0.78125, 0.02500000037252903, 0.02500000037252903], [0.7437499761581421, 0.78125, 0.05000000074505806, 0.05000000074505806], [0.7562500238418579, 0.78125, 0.02500000037252903, 0.02500000037252903], [0.7562500238418579, 0.78125, 0.05000000074505806, 0.05000000074505806], [0.768750011920929, 0.78125, 0.02500000037252903, 0.02500000037252903], [0.768750011920929, 0.78125, 0.05000000074505806, 0.05000000074505806], [0.78125, 0.78125, 0.02500000037252903, 0.02500000037252903], [0.78125, 0.78125, 0.05000000074505806, 0.05000000074505806], [0.793749988079071, 0.78125, 0.02500000037252903, 0.02500000037252903], [0.793749988079071, 0.78125, 0.05000000074505806, 0.05000000074505806], [0.8062499761581421, 0.78125, 0.02500000037252903, 0.02500000037252903], [0.8062499761581421, 0.78125, 0.05000000074505806, 0.05000000074505806], [0.8187500238418579, 0.78125, 0.02500000037252903, 0.02500000037252903], [0.8187500238418579, 0.78125, 0.05000000074505806, 0.05000000074505806], [0.831250011920929, 0.78125, 0.02500000037252903, 0.02500000037252903], [0.831250011920929, 0.78125, 0.05000000074505806, 0.05000000074505806], [0.84375, 0.78125, 0.02500000037252903, 0.02500000037252903], [0.84375, 0.78125, 0.05000000074505806, 0.05000000074505806], [0.856249988079071, 0.78125, 0.02500000037252903, 0.02500000037252903], [0.856249988079071, 0.78125, 0.05000000074505806, 0.05000000074505806], [0.8687499761581421, 0.78125, 0.02500000037252903, 0.02500000037252903], [0.8687499761581421, 0.78125, 0.05000000074505806, 0.05000000074505806], [0.8812500238418579, 0.78125, 0.02500000037252903, 0.02500000037252903], [0.8812500238418579, 0.78125, 0.05000000074505806, 0.05000000074505806], [0.893750011920929, 0.78125, 0.02500000037252903, 0.02500000037252903], [0.893750011920929, 0.78125, 0.05000000074505806, 0.05000000074505806], [0.90625, 0.78125, 0.02500000037252903, 0.02500000037252903], [0.90625, 0.78125, 0.05000000074505806, 0.05000000074505806], [0.918749988079071, 0.78125, 0.02500000037252903, 0.02500000037252903], [0.918749988079071, 0.78125, 0.05000000074505806, 0.05000000074505806], [0.9312499761581421, 0.78125, 0.02500000037252903, 0.02500000037252903], [0.9312499761581421, 0.78125, 0.05000000074505806, 0.05000000074505806], [0.9437500238418579, 0.78125, 0.02500000037252903, 0.02500000037252903], [0.9437500238418579, 0.78125, 0.05000000074505806, 0.05000000074505806], [0.956250011920929, 0.78125, 0.02500000037252903, 0.02500000037252903], [0.956250011920929, 0.78125, 0.05000000074505806, 0.05000000074505806], [0.96875, 0.78125, 0.02500000037252903, 0.02500000037252903], [0.96875, 0.78125, 0.05000000074505806, 0.05000000074505806], [0.981249988079071, 0.78125, 0.02500000037252903, 0.02500000037252903], [0.981249988079071, 0.78125, 0.05000000074505806, 0.05000000074505806], [0.9937499761581421, 0.78125, 0.02500000037252903, 0.02500000037252903], [0.9937499761581421, 0.78125, 0.05000000074505806, 0.05000000074505806], [0.0062500000931322575, 0.793749988079071, 0.02500000037252903, 0.02500000037252903], [0.0062500000931322575, 0.793749988079071, 0.05000000074505806, 0.05000000074505806], [0.01875000074505806, 0.793749988079071, 0.02500000037252903, 0.02500000037252903], [0.01875000074505806, 0.793749988079071, 0.05000000074505806, 0.05000000074505806], [0.03125, 0.793749988079071, 0.02500000037252903, 0.02500000037252903], [0.03125, 0.793749988079071, 0.05000000074505806, 0.05000000074505806], [0.04374999925494194, 0.793749988079071, 0.02500000037252903, 0.02500000037252903], [0.04374999925494194, 0.793749988079071, 0.05000000074505806, 0.05000000074505806], [0.05624999850988388, 0.793749988079071, 0.02500000037252903, 0.02500000037252903], [0.05624999850988388, 0.793749988079071, 0.05000000074505806, 0.05000000074505806], [0.06875000149011612, 0.793749988079071, 0.02500000037252903, 0.02500000037252903], [0.06875000149011612, 0.793749988079071, 0.05000000074505806, 0.05000000074505806], [0.08124999701976776, 0.793749988079071, 0.02500000037252903, 0.02500000037252903], [0.08124999701976776, 0.793749988079071, 0.05000000074505806, 0.05000000074505806], [0.09375, 0.793749988079071, 0.02500000037252903, 0.02500000037252903], [0.09375, 0.793749988079071, 0.05000000074505806, 0.05000000074505806], [0.10625000298023224, 0.793749988079071, 0.02500000037252903, 0.02500000037252903], [0.10625000298023224, 0.793749988079071, 0.05000000074505806, 0.05000000074505806], [0.11874999850988388, 0.793749988079071, 0.02500000037252903, 0.02500000037252903], [0.11874999850988388, 0.793749988079071, 0.05000000074505806, 0.05000000074505806], [0.13124999403953552, 0.793749988079071, 0.02500000037252903, 0.02500000037252903], [0.13124999403953552, 0.793749988079071, 0.05000000074505806, 0.05000000074505806], [0.14374999701976776, 0.793749988079071, 0.02500000037252903, 0.02500000037252903], [0.14374999701976776, 0.793749988079071, 0.05000000074505806, 0.05000000074505806], [0.15625, 0.793749988079071, 0.02500000037252903, 0.02500000037252903], [0.15625, 0.793749988079071, 0.05000000074505806, 0.05000000074505806], [0.16875000298023224, 0.793749988079071, 0.02500000037252903, 0.02500000037252903], [0.16875000298023224, 0.793749988079071, 0.05000000074505806, 0.05000000074505806], [0.18125000596046448, 0.793749988079071, 0.02500000037252903, 0.02500000037252903], [0.18125000596046448, 0.793749988079071, 0.05000000074505806, 0.05000000074505806], [0.19374999403953552, 0.793749988079071, 0.02500000037252903, 0.02500000037252903], [0.19374999403953552, 0.793749988079071, 0.05000000074505806, 0.05000000074505806], [0.20624999701976776, 0.793749988079071, 0.02500000037252903, 0.02500000037252903], [0.20624999701976776, 0.793749988079071, 0.05000000074505806, 0.05000000074505806], [0.21875, 0.793749988079071, 0.02500000037252903, 0.02500000037252903], [0.21875, 0.793749988079071, 0.05000000074505806, 0.05000000074505806], [0.23125000298023224, 0.793749988079071, 0.02500000037252903, 0.02500000037252903], [0.23125000298023224, 0.793749988079071, 0.05000000074505806, 0.05000000074505806], [0.24375000596046448, 0.793749988079071, 0.02500000037252903, 0.02500000037252903], [0.24375000596046448, 0.793749988079071, 0.05000000074505806, 0.05000000074505806], [0.2562499940395355, 0.793749988079071, 0.02500000037252903, 0.02500000037252903], [0.2562499940395355, 0.793749988079071, 0.05000000074505806, 0.05000000074505806], [0.26875001192092896, 0.793749988079071, 0.02500000037252903, 0.02500000037252903], [0.26875001192092896, 0.793749988079071, 0.05000000074505806, 0.05000000074505806], [0.28125, 0.793749988079071, 0.02500000037252903, 0.02500000037252903], [0.28125, 0.793749988079071, 0.05000000074505806, 0.05000000074505806], [0.29374998807907104, 0.793749988079071, 0.02500000037252903, 0.02500000037252903], [0.29374998807907104, 0.793749988079071, 0.05000000074505806, 0.05000000074505806], [0.3062500059604645, 0.793749988079071, 0.02500000037252903, 0.02500000037252903], [0.3062500059604645, 0.793749988079071, 0.05000000074505806, 0.05000000074505806], [0.3187499940395355, 0.793749988079071, 0.02500000037252903, 0.02500000037252903], [0.3187499940395355, 0.793749988079071, 0.05000000074505806, 0.05000000074505806], [0.33125001192092896, 0.793749988079071, 0.02500000037252903, 0.02500000037252903], [0.33125001192092896, 0.793749988079071, 0.05000000074505806, 0.05000000074505806], [0.34375, 0.793749988079071, 0.02500000037252903, 0.02500000037252903], [0.34375, 0.793749988079071, 0.05000000074505806, 0.05000000074505806], [0.35624998807907104, 0.793749988079071, 0.02500000037252903, 0.02500000037252903], [0.35624998807907104, 0.793749988079071, 0.05000000074505806, 0.05000000074505806], [0.3687500059604645, 0.793749988079071, 0.02500000037252903, 0.02500000037252903], [0.3687500059604645, 0.793749988079071, 0.05000000074505806, 0.05000000074505806], [0.3812499940395355, 0.793749988079071, 0.02500000037252903, 0.02500000037252903], [0.3812499940395355, 0.793749988079071, 0.05000000074505806, 0.05000000074505806], [0.39375001192092896, 0.793749988079071, 0.02500000037252903, 0.02500000037252903], [0.39375001192092896, 0.793749988079071, 0.05000000074505806, 0.05000000074505806], [0.40625, 0.793749988079071, 0.02500000037252903, 0.02500000037252903], [0.40625, 0.793749988079071, 0.05000000074505806, 0.05000000074505806], [0.41874998807907104, 0.793749988079071, 0.02500000037252903, 0.02500000037252903], [0.41874998807907104, 0.793749988079071, 0.05000000074505806, 0.05000000074505806], [0.4312500059604645, 0.793749988079071, 0.02500000037252903, 0.02500000037252903], [0.4312500059604645, 0.793749988079071, 0.05000000074505806, 0.05000000074505806], [0.4437499940395355, 0.793749988079071, 0.02500000037252903, 0.02500000037252903], [0.4437499940395355, 0.793749988079071, 0.05000000074505806, 0.05000000074505806], [0.45625001192092896, 0.793749988079071, 0.02500000037252903, 0.02500000037252903], [0.45625001192092896, 0.793749988079071, 0.05000000074505806, 0.05000000074505806], [0.46875, 0.793749988079071, 0.02500000037252903, 0.02500000037252903], [0.46875, 0.793749988079071, 0.05000000074505806, 0.05000000074505806], [0.48124998807907104, 0.793749988079071, 0.02500000037252903, 0.02500000037252903], [0.48124998807907104, 0.793749988079071, 0.05000000074505806, 0.05000000074505806], [0.4937500059604645, 0.793749988079071, 0.02500000037252903, 0.02500000037252903], [0.4937500059604645, 0.793749988079071, 0.05000000074505806, 0.05000000074505806], [0.5062500238418579, 0.793749988079071, 0.02500000037252903, 0.02500000037252903], [0.5062500238418579, 0.793749988079071, 0.05000000074505806, 0.05000000074505806], [0.518750011920929, 0.793749988079071, 0.02500000037252903, 0.02500000037252903], [0.518750011920929, 0.793749988079071, 0.05000000074505806, 0.05000000074505806], [0.53125, 0.793749988079071, 0.02500000037252903, 0.02500000037252903], [0.53125, 0.793749988079071, 0.05000000074505806, 0.05000000074505806], [0.543749988079071, 0.793749988079071, 0.02500000037252903, 0.02500000037252903], [0.543749988079071, 0.793749988079071, 0.05000000074505806, 0.05000000074505806], [0.5562499761581421, 0.793749988079071, 0.02500000037252903, 0.02500000037252903], [0.5562499761581421, 0.793749988079071, 0.05000000074505806, 0.05000000074505806], [0.5687500238418579, 0.793749988079071, 0.02500000037252903, 0.02500000037252903], [0.5687500238418579, 0.793749988079071, 0.05000000074505806, 0.05000000074505806], [0.581250011920929, 0.793749988079071, 0.02500000037252903, 0.02500000037252903], [0.581250011920929, 0.793749988079071, 0.05000000074505806, 0.05000000074505806], [0.59375, 0.793749988079071, 0.02500000037252903, 0.02500000037252903], [0.59375, 0.793749988079071, 0.05000000074505806, 0.05000000074505806], [0.606249988079071, 0.793749988079071, 0.02500000037252903, 0.02500000037252903], [0.606249988079071, 0.793749988079071, 0.05000000074505806, 0.05000000074505806], [0.6187499761581421, 0.793749988079071, 0.02500000037252903, 0.02500000037252903], [0.6187499761581421, 0.793749988079071, 0.05000000074505806, 0.05000000074505806], [0.6312500238418579, 0.793749988079071, 0.02500000037252903, 0.02500000037252903], [0.6312500238418579, 0.793749988079071, 0.05000000074505806, 0.05000000074505806], [0.643750011920929, 0.793749988079071, 0.02500000037252903, 0.02500000037252903], [0.643750011920929, 0.793749988079071, 0.05000000074505806, 0.05000000074505806], [0.65625, 0.793749988079071, 0.02500000037252903, 0.02500000037252903], [0.65625, 0.793749988079071, 0.05000000074505806, 0.05000000074505806], [0.668749988079071, 0.793749988079071, 0.02500000037252903, 0.02500000037252903], [0.668749988079071, 0.793749988079071, 0.05000000074505806, 0.05000000074505806], [0.6812499761581421, 0.793749988079071, 0.02500000037252903, 0.02500000037252903], [0.6812499761581421, 0.793749988079071, 0.05000000074505806, 0.05000000074505806], [0.6937500238418579, 0.793749988079071, 0.02500000037252903, 0.02500000037252903], [0.6937500238418579, 0.793749988079071, 0.05000000074505806, 0.05000000074505806], [0.706250011920929, 0.793749988079071, 0.02500000037252903, 0.02500000037252903], [0.706250011920929, 0.793749988079071, 0.05000000074505806, 0.05000000074505806], [0.71875, 0.793749988079071, 0.02500000037252903, 0.02500000037252903], [0.71875, 0.793749988079071, 0.05000000074505806, 0.05000000074505806], [0.731249988079071, 0.793749988079071, 0.02500000037252903, 0.02500000037252903], [0.731249988079071, 0.793749988079071, 0.05000000074505806, 0.05000000074505806], [0.7437499761581421, 0.793749988079071, 0.02500000037252903, 0.02500000037252903], [0.7437499761581421, 0.793749988079071, 0.05000000074505806, 0.05000000074505806], [0.7562500238418579, 0.793749988079071, 0.02500000037252903, 0.02500000037252903], [0.7562500238418579, 0.793749988079071, 0.05000000074505806, 0.05000000074505806], [0.768750011920929, 0.793749988079071, 0.02500000037252903, 0.02500000037252903], [0.768750011920929, 0.793749988079071, 0.05000000074505806, 0.05000000074505806], [0.78125, 0.793749988079071, 0.02500000037252903, 0.02500000037252903], [0.78125, 0.793749988079071, 0.05000000074505806, 0.05000000074505806], [0.793749988079071, 0.793749988079071, 0.02500000037252903, 0.02500000037252903], [0.793749988079071, 0.793749988079071, 0.05000000074505806, 0.05000000074505806], [0.8062499761581421, 0.793749988079071, 0.02500000037252903, 0.02500000037252903], [0.8062499761581421, 0.793749988079071, 0.05000000074505806, 0.05000000074505806], [0.8187500238418579, 0.793749988079071, 0.02500000037252903, 0.02500000037252903], [0.8187500238418579, 0.793749988079071, 0.05000000074505806, 0.05000000074505806], [0.831250011920929, 0.793749988079071, 0.02500000037252903, 0.02500000037252903], [0.831250011920929, 0.793749988079071, 0.05000000074505806, 0.05000000074505806], [0.84375, 0.793749988079071, 0.02500000037252903, 0.02500000037252903], [0.84375, 0.793749988079071, 0.05000000074505806, 0.05000000074505806], [0.856249988079071, 0.793749988079071, 0.02500000037252903, 0.02500000037252903], [0.856249988079071, 0.793749988079071, 0.05000000074505806, 0.05000000074505806], [0.8687499761581421, 0.793749988079071, 0.02500000037252903, 0.02500000037252903], [0.8687499761581421, 0.793749988079071, 0.05000000074505806, 0.05000000074505806], [0.8812500238418579, 0.793749988079071, 0.02500000037252903, 0.02500000037252903], [0.8812500238418579, 0.793749988079071, 0.05000000074505806, 0.05000000074505806], [0.893750011920929, 0.793749988079071, 0.02500000037252903, 0.02500000037252903], [0.893750011920929, 0.793749988079071, 0.05000000074505806, 0.05000000074505806], [0.90625, 0.793749988079071, 0.02500000037252903, 0.02500000037252903], [0.90625, 0.793749988079071, 0.05000000074505806, 0.05000000074505806], [0.918749988079071, 0.793749988079071, 0.02500000037252903, 0.02500000037252903], [0.918749988079071, 0.793749988079071, 0.05000000074505806, 0.05000000074505806], [0.9312499761581421, 0.793749988079071, 0.02500000037252903, 0.02500000037252903], [0.9312499761581421, 0.793749988079071, 0.05000000074505806, 0.05000000074505806], [0.9437500238418579, 0.793749988079071, 0.02500000037252903, 0.02500000037252903], [0.9437500238418579, 0.793749988079071, 0.05000000074505806, 0.05000000074505806], [0.956250011920929, 0.793749988079071, 0.02500000037252903, 0.02500000037252903], [0.956250011920929, 0.793749988079071, 0.05000000074505806, 0.05000000074505806], [0.96875, 0.793749988079071, 0.02500000037252903, 0.02500000037252903], [0.96875, 0.793749988079071, 0.05000000074505806, 0.05000000074505806], [0.981249988079071, 0.793749988079071, 0.02500000037252903, 0.02500000037252903], [0.981249988079071, 0.793749988079071, 0.05000000074505806, 0.05000000074505806], [0.9937499761581421, 0.793749988079071, 0.02500000037252903, 0.02500000037252903], [0.9937499761581421, 0.793749988079071, 0.05000000074505806, 0.05000000074505806], [0.0062500000931322575, 0.8062499761581421, 0.02500000037252903, 0.02500000037252903], [0.0062500000931322575, 0.8062499761581421, 0.05000000074505806, 0.05000000074505806], [0.01875000074505806, 0.8062499761581421, 0.02500000037252903, 0.02500000037252903], [0.01875000074505806, 0.8062499761581421, 0.05000000074505806, 0.05000000074505806], [0.03125, 0.8062499761581421, 0.02500000037252903, 0.02500000037252903], [0.03125, 0.8062499761581421, 0.05000000074505806, 0.05000000074505806], [0.04374999925494194, 0.8062499761581421, 0.02500000037252903, 0.02500000037252903], [0.04374999925494194, 0.8062499761581421, 0.05000000074505806, 0.05000000074505806], [0.05624999850988388, 0.8062499761581421, 0.02500000037252903, 0.02500000037252903], [0.05624999850988388, 0.8062499761581421, 0.05000000074505806, 0.05000000074505806], [0.06875000149011612, 0.8062499761581421, 0.02500000037252903, 0.02500000037252903], [0.06875000149011612, 0.8062499761581421, 0.05000000074505806, 0.05000000074505806], [0.08124999701976776, 0.8062499761581421, 0.02500000037252903, 0.02500000037252903], [0.08124999701976776, 0.8062499761581421, 0.05000000074505806, 0.05000000074505806], [0.09375, 0.8062499761581421, 0.02500000037252903, 0.02500000037252903], [0.09375, 0.8062499761581421, 0.05000000074505806, 0.05000000074505806], [0.10625000298023224, 0.8062499761581421, 0.02500000037252903, 0.02500000037252903], [0.10625000298023224, 0.8062499761581421, 0.05000000074505806, 0.05000000074505806], [0.11874999850988388, 0.8062499761581421, 0.02500000037252903, 0.02500000037252903], [0.11874999850988388, 0.8062499761581421, 0.05000000074505806, 0.05000000074505806], [0.13124999403953552, 0.8062499761581421, 0.02500000037252903, 0.02500000037252903], [0.13124999403953552, 0.8062499761581421, 0.05000000074505806, 0.05000000074505806], [0.14374999701976776, 0.8062499761581421, 0.02500000037252903, 0.02500000037252903], [0.14374999701976776, 0.8062499761581421, 0.05000000074505806, 0.05000000074505806], [0.15625, 0.8062499761581421, 0.02500000037252903, 0.02500000037252903], [0.15625, 0.8062499761581421, 0.05000000074505806, 0.05000000074505806], [0.16875000298023224, 0.8062499761581421, 0.02500000037252903, 0.02500000037252903], [0.16875000298023224, 0.8062499761581421, 0.05000000074505806, 0.05000000074505806], [0.18125000596046448, 0.8062499761581421, 0.02500000037252903, 0.02500000037252903], [0.18125000596046448, 0.8062499761581421, 0.05000000074505806, 0.05000000074505806], [0.19374999403953552, 0.8062499761581421, 0.02500000037252903, 0.02500000037252903], [0.19374999403953552, 0.8062499761581421, 0.05000000074505806, 0.05000000074505806], [0.20624999701976776, 0.8062499761581421, 0.02500000037252903, 0.02500000037252903], [0.20624999701976776, 0.8062499761581421, 0.05000000074505806, 0.05000000074505806], [0.21875, 0.8062499761581421, 0.02500000037252903, 0.02500000037252903], [0.21875, 0.8062499761581421, 0.05000000074505806, 0.05000000074505806], [0.23125000298023224, 0.8062499761581421, 0.02500000037252903, 0.02500000037252903], [0.23125000298023224, 0.8062499761581421, 0.05000000074505806, 0.05000000074505806], [0.24375000596046448, 0.8062499761581421, 0.02500000037252903, 0.02500000037252903], [0.24375000596046448, 0.8062499761581421, 0.05000000074505806, 0.05000000074505806], [0.2562499940395355, 0.8062499761581421, 0.02500000037252903, 0.02500000037252903], [0.2562499940395355, 0.8062499761581421, 0.05000000074505806, 0.05000000074505806], [0.26875001192092896, 0.8062499761581421, 0.02500000037252903, 0.02500000037252903], [0.26875001192092896, 0.8062499761581421, 0.05000000074505806, 0.05000000074505806], [0.28125, 0.8062499761581421, 0.02500000037252903, 0.02500000037252903], [0.28125, 0.8062499761581421, 0.05000000074505806, 0.05000000074505806], [0.29374998807907104, 0.8062499761581421, 0.02500000037252903, 0.02500000037252903], [0.29374998807907104, 0.8062499761581421, 0.05000000074505806, 0.05000000074505806], [0.3062500059604645, 0.8062499761581421, 0.02500000037252903, 0.02500000037252903], [0.3062500059604645, 0.8062499761581421, 0.05000000074505806, 0.05000000074505806], [0.3187499940395355, 0.8062499761581421, 0.02500000037252903, 0.02500000037252903], [0.3187499940395355, 0.8062499761581421, 0.05000000074505806, 0.05000000074505806], [0.33125001192092896, 0.8062499761581421, 0.02500000037252903, 0.02500000037252903], [0.33125001192092896, 0.8062499761581421, 0.05000000074505806, 0.05000000074505806], [0.34375, 0.8062499761581421, 0.02500000037252903, 0.02500000037252903], [0.34375, 0.8062499761581421, 0.05000000074505806, 0.05000000074505806], [0.35624998807907104, 0.8062499761581421, 0.02500000037252903, 0.02500000037252903], [0.35624998807907104, 0.8062499761581421, 0.05000000074505806, 0.05000000074505806], [0.3687500059604645, 0.8062499761581421, 0.02500000037252903, 0.02500000037252903], [0.3687500059604645, 0.8062499761581421, 0.05000000074505806, 0.05000000074505806], [0.3812499940395355, 0.8062499761581421, 0.02500000037252903, 0.02500000037252903], [0.3812499940395355, 0.8062499761581421, 0.05000000074505806, 0.05000000074505806], [0.39375001192092896, 0.8062499761581421, 0.02500000037252903, 0.02500000037252903], [0.39375001192092896, 0.8062499761581421, 0.05000000074505806, 0.05000000074505806], [0.40625, 0.8062499761581421, 0.02500000037252903, 0.02500000037252903], [0.40625, 0.8062499761581421, 0.05000000074505806, 0.05000000074505806], [0.41874998807907104, 0.8062499761581421, 0.02500000037252903, 0.02500000037252903], [0.41874998807907104, 0.8062499761581421, 0.05000000074505806, 0.05000000074505806], [0.4312500059604645, 0.8062499761581421, 0.02500000037252903, 0.02500000037252903], [0.4312500059604645, 0.8062499761581421, 0.05000000074505806, 0.05000000074505806], [0.4437499940395355, 0.8062499761581421, 0.02500000037252903, 0.02500000037252903], [0.4437499940395355, 0.8062499761581421, 0.05000000074505806, 0.05000000074505806], [0.45625001192092896, 0.8062499761581421, 0.02500000037252903, 0.02500000037252903], [0.45625001192092896, 0.8062499761581421, 0.05000000074505806, 0.05000000074505806], [0.46875, 0.8062499761581421, 0.02500000037252903, 0.02500000037252903], [0.46875, 0.8062499761581421, 0.05000000074505806, 0.05000000074505806], [0.48124998807907104, 0.8062499761581421, 0.02500000037252903, 0.02500000037252903], [0.48124998807907104, 0.8062499761581421, 0.05000000074505806, 0.05000000074505806], [0.4937500059604645, 0.8062499761581421, 0.02500000037252903, 0.02500000037252903], [0.4937500059604645, 0.8062499761581421, 0.05000000074505806, 0.05000000074505806], [0.5062500238418579, 0.8062499761581421, 0.02500000037252903, 0.02500000037252903], [0.5062500238418579, 0.8062499761581421, 0.05000000074505806, 0.05000000074505806], [0.518750011920929, 0.8062499761581421, 0.02500000037252903, 0.02500000037252903], [0.518750011920929, 0.8062499761581421, 0.05000000074505806, 0.05000000074505806], [0.53125, 0.8062499761581421, 0.02500000037252903, 0.02500000037252903], [0.53125, 0.8062499761581421, 0.05000000074505806, 0.05000000074505806], [0.543749988079071, 0.8062499761581421, 0.02500000037252903, 0.02500000037252903], [0.543749988079071, 0.8062499761581421, 0.05000000074505806, 0.05000000074505806], [0.5562499761581421, 0.8062499761581421, 0.02500000037252903, 0.02500000037252903], [0.5562499761581421, 0.8062499761581421, 0.05000000074505806, 0.05000000074505806], [0.5687500238418579, 0.8062499761581421, 0.02500000037252903, 0.02500000037252903], [0.5687500238418579, 0.8062499761581421, 0.05000000074505806, 0.05000000074505806], [0.581250011920929, 0.8062499761581421, 0.02500000037252903, 0.02500000037252903], [0.581250011920929, 0.8062499761581421, 0.05000000074505806, 0.05000000074505806], [0.59375, 0.8062499761581421, 0.02500000037252903, 0.02500000037252903], [0.59375, 0.8062499761581421, 0.05000000074505806, 0.05000000074505806], [0.606249988079071, 0.8062499761581421, 0.02500000037252903, 0.02500000037252903], [0.606249988079071, 0.8062499761581421, 0.05000000074505806, 0.05000000074505806], [0.6187499761581421, 0.8062499761581421, 0.02500000037252903, 0.02500000037252903], [0.6187499761581421, 0.8062499761581421, 0.05000000074505806, 0.05000000074505806], [0.6312500238418579, 0.8062499761581421, 0.02500000037252903, 0.02500000037252903], [0.6312500238418579, 0.8062499761581421, 0.05000000074505806, 0.05000000074505806], [0.643750011920929, 0.8062499761581421, 0.02500000037252903, 0.02500000037252903], [0.643750011920929, 0.8062499761581421, 0.05000000074505806, 0.05000000074505806], [0.65625, 0.8062499761581421, 0.02500000037252903, 0.02500000037252903], [0.65625, 0.8062499761581421, 0.05000000074505806, 0.05000000074505806], [0.668749988079071, 0.8062499761581421, 0.02500000037252903, 0.02500000037252903], [0.668749988079071, 0.8062499761581421, 0.05000000074505806, 0.05000000074505806], [0.6812499761581421, 0.8062499761581421, 0.02500000037252903, 0.02500000037252903], [0.6812499761581421, 0.8062499761581421, 0.05000000074505806, 0.05000000074505806], [0.6937500238418579, 0.8062499761581421, 0.02500000037252903, 0.02500000037252903], [0.6937500238418579, 0.8062499761581421, 0.05000000074505806, 0.05000000074505806], [0.706250011920929, 0.8062499761581421, 0.02500000037252903, 0.02500000037252903], [0.706250011920929, 0.8062499761581421, 0.05000000074505806, 0.05000000074505806], [0.71875, 0.8062499761581421, 0.02500000037252903, 0.02500000037252903], [0.71875, 0.8062499761581421, 0.05000000074505806, 0.05000000074505806], [0.731249988079071, 0.8062499761581421, 0.02500000037252903, 0.02500000037252903], [0.731249988079071, 0.8062499761581421, 0.05000000074505806, 0.05000000074505806], [0.7437499761581421, 0.8062499761581421, 0.02500000037252903, 0.02500000037252903], [0.7437499761581421, 0.8062499761581421, 0.05000000074505806, 0.05000000074505806], [0.7562500238418579, 0.8062499761581421, 0.02500000037252903, 0.02500000037252903], [0.7562500238418579, 0.8062499761581421, 0.05000000074505806, 0.05000000074505806], [0.768750011920929, 0.8062499761581421, 0.02500000037252903, 0.02500000037252903], [0.768750011920929, 0.8062499761581421, 0.05000000074505806, 0.05000000074505806], [0.78125, 0.8062499761581421, 0.02500000037252903, 0.02500000037252903], [0.78125, 0.8062499761581421, 0.05000000074505806, 0.05000000074505806], [0.793749988079071, 0.8062499761581421, 0.02500000037252903, 0.02500000037252903], [0.793749988079071, 0.8062499761581421, 0.05000000074505806, 0.05000000074505806], [0.8062499761581421, 0.8062499761581421, 0.02500000037252903, 0.02500000037252903], [0.8062499761581421, 0.8062499761581421, 0.05000000074505806, 0.05000000074505806], [0.8187500238418579, 0.8062499761581421, 0.02500000037252903, 0.02500000037252903], [0.8187500238418579, 0.8062499761581421, 0.05000000074505806, 0.05000000074505806], [0.831250011920929, 0.8062499761581421, 0.02500000037252903, 0.02500000037252903], [0.831250011920929, 0.8062499761581421, 0.05000000074505806, 0.05000000074505806], [0.84375, 0.8062499761581421, 0.02500000037252903, 0.02500000037252903], [0.84375, 0.8062499761581421, 0.05000000074505806, 0.05000000074505806], [0.856249988079071, 0.8062499761581421, 0.02500000037252903, 0.02500000037252903], [0.856249988079071, 0.8062499761581421, 0.05000000074505806, 0.05000000074505806], [0.8687499761581421, 0.8062499761581421, 0.02500000037252903, 0.02500000037252903], [0.8687499761581421, 0.8062499761581421, 0.05000000074505806, 0.05000000074505806], [0.8812500238418579, 0.8062499761581421, 0.02500000037252903, 0.02500000037252903], [0.8812500238418579, 0.8062499761581421, 0.05000000074505806, 0.05000000074505806], [0.893750011920929, 0.8062499761581421, 0.02500000037252903, 0.02500000037252903], [0.893750011920929, 0.8062499761581421, 0.05000000074505806, 0.05000000074505806], [0.90625, 0.8062499761581421, 0.02500000037252903, 0.02500000037252903], [0.90625, 0.8062499761581421, 0.05000000074505806, 0.05000000074505806], [0.918749988079071, 0.8062499761581421, 0.02500000037252903, 0.02500000037252903], [0.918749988079071, 0.8062499761581421, 0.05000000074505806, 0.05000000074505806], [0.9312499761581421, 0.8062499761581421, 0.02500000037252903, 0.02500000037252903], [0.9312499761581421, 0.8062499761581421, 0.05000000074505806, 0.05000000074505806], [0.9437500238418579, 0.8062499761581421, 0.02500000037252903, 0.02500000037252903], [0.9437500238418579, 0.8062499761581421, 0.05000000074505806, 0.05000000074505806], [0.956250011920929, 0.8062499761581421, 0.02500000037252903, 0.02500000037252903], [0.956250011920929, 0.8062499761581421, 0.05000000074505806, 0.05000000074505806], [0.96875, 0.8062499761581421, 0.02500000037252903, 0.02500000037252903], [0.96875, 0.8062499761581421, 0.05000000074505806, 0.05000000074505806], [0.981249988079071, 0.8062499761581421, 0.02500000037252903, 0.02500000037252903], [0.981249988079071, 0.8062499761581421, 0.05000000074505806, 0.05000000074505806], [0.9937499761581421, 0.8062499761581421, 0.02500000037252903, 0.02500000037252903], [0.9937499761581421, 0.8062499761581421, 0.05000000074505806, 0.05000000074505806], [0.0062500000931322575, 0.8187500238418579, 0.02500000037252903, 0.02500000037252903], [0.0062500000931322575, 0.8187500238418579, 0.05000000074505806, 0.05000000074505806], [0.01875000074505806, 0.8187500238418579, 0.02500000037252903, 0.02500000037252903], [0.01875000074505806, 0.8187500238418579, 0.05000000074505806, 0.05000000074505806], [0.03125, 0.8187500238418579, 0.02500000037252903, 0.02500000037252903], [0.03125, 0.8187500238418579, 0.05000000074505806, 0.05000000074505806], [0.04374999925494194, 0.8187500238418579, 0.02500000037252903, 0.02500000037252903], [0.04374999925494194, 0.8187500238418579, 0.05000000074505806, 0.05000000074505806], [0.05624999850988388, 0.8187500238418579, 0.02500000037252903, 0.02500000037252903], [0.05624999850988388, 0.8187500238418579, 0.05000000074505806, 0.05000000074505806], [0.06875000149011612, 0.8187500238418579, 0.02500000037252903, 0.02500000037252903], [0.06875000149011612, 0.8187500238418579, 0.05000000074505806, 0.05000000074505806], [0.08124999701976776, 0.8187500238418579, 0.02500000037252903, 0.02500000037252903], [0.08124999701976776, 0.8187500238418579, 0.05000000074505806, 0.05000000074505806], [0.09375, 0.8187500238418579, 0.02500000037252903, 0.02500000037252903], [0.09375, 0.8187500238418579, 0.05000000074505806, 0.05000000074505806], [0.10625000298023224, 0.8187500238418579, 0.02500000037252903, 0.02500000037252903], [0.10625000298023224, 0.8187500238418579, 0.05000000074505806, 0.05000000074505806], [0.11874999850988388, 0.8187500238418579, 0.02500000037252903, 0.02500000037252903], [0.11874999850988388, 0.8187500238418579, 0.05000000074505806, 0.05000000074505806], [0.13124999403953552, 0.8187500238418579, 0.02500000037252903, 0.02500000037252903], [0.13124999403953552, 0.8187500238418579, 0.05000000074505806, 0.05000000074505806], [0.14374999701976776, 0.8187500238418579, 0.02500000037252903, 0.02500000037252903], [0.14374999701976776, 0.8187500238418579, 0.05000000074505806, 0.05000000074505806], [0.15625, 0.8187500238418579, 0.02500000037252903, 0.02500000037252903], [0.15625, 0.8187500238418579, 0.05000000074505806, 0.05000000074505806], [0.16875000298023224, 0.8187500238418579, 0.02500000037252903, 0.02500000037252903], [0.16875000298023224, 0.8187500238418579, 0.05000000074505806, 0.05000000074505806], [0.18125000596046448, 0.8187500238418579, 0.02500000037252903, 0.02500000037252903], [0.18125000596046448, 0.8187500238418579, 0.05000000074505806, 0.05000000074505806], [0.19374999403953552, 0.8187500238418579, 0.02500000037252903, 0.02500000037252903], [0.19374999403953552, 0.8187500238418579, 0.05000000074505806, 0.05000000074505806], [0.20624999701976776, 0.8187500238418579, 0.02500000037252903, 0.02500000037252903], [0.20624999701976776, 0.8187500238418579, 0.05000000074505806, 0.05000000074505806], [0.21875, 0.8187500238418579, 0.02500000037252903, 0.02500000037252903], [0.21875, 0.8187500238418579, 0.05000000074505806, 0.05000000074505806], [0.23125000298023224, 0.8187500238418579, 0.02500000037252903, 0.02500000037252903], [0.23125000298023224, 0.8187500238418579, 0.05000000074505806, 0.05000000074505806], [0.24375000596046448, 0.8187500238418579, 0.02500000037252903, 0.02500000037252903], [0.24375000596046448, 0.8187500238418579, 0.05000000074505806, 0.05000000074505806], [0.2562499940395355, 0.8187500238418579, 0.02500000037252903, 0.02500000037252903], [0.2562499940395355, 0.8187500238418579, 0.05000000074505806, 0.05000000074505806], [0.26875001192092896, 0.8187500238418579, 0.02500000037252903, 0.02500000037252903], [0.26875001192092896, 0.8187500238418579, 0.05000000074505806, 0.05000000074505806], [0.28125, 0.8187500238418579, 0.02500000037252903, 0.02500000037252903], [0.28125, 0.8187500238418579, 0.05000000074505806, 0.05000000074505806], [0.29374998807907104, 0.8187500238418579, 0.02500000037252903, 0.02500000037252903], [0.29374998807907104, 0.8187500238418579, 0.05000000074505806, 0.05000000074505806], [0.3062500059604645, 0.8187500238418579, 0.02500000037252903, 0.02500000037252903], [0.3062500059604645, 0.8187500238418579, 0.05000000074505806, 0.05000000074505806], [0.3187499940395355, 0.8187500238418579, 0.02500000037252903, 0.02500000037252903], [0.3187499940395355, 0.8187500238418579, 0.05000000074505806, 0.05000000074505806], [0.33125001192092896, 0.8187500238418579, 0.02500000037252903, 0.02500000037252903], [0.33125001192092896, 0.8187500238418579, 0.05000000074505806, 0.05000000074505806], [0.34375, 0.8187500238418579, 0.02500000037252903, 0.02500000037252903], [0.34375, 0.8187500238418579, 0.05000000074505806, 0.05000000074505806], [0.35624998807907104, 0.8187500238418579, 0.02500000037252903, 0.02500000037252903], [0.35624998807907104, 0.8187500238418579, 0.05000000074505806, 0.05000000074505806], [0.3687500059604645, 0.8187500238418579, 0.02500000037252903, 0.02500000037252903], [0.3687500059604645, 0.8187500238418579, 0.05000000074505806, 0.05000000074505806], [0.3812499940395355, 0.8187500238418579, 0.02500000037252903, 0.02500000037252903], [0.3812499940395355, 0.8187500238418579, 0.05000000074505806, 0.05000000074505806], [0.39375001192092896, 0.8187500238418579, 0.02500000037252903, 0.02500000037252903], [0.39375001192092896, 0.8187500238418579, 0.05000000074505806, 0.05000000074505806], [0.40625, 0.8187500238418579, 0.02500000037252903, 0.02500000037252903], [0.40625, 0.8187500238418579, 0.05000000074505806, 0.05000000074505806], [0.41874998807907104, 0.8187500238418579, 0.02500000037252903, 0.02500000037252903], [0.41874998807907104, 0.8187500238418579, 0.05000000074505806, 0.05000000074505806], [0.4312500059604645, 0.8187500238418579, 0.02500000037252903, 0.02500000037252903], [0.4312500059604645, 0.8187500238418579, 0.05000000074505806, 0.05000000074505806], [0.4437499940395355, 0.8187500238418579, 0.02500000037252903, 0.02500000037252903], [0.4437499940395355, 0.8187500238418579, 0.05000000074505806, 0.05000000074505806], [0.45625001192092896, 0.8187500238418579, 0.02500000037252903, 0.02500000037252903], [0.45625001192092896, 0.8187500238418579, 0.05000000074505806, 0.05000000074505806], [0.46875, 0.8187500238418579, 0.02500000037252903, 0.02500000037252903], [0.46875, 0.8187500238418579, 0.05000000074505806, 0.05000000074505806], [0.48124998807907104, 0.8187500238418579, 0.02500000037252903, 0.02500000037252903], [0.48124998807907104, 0.8187500238418579, 0.05000000074505806, 0.05000000074505806], [0.4937500059604645, 0.8187500238418579, 0.02500000037252903, 0.02500000037252903], [0.4937500059604645, 0.8187500238418579, 0.05000000074505806, 0.05000000074505806], [0.5062500238418579, 0.8187500238418579, 0.02500000037252903, 0.02500000037252903], [0.5062500238418579, 0.8187500238418579, 0.05000000074505806, 0.05000000074505806], [0.518750011920929, 0.8187500238418579, 0.02500000037252903, 0.02500000037252903], [0.518750011920929, 0.8187500238418579, 0.05000000074505806, 0.05000000074505806], [0.53125, 0.8187500238418579, 0.02500000037252903, 0.02500000037252903], [0.53125, 0.8187500238418579, 0.05000000074505806, 0.05000000074505806], [0.543749988079071, 0.8187500238418579, 0.02500000037252903, 0.02500000037252903], [0.543749988079071, 0.8187500238418579, 0.05000000074505806, 0.05000000074505806], [0.5562499761581421, 0.8187500238418579, 0.02500000037252903, 0.02500000037252903], [0.5562499761581421, 0.8187500238418579, 0.05000000074505806, 0.05000000074505806], [0.5687500238418579, 0.8187500238418579, 0.02500000037252903, 0.02500000037252903], [0.5687500238418579, 0.8187500238418579, 0.05000000074505806, 0.05000000074505806], [0.581250011920929, 0.8187500238418579, 0.02500000037252903, 0.02500000037252903], [0.581250011920929, 0.8187500238418579, 0.05000000074505806, 0.05000000074505806], [0.59375, 0.8187500238418579, 0.02500000037252903, 0.02500000037252903], [0.59375, 0.8187500238418579, 0.05000000074505806, 0.05000000074505806], [0.606249988079071, 0.8187500238418579, 0.02500000037252903, 0.02500000037252903], [0.606249988079071, 0.8187500238418579, 0.05000000074505806, 0.05000000074505806], [0.6187499761581421, 0.8187500238418579, 0.02500000037252903, 0.02500000037252903], [0.6187499761581421, 0.8187500238418579, 0.05000000074505806, 0.05000000074505806], [0.6312500238418579, 0.8187500238418579, 0.02500000037252903, 0.02500000037252903], [0.6312500238418579, 0.8187500238418579, 0.05000000074505806, 0.05000000074505806], [0.643750011920929, 0.8187500238418579, 0.02500000037252903, 0.02500000037252903], [0.643750011920929, 0.8187500238418579, 0.05000000074505806, 0.05000000074505806], [0.65625, 0.8187500238418579, 0.02500000037252903, 0.02500000037252903], [0.65625, 0.8187500238418579, 0.05000000074505806, 0.05000000074505806], [0.668749988079071, 0.8187500238418579, 0.02500000037252903, 0.02500000037252903], [0.668749988079071, 0.8187500238418579, 0.05000000074505806, 0.05000000074505806], [0.6812499761581421, 0.8187500238418579, 0.02500000037252903, 0.02500000037252903], [0.6812499761581421, 0.8187500238418579, 0.05000000074505806, 0.05000000074505806], [0.6937500238418579, 0.8187500238418579, 0.02500000037252903, 0.02500000037252903], [0.6937500238418579, 0.8187500238418579, 0.05000000074505806, 0.05000000074505806], [0.706250011920929, 0.8187500238418579, 0.02500000037252903, 0.02500000037252903], [0.706250011920929, 0.8187500238418579, 0.05000000074505806, 0.05000000074505806], [0.71875, 0.8187500238418579, 0.02500000037252903, 0.02500000037252903], [0.71875, 0.8187500238418579, 0.05000000074505806, 0.05000000074505806], [0.731249988079071, 0.8187500238418579, 0.02500000037252903, 0.02500000037252903], [0.731249988079071, 0.8187500238418579, 0.05000000074505806, 0.05000000074505806], [0.7437499761581421, 0.8187500238418579, 0.02500000037252903, 0.02500000037252903], [0.7437499761581421, 0.8187500238418579, 0.05000000074505806, 0.05000000074505806], [0.7562500238418579, 0.8187500238418579, 0.02500000037252903, 0.02500000037252903], [0.7562500238418579, 0.8187500238418579, 0.05000000074505806, 0.05000000074505806], [0.768750011920929, 0.8187500238418579, 0.02500000037252903, 0.02500000037252903], [0.768750011920929, 0.8187500238418579, 0.05000000074505806, 0.05000000074505806], [0.78125, 0.8187500238418579, 0.02500000037252903, 0.02500000037252903], [0.78125, 0.8187500238418579, 0.05000000074505806, 0.05000000074505806], [0.793749988079071, 0.8187500238418579, 0.02500000037252903, 0.02500000037252903], [0.793749988079071, 0.8187500238418579, 0.05000000074505806, 0.05000000074505806], [0.8062499761581421, 0.8187500238418579, 0.02500000037252903, 0.02500000037252903], [0.8062499761581421, 0.8187500238418579, 0.05000000074505806, 0.05000000074505806], [0.8187500238418579, 0.8187500238418579, 0.02500000037252903, 0.02500000037252903], [0.8187500238418579, 0.8187500238418579, 0.05000000074505806, 0.05000000074505806], [0.831250011920929, 0.8187500238418579, 0.02500000037252903, 0.02500000037252903], [0.831250011920929, 0.8187500238418579, 0.05000000074505806, 0.05000000074505806], [0.84375, 0.8187500238418579, 0.02500000037252903, 0.02500000037252903], [0.84375, 0.8187500238418579, 0.05000000074505806, 0.05000000074505806], [0.856249988079071, 0.8187500238418579, 0.02500000037252903, 0.02500000037252903], [0.856249988079071, 0.8187500238418579, 0.05000000074505806, 0.05000000074505806], [0.8687499761581421, 0.8187500238418579, 0.02500000037252903, 0.02500000037252903], [0.8687499761581421, 0.8187500238418579, 0.05000000074505806, 0.05000000074505806], [0.8812500238418579, 0.8187500238418579, 0.02500000037252903, 0.02500000037252903], [0.8812500238418579, 0.8187500238418579, 0.05000000074505806, 0.05000000074505806], [0.893750011920929, 0.8187500238418579, 0.02500000037252903, 0.02500000037252903], [0.893750011920929, 0.8187500238418579, 0.05000000074505806, 0.05000000074505806], [0.90625, 0.8187500238418579, 0.02500000037252903, 0.02500000037252903], [0.90625, 0.8187500238418579, 0.05000000074505806, 0.05000000074505806], [0.918749988079071, 0.8187500238418579, 0.02500000037252903, 0.02500000037252903], [0.918749988079071, 0.8187500238418579, 0.05000000074505806, 0.05000000074505806], [0.9312499761581421, 0.8187500238418579, 0.02500000037252903, 0.02500000037252903], [0.9312499761581421, 0.8187500238418579, 0.05000000074505806, 0.05000000074505806], [0.9437500238418579, 0.8187500238418579, 0.02500000037252903, 0.02500000037252903], [0.9437500238418579, 0.8187500238418579, 0.05000000074505806, 0.05000000074505806], [0.956250011920929, 0.8187500238418579, 0.02500000037252903, 0.02500000037252903], [0.956250011920929, 0.8187500238418579, 0.05000000074505806, 0.05000000074505806], [0.96875, 0.8187500238418579, 0.02500000037252903, 0.02500000037252903], [0.96875, 0.8187500238418579, 0.05000000074505806, 0.05000000074505806], [0.981249988079071, 0.8187500238418579, 0.02500000037252903, 0.02500000037252903], [0.981249988079071, 0.8187500238418579, 0.05000000074505806, 0.05000000074505806], [0.9937499761581421, 0.8187500238418579, 0.02500000037252903, 0.02500000037252903], [0.9937499761581421, 0.8187500238418579, 0.05000000074505806, 0.05000000074505806], [0.0062500000931322575, 0.831250011920929, 0.02500000037252903, 0.02500000037252903], [0.0062500000931322575, 0.831250011920929, 0.05000000074505806, 0.05000000074505806], [0.01875000074505806, 0.831250011920929, 0.02500000037252903, 0.02500000037252903], [0.01875000074505806, 0.831250011920929, 0.05000000074505806, 0.05000000074505806], [0.03125, 0.831250011920929, 0.02500000037252903, 0.02500000037252903], [0.03125, 0.831250011920929, 0.05000000074505806, 0.05000000074505806], [0.04374999925494194, 0.831250011920929, 0.02500000037252903, 0.02500000037252903], [0.04374999925494194, 0.831250011920929, 0.05000000074505806, 0.05000000074505806], [0.05624999850988388, 0.831250011920929, 0.02500000037252903, 0.02500000037252903], [0.05624999850988388, 0.831250011920929, 0.05000000074505806, 0.05000000074505806], [0.06875000149011612, 0.831250011920929, 0.02500000037252903, 0.02500000037252903], [0.06875000149011612, 0.831250011920929, 0.05000000074505806, 0.05000000074505806], [0.08124999701976776, 0.831250011920929, 0.02500000037252903, 0.02500000037252903], [0.08124999701976776, 0.831250011920929, 0.05000000074505806, 0.05000000074505806], [0.09375, 0.831250011920929, 0.02500000037252903, 0.02500000037252903], [0.09375, 0.831250011920929, 0.05000000074505806, 0.05000000074505806], [0.10625000298023224, 0.831250011920929, 0.02500000037252903, 0.02500000037252903], [0.10625000298023224, 0.831250011920929, 0.05000000074505806, 0.05000000074505806], [0.11874999850988388, 0.831250011920929, 0.02500000037252903, 0.02500000037252903], [0.11874999850988388, 0.831250011920929, 0.05000000074505806, 0.05000000074505806], [0.13124999403953552, 0.831250011920929, 0.02500000037252903, 0.02500000037252903], [0.13124999403953552, 0.831250011920929, 0.05000000074505806, 0.05000000074505806], [0.14374999701976776, 0.831250011920929, 0.02500000037252903, 0.02500000037252903], [0.14374999701976776, 0.831250011920929, 0.05000000074505806, 0.05000000074505806], [0.15625, 0.831250011920929, 0.02500000037252903, 0.02500000037252903], [0.15625, 0.831250011920929, 0.05000000074505806, 0.05000000074505806], [0.16875000298023224, 0.831250011920929, 0.02500000037252903, 0.02500000037252903], [0.16875000298023224, 0.831250011920929, 0.05000000074505806, 0.05000000074505806], [0.18125000596046448, 0.831250011920929, 0.02500000037252903, 0.02500000037252903], [0.18125000596046448, 0.831250011920929, 0.05000000074505806, 0.05000000074505806], [0.19374999403953552, 0.831250011920929, 0.02500000037252903, 0.02500000037252903], [0.19374999403953552, 0.831250011920929, 0.05000000074505806, 0.05000000074505806], [0.20624999701976776, 0.831250011920929, 0.02500000037252903, 0.02500000037252903], [0.20624999701976776, 0.831250011920929, 0.05000000074505806, 0.05000000074505806], [0.21875, 0.831250011920929, 0.02500000037252903, 0.02500000037252903], [0.21875, 0.831250011920929, 0.05000000074505806, 0.05000000074505806], [0.23125000298023224, 0.831250011920929, 0.02500000037252903, 0.02500000037252903], [0.23125000298023224, 0.831250011920929, 0.05000000074505806, 0.05000000074505806], [0.24375000596046448, 0.831250011920929, 0.02500000037252903, 0.02500000037252903], [0.24375000596046448, 0.831250011920929, 0.05000000074505806, 0.05000000074505806], [0.2562499940395355, 0.831250011920929, 0.02500000037252903, 0.02500000037252903], [0.2562499940395355, 0.831250011920929, 0.05000000074505806, 0.05000000074505806], [0.26875001192092896, 0.831250011920929, 0.02500000037252903, 0.02500000037252903], [0.26875001192092896, 0.831250011920929, 0.05000000074505806, 0.05000000074505806], [0.28125, 0.831250011920929, 0.02500000037252903, 0.02500000037252903], [0.28125, 0.831250011920929, 0.05000000074505806, 0.05000000074505806], [0.29374998807907104, 0.831250011920929, 0.02500000037252903, 0.02500000037252903], [0.29374998807907104, 0.831250011920929, 0.05000000074505806, 0.05000000074505806], [0.3062500059604645, 0.831250011920929, 0.02500000037252903, 0.02500000037252903], [0.3062500059604645, 0.831250011920929, 0.05000000074505806, 0.05000000074505806], [0.3187499940395355, 0.831250011920929, 0.02500000037252903, 0.02500000037252903], [0.3187499940395355, 0.831250011920929, 0.05000000074505806, 0.05000000074505806], [0.33125001192092896, 0.831250011920929, 0.02500000037252903, 0.02500000037252903], [0.33125001192092896, 0.831250011920929, 0.05000000074505806, 0.05000000074505806], [0.34375, 0.831250011920929, 0.02500000037252903, 0.02500000037252903], [0.34375, 0.831250011920929, 0.05000000074505806, 0.05000000074505806], [0.35624998807907104, 0.831250011920929, 0.02500000037252903, 0.02500000037252903], [0.35624998807907104, 0.831250011920929, 0.05000000074505806, 0.05000000074505806], [0.3687500059604645, 0.831250011920929, 0.02500000037252903, 0.02500000037252903], [0.3687500059604645, 0.831250011920929, 0.05000000074505806, 0.05000000074505806], [0.3812499940395355, 0.831250011920929, 0.02500000037252903, 0.02500000037252903], [0.3812499940395355, 0.831250011920929, 0.05000000074505806, 0.05000000074505806], [0.39375001192092896, 0.831250011920929, 0.02500000037252903, 0.02500000037252903], [0.39375001192092896, 0.831250011920929, 0.05000000074505806, 0.05000000074505806], [0.40625, 0.831250011920929, 0.02500000037252903, 0.02500000037252903], [0.40625, 0.831250011920929, 0.05000000074505806, 0.05000000074505806], [0.41874998807907104, 0.831250011920929, 0.02500000037252903, 0.02500000037252903], [0.41874998807907104, 0.831250011920929, 0.05000000074505806, 0.05000000074505806], [0.4312500059604645, 0.831250011920929, 0.02500000037252903, 0.02500000037252903], [0.4312500059604645, 0.831250011920929, 0.05000000074505806, 0.05000000074505806], [0.4437499940395355, 0.831250011920929, 0.02500000037252903, 0.02500000037252903], [0.4437499940395355, 0.831250011920929, 0.05000000074505806, 0.05000000074505806], [0.45625001192092896, 0.831250011920929, 0.02500000037252903, 0.02500000037252903], [0.45625001192092896, 0.831250011920929, 0.05000000074505806, 0.05000000074505806], [0.46875, 0.831250011920929, 0.02500000037252903, 0.02500000037252903], [0.46875, 0.831250011920929, 0.05000000074505806, 0.05000000074505806], [0.48124998807907104, 0.831250011920929, 0.02500000037252903, 0.02500000037252903], [0.48124998807907104, 0.831250011920929, 0.05000000074505806, 0.05000000074505806], [0.4937500059604645, 0.831250011920929, 0.02500000037252903, 0.02500000037252903], [0.4937500059604645, 0.831250011920929, 0.05000000074505806, 0.05000000074505806], [0.5062500238418579, 0.831250011920929, 0.02500000037252903, 0.02500000037252903], [0.5062500238418579, 0.831250011920929, 0.05000000074505806, 0.05000000074505806], [0.518750011920929, 0.831250011920929, 0.02500000037252903, 0.02500000037252903], [0.518750011920929, 0.831250011920929, 0.05000000074505806, 0.05000000074505806], [0.53125, 0.831250011920929, 0.02500000037252903, 0.02500000037252903], [0.53125, 0.831250011920929, 0.05000000074505806, 0.05000000074505806], [0.543749988079071, 0.831250011920929, 0.02500000037252903, 0.02500000037252903], [0.543749988079071, 0.831250011920929, 0.05000000074505806, 0.05000000074505806], [0.5562499761581421, 0.831250011920929, 0.02500000037252903, 0.02500000037252903], [0.5562499761581421, 0.831250011920929, 0.05000000074505806, 0.05000000074505806], [0.5687500238418579, 0.831250011920929, 0.02500000037252903, 0.02500000037252903], [0.5687500238418579, 0.831250011920929, 0.05000000074505806, 0.05000000074505806], [0.581250011920929, 0.831250011920929, 0.02500000037252903, 0.02500000037252903], [0.581250011920929, 0.831250011920929, 0.05000000074505806, 0.05000000074505806], [0.59375, 0.831250011920929, 0.02500000037252903, 0.02500000037252903], [0.59375, 0.831250011920929, 0.05000000074505806, 0.05000000074505806], [0.606249988079071, 0.831250011920929, 0.02500000037252903, 0.02500000037252903], [0.606249988079071, 0.831250011920929, 0.05000000074505806, 0.05000000074505806], [0.6187499761581421, 0.831250011920929, 0.02500000037252903, 0.02500000037252903], [0.6187499761581421, 0.831250011920929, 0.05000000074505806, 0.05000000074505806], [0.6312500238418579, 0.831250011920929, 0.02500000037252903, 0.02500000037252903], [0.6312500238418579, 0.831250011920929, 0.05000000074505806, 0.05000000074505806], [0.643750011920929, 0.831250011920929, 0.02500000037252903, 0.02500000037252903], [0.643750011920929, 0.831250011920929, 0.05000000074505806, 0.05000000074505806], [0.65625, 0.831250011920929, 0.02500000037252903, 0.02500000037252903], [0.65625, 0.831250011920929, 0.05000000074505806, 0.05000000074505806], [0.668749988079071, 0.831250011920929, 0.02500000037252903, 0.02500000037252903], [0.668749988079071, 0.831250011920929, 0.05000000074505806, 0.05000000074505806], [0.6812499761581421, 0.831250011920929, 0.02500000037252903, 0.02500000037252903], [0.6812499761581421, 0.831250011920929, 0.05000000074505806, 0.05000000074505806], [0.6937500238418579, 0.831250011920929, 0.02500000037252903, 0.02500000037252903], [0.6937500238418579, 0.831250011920929, 0.05000000074505806, 0.05000000074505806], [0.706250011920929, 0.831250011920929, 0.02500000037252903, 0.02500000037252903], [0.706250011920929, 0.831250011920929, 0.05000000074505806, 0.05000000074505806], [0.71875, 0.831250011920929, 0.02500000037252903, 0.02500000037252903], [0.71875, 0.831250011920929, 0.05000000074505806, 0.05000000074505806], [0.731249988079071, 0.831250011920929, 0.02500000037252903, 0.02500000037252903], [0.731249988079071, 0.831250011920929, 0.05000000074505806, 0.05000000074505806], [0.7437499761581421, 0.831250011920929, 0.02500000037252903, 0.02500000037252903], [0.7437499761581421, 0.831250011920929, 0.05000000074505806, 0.05000000074505806], [0.7562500238418579, 0.831250011920929, 0.02500000037252903, 0.02500000037252903], [0.7562500238418579, 0.831250011920929, 0.05000000074505806, 0.05000000074505806], [0.768750011920929, 0.831250011920929, 0.02500000037252903, 0.02500000037252903], [0.768750011920929, 0.831250011920929, 0.05000000074505806, 0.05000000074505806], [0.78125, 0.831250011920929, 0.02500000037252903, 0.02500000037252903], [0.78125, 0.831250011920929, 0.05000000074505806, 0.05000000074505806], [0.793749988079071, 0.831250011920929, 0.02500000037252903, 0.02500000037252903], [0.793749988079071, 0.831250011920929, 0.05000000074505806, 0.05000000074505806], [0.8062499761581421, 0.831250011920929, 0.02500000037252903, 0.02500000037252903], [0.8062499761581421, 0.831250011920929, 0.05000000074505806, 0.05000000074505806], [0.8187500238418579, 0.831250011920929, 0.02500000037252903, 0.02500000037252903], [0.8187500238418579, 0.831250011920929, 0.05000000074505806, 0.05000000074505806], [0.831250011920929, 0.831250011920929, 0.02500000037252903, 0.02500000037252903], [0.831250011920929, 0.831250011920929, 0.05000000074505806, 0.05000000074505806], [0.84375, 0.831250011920929, 0.02500000037252903, 0.02500000037252903], [0.84375, 0.831250011920929, 0.05000000074505806, 0.05000000074505806], [0.856249988079071, 0.831250011920929, 0.02500000037252903, 0.02500000037252903], [0.856249988079071, 0.831250011920929, 0.05000000074505806, 0.05000000074505806], [0.8687499761581421, 0.831250011920929, 0.02500000037252903, 0.02500000037252903], [0.8687499761581421, 0.831250011920929, 0.05000000074505806, 0.05000000074505806], [0.8812500238418579, 0.831250011920929, 0.02500000037252903, 0.02500000037252903], [0.8812500238418579, 0.831250011920929, 0.05000000074505806, 0.05000000074505806], [0.893750011920929, 0.831250011920929, 0.02500000037252903, 0.02500000037252903], [0.893750011920929, 0.831250011920929, 0.05000000074505806, 0.05000000074505806], [0.90625, 0.831250011920929, 0.02500000037252903, 0.02500000037252903], [0.90625, 0.831250011920929, 0.05000000074505806, 0.05000000074505806], [0.918749988079071, 0.831250011920929, 0.02500000037252903, 0.02500000037252903], [0.918749988079071, 0.831250011920929, 0.05000000074505806, 0.05000000074505806], [0.9312499761581421, 0.831250011920929, 0.02500000037252903, 0.02500000037252903], [0.9312499761581421, 0.831250011920929, 0.05000000074505806, 0.05000000074505806], [0.9437500238418579, 0.831250011920929, 0.02500000037252903, 0.02500000037252903], [0.9437500238418579, 0.831250011920929, 0.05000000074505806, 0.05000000074505806], [0.956250011920929, 0.831250011920929, 0.02500000037252903, 0.02500000037252903], [0.956250011920929, 0.831250011920929, 0.05000000074505806, 0.05000000074505806], [0.96875, 0.831250011920929, 0.02500000037252903, 0.02500000037252903], [0.96875, 0.831250011920929, 0.05000000074505806, 0.05000000074505806], [0.981249988079071, 0.831250011920929, 0.02500000037252903, 0.02500000037252903], [0.981249988079071, 0.831250011920929, 0.05000000074505806, 0.05000000074505806], [0.9937499761581421, 0.831250011920929, 0.02500000037252903, 0.02500000037252903], [0.9937499761581421, 0.831250011920929, 0.05000000074505806, 0.05000000074505806], [0.0062500000931322575, 0.84375, 0.02500000037252903, 0.02500000037252903], [0.0062500000931322575, 0.84375, 0.05000000074505806, 0.05000000074505806], [0.01875000074505806, 0.84375, 0.02500000037252903, 0.02500000037252903], [0.01875000074505806, 0.84375, 0.05000000074505806, 0.05000000074505806], [0.03125, 0.84375, 0.02500000037252903, 0.02500000037252903], [0.03125, 0.84375, 0.05000000074505806, 0.05000000074505806], [0.04374999925494194, 0.84375, 0.02500000037252903, 0.02500000037252903], [0.04374999925494194, 0.84375, 0.05000000074505806, 0.05000000074505806], [0.05624999850988388, 0.84375, 0.02500000037252903, 0.02500000037252903], [0.05624999850988388, 0.84375, 0.05000000074505806, 0.05000000074505806], [0.06875000149011612, 0.84375, 0.02500000037252903, 0.02500000037252903], [0.06875000149011612, 0.84375, 0.05000000074505806, 0.05000000074505806], [0.08124999701976776, 0.84375, 0.02500000037252903, 0.02500000037252903], [0.08124999701976776, 0.84375, 0.05000000074505806, 0.05000000074505806], [0.09375, 0.84375, 0.02500000037252903, 0.02500000037252903], [0.09375, 0.84375, 0.05000000074505806, 0.05000000074505806], [0.10625000298023224, 0.84375, 0.02500000037252903, 0.02500000037252903], [0.10625000298023224, 0.84375, 0.05000000074505806, 0.05000000074505806], [0.11874999850988388, 0.84375, 0.02500000037252903, 0.02500000037252903], [0.11874999850988388, 0.84375, 0.05000000074505806, 0.05000000074505806], [0.13124999403953552, 0.84375, 0.02500000037252903, 0.02500000037252903], [0.13124999403953552, 0.84375, 0.05000000074505806, 0.05000000074505806], [0.14374999701976776, 0.84375, 0.02500000037252903, 0.02500000037252903], [0.14374999701976776, 0.84375, 0.05000000074505806, 0.05000000074505806], [0.15625, 0.84375, 0.02500000037252903, 0.02500000037252903], [0.15625, 0.84375, 0.05000000074505806, 0.05000000074505806], [0.16875000298023224, 0.84375, 0.02500000037252903, 0.02500000037252903], [0.16875000298023224, 0.84375, 0.05000000074505806, 0.05000000074505806], [0.18125000596046448, 0.84375, 0.02500000037252903, 0.02500000037252903], [0.18125000596046448, 0.84375, 0.05000000074505806, 0.05000000074505806], [0.19374999403953552, 0.84375, 0.02500000037252903, 0.02500000037252903], [0.19374999403953552, 0.84375, 0.05000000074505806, 0.05000000074505806], [0.20624999701976776, 0.84375, 0.02500000037252903, 0.02500000037252903], [0.20624999701976776, 0.84375, 0.05000000074505806, 0.05000000074505806], [0.21875, 0.84375, 0.02500000037252903, 0.02500000037252903], [0.21875, 0.84375, 0.05000000074505806, 0.05000000074505806], [0.23125000298023224, 0.84375, 0.02500000037252903, 0.02500000037252903], [0.23125000298023224, 0.84375, 0.05000000074505806, 0.05000000074505806], [0.24375000596046448, 0.84375, 0.02500000037252903, 0.02500000037252903], [0.24375000596046448, 0.84375, 0.05000000074505806, 0.05000000074505806], [0.2562499940395355, 0.84375, 0.02500000037252903, 0.02500000037252903], [0.2562499940395355, 0.84375, 0.05000000074505806, 0.05000000074505806], [0.26875001192092896, 0.84375, 0.02500000037252903, 0.02500000037252903], [0.26875001192092896, 0.84375, 0.05000000074505806, 0.05000000074505806], [0.28125, 0.84375, 0.02500000037252903, 0.02500000037252903], [0.28125, 0.84375, 0.05000000074505806, 0.05000000074505806], [0.29374998807907104, 0.84375, 0.02500000037252903, 0.02500000037252903], [0.29374998807907104, 0.84375, 0.05000000074505806, 0.05000000074505806], [0.3062500059604645, 0.84375, 0.02500000037252903, 0.02500000037252903], [0.3062500059604645, 0.84375, 0.05000000074505806, 0.05000000074505806], [0.3187499940395355, 0.84375, 0.02500000037252903, 0.02500000037252903], [0.3187499940395355, 0.84375, 0.05000000074505806, 0.05000000074505806], [0.33125001192092896, 0.84375, 0.02500000037252903, 0.02500000037252903], [0.33125001192092896, 0.84375, 0.05000000074505806, 0.05000000074505806], [0.34375, 0.84375, 0.02500000037252903, 0.02500000037252903], [0.34375, 0.84375, 0.05000000074505806, 0.05000000074505806], [0.35624998807907104, 0.84375, 0.02500000037252903, 0.02500000037252903], [0.35624998807907104, 0.84375, 0.05000000074505806, 0.05000000074505806], [0.3687500059604645, 0.84375, 0.02500000037252903, 0.02500000037252903], [0.3687500059604645, 0.84375, 0.05000000074505806, 0.05000000074505806], [0.3812499940395355, 0.84375, 0.02500000037252903, 0.02500000037252903], [0.3812499940395355, 0.84375, 0.05000000074505806, 0.05000000074505806], [0.39375001192092896, 0.84375, 0.02500000037252903, 0.02500000037252903], [0.39375001192092896, 0.84375, 0.05000000074505806, 0.05000000074505806], [0.40625, 0.84375, 0.02500000037252903, 0.02500000037252903], [0.40625, 0.84375, 0.05000000074505806, 0.05000000074505806], [0.41874998807907104, 0.84375, 0.02500000037252903, 0.02500000037252903], [0.41874998807907104, 0.84375, 0.05000000074505806, 0.05000000074505806], [0.4312500059604645, 0.84375, 0.02500000037252903, 0.02500000037252903], [0.4312500059604645, 0.84375, 0.05000000074505806, 0.05000000074505806], [0.4437499940395355, 0.84375, 0.02500000037252903, 0.02500000037252903], [0.4437499940395355, 0.84375, 0.05000000074505806, 0.05000000074505806], [0.45625001192092896, 0.84375, 0.02500000037252903, 0.02500000037252903], [0.45625001192092896, 0.84375, 0.05000000074505806, 0.05000000074505806], [0.46875, 0.84375, 0.02500000037252903, 0.02500000037252903], [0.46875, 0.84375, 0.05000000074505806, 0.05000000074505806], [0.48124998807907104, 0.84375, 0.02500000037252903, 0.02500000037252903], [0.48124998807907104, 0.84375, 0.05000000074505806, 0.05000000074505806], [0.4937500059604645, 0.84375, 0.02500000037252903, 0.02500000037252903], [0.4937500059604645, 0.84375, 0.05000000074505806, 0.05000000074505806], [0.5062500238418579, 0.84375, 0.02500000037252903, 0.02500000037252903], [0.5062500238418579, 0.84375, 0.05000000074505806, 0.05000000074505806], [0.518750011920929, 0.84375, 0.02500000037252903, 0.02500000037252903], [0.518750011920929, 0.84375, 0.05000000074505806, 0.05000000074505806], [0.53125, 0.84375, 0.02500000037252903, 0.02500000037252903], [0.53125, 0.84375, 0.05000000074505806, 0.05000000074505806], [0.543749988079071, 0.84375, 0.02500000037252903, 0.02500000037252903], [0.543749988079071, 0.84375, 0.05000000074505806, 0.05000000074505806], [0.5562499761581421, 0.84375, 0.02500000037252903, 0.02500000037252903], [0.5562499761581421, 0.84375, 0.05000000074505806, 0.05000000074505806], [0.5687500238418579, 0.84375, 0.02500000037252903, 0.02500000037252903], [0.5687500238418579, 0.84375, 0.05000000074505806, 0.05000000074505806], [0.581250011920929, 0.84375, 0.02500000037252903, 0.02500000037252903], [0.581250011920929, 0.84375, 0.05000000074505806, 0.05000000074505806], [0.59375, 0.84375, 0.02500000037252903, 0.02500000037252903], [0.59375, 0.84375, 0.05000000074505806, 0.05000000074505806], [0.606249988079071, 0.84375, 0.02500000037252903, 0.02500000037252903], [0.606249988079071, 0.84375, 0.05000000074505806, 0.05000000074505806], [0.6187499761581421, 0.84375, 0.02500000037252903, 0.02500000037252903], [0.6187499761581421, 0.84375, 0.05000000074505806, 0.05000000074505806], [0.6312500238418579, 0.84375, 0.02500000037252903, 0.02500000037252903], [0.6312500238418579, 0.84375, 0.05000000074505806, 0.05000000074505806], [0.643750011920929, 0.84375, 0.02500000037252903, 0.02500000037252903], [0.643750011920929, 0.84375, 0.05000000074505806, 0.05000000074505806], [0.65625, 0.84375, 0.02500000037252903, 0.02500000037252903], [0.65625, 0.84375, 0.05000000074505806, 0.05000000074505806], [0.668749988079071, 0.84375, 0.02500000037252903, 0.02500000037252903], [0.668749988079071, 0.84375, 0.05000000074505806, 0.05000000074505806], [0.6812499761581421, 0.84375, 0.02500000037252903, 0.02500000037252903], [0.6812499761581421, 0.84375, 0.05000000074505806, 0.05000000074505806], [0.6937500238418579, 0.84375, 0.02500000037252903, 0.02500000037252903], [0.6937500238418579, 0.84375, 0.05000000074505806, 0.05000000074505806], [0.706250011920929, 0.84375, 0.02500000037252903, 0.02500000037252903], [0.706250011920929, 0.84375, 0.05000000074505806, 0.05000000074505806], [0.71875, 0.84375, 0.02500000037252903, 0.02500000037252903], [0.71875, 0.84375, 0.05000000074505806, 0.05000000074505806], [0.731249988079071, 0.84375, 0.02500000037252903, 0.02500000037252903], [0.731249988079071, 0.84375, 0.05000000074505806, 0.05000000074505806], [0.7437499761581421, 0.84375, 0.02500000037252903, 0.02500000037252903], [0.7437499761581421, 0.84375, 0.05000000074505806, 0.05000000074505806], [0.7562500238418579, 0.84375, 0.02500000037252903, 0.02500000037252903], [0.7562500238418579, 0.84375, 0.05000000074505806, 0.05000000074505806], [0.768750011920929, 0.84375, 0.02500000037252903, 0.02500000037252903], [0.768750011920929, 0.84375, 0.05000000074505806, 0.05000000074505806], [0.78125, 0.84375, 0.02500000037252903, 0.02500000037252903], [0.78125, 0.84375, 0.05000000074505806, 0.05000000074505806], [0.793749988079071, 0.84375, 0.02500000037252903, 0.02500000037252903], [0.793749988079071, 0.84375, 0.05000000074505806, 0.05000000074505806], [0.8062499761581421, 0.84375, 0.02500000037252903, 0.02500000037252903], [0.8062499761581421, 0.84375, 0.05000000074505806, 0.05000000074505806], [0.8187500238418579, 0.84375, 0.02500000037252903, 0.02500000037252903], [0.8187500238418579, 0.84375, 0.05000000074505806, 0.05000000074505806], [0.831250011920929, 0.84375, 0.02500000037252903, 0.02500000037252903], [0.831250011920929, 0.84375, 0.05000000074505806, 0.05000000074505806], [0.84375, 0.84375, 0.02500000037252903, 0.02500000037252903], [0.84375, 0.84375, 0.05000000074505806, 0.05000000074505806], [0.856249988079071, 0.84375, 0.02500000037252903, 0.02500000037252903], [0.856249988079071, 0.84375, 0.05000000074505806, 0.05000000074505806], [0.8687499761581421, 0.84375, 0.02500000037252903, 0.02500000037252903], [0.8687499761581421, 0.84375, 0.05000000074505806, 0.05000000074505806], [0.8812500238418579, 0.84375, 0.02500000037252903, 0.02500000037252903], [0.8812500238418579, 0.84375, 0.05000000074505806, 0.05000000074505806], [0.893750011920929, 0.84375, 0.02500000037252903, 0.02500000037252903], [0.893750011920929, 0.84375, 0.05000000074505806, 0.05000000074505806], [0.90625, 0.84375, 0.02500000037252903, 0.02500000037252903], [0.90625, 0.84375, 0.05000000074505806, 0.05000000074505806], [0.918749988079071, 0.84375, 0.02500000037252903, 0.02500000037252903], [0.918749988079071, 0.84375, 0.05000000074505806, 0.05000000074505806], [0.9312499761581421, 0.84375, 0.02500000037252903, 0.02500000037252903], [0.9312499761581421, 0.84375, 0.05000000074505806, 0.05000000074505806], [0.9437500238418579, 0.84375, 0.02500000037252903, 0.02500000037252903], [0.9437500238418579, 0.84375, 0.05000000074505806, 0.05000000074505806], [0.956250011920929, 0.84375, 0.02500000037252903, 0.02500000037252903], [0.956250011920929, 0.84375, 0.05000000074505806, 0.05000000074505806], [0.96875, 0.84375, 0.02500000037252903, 0.02500000037252903], [0.96875, 0.84375, 0.05000000074505806, 0.05000000074505806], [0.981249988079071, 0.84375, 0.02500000037252903, 0.02500000037252903], [0.981249988079071, 0.84375, 0.05000000074505806, 0.05000000074505806], [0.9937499761581421, 0.84375, 0.02500000037252903, 0.02500000037252903], [0.9937499761581421, 0.84375, 0.05000000074505806, 0.05000000074505806], [0.0062500000931322575, 0.856249988079071, 0.02500000037252903, 0.02500000037252903], [0.0062500000931322575, 0.856249988079071, 0.05000000074505806, 0.05000000074505806], [0.01875000074505806, 0.856249988079071, 0.02500000037252903, 0.02500000037252903], [0.01875000074505806, 0.856249988079071, 0.05000000074505806, 0.05000000074505806], [0.03125, 0.856249988079071, 0.02500000037252903, 0.02500000037252903], [0.03125, 0.856249988079071, 0.05000000074505806, 0.05000000074505806], [0.04374999925494194, 0.856249988079071, 0.02500000037252903, 0.02500000037252903], [0.04374999925494194, 0.856249988079071, 0.05000000074505806, 0.05000000074505806], [0.05624999850988388, 0.856249988079071, 0.02500000037252903, 0.02500000037252903], [0.05624999850988388, 0.856249988079071, 0.05000000074505806, 0.05000000074505806], [0.06875000149011612, 0.856249988079071, 0.02500000037252903, 0.02500000037252903], [0.06875000149011612, 0.856249988079071, 0.05000000074505806, 0.05000000074505806], [0.08124999701976776, 0.856249988079071, 0.02500000037252903, 0.02500000037252903], [0.08124999701976776, 0.856249988079071, 0.05000000074505806, 0.05000000074505806], [0.09375, 0.856249988079071, 0.02500000037252903, 0.02500000037252903], [0.09375, 0.856249988079071, 0.05000000074505806, 0.05000000074505806], [0.10625000298023224, 0.856249988079071, 0.02500000037252903, 0.02500000037252903], [0.10625000298023224, 0.856249988079071, 0.05000000074505806, 0.05000000074505806], [0.11874999850988388, 0.856249988079071, 0.02500000037252903, 0.02500000037252903], [0.11874999850988388, 0.856249988079071, 0.05000000074505806, 0.05000000074505806], [0.13124999403953552, 0.856249988079071, 0.02500000037252903, 0.02500000037252903], [0.13124999403953552, 0.856249988079071, 0.05000000074505806, 0.05000000074505806], [0.14374999701976776, 0.856249988079071, 0.02500000037252903, 0.02500000037252903], [0.14374999701976776, 0.856249988079071, 0.05000000074505806, 0.05000000074505806], [0.15625, 0.856249988079071, 0.02500000037252903, 0.02500000037252903], [0.15625, 0.856249988079071, 0.05000000074505806, 0.05000000074505806], [0.16875000298023224, 0.856249988079071, 0.02500000037252903, 0.02500000037252903], [0.16875000298023224, 0.856249988079071, 0.05000000074505806, 0.05000000074505806], [0.18125000596046448, 0.856249988079071, 0.02500000037252903, 0.02500000037252903], [0.18125000596046448, 0.856249988079071, 0.05000000074505806, 0.05000000074505806], [0.19374999403953552, 0.856249988079071, 0.02500000037252903, 0.02500000037252903], [0.19374999403953552, 0.856249988079071, 0.05000000074505806, 0.05000000074505806], [0.20624999701976776, 0.856249988079071, 0.02500000037252903, 0.02500000037252903], [0.20624999701976776, 0.856249988079071, 0.05000000074505806, 0.05000000074505806], [0.21875, 0.856249988079071, 0.02500000037252903, 0.02500000037252903], [0.21875, 0.856249988079071, 0.05000000074505806, 0.05000000074505806], [0.23125000298023224, 0.856249988079071, 0.02500000037252903, 0.02500000037252903], [0.23125000298023224, 0.856249988079071, 0.05000000074505806, 0.05000000074505806], [0.24375000596046448, 0.856249988079071, 0.02500000037252903, 0.02500000037252903], [0.24375000596046448, 0.856249988079071, 0.05000000074505806, 0.05000000074505806], [0.2562499940395355, 0.856249988079071, 0.02500000037252903, 0.02500000037252903], [0.2562499940395355, 0.856249988079071, 0.05000000074505806, 0.05000000074505806], [0.26875001192092896, 0.856249988079071, 0.02500000037252903, 0.02500000037252903], [0.26875001192092896, 0.856249988079071, 0.05000000074505806, 0.05000000074505806], [0.28125, 0.856249988079071, 0.02500000037252903, 0.02500000037252903], [0.28125, 0.856249988079071, 0.05000000074505806, 0.05000000074505806], [0.29374998807907104, 0.856249988079071, 0.02500000037252903, 0.02500000037252903], [0.29374998807907104, 0.856249988079071, 0.05000000074505806, 0.05000000074505806], [0.3062500059604645, 0.856249988079071, 0.02500000037252903, 0.02500000037252903], [0.3062500059604645, 0.856249988079071, 0.05000000074505806, 0.05000000074505806], [0.3187499940395355, 0.856249988079071, 0.02500000037252903, 0.02500000037252903], [0.3187499940395355, 0.856249988079071, 0.05000000074505806, 0.05000000074505806], [0.33125001192092896, 0.856249988079071, 0.02500000037252903, 0.02500000037252903], [0.33125001192092896, 0.856249988079071, 0.05000000074505806, 0.05000000074505806], [0.34375, 0.856249988079071, 0.02500000037252903, 0.02500000037252903], [0.34375, 0.856249988079071, 0.05000000074505806, 0.05000000074505806], [0.35624998807907104, 0.856249988079071, 0.02500000037252903, 0.02500000037252903], [0.35624998807907104, 0.856249988079071, 0.05000000074505806, 0.05000000074505806], [0.3687500059604645, 0.856249988079071, 0.02500000037252903, 0.02500000037252903], [0.3687500059604645, 0.856249988079071, 0.05000000074505806, 0.05000000074505806], [0.3812499940395355, 0.856249988079071, 0.02500000037252903, 0.02500000037252903], [0.3812499940395355, 0.856249988079071, 0.05000000074505806, 0.05000000074505806], [0.39375001192092896, 0.856249988079071, 0.02500000037252903, 0.02500000037252903], [0.39375001192092896, 0.856249988079071, 0.05000000074505806, 0.05000000074505806], [0.40625, 0.856249988079071, 0.02500000037252903, 0.02500000037252903], [0.40625, 0.856249988079071, 0.05000000074505806, 0.05000000074505806], [0.41874998807907104, 0.856249988079071, 0.02500000037252903, 0.02500000037252903], [0.41874998807907104, 0.856249988079071, 0.05000000074505806, 0.05000000074505806], [0.4312500059604645, 0.856249988079071, 0.02500000037252903, 0.02500000037252903], [0.4312500059604645, 0.856249988079071, 0.05000000074505806, 0.05000000074505806], [0.4437499940395355, 0.856249988079071, 0.02500000037252903, 0.02500000037252903], [0.4437499940395355, 0.856249988079071, 0.05000000074505806, 0.05000000074505806], [0.45625001192092896, 0.856249988079071, 0.02500000037252903, 0.02500000037252903], [0.45625001192092896, 0.856249988079071, 0.05000000074505806, 0.05000000074505806], [0.46875, 0.856249988079071, 0.02500000037252903, 0.02500000037252903], [0.46875, 0.856249988079071, 0.05000000074505806, 0.05000000074505806], [0.48124998807907104, 0.856249988079071, 0.02500000037252903, 0.02500000037252903], [0.48124998807907104, 0.856249988079071, 0.05000000074505806, 0.05000000074505806], [0.4937500059604645, 0.856249988079071, 0.02500000037252903, 0.02500000037252903], [0.4937500059604645, 0.856249988079071, 0.05000000074505806, 0.05000000074505806], [0.5062500238418579, 0.856249988079071, 0.02500000037252903, 0.02500000037252903], [0.5062500238418579, 0.856249988079071, 0.05000000074505806, 0.05000000074505806], [0.518750011920929, 0.856249988079071, 0.02500000037252903, 0.02500000037252903], [0.518750011920929, 0.856249988079071, 0.05000000074505806, 0.05000000074505806], [0.53125, 0.856249988079071, 0.02500000037252903, 0.02500000037252903], [0.53125, 0.856249988079071, 0.05000000074505806, 0.05000000074505806], [0.543749988079071, 0.856249988079071, 0.02500000037252903, 0.02500000037252903], [0.543749988079071, 0.856249988079071, 0.05000000074505806, 0.05000000074505806], [0.5562499761581421, 0.856249988079071, 0.02500000037252903, 0.02500000037252903], [0.5562499761581421, 0.856249988079071, 0.05000000074505806, 0.05000000074505806], [0.5687500238418579, 0.856249988079071, 0.02500000037252903, 0.02500000037252903], [0.5687500238418579, 0.856249988079071, 0.05000000074505806, 0.05000000074505806], [0.581250011920929, 0.856249988079071, 0.02500000037252903, 0.02500000037252903], [0.581250011920929, 0.856249988079071, 0.05000000074505806, 0.05000000074505806], [0.59375, 0.856249988079071, 0.02500000037252903, 0.02500000037252903], [0.59375, 0.856249988079071, 0.05000000074505806, 0.05000000074505806], [0.606249988079071, 0.856249988079071, 0.02500000037252903, 0.02500000037252903], [0.606249988079071, 0.856249988079071, 0.05000000074505806, 0.05000000074505806], [0.6187499761581421, 0.856249988079071, 0.02500000037252903, 0.02500000037252903], [0.6187499761581421, 0.856249988079071, 0.05000000074505806, 0.05000000074505806], [0.6312500238418579, 0.856249988079071, 0.02500000037252903, 0.02500000037252903], [0.6312500238418579, 0.856249988079071, 0.05000000074505806, 0.05000000074505806], [0.643750011920929, 0.856249988079071, 0.02500000037252903, 0.02500000037252903], [0.643750011920929, 0.856249988079071, 0.05000000074505806, 0.05000000074505806], [0.65625, 0.856249988079071, 0.02500000037252903, 0.02500000037252903], [0.65625, 0.856249988079071, 0.05000000074505806, 0.05000000074505806], [0.668749988079071, 0.856249988079071, 0.02500000037252903, 0.02500000037252903], [0.668749988079071, 0.856249988079071, 0.05000000074505806, 0.05000000074505806], [0.6812499761581421, 0.856249988079071, 0.02500000037252903, 0.02500000037252903], [0.6812499761581421, 0.856249988079071, 0.05000000074505806, 0.05000000074505806], [0.6937500238418579, 0.856249988079071, 0.02500000037252903, 0.02500000037252903], [0.6937500238418579, 0.856249988079071, 0.05000000074505806, 0.05000000074505806], [0.706250011920929, 0.856249988079071, 0.02500000037252903, 0.02500000037252903], [0.706250011920929, 0.856249988079071, 0.05000000074505806, 0.05000000074505806], [0.71875, 0.856249988079071, 0.02500000037252903, 0.02500000037252903], [0.71875, 0.856249988079071, 0.05000000074505806, 0.05000000074505806], [0.731249988079071, 0.856249988079071, 0.02500000037252903, 0.02500000037252903], [0.731249988079071, 0.856249988079071, 0.05000000074505806, 0.05000000074505806], [0.7437499761581421, 0.856249988079071, 0.02500000037252903, 0.02500000037252903], [0.7437499761581421, 0.856249988079071, 0.05000000074505806, 0.05000000074505806], [0.7562500238418579, 0.856249988079071, 0.02500000037252903, 0.02500000037252903], [0.7562500238418579, 0.856249988079071, 0.05000000074505806, 0.05000000074505806], [0.768750011920929, 0.856249988079071, 0.02500000037252903, 0.02500000037252903], [0.768750011920929, 0.856249988079071, 0.05000000074505806, 0.05000000074505806], [0.78125, 0.856249988079071, 0.02500000037252903, 0.02500000037252903], [0.78125, 0.856249988079071, 0.05000000074505806, 0.05000000074505806], [0.793749988079071, 0.856249988079071, 0.02500000037252903, 0.02500000037252903], [0.793749988079071, 0.856249988079071, 0.05000000074505806, 0.05000000074505806], [0.8062499761581421, 0.856249988079071, 0.02500000037252903, 0.02500000037252903], [0.8062499761581421, 0.856249988079071, 0.05000000074505806, 0.05000000074505806], [0.8187500238418579, 0.856249988079071, 0.02500000037252903, 0.02500000037252903], [0.8187500238418579, 0.856249988079071, 0.05000000074505806, 0.05000000074505806], [0.831250011920929, 0.856249988079071, 0.02500000037252903, 0.02500000037252903], [0.831250011920929, 0.856249988079071, 0.05000000074505806, 0.05000000074505806], [0.84375, 0.856249988079071, 0.02500000037252903, 0.02500000037252903], [0.84375, 0.856249988079071, 0.05000000074505806, 0.05000000074505806], [0.856249988079071, 0.856249988079071, 0.02500000037252903, 0.02500000037252903], [0.856249988079071, 0.856249988079071, 0.05000000074505806, 0.05000000074505806], [0.8687499761581421, 0.856249988079071, 0.02500000037252903, 0.02500000037252903], [0.8687499761581421, 0.856249988079071, 0.05000000074505806, 0.05000000074505806], [0.8812500238418579, 0.856249988079071, 0.02500000037252903, 0.02500000037252903], [0.8812500238418579, 0.856249988079071, 0.05000000074505806, 0.05000000074505806], [0.893750011920929, 0.856249988079071, 0.02500000037252903, 0.02500000037252903], [0.893750011920929, 0.856249988079071, 0.05000000074505806, 0.05000000074505806], [0.90625, 0.856249988079071, 0.02500000037252903, 0.02500000037252903], [0.90625, 0.856249988079071, 0.05000000074505806, 0.05000000074505806], [0.918749988079071, 0.856249988079071, 0.02500000037252903, 0.02500000037252903], [0.918749988079071, 0.856249988079071, 0.05000000074505806, 0.05000000074505806], [0.9312499761581421, 0.856249988079071, 0.02500000037252903, 0.02500000037252903], [0.9312499761581421, 0.856249988079071, 0.05000000074505806, 0.05000000074505806], [0.9437500238418579, 0.856249988079071, 0.02500000037252903, 0.02500000037252903], [0.9437500238418579, 0.856249988079071, 0.05000000074505806, 0.05000000074505806], [0.956250011920929, 0.856249988079071, 0.02500000037252903, 0.02500000037252903], [0.956250011920929, 0.856249988079071, 0.05000000074505806, 0.05000000074505806], [0.96875, 0.856249988079071, 0.02500000037252903, 0.02500000037252903], [0.96875, 0.856249988079071, 0.05000000074505806, 0.05000000074505806], [0.981249988079071, 0.856249988079071, 0.02500000037252903, 0.02500000037252903], [0.981249988079071, 0.856249988079071, 0.05000000074505806, 0.05000000074505806], [0.9937499761581421, 0.856249988079071, 0.02500000037252903, 0.02500000037252903], [0.9937499761581421, 0.856249988079071, 0.05000000074505806, 0.05000000074505806], [0.0062500000931322575, 0.8687499761581421, 0.02500000037252903, 0.02500000037252903], [0.0062500000931322575, 0.8687499761581421, 0.05000000074505806, 0.05000000074505806], [0.01875000074505806, 0.8687499761581421, 0.02500000037252903, 0.02500000037252903], [0.01875000074505806, 0.8687499761581421, 0.05000000074505806, 0.05000000074505806], [0.03125, 0.8687499761581421, 0.02500000037252903, 0.02500000037252903], [0.03125, 0.8687499761581421, 0.05000000074505806, 0.05000000074505806], [0.04374999925494194, 0.8687499761581421, 0.02500000037252903, 0.02500000037252903], [0.04374999925494194, 0.8687499761581421, 0.05000000074505806, 0.05000000074505806], [0.05624999850988388, 0.8687499761581421, 0.02500000037252903, 0.02500000037252903], [0.05624999850988388, 0.8687499761581421, 0.05000000074505806, 0.05000000074505806], [0.06875000149011612, 0.8687499761581421, 0.02500000037252903, 0.02500000037252903], [0.06875000149011612, 0.8687499761581421, 0.05000000074505806, 0.05000000074505806], [0.08124999701976776, 0.8687499761581421, 0.02500000037252903, 0.02500000037252903], [0.08124999701976776, 0.8687499761581421, 0.05000000074505806, 0.05000000074505806], [0.09375, 0.8687499761581421, 0.02500000037252903, 0.02500000037252903], [0.09375, 0.8687499761581421, 0.05000000074505806, 0.05000000074505806], [0.10625000298023224, 0.8687499761581421, 0.02500000037252903, 0.02500000037252903], [0.10625000298023224, 0.8687499761581421, 0.05000000074505806, 0.05000000074505806], [0.11874999850988388, 0.8687499761581421, 0.02500000037252903, 0.02500000037252903], [0.11874999850988388, 0.8687499761581421, 0.05000000074505806, 0.05000000074505806], [0.13124999403953552, 0.8687499761581421, 0.02500000037252903, 0.02500000037252903], [0.13124999403953552, 0.8687499761581421, 0.05000000074505806, 0.05000000074505806], [0.14374999701976776, 0.8687499761581421, 0.02500000037252903, 0.02500000037252903], [0.14374999701976776, 0.8687499761581421, 0.05000000074505806, 0.05000000074505806], [0.15625, 0.8687499761581421, 0.02500000037252903, 0.02500000037252903], [0.15625, 0.8687499761581421, 0.05000000074505806, 0.05000000074505806], [0.16875000298023224, 0.8687499761581421, 0.02500000037252903, 0.02500000037252903], [0.16875000298023224, 0.8687499761581421, 0.05000000074505806, 0.05000000074505806], [0.18125000596046448, 0.8687499761581421, 0.02500000037252903, 0.02500000037252903], [0.18125000596046448, 0.8687499761581421, 0.05000000074505806, 0.05000000074505806], [0.19374999403953552, 0.8687499761581421, 0.02500000037252903, 0.02500000037252903], [0.19374999403953552, 0.8687499761581421, 0.05000000074505806, 0.05000000074505806], [0.20624999701976776, 0.8687499761581421, 0.02500000037252903, 0.02500000037252903], [0.20624999701976776, 0.8687499761581421, 0.05000000074505806, 0.05000000074505806], [0.21875, 0.8687499761581421, 0.02500000037252903, 0.02500000037252903], [0.21875, 0.8687499761581421, 0.05000000074505806, 0.05000000074505806], [0.23125000298023224, 0.8687499761581421, 0.02500000037252903, 0.02500000037252903], [0.23125000298023224, 0.8687499761581421, 0.05000000074505806, 0.05000000074505806], [0.24375000596046448, 0.8687499761581421, 0.02500000037252903, 0.02500000037252903], [0.24375000596046448, 0.8687499761581421, 0.05000000074505806, 0.05000000074505806], [0.2562499940395355, 0.8687499761581421, 0.02500000037252903, 0.02500000037252903], [0.2562499940395355, 0.8687499761581421, 0.05000000074505806, 0.05000000074505806], [0.26875001192092896, 0.8687499761581421, 0.02500000037252903, 0.02500000037252903], [0.26875001192092896, 0.8687499761581421, 0.05000000074505806, 0.05000000074505806], [0.28125, 0.8687499761581421, 0.02500000037252903, 0.02500000037252903], [0.28125, 0.8687499761581421, 0.05000000074505806, 0.05000000074505806], [0.29374998807907104, 0.8687499761581421, 0.02500000037252903, 0.02500000037252903], [0.29374998807907104, 0.8687499761581421, 0.05000000074505806, 0.05000000074505806], [0.3062500059604645, 0.8687499761581421, 0.02500000037252903, 0.02500000037252903], [0.3062500059604645, 0.8687499761581421, 0.05000000074505806, 0.05000000074505806], [0.3187499940395355, 0.8687499761581421, 0.02500000037252903, 0.02500000037252903], [0.3187499940395355, 0.8687499761581421, 0.05000000074505806, 0.05000000074505806], [0.33125001192092896, 0.8687499761581421, 0.02500000037252903, 0.02500000037252903], [0.33125001192092896, 0.8687499761581421, 0.05000000074505806, 0.05000000074505806], [0.34375, 0.8687499761581421, 0.02500000037252903, 0.02500000037252903], [0.34375, 0.8687499761581421, 0.05000000074505806, 0.05000000074505806], [0.35624998807907104, 0.8687499761581421, 0.02500000037252903, 0.02500000037252903], [0.35624998807907104, 0.8687499761581421, 0.05000000074505806, 0.05000000074505806], [0.3687500059604645, 0.8687499761581421, 0.02500000037252903, 0.02500000037252903], [0.3687500059604645, 0.8687499761581421, 0.05000000074505806, 0.05000000074505806], [0.3812499940395355, 0.8687499761581421, 0.02500000037252903, 0.02500000037252903], [0.3812499940395355, 0.8687499761581421, 0.05000000074505806, 0.05000000074505806], [0.39375001192092896, 0.8687499761581421, 0.02500000037252903, 0.02500000037252903], [0.39375001192092896, 0.8687499761581421, 0.05000000074505806, 0.05000000074505806], [0.40625, 0.8687499761581421, 0.02500000037252903, 0.02500000037252903], [0.40625, 0.8687499761581421, 0.05000000074505806, 0.05000000074505806], [0.41874998807907104, 0.8687499761581421, 0.02500000037252903, 0.02500000037252903], [0.41874998807907104, 0.8687499761581421, 0.05000000074505806, 0.05000000074505806], [0.4312500059604645, 0.8687499761581421, 0.02500000037252903, 0.02500000037252903], [0.4312500059604645, 0.8687499761581421, 0.05000000074505806, 0.05000000074505806], [0.4437499940395355, 0.8687499761581421, 0.02500000037252903, 0.02500000037252903], [0.4437499940395355, 0.8687499761581421, 0.05000000074505806, 0.05000000074505806], [0.45625001192092896, 0.8687499761581421, 0.02500000037252903, 0.02500000037252903], [0.45625001192092896, 0.8687499761581421, 0.05000000074505806, 0.05000000074505806], [0.46875, 0.8687499761581421, 0.02500000037252903, 0.02500000037252903], [0.46875, 0.8687499761581421, 0.05000000074505806, 0.05000000074505806], [0.48124998807907104, 0.8687499761581421, 0.02500000037252903, 0.02500000037252903], [0.48124998807907104, 0.8687499761581421, 0.05000000074505806, 0.05000000074505806], [0.4937500059604645, 0.8687499761581421, 0.02500000037252903, 0.02500000037252903], [0.4937500059604645, 0.8687499761581421, 0.05000000074505806, 0.05000000074505806], [0.5062500238418579, 0.8687499761581421, 0.02500000037252903, 0.02500000037252903], [0.5062500238418579, 0.8687499761581421, 0.05000000074505806, 0.05000000074505806], [0.518750011920929, 0.8687499761581421, 0.02500000037252903, 0.02500000037252903], [0.518750011920929, 0.8687499761581421, 0.05000000074505806, 0.05000000074505806], [0.53125, 0.8687499761581421, 0.02500000037252903, 0.02500000037252903], [0.53125, 0.8687499761581421, 0.05000000074505806, 0.05000000074505806], [0.543749988079071, 0.8687499761581421, 0.02500000037252903, 0.02500000037252903], [0.543749988079071, 0.8687499761581421, 0.05000000074505806, 0.05000000074505806], [0.5562499761581421, 0.8687499761581421, 0.02500000037252903, 0.02500000037252903], [0.5562499761581421, 0.8687499761581421, 0.05000000074505806, 0.05000000074505806], [0.5687500238418579, 0.8687499761581421, 0.02500000037252903, 0.02500000037252903], [0.5687500238418579, 0.8687499761581421, 0.05000000074505806, 0.05000000074505806], [0.581250011920929, 0.8687499761581421, 0.02500000037252903, 0.02500000037252903], [0.581250011920929, 0.8687499761581421, 0.05000000074505806, 0.05000000074505806], [0.59375, 0.8687499761581421, 0.02500000037252903, 0.02500000037252903], [0.59375, 0.8687499761581421, 0.05000000074505806, 0.05000000074505806], [0.606249988079071, 0.8687499761581421, 0.02500000037252903, 0.02500000037252903], [0.606249988079071, 0.8687499761581421, 0.05000000074505806, 0.05000000074505806], [0.6187499761581421, 0.8687499761581421, 0.02500000037252903, 0.02500000037252903], [0.6187499761581421, 0.8687499761581421, 0.05000000074505806, 0.05000000074505806], [0.6312500238418579, 0.8687499761581421, 0.02500000037252903, 0.02500000037252903], [0.6312500238418579, 0.8687499761581421, 0.05000000074505806, 0.05000000074505806], [0.643750011920929, 0.8687499761581421, 0.02500000037252903, 0.02500000037252903], [0.643750011920929, 0.8687499761581421, 0.05000000074505806, 0.05000000074505806], [0.65625, 0.8687499761581421, 0.02500000037252903, 0.02500000037252903], [0.65625, 0.8687499761581421, 0.05000000074505806, 0.05000000074505806], [0.668749988079071, 0.8687499761581421, 0.02500000037252903, 0.02500000037252903], [0.668749988079071, 0.8687499761581421, 0.05000000074505806, 0.05000000074505806], [0.6812499761581421, 0.8687499761581421, 0.02500000037252903, 0.02500000037252903], [0.6812499761581421, 0.8687499761581421, 0.05000000074505806, 0.05000000074505806], [0.6937500238418579, 0.8687499761581421, 0.02500000037252903, 0.02500000037252903], [0.6937500238418579, 0.8687499761581421, 0.05000000074505806, 0.05000000074505806], [0.706250011920929, 0.8687499761581421, 0.02500000037252903, 0.02500000037252903], [0.706250011920929, 0.8687499761581421, 0.05000000074505806, 0.05000000074505806], [0.71875, 0.8687499761581421, 0.02500000037252903, 0.02500000037252903], [0.71875, 0.8687499761581421, 0.05000000074505806, 0.05000000074505806], [0.731249988079071, 0.8687499761581421, 0.02500000037252903, 0.02500000037252903], [0.731249988079071, 0.8687499761581421, 0.05000000074505806, 0.05000000074505806], [0.7437499761581421, 0.8687499761581421, 0.02500000037252903, 0.02500000037252903], [0.7437499761581421, 0.8687499761581421, 0.05000000074505806, 0.05000000074505806], [0.7562500238418579, 0.8687499761581421, 0.02500000037252903, 0.02500000037252903], [0.7562500238418579, 0.8687499761581421, 0.05000000074505806, 0.05000000074505806], [0.768750011920929, 0.8687499761581421, 0.02500000037252903, 0.02500000037252903], [0.768750011920929, 0.8687499761581421, 0.05000000074505806, 0.05000000074505806], [0.78125, 0.8687499761581421, 0.02500000037252903, 0.02500000037252903], [0.78125, 0.8687499761581421, 0.05000000074505806, 0.05000000074505806], [0.793749988079071, 0.8687499761581421, 0.02500000037252903, 0.02500000037252903], [0.793749988079071, 0.8687499761581421, 0.05000000074505806, 0.05000000074505806], [0.8062499761581421, 0.8687499761581421, 0.02500000037252903, 0.02500000037252903], [0.8062499761581421, 0.8687499761581421, 0.05000000074505806, 0.05000000074505806], [0.8187500238418579, 0.8687499761581421, 0.02500000037252903, 0.02500000037252903], [0.8187500238418579, 0.8687499761581421, 0.05000000074505806, 0.05000000074505806], [0.831250011920929, 0.8687499761581421, 0.02500000037252903, 0.02500000037252903], [0.831250011920929, 0.8687499761581421, 0.05000000074505806, 0.05000000074505806], [0.84375, 0.8687499761581421, 0.02500000037252903, 0.02500000037252903], [0.84375, 0.8687499761581421, 0.05000000074505806, 0.05000000074505806], [0.856249988079071, 0.8687499761581421, 0.02500000037252903, 0.02500000037252903], [0.856249988079071, 0.8687499761581421, 0.05000000074505806, 0.05000000074505806], [0.8687499761581421, 0.8687499761581421, 0.02500000037252903, 0.02500000037252903], [0.8687499761581421, 0.8687499761581421, 0.05000000074505806, 0.05000000074505806], [0.8812500238418579, 0.8687499761581421, 0.02500000037252903, 0.02500000037252903], [0.8812500238418579, 0.8687499761581421, 0.05000000074505806, 0.05000000074505806], [0.893750011920929, 0.8687499761581421, 0.02500000037252903, 0.02500000037252903], [0.893750011920929, 0.8687499761581421, 0.05000000074505806, 0.05000000074505806], [0.90625, 0.8687499761581421, 0.02500000037252903, 0.02500000037252903], [0.90625, 0.8687499761581421, 0.05000000074505806, 0.05000000074505806], [0.918749988079071, 0.8687499761581421, 0.02500000037252903, 0.02500000037252903], [0.918749988079071, 0.8687499761581421, 0.05000000074505806, 0.05000000074505806], [0.9312499761581421, 0.8687499761581421, 0.02500000037252903, 0.02500000037252903], [0.9312499761581421, 0.8687499761581421, 0.05000000074505806, 0.05000000074505806], [0.9437500238418579, 0.8687499761581421, 0.02500000037252903, 0.02500000037252903], [0.9437500238418579, 0.8687499761581421, 0.05000000074505806, 0.05000000074505806], [0.956250011920929, 0.8687499761581421, 0.02500000037252903, 0.02500000037252903], [0.956250011920929, 0.8687499761581421, 0.05000000074505806, 0.05000000074505806], [0.96875, 0.8687499761581421, 0.02500000037252903, 0.02500000037252903], [0.96875, 0.8687499761581421, 0.05000000074505806, 0.05000000074505806], [0.981249988079071, 0.8687499761581421, 0.02500000037252903, 0.02500000037252903], [0.981249988079071, 0.8687499761581421, 0.05000000074505806, 0.05000000074505806], [0.9937499761581421, 0.8687499761581421, 0.02500000037252903, 0.02500000037252903], [0.9937499761581421, 0.8687499761581421, 0.05000000074505806, 0.05000000074505806], [0.0062500000931322575, 0.8812500238418579, 0.02500000037252903, 0.02500000037252903], [0.0062500000931322575, 0.8812500238418579, 0.05000000074505806, 0.05000000074505806], [0.01875000074505806, 0.8812500238418579, 0.02500000037252903, 0.02500000037252903], [0.01875000074505806, 0.8812500238418579, 0.05000000074505806, 0.05000000074505806], [0.03125, 0.8812500238418579, 0.02500000037252903, 0.02500000037252903], [0.03125, 0.8812500238418579, 0.05000000074505806, 0.05000000074505806], [0.04374999925494194, 0.8812500238418579, 0.02500000037252903, 0.02500000037252903], [0.04374999925494194, 0.8812500238418579, 0.05000000074505806, 0.05000000074505806], [0.05624999850988388, 0.8812500238418579, 0.02500000037252903, 0.02500000037252903], [0.05624999850988388, 0.8812500238418579, 0.05000000074505806, 0.05000000074505806], [0.06875000149011612, 0.8812500238418579, 0.02500000037252903, 0.02500000037252903], [0.06875000149011612, 0.8812500238418579, 0.05000000074505806, 0.05000000074505806], [0.08124999701976776, 0.8812500238418579, 0.02500000037252903, 0.02500000037252903], [0.08124999701976776, 0.8812500238418579, 0.05000000074505806, 0.05000000074505806], [0.09375, 0.8812500238418579, 0.02500000037252903, 0.02500000037252903], [0.09375, 0.8812500238418579, 0.05000000074505806, 0.05000000074505806], [0.10625000298023224, 0.8812500238418579, 0.02500000037252903, 0.02500000037252903], [0.10625000298023224, 0.8812500238418579, 0.05000000074505806, 0.05000000074505806], [0.11874999850988388, 0.8812500238418579, 0.02500000037252903, 0.02500000037252903], [0.11874999850988388, 0.8812500238418579, 0.05000000074505806, 0.05000000074505806], [0.13124999403953552, 0.8812500238418579, 0.02500000037252903, 0.02500000037252903], [0.13124999403953552, 0.8812500238418579, 0.05000000074505806, 0.05000000074505806], [0.14374999701976776, 0.8812500238418579, 0.02500000037252903, 0.02500000037252903], [0.14374999701976776, 0.8812500238418579, 0.05000000074505806, 0.05000000074505806], [0.15625, 0.8812500238418579, 0.02500000037252903, 0.02500000037252903], [0.15625, 0.8812500238418579, 0.05000000074505806, 0.05000000074505806], [0.16875000298023224, 0.8812500238418579, 0.02500000037252903, 0.02500000037252903], [0.16875000298023224, 0.8812500238418579, 0.05000000074505806, 0.05000000074505806], [0.18125000596046448, 0.8812500238418579, 0.02500000037252903, 0.02500000037252903], [0.18125000596046448, 0.8812500238418579, 0.05000000074505806, 0.05000000074505806], [0.19374999403953552, 0.8812500238418579, 0.02500000037252903, 0.02500000037252903], [0.19374999403953552, 0.8812500238418579, 0.05000000074505806, 0.05000000074505806], [0.20624999701976776, 0.8812500238418579, 0.02500000037252903, 0.02500000037252903], [0.20624999701976776, 0.8812500238418579, 0.05000000074505806, 0.05000000074505806], [0.21875, 0.8812500238418579, 0.02500000037252903, 0.02500000037252903], [0.21875, 0.8812500238418579, 0.05000000074505806, 0.05000000074505806], [0.23125000298023224, 0.8812500238418579, 0.02500000037252903, 0.02500000037252903], [0.23125000298023224, 0.8812500238418579, 0.05000000074505806, 0.05000000074505806], [0.24375000596046448, 0.8812500238418579, 0.02500000037252903, 0.02500000037252903], [0.24375000596046448, 0.8812500238418579, 0.05000000074505806, 0.05000000074505806], [0.2562499940395355, 0.8812500238418579, 0.02500000037252903, 0.02500000037252903], [0.2562499940395355, 0.8812500238418579, 0.05000000074505806, 0.05000000074505806], [0.26875001192092896, 0.8812500238418579, 0.02500000037252903, 0.02500000037252903], [0.26875001192092896, 0.8812500238418579, 0.05000000074505806, 0.05000000074505806], [0.28125, 0.8812500238418579, 0.02500000037252903, 0.02500000037252903], [0.28125, 0.8812500238418579, 0.05000000074505806, 0.05000000074505806], [0.29374998807907104, 0.8812500238418579, 0.02500000037252903, 0.02500000037252903], [0.29374998807907104, 0.8812500238418579, 0.05000000074505806, 0.05000000074505806], [0.3062500059604645, 0.8812500238418579, 0.02500000037252903, 0.02500000037252903], [0.3062500059604645, 0.8812500238418579, 0.05000000074505806, 0.05000000074505806], [0.3187499940395355, 0.8812500238418579, 0.02500000037252903, 0.02500000037252903], [0.3187499940395355, 0.8812500238418579, 0.05000000074505806, 0.05000000074505806], [0.33125001192092896, 0.8812500238418579, 0.02500000037252903, 0.02500000037252903], [0.33125001192092896, 0.8812500238418579, 0.05000000074505806, 0.05000000074505806], [0.34375, 0.8812500238418579, 0.02500000037252903, 0.02500000037252903], [0.34375, 0.8812500238418579, 0.05000000074505806, 0.05000000074505806], [0.35624998807907104, 0.8812500238418579, 0.02500000037252903, 0.02500000037252903], [0.35624998807907104, 0.8812500238418579, 0.05000000074505806, 0.05000000074505806], [0.3687500059604645, 0.8812500238418579, 0.02500000037252903, 0.02500000037252903], [0.3687500059604645, 0.8812500238418579, 0.05000000074505806, 0.05000000074505806], [0.3812499940395355, 0.8812500238418579, 0.02500000037252903, 0.02500000037252903], [0.3812499940395355, 0.8812500238418579, 0.05000000074505806, 0.05000000074505806], [0.39375001192092896, 0.8812500238418579, 0.02500000037252903, 0.02500000037252903], [0.39375001192092896, 0.8812500238418579, 0.05000000074505806, 0.05000000074505806], [0.40625, 0.8812500238418579, 0.02500000037252903, 0.02500000037252903], [0.40625, 0.8812500238418579, 0.05000000074505806, 0.05000000074505806], [0.41874998807907104, 0.8812500238418579, 0.02500000037252903, 0.02500000037252903], [0.41874998807907104, 0.8812500238418579, 0.05000000074505806, 0.05000000074505806], [0.4312500059604645, 0.8812500238418579, 0.02500000037252903, 0.02500000037252903], [0.4312500059604645, 0.8812500238418579, 0.05000000074505806, 0.05000000074505806], [0.4437499940395355, 0.8812500238418579, 0.02500000037252903, 0.02500000037252903], [0.4437499940395355, 0.8812500238418579, 0.05000000074505806, 0.05000000074505806], [0.45625001192092896, 0.8812500238418579, 0.02500000037252903, 0.02500000037252903], [0.45625001192092896, 0.8812500238418579, 0.05000000074505806, 0.05000000074505806], [0.46875, 0.8812500238418579, 0.02500000037252903, 0.02500000037252903], [0.46875, 0.8812500238418579, 0.05000000074505806, 0.05000000074505806], [0.48124998807907104, 0.8812500238418579, 0.02500000037252903, 0.02500000037252903], [0.48124998807907104, 0.8812500238418579, 0.05000000074505806, 0.05000000074505806], [0.4937500059604645, 0.8812500238418579, 0.02500000037252903, 0.02500000037252903], [0.4937500059604645, 0.8812500238418579, 0.05000000074505806, 0.05000000074505806], [0.5062500238418579, 0.8812500238418579, 0.02500000037252903, 0.02500000037252903], [0.5062500238418579, 0.8812500238418579, 0.05000000074505806, 0.05000000074505806], [0.518750011920929, 0.8812500238418579, 0.02500000037252903, 0.02500000037252903], [0.518750011920929, 0.8812500238418579, 0.05000000074505806, 0.05000000074505806], [0.53125, 0.8812500238418579, 0.02500000037252903, 0.02500000037252903], [0.53125, 0.8812500238418579, 0.05000000074505806, 0.05000000074505806], [0.543749988079071, 0.8812500238418579, 0.02500000037252903, 0.02500000037252903], [0.543749988079071, 0.8812500238418579, 0.05000000074505806, 0.05000000074505806], [0.5562499761581421, 0.8812500238418579, 0.02500000037252903, 0.02500000037252903], [0.5562499761581421, 0.8812500238418579, 0.05000000074505806, 0.05000000074505806], [0.5687500238418579, 0.8812500238418579, 0.02500000037252903, 0.02500000037252903], [0.5687500238418579, 0.8812500238418579, 0.05000000074505806, 0.05000000074505806], [0.581250011920929, 0.8812500238418579, 0.02500000037252903, 0.02500000037252903], [0.581250011920929, 0.8812500238418579, 0.05000000074505806, 0.05000000074505806], [0.59375, 0.8812500238418579, 0.02500000037252903, 0.02500000037252903], [0.59375, 0.8812500238418579, 0.05000000074505806, 0.05000000074505806], [0.606249988079071, 0.8812500238418579, 0.02500000037252903, 0.02500000037252903], [0.606249988079071, 0.8812500238418579, 0.05000000074505806, 0.05000000074505806], [0.6187499761581421, 0.8812500238418579, 0.02500000037252903, 0.02500000037252903], [0.6187499761581421, 0.8812500238418579, 0.05000000074505806, 0.05000000074505806], [0.6312500238418579, 0.8812500238418579, 0.02500000037252903, 0.02500000037252903], [0.6312500238418579, 0.8812500238418579, 0.05000000074505806, 0.05000000074505806], [0.643750011920929, 0.8812500238418579, 0.02500000037252903, 0.02500000037252903], [0.643750011920929, 0.8812500238418579, 0.05000000074505806, 0.05000000074505806], [0.65625, 0.8812500238418579, 0.02500000037252903, 0.02500000037252903], [0.65625, 0.8812500238418579, 0.05000000074505806, 0.05000000074505806], [0.668749988079071, 0.8812500238418579, 0.02500000037252903, 0.02500000037252903], [0.668749988079071, 0.8812500238418579, 0.05000000074505806, 0.05000000074505806], [0.6812499761581421, 0.8812500238418579, 0.02500000037252903, 0.02500000037252903], [0.6812499761581421, 0.8812500238418579, 0.05000000074505806, 0.05000000074505806], [0.6937500238418579, 0.8812500238418579, 0.02500000037252903, 0.02500000037252903], [0.6937500238418579, 0.8812500238418579, 0.05000000074505806, 0.05000000074505806], [0.706250011920929, 0.8812500238418579, 0.02500000037252903, 0.02500000037252903], [0.706250011920929, 0.8812500238418579, 0.05000000074505806, 0.05000000074505806], [0.71875, 0.8812500238418579, 0.02500000037252903, 0.02500000037252903], [0.71875, 0.8812500238418579, 0.05000000074505806, 0.05000000074505806], [0.731249988079071, 0.8812500238418579, 0.02500000037252903, 0.02500000037252903], [0.731249988079071, 0.8812500238418579, 0.05000000074505806, 0.05000000074505806], [0.7437499761581421, 0.8812500238418579, 0.02500000037252903, 0.02500000037252903], [0.7437499761581421, 0.8812500238418579, 0.05000000074505806, 0.05000000074505806], [0.7562500238418579, 0.8812500238418579, 0.02500000037252903, 0.02500000037252903], [0.7562500238418579, 0.8812500238418579, 0.05000000074505806, 0.05000000074505806], [0.768750011920929, 0.8812500238418579, 0.02500000037252903, 0.02500000037252903], [0.768750011920929, 0.8812500238418579, 0.05000000074505806, 0.05000000074505806], [0.78125, 0.8812500238418579, 0.02500000037252903, 0.02500000037252903], [0.78125, 0.8812500238418579, 0.05000000074505806, 0.05000000074505806], [0.793749988079071, 0.8812500238418579, 0.02500000037252903, 0.02500000037252903], [0.793749988079071, 0.8812500238418579, 0.05000000074505806, 0.05000000074505806], [0.8062499761581421, 0.8812500238418579, 0.02500000037252903, 0.02500000037252903], [0.8062499761581421, 0.8812500238418579, 0.05000000074505806, 0.05000000074505806], [0.8187500238418579, 0.8812500238418579, 0.02500000037252903, 0.02500000037252903], [0.8187500238418579, 0.8812500238418579, 0.05000000074505806, 0.05000000074505806], [0.831250011920929, 0.8812500238418579, 0.02500000037252903, 0.02500000037252903], [0.831250011920929, 0.8812500238418579, 0.05000000074505806, 0.05000000074505806], [0.84375, 0.8812500238418579, 0.02500000037252903, 0.02500000037252903], [0.84375, 0.8812500238418579, 0.05000000074505806, 0.05000000074505806], [0.856249988079071, 0.8812500238418579, 0.02500000037252903, 0.02500000037252903], [0.856249988079071, 0.8812500238418579, 0.05000000074505806, 0.05000000074505806], [0.8687499761581421, 0.8812500238418579, 0.02500000037252903, 0.02500000037252903], [0.8687499761581421, 0.8812500238418579, 0.05000000074505806, 0.05000000074505806], [0.8812500238418579, 0.8812500238418579, 0.02500000037252903, 0.02500000037252903], [0.8812500238418579, 0.8812500238418579, 0.05000000074505806, 0.05000000074505806], [0.893750011920929, 0.8812500238418579, 0.02500000037252903, 0.02500000037252903], [0.893750011920929, 0.8812500238418579, 0.05000000074505806, 0.05000000074505806], [0.90625, 0.8812500238418579, 0.02500000037252903, 0.02500000037252903], [0.90625, 0.8812500238418579, 0.05000000074505806, 0.05000000074505806], [0.918749988079071, 0.8812500238418579, 0.02500000037252903, 0.02500000037252903], [0.918749988079071, 0.8812500238418579, 0.05000000074505806, 0.05000000074505806], [0.9312499761581421, 0.8812500238418579, 0.02500000037252903, 0.02500000037252903], [0.9312499761581421, 0.8812500238418579, 0.05000000074505806, 0.05000000074505806], [0.9437500238418579, 0.8812500238418579, 0.02500000037252903, 0.02500000037252903], [0.9437500238418579, 0.8812500238418579, 0.05000000074505806, 0.05000000074505806], [0.956250011920929, 0.8812500238418579, 0.02500000037252903, 0.02500000037252903], [0.956250011920929, 0.8812500238418579, 0.05000000074505806, 0.05000000074505806], [0.96875, 0.8812500238418579, 0.02500000037252903, 0.02500000037252903], [0.96875, 0.8812500238418579, 0.05000000074505806, 0.05000000074505806], [0.981249988079071, 0.8812500238418579, 0.02500000037252903, 0.02500000037252903], [0.981249988079071, 0.8812500238418579, 0.05000000074505806, 0.05000000074505806], [0.9937499761581421, 0.8812500238418579, 0.02500000037252903, 0.02500000037252903], [0.9937499761581421, 0.8812500238418579, 0.05000000074505806, 0.05000000074505806], [0.0062500000931322575, 0.893750011920929, 0.02500000037252903, 0.02500000037252903], [0.0062500000931322575, 0.893750011920929, 0.05000000074505806, 0.05000000074505806], [0.01875000074505806, 0.893750011920929, 0.02500000037252903, 0.02500000037252903], [0.01875000074505806, 0.893750011920929, 0.05000000074505806, 0.05000000074505806], [0.03125, 0.893750011920929, 0.02500000037252903, 0.02500000037252903], [0.03125, 0.893750011920929, 0.05000000074505806, 0.05000000074505806], [0.04374999925494194, 0.893750011920929, 0.02500000037252903, 0.02500000037252903], [0.04374999925494194, 0.893750011920929, 0.05000000074505806, 0.05000000074505806], [0.05624999850988388, 0.893750011920929, 0.02500000037252903, 0.02500000037252903], [0.05624999850988388, 0.893750011920929, 0.05000000074505806, 0.05000000074505806], [0.06875000149011612, 0.893750011920929, 0.02500000037252903, 0.02500000037252903], [0.06875000149011612, 0.893750011920929, 0.05000000074505806, 0.05000000074505806], [0.08124999701976776, 0.893750011920929, 0.02500000037252903, 0.02500000037252903], [0.08124999701976776, 0.893750011920929, 0.05000000074505806, 0.05000000074505806], [0.09375, 0.893750011920929, 0.02500000037252903, 0.02500000037252903], [0.09375, 0.893750011920929, 0.05000000074505806, 0.05000000074505806], [0.10625000298023224, 0.893750011920929, 0.02500000037252903, 0.02500000037252903], [0.10625000298023224, 0.893750011920929, 0.05000000074505806, 0.05000000074505806], [0.11874999850988388, 0.893750011920929, 0.02500000037252903, 0.02500000037252903], [0.11874999850988388, 0.893750011920929, 0.05000000074505806, 0.05000000074505806], [0.13124999403953552, 0.893750011920929, 0.02500000037252903, 0.02500000037252903], [0.13124999403953552, 0.893750011920929, 0.05000000074505806, 0.05000000074505806], [0.14374999701976776, 0.893750011920929, 0.02500000037252903, 0.02500000037252903], [0.14374999701976776, 0.893750011920929, 0.05000000074505806, 0.05000000074505806], [0.15625, 0.893750011920929, 0.02500000037252903, 0.02500000037252903], [0.15625, 0.893750011920929, 0.05000000074505806, 0.05000000074505806], [0.16875000298023224, 0.893750011920929, 0.02500000037252903, 0.02500000037252903], [0.16875000298023224, 0.893750011920929, 0.05000000074505806, 0.05000000074505806], [0.18125000596046448, 0.893750011920929, 0.02500000037252903, 0.02500000037252903], [0.18125000596046448, 0.893750011920929, 0.05000000074505806, 0.05000000074505806], [0.19374999403953552, 0.893750011920929, 0.02500000037252903, 0.02500000037252903], [0.19374999403953552, 0.893750011920929, 0.05000000074505806, 0.05000000074505806], [0.20624999701976776, 0.893750011920929, 0.02500000037252903, 0.02500000037252903], [0.20624999701976776, 0.893750011920929, 0.05000000074505806, 0.05000000074505806], [0.21875, 0.893750011920929, 0.02500000037252903, 0.02500000037252903], [0.21875, 0.893750011920929, 0.05000000074505806, 0.05000000074505806], [0.23125000298023224, 0.893750011920929, 0.02500000037252903, 0.02500000037252903], [0.23125000298023224, 0.893750011920929, 0.05000000074505806, 0.05000000074505806], [0.24375000596046448, 0.893750011920929, 0.02500000037252903, 0.02500000037252903], [0.24375000596046448, 0.893750011920929, 0.05000000074505806, 0.05000000074505806], [0.2562499940395355, 0.893750011920929, 0.02500000037252903, 0.02500000037252903], [0.2562499940395355, 0.893750011920929, 0.05000000074505806, 0.05000000074505806], [0.26875001192092896, 0.893750011920929, 0.02500000037252903, 0.02500000037252903], [0.26875001192092896, 0.893750011920929, 0.05000000074505806, 0.05000000074505806], [0.28125, 0.893750011920929, 0.02500000037252903, 0.02500000037252903], [0.28125, 0.893750011920929, 0.05000000074505806, 0.05000000074505806], [0.29374998807907104, 0.893750011920929, 0.02500000037252903, 0.02500000037252903], [0.29374998807907104, 0.893750011920929, 0.05000000074505806, 0.05000000074505806], [0.3062500059604645, 0.893750011920929, 0.02500000037252903, 0.02500000037252903], [0.3062500059604645, 0.893750011920929, 0.05000000074505806, 0.05000000074505806], [0.3187499940395355, 0.893750011920929, 0.02500000037252903, 0.02500000037252903], [0.3187499940395355, 0.893750011920929, 0.05000000074505806, 0.05000000074505806], [0.33125001192092896, 0.893750011920929, 0.02500000037252903, 0.02500000037252903], [0.33125001192092896, 0.893750011920929, 0.05000000074505806, 0.05000000074505806], [0.34375, 0.893750011920929, 0.02500000037252903, 0.02500000037252903], [0.34375, 0.893750011920929, 0.05000000074505806, 0.05000000074505806], [0.35624998807907104, 0.893750011920929, 0.02500000037252903, 0.02500000037252903], [0.35624998807907104, 0.893750011920929, 0.05000000074505806, 0.05000000074505806], [0.3687500059604645, 0.893750011920929, 0.02500000037252903, 0.02500000037252903], [0.3687500059604645, 0.893750011920929, 0.05000000074505806, 0.05000000074505806], [0.3812499940395355, 0.893750011920929, 0.02500000037252903, 0.02500000037252903], [0.3812499940395355, 0.893750011920929, 0.05000000074505806, 0.05000000074505806], [0.39375001192092896, 0.893750011920929, 0.02500000037252903, 0.02500000037252903], [0.39375001192092896, 0.893750011920929, 0.05000000074505806, 0.05000000074505806], [0.40625, 0.893750011920929, 0.02500000037252903, 0.02500000037252903], [0.40625, 0.893750011920929, 0.05000000074505806, 0.05000000074505806], [0.41874998807907104, 0.893750011920929, 0.02500000037252903, 0.02500000037252903], [0.41874998807907104, 0.893750011920929, 0.05000000074505806, 0.05000000074505806], [0.4312500059604645, 0.893750011920929, 0.02500000037252903, 0.02500000037252903], [0.4312500059604645, 0.893750011920929, 0.05000000074505806, 0.05000000074505806], [0.4437499940395355, 0.893750011920929, 0.02500000037252903, 0.02500000037252903], [0.4437499940395355, 0.893750011920929, 0.05000000074505806, 0.05000000074505806], [0.45625001192092896, 0.893750011920929, 0.02500000037252903, 0.02500000037252903], [0.45625001192092896, 0.893750011920929, 0.05000000074505806, 0.05000000074505806], [0.46875, 0.893750011920929, 0.02500000037252903, 0.02500000037252903], [0.46875, 0.893750011920929, 0.05000000074505806, 0.05000000074505806], [0.48124998807907104, 0.893750011920929, 0.02500000037252903, 0.02500000037252903], [0.48124998807907104, 0.893750011920929, 0.05000000074505806, 0.05000000074505806], [0.4937500059604645, 0.893750011920929, 0.02500000037252903, 0.02500000037252903], [0.4937500059604645, 0.893750011920929, 0.05000000074505806, 0.05000000074505806], [0.5062500238418579, 0.893750011920929, 0.02500000037252903, 0.02500000037252903], [0.5062500238418579, 0.893750011920929, 0.05000000074505806, 0.05000000074505806], [0.518750011920929, 0.893750011920929, 0.02500000037252903, 0.02500000037252903], [0.518750011920929, 0.893750011920929, 0.05000000074505806, 0.05000000074505806], [0.53125, 0.893750011920929, 0.02500000037252903, 0.02500000037252903], [0.53125, 0.893750011920929, 0.05000000074505806, 0.05000000074505806], [0.543749988079071, 0.893750011920929, 0.02500000037252903, 0.02500000037252903], [0.543749988079071, 0.893750011920929, 0.05000000074505806, 0.05000000074505806], [0.5562499761581421, 0.893750011920929, 0.02500000037252903, 0.02500000037252903], [0.5562499761581421, 0.893750011920929, 0.05000000074505806, 0.05000000074505806], [0.5687500238418579, 0.893750011920929, 0.02500000037252903, 0.02500000037252903], [0.5687500238418579, 0.893750011920929, 0.05000000074505806, 0.05000000074505806], [0.581250011920929, 0.893750011920929, 0.02500000037252903, 0.02500000037252903], [0.581250011920929, 0.893750011920929, 0.05000000074505806, 0.05000000074505806], [0.59375, 0.893750011920929, 0.02500000037252903, 0.02500000037252903], [0.59375, 0.893750011920929, 0.05000000074505806, 0.05000000074505806], [0.606249988079071, 0.893750011920929, 0.02500000037252903, 0.02500000037252903], [0.606249988079071, 0.893750011920929, 0.05000000074505806, 0.05000000074505806], [0.6187499761581421, 0.893750011920929, 0.02500000037252903, 0.02500000037252903], [0.6187499761581421, 0.893750011920929, 0.05000000074505806, 0.05000000074505806], [0.6312500238418579, 0.893750011920929, 0.02500000037252903, 0.02500000037252903], [0.6312500238418579, 0.893750011920929, 0.05000000074505806, 0.05000000074505806], [0.643750011920929, 0.893750011920929, 0.02500000037252903, 0.02500000037252903], [0.643750011920929, 0.893750011920929, 0.05000000074505806, 0.05000000074505806], [0.65625, 0.893750011920929, 0.02500000037252903, 0.02500000037252903], [0.65625, 0.893750011920929, 0.05000000074505806, 0.05000000074505806], [0.668749988079071, 0.893750011920929, 0.02500000037252903, 0.02500000037252903], [0.668749988079071, 0.893750011920929, 0.05000000074505806, 0.05000000074505806], [0.6812499761581421, 0.893750011920929, 0.02500000037252903, 0.02500000037252903], [0.6812499761581421, 0.893750011920929, 0.05000000074505806, 0.05000000074505806], [0.6937500238418579, 0.893750011920929, 0.02500000037252903, 0.02500000037252903], [0.6937500238418579, 0.893750011920929, 0.05000000074505806, 0.05000000074505806], [0.706250011920929, 0.893750011920929, 0.02500000037252903, 0.02500000037252903], [0.706250011920929, 0.893750011920929, 0.05000000074505806, 0.05000000074505806], [0.71875, 0.893750011920929, 0.02500000037252903, 0.02500000037252903], [0.71875, 0.893750011920929, 0.05000000074505806, 0.05000000074505806], [0.731249988079071, 0.893750011920929, 0.02500000037252903, 0.02500000037252903], [0.731249988079071, 0.893750011920929, 0.05000000074505806, 0.05000000074505806], [0.7437499761581421, 0.893750011920929, 0.02500000037252903, 0.02500000037252903], [0.7437499761581421, 0.893750011920929, 0.05000000074505806, 0.05000000074505806], [0.7562500238418579, 0.893750011920929, 0.02500000037252903, 0.02500000037252903], [0.7562500238418579, 0.893750011920929, 0.05000000074505806, 0.05000000074505806], [0.768750011920929, 0.893750011920929, 0.02500000037252903, 0.02500000037252903], [0.768750011920929, 0.893750011920929, 0.05000000074505806, 0.05000000074505806], [0.78125, 0.893750011920929, 0.02500000037252903, 0.02500000037252903], [0.78125, 0.893750011920929, 0.05000000074505806, 0.05000000074505806], [0.793749988079071, 0.893750011920929, 0.02500000037252903, 0.02500000037252903], [0.793749988079071, 0.893750011920929, 0.05000000074505806, 0.05000000074505806], [0.8062499761581421, 0.893750011920929, 0.02500000037252903, 0.02500000037252903], [0.8062499761581421, 0.893750011920929, 0.05000000074505806, 0.05000000074505806], [0.8187500238418579, 0.893750011920929, 0.02500000037252903, 0.02500000037252903], [0.8187500238418579, 0.893750011920929, 0.05000000074505806, 0.05000000074505806], [0.831250011920929, 0.893750011920929, 0.02500000037252903, 0.02500000037252903], [0.831250011920929, 0.893750011920929, 0.05000000074505806, 0.05000000074505806], [0.84375, 0.893750011920929, 0.02500000037252903, 0.02500000037252903], [0.84375, 0.893750011920929, 0.05000000074505806, 0.05000000074505806], [0.856249988079071, 0.893750011920929, 0.02500000037252903, 0.02500000037252903], [0.856249988079071, 0.893750011920929, 0.05000000074505806, 0.05000000074505806], [0.8687499761581421, 0.893750011920929, 0.02500000037252903, 0.02500000037252903], [0.8687499761581421, 0.893750011920929, 0.05000000074505806, 0.05000000074505806], [0.8812500238418579, 0.893750011920929, 0.02500000037252903, 0.02500000037252903], [0.8812500238418579, 0.893750011920929, 0.05000000074505806, 0.05000000074505806], [0.893750011920929, 0.893750011920929, 0.02500000037252903, 0.02500000037252903], [0.893750011920929, 0.893750011920929, 0.05000000074505806, 0.05000000074505806], [0.90625, 0.893750011920929, 0.02500000037252903, 0.02500000037252903], [0.90625, 0.893750011920929, 0.05000000074505806, 0.05000000074505806], [0.918749988079071, 0.893750011920929, 0.02500000037252903, 0.02500000037252903], [0.918749988079071, 0.893750011920929, 0.05000000074505806, 0.05000000074505806], [0.9312499761581421, 0.893750011920929, 0.02500000037252903, 0.02500000037252903], [0.9312499761581421, 0.893750011920929, 0.05000000074505806, 0.05000000074505806], [0.9437500238418579, 0.893750011920929, 0.02500000037252903, 0.02500000037252903], [0.9437500238418579, 0.893750011920929, 0.05000000074505806, 0.05000000074505806], [0.956250011920929, 0.893750011920929, 0.02500000037252903, 0.02500000037252903], [0.956250011920929, 0.893750011920929, 0.05000000074505806, 0.05000000074505806], [0.96875, 0.893750011920929, 0.02500000037252903, 0.02500000037252903], [0.96875, 0.893750011920929, 0.05000000074505806, 0.05000000074505806], [0.981249988079071, 0.893750011920929, 0.02500000037252903, 0.02500000037252903], [0.981249988079071, 0.893750011920929, 0.05000000074505806, 0.05000000074505806], [0.9937499761581421, 0.893750011920929, 0.02500000037252903, 0.02500000037252903], [0.9937499761581421, 0.893750011920929, 0.05000000074505806, 0.05000000074505806], [0.0062500000931322575, 0.90625, 0.02500000037252903, 0.02500000037252903], [0.0062500000931322575, 0.90625, 0.05000000074505806, 0.05000000074505806], [0.01875000074505806, 0.90625, 0.02500000037252903, 0.02500000037252903], [0.01875000074505806, 0.90625, 0.05000000074505806, 0.05000000074505806], [0.03125, 0.90625, 0.02500000037252903, 0.02500000037252903], [0.03125, 0.90625, 0.05000000074505806, 0.05000000074505806], [0.04374999925494194, 0.90625, 0.02500000037252903, 0.02500000037252903], [0.04374999925494194, 0.90625, 0.05000000074505806, 0.05000000074505806], [0.05624999850988388, 0.90625, 0.02500000037252903, 0.02500000037252903], [0.05624999850988388, 0.90625, 0.05000000074505806, 0.05000000074505806], [0.06875000149011612, 0.90625, 0.02500000037252903, 0.02500000037252903], [0.06875000149011612, 0.90625, 0.05000000074505806, 0.05000000074505806], [0.08124999701976776, 0.90625, 0.02500000037252903, 0.02500000037252903], [0.08124999701976776, 0.90625, 0.05000000074505806, 0.05000000074505806], [0.09375, 0.90625, 0.02500000037252903, 0.02500000037252903], [0.09375, 0.90625, 0.05000000074505806, 0.05000000074505806], [0.10625000298023224, 0.90625, 0.02500000037252903, 0.02500000037252903], [0.10625000298023224, 0.90625, 0.05000000074505806, 0.05000000074505806], [0.11874999850988388, 0.90625, 0.02500000037252903, 0.02500000037252903], [0.11874999850988388, 0.90625, 0.05000000074505806, 0.05000000074505806], [0.13124999403953552, 0.90625, 0.02500000037252903, 0.02500000037252903], [0.13124999403953552, 0.90625, 0.05000000074505806, 0.05000000074505806], [0.14374999701976776, 0.90625, 0.02500000037252903, 0.02500000037252903], [0.14374999701976776, 0.90625, 0.05000000074505806, 0.05000000074505806], [0.15625, 0.90625, 0.02500000037252903, 0.02500000037252903], [0.15625, 0.90625, 0.05000000074505806, 0.05000000074505806], [0.16875000298023224, 0.90625, 0.02500000037252903, 0.02500000037252903], [0.16875000298023224, 0.90625, 0.05000000074505806, 0.05000000074505806], [0.18125000596046448, 0.90625, 0.02500000037252903, 0.02500000037252903], [0.18125000596046448, 0.90625, 0.05000000074505806, 0.05000000074505806], [0.19374999403953552, 0.90625, 0.02500000037252903, 0.02500000037252903], [0.19374999403953552, 0.90625, 0.05000000074505806, 0.05000000074505806], [0.20624999701976776, 0.90625, 0.02500000037252903, 0.02500000037252903], [0.20624999701976776, 0.90625, 0.05000000074505806, 0.05000000074505806], [0.21875, 0.90625, 0.02500000037252903, 0.02500000037252903], [0.21875, 0.90625, 0.05000000074505806, 0.05000000074505806], [0.23125000298023224, 0.90625, 0.02500000037252903, 0.02500000037252903], [0.23125000298023224, 0.90625, 0.05000000074505806, 0.05000000074505806], [0.24375000596046448, 0.90625, 0.02500000037252903, 0.02500000037252903], [0.24375000596046448, 0.90625, 0.05000000074505806, 0.05000000074505806], [0.2562499940395355, 0.90625, 0.02500000037252903, 0.02500000037252903], [0.2562499940395355, 0.90625, 0.05000000074505806, 0.05000000074505806], [0.26875001192092896, 0.90625, 0.02500000037252903, 0.02500000037252903], [0.26875001192092896, 0.90625, 0.05000000074505806, 0.05000000074505806], [0.28125, 0.90625, 0.02500000037252903, 0.02500000037252903], [0.28125, 0.90625, 0.05000000074505806, 0.05000000074505806], [0.29374998807907104, 0.90625, 0.02500000037252903, 0.02500000037252903], [0.29374998807907104, 0.90625, 0.05000000074505806, 0.05000000074505806], [0.3062500059604645, 0.90625, 0.02500000037252903, 0.02500000037252903], [0.3062500059604645, 0.90625, 0.05000000074505806, 0.05000000074505806], [0.3187499940395355, 0.90625, 0.02500000037252903, 0.02500000037252903], [0.3187499940395355, 0.90625, 0.05000000074505806, 0.05000000074505806], [0.33125001192092896, 0.90625, 0.02500000037252903, 0.02500000037252903], [0.33125001192092896, 0.90625, 0.05000000074505806, 0.05000000074505806], [0.34375, 0.90625, 0.02500000037252903, 0.02500000037252903], [0.34375, 0.90625, 0.05000000074505806, 0.05000000074505806], [0.35624998807907104, 0.90625, 0.02500000037252903, 0.02500000037252903], [0.35624998807907104, 0.90625, 0.05000000074505806, 0.05000000074505806], [0.3687500059604645, 0.90625, 0.02500000037252903, 0.02500000037252903], [0.3687500059604645, 0.90625, 0.05000000074505806, 0.05000000074505806], [0.3812499940395355, 0.90625, 0.02500000037252903, 0.02500000037252903], [0.3812499940395355, 0.90625, 0.05000000074505806, 0.05000000074505806], [0.39375001192092896, 0.90625, 0.02500000037252903, 0.02500000037252903], [0.39375001192092896, 0.90625, 0.05000000074505806, 0.05000000074505806], [0.40625, 0.90625, 0.02500000037252903, 0.02500000037252903], [0.40625, 0.90625, 0.05000000074505806, 0.05000000074505806], [0.41874998807907104, 0.90625, 0.02500000037252903, 0.02500000037252903], [0.41874998807907104, 0.90625, 0.05000000074505806, 0.05000000074505806], [0.4312500059604645, 0.90625, 0.02500000037252903, 0.02500000037252903], [0.4312500059604645, 0.90625, 0.05000000074505806, 0.05000000074505806], [0.4437499940395355, 0.90625, 0.02500000037252903, 0.02500000037252903], [0.4437499940395355, 0.90625, 0.05000000074505806, 0.05000000074505806], [0.45625001192092896, 0.90625, 0.02500000037252903, 0.02500000037252903], [0.45625001192092896, 0.90625, 0.05000000074505806, 0.05000000074505806], [0.46875, 0.90625, 0.02500000037252903, 0.02500000037252903], [0.46875, 0.90625, 0.05000000074505806, 0.05000000074505806], [0.48124998807907104, 0.90625, 0.02500000037252903, 0.02500000037252903], [0.48124998807907104, 0.90625, 0.05000000074505806, 0.05000000074505806], [0.4937500059604645, 0.90625, 0.02500000037252903, 0.02500000037252903], [0.4937500059604645, 0.90625, 0.05000000074505806, 0.05000000074505806], [0.5062500238418579, 0.90625, 0.02500000037252903, 0.02500000037252903], [0.5062500238418579, 0.90625, 0.05000000074505806, 0.05000000074505806], [0.518750011920929, 0.90625, 0.02500000037252903, 0.02500000037252903], [0.518750011920929, 0.90625, 0.05000000074505806, 0.05000000074505806], [0.53125, 0.90625, 0.02500000037252903, 0.02500000037252903], [0.53125, 0.90625, 0.05000000074505806, 0.05000000074505806], [0.543749988079071, 0.90625, 0.02500000037252903, 0.02500000037252903], [0.543749988079071, 0.90625, 0.05000000074505806, 0.05000000074505806], [0.5562499761581421, 0.90625, 0.02500000037252903, 0.02500000037252903], [0.5562499761581421, 0.90625, 0.05000000074505806, 0.05000000074505806], [0.5687500238418579, 0.90625, 0.02500000037252903, 0.02500000037252903], [0.5687500238418579, 0.90625, 0.05000000074505806, 0.05000000074505806], [0.581250011920929, 0.90625, 0.02500000037252903, 0.02500000037252903], [0.581250011920929, 0.90625, 0.05000000074505806, 0.05000000074505806], [0.59375, 0.90625, 0.02500000037252903, 0.02500000037252903], [0.59375, 0.90625, 0.05000000074505806, 0.05000000074505806], [0.606249988079071, 0.90625, 0.02500000037252903, 0.02500000037252903], [0.606249988079071, 0.90625, 0.05000000074505806, 0.05000000074505806], [0.6187499761581421, 0.90625, 0.02500000037252903, 0.02500000037252903], [0.6187499761581421, 0.90625, 0.05000000074505806, 0.05000000074505806], [0.6312500238418579, 0.90625, 0.02500000037252903, 0.02500000037252903], [0.6312500238418579, 0.90625, 0.05000000074505806, 0.05000000074505806], [0.643750011920929, 0.90625, 0.02500000037252903, 0.02500000037252903], [0.643750011920929, 0.90625, 0.05000000074505806, 0.05000000074505806], [0.65625, 0.90625, 0.02500000037252903, 0.02500000037252903], [0.65625, 0.90625, 0.05000000074505806, 0.05000000074505806], [0.668749988079071, 0.90625, 0.02500000037252903, 0.02500000037252903], [0.668749988079071, 0.90625, 0.05000000074505806, 0.05000000074505806], [0.6812499761581421, 0.90625, 0.02500000037252903, 0.02500000037252903], [0.6812499761581421, 0.90625, 0.05000000074505806, 0.05000000074505806], [0.6937500238418579, 0.90625, 0.02500000037252903, 0.02500000037252903], [0.6937500238418579, 0.90625, 0.05000000074505806, 0.05000000074505806], [0.706250011920929, 0.90625, 0.02500000037252903, 0.02500000037252903], [0.706250011920929, 0.90625, 0.05000000074505806, 0.05000000074505806], [0.71875, 0.90625, 0.02500000037252903, 0.02500000037252903], [0.71875, 0.90625, 0.05000000074505806, 0.05000000074505806], [0.731249988079071, 0.90625, 0.02500000037252903, 0.02500000037252903], [0.731249988079071, 0.90625, 0.05000000074505806, 0.05000000074505806], [0.7437499761581421, 0.90625, 0.02500000037252903, 0.02500000037252903], [0.7437499761581421, 0.90625, 0.05000000074505806, 0.05000000074505806], [0.7562500238418579, 0.90625, 0.02500000037252903, 0.02500000037252903], [0.7562500238418579, 0.90625, 0.05000000074505806, 0.05000000074505806], [0.768750011920929, 0.90625, 0.02500000037252903, 0.02500000037252903], [0.768750011920929, 0.90625, 0.05000000074505806, 0.05000000074505806], [0.78125, 0.90625, 0.02500000037252903, 0.02500000037252903], [0.78125, 0.90625, 0.05000000074505806, 0.05000000074505806], [0.793749988079071, 0.90625, 0.02500000037252903, 0.02500000037252903], [0.793749988079071, 0.90625, 0.05000000074505806, 0.05000000074505806], [0.8062499761581421, 0.90625, 0.02500000037252903, 0.02500000037252903], [0.8062499761581421, 0.90625, 0.05000000074505806, 0.05000000074505806], [0.8187500238418579, 0.90625, 0.02500000037252903, 0.02500000037252903], [0.8187500238418579, 0.90625, 0.05000000074505806, 0.05000000074505806], [0.831250011920929, 0.90625, 0.02500000037252903, 0.02500000037252903], [0.831250011920929, 0.90625, 0.05000000074505806, 0.05000000074505806], [0.84375, 0.90625, 0.02500000037252903, 0.02500000037252903], [0.84375, 0.90625, 0.05000000074505806, 0.05000000074505806], [0.856249988079071, 0.90625, 0.02500000037252903, 0.02500000037252903], [0.856249988079071, 0.90625, 0.05000000074505806, 0.05000000074505806], [0.8687499761581421, 0.90625, 0.02500000037252903, 0.02500000037252903], [0.8687499761581421, 0.90625, 0.05000000074505806, 0.05000000074505806], [0.8812500238418579, 0.90625, 0.02500000037252903, 0.02500000037252903], [0.8812500238418579, 0.90625, 0.05000000074505806, 0.05000000074505806], [0.893750011920929, 0.90625, 0.02500000037252903, 0.02500000037252903], [0.893750011920929, 0.90625, 0.05000000074505806, 0.05000000074505806], [0.90625, 0.90625, 0.02500000037252903, 0.02500000037252903], [0.90625, 0.90625, 0.05000000074505806, 0.05000000074505806], [0.918749988079071, 0.90625, 0.02500000037252903, 0.02500000037252903], [0.918749988079071, 0.90625, 0.05000000074505806, 0.05000000074505806], [0.9312499761581421, 0.90625, 0.02500000037252903, 0.02500000037252903], [0.9312499761581421, 0.90625, 0.05000000074505806, 0.05000000074505806], [0.9437500238418579, 0.90625, 0.02500000037252903, 0.02500000037252903], [0.9437500238418579, 0.90625, 0.05000000074505806, 0.05000000074505806], [0.956250011920929, 0.90625, 0.02500000037252903, 0.02500000037252903], [0.956250011920929, 0.90625, 0.05000000074505806, 0.05000000074505806], [0.96875, 0.90625, 0.02500000037252903, 0.02500000037252903], [0.96875, 0.90625, 0.05000000074505806, 0.05000000074505806], [0.981249988079071, 0.90625, 0.02500000037252903, 0.02500000037252903], [0.981249988079071, 0.90625, 0.05000000074505806, 0.05000000074505806], [0.9937499761581421, 0.90625, 0.02500000037252903, 0.02500000037252903], [0.9937499761581421, 0.90625, 0.05000000074505806, 0.05000000074505806], [0.0062500000931322575, 0.918749988079071, 0.02500000037252903, 0.02500000037252903], [0.0062500000931322575, 0.918749988079071, 0.05000000074505806, 0.05000000074505806], [0.01875000074505806, 0.918749988079071, 0.02500000037252903, 0.02500000037252903], [0.01875000074505806, 0.918749988079071, 0.05000000074505806, 0.05000000074505806], [0.03125, 0.918749988079071, 0.02500000037252903, 0.02500000037252903], [0.03125, 0.918749988079071, 0.05000000074505806, 0.05000000074505806], [0.04374999925494194, 0.918749988079071, 0.02500000037252903, 0.02500000037252903], [0.04374999925494194, 0.918749988079071, 0.05000000074505806, 0.05000000074505806], [0.05624999850988388, 0.918749988079071, 0.02500000037252903, 0.02500000037252903], [0.05624999850988388, 0.918749988079071, 0.05000000074505806, 0.05000000074505806], [0.06875000149011612, 0.918749988079071, 0.02500000037252903, 0.02500000037252903], [0.06875000149011612, 0.918749988079071, 0.05000000074505806, 0.05000000074505806], [0.08124999701976776, 0.918749988079071, 0.02500000037252903, 0.02500000037252903], [0.08124999701976776, 0.918749988079071, 0.05000000074505806, 0.05000000074505806], [0.09375, 0.918749988079071, 0.02500000037252903, 0.02500000037252903], [0.09375, 0.918749988079071, 0.05000000074505806, 0.05000000074505806], [0.10625000298023224, 0.918749988079071, 0.02500000037252903, 0.02500000037252903], [0.10625000298023224, 0.918749988079071, 0.05000000074505806, 0.05000000074505806], [0.11874999850988388, 0.918749988079071, 0.02500000037252903, 0.02500000037252903], [0.11874999850988388, 0.918749988079071, 0.05000000074505806, 0.05000000074505806], [0.13124999403953552, 0.918749988079071, 0.02500000037252903, 0.02500000037252903], [0.13124999403953552, 0.918749988079071, 0.05000000074505806, 0.05000000074505806], [0.14374999701976776, 0.918749988079071, 0.02500000037252903, 0.02500000037252903], [0.14374999701976776, 0.918749988079071, 0.05000000074505806, 0.05000000074505806], [0.15625, 0.918749988079071, 0.02500000037252903, 0.02500000037252903], [0.15625, 0.918749988079071, 0.05000000074505806, 0.05000000074505806], [0.16875000298023224, 0.918749988079071, 0.02500000037252903, 0.02500000037252903], [0.16875000298023224, 0.918749988079071, 0.05000000074505806, 0.05000000074505806], [0.18125000596046448, 0.918749988079071, 0.02500000037252903, 0.02500000037252903], [0.18125000596046448, 0.918749988079071, 0.05000000074505806, 0.05000000074505806], [0.19374999403953552, 0.918749988079071, 0.02500000037252903, 0.02500000037252903], [0.19374999403953552, 0.918749988079071, 0.05000000074505806, 0.05000000074505806], [0.20624999701976776, 0.918749988079071, 0.02500000037252903, 0.02500000037252903], [0.20624999701976776, 0.918749988079071, 0.05000000074505806, 0.05000000074505806], [0.21875, 0.918749988079071, 0.02500000037252903, 0.02500000037252903], [0.21875, 0.918749988079071, 0.05000000074505806, 0.05000000074505806], [0.23125000298023224, 0.918749988079071, 0.02500000037252903, 0.02500000037252903], [0.23125000298023224, 0.918749988079071, 0.05000000074505806, 0.05000000074505806], [0.24375000596046448, 0.918749988079071, 0.02500000037252903, 0.02500000037252903], [0.24375000596046448, 0.918749988079071, 0.05000000074505806, 0.05000000074505806], [0.2562499940395355, 0.918749988079071, 0.02500000037252903, 0.02500000037252903], [0.2562499940395355, 0.918749988079071, 0.05000000074505806, 0.05000000074505806], [0.26875001192092896, 0.918749988079071, 0.02500000037252903, 0.02500000037252903], [0.26875001192092896, 0.918749988079071, 0.05000000074505806, 0.05000000074505806], [0.28125, 0.918749988079071, 0.02500000037252903, 0.02500000037252903], [0.28125, 0.918749988079071, 0.05000000074505806, 0.05000000074505806], [0.29374998807907104, 0.918749988079071, 0.02500000037252903, 0.02500000037252903], [0.29374998807907104, 0.918749988079071, 0.05000000074505806, 0.05000000074505806], [0.3062500059604645, 0.918749988079071, 0.02500000037252903, 0.02500000037252903], [0.3062500059604645, 0.918749988079071, 0.05000000074505806, 0.05000000074505806], [0.3187499940395355, 0.918749988079071, 0.02500000037252903, 0.02500000037252903], [0.3187499940395355, 0.918749988079071, 0.05000000074505806, 0.05000000074505806], [0.33125001192092896, 0.918749988079071, 0.02500000037252903, 0.02500000037252903], [0.33125001192092896, 0.918749988079071, 0.05000000074505806, 0.05000000074505806], [0.34375, 0.918749988079071, 0.02500000037252903, 0.02500000037252903], [0.34375, 0.918749988079071, 0.05000000074505806, 0.05000000074505806], [0.35624998807907104, 0.918749988079071, 0.02500000037252903, 0.02500000037252903], [0.35624998807907104, 0.918749988079071, 0.05000000074505806, 0.05000000074505806], [0.3687500059604645, 0.918749988079071, 0.02500000037252903, 0.02500000037252903], [0.3687500059604645, 0.918749988079071, 0.05000000074505806, 0.05000000074505806], [0.3812499940395355, 0.918749988079071, 0.02500000037252903, 0.02500000037252903], [0.3812499940395355, 0.918749988079071, 0.05000000074505806, 0.05000000074505806], [0.39375001192092896, 0.918749988079071, 0.02500000037252903, 0.02500000037252903], [0.39375001192092896, 0.918749988079071, 0.05000000074505806, 0.05000000074505806], [0.40625, 0.918749988079071, 0.02500000037252903, 0.02500000037252903], [0.40625, 0.918749988079071, 0.05000000074505806, 0.05000000074505806], [0.41874998807907104, 0.918749988079071, 0.02500000037252903, 0.02500000037252903], [0.41874998807907104, 0.918749988079071, 0.05000000074505806, 0.05000000074505806], [0.4312500059604645, 0.918749988079071, 0.02500000037252903, 0.02500000037252903], [0.4312500059604645, 0.918749988079071, 0.05000000074505806, 0.05000000074505806], [0.4437499940395355, 0.918749988079071, 0.02500000037252903, 0.02500000037252903], [0.4437499940395355, 0.918749988079071, 0.05000000074505806, 0.05000000074505806], [0.45625001192092896, 0.918749988079071, 0.02500000037252903, 0.02500000037252903], [0.45625001192092896, 0.918749988079071, 0.05000000074505806, 0.05000000074505806], [0.46875, 0.918749988079071, 0.02500000037252903, 0.02500000037252903], [0.46875, 0.918749988079071, 0.05000000074505806, 0.05000000074505806], [0.48124998807907104, 0.918749988079071, 0.02500000037252903, 0.02500000037252903], [0.48124998807907104, 0.918749988079071, 0.05000000074505806, 0.05000000074505806], [0.4937500059604645, 0.918749988079071, 0.02500000037252903, 0.02500000037252903], [0.4937500059604645, 0.918749988079071, 0.05000000074505806, 0.05000000074505806], [0.5062500238418579, 0.918749988079071, 0.02500000037252903, 0.02500000037252903], [0.5062500238418579, 0.918749988079071, 0.05000000074505806, 0.05000000074505806], [0.518750011920929, 0.918749988079071, 0.02500000037252903, 0.02500000037252903], [0.518750011920929, 0.918749988079071, 0.05000000074505806, 0.05000000074505806], [0.53125, 0.918749988079071, 0.02500000037252903, 0.02500000037252903], [0.53125, 0.918749988079071, 0.05000000074505806, 0.05000000074505806], [0.543749988079071, 0.918749988079071, 0.02500000037252903, 0.02500000037252903], [0.543749988079071, 0.918749988079071, 0.05000000074505806, 0.05000000074505806], [0.5562499761581421, 0.918749988079071, 0.02500000037252903, 0.02500000037252903], [0.5562499761581421, 0.918749988079071, 0.05000000074505806, 0.05000000074505806], [0.5687500238418579, 0.918749988079071, 0.02500000037252903, 0.02500000037252903], [0.5687500238418579, 0.918749988079071, 0.05000000074505806, 0.05000000074505806], [0.581250011920929, 0.918749988079071, 0.02500000037252903, 0.02500000037252903], [0.581250011920929, 0.918749988079071, 0.05000000074505806, 0.05000000074505806], [0.59375, 0.918749988079071, 0.02500000037252903, 0.02500000037252903], [0.59375, 0.918749988079071, 0.05000000074505806, 0.05000000074505806], [0.606249988079071, 0.918749988079071, 0.02500000037252903, 0.02500000037252903], [0.606249988079071, 0.918749988079071, 0.05000000074505806, 0.05000000074505806], [0.6187499761581421, 0.918749988079071, 0.02500000037252903, 0.02500000037252903], [0.6187499761581421, 0.918749988079071, 0.05000000074505806, 0.05000000074505806], [0.6312500238418579, 0.918749988079071, 0.02500000037252903, 0.02500000037252903], [0.6312500238418579, 0.918749988079071, 0.05000000074505806, 0.05000000074505806], [0.643750011920929, 0.918749988079071, 0.02500000037252903, 0.02500000037252903], [0.643750011920929, 0.918749988079071, 0.05000000074505806, 0.05000000074505806], [0.65625, 0.918749988079071, 0.02500000037252903, 0.02500000037252903], [0.65625, 0.918749988079071, 0.05000000074505806, 0.05000000074505806], [0.668749988079071, 0.918749988079071, 0.02500000037252903, 0.02500000037252903], [0.668749988079071, 0.918749988079071, 0.05000000074505806, 0.05000000074505806], [0.6812499761581421, 0.918749988079071, 0.02500000037252903, 0.02500000037252903], [0.6812499761581421, 0.918749988079071, 0.05000000074505806, 0.05000000074505806], [0.6937500238418579, 0.918749988079071, 0.02500000037252903, 0.02500000037252903], [0.6937500238418579, 0.918749988079071, 0.05000000074505806, 0.05000000074505806], [0.706250011920929, 0.918749988079071, 0.02500000037252903, 0.02500000037252903], [0.706250011920929, 0.918749988079071, 0.05000000074505806, 0.05000000074505806], [0.71875, 0.918749988079071, 0.02500000037252903, 0.02500000037252903], [0.71875, 0.918749988079071, 0.05000000074505806, 0.05000000074505806], [0.731249988079071, 0.918749988079071, 0.02500000037252903, 0.02500000037252903], [0.731249988079071, 0.918749988079071, 0.05000000074505806, 0.05000000074505806], [0.7437499761581421, 0.918749988079071, 0.02500000037252903, 0.02500000037252903], [0.7437499761581421, 0.918749988079071, 0.05000000074505806, 0.05000000074505806], [0.7562500238418579, 0.918749988079071, 0.02500000037252903, 0.02500000037252903], [0.7562500238418579, 0.918749988079071, 0.05000000074505806, 0.05000000074505806], [0.768750011920929, 0.918749988079071, 0.02500000037252903, 0.02500000037252903], [0.768750011920929, 0.918749988079071, 0.05000000074505806, 0.05000000074505806], [0.78125, 0.918749988079071, 0.02500000037252903, 0.02500000037252903], [0.78125, 0.918749988079071, 0.05000000074505806, 0.05000000074505806], [0.793749988079071, 0.918749988079071, 0.02500000037252903, 0.02500000037252903], [0.793749988079071, 0.918749988079071, 0.05000000074505806, 0.05000000074505806], [0.8062499761581421, 0.918749988079071, 0.02500000037252903, 0.02500000037252903], [0.8062499761581421, 0.918749988079071, 0.05000000074505806, 0.05000000074505806], [0.8187500238418579, 0.918749988079071, 0.02500000037252903, 0.02500000037252903], [0.8187500238418579, 0.918749988079071, 0.05000000074505806, 0.05000000074505806], [0.831250011920929, 0.918749988079071, 0.02500000037252903, 0.02500000037252903], [0.831250011920929, 0.918749988079071, 0.05000000074505806, 0.05000000074505806], [0.84375, 0.918749988079071, 0.02500000037252903, 0.02500000037252903], [0.84375, 0.918749988079071, 0.05000000074505806, 0.05000000074505806], [0.856249988079071, 0.918749988079071, 0.02500000037252903, 0.02500000037252903], [0.856249988079071, 0.918749988079071, 0.05000000074505806, 0.05000000074505806], [0.8687499761581421, 0.918749988079071, 0.02500000037252903, 0.02500000037252903], [0.8687499761581421, 0.918749988079071, 0.05000000074505806, 0.05000000074505806], [0.8812500238418579, 0.918749988079071, 0.02500000037252903, 0.02500000037252903], [0.8812500238418579, 0.918749988079071, 0.05000000074505806, 0.05000000074505806], [0.893750011920929, 0.918749988079071, 0.02500000037252903, 0.02500000037252903], [0.893750011920929, 0.918749988079071, 0.05000000074505806, 0.05000000074505806], [0.90625, 0.918749988079071, 0.02500000037252903, 0.02500000037252903], [0.90625, 0.918749988079071, 0.05000000074505806, 0.05000000074505806], [0.918749988079071, 0.918749988079071, 0.02500000037252903, 0.02500000037252903], [0.918749988079071, 0.918749988079071, 0.05000000074505806, 0.05000000074505806], [0.9312499761581421, 0.918749988079071, 0.02500000037252903, 0.02500000037252903], [0.9312499761581421, 0.918749988079071, 0.05000000074505806, 0.05000000074505806], [0.9437500238418579, 0.918749988079071, 0.02500000037252903, 0.02500000037252903], [0.9437500238418579, 0.918749988079071, 0.05000000074505806, 0.05000000074505806], [0.956250011920929, 0.918749988079071, 0.02500000037252903, 0.02500000037252903], [0.956250011920929, 0.918749988079071, 0.05000000074505806, 0.05000000074505806], [0.96875, 0.918749988079071, 0.02500000037252903, 0.02500000037252903], [0.96875, 0.918749988079071, 0.05000000074505806, 0.05000000074505806], [0.981249988079071, 0.918749988079071, 0.02500000037252903, 0.02500000037252903], [0.981249988079071, 0.918749988079071, 0.05000000074505806, 0.05000000074505806], [0.9937499761581421, 0.918749988079071, 0.02500000037252903, 0.02500000037252903], [0.9937499761581421, 0.918749988079071, 0.05000000074505806, 0.05000000074505806], [0.0062500000931322575, 0.9312499761581421, 0.02500000037252903, 0.02500000037252903], [0.0062500000931322575, 0.9312499761581421, 0.05000000074505806, 0.05000000074505806], [0.01875000074505806, 0.9312499761581421, 0.02500000037252903, 0.02500000037252903], [0.01875000074505806, 0.9312499761581421, 0.05000000074505806, 0.05000000074505806], [0.03125, 0.9312499761581421, 0.02500000037252903, 0.02500000037252903], [0.03125, 0.9312499761581421, 0.05000000074505806, 0.05000000074505806], [0.04374999925494194, 0.9312499761581421, 0.02500000037252903, 0.02500000037252903], [0.04374999925494194, 0.9312499761581421, 0.05000000074505806, 0.05000000074505806], [0.05624999850988388, 0.9312499761581421, 0.02500000037252903, 0.02500000037252903], [0.05624999850988388, 0.9312499761581421, 0.05000000074505806, 0.05000000074505806], [0.06875000149011612, 0.9312499761581421, 0.02500000037252903, 0.02500000037252903], [0.06875000149011612, 0.9312499761581421, 0.05000000074505806, 0.05000000074505806], [0.08124999701976776, 0.9312499761581421, 0.02500000037252903, 0.02500000037252903], [0.08124999701976776, 0.9312499761581421, 0.05000000074505806, 0.05000000074505806], [0.09375, 0.9312499761581421, 0.02500000037252903, 0.02500000037252903], [0.09375, 0.9312499761581421, 0.05000000074505806, 0.05000000074505806], [0.10625000298023224, 0.9312499761581421, 0.02500000037252903, 0.02500000037252903], [0.10625000298023224, 0.9312499761581421, 0.05000000074505806, 0.05000000074505806], [0.11874999850988388, 0.9312499761581421, 0.02500000037252903, 0.02500000037252903], [0.11874999850988388, 0.9312499761581421, 0.05000000074505806, 0.05000000074505806], [0.13124999403953552, 0.9312499761581421, 0.02500000037252903, 0.02500000037252903], [0.13124999403953552, 0.9312499761581421, 0.05000000074505806, 0.05000000074505806], [0.14374999701976776, 0.9312499761581421, 0.02500000037252903, 0.02500000037252903], [0.14374999701976776, 0.9312499761581421, 0.05000000074505806, 0.05000000074505806], [0.15625, 0.9312499761581421, 0.02500000037252903, 0.02500000037252903], [0.15625, 0.9312499761581421, 0.05000000074505806, 0.05000000074505806], [0.16875000298023224, 0.9312499761581421, 0.02500000037252903, 0.02500000037252903], [0.16875000298023224, 0.9312499761581421, 0.05000000074505806, 0.05000000074505806], [0.18125000596046448, 0.9312499761581421, 0.02500000037252903, 0.02500000037252903], [0.18125000596046448, 0.9312499761581421, 0.05000000074505806, 0.05000000074505806], [0.19374999403953552, 0.9312499761581421, 0.02500000037252903, 0.02500000037252903], [0.19374999403953552, 0.9312499761581421, 0.05000000074505806, 0.05000000074505806], [0.20624999701976776, 0.9312499761581421, 0.02500000037252903, 0.02500000037252903], [0.20624999701976776, 0.9312499761581421, 0.05000000074505806, 0.05000000074505806], [0.21875, 0.9312499761581421, 0.02500000037252903, 0.02500000037252903], [0.21875, 0.9312499761581421, 0.05000000074505806, 0.05000000074505806], [0.23125000298023224, 0.9312499761581421, 0.02500000037252903, 0.02500000037252903], [0.23125000298023224, 0.9312499761581421, 0.05000000074505806, 0.05000000074505806], [0.24375000596046448, 0.9312499761581421, 0.02500000037252903, 0.02500000037252903], [0.24375000596046448, 0.9312499761581421, 0.05000000074505806, 0.05000000074505806], [0.2562499940395355, 0.9312499761581421, 0.02500000037252903, 0.02500000037252903], [0.2562499940395355, 0.9312499761581421, 0.05000000074505806, 0.05000000074505806], [0.26875001192092896, 0.9312499761581421, 0.02500000037252903, 0.02500000037252903], [0.26875001192092896, 0.9312499761581421, 0.05000000074505806, 0.05000000074505806], [0.28125, 0.9312499761581421, 0.02500000037252903, 0.02500000037252903], [0.28125, 0.9312499761581421, 0.05000000074505806, 0.05000000074505806], [0.29374998807907104, 0.9312499761581421, 0.02500000037252903, 0.02500000037252903], [0.29374998807907104, 0.9312499761581421, 0.05000000074505806, 0.05000000074505806], [0.3062500059604645, 0.9312499761581421, 0.02500000037252903, 0.02500000037252903], [0.3062500059604645, 0.9312499761581421, 0.05000000074505806, 0.05000000074505806], [0.3187499940395355, 0.9312499761581421, 0.02500000037252903, 0.02500000037252903], [0.3187499940395355, 0.9312499761581421, 0.05000000074505806, 0.05000000074505806], [0.33125001192092896, 0.9312499761581421, 0.02500000037252903, 0.02500000037252903], [0.33125001192092896, 0.9312499761581421, 0.05000000074505806, 0.05000000074505806], [0.34375, 0.9312499761581421, 0.02500000037252903, 0.02500000037252903], [0.34375, 0.9312499761581421, 0.05000000074505806, 0.05000000074505806], [0.35624998807907104, 0.9312499761581421, 0.02500000037252903, 0.02500000037252903], [0.35624998807907104, 0.9312499761581421, 0.05000000074505806, 0.05000000074505806], [0.3687500059604645, 0.9312499761581421, 0.02500000037252903, 0.02500000037252903], [0.3687500059604645, 0.9312499761581421, 0.05000000074505806, 0.05000000074505806], [0.3812499940395355, 0.9312499761581421, 0.02500000037252903, 0.02500000037252903], [0.3812499940395355, 0.9312499761581421, 0.05000000074505806, 0.05000000074505806], [0.39375001192092896, 0.9312499761581421, 0.02500000037252903, 0.02500000037252903], [0.39375001192092896, 0.9312499761581421, 0.05000000074505806, 0.05000000074505806], [0.40625, 0.9312499761581421, 0.02500000037252903, 0.02500000037252903], [0.40625, 0.9312499761581421, 0.05000000074505806, 0.05000000074505806], [0.41874998807907104, 0.9312499761581421, 0.02500000037252903, 0.02500000037252903], [0.41874998807907104, 0.9312499761581421, 0.05000000074505806, 0.05000000074505806], [0.4312500059604645, 0.9312499761581421, 0.02500000037252903, 0.02500000037252903], [0.4312500059604645, 0.9312499761581421, 0.05000000074505806, 0.05000000074505806], [0.4437499940395355, 0.9312499761581421, 0.02500000037252903, 0.02500000037252903], [0.4437499940395355, 0.9312499761581421, 0.05000000074505806, 0.05000000074505806], [0.45625001192092896, 0.9312499761581421, 0.02500000037252903, 0.02500000037252903], [0.45625001192092896, 0.9312499761581421, 0.05000000074505806, 0.05000000074505806], [0.46875, 0.9312499761581421, 0.02500000037252903, 0.02500000037252903], [0.46875, 0.9312499761581421, 0.05000000074505806, 0.05000000074505806], [0.48124998807907104, 0.9312499761581421, 0.02500000037252903, 0.02500000037252903], [0.48124998807907104, 0.9312499761581421, 0.05000000074505806, 0.05000000074505806], [0.4937500059604645, 0.9312499761581421, 0.02500000037252903, 0.02500000037252903], [0.4937500059604645, 0.9312499761581421, 0.05000000074505806, 0.05000000074505806], [0.5062500238418579, 0.9312499761581421, 0.02500000037252903, 0.02500000037252903], [0.5062500238418579, 0.9312499761581421, 0.05000000074505806, 0.05000000074505806], [0.518750011920929, 0.9312499761581421, 0.02500000037252903, 0.02500000037252903], [0.518750011920929, 0.9312499761581421, 0.05000000074505806, 0.05000000074505806], [0.53125, 0.9312499761581421, 0.02500000037252903, 0.02500000037252903], [0.53125, 0.9312499761581421, 0.05000000074505806, 0.05000000074505806], [0.543749988079071, 0.9312499761581421, 0.02500000037252903, 0.02500000037252903], [0.543749988079071, 0.9312499761581421, 0.05000000074505806, 0.05000000074505806], [0.5562499761581421, 0.9312499761581421, 0.02500000037252903, 0.02500000037252903], [0.5562499761581421, 0.9312499761581421, 0.05000000074505806, 0.05000000074505806], [0.5687500238418579, 0.9312499761581421, 0.02500000037252903, 0.02500000037252903], [0.5687500238418579, 0.9312499761581421, 0.05000000074505806, 0.05000000074505806], [0.581250011920929, 0.9312499761581421, 0.02500000037252903, 0.02500000037252903], [0.581250011920929, 0.9312499761581421, 0.05000000074505806, 0.05000000074505806], [0.59375, 0.9312499761581421, 0.02500000037252903, 0.02500000037252903], [0.59375, 0.9312499761581421, 0.05000000074505806, 0.05000000074505806], [0.606249988079071, 0.9312499761581421, 0.02500000037252903, 0.02500000037252903], [0.606249988079071, 0.9312499761581421, 0.05000000074505806, 0.05000000074505806], [0.6187499761581421, 0.9312499761581421, 0.02500000037252903, 0.02500000037252903], [0.6187499761581421, 0.9312499761581421, 0.05000000074505806, 0.05000000074505806], [0.6312500238418579, 0.9312499761581421, 0.02500000037252903, 0.02500000037252903], [0.6312500238418579, 0.9312499761581421, 0.05000000074505806, 0.05000000074505806], [0.643750011920929, 0.9312499761581421, 0.02500000037252903, 0.02500000037252903], [0.643750011920929, 0.9312499761581421, 0.05000000074505806, 0.05000000074505806], [0.65625, 0.9312499761581421, 0.02500000037252903, 0.02500000037252903], [0.65625, 0.9312499761581421, 0.05000000074505806, 0.05000000074505806], [0.668749988079071, 0.9312499761581421, 0.02500000037252903, 0.02500000037252903], [0.668749988079071, 0.9312499761581421, 0.05000000074505806, 0.05000000074505806], [0.6812499761581421, 0.9312499761581421, 0.02500000037252903, 0.02500000037252903], [0.6812499761581421, 0.9312499761581421, 0.05000000074505806, 0.05000000074505806], [0.6937500238418579, 0.9312499761581421, 0.02500000037252903, 0.02500000037252903], [0.6937500238418579, 0.9312499761581421, 0.05000000074505806, 0.05000000074505806], [0.706250011920929, 0.9312499761581421, 0.02500000037252903, 0.02500000037252903], [0.706250011920929, 0.9312499761581421, 0.05000000074505806, 0.05000000074505806], [0.71875, 0.9312499761581421, 0.02500000037252903, 0.02500000037252903], [0.71875, 0.9312499761581421, 0.05000000074505806, 0.05000000074505806], [0.731249988079071, 0.9312499761581421, 0.02500000037252903, 0.02500000037252903], [0.731249988079071, 0.9312499761581421, 0.05000000074505806, 0.05000000074505806], [0.7437499761581421, 0.9312499761581421, 0.02500000037252903, 0.02500000037252903], [0.7437499761581421, 0.9312499761581421, 0.05000000074505806, 0.05000000074505806], [0.7562500238418579, 0.9312499761581421, 0.02500000037252903, 0.02500000037252903], [0.7562500238418579, 0.9312499761581421, 0.05000000074505806, 0.05000000074505806], [0.768750011920929, 0.9312499761581421, 0.02500000037252903, 0.02500000037252903], [0.768750011920929, 0.9312499761581421, 0.05000000074505806, 0.05000000074505806], [0.78125, 0.9312499761581421, 0.02500000037252903, 0.02500000037252903], [0.78125, 0.9312499761581421, 0.05000000074505806, 0.05000000074505806], [0.793749988079071, 0.9312499761581421, 0.02500000037252903, 0.02500000037252903], [0.793749988079071, 0.9312499761581421, 0.05000000074505806, 0.05000000074505806], [0.8062499761581421, 0.9312499761581421, 0.02500000037252903, 0.02500000037252903], [0.8062499761581421, 0.9312499761581421, 0.05000000074505806, 0.05000000074505806], [0.8187500238418579, 0.9312499761581421, 0.02500000037252903, 0.02500000037252903], [0.8187500238418579, 0.9312499761581421, 0.05000000074505806, 0.05000000074505806], [0.831250011920929, 0.9312499761581421, 0.02500000037252903, 0.02500000037252903], [0.831250011920929, 0.9312499761581421, 0.05000000074505806, 0.05000000074505806], [0.84375, 0.9312499761581421, 0.02500000037252903, 0.02500000037252903], [0.84375, 0.9312499761581421, 0.05000000074505806, 0.05000000074505806], [0.856249988079071, 0.9312499761581421, 0.02500000037252903, 0.02500000037252903], [0.856249988079071, 0.9312499761581421, 0.05000000074505806, 0.05000000074505806], [0.8687499761581421, 0.9312499761581421, 0.02500000037252903, 0.02500000037252903], [0.8687499761581421, 0.9312499761581421, 0.05000000074505806, 0.05000000074505806], [0.8812500238418579, 0.9312499761581421, 0.02500000037252903, 0.02500000037252903], [0.8812500238418579, 0.9312499761581421, 0.05000000074505806, 0.05000000074505806], [0.893750011920929, 0.9312499761581421, 0.02500000037252903, 0.02500000037252903], [0.893750011920929, 0.9312499761581421, 0.05000000074505806, 0.05000000074505806], [0.90625, 0.9312499761581421, 0.02500000037252903, 0.02500000037252903], [0.90625, 0.9312499761581421, 0.05000000074505806, 0.05000000074505806], [0.918749988079071, 0.9312499761581421, 0.02500000037252903, 0.02500000037252903], [0.918749988079071, 0.9312499761581421, 0.05000000074505806, 0.05000000074505806], [0.9312499761581421, 0.9312499761581421, 0.02500000037252903, 0.02500000037252903], [0.9312499761581421, 0.9312499761581421, 0.05000000074505806, 0.05000000074505806], [0.9437500238418579, 0.9312499761581421, 0.02500000037252903, 0.02500000037252903], [0.9437500238418579, 0.9312499761581421, 0.05000000074505806, 0.05000000074505806], [0.956250011920929, 0.9312499761581421, 0.02500000037252903, 0.02500000037252903], [0.956250011920929, 0.9312499761581421, 0.05000000074505806, 0.05000000074505806], [0.96875, 0.9312499761581421, 0.02500000037252903, 0.02500000037252903], [0.96875, 0.9312499761581421, 0.05000000074505806, 0.05000000074505806], [0.981249988079071, 0.9312499761581421, 0.02500000037252903, 0.02500000037252903], [0.981249988079071, 0.9312499761581421, 0.05000000074505806, 0.05000000074505806], [0.9937499761581421, 0.9312499761581421, 0.02500000037252903, 0.02500000037252903], [0.9937499761581421, 0.9312499761581421, 0.05000000074505806, 0.05000000074505806], [0.0062500000931322575, 0.9437500238418579, 0.02500000037252903, 0.02500000037252903], [0.0062500000931322575, 0.9437500238418579, 0.05000000074505806, 0.05000000074505806], [0.01875000074505806, 0.9437500238418579, 0.02500000037252903, 0.02500000037252903], [0.01875000074505806, 0.9437500238418579, 0.05000000074505806, 0.05000000074505806], [0.03125, 0.9437500238418579, 0.02500000037252903, 0.02500000037252903], [0.03125, 0.9437500238418579, 0.05000000074505806, 0.05000000074505806], [0.04374999925494194, 0.9437500238418579, 0.02500000037252903, 0.02500000037252903], [0.04374999925494194, 0.9437500238418579, 0.05000000074505806, 0.05000000074505806], [0.05624999850988388, 0.9437500238418579, 0.02500000037252903, 0.02500000037252903], [0.05624999850988388, 0.9437500238418579, 0.05000000074505806, 0.05000000074505806], [0.06875000149011612, 0.9437500238418579, 0.02500000037252903, 0.02500000037252903], [0.06875000149011612, 0.9437500238418579, 0.05000000074505806, 0.05000000074505806], [0.08124999701976776, 0.9437500238418579, 0.02500000037252903, 0.02500000037252903], [0.08124999701976776, 0.9437500238418579, 0.05000000074505806, 0.05000000074505806], [0.09375, 0.9437500238418579, 0.02500000037252903, 0.02500000037252903], [0.09375, 0.9437500238418579, 0.05000000074505806, 0.05000000074505806], [0.10625000298023224, 0.9437500238418579, 0.02500000037252903, 0.02500000037252903], [0.10625000298023224, 0.9437500238418579, 0.05000000074505806, 0.05000000074505806], [0.11874999850988388, 0.9437500238418579, 0.02500000037252903, 0.02500000037252903], [0.11874999850988388, 0.9437500238418579, 0.05000000074505806, 0.05000000074505806], [0.13124999403953552, 0.9437500238418579, 0.02500000037252903, 0.02500000037252903], [0.13124999403953552, 0.9437500238418579, 0.05000000074505806, 0.05000000074505806], [0.14374999701976776, 0.9437500238418579, 0.02500000037252903, 0.02500000037252903], [0.14374999701976776, 0.9437500238418579, 0.05000000074505806, 0.05000000074505806], [0.15625, 0.9437500238418579, 0.02500000037252903, 0.02500000037252903], [0.15625, 0.9437500238418579, 0.05000000074505806, 0.05000000074505806], [0.16875000298023224, 0.9437500238418579, 0.02500000037252903, 0.02500000037252903], [0.16875000298023224, 0.9437500238418579, 0.05000000074505806, 0.05000000074505806], [0.18125000596046448, 0.9437500238418579, 0.02500000037252903, 0.02500000037252903], [0.18125000596046448, 0.9437500238418579, 0.05000000074505806, 0.05000000074505806], [0.19374999403953552, 0.9437500238418579, 0.02500000037252903, 0.02500000037252903], [0.19374999403953552, 0.9437500238418579, 0.05000000074505806, 0.05000000074505806], [0.20624999701976776, 0.9437500238418579, 0.02500000037252903, 0.02500000037252903], [0.20624999701976776, 0.9437500238418579, 0.05000000074505806, 0.05000000074505806], [0.21875, 0.9437500238418579, 0.02500000037252903, 0.02500000037252903], [0.21875, 0.9437500238418579, 0.05000000074505806, 0.05000000074505806], [0.23125000298023224, 0.9437500238418579, 0.02500000037252903, 0.02500000037252903], [0.23125000298023224, 0.9437500238418579, 0.05000000074505806, 0.05000000074505806], [0.24375000596046448, 0.9437500238418579, 0.02500000037252903, 0.02500000037252903], [0.24375000596046448, 0.9437500238418579, 0.05000000074505806, 0.05000000074505806], [0.2562499940395355, 0.9437500238418579, 0.02500000037252903, 0.02500000037252903], [0.2562499940395355, 0.9437500238418579, 0.05000000074505806, 0.05000000074505806], [0.26875001192092896, 0.9437500238418579, 0.02500000037252903, 0.02500000037252903], [0.26875001192092896, 0.9437500238418579, 0.05000000074505806, 0.05000000074505806], [0.28125, 0.9437500238418579, 0.02500000037252903, 0.02500000037252903], [0.28125, 0.9437500238418579, 0.05000000074505806, 0.05000000074505806], [0.29374998807907104, 0.9437500238418579, 0.02500000037252903, 0.02500000037252903], [0.29374998807907104, 0.9437500238418579, 0.05000000074505806, 0.05000000074505806], [0.3062500059604645, 0.9437500238418579, 0.02500000037252903, 0.02500000037252903], [0.3062500059604645, 0.9437500238418579, 0.05000000074505806, 0.05000000074505806], [0.3187499940395355, 0.9437500238418579, 0.02500000037252903, 0.02500000037252903], [0.3187499940395355, 0.9437500238418579, 0.05000000074505806, 0.05000000074505806], [0.33125001192092896, 0.9437500238418579, 0.02500000037252903, 0.02500000037252903], [0.33125001192092896, 0.9437500238418579, 0.05000000074505806, 0.05000000074505806], [0.34375, 0.9437500238418579, 0.02500000037252903, 0.02500000037252903], [0.34375, 0.9437500238418579, 0.05000000074505806, 0.05000000074505806], [0.35624998807907104, 0.9437500238418579, 0.02500000037252903, 0.02500000037252903], [0.35624998807907104, 0.9437500238418579, 0.05000000074505806, 0.05000000074505806], [0.3687500059604645, 0.9437500238418579, 0.02500000037252903, 0.02500000037252903], [0.3687500059604645, 0.9437500238418579, 0.05000000074505806, 0.05000000074505806], [0.3812499940395355, 0.9437500238418579, 0.02500000037252903, 0.02500000037252903], [0.3812499940395355, 0.9437500238418579, 0.05000000074505806, 0.05000000074505806], [0.39375001192092896, 0.9437500238418579, 0.02500000037252903, 0.02500000037252903], [0.39375001192092896, 0.9437500238418579, 0.05000000074505806, 0.05000000074505806], [0.40625, 0.9437500238418579, 0.02500000037252903, 0.02500000037252903], [0.40625, 0.9437500238418579, 0.05000000074505806, 0.05000000074505806], [0.41874998807907104, 0.9437500238418579, 0.02500000037252903, 0.02500000037252903], [0.41874998807907104, 0.9437500238418579, 0.05000000074505806, 0.05000000074505806], [0.4312500059604645, 0.9437500238418579, 0.02500000037252903, 0.02500000037252903], [0.4312500059604645, 0.9437500238418579, 0.05000000074505806, 0.05000000074505806], [0.4437499940395355, 0.9437500238418579, 0.02500000037252903, 0.02500000037252903], [0.4437499940395355, 0.9437500238418579, 0.05000000074505806, 0.05000000074505806], [0.45625001192092896, 0.9437500238418579, 0.02500000037252903, 0.02500000037252903], [0.45625001192092896, 0.9437500238418579, 0.05000000074505806, 0.05000000074505806], [0.46875, 0.9437500238418579, 0.02500000037252903, 0.02500000037252903], [0.46875, 0.9437500238418579, 0.05000000074505806, 0.05000000074505806], [0.48124998807907104, 0.9437500238418579, 0.02500000037252903, 0.02500000037252903], [0.48124998807907104, 0.9437500238418579, 0.05000000074505806, 0.05000000074505806], [0.4937500059604645, 0.9437500238418579, 0.02500000037252903, 0.02500000037252903], [0.4937500059604645, 0.9437500238418579, 0.05000000074505806, 0.05000000074505806], [0.5062500238418579, 0.9437500238418579, 0.02500000037252903, 0.02500000037252903], [0.5062500238418579, 0.9437500238418579, 0.05000000074505806, 0.05000000074505806], [0.518750011920929, 0.9437500238418579, 0.02500000037252903, 0.02500000037252903], [0.518750011920929, 0.9437500238418579, 0.05000000074505806, 0.05000000074505806], [0.53125, 0.9437500238418579, 0.02500000037252903, 0.02500000037252903], [0.53125, 0.9437500238418579, 0.05000000074505806, 0.05000000074505806], [0.543749988079071, 0.9437500238418579, 0.02500000037252903, 0.02500000037252903], [0.543749988079071, 0.9437500238418579, 0.05000000074505806, 0.05000000074505806], [0.5562499761581421, 0.9437500238418579, 0.02500000037252903, 0.02500000037252903], [0.5562499761581421, 0.9437500238418579, 0.05000000074505806, 0.05000000074505806], [0.5687500238418579, 0.9437500238418579, 0.02500000037252903, 0.02500000037252903], [0.5687500238418579, 0.9437500238418579, 0.05000000074505806, 0.05000000074505806], [0.581250011920929, 0.9437500238418579, 0.02500000037252903, 0.02500000037252903], [0.581250011920929, 0.9437500238418579, 0.05000000074505806, 0.05000000074505806], [0.59375, 0.9437500238418579, 0.02500000037252903, 0.02500000037252903], [0.59375, 0.9437500238418579, 0.05000000074505806, 0.05000000074505806], [0.606249988079071, 0.9437500238418579, 0.02500000037252903, 0.02500000037252903], [0.606249988079071, 0.9437500238418579, 0.05000000074505806, 0.05000000074505806], [0.6187499761581421, 0.9437500238418579, 0.02500000037252903, 0.02500000037252903], [0.6187499761581421, 0.9437500238418579, 0.05000000074505806, 0.05000000074505806], [0.6312500238418579, 0.9437500238418579, 0.02500000037252903, 0.02500000037252903], [0.6312500238418579, 0.9437500238418579, 0.05000000074505806, 0.05000000074505806], [0.643750011920929, 0.9437500238418579, 0.02500000037252903, 0.02500000037252903], [0.643750011920929, 0.9437500238418579, 0.05000000074505806, 0.05000000074505806], [0.65625, 0.9437500238418579, 0.02500000037252903, 0.02500000037252903], [0.65625, 0.9437500238418579, 0.05000000074505806, 0.05000000074505806], [0.668749988079071, 0.9437500238418579, 0.02500000037252903, 0.02500000037252903], [0.668749988079071, 0.9437500238418579, 0.05000000074505806, 0.05000000074505806], [0.6812499761581421, 0.9437500238418579, 0.02500000037252903, 0.02500000037252903], [0.6812499761581421, 0.9437500238418579, 0.05000000074505806, 0.05000000074505806], [0.6937500238418579, 0.9437500238418579, 0.02500000037252903, 0.02500000037252903], [0.6937500238418579, 0.9437500238418579, 0.05000000074505806, 0.05000000074505806], [0.706250011920929, 0.9437500238418579, 0.02500000037252903, 0.02500000037252903], [0.706250011920929, 0.9437500238418579, 0.05000000074505806, 0.05000000074505806], [0.71875, 0.9437500238418579, 0.02500000037252903, 0.02500000037252903], [0.71875, 0.9437500238418579, 0.05000000074505806, 0.05000000074505806], [0.731249988079071, 0.9437500238418579, 0.02500000037252903, 0.02500000037252903], [0.731249988079071, 0.9437500238418579, 0.05000000074505806, 0.05000000074505806], [0.7437499761581421, 0.9437500238418579, 0.02500000037252903, 0.02500000037252903], [0.7437499761581421, 0.9437500238418579, 0.05000000074505806, 0.05000000074505806], [0.7562500238418579, 0.9437500238418579, 0.02500000037252903, 0.02500000037252903], [0.7562500238418579, 0.9437500238418579, 0.05000000074505806, 0.05000000074505806], [0.768750011920929, 0.9437500238418579, 0.02500000037252903, 0.02500000037252903], [0.768750011920929, 0.9437500238418579, 0.05000000074505806, 0.05000000074505806], [0.78125, 0.9437500238418579, 0.02500000037252903, 0.02500000037252903], [0.78125, 0.9437500238418579, 0.05000000074505806, 0.05000000074505806], [0.793749988079071, 0.9437500238418579, 0.02500000037252903, 0.02500000037252903], [0.793749988079071, 0.9437500238418579, 0.05000000074505806, 0.05000000074505806], [0.8062499761581421, 0.9437500238418579, 0.02500000037252903, 0.02500000037252903], [0.8062499761581421, 0.9437500238418579, 0.05000000074505806, 0.05000000074505806], [0.8187500238418579, 0.9437500238418579, 0.02500000037252903, 0.02500000037252903], [0.8187500238418579, 0.9437500238418579, 0.05000000074505806, 0.05000000074505806], [0.831250011920929, 0.9437500238418579, 0.02500000037252903, 0.02500000037252903], [0.831250011920929, 0.9437500238418579, 0.05000000074505806, 0.05000000074505806], [0.84375, 0.9437500238418579, 0.02500000037252903, 0.02500000037252903], [0.84375, 0.9437500238418579, 0.05000000074505806, 0.05000000074505806], [0.856249988079071, 0.9437500238418579, 0.02500000037252903, 0.02500000037252903], [0.856249988079071, 0.9437500238418579, 0.05000000074505806, 0.05000000074505806], [0.8687499761581421, 0.9437500238418579, 0.02500000037252903, 0.02500000037252903], [0.8687499761581421, 0.9437500238418579, 0.05000000074505806, 0.05000000074505806], [0.8812500238418579, 0.9437500238418579, 0.02500000037252903, 0.02500000037252903], [0.8812500238418579, 0.9437500238418579, 0.05000000074505806, 0.05000000074505806], [0.893750011920929, 0.9437500238418579, 0.02500000037252903, 0.02500000037252903], [0.893750011920929, 0.9437500238418579, 0.05000000074505806, 0.05000000074505806], [0.90625, 0.9437500238418579, 0.02500000037252903, 0.02500000037252903], [0.90625, 0.9437500238418579, 0.05000000074505806, 0.05000000074505806], [0.918749988079071, 0.9437500238418579, 0.02500000037252903, 0.02500000037252903], [0.918749988079071, 0.9437500238418579, 0.05000000074505806, 0.05000000074505806], [0.9312499761581421, 0.9437500238418579, 0.02500000037252903, 0.02500000037252903], [0.9312499761581421, 0.9437500238418579, 0.05000000074505806, 0.05000000074505806], [0.9437500238418579, 0.9437500238418579, 0.02500000037252903, 0.02500000037252903], [0.9437500238418579, 0.9437500238418579, 0.05000000074505806, 0.05000000074505806], [0.956250011920929, 0.9437500238418579, 0.02500000037252903, 0.02500000037252903], [0.956250011920929, 0.9437500238418579, 0.05000000074505806, 0.05000000074505806], [0.96875, 0.9437500238418579, 0.02500000037252903, 0.02500000037252903], [0.96875, 0.9437500238418579, 0.05000000074505806, 0.05000000074505806], [0.981249988079071, 0.9437500238418579, 0.02500000037252903, 0.02500000037252903], [0.981249988079071, 0.9437500238418579, 0.05000000074505806, 0.05000000074505806], [0.9937499761581421, 0.9437500238418579, 0.02500000037252903, 0.02500000037252903], [0.9937499761581421, 0.9437500238418579, 0.05000000074505806, 0.05000000074505806], [0.0062500000931322575, 0.956250011920929, 0.02500000037252903, 0.02500000037252903], [0.0062500000931322575, 0.956250011920929, 0.05000000074505806, 0.05000000074505806], [0.01875000074505806, 0.956250011920929, 0.02500000037252903, 0.02500000037252903], [0.01875000074505806, 0.956250011920929, 0.05000000074505806, 0.05000000074505806], [0.03125, 0.956250011920929, 0.02500000037252903, 0.02500000037252903], [0.03125, 0.956250011920929, 0.05000000074505806, 0.05000000074505806], [0.04374999925494194, 0.956250011920929, 0.02500000037252903, 0.02500000037252903], [0.04374999925494194, 0.956250011920929, 0.05000000074505806, 0.05000000074505806], [0.05624999850988388, 0.956250011920929, 0.02500000037252903, 0.02500000037252903], [0.05624999850988388, 0.956250011920929, 0.05000000074505806, 0.05000000074505806], [0.06875000149011612, 0.956250011920929, 0.02500000037252903, 0.02500000037252903], [0.06875000149011612, 0.956250011920929, 0.05000000074505806, 0.05000000074505806], [0.08124999701976776, 0.956250011920929, 0.02500000037252903, 0.02500000037252903], [0.08124999701976776, 0.956250011920929, 0.05000000074505806, 0.05000000074505806], [0.09375, 0.956250011920929, 0.02500000037252903, 0.02500000037252903], [0.09375, 0.956250011920929, 0.05000000074505806, 0.05000000074505806], [0.10625000298023224, 0.956250011920929, 0.02500000037252903, 0.02500000037252903], [0.10625000298023224, 0.956250011920929, 0.05000000074505806, 0.05000000074505806], [0.11874999850988388, 0.956250011920929, 0.02500000037252903, 0.02500000037252903], [0.11874999850988388, 0.956250011920929, 0.05000000074505806, 0.05000000074505806], [0.13124999403953552, 0.956250011920929, 0.02500000037252903, 0.02500000037252903], [0.13124999403953552, 0.956250011920929, 0.05000000074505806, 0.05000000074505806], [0.14374999701976776, 0.956250011920929, 0.02500000037252903, 0.02500000037252903], [0.14374999701976776, 0.956250011920929, 0.05000000074505806, 0.05000000074505806], [0.15625, 0.956250011920929, 0.02500000037252903, 0.02500000037252903], [0.15625, 0.956250011920929, 0.05000000074505806, 0.05000000074505806], [0.16875000298023224, 0.956250011920929, 0.02500000037252903, 0.02500000037252903], [0.16875000298023224, 0.956250011920929, 0.05000000074505806, 0.05000000074505806], [0.18125000596046448, 0.956250011920929, 0.02500000037252903, 0.02500000037252903], [0.18125000596046448, 0.956250011920929, 0.05000000074505806, 0.05000000074505806], [0.19374999403953552, 0.956250011920929, 0.02500000037252903, 0.02500000037252903], [0.19374999403953552, 0.956250011920929, 0.05000000074505806, 0.05000000074505806], [0.20624999701976776, 0.956250011920929, 0.02500000037252903, 0.02500000037252903], [0.20624999701976776, 0.956250011920929, 0.05000000074505806, 0.05000000074505806], [0.21875, 0.956250011920929, 0.02500000037252903, 0.02500000037252903], [0.21875, 0.956250011920929, 0.05000000074505806, 0.05000000074505806], [0.23125000298023224, 0.956250011920929, 0.02500000037252903, 0.02500000037252903], [0.23125000298023224, 0.956250011920929, 0.05000000074505806, 0.05000000074505806], [0.24375000596046448, 0.956250011920929, 0.02500000037252903, 0.02500000037252903], [0.24375000596046448, 0.956250011920929, 0.05000000074505806, 0.05000000074505806], [0.2562499940395355, 0.956250011920929, 0.02500000037252903, 0.02500000037252903], [0.2562499940395355, 0.956250011920929, 0.05000000074505806, 0.05000000074505806], [0.26875001192092896, 0.956250011920929, 0.02500000037252903, 0.02500000037252903], [0.26875001192092896, 0.956250011920929, 0.05000000074505806, 0.05000000074505806], [0.28125, 0.956250011920929, 0.02500000037252903, 0.02500000037252903], [0.28125, 0.956250011920929, 0.05000000074505806, 0.05000000074505806], [0.29374998807907104, 0.956250011920929, 0.02500000037252903, 0.02500000037252903], [0.29374998807907104, 0.956250011920929, 0.05000000074505806, 0.05000000074505806], [0.3062500059604645, 0.956250011920929, 0.02500000037252903, 0.02500000037252903], [0.3062500059604645, 0.956250011920929, 0.05000000074505806, 0.05000000074505806], [0.3187499940395355, 0.956250011920929, 0.02500000037252903, 0.02500000037252903], [0.3187499940395355, 0.956250011920929, 0.05000000074505806, 0.05000000074505806], [0.33125001192092896, 0.956250011920929, 0.02500000037252903, 0.02500000037252903], [0.33125001192092896, 0.956250011920929, 0.05000000074505806, 0.05000000074505806], [0.34375, 0.956250011920929, 0.02500000037252903, 0.02500000037252903], [0.34375, 0.956250011920929, 0.05000000074505806, 0.05000000074505806], [0.35624998807907104, 0.956250011920929, 0.02500000037252903, 0.02500000037252903], [0.35624998807907104, 0.956250011920929, 0.05000000074505806, 0.05000000074505806], [0.3687500059604645, 0.956250011920929, 0.02500000037252903, 0.02500000037252903], [0.3687500059604645, 0.956250011920929, 0.05000000074505806, 0.05000000074505806], [0.3812499940395355, 0.956250011920929, 0.02500000037252903, 0.02500000037252903], [0.3812499940395355, 0.956250011920929, 0.05000000074505806, 0.05000000074505806], [0.39375001192092896, 0.956250011920929, 0.02500000037252903, 0.02500000037252903], [0.39375001192092896, 0.956250011920929, 0.05000000074505806, 0.05000000074505806], [0.40625, 0.956250011920929, 0.02500000037252903, 0.02500000037252903], [0.40625, 0.956250011920929, 0.05000000074505806, 0.05000000074505806], [0.41874998807907104, 0.956250011920929, 0.02500000037252903, 0.02500000037252903], [0.41874998807907104, 0.956250011920929, 0.05000000074505806, 0.05000000074505806], [0.4312500059604645, 0.956250011920929, 0.02500000037252903, 0.02500000037252903], [0.4312500059604645, 0.956250011920929, 0.05000000074505806, 0.05000000074505806], [0.4437499940395355, 0.956250011920929, 0.02500000037252903, 0.02500000037252903], [0.4437499940395355, 0.956250011920929, 0.05000000074505806, 0.05000000074505806], [0.45625001192092896, 0.956250011920929, 0.02500000037252903, 0.02500000037252903], [0.45625001192092896, 0.956250011920929, 0.05000000074505806, 0.05000000074505806], [0.46875, 0.956250011920929, 0.02500000037252903, 0.02500000037252903], [0.46875, 0.956250011920929, 0.05000000074505806, 0.05000000074505806], [0.48124998807907104, 0.956250011920929, 0.02500000037252903, 0.02500000037252903], [0.48124998807907104, 0.956250011920929, 0.05000000074505806, 0.05000000074505806], [0.4937500059604645, 0.956250011920929, 0.02500000037252903, 0.02500000037252903], [0.4937500059604645, 0.956250011920929, 0.05000000074505806, 0.05000000074505806], [0.5062500238418579, 0.956250011920929, 0.02500000037252903, 0.02500000037252903], [0.5062500238418579, 0.956250011920929, 0.05000000074505806, 0.05000000074505806], [0.518750011920929, 0.956250011920929, 0.02500000037252903, 0.02500000037252903], [0.518750011920929, 0.956250011920929, 0.05000000074505806, 0.05000000074505806], [0.53125, 0.956250011920929, 0.02500000037252903, 0.02500000037252903], [0.53125, 0.956250011920929, 0.05000000074505806, 0.05000000074505806], [0.543749988079071, 0.956250011920929, 0.02500000037252903, 0.02500000037252903], [0.543749988079071, 0.956250011920929, 0.05000000074505806, 0.05000000074505806], [0.5562499761581421, 0.956250011920929, 0.02500000037252903, 0.02500000037252903], [0.5562499761581421, 0.956250011920929, 0.05000000074505806, 0.05000000074505806], [0.5687500238418579, 0.956250011920929, 0.02500000037252903, 0.02500000037252903], [0.5687500238418579, 0.956250011920929, 0.05000000074505806, 0.05000000074505806], [0.581250011920929, 0.956250011920929, 0.02500000037252903, 0.02500000037252903], [0.581250011920929, 0.956250011920929, 0.05000000074505806, 0.05000000074505806], [0.59375, 0.956250011920929, 0.02500000037252903, 0.02500000037252903], [0.59375, 0.956250011920929, 0.05000000074505806, 0.05000000074505806], [0.606249988079071, 0.956250011920929, 0.02500000037252903, 0.02500000037252903], [0.606249988079071, 0.956250011920929, 0.05000000074505806, 0.05000000074505806], [0.6187499761581421, 0.956250011920929, 0.02500000037252903, 0.02500000037252903], [0.6187499761581421, 0.956250011920929, 0.05000000074505806, 0.05000000074505806], [0.6312500238418579, 0.956250011920929, 0.02500000037252903, 0.02500000037252903], [0.6312500238418579, 0.956250011920929, 0.05000000074505806, 0.05000000074505806], [0.643750011920929, 0.956250011920929, 0.02500000037252903, 0.02500000037252903], [0.643750011920929, 0.956250011920929, 0.05000000074505806, 0.05000000074505806], [0.65625, 0.956250011920929, 0.02500000037252903, 0.02500000037252903], [0.65625, 0.956250011920929, 0.05000000074505806, 0.05000000074505806], [0.668749988079071, 0.956250011920929, 0.02500000037252903, 0.02500000037252903], [0.668749988079071, 0.956250011920929, 0.05000000074505806, 0.05000000074505806], [0.6812499761581421, 0.956250011920929, 0.02500000037252903, 0.02500000037252903], [0.6812499761581421, 0.956250011920929, 0.05000000074505806, 0.05000000074505806], [0.6937500238418579, 0.956250011920929, 0.02500000037252903, 0.02500000037252903], [0.6937500238418579, 0.956250011920929, 0.05000000074505806, 0.05000000074505806], [0.706250011920929, 0.956250011920929, 0.02500000037252903, 0.02500000037252903], [0.706250011920929, 0.956250011920929, 0.05000000074505806, 0.05000000074505806], [0.71875, 0.956250011920929, 0.02500000037252903, 0.02500000037252903], [0.71875, 0.956250011920929, 0.05000000074505806, 0.05000000074505806], [0.731249988079071, 0.956250011920929, 0.02500000037252903, 0.02500000037252903], [0.731249988079071, 0.956250011920929, 0.05000000074505806, 0.05000000074505806], [0.7437499761581421, 0.956250011920929, 0.02500000037252903, 0.02500000037252903], [0.7437499761581421, 0.956250011920929, 0.05000000074505806, 0.05000000074505806], [0.7562500238418579, 0.956250011920929, 0.02500000037252903, 0.02500000037252903], [0.7562500238418579, 0.956250011920929, 0.05000000074505806, 0.05000000074505806], [0.768750011920929, 0.956250011920929, 0.02500000037252903, 0.02500000037252903], [0.768750011920929, 0.956250011920929, 0.05000000074505806, 0.05000000074505806], [0.78125, 0.956250011920929, 0.02500000037252903, 0.02500000037252903], [0.78125, 0.956250011920929, 0.05000000074505806, 0.05000000074505806], [0.793749988079071, 0.956250011920929, 0.02500000037252903, 0.02500000037252903], [0.793749988079071, 0.956250011920929, 0.05000000074505806, 0.05000000074505806], [0.8062499761581421, 0.956250011920929, 0.02500000037252903, 0.02500000037252903], [0.8062499761581421, 0.956250011920929, 0.05000000074505806, 0.05000000074505806], [0.8187500238418579, 0.956250011920929, 0.02500000037252903, 0.02500000037252903], [0.8187500238418579, 0.956250011920929, 0.05000000074505806, 0.05000000074505806], [0.831250011920929, 0.956250011920929, 0.02500000037252903, 0.02500000037252903], [0.831250011920929, 0.956250011920929, 0.05000000074505806, 0.05000000074505806], [0.84375, 0.956250011920929, 0.02500000037252903, 0.02500000037252903], [0.84375, 0.956250011920929, 0.05000000074505806, 0.05000000074505806], [0.856249988079071, 0.956250011920929, 0.02500000037252903, 0.02500000037252903], [0.856249988079071, 0.956250011920929, 0.05000000074505806, 0.05000000074505806], [0.8687499761581421, 0.956250011920929, 0.02500000037252903, 0.02500000037252903], [0.8687499761581421, 0.956250011920929, 0.05000000074505806, 0.05000000074505806], [0.8812500238418579, 0.956250011920929, 0.02500000037252903, 0.02500000037252903], [0.8812500238418579, 0.956250011920929, 0.05000000074505806, 0.05000000074505806], [0.893750011920929, 0.956250011920929, 0.02500000037252903, 0.02500000037252903], [0.893750011920929, 0.956250011920929, 0.05000000074505806, 0.05000000074505806], [0.90625, 0.956250011920929, 0.02500000037252903, 0.02500000037252903], [0.90625, 0.956250011920929, 0.05000000074505806, 0.05000000074505806], [0.918749988079071, 0.956250011920929, 0.02500000037252903, 0.02500000037252903], [0.918749988079071, 0.956250011920929, 0.05000000074505806, 0.05000000074505806], [0.9312499761581421, 0.956250011920929, 0.02500000037252903, 0.02500000037252903], [0.9312499761581421, 0.956250011920929, 0.05000000074505806, 0.05000000074505806], [0.9437500238418579, 0.956250011920929, 0.02500000037252903, 0.02500000037252903], [0.9437500238418579, 0.956250011920929, 0.05000000074505806, 0.05000000074505806], [0.956250011920929, 0.956250011920929, 0.02500000037252903, 0.02500000037252903], [0.956250011920929, 0.956250011920929, 0.05000000074505806, 0.05000000074505806], [0.96875, 0.956250011920929, 0.02500000037252903, 0.02500000037252903], [0.96875, 0.956250011920929, 0.05000000074505806, 0.05000000074505806], [0.981249988079071, 0.956250011920929, 0.02500000037252903, 0.02500000037252903], [0.981249988079071, 0.956250011920929, 0.05000000074505806, 0.05000000074505806], [0.9937499761581421, 0.956250011920929, 0.02500000037252903, 0.02500000037252903], [0.9937499761581421, 0.956250011920929, 0.05000000074505806, 0.05000000074505806], [0.0062500000931322575, 0.96875, 0.02500000037252903, 0.02500000037252903], [0.0062500000931322575, 0.96875, 0.05000000074505806, 0.05000000074505806], [0.01875000074505806, 0.96875, 0.02500000037252903, 0.02500000037252903], [0.01875000074505806, 0.96875, 0.05000000074505806, 0.05000000074505806], [0.03125, 0.96875, 0.02500000037252903, 0.02500000037252903], [0.03125, 0.96875, 0.05000000074505806, 0.05000000074505806], [0.04374999925494194, 0.96875, 0.02500000037252903, 0.02500000037252903], [0.04374999925494194, 0.96875, 0.05000000074505806, 0.05000000074505806], [0.05624999850988388, 0.96875, 0.02500000037252903, 0.02500000037252903], [0.05624999850988388, 0.96875, 0.05000000074505806, 0.05000000074505806], [0.06875000149011612, 0.96875, 0.02500000037252903, 0.02500000037252903], [0.06875000149011612, 0.96875, 0.05000000074505806, 0.05000000074505806], [0.08124999701976776, 0.96875, 0.02500000037252903, 0.02500000037252903], [0.08124999701976776, 0.96875, 0.05000000074505806, 0.05000000074505806], [0.09375, 0.96875, 0.02500000037252903, 0.02500000037252903], [0.09375, 0.96875, 0.05000000074505806, 0.05000000074505806], [0.10625000298023224, 0.96875, 0.02500000037252903, 0.02500000037252903], [0.10625000298023224, 0.96875, 0.05000000074505806, 0.05000000074505806], [0.11874999850988388, 0.96875, 0.02500000037252903, 0.02500000037252903], [0.11874999850988388, 0.96875, 0.05000000074505806, 0.05000000074505806], [0.13124999403953552, 0.96875, 0.02500000037252903, 0.02500000037252903], [0.13124999403953552, 0.96875, 0.05000000074505806, 0.05000000074505806], [0.14374999701976776, 0.96875, 0.02500000037252903, 0.02500000037252903], [0.14374999701976776, 0.96875, 0.05000000074505806, 0.05000000074505806], [0.15625, 0.96875, 0.02500000037252903, 0.02500000037252903], [0.15625, 0.96875, 0.05000000074505806, 0.05000000074505806], [0.16875000298023224, 0.96875, 0.02500000037252903, 0.02500000037252903], [0.16875000298023224, 0.96875, 0.05000000074505806, 0.05000000074505806], [0.18125000596046448, 0.96875, 0.02500000037252903, 0.02500000037252903], [0.18125000596046448, 0.96875, 0.05000000074505806, 0.05000000074505806], [0.19374999403953552, 0.96875, 0.02500000037252903, 0.02500000037252903], [0.19374999403953552, 0.96875, 0.05000000074505806, 0.05000000074505806], [0.20624999701976776, 0.96875, 0.02500000037252903, 0.02500000037252903], [0.20624999701976776, 0.96875, 0.05000000074505806, 0.05000000074505806], [0.21875, 0.96875, 0.02500000037252903, 0.02500000037252903], [0.21875, 0.96875, 0.05000000074505806, 0.05000000074505806], [0.23125000298023224, 0.96875, 0.02500000037252903, 0.02500000037252903], [0.23125000298023224, 0.96875, 0.05000000074505806, 0.05000000074505806], [0.24375000596046448, 0.96875, 0.02500000037252903, 0.02500000037252903], [0.24375000596046448, 0.96875, 0.05000000074505806, 0.05000000074505806], [0.2562499940395355, 0.96875, 0.02500000037252903, 0.02500000037252903], [0.2562499940395355, 0.96875, 0.05000000074505806, 0.05000000074505806], [0.26875001192092896, 0.96875, 0.02500000037252903, 0.02500000037252903], [0.26875001192092896, 0.96875, 0.05000000074505806, 0.05000000074505806], [0.28125, 0.96875, 0.02500000037252903, 0.02500000037252903], [0.28125, 0.96875, 0.05000000074505806, 0.05000000074505806], [0.29374998807907104, 0.96875, 0.02500000037252903, 0.02500000037252903], [0.29374998807907104, 0.96875, 0.05000000074505806, 0.05000000074505806], [0.3062500059604645, 0.96875, 0.02500000037252903, 0.02500000037252903], [0.3062500059604645, 0.96875, 0.05000000074505806, 0.05000000074505806], [0.3187499940395355, 0.96875, 0.02500000037252903, 0.02500000037252903], [0.3187499940395355, 0.96875, 0.05000000074505806, 0.05000000074505806], [0.33125001192092896, 0.96875, 0.02500000037252903, 0.02500000037252903], [0.33125001192092896, 0.96875, 0.05000000074505806, 0.05000000074505806], [0.34375, 0.96875, 0.02500000037252903, 0.02500000037252903], [0.34375, 0.96875, 0.05000000074505806, 0.05000000074505806], [0.35624998807907104, 0.96875, 0.02500000037252903, 0.02500000037252903], [0.35624998807907104, 0.96875, 0.05000000074505806, 0.05000000074505806], [0.3687500059604645, 0.96875, 0.02500000037252903, 0.02500000037252903], [0.3687500059604645, 0.96875, 0.05000000074505806, 0.05000000074505806], [0.3812499940395355, 0.96875, 0.02500000037252903, 0.02500000037252903], [0.3812499940395355, 0.96875, 0.05000000074505806, 0.05000000074505806], [0.39375001192092896, 0.96875, 0.02500000037252903, 0.02500000037252903], [0.39375001192092896, 0.96875, 0.05000000074505806, 0.05000000074505806], [0.40625, 0.96875, 0.02500000037252903, 0.02500000037252903], [0.40625, 0.96875, 0.05000000074505806, 0.05000000074505806], [0.41874998807907104, 0.96875, 0.02500000037252903, 0.02500000037252903], [0.41874998807907104, 0.96875, 0.05000000074505806, 0.05000000074505806], [0.4312500059604645, 0.96875, 0.02500000037252903, 0.02500000037252903], [0.4312500059604645, 0.96875, 0.05000000074505806, 0.05000000074505806], [0.4437499940395355, 0.96875, 0.02500000037252903, 0.02500000037252903], [0.4437499940395355, 0.96875, 0.05000000074505806, 0.05000000074505806], [0.45625001192092896, 0.96875, 0.02500000037252903, 0.02500000037252903], [0.45625001192092896, 0.96875, 0.05000000074505806, 0.05000000074505806], [0.46875, 0.96875, 0.02500000037252903, 0.02500000037252903], [0.46875, 0.96875, 0.05000000074505806, 0.05000000074505806], [0.48124998807907104, 0.96875, 0.02500000037252903, 0.02500000037252903], [0.48124998807907104, 0.96875, 0.05000000074505806, 0.05000000074505806], [0.4937500059604645, 0.96875, 0.02500000037252903, 0.02500000037252903], [0.4937500059604645, 0.96875, 0.05000000074505806, 0.05000000074505806], [0.5062500238418579, 0.96875, 0.02500000037252903, 0.02500000037252903], [0.5062500238418579, 0.96875, 0.05000000074505806, 0.05000000074505806], [0.518750011920929, 0.96875, 0.02500000037252903, 0.02500000037252903], [0.518750011920929, 0.96875, 0.05000000074505806, 0.05000000074505806], [0.53125, 0.96875, 0.02500000037252903, 0.02500000037252903], [0.53125, 0.96875, 0.05000000074505806, 0.05000000074505806], [0.543749988079071, 0.96875, 0.02500000037252903, 0.02500000037252903], [0.543749988079071, 0.96875, 0.05000000074505806, 0.05000000074505806], [0.5562499761581421, 0.96875, 0.02500000037252903, 0.02500000037252903], [0.5562499761581421, 0.96875, 0.05000000074505806, 0.05000000074505806], [0.5687500238418579, 0.96875, 0.02500000037252903, 0.02500000037252903], [0.5687500238418579, 0.96875, 0.05000000074505806, 0.05000000074505806], [0.581250011920929, 0.96875, 0.02500000037252903, 0.02500000037252903], [0.581250011920929, 0.96875, 0.05000000074505806, 0.05000000074505806], [0.59375, 0.96875, 0.02500000037252903, 0.02500000037252903], [0.59375, 0.96875, 0.05000000074505806, 0.05000000074505806], [0.606249988079071, 0.96875, 0.02500000037252903, 0.02500000037252903], [0.606249988079071, 0.96875, 0.05000000074505806, 0.05000000074505806], [0.6187499761581421, 0.96875, 0.02500000037252903, 0.02500000037252903], [0.6187499761581421, 0.96875, 0.05000000074505806, 0.05000000074505806], [0.6312500238418579, 0.96875, 0.02500000037252903, 0.02500000037252903], [0.6312500238418579, 0.96875, 0.05000000074505806, 0.05000000074505806], [0.643750011920929, 0.96875, 0.02500000037252903, 0.02500000037252903], [0.643750011920929, 0.96875, 0.05000000074505806, 0.05000000074505806], [0.65625, 0.96875, 0.02500000037252903, 0.02500000037252903], [0.65625, 0.96875, 0.05000000074505806, 0.05000000074505806], [0.668749988079071, 0.96875, 0.02500000037252903, 0.02500000037252903], [0.668749988079071, 0.96875, 0.05000000074505806, 0.05000000074505806], [0.6812499761581421, 0.96875, 0.02500000037252903, 0.02500000037252903], [0.6812499761581421, 0.96875, 0.05000000074505806, 0.05000000074505806], [0.6937500238418579, 0.96875, 0.02500000037252903, 0.02500000037252903], [0.6937500238418579, 0.96875, 0.05000000074505806, 0.05000000074505806], [0.706250011920929, 0.96875, 0.02500000037252903, 0.02500000037252903], [0.706250011920929, 0.96875, 0.05000000074505806, 0.05000000074505806], [0.71875, 0.96875, 0.02500000037252903, 0.02500000037252903], [0.71875, 0.96875, 0.05000000074505806, 0.05000000074505806], [0.731249988079071, 0.96875, 0.02500000037252903, 0.02500000037252903], [0.731249988079071, 0.96875, 0.05000000074505806, 0.05000000074505806], [0.7437499761581421, 0.96875, 0.02500000037252903, 0.02500000037252903], [0.7437499761581421, 0.96875, 0.05000000074505806, 0.05000000074505806], [0.7562500238418579, 0.96875, 0.02500000037252903, 0.02500000037252903], [0.7562500238418579, 0.96875, 0.05000000074505806, 0.05000000074505806], [0.768750011920929, 0.96875, 0.02500000037252903, 0.02500000037252903], [0.768750011920929, 0.96875, 0.05000000074505806, 0.05000000074505806], [0.78125, 0.96875, 0.02500000037252903, 0.02500000037252903], [0.78125, 0.96875, 0.05000000074505806, 0.05000000074505806], [0.793749988079071, 0.96875, 0.02500000037252903, 0.02500000037252903], [0.793749988079071, 0.96875, 0.05000000074505806, 0.05000000074505806], [0.8062499761581421, 0.96875, 0.02500000037252903, 0.02500000037252903], [0.8062499761581421, 0.96875, 0.05000000074505806, 0.05000000074505806], [0.8187500238418579, 0.96875, 0.02500000037252903, 0.02500000037252903], [0.8187500238418579, 0.96875, 0.05000000074505806, 0.05000000074505806], [0.831250011920929, 0.96875, 0.02500000037252903, 0.02500000037252903], [0.831250011920929, 0.96875, 0.05000000074505806, 0.05000000074505806], [0.84375, 0.96875, 0.02500000037252903, 0.02500000037252903], [0.84375, 0.96875, 0.05000000074505806, 0.05000000074505806], [0.856249988079071, 0.96875, 0.02500000037252903, 0.02500000037252903], [0.856249988079071, 0.96875, 0.05000000074505806, 0.05000000074505806], [0.8687499761581421, 0.96875, 0.02500000037252903, 0.02500000037252903], [0.8687499761581421, 0.96875, 0.05000000074505806, 0.05000000074505806], [0.8812500238418579, 0.96875, 0.02500000037252903, 0.02500000037252903], [0.8812500238418579, 0.96875, 0.05000000074505806, 0.05000000074505806], [0.893750011920929, 0.96875, 0.02500000037252903, 0.02500000037252903], [0.893750011920929, 0.96875, 0.05000000074505806, 0.05000000074505806], [0.90625, 0.96875, 0.02500000037252903, 0.02500000037252903], [0.90625, 0.96875, 0.05000000074505806, 0.05000000074505806], [0.918749988079071, 0.96875, 0.02500000037252903, 0.02500000037252903], [0.918749988079071, 0.96875, 0.05000000074505806, 0.05000000074505806], [0.9312499761581421, 0.96875, 0.02500000037252903, 0.02500000037252903], [0.9312499761581421, 0.96875, 0.05000000074505806, 0.05000000074505806], [0.9437500238418579, 0.96875, 0.02500000037252903, 0.02500000037252903], [0.9437500238418579, 0.96875, 0.05000000074505806, 0.05000000074505806], [0.956250011920929, 0.96875, 0.02500000037252903, 0.02500000037252903], [0.956250011920929, 0.96875, 0.05000000074505806, 0.05000000074505806], [0.96875, 0.96875, 0.02500000037252903, 0.02500000037252903], [0.96875, 0.96875, 0.05000000074505806, 0.05000000074505806], [0.981249988079071, 0.96875, 0.02500000037252903, 0.02500000037252903], [0.981249988079071, 0.96875, 0.05000000074505806, 0.05000000074505806], [0.9937499761581421, 0.96875, 0.02500000037252903, 0.02500000037252903], [0.9937499761581421, 0.96875, 0.05000000074505806, 0.05000000074505806], [0.0062500000931322575, 0.981249988079071, 0.02500000037252903, 0.02500000037252903], [0.0062500000931322575, 0.981249988079071, 0.05000000074505806, 0.05000000074505806], [0.01875000074505806, 0.981249988079071, 0.02500000037252903, 0.02500000037252903], [0.01875000074505806, 0.981249988079071, 0.05000000074505806, 0.05000000074505806], [0.03125, 0.981249988079071, 0.02500000037252903, 0.02500000037252903], [0.03125, 0.981249988079071, 0.05000000074505806, 0.05000000074505806], [0.04374999925494194, 0.981249988079071, 0.02500000037252903, 0.02500000037252903], [0.04374999925494194, 0.981249988079071, 0.05000000074505806, 0.05000000074505806], [0.05624999850988388, 0.981249988079071, 0.02500000037252903, 0.02500000037252903], [0.05624999850988388, 0.981249988079071, 0.05000000074505806, 0.05000000074505806], [0.06875000149011612, 0.981249988079071, 0.02500000037252903, 0.02500000037252903], [0.06875000149011612, 0.981249988079071, 0.05000000074505806, 0.05000000074505806], [0.08124999701976776, 0.981249988079071, 0.02500000037252903, 0.02500000037252903], [0.08124999701976776, 0.981249988079071, 0.05000000074505806, 0.05000000074505806], [0.09375, 0.981249988079071, 0.02500000037252903, 0.02500000037252903], [0.09375, 0.981249988079071, 0.05000000074505806, 0.05000000074505806], [0.10625000298023224, 0.981249988079071, 0.02500000037252903, 0.02500000037252903], [0.10625000298023224, 0.981249988079071, 0.05000000074505806, 0.05000000074505806], [0.11874999850988388, 0.981249988079071, 0.02500000037252903, 0.02500000037252903], [0.11874999850988388, 0.981249988079071, 0.05000000074505806, 0.05000000074505806], [0.13124999403953552, 0.981249988079071, 0.02500000037252903, 0.02500000037252903], [0.13124999403953552, 0.981249988079071, 0.05000000074505806, 0.05000000074505806], [0.14374999701976776, 0.981249988079071, 0.02500000037252903, 0.02500000037252903], [0.14374999701976776, 0.981249988079071, 0.05000000074505806, 0.05000000074505806], [0.15625, 0.981249988079071, 0.02500000037252903, 0.02500000037252903], [0.15625, 0.981249988079071, 0.05000000074505806, 0.05000000074505806], [0.16875000298023224, 0.981249988079071, 0.02500000037252903, 0.02500000037252903], [0.16875000298023224, 0.981249988079071, 0.05000000074505806, 0.05000000074505806], [0.18125000596046448, 0.981249988079071, 0.02500000037252903, 0.02500000037252903], [0.18125000596046448, 0.981249988079071, 0.05000000074505806, 0.05000000074505806], [0.19374999403953552, 0.981249988079071, 0.02500000037252903, 0.02500000037252903], [0.19374999403953552, 0.981249988079071, 0.05000000074505806, 0.05000000074505806], [0.20624999701976776, 0.981249988079071, 0.02500000037252903, 0.02500000037252903], [0.20624999701976776, 0.981249988079071, 0.05000000074505806, 0.05000000074505806], [0.21875, 0.981249988079071, 0.02500000037252903, 0.02500000037252903], [0.21875, 0.981249988079071, 0.05000000074505806, 0.05000000074505806], [0.23125000298023224, 0.981249988079071, 0.02500000037252903, 0.02500000037252903], [0.23125000298023224, 0.981249988079071, 0.05000000074505806, 0.05000000074505806], [0.24375000596046448, 0.981249988079071, 0.02500000037252903, 0.02500000037252903], [0.24375000596046448, 0.981249988079071, 0.05000000074505806, 0.05000000074505806], [0.2562499940395355, 0.981249988079071, 0.02500000037252903, 0.02500000037252903], [0.2562499940395355, 0.981249988079071, 0.05000000074505806, 0.05000000074505806], [0.26875001192092896, 0.981249988079071, 0.02500000037252903, 0.02500000037252903], [0.26875001192092896, 0.981249988079071, 0.05000000074505806, 0.05000000074505806], [0.28125, 0.981249988079071, 0.02500000037252903, 0.02500000037252903], [0.28125, 0.981249988079071, 0.05000000074505806, 0.05000000074505806], [0.29374998807907104, 0.981249988079071, 0.02500000037252903, 0.02500000037252903], [0.29374998807907104, 0.981249988079071, 0.05000000074505806, 0.05000000074505806], [0.3062500059604645, 0.981249988079071, 0.02500000037252903, 0.02500000037252903], [0.3062500059604645, 0.981249988079071, 0.05000000074505806, 0.05000000074505806], [0.3187499940395355, 0.981249988079071, 0.02500000037252903, 0.02500000037252903], [0.3187499940395355, 0.981249988079071, 0.05000000074505806, 0.05000000074505806], [0.33125001192092896, 0.981249988079071, 0.02500000037252903, 0.02500000037252903], [0.33125001192092896, 0.981249988079071, 0.05000000074505806, 0.05000000074505806], [0.34375, 0.981249988079071, 0.02500000037252903, 0.02500000037252903], [0.34375, 0.981249988079071, 0.05000000074505806, 0.05000000074505806], [0.35624998807907104, 0.981249988079071, 0.02500000037252903, 0.02500000037252903], [0.35624998807907104, 0.981249988079071, 0.05000000074505806, 0.05000000074505806], [0.3687500059604645, 0.981249988079071, 0.02500000037252903, 0.02500000037252903], [0.3687500059604645, 0.981249988079071, 0.05000000074505806, 0.05000000074505806], [0.3812499940395355, 0.981249988079071, 0.02500000037252903, 0.02500000037252903], [0.3812499940395355, 0.981249988079071, 0.05000000074505806, 0.05000000074505806], [0.39375001192092896, 0.981249988079071, 0.02500000037252903, 0.02500000037252903], [0.39375001192092896, 0.981249988079071, 0.05000000074505806, 0.05000000074505806], [0.40625, 0.981249988079071, 0.02500000037252903, 0.02500000037252903], [0.40625, 0.981249988079071, 0.05000000074505806, 0.05000000074505806], [0.41874998807907104, 0.981249988079071, 0.02500000037252903, 0.02500000037252903], [0.41874998807907104, 0.981249988079071, 0.05000000074505806, 0.05000000074505806], [0.4312500059604645, 0.981249988079071, 0.02500000037252903, 0.02500000037252903], [0.4312500059604645, 0.981249988079071, 0.05000000074505806, 0.05000000074505806], [0.4437499940395355, 0.981249988079071, 0.02500000037252903, 0.02500000037252903], [0.4437499940395355, 0.981249988079071, 0.05000000074505806, 0.05000000074505806], [0.45625001192092896, 0.981249988079071, 0.02500000037252903, 0.02500000037252903], [0.45625001192092896, 0.981249988079071, 0.05000000074505806, 0.05000000074505806], [0.46875, 0.981249988079071, 0.02500000037252903, 0.02500000037252903], [0.46875, 0.981249988079071, 0.05000000074505806, 0.05000000074505806], [0.48124998807907104, 0.981249988079071, 0.02500000037252903, 0.02500000037252903], [0.48124998807907104, 0.981249988079071, 0.05000000074505806, 0.05000000074505806], [0.4937500059604645, 0.981249988079071, 0.02500000037252903, 0.02500000037252903], [0.4937500059604645, 0.981249988079071, 0.05000000074505806, 0.05000000074505806], [0.5062500238418579, 0.981249988079071, 0.02500000037252903, 0.02500000037252903], [0.5062500238418579, 0.981249988079071, 0.05000000074505806, 0.05000000074505806], [0.518750011920929, 0.981249988079071, 0.02500000037252903, 0.02500000037252903], [0.518750011920929, 0.981249988079071, 0.05000000074505806, 0.05000000074505806], [0.53125, 0.981249988079071, 0.02500000037252903, 0.02500000037252903], [0.53125, 0.981249988079071, 0.05000000074505806, 0.05000000074505806], [0.543749988079071, 0.981249988079071, 0.02500000037252903, 0.02500000037252903], [0.543749988079071, 0.981249988079071, 0.05000000074505806, 0.05000000074505806], [0.5562499761581421, 0.981249988079071, 0.02500000037252903, 0.02500000037252903], [0.5562499761581421, 0.981249988079071, 0.05000000074505806, 0.05000000074505806], [0.5687500238418579, 0.981249988079071, 0.02500000037252903, 0.02500000037252903], [0.5687500238418579, 0.981249988079071, 0.05000000074505806, 0.05000000074505806], [0.581250011920929, 0.981249988079071, 0.02500000037252903, 0.02500000037252903], [0.581250011920929, 0.981249988079071, 0.05000000074505806, 0.05000000074505806], [0.59375, 0.981249988079071, 0.02500000037252903, 0.02500000037252903], [0.59375, 0.981249988079071, 0.05000000074505806, 0.05000000074505806], [0.606249988079071, 0.981249988079071, 0.02500000037252903, 0.02500000037252903], [0.606249988079071, 0.981249988079071, 0.05000000074505806, 0.05000000074505806], [0.6187499761581421, 0.981249988079071, 0.02500000037252903, 0.02500000037252903], [0.6187499761581421, 0.981249988079071, 0.05000000074505806, 0.05000000074505806], [0.6312500238418579, 0.981249988079071, 0.02500000037252903, 0.02500000037252903], [0.6312500238418579, 0.981249988079071, 0.05000000074505806, 0.05000000074505806], [0.643750011920929, 0.981249988079071, 0.02500000037252903, 0.02500000037252903], [0.643750011920929, 0.981249988079071, 0.05000000074505806, 0.05000000074505806], [0.65625, 0.981249988079071, 0.02500000037252903, 0.02500000037252903], [0.65625, 0.981249988079071, 0.05000000074505806, 0.05000000074505806], [0.668749988079071, 0.981249988079071, 0.02500000037252903, 0.02500000037252903], [0.668749988079071, 0.981249988079071, 0.05000000074505806, 0.05000000074505806], [0.6812499761581421, 0.981249988079071, 0.02500000037252903, 0.02500000037252903], [0.6812499761581421, 0.981249988079071, 0.05000000074505806, 0.05000000074505806], [0.6937500238418579, 0.981249988079071, 0.02500000037252903, 0.02500000037252903], [0.6937500238418579, 0.981249988079071, 0.05000000074505806, 0.05000000074505806], [0.706250011920929, 0.981249988079071, 0.02500000037252903, 0.02500000037252903], [0.706250011920929, 0.981249988079071, 0.05000000074505806, 0.05000000074505806], [0.71875, 0.981249988079071, 0.02500000037252903, 0.02500000037252903], [0.71875, 0.981249988079071, 0.05000000074505806, 0.05000000074505806], [0.731249988079071, 0.981249988079071, 0.02500000037252903, 0.02500000037252903], [0.731249988079071, 0.981249988079071, 0.05000000074505806, 0.05000000074505806], [0.7437499761581421, 0.981249988079071, 0.02500000037252903, 0.02500000037252903], [0.7437499761581421, 0.981249988079071, 0.05000000074505806, 0.05000000074505806], [0.7562500238418579, 0.981249988079071, 0.02500000037252903, 0.02500000037252903], [0.7562500238418579, 0.981249988079071, 0.05000000074505806, 0.05000000074505806], [0.768750011920929, 0.981249988079071, 0.02500000037252903, 0.02500000037252903], [0.768750011920929, 0.981249988079071, 0.05000000074505806, 0.05000000074505806], [0.78125, 0.981249988079071, 0.02500000037252903, 0.02500000037252903], [0.78125, 0.981249988079071, 0.05000000074505806, 0.05000000074505806], [0.793749988079071, 0.981249988079071, 0.02500000037252903, 0.02500000037252903], [0.793749988079071, 0.981249988079071, 0.05000000074505806, 0.05000000074505806], [0.8062499761581421, 0.981249988079071, 0.02500000037252903, 0.02500000037252903], [0.8062499761581421, 0.981249988079071, 0.05000000074505806, 0.05000000074505806], [0.8187500238418579, 0.981249988079071, 0.02500000037252903, 0.02500000037252903], [0.8187500238418579, 0.981249988079071, 0.05000000074505806, 0.05000000074505806], [0.831250011920929, 0.981249988079071, 0.02500000037252903, 0.02500000037252903], [0.831250011920929, 0.981249988079071, 0.05000000074505806, 0.05000000074505806], [0.84375, 0.981249988079071, 0.02500000037252903, 0.02500000037252903], [0.84375, 0.981249988079071, 0.05000000074505806, 0.05000000074505806], [0.856249988079071, 0.981249988079071, 0.02500000037252903, 0.02500000037252903], [0.856249988079071, 0.981249988079071, 0.05000000074505806, 0.05000000074505806], [0.8687499761581421, 0.981249988079071, 0.02500000037252903, 0.02500000037252903], [0.8687499761581421, 0.981249988079071, 0.05000000074505806, 0.05000000074505806], [0.8812500238418579, 0.981249988079071, 0.02500000037252903, 0.02500000037252903], [0.8812500238418579, 0.981249988079071, 0.05000000074505806, 0.05000000074505806], [0.893750011920929, 0.981249988079071, 0.02500000037252903, 0.02500000037252903], [0.893750011920929, 0.981249988079071, 0.05000000074505806, 0.05000000074505806], [0.90625, 0.981249988079071, 0.02500000037252903, 0.02500000037252903], [0.90625, 0.981249988079071, 0.05000000074505806, 0.05000000074505806], [0.918749988079071, 0.981249988079071, 0.02500000037252903, 0.02500000037252903], [0.918749988079071, 0.981249988079071, 0.05000000074505806, 0.05000000074505806], [0.9312499761581421, 0.981249988079071, 0.02500000037252903, 0.02500000037252903], [0.9312499761581421, 0.981249988079071, 0.05000000074505806, 0.05000000074505806], [0.9437500238418579, 0.981249988079071, 0.02500000037252903, 0.02500000037252903], [0.9437500238418579, 0.981249988079071, 0.05000000074505806, 0.05000000074505806], [0.956250011920929, 0.981249988079071, 0.02500000037252903, 0.02500000037252903], [0.956250011920929, 0.981249988079071, 0.05000000074505806, 0.05000000074505806], [0.96875, 0.981249988079071, 0.02500000037252903, 0.02500000037252903], [0.96875, 0.981249988079071, 0.05000000074505806, 0.05000000074505806], [0.981249988079071, 0.981249988079071, 0.02500000037252903, 0.02500000037252903], [0.981249988079071, 0.981249988079071, 0.05000000074505806, 0.05000000074505806], [0.9937499761581421, 0.981249988079071, 0.02500000037252903, 0.02500000037252903], [0.9937499761581421, 0.981249988079071, 0.05000000074505806, 0.05000000074505806], [0.0062500000931322575, 0.9937499761581421, 0.02500000037252903, 0.02500000037252903], [0.0062500000931322575, 0.9937499761581421, 0.05000000074505806, 0.05000000074505806], [0.01875000074505806, 0.9937499761581421, 0.02500000037252903, 0.02500000037252903], [0.01875000074505806, 0.9937499761581421, 0.05000000074505806, 0.05000000074505806], [0.03125, 0.9937499761581421, 0.02500000037252903, 0.02500000037252903], [0.03125, 0.9937499761581421, 0.05000000074505806, 0.05000000074505806], [0.04374999925494194, 0.9937499761581421, 0.02500000037252903, 0.02500000037252903], [0.04374999925494194, 0.9937499761581421, 0.05000000074505806, 0.05000000074505806], [0.05624999850988388, 0.9937499761581421, 0.02500000037252903, 0.02500000037252903], [0.05624999850988388, 0.9937499761581421, 0.05000000074505806, 0.05000000074505806], [0.06875000149011612, 0.9937499761581421, 0.02500000037252903, 0.02500000037252903], [0.06875000149011612, 0.9937499761581421, 0.05000000074505806, 0.05000000074505806], [0.08124999701976776, 0.9937499761581421, 0.02500000037252903, 0.02500000037252903], [0.08124999701976776, 0.9937499761581421, 0.05000000074505806, 0.05000000074505806], [0.09375, 0.9937499761581421, 0.02500000037252903, 0.02500000037252903], [0.09375, 0.9937499761581421, 0.05000000074505806, 0.05000000074505806], [0.10625000298023224, 0.9937499761581421, 0.02500000037252903, 0.02500000037252903], [0.10625000298023224, 0.9937499761581421, 0.05000000074505806, 0.05000000074505806], [0.11874999850988388, 0.9937499761581421, 0.02500000037252903, 0.02500000037252903], [0.11874999850988388, 0.9937499761581421, 0.05000000074505806, 0.05000000074505806], [0.13124999403953552, 0.9937499761581421, 0.02500000037252903, 0.02500000037252903], [0.13124999403953552, 0.9937499761581421, 0.05000000074505806, 0.05000000074505806], [0.14374999701976776, 0.9937499761581421, 0.02500000037252903, 0.02500000037252903], [0.14374999701976776, 0.9937499761581421, 0.05000000074505806, 0.05000000074505806], [0.15625, 0.9937499761581421, 0.02500000037252903, 0.02500000037252903], [0.15625, 0.9937499761581421, 0.05000000074505806, 0.05000000074505806], [0.16875000298023224, 0.9937499761581421, 0.02500000037252903, 0.02500000037252903], [0.16875000298023224, 0.9937499761581421, 0.05000000074505806, 0.05000000074505806], [0.18125000596046448, 0.9937499761581421, 0.02500000037252903, 0.02500000037252903], [0.18125000596046448, 0.9937499761581421, 0.05000000074505806, 0.05000000074505806], [0.19374999403953552, 0.9937499761581421, 0.02500000037252903, 0.02500000037252903], [0.19374999403953552, 0.9937499761581421, 0.05000000074505806, 0.05000000074505806], [0.20624999701976776, 0.9937499761581421, 0.02500000037252903, 0.02500000037252903], [0.20624999701976776, 0.9937499761581421, 0.05000000074505806, 0.05000000074505806], [0.21875, 0.9937499761581421, 0.02500000037252903, 0.02500000037252903], [0.21875, 0.9937499761581421, 0.05000000074505806, 0.05000000074505806], [0.23125000298023224, 0.9937499761581421, 0.02500000037252903, 0.02500000037252903], [0.23125000298023224, 0.9937499761581421, 0.05000000074505806, 0.05000000074505806], [0.24375000596046448, 0.9937499761581421, 0.02500000037252903, 0.02500000037252903], [0.24375000596046448, 0.9937499761581421, 0.05000000074505806, 0.05000000074505806], [0.2562499940395355, 0.9937499761581421, 0.02500000037252903, 0.02500000037252903], [0.2562499940395355, 0.9937499761581421, 0.05000000074505806, 0.05000000074505806], [0.26875001192092896, 0.9937499761581421, 0.02500000037252903, 0.02500000037252903], [0.26875001192092896, 0.9937499761581421, 0.05000000074505806, 0.05000000074505806], [0.28125, 0.9937499761581421, 0.02500000037252903, 0.02500000037252903], [0.28125, 0.9937499761581421, 0.05000000074505806, 0.05000000074505806], [0.29374998807907104, 0.9937499761581421, 0.02500000037252903, 0.02500000037252903], [0.29374998807907104, 0.9937499761581421, 0.05000000074505806, 0.05000000074505806], [0.3062500059604645, 0.9937499761581421, 0.02500000037252903, 0.02500000037252903], [0.3062500059604645, 0.9937499761581421, 0.05000000074505806, 0.05000000074505806], [0.3187499940395355, 0.9937499761581421, 0.02500000037252903, 0.02500000037252903], [0.3187499940395355, 0.9937499761581421, 0.05000000074505806, 0.05000000074505806], [0.33125001192092896, 0.9937499761581421, 0.02500000037252903, 0.02500000037252903], [0.33125001192092896, 0.9937499761581421, 0.05000000074505806, 0.05000000074505806], [0.34375, 0.9937499761581421, 0.02500000037252903, 0.02500000037252903], [0.34375, 0.9937499761581421, 0.05000000074505806, 0.05000000074505806], [0.35624998807907104, 0.9937499761581421, 0.02500000037252903, 0.02500000037252903], [0.35624998807907104, 0.9937499761581421, 0.05000000074505806, 0.05000000074505806], [0.3687500059604645, 0.9937499761581421, 0.02500000037252903, 0.02500000037252903], [0.3687500059604645, 0.9937499761581421, 0.05000000074505806, 0.05000000074505806], [0.3812499940395355, 0.9937499761581421, 0.02500000037252903, 0.02500000037252903], [0.3812499940395355, 0.9937499761581421, 0.05000000074505806, 0.05000000074505806], [0.39375001192092896, 0.9937499761581421, 0.02500000037252903, 0.02500000037252903], [0.39375001192092896, 0.9937499761581421, 0.05000000074505806, 0.05000000074505806], [0.40625, 0.9937499761581421, 0.02500000037252903, 0.02500000037252903], [0.40625, 0.9937499761581421, 0.05000000074505806, 0.05000000074505806], [0.41874998807907104, 0.9937499761581421, 0.02500000037252903, 0.02500000037252903], [0.41874998807907104, 0.9937499761581421, 0.05000000074505806, 0.05000000074505806], [0.4312500059604645, 0.9937499761581421, 0.02500000037252903, 0.02500000037252903], [0.4312500059604645, 0.9937499761581421, 0.05000000074505806, 0.05000000074505806], [0.4437499940395355, 0.9937499761581421, 0.02500000037252903, 0.02500000037252903], [0.4437499940395355, 0.9937499761581421, 0.05000000074505806, 0.05000000074505806], [0.45625001192092896, 0.9937499761581421, 0.02500000037252903, 0.02500000037252903], [0.45625001192092896, 0.9937499761581421, 0.05000000074505806, 0.05000000074505806], [0.46875, 0.9937499761581421, 0.02500000037252903, 0.02500000037252903], [0.46875, 0.9937499761581421, 0.05000000074505806, 0.05000000074505806], [0.48124998807907104, 0.9937499761581421, 0.02500000037252903, 0.02500000037252903], [0.48124998807907104, 0.9937499761581421, 0.05000000074505806, 0.05000000074505806], [0.4937500059604645, 0.9937499761581421, 0.02500000037252903, 0.02500000037252903], [0.4937500059604645, 0.9937499761581421, 0.05000000074505806, 0.05000000074505806], [0.5062500238418579, 0.9937499761581421, 0.02500000037252903, 0.02500000037252903], [0.5062500238418579, 0.9937499761581421, 0.05000000074505806, 0.05000000074505806], [0.518750011920929, 0.9937499761581421, 0.02500000037252903, 0.02500000037252903], [0.518750011920929, 0.9937499761581421, 0.05000000074505806, 0.05000000074505806], [0.53125, 0.9937499761581421, 0.02500000037252903, 0.02500000037252903], [0.53125, 0.9937499761581421, 0.05000000074505806, 0.05000000074505806], [0.543749988079071, 0.9937499761581421, 0.02500000037252903, 0.02500000037252903], [0.543749988079071, 0.9937499761581421, 0.05000000074505806, 0.05000000074505806], [0.5562499761581421, 0.9937499761581421, 0.02500000037252903, 0.02500000037252903], [0.5562499761581421, 0.9937499761581421, 0.05000000074505806, 0.05000000074505806], [0.5687500238418579, 0.9937499761581421, 0.02500000037252903, 0.02500000037252903], [0.5687500238418579, 0.9937499761581421, 0.05000000074505806, 0.05000000074505806], [0.581250011920929, 0.9937499761581421, 0.02500000037252903, 0.02500000037252903], [0.581250011920929, 0.9937499761581421, 0.05000000074505806, 0.05000000074505806], [0.59375, 0.9937499761581421, 0.02500000037252903, 0.02500000037252903], [0.59375, 0.9937499761581421, 0.05000000074505806, 0.05000000074505806], [0.606249988079071, 0.9937499761581421, 0.02500000037252903, 0.02500000037252903], [0.606249988079071, 0.9937499761581421, 0.05000000074505806, 0.05000000074505806], [0.6187499761581421, 0.9937499761581421, 0.02500000037252903, 0.02500000037252903], [0.6187499761581421, 0.9937499761581421, 0.05000000074505806, 0.05000000074505806], [0.6312500238418579, 0.9937499761581421, 0.02500000037252903, 0.02500000037252903], [0.6312500238418579, 0.9937499761581421, 0.05000000074505806, 0.05000000074505806], [0.643750011920929, 0.9937499761581421, 0.02500000037252903, 0.02500000037252903], [0.643750011920929, 0.9937499761581421, 0.05000000074505806, 0.05000000074505806], [0.65625, 0.9937499761581421, 0.02500000037252903, 0.02500000037252903], [0.65625, 0.9937499761581421, 0.05000000074505806, 0.05000000074505806], [0.668749988079071, 0.9937499761581421, 0.02500000037252903, 0.02500000037252903], [0.668749988079071, 0.9937499761581421, 0.05000000074505806, 0.05000000074505806], [0.6812499761581421, 0.9937499761581421, 0.02500000037252903, 0.02500000037252903], [0.6812499761581421, 0.9937499761581421, 0.05000000074505806, 0.05000000074505806], [0.6937500238418579, 0.9937499761581421, 0.02500000037252903, 0.02500000037252903], [0.6937500238418579, 0.9937499761581421, 0.05000000074505806, 0.05000000074505806], [0.706250011920929, 0.9937499761581421, 0.02500000037252903, 0.02500000037252903], [0.706250011920929, 0.9937499761581421, 0.05000000074505806, 0.05000000074505806], [0.71875, 0.9937499761581421, 0.02500000037252903, 0.02500000037252903], [0.71875, 0.9937499761581421, 0.05000000074505806, 0.05000000074505806], [0.731249988079071, 0.9937499761581421, 0.02500000037252903, 0.02500000037252903], [0.731249988079071, 0.9937499761581421, 0.05000000074505806, 0.05000000074505806], [0.7437499761581421, 0.9937499761581421, 0.02500000037252903, 0.02500000037252903], [0.7437499761581421, 0.9937499761581421, 0.05000000074505806, 0.05000000074505806], [0.7562500238418579, 0.9937499761581421, 0.02500000037252903, 0.02500000037252903], [0.7562500238418579, 0.9937499761581421, 0.05000000074505806, 0.05000000074505806], [0.768750011920929, 0.9937499761581421, 0.02500000037252903, 0.02500000037252903], [0.768750011920929, 0.9937499761581421, 0.05000000074505806, 0.05000000074505806], [0.78125, 0.9937499761581421, 0.02500000037252903, 0.02500000037252903], [0.78125, 0.9937499761581421, 0.05000000074505806, 0.05000000074505806], [0.793749988079071, 0.9937499761581421, 0.02500000037252903, 0.02500000037252903], [0.793749988079071, 0.9937499761581421, 0.05000000074505806, 0.05000000074505806], [0.8062499761581421, 0.9937499761581421, 0.02500000037252903, 0.02500000037252903], [0.8062499761581421, 0.9937499761581421, 0.05000000074505806, 0.05000000074505806], [0.8187500238418579, 0.9937499761581421, 0.02500000037252903, 0.02500000037252903], [0.8187500238418579, 0.9937499761581421, 0.05000000074505806, 0.05000000074505806], [0.831250011920929, 0.9937499761581421, 0.02500000037252903, 0.02500000037252903], [0.831250011920929, 0.9937499761581421, 0.05000000074505806, 0.05000000074505806], [0.84375, 0.9937499761581421, 0.02500000037252903, 0.02500000037252903], [0.84375, 0.9937499761581421, 0.05000000074505806, 0.05000000074505806], [0.856249988079071, 0.9937499761581421, 0.02500000037252903, 0.02500000037252903], [0.856249988079071, 0.9937499761581421, 0.05000000074505806, 0.05000000074505806], [0.8687499761581421, 0.9937499761581421, 0.02500000037252903, 0.02500000037252903], [0.8687499761581421, 0.9937499761581421, 0.05000000074505806, 0.05000000074505806], [0.8812500238418579, 0.9937499761581421, 0.02500000037252903, 0.02500000037252903], [0.8812500238418579, 0.9937499761581421, 0.05000000074505806, 0.05000000074505806], [0.893750011920929, 0.9937499761581421, 0.02500000037252903, 0.02500000037252903], [0.893750011920929, 0.9937499761581421, 0.05000000074505806, 0.05000000074505806], [0.90625, 0.9937499761581421, 0.02500000037252903, 0.02500000037252903], [0.90625, 0.9937499761581421, 0.05000000074505806, 0.05000000074505806], [0.918749988079071, 0.9937499761581421, 0.02500000037252903, 0.02500000037252903], [0.918749988079071, 0.9937499761581421, 0.05000000074505806, 0.05000000074505806], [0.9312499761581421, 0.9937499761581421, 0.02500000037252903, 0.02500000037252903], [0.9312499761581421, 0.9937499761581421, 0.05000000074505806, 0.05000000074505806], [0.9437500238418579, 0.9937499761581421, 0.02500000037252903, 0.02500000037252903], [0.9437500238418579, 0.9937499761581421, 0.05000000074505806, 0.05000000074505806], [0.956250011920929, 0.9937499761581421, 0.02500000037252903, 0.02500000037252903], [0.956250011920929, 0.9937499761581421, 0.05000000074505806, 0.05000000074505806], [0.96875, 0.9937499761581421, 0.02500000037252903, 0.02500000037252903], [0.96875, 0.9937499761581421, 0.05000000074505806, 0.05000000074505806], [0.981249988079071, 0.9937499761581421, 0.02500000037252903, 0.02500000037252903], [0.981249988079071, 0.9937499761581421, 0.05000000074505806, 0.05000000074505806], [0.9937499761581421, 0.9937499761581421, 0.02500000037252903, 0.02500000037252903], [0.9937499761581421, 0.9937499761581421, 0.05000000074505806, 0.05000000074505806], [0.012500000186264515, 0.012500000186264515, 0.10000000149011612, 0.10000000149011612], [0.012500000186264515, 0.012500000186264515, 0.20000000298023224, 0.20000000298023224], [0.03750000149011612, 0.012500000186264515, 0.10000000149011612, 0.10000000149011612], [0.03750000149011612, 0.012500000186264515, 0.20000000298023224, 0.20000000298023224], [0.0625, 0.012500000186264515, 0.10000000149011612, 0.10000000149011612], [0.0625, 0.012500000186264515, 0.20000000298023224, 0.20000000298023224], [0.08749999850988388, 0.012500000186264515, 0.10000000149011612, 0.10000000149011612], [0.08749999850988388, 0.012500000186264515, 0.20000000298023224, 0.20000000298023224], [0.11249999701976776, 0.012500000186264515, 0.10000000149011612, 0.10000000149011612], [0.11249999701976776, 0.012500000186264515, 0.20000000298023224, 0.20000000298023224], [0.13750000298023224, 0.012500000186264515, 0.10000000149011612, 0.10000000149011612], [0.13750000298023224, 0.012500000186264515, 0.20000000298023224, 0.20000000298023224], [0.16249999403953552, 0.012500000186264515, 0.10000000149011612, 0.10000000149011612], [0.16249999403953552, 0.012500000186264515, 0.20000000298023224, 0.20000000298023224], [0.1875, 0.012500000186264515, 0.10000000149011612, 0.10000000149011612], [0.1875, 0.012500000186264515, 0.20000000298023224, 0.20000000298023224], [0.21250000596046448, 0.012500000186264515, 0.10000000149011612, 0.10000000149011612], [0.21250000596046448, 0.012500000186264515, 0.20000000298023224, 0.20000000298023224], [0.23749999701976776, 0.012500000186264515, 0.10000000149011612, 0.10000000149011612], [0.23749999701976776, 0.012500000186264515, 0.20000000298023224, 0.20000000298023224], [0.26249998807907104, 0.012500000186264515, 0.10000000149011612, 0.10000000149011612], [0.26249998807907104, 0.012500000186264515, 0.20000000298023224, 0.20000000298023224], [0.2874999940395355, 0.012500000186264515, 0.10000000149011612, 0.10000000149011612], [0.2874999940395355, 0.012500000186264515, 0.20000000298023224, 0.20000000298023224], [0.3125, 0.012500000186264515, 0.10000000149011612, 0.10000000149011612], [0.3125, 0.012500000186264515, 0.20000000298023224, 0.20000000298023224], [0.3375000059604645, 0.012500000186264515, 0.10000000149011612, 0.10000000149011612], [0.3375000059604645, 0.012500000186264515, 0.20000000298023224, 0.20000000298023224], [0.36250001192092896, 0.012500000186264515, 0.10000000149011612, 0.10000000149011612], [0.36250001192092896, 0.012500000186264515, 0.20000000298023224, 0.20000000298023224], [0.38749998807907104, 0.012500000186264515, 0.10000000149011612, 0.10000000149011612], [0.38749998807907104, 0.012500000186264515, 0.20000000298023224, 0.20000000298023224], [0.4124999940395355, 0.012500000186264515, 0.10000000149011612, 0.10000000149011612], [0.4124999940395355, 0.012500000186264515, 0.20000000298023224, 0.20000000298023224], [0.4375, 0.012500000186264515, 0.10000000149011612, 0.10000000149011612], [0.4375, 0.012500000186264515, 0.20000000298023224, 0.20000000298023224], [0.4625000059604645, 0.012500000186264515, 0.10000000149011612, 0.10000000149011612], [0.4625000059604645, 0.012500000186264515, 0.20000000298023224, 0.20000000298023224], [0.48750001192092896, 0.012500000186264515, 0.10000000149011612, 0.10000000149011612], [0.48750001192092896, 0.012500000186264515, 0.20000000298023224, 0.20000000298023224], [0.512499988079071, 0.012500000186264515, 0.10000000149011612, 0.10000000149011612], [0.512499988079071, 0.012500000186264515, 0.20000000298023224, 0.20000000298023224], [0.5375000238418579, 0.012500000186264515, 0.10000000149011612, 0.10000000149011612], [0.5375000238418579, 0.012500000186264515, 0.20000000298023224, 0.20000000298023224], [0.5625, 0.012500000186264515, 0.10000000149011612, 0.10000000149011612], [0.5625, 0.012500000186264515, 0.20000000298023224, 0.20000000298023224], [0.5874999761581421, 0.012500000186264515, 0.10000000149011612, 0.10000000149011612], [0.5874999761581421, 0.012500000186264515, 0.20000000298023224, 0.20000000298023224], [0.612500011920929, 0.012500000186264515, 0.10000000149011612, 0.10000000149011612], [0.612500011920929, 0.012500000186264515, 0.20000000298023224, 0.20000000298023224], [0.637499988079071, 0.012500000186264515, 0.10000000149011612, 0.10000000149011612], [0.637499988079071, 0.012500000186264515, 0.20000000298023224, 0.20000000298023224], [0.6625000238418579, 0.012500000186264515, 0.10000000149011612, 0.10000000149011612], [0.6625000238418579, 0.012500000186264515, 0.20000000298023224, 0.20000000298023224], [0.6875, 0.012500000186264515, 0.10000000149011612, 0.10000000149011612], [0.6875, 0.012500000186264515, 0.20000000298023224, 0.20000000298023224], [0.7124999761581421, 0.012500000186264515, 0.10000000149011612, 0.10000000149011612], [0.7124999761581421, 0.012500000186264515, 0.20000000298023224, 0.20000000298023224], [0.737500011920929, 0.012500000186264515, 0.10000000149011612, 0.10000000149011612], [0.737500011920929, 0.012500000186264515, 0.20000000298023224, 0.20000000298023224], [0.762499988079071, 0.012500000186264515, 0.10000000149011612, 0.10000000149011612], [0.762499988079071, 0.012500000186264515, 0.20000000298023224, 0.20000000298023224], [0.7875000238418579, 0.012500000186264515, 0.10000000149011612, 0.10000000149011612], [0.7875000238418579, 0.012500000186264515, 0.20000000298023224, 0.20000000298023224], [0.8125, 0.012500000186264515, 0.10000000149011612, 0.10000000149011612], [0.8125, 0.012500000186264515, 0.20000000298023224, 0.20000000298023224], [0.8374999761581421, 0.012500000186264515, 0.10000000149011612, 0.10000000149011612], [0.8374999761581421, 0.012500000186264515, 0.20000000298023224, 0.20000000298023224], [0.862500011920929, 0.012500000186264515, 0.10000000149011612, 0.10000000149011612], [0.862500011920929, 0.012500000186264515, 0.20000000298023224, 0.20000000298023224], [0.887499988079071, 0.012500000186264515, 0.10000000149011612, 0.10000000149011612], [0.887499988079071, 0.012500000186264515, 0.20000000298023224, 0.20000000298023224], [0.9125000238418579, 0.012500000186264515, 0.10000000149011612, 0.10000000149011612], [0.9125000238418579, 0.012500000186264515, 0.20000000298023224, 0.20000000298023224], [0.9375, 0.012500000186264515, 0.10000000149011612, 0.10000000149011612], [0.9375, 0.012500000186264515, 0.20000000298023224, 0.20000000298023224], [0.9624999761581421, 0.012500000186264515, 0.10000000149011612, 0.10000000149011612], [0.9624999761581421, 0.012500000186264515, 0.20000000298023224, 0.20000000298023224], [0.987500011920929, 0.012500000186264515, 0.10000000149011612, 0.10000000149011612], [0.987500011920929, 0.012500000186264515, 0.20000000298023224, 0.20000000298023224], [0.012500000186264515, 0.03750000149011612, 0.10000000149011612, 0.10000000149011612], [0.012500000186264515, 0.03750000149011612, 0.20000000298023224, 0.20000000298023224], [0.03750000149011612, 0.03750000149011612, 0.10000000149011612, 0.10000000149011612], [0.03750000149011612, 0.03750000149011612, 0.20000000298023224, 0.20000000298023224], [0.0625, 0.03750000149011612, 0.10000000149011612, 0.10000000149011612], [0.0625, 0.03750000149011612, 0.20000000298023224, 0.20000000298023224], [0.08749999850988388, 0.03750000149011612, 0.10000000149011612, 0.10000000149011612], [0.08749999850988388, 0.03750000149011612, 0.20000000298023224, 0.20000000298023224], [0.11249999701976776, 0.03750000149011612, 0.10000000149011612, 0.10000000149011612], [0.11249999701976776, 0.03750000149011612, 0.20000000298023224, 0.20000000298023224], [0.13750000298023224, 0.03750000149011612, 0.10000000149011612, 0.10000000149011612], [0.13750000298023224, 0.03750000149011612, 0.20000000298023224, 0.20000000298023224], [0.16249999403953552, 0.03750000149011612, 0.10000000149011612, 0.10000000149011612], [0.16249999403953552, 0.03750000149011612, 0.20000000298023224, 0.20000000298023224], [0.1875, 0.03750000149011612, 0.10000000149011612, 0.10000000149011612], [0.1875, 0.03750000149011612, 0.20000000298023224, 0.20000000298023224], [0.21250000596046448, 0.03750000149011612, 0.10000000149011612, 0.10000000149011612], [0.21250000596046448, 0.03750000149011612, 0.20000000298023224, 0.20000000298023224], [0.23749999701976776, 0.03750000149011612, 0.10000000149011612, 0.10000000149011612], [0.23749999701976776, 0.03750000149011612, 0.20000000298023224, 0.20000000298023224], [0.26249998807907104, 0.03750000149011612, 0.10000000149011612, 0.10000000149011612], [0.26249998807907104, 0.03750000149011612, 0.20000000298023224, 0.20000000298023224], [0.2874999940395355, 0.03750000149011612, 0.10000000149011612, 0.10000000149011612], [0.2874999940395355, 0.03750000149011612, 0.20000000298023224, 0.20000000298023224], [0.3125, 0.03750000149011612, 0.10000000149011612, 0.10000000149011612], [0.3125, 0.03750000149011612, 0.20000000298023224, 0.20000000298023224], [0.3375000059604645, 0.03750000149011612, 0.10000000149011612, 0.10000000149011612], [0.3375000059604645, 0.03750000149011612, 0.20000000298023224, 0.20000000298023224], [0.36250001192092896, 0.03750000149011612, 0.10000000149011612, 0.10000000149011612], [0.36250001192092896, 0.03750000149011612, 0.20000000298023224, 0.20000000298023224], [0.38749998807907104, 0.03750000149011612, 0.10000000149011612, 0.10000000149011612], [0.38749998807907104, 0.03750000149011612, 0.20000000298023224, 0.20000000298023224], [0.4124999940395355, 0.03750000149011612, 0.10000000149011612, 0.10000000149011612], [0.4124999940395355, 0.03750000149011612, 0.20000000298023224, 0.20000000298023224], [0.4375, 0.03750000149011612, 0.10000000149011612, 0.10000000149011612], [0.4375, 0.03750000149011612, 0.20000000298023224, 0.20000000298023224], [0.4625000059604645, 0.03750000149011612, 0.10000000149011612, 0.10000000149011612], [0.4625000059604645, 0.03750000149011612, 0.20000000298023224, 0.20000000298023224], [0.48750001192092896, 0.03750000149011612, 0.10000000149011612, 0.10000000149011612], [0.48750001192092896, 0.03750000149011612, 0.20000000298023224, 0.20000000298023224], [0.512499988079071, 0.03750000149011612, 0.10000000149011612, 0.10000000149011612], [0.512499988079071, 0.03750000149011612, 0.20000000298023224, 0.20000000298023224], [0.5375000238418579, 0.03750000149011612, 0.10000000149011612, 0.10000000149011612], [0.5375000238418579, 0.03750000149011612, 0.20000000298023224, 0.20000000298023224], [0.5625, 0.03750000149011612, 0.10000000149011612, 0.10000000149011612], [0.5625, 0.03750000149011612, 0.20000000298023224, 0.20000000298023224], [0.5874999761581421, 0.03750000149011612, 0.10000000149011612, 0.10000000149011612], [0.5874999761581421, 0.03750000149011612, 0.20000000298023224, 0.20000000298023224], [0.612500011920929, 0.03750000149011612, 0.10000000149011612, 0.10000000149011612], [0.612500011920929, 0.03750000149011612, 0.20000000298023224, 0.20000000298023224], [0.637499988079071, 0.03750000149011612, 0.10000000149011612, 0.10000000149011612], [0.637499988079071, 0.03750000149011612, 0.20000000298023224, 0.20000000298023224], [0.6625000238418579, 0.03750000149011612, 0.10000000149011612, 0.10000000149011612], [0.6625000238418579, 0.03750000149011612, 0.20000000298023224, 0.20000000298023224], [0.6875, 0.03750000149011612, 0.10000000149011612, 0.10000000149011612], [0.6875, 0.03750000149011612, 0.20000000298023224, 0.20000000298023224], [0.7124999761581421, 0.03750000149011612, 0.10000000149011612, 0.10000000149011612], [0.7124999761581421, 0.03750000149011612, 0.20000000298023224, 0.20000000298023224], [0.737500011920929, 0.03750000149011612, 0.10000000149011612, 0.10000000149011612], [0.737500011920929, 0.03750000149011612, 0.20000000298023224, 0.20000000298023224], [0.762499988079071, 0.03750000149011612, 0.10000000149011612, 0.10000000149011612], [0.762499988079071, 0.03750000149011612, 0.20000000298023224, 0.20000000298023224], [0.7875000238418579, 0.03750000149011612, 0.10000000149011612, 0.10000000149011612], [0.7875000238418579, 0.03750000149011612, 0.20000000298023224, 0.20000000298023224], [0.8125, 0.03750000149011612, 0.10000000149011612, 0.10000000149011612], [0.8125, 0.03750000149011612, 0.20000000298023224, 0.20000000298023224], [0.8374999761581421, 0.03750000149011612, 0.10000000149011612, 0.10000000149011612], [0.8374999761581421, 0.03750000149011612, 0.20000000298023224, 0.20000000298023224], [0.862500011920929, 0.03750000149011612, 0.10000000149011612, 0.10000000149011612], [0.862500011920929, 0.03750000149011612, 0.20000000298023224, 0.20000000298023224], [0.887499988079071, 0.03750000149011612, 0.10000000149011612, 0.10000000149011612], [0.887499988079071, 0.03750000149011612, 0.20000000298023224, 0.20000000298023224], [0.9125000238418579, 0.03750000149011612, 0.10000000149011612, 0.10000000149011612], [0.9125000238418579, 0.03750000149011612, 0.20000000298023224, 0.20000000298023224], [0.9375, 0.03750000149011612, 0.10000000149011612, 0.10000000149011612], [0.9375, 0.03750000149011612, 0.20000000298023224, 0.20000000298023224], [0.9624999761581421, 0.03750000149011612, 0.10000000149011612, 0.10000000149011612], [0.9624999761581421, 0.03750000149011612, 0.20000000298023224, 0.20000000298023224], [0.987500011920929, 0.03750000149011612, 0.10000000149011612, 0.10000000149011612], [0.987500011920929, 0.03750000149011612, 0.20000000298023224, 0.20000000298023224], [0.012500000186264515, 0.0625, 0.10000000149011612, 0.10000000149011612], [0.012500000186264515, 0.0625, 0.20000000298023224, 0.20000000298023224], [0.03750000149011612, 0.0625, 0.10000000149011612, 0.10000000149011612], [0.03750000149011612, 0.0625, 0.20000000298023224, 0.20000000298023224], [0.0625, 0.0625, 0.10000000149011612, 0.10000000149011612], [0.0625, 0.0625, 0.20000000298023224, 0.20000000298023224], [0.08749999850988388, 0.0625, 0.10000000149011612, 0.10000000149011612], [0.08749999850988388, 0.0625, 0.20000000298023224, 0.20000000298023224], [0.11249999701976776, 0.0625, 0.10000000149011612, 0.10000000149011612], [0.11249999701976776, 0.0625, 0.20000000298023224, 0.20000000298023224], [0.13750000298023224, 0.0625, 0.10000000149011612, 0.10000000149011612], [0.13750000298023224, 0.0625, 0.20000000298023224, 0.20000000298023224], [0.16249999403953552, 0.0625, 0.10000000149011612, 0.10000000149011612], [0.16249999403953552, 0.0625, 0.20000000298023224, 0.20000000298023224], [0.1875, 0.0625, 0.10000000149011612, 0.10000000149011612], [0.1875, 0.0625, 0.20000000298023224, 0.20000000298023224], [0.21250000596046448, 0.0625, 0.10000000149011612, 0.10000000149011612], [0.21250000596046448, 0.0625, 0.20000000298023224, 0.20000000298023224], [0.23749999701976776, 0.0625, 0.10000000149011612, 0.10000000149011612], [0.23749999701976776, 0.0625, 0.20000000298023224, 0.20000000298023224], [0.26249998807907104, 0.0625, 0.10000000149011612, 0.10000000149011612], [0.26249998807907104, 0.0625, 0.20000000298023224, 0.20000000298023224], [0.2874999940395355, 0.0625, 0.10000000149011612, 0.10000000149011612], [0.2874999940395355, 0.0625, 0.20000000298023224, 0.20000000298023224], [0.3125, 0.0625, 0.10000000149011612, 0.10000000149011612], [0.3125, 0.0625, 0.20000000298023224, 0.20000000298023224], [0.3375000059604645, 0.0625, 0.10000000149011612, 0.10000000149011612], [0.3375000059604645, 0.0625, 0.20000000298023224, 0.20000000298023224], [0.36250001192092896, 0.0625, 0.10000000149011612, 0.10000000149011612], [0.36250001192092896, 0.0625, 0.20000000298023224, 0.20000000298023224], [0.38749998807907104, 0.0625, 0.10000000149011612, 0.10000000149011612], [0.38749998807907104, 0.0625, 0.20000000298023224, 0.20000000298023224], [0.4124999940395355, 0.0625, 0.10000000149011612, 0.10000000149011612], [0.4124999940395355, 0.0625, 0.20000000298023224, 0.20000000298023224], [0.4375, 0.0625, 0.10000000149011612, 0.10000000149011612], [0.4375, 0.0625, 0.20000000298023224, 0.20000000298023224], [0.4625000059604645, 0.0625, 0.10000000149011612, 0.10000000149011612], [0.4625000059604645, 0.0625, 0.20000000298023224, 0.20000000298023224], [0.48750001192092896, 0.0625, 0.10000000149011612, 0.10000000149011612], [0.48750001192092896, 0.0625, 0.20000000298023224, 0.20000000298023224], [0.512499988079071, 0.0625, 0.10000000149011612, 0.10000000149011612], [0.512499988079071, 0.0625, 0.20000000298023224, 0.20000000298023224], [0.5375000238418579, 0.0625, 0.10000000149011612, 0.10000000149011612], [0.5375000238418579, 0.0625, 0.20000000298023224, 0.20000000298023224], [0.5625, 0.0625, 0.10000000149011612, 0.10000000149011612], [0.5625, 0.0625, 0.20000000298023224, 0.20000000298023224], [0.5874999761581421, 0.0625, 0.10000000149011612, 0.10000000149011612], [0.5874999761581421, 0.0625, 0.20000000298023224, 0.20000000298023224], [0.612500011920929, 0.0625, 0.10000000149011612, 0.10000000149011612], [0.612500011920929, 0.0625, 0.20000000298023224, 0.20000000298023224], [0.637499988079071, 0.0625, 0.10000000149011612, 0.10000000149011612], [0.637499988079071, 0.0625, 0.20000000298023224, 0.20000000298023224], [0.6625000238418579, 0.0625, 0.10000000149011612, 0.10000000149011612], [0.6625000238418579, 0.0625, 0.20000000298023224, 0.20000000298023224], [0.6875, 0.0625, 0.10000000149011612, 0.10000000149011612], [0.6875, 0.0625, 0.20000000298023224, 0.20000000298023224], [0.7124999761581421, 0.0625, 0.10000000149011612, 0.10000000149011612], [0.7124999761581421, 0.0625, 0.20000000298023224, 0.20000000298023224], [0.737500011920929, 0.0625, 0.10000000149011612, 0.10000000149011612], [0.737500011920929, 0.0625, 0.20000000298023224, 0.20000000298023224], [0.762499988079071, 0.0625, 0.10000000149011612, 0.10000000149011612], [0.762499988079071, 0.0625, 0.20000000298023224, 0.20000000298023224], [0.7875000238418579, 0.0625, 0.10000000149011612, 0.10000000149011612], [0.7875000238418579, 0.0625, 0.20000000298023224, 0.20000000298023224], [0.8125, 0.0625, 0.10000000149011612, 0.10000000149011612], [0.8125, 0.0625, 0.20000000298023224, 0.20000000298023224], [0.8374999761581421, 0.0625, 0.10000000149011612, 0.10000000149011612], [0.8374999761581421, 0.0625, 0.20000000298023224, 0.20000000298023224], [0.862500011920929, 0.0625, 0.10000000149011612, 0.10000000149011612], [0.862500011920929, 0.0625, 0.20000000298023224, 0.20000000298023224], [0.887499988079071, 0.0625, 0.10000000149011612, 0.10000000149011612], [0.887499988079071, 0.0625, 0.20000000298023224, 0.20000000298023224], [0.9125000238418579, 0.0625, 0.10000000149011612, 0.10000000149011612], [0.9125000238418579, 0.0625, 0.20000000298023224, 0.20000000298023224], [0.9375, 0.0625, 0.10000000149011612, 0.10000000149011612], [0.9375, 0.0625, 0.20000000298023224, 0.20000000298023224], [0.9624999761581421, 0.0625, 0.10000000149011612, 0.10000000149011612], [0.9624999761581421, 0.0625, 0.20000000298023224, 0.20000000298023224], [0.987500011920929, 0.0625, 0.10000000149011612, 0.10000000149011612], [0.987500011920929, 0.0625, 0.20000000298023224, 0.20000000298023224], [0.012500000186264515, 0.08749999850988388, 0.10000000149011612, 0.10000000149011612], [0.012500000186264515, 0.08749999850988388, 0.20000000298023224, 0.20000000298023224], [0.03750000149011612, 0.08749999850988388, 0.10000000149011612, 0.10000000149011612], [0.03750000149011612, 0.08749999850988388, 0.20000000298023224, 0.20000000298023224], [0.0625, 0.08749999850988388, 0.10000000149011612, 0.10000000149011612], [0.0625, 0.08749999850988388, 0.20000000298023224, 0.20000000298023224], [0.08749999850988388, 0.08749999850988388, 0.10000000149011612, 0.10000000149011612], [0.08749999850988388, 0.08749999850988388, 0.20000000298023224, 0.20000000298023224], [0.11249999701976776, 0.08749999850988388, 0.10000000149011612, 0.10000000149011612], [0.11249999701976776, 0.08749999850988388, 0.20000000298023224, 0.20000000298023224], [0.13750000298023224, 0.08749999850988388, 0.10000000149011612, 0.10000000149011612], [0.13750000298023224, 0.08749999850988388, 0.20000000298023224, 0.20000000298023224], [0.16249999403953552, 0.08749999850988388, 0.10000000149011612, 0.10000000149011612], [0.16249999403953552, 0.08749999850988388, 0.20000000298023224, 0.20000000298023224], [0.1875, 0.08749999850988388, 0.10000000149011612, 0.10000000149011612], [0.1875, 0.08749999850988388, 0.20000000298023224, 0.20000000298023224], [0.21250000596046448, 0.08749999850988388, 0.10000000149011612, 0.10000000149011612], [0.21250000596046448, 0.08749999850988388, 0.20000000298023224, 0.20000000298023224], [0.23749999701976776, 0.08749999850988388, 0.10000000149011612, 0.10000000149011612], [0.23749999701976776, 0.08749999850988388, 0.20000000298023224, 0.20000000298023224], [0.26249998807907104, 0.08749999850988388, 0.10000000149011612, 0.10000000149011612], [0.26249998807907104, 0.08749999850988388, 0.20000000298023224, 0.20000000298023224], [0.2874999940395355, 0.08749999850988388, 0.10000000149011612, 0.10000000149011612], [0.2874999940395355, 0.08749999850988388, 0.20000000298023224, 0.20000000298023224], [0.3125, 0.08749999850988388, 0.10000000149011612, 0.10000000149011612], [0.3125, 0.08749999850988388, 0.20000000298023224, 0.20000000298023224], [0.3375000059604645, 0.08749999850988388, 0.10000000149011612, 0.10000000149011612], [0.3375000059604645, 0.08749999850988388, 0.20000000298023224, 0.20000000298023224], [0.36250001192092896, 0.08749999850988388, 0.10000000149011612, 0.10000000149011612], [0.36250001192092896, 0.08749999850988388, 0.20000000298023224, 0.20000000298023224], [0.38749998807907104, 0.08749999850988388, 0.10000000149011612, 0.10000000149011612], [0.38749998807907104, 0.08749999850988388, 0.20000000298023224, 0.20000000298023224], [0.4124999940395355, 0.08749999850988388, 0.10000000149011612, 0.10000000149011612], [0.4124999940395355, 0.08749999850988388, 0.20000000298023224, 0.20000000298023224], [0.4375, 0.08749999850988388, 0.10000000149011612, 0.10000000149011612], [0.4375, 0.08749999850988388, 0.20000000298023224, 0.20000000298023224], [0.4625000059604645, 0.08749999850988388, 0.10000000149011612, 0.10000000149011612], [0.4625000059604645, 0.08749999850988388, 0.20000000298023224, 0.20000000298023224], [0.48750001192092896, 0.08749999850988388, 0.10000000149011612, 0.10000000149011612], [0.48750001192092896, 0.08749999850988388, 0.20000000298023224, 0.20000000298023224], [0.512499988079071, 0.08749999850988388, 0.10000000149011612, 0.10000000149011612], [0.512499988079071, 0.08749999850988388, 0.20000000298023224, 0.20000000298023224], [0.5375000238418579, 0.08749999850988388, 0.10000000149011612, 0.10000000149011612], [0.5375000238418579, 0.08749999850988388, 0.20000000298023224, 0.20000000298023224], [0.5625, 0.08749999850988388, 0.10000000149011612, 0.10000000149011612], [0.5625, 0.08749999850988388, 0.20000000298023224, 0.20000000298023224], [0.5874999761581421, 0.08749999850988388, 0.10000000149011612, 0.10000000149011612], [0.5874999761581421, 0.08749999850988388, 0.20000000298023224, 0.20000000298023224], [0.612500011920929, 0.08749999850988388, 0.10000000149011612, 0.10000000149011612], [0.612500011920929, 0.08749999850988388, 0.20000000298023224, 0.20000000298023224], [0.637499988079071, 0.08749999850988388, 0.10000000149011612, 0.10000000149011612], [0.637499988079071, 0.08749999850988388, 0.20000000298023224, 0.20000000298023224], [0.6625000238418579, 0.08749999850988388, 0.10000000149011612, 0.10000000149011612], [0.6625000238418579, 0.08749999850988388, 0.20000000298023224, 0.20000000298023224], [0.6875, 0.08749999850988388, 0.10000000149011612, 0.10000000149011612], [0.6875, 0.08749999850988388, 0.20000000298023224, 0.20000000298023224], [0.7124999761581421, 0.08749999850988388, 0.10000000149011612, 0.10000000149011612], [0.7124999761581421, 0.08749999850988388, 0.20000000298023224, 0.20000000298023224], [0.737500011920929, 0.08749999850988388, 0.10000000149011612, 0.10000000149011612], [0.737500011920929, 0.08749999850988388, 0.20000000298023224, 0.20000000298023224], [0.762499988079071, 0.08749999850988388, 0.10000000149011612, 0.10000000149011612], [0.762499988079071, 0.08749999850988388, 0.20000000298023224, 0.20000000298023224], [0.7875000238418579, 0.08749999850988388, 0.10000000149011612, 0.10000000149011612], [0.7875000238418579, 0.08749999850988388, 0.20000000298023224, 0.20000000298023224], [0.8125, 0.08749999850988388, 0.10000000149011612, 0.10000000149011612], [0.8125, 0.08749999850988388, 0.20000000298023224, 0.20000000298023224], [0.8374999761581421, 0.08749999850988388, 0.10000000149011612, 0.10000000149011612], [0.8374999761581421, 0.08749999850988388, 0.20000000298023224, 0.20000000298023224], [0.862500011920929, 0.08749999850988388, 0.10000000149011612, 0.10000000149011612], [0.862500011920929, 0.08749999850988388, 0.20000000298023224, 0.20000000298023224], [0.887499988079071, 0.08749999850988388, 0.10000000149011612, 0.10000000149011612], [0.887499988079071, 0.08749999850988388, 0.20000000298023224, 0.20000000298023224], [0.9125000238418579, 0.08749999850988388, 0.10000000149011612, 0.10000000149011612], [0.9125000238418579, 0.08749999850988388, 0.20000000298023224, 0.20000000298023224], [0.9375, 0.08749999850988388, 0.10000000149011612, 0.10000000149011612], [0.9375, 0.08749999850988388, 0.20000000298023224, 0.20000000298023224], [0.9624999761581421, 0.08749999850988388, 0.10000000149011612, 0.10000000149011612], [0.9624999761581421, 0.08749999850988388, 0.20000000298023224, 0.20000000298023224], [0.987500011920929, 0.08749999850988388, 0.10000000149011612, 0.10000000149011612], [0.987500011920929, 0.08749999850988388, 0.20000000298023224, 0.20000000298023224], [0.012500000186264515, 0.11249999701976776, 0.10000000149011612, 0.10000000149011612], [0.012500000186264515, 0.11249999701976776, 0.20000000298023224, 0.20000000298023224], [0.03750000149011612, 0.11249999701976776, 0.10000000149011612, 0.10000000149011612], [0.03750000149011612, 0.11249999701976776, 0.20000000298023224, 0.20000000298023224], [0.0625, 0.11249999701976776, 0.10000000149011612, 0.10000000149011612], [0.0625, 0.11249999701976776, 0.20000000298023224, 0.20000000298023224], [0.08749999850988388, 0.11249999701976776, 0.10000000149011612, 0.10000000149011612], [0.08749999850988388, 0.11249999701976776, 0.20000000298023224, 0.20000000298023224], [0.11249999701976776, 0.11249999701976776, 0.10000000149011612, 0.10000000149011612], [0.11249999701976776, 0.11249999701976776, 0.20000000298023224, 0.20000000298023224], [0.13750000298023224, 0.11249999701976776, 0.10000000149011612, 0.10000000149011612], [0.13750000298023224, 0.11249999701976776, 0.20000000298023224, 0.20000000298023224], [0.16249999403953552, 0.11249999701976776, 0.10000000149011612, 0.10000000149011612], [0.16249999403953552, 0.11249999701976776, 0.20000000298023224, 0.20000000298023224], [0.1875, 0.11249999701976776, 0.10000000149011612, 0.10000000149011612], [0.1875, 0.11249999701976776, 0.20000000298023224, 0.20000000298023224], [0.21250000596046448, 0.11249999701976776, 0.10000000149011612, 0.10000000149011612], [0.21250000596046448, 0.11249999701976776, 0.20000000298023224, 0.20000000298023224], [0.23749999701976776, 0.11249999701976776, 0.10000000149011612, 0.10000000149011612], [0.23749999701976776, 0.11249999701976776, 0.20000000298023224, 0.20000000298023224], [0.26249998807907104, 0.11249999701976776, 0.10000000149011612, 0.10000000149011612], [0.26249998807907104, 0.11249999701976776, 0.20000000298023224, 0.20000000298023224], [0.2874999940395355, 0.11249999701976776, 0.10000000149011612, 0.10000000149011612], [0.2874999940395355, 0.11249999701976776, 0.20000000298023224, 0.20000000298023224], [0.3125, 0.11249999701976776, 0.10000000149011612, 0.10000000149011612], [0.3125, 0.11249999701976776, 0.20000000298023224, 0.20000000298023224], [0.3375000059604645, 0.11249999701976776, 0.10000000149011612, 0.10000000149011612], [0.3375000059604645, 0.11249999701976776, 0.20000000298023224, 0.20000000298023224], [0.36250001192092896, 0.11249999701976776, 0.10000000149011612, 0.10000000149011612], [0.36250001192092896, 0.11249999701976776, 0.20000000298023224, 0.20000000298023224], [0.38749998807907104, 0.11249999701976776, 0.10000000149011612, 0.10000000149011612], [0.38749998807907104, 0.11249999701976776, 0.20000000298023224, 0.20000000298023224], [0.4124999940395355, 0.11249999701976776, 0.10000000149011612, 0.10000000149011612], [0.4124999940395355, 0.11249999701976776, 0.20000000298023224, 0.20000000298023224], [0.4375, 0.11249999701976776, 0.10000000149011612, 0.10000000149011612], [0.4375, 0.11249999701976776, 0.20000000298023224, 0.20000000298023224], [0.4625000059604645, 0.11249999701976776, 0.10000000149011612, 0.10000000149011612], [0.4625000059604645, 0.11249999701976776, 0.20000000298023224, 0.20000000298023224], [0.48750001192092896, 0.11249999701976776, 0.10000000149011612, 0.10000000149011612], [0.48750001192092896, 0.11249999701976776, 0.20000000298023224, 0.20000000298023224], [0.512499988079071, 0.11249999701976776, 0.10000000149011612, 0.10000000149011612], [0.512499988079071, 0.11249999701976776, 0.20000000298023224, 0.20000000298023224], [0.5375000238418579, 0.11249999701976776, 0.10000000149011612, 0.10000000149011612], [0.5375000238418579, 0.11249999701976776, 0.20000000298023224, 0.20000000298023224], [0.5625, 0.11249999701976776, 0.10000000149011612, 0.10000000149011612], [0.5625, 0.11249999701976776, 0.20000000298023224, 0.20000000298023224], [0.5874999761581421, 0.11249999701976776, 0.10000000149011612, 0.10000000149011612], [0.5874999761581421, 0.11249999701976776, 0.20000000298023224, 0.20000000298023224], [0.612500011920929, 0.11249999701976776, 0.10000000149011612, 0.10000000149011612], [0.612500011920929, 0.11249999701976776, 0.20000000298023224, 0.20000000298023224], [0.637499988079071, 0.11249999701976776, 0.10000000149011612, 0.10000000149011612], [0.637499988079071, 0.11249999701976776, 0.20000000298023224, 0.20000000298023224], [0.6625000238418579, 0.11249999701976776, 0.10000000149011612, 0.10000000149011612], [0.6625000238418579, 0.11249999701976776, 0.20000000298023224, 0.20000000298023224], [0.6875, 0.11249999701976776, 0.10000000149011612, 0.10000000149011612], [0.6875, 0.11249999701976776, 0.20000000298023224, 0.20000000298023224], [0.7124999761581421, 0.11249999701976776, 0.10000000149011612, 0.10000000149011612], [0.7124999761581421, 0.11249999701976776, 0.20000000298023224, 0.20000000298023224], [0.737500011920929, 0.11249999701976776, 0.10000000149011612, 0.10000000149011612], [0.737500011920929, 0.11249999701976776, 0.20000000298023224, 0.20000000298023224], [0.762499988079071, 0.11249999701976776, 0.10000000149011612, 0.10000000149011612], [0.762499988079071, 0.11249999701976776, 0.20000000298023224, 0.20000000298023224], [0.7875000238418579, 0.11249999701976776, 0.10000000149011612, 0.10000000149011612], [0.7875000238418579, 0.11249999701976776, 0.20000000298023224, 0.20000000298023224], [0.8125, 0.11249999701976776, 0.10000000149011612, 0.10000000149011612], [0.8125, 0.11249999701976776, 0.20000000298023224, 0.20000000298023224], [0.8374999761581421, 0.11249999701976776, 0.10000000149011612, 0.10000000149011612], [0.8374999761581421, 0.11249999701976776, 0.20000000298023224, 0.20000000298023224], [0.862500011920929, 0.11249999701976776, 0.10000000149011612, 0.10000000149011612], [0.862500011920929, 0.11249999701976776, 0.20000000298023224, 0.20000000298023224], [0.887499988079071, 0.11249999701976776, 0.10000000149011612, 0.10000000149011612], [0.887499988079071, 0.11249999701976776, 0.20000000298023224, 0.20000000298023224], [0.9125000238418579, 0.11249999701976776, 0.10000000149011612, 0.10000000149011612], [0.9125000238418579, 0.11249999701976776, 0.20000000298023224, 0.20000000298023224], [0.9375, 0.11249999701976776, 0.10000000149011612, 0.10000000149011612], [0.9375, 0.11249999701976776, 0.20000000298023224, 0.20000000298023224], [0.9624999761581421, 0.11249999701976776, 0.10000000149011612, 0.10000000149011612], [0.9624999761581421, 0.11249999701976776, 0.20000000298023224, 0.20000000298023224], [0.987500011920929, 0.11249999701976776, 0.10000000149011612, 0.10000000149011612], [0.987500011920929, 0.11249999701976776, 0.20000000298023224, 0.20000000298023224], [0.012500000186264515, 0.13750000298023224, 0.10000000149011612, 0.10000000149011612], [0.012500000186264515, 0.13750000298023224, 0.20000000298023224, 0.20000000298023224], [0.03750000149011612, 0.13750000298023224, 0.10000000149011612, 0.10000000149011612], [0.03750000149011612, 0.13750000298023224, 0.20000000298023224, 0.20000000298023224], [0.0625, 0.13750000298023224, 0.10000000149011612, 0.10000000149011612], [0.0625, 0.13750000298023224, 0.20000000298023224, 0.20000000298023224], [0.08749999850988388, 0.13750000298023224, 0.10000000149011612, 0.10000000149011612], [0.08749999850988388, 0.13750000298023224, 0.20000000298023224, 0.20000000298023224], [0.11249999701976776, 0.13750000298023224, 0.10000000149011612, 0.10000000149011612], [0.11249999701976776, 0.13750000298023224, 0.20000000298023224, 0.20000000298023224], [0.13750000298023224, 0.13750000298023224, 0.10000000149011612, 0.10000000149011612], [0.13750000298023224, 0.13750000298023224, 0.20000000298023224, 0.20000000298023224], [0.16249999403953552, 0.13750000298023224, 0.10000000149011612, 0.10000000149011612], [0.16249999403953552, 0.13750000298023224, 0.20000000298023224, 0.20000000298023224], [0.1875, 0.13750000298023224, 0.10000000149011612, 0.10000000149011612], [0.1875, 0.13750000298023224, 0.20000000298023224, 0.20000000298023224], [0.21250000596046448, 0.13750000298023224, 0.10000000149011612, 0.10000000149011612], [0.21250000596046448, 0.13750000298023224, 0.20000000298023224, 0.20000000298023224], [0.23749999701976776, 0.13750000298023224, 0.10000000149011612, 0.10000000149011612], [0.23749999701976776, 0.13750000298023224, 0.20000000298023224, 0.20000000298023224], [0.26249998807907104, 0.13750000298023224, 0.10000000149011612, 0.10000000149011612], [0.26249998807907104, 0.13750000298023224, 0.20000000298023224, 0.20000000298023224], [0.2874999940395355, 0.13750000298023224, 0.10000000149011612, 0.10000000149011612], [0.2874999940395355, 0.13750000298023224, 0.20000000298023224, 0.20000000298023224], [0.3125, 0.13750000298023224, 0.10000000149011612, 0.10000000149011612], [0.3125, 0.13750000298023224, 0.20000000298023224, 0.20000000298023224], [0.3375000059604645, 0.13750000298023224, 0.10000000149011612, 0.10000000149011612], [0.3375000059604645, 0.13750000298023224, 0.20000000298023224, 0.20000000298023224], [0.36250001192092896, 0.13750000298023224, 0.10000000149011612, 0.10000000149011612], [0.36250001192092896, 0.13750000298023224, 0.20000000298023224, 0.20000000298023224], [0.38749998807907104, 0.13750000298023224, 0.10000000149011612, 0.10000000149011612], [0.38749998807907104, 0.13750000298023224, 0.20000000298023224, 0.20000000298023224], [0.4124999940395355, 0.13750000298023224, 0.10000000149011612, 0.10000000149011612], [0.4124999940395355, 0.13750000298023224, 0.20000000298023224, 0.20000000298023224], [0.4375, 0.13750000298023224, 0.10000000149011612, 0.10000000149011612], [0.4375, 0.13750000298023224, 0.20000000298023224, 0.20000000298023224], [0.4625000059604645, 0.13750000298023224, 0.10000000149011612, 0.10000000149011612], [0.4625000059604645, 0.13750000298023224, 0.20000000298023224, 0.20000000298023224], [0.48750001192092896, 0.13750000298023224, 0.10000000149011612, 0.10000000149011612], [0.48750001192092896, 0.13750000298023224, 0.20000000298023224, 0.20000000298023224], [0.512499988079071, 0.13750000298023224, 0.10000000149011612, 0.10000000149011612], [0.512499988079071, 0.13750000298023224, 0.20000000298023224, 0.20000000298023224], [0.5375000238418579, 0.13750000298023224, 0.10000000149011612, 0.10000000149011612], [0.5375000238418579, 0.13750000298023224, 0.20000000298023224, 0.20000000298023224], [0.5625, 0.13750000298023224, 0.10000000149011612, 0.10000000149011612], [0.5625, 0.13750000298023224, 0.20000000298023224, 0.20000000298023224], [0.5874999761581421, 0.13750000298023224, 0.10000000149011612, 0.10000000149011612], [0.5874999761581421, 0.13750000298023224, 0.20000000298023224, 0.20000000298023224], [0.612500011920929, 0.13750000298023224, 0.10000000149011612, 0.10000000149011612], [0.612500011920929, 0.13750000298023224, 0.20000000298023224, 0.20000000298023224], [0.637499988079071, 0.13750000298023224, 0.10000000149011612, 0.10000000149011612], [0.637499988079071, 0.13750000298023224, 0.20000000298023224, 0.20000000298023224], [0.6625000238418579, 0.13750000298023224, 0.10000000149011612, 0.10000000149011612], [0.6625000238418579, 0.13750000298023224, 0.20000000298023224, 0.20000000298023224], [0.6875, 0.13750000298023224, 0.10000000149011612, 0.10000000149011612], [0.6875, 0.13750000298023224, 0.20000000298023224, 0.20000000298023224], [0.7124999761581421, 0.13750000298023224, 0.10000000149011612, 0.10000000149011612], [0.7124999761581421, 0.13750000298023224, 0.20000000298023224, 0.20000000298023224], [0.737500011920929, 0.13750000298023224, 0.10000000149011612, 0.10000000149011612], [0.737500011920929, 0.13750000298023224, 0.20000000298023224, 0.20000000298023224], [0.762499988079071, 0.13750000298023224, 0.10000000149011612, 0.10000000149011612], [0.762499988079071, 0.13750000298023224, 0.20000000298023224, 0.20000000298023224], [0.7875000238418579, 0.13750000298023224, 0.10000000149011612, 0.10000000149011612], [0.7875000238418579, 0.13750000298023224, 0.20000000298023224, 0.20000000298023224], [0.8125, 0.13750000298023224, 0.10000000149011612, 0.10000000149011612], [0.8125, 0.13750000298023224, 0.20000000298023224, 0.20000000298023224], [0.8374999761581421, 0.13750000298023224, 0.10000000149011612, 0.10000000149011612], [0.8374999761581421, 0.13750000298023224, 0.20000000298023224, 0.20000000298023224], [0.862500011920929, 0.13750000298023224, 0.10000000149011612, 0.10000000149011612], [0.862500011920929, 0.13750000298023224, 0.20000000298023224, 0.20000000298023224], [0.887499988079071, 0.13750000298023224, 0.10000000149011612, 0.10000000149011612], [0.887499988079071, 0.13750000298023224, 0.20000000298023224, 0.20000000298023224], [0.9125000238418579, 0.13750000298023224, 0.10000000149011612, 0.10000000149011612], [0.9125000238418579, 0.13750000298023224, 0.20000000298023224, 0.20000000298023224], [0.9375, 0.13750000298023224, 0.10000000149011612, 0.10000000149011612], [0.9375, 0.13750000298023224, 0.20000000298023224, 0.20000000298023224], [0.9624999761581421, 0.13750000298023224, 0.10000000149011612, 0.10000000149011612], [0.9624999761581421, 0.13750000298023224, 0.20000000298023224, 0.20000000298023224], [0.987500011920929, 0.13750000298023224, 0.10000000149011612, 0.10000000149011612], [0.987500011920929, 0.13750000298023224, 0.20000000298023224, 0.20000000298023224], [0.012500000186264515, 0.16249999403953552, 0.10000000149011612, 0.10000000149011612], [0.012500000186264515, 0.16249999403953552, 0.20000000298023224, 0.20000000298023224], [0.03750000149011612, 0.16249999403953552, 0.10000000149011612, 0.10000000149011612], [0.03750000149011612, 0.16249999403953552, 0.20000000298023224, 0.20000000298023224], [0.0625, 0.16249999403953552, 0.10000000149011612, 0.10000000149011612], [0.0625, 0.16249999403953552, 0.20000000298023224, 0.20000000298023224], [0.08749999850988388, 0.16249999403953552, 0.10000000149011612, 0.10000000149011612], [0.08749999850988388, 0.16249999403953552, 0.20000000298023224, 0.20000000298023224], [0.11249999701976776, 0.16249999403953552, 0.10000000149011612, 0.10000000149011612], [0.11249999701976776, 0.16249999403953552, 0.20000000298023224, 0.20000000298023224], [0.13750000298023224, 0.16249999403953552, 0.10000000149011612, 0.10000000149011612], [0.13750000298023224, 0.16249999403953552, 0.20000000298023224, 0.20000000298023224], [0.16249999403953552, 0.16249999403953552, 0.10000000149011612, 0.10000000149011612], [0.16249999403953552, 0.16249999403953552, 0.20000000298023224, 0.20000000298023224], [0.1875, 0.16249999403953552, 0.10000000149011612, 0.10000000149011612], [0.1875, 0.16249999403953552, 0.20000000298023224, 0.20000000298023224], [0.21250000596046448, 0.16249999403953552, 0.10000000149011612, 0.10000000149011612], [0.21250000596046448, 0.16249999403953552, 0.20000000298023224, 0.20000000298023224], [0.23749999701976776, 0.16249999403953552, 0.10000000149011612, 0.10000000149011612], [0.23749999701976776, 0.16249999403953552, 0.20000000298023224, 0.20000000298023224], [0.26249998807907104, 0.16249999403953552, 0.10000000149011612, 0.10000000149011612], [0.26249998807907104, 0.16249999403953552, 0.20000000298023224, 0.20000000298023224], [0.2874999940395355, 0.16249999403953552, 0.10000000149011612, 0.10000000149011612], [0.2874999940395355, 0.16249999403953552, 0.20000000298023224, 0.20000000298023224], [0.3125, 0.16249999403953552, 0.10000000149011612, 0.10000000149011612], [0.3125, 0.16249999403953552, 0.20000000298023224, 0.20000000298023224], [0.3375000059604645, 0.16249999403953552, 0.10000000149011612, 0.10000000149011612], [0.3375000059604645, 0.16249999403953552, 0.20000000298023224, 0.20000000298023224], [0.36250001192092896, 0.16249999403953552, 0.10000000149011612, 0.10000000149011612], [0.36250001192092896, 0.16249999403953552, 0.20000000298023224, 0.20000000298023224], [0.38749998807907104, 0.16249999403953552, 0.10000000149011612, 0.10000000149011612], [0.38749998807907104, 0.16249999403953552, 0.20000000298023224, 0.20000000298023224], [0.4124999940395355, 0.16249999403953552, 0.10000000149011612, 0.10000000149011612], [0.4124999940395355, 0.16249999403953552, 0.20000000298023224, 0.20000000298023224], [0.4375, 0.16249999403953552, 0.10000000149011612, 0.10000000149011612], [0.4375, 0.16249999403953552, 0.20000000298023224, 0.20000000298023224], [0.4625000059604645, 0.16249999403953552, 0.10000000149011612, 0.10000000149011612], [0.4625000059604645, 0.16249999403953552, 0.20000000298023224, 0.20000000298023224], [0.48750001192092896, 0.16249999403953552, 0.10000000149011612, 0.10000000149011612], [0.48750001192092896, 0.16249999403953552, 0.20000000298023224, 0.20000000298023224], [0.512499988079071, 0.16249999403953552, 0.10000000149011612, 0.10000000149011612], [0.512499988079071, 0.16249999403953552, 0.20000000298023224, 0.20000000298023224], [0.5375000238418579, 0.16249999403953552, 0.10000000149011612, 0.10000000149011612], [0.5375000238418579, 0.16249999403953552, 0.20000000298023224, 0.20000000298023224], [0.5625, 0.16249999403953552, 0.10000000149011612, 0.10000000149011612], [0.5625, 0.16249999403953552, 0.20000000298023224, 0.20000000298023224], [0.5874999761581421, 0.16249999403953552, 0.10000000149011612, 0.10000000149011612], [0.5874999761581421, 0.16249999403953552, 0.20000000298023224, 0.20000000298023224], [0.612500011920929, 0.16249999403953552, 0.10000000149011612, 0.10000000149011612], [0.612500011920929, 0.16249999403953552, 0.20000000298023224, 0.20000000298023224], [0.637499988079071, 0.16249999403953552, 0.10000000149011612, 0.10000000149011612], [0.637499988079071, 0.16249999403953552, 0.20000000298023224, 0.20000000298023224], [0.6625000238418579, 0.16249999403953552, 0.10000000149011612, 0.10000000149011612], [0.6625000238418579, 0.16249999403953552, 0.20000000298023224, 0.20000000298023224], [0.6875, 0.16249999403953552, 0.10000000149011612, 0.10000000149011612], [0.6875, 0.16249999403953552, 0.20000000298023224, 0.20000000298023224], [0.7124999761581421, 0.16249999403953552, 0.10000000149011612, 0.10000000149011612], [0.7124999761581421, 0.16249999403953552, 0.20000000298023224, 0.20000000298023224], [0.737500011920929, 0.16249999403953552, 0.10000000149011612, 0.10000000149011612], [0.737500011920929, 0.16249999403953552, 0.20000000298023224, 0.20000000298023224], [0.762499988079071, 0.16249999403953552, 0.10000000149011612, 0.10000000149011612], [0.762499988079071, 0.16249999403953552, 0.20000000298023224, 0.20000000298023224], [0.7875000238418579, 0.16249999403953552, 0.10000000149011612, 0.10000000149011612], [0.7875000238418579, 0.16249999403953552, 0.20000000298023224, 0.20000000298023224], [0.8125, 0.16249999403953552, 0.10000000149011612, 0.10000000149011612], [0.8125, 0.16249999403953552, 0.20000000298023224, 0.20000000298023224], [0.8374999761581421, 0.16249999403953552, 0.10000000149011612, 0.10000000149011612], [0.8374999761581421, 0.16249999403953552, 0.20000000298023224, 0.20000000298023224], [0.862500011920929, 0.16249999403953552, 0.10000000149011612, 0.10000000149011612], [0.862500011920929, 0.16249999403953552, 0.20000000298023224, 0.20000000298023224], [0.887499988079071, 0.16249999403953552, 0.10000000149011612, 0.10000000149011612], [0.887499988079071, 0.16249999403953552, 0.20000000298023224, 0.20000000298023224], [0.9125000238418579, 0.16249999403953552, 0.10000000149011612, 0.10000000149011612], [0.9125000238418579, 0.16249999403953552, 0.20000000298023224, 0.20000000298023224], [0.9375, 0.16249999403953552, 0.10000000149011612, 0.10000000149011612], [0.9375, 0.16249999403953552, 0.20000000298023224, 0.20000000298023224], [0.9624999761581421, 0.16249999403953552, 0.10000000149011612, 0.10000000149011612], [0.9624999761581421, 0.16249999403953552, 0.20000000298023224, 0.20000000298023224], [0.987500011920929, 0.16249999403953552, 0.10000000149011612, 0.10000000149011612], [0.987500011920929, 0.16249999403953552, 0.20000000298023224, 0.20000000298023224], [0.012500000186264515, 0.1875, 0.10000000149011612, 0.10000000149011612], [0.012500000186264515, 0.1875, 0.20000000298023224, 0.20000000298023224], [0.03750000149011612, 0.1875, 0.10000000149011612, 0.10000000149011612], [0.03750000149011612, 0.1875, 0.20000000298023224, 0.20000000298023224], [0.0625, 0.1875, 0.10000000149011612, 0.10000000149011612], [0.0625, 0.1875, 0.20000000298023224, 0.20000000298023224], [0.08749999850988388, 0.1875, 0.10000000149011612, 0.10000000149011612], [0.08749999850988388, 0.1875, 0.20000000298023224, 0.20000000298023224], [0.11249999701976776, 0.1875, 0.10000000149011612, 0.10000000149011612], [0.11249999701976776, 0.1875, 0.20000000298023224, 0.20000000298023224], [0.13750000298023224, 0.1875, 0.10000000149011612, 0.10000000149011612], [0.13750000298023224, 0.1875, 0.20000000298023224, 0.20000000298023224], [0.16249999403953552, 0.1875, 0.10000000149011612, 0.10000000149011612], [0.16249999403953552, 0.1875, 0.20000000298023224, 0.20000000298023224], [0.1875, 0.1875, 0.10000000149011612, 0.10000000149011612], [0.1875, 0.1875, 0.20000000298023224, 0.20000000298023224], [0.21250000596046448, 0.1875, 0.10000000149011612, 0.10000000149011612], [0.21250000596046448, 0.1875, 0.20000000298023224, 0.20000000298023224], [0.23749999701976776, 0.1875, 0.10000000149011612, 0.10000000149011612], [0.23749999701976776, 0.1875, 0.20000000298023224, 0.20000000298023224], [0.26249998807907104, 0.1875, 0.10000000149011612, 0.10000000149011612], [0.26249998807907104, 0.1875, 0.20000000298023224, 0.20000000298023224], [0.2874999940395355, 0.1875, 0.10000000149011612, 0.10000000149011612], [0.2874999940395355, 0.1875, 0.20000000298023224, 0.20000000298023224], [0.3125, 0.1875, 0.10000000149011612, 0.10000000149011612], [0.3125, 0.1875, 0.20000000298023224, 0.20000000298023224], [0.3375000059604645, 0.1875, 0.10000000149011612, 0.10000000149011612], [0.3375000059604645, 0.1875, 0.20000000298023224, 0.20000000298023224], [0.36250001192092896, 0.1875, 0.10000000149011612, 0.10000000149011612], [0.36250001192092896, 0.1875, 0.20000000298023224, 0.20000000298023224], [0.38749998807907104, 0.1875, 0.10000000149011612, 0.10000000149011612], [0.38749998807907104, 0.1875, 0.20000000298023224, 0.20000000298023224], [0.4124999940395355, 0.1875, 0.10000000149011612, 0.10000000149011612], [0.4124999940395355, 0.1875, 0.20000000298023224, 0.20000000298023224], [0.4375, 0.1875, 0.10000000149011612, 0.10000000149011612], [0.4375, 0.1875, 0.20000000298023224, 0.20000000298023224], [0.4625000059604645, 0.1875, 0.10000000149011612, 0.10000000149011612], [0.4625000059604645, 0.1875, 0.20000000298023224, 0.20000000298023224], [0.48750001192092896, 0.1875, 0.10000000149011612, 0.10000000149011612], [0.48750001192092896, 0.1875, 0.20000000298023224, 0.20000000298023224], [0.512499988079071, 0.1875, 0.10000000149011612, 0.10000000149011612], [0.512499988079071, 0.1875, 0.20000000298023224, 0.20000000298023224], [0.5375000238418579, 0.1875, 0.10000000149011612, 0.10000000149011612], [0.5375000238418579, 0.1875, 0.20000000298023224, 0.20000000298023224], [0.5625, 0.1875, 0.10000000149011612, 0.10000000149011612], [0.5625, 0.1875, 0.20000000298023224, 0.20000000298023224], [0.5874999761581421, 0.1875, 0.10000000149011612, 0.10000000149011612], [0.5874999761581421, 0.1875, 0.20000000298023224, 0.20000000298023224], [0.612500011920929, 0.1875, 0.10000000149011612, 0.10000000149011612], [0.612500011920929, 0.1875, 0.20000000298023224, 0.20000000298023224], [0.637499988079071, 0.1875, 0.10000000149011612, 0.10000000149011612], [0.637499988079071, 0.1875, 0.20000000298023224, 0.20000000298023224], [0.6625000238418579, 0.1875, 0.10000000149011612, 0.10000000149011612], [0.6625000238418579, 0.1875, 0.20000000298023224, 0.20000000298023224], [0.6875, 0.1875, 0.10000000149011612, 0.10000000149011612], [0.6875, 0.1875, 0.20000000298023224, 0.20000000298023224], [0.7124999761581421, 0.1875, 0.10000000149011612, 0.10000000149011612], [0.7124999761581421, 0.1875, 0.20000000298023224, 0.20000000298023224], [0.737500011920929, 0.1875, 0.10000000149011612, 0.10000000149011612], [0.737500011920929, 0.1875, 0.20000000298023224, 0.20000000298023224], [0.762499988079071, 0.1875, 0.10000000149011612, 0.10000000149011612], [0.762499988079071, 0.1875, 0.20000000298023224, 0.20000000298023224], [0.7875000238418579, 0.1875, 0.10000000149011612, 0.10000000149011612], [0.7875000238418579, 0.1875, 0.20000000298023224, 0.20000000298023224], [0.8125, 0.1875, 0.10000000149011612, 0.10000000149011612], [0.8125, 0.1875, 0.20000000298023224, 0.20000000298023224], [0.8374999761581421, 0.1875, 0.10000000149011612, 0.10000000149011612], [0.8374999761581421, 0.1875, 0.20000000298023224, 0.20000000298023224], [0.862500011920929, 0.1875, 0.10000000149011612, 0.10000000149011612], [0.862500011920929, 0.1875, 0.20000000298023224, 0.20000000298023224], [0.887499988079071, 0.1875, 0.10000000149011612, 0.10000000149011612], [0.887499988079071, 0.1875, 0.20000000298023224, 0.20000000298023224], [0.9125000238418579, 0.1875, 0.10000000149011612, 0.10000000149011612], [0.9125000238418579, 0.1875, 0.20000000298023224, 0.20000000298023224], [0.9375, 0.1875, 0.10000000149011612, 0.10000000149011612], [0.9375, 0.1875, 0.20000000298023224, 0.20000000298023224], [0.9624999761581421, 0.1875, 0.10000000149011612, 0.10000000149011612], [0.9624999761581421, 0.1875, 0.20000000298023224, 0.20000000298023224], [0.987500011920929, 0.1875, 0.10000000149011612, 0.10000000149011612], [0.987500011920929, 0.1875, 0.20000000298023224, 0.20000000298023224], [0.012500000186264515, 0.21250000596046448, 0.10000000149011612, 0.10000000149011612], [0.012500000186264515, 0.21250000596046448, 0.20000000298023224, 0.20000000298023224], [0.03750000149011612, 0.21250000596046448, 0.10000000149011612, 0.10000000149011612], [0.03750000149011612, 0.21250000596046448, 0.20000000298023224, 0.20000000298023224], [0.0625, 0.21250000596046448, 0.10000000149011612, 0.10000000149011612], [0.0625, 0.21250000596046448, 0.20000000298023224, 0.20000000298023224], [0.08749999850988388, 0.21250000596046448, 0.10000000149011612, 0.10000000149011612], [0.08749999850988388, 0.21250000596046448, 0.20000000298023224, 0.20000000298023224], [0.11249999701976776, 0.21250000596046448, 0.10000000149011612, 0.10000000149011612], [0.11249999701976776, 0.21250000596046448, 0.20000000298023224, 0.20000000298023224], [0.13750000298023224, 0.21250000596046448, 0.10000000149011612, 0.10000000149011612], [0.13750000298023224, 0.21250000596046448, 0.20000000298023224, 0.20000000298023224], [0.16249999403953552, 0.21250000596046448, 0.10000000149011612, 0.10000000149011612], [0.16249999403953552, 0.21250000596046448, 0.20000000298023224, 0.20000000298023224], [0.1875, 0.21250000596046448, 0.10000000149011612, 0.10000000149011612], [0.1875, 0.21250000596046448, 0.20000000298023224, 0.20000000298023224], [0.21250000596046448, 0.21250000596046448, 0.10000000149011612, 0.10000000149011612], [0.21250000596046448, 0.21250000596046448, 0.20000000298023224, 0.20000000298023224], [0.23749999701976776, 0.21250000596046448, 0.10000000149011612, 0.10000000149011612], [0.23749999701976776, 0.21250000596046448, 0.20000000298023224, 0.20000000298023224], [0.26249998807907104, 0.21250000596046448, 0.10000000149011612, 0.10000000149011612], [0.26249998807907104, 0.21250000596046448, 0.20000000298023224, 0.20000000298023224], [0.2874999940395355, 0.21250000596046448, 0.10000000149011612, 0.10000000149011612], [0.2874999940395355, 0.21250000596046448, 0.20000000298023224, 0.20000000298023224], [0.3125, 0.21250000596046448, 0.10000000149011612, 0.10000000149011612], [0.3125, 0.21250000596046448, 0.20000000298023224, 0.20000000298023224], [0.3375000059604645, 0.21250000596046448, 0.10000000149011612, 0.10000000149011612], [0.3375000059604645, 0.21250000596046448, 0.20000000298023224, 0.20000000298023224], [0.36250001192092896, 0.21250000596046448, 0.10000000149011612, 0.10000000149011612], [0.36250001192092896, 0.21250000596046448, 0.20000000298023224, 0.20000000298023224], [0.38749998807907104, 0.21250000596046448, 0.10000000149011612, 0.10000000149011612], [0.38749998807907104, 0.21250000596046448, 0.20000000298023224, 0.20000000298023224], [0.4124999940395355, 0.21250000596046448, 0.10000000149011612, 0.10000000149011612], [0.4124999940395355, 0.21250000596046448, 0.20000000298023224, 0.20000000298023224], [0.4375, 0.21250000596046448, 0.10000000149011612, 0.10000000149011612], [0.4375, 0.21250000596046448, 0.20000000298023224, 0.20000000298023224], [0.4625000059604645, 0.21250000596046448, 0.10000000149011612, 0.10000000149011612], [0.4625000059604645, 0.21250000596046448, 0.20000000298023224, 0.20000000298023224], [0.48750001192092896, 0.21250000596046448, 0.10000000149011612, 0.10000000149011612], [0.48750001192092896, 0.21250000596046448, 0.20000000298023224, 0.20000000298023224], [0.512499988079071, 0.21250000596046448, 0.10000000149011612, 0.10000000149011612], [0.512499988079071, 0.21250000596046448, 0.20000000298023224, 0.20000000298023224], [0.5375000238418579, 0.21250000596046448, 0.10000000149011612, 0.10000000149011612], [0.5375000238418579, 0.21250000596046448, 0.20000000298023224, 0.20000000298023224], [0.5625, 0.21250000596046448, 0.10000000149011612, 0.10000000149011612], [0.5625, 0.21250000596046448, 0.20000000298023224, 0.20000000298023224], [0.5874999761581421, 0.21250000596046448, 0.10000000149011612, 0.10000000149011612], [0.5874999761581421, 0.21250000596046448, 0.20000000298023224, 0.20000000298023224], [0.612500011920929, 0.21250000596046448, 0.10000000149011612, 0.10000000149011612], [0.612500011920929, 0.21250000596046448, 0.20000000298023224, 0.20000000298023224], [0.637499988079071, 0.21250000596046448, 0.10000000149011612, 0.10000000149011612], [0.637499988079071, 0.21250000596046448, 0.20000000298023224, 0.20000000298023224], [0.6625000238418579, 0.21250000596046448, 0.10000000149011612, 0.10000000149011612], [0.6625000238418579, 0.21250000596046448, 0.20000000298023224, 0.20000000298023224], [0.6875, 0.21250000596046448, 0.10000000149011612, 0.10000000149011612], [0.6875, 0.21250000596046448, 0.20000000298023224, 0.20000000298023224], [0.7124999761581421, 0.21250000596046448, 0.10000000149011612, 0.10000000149011612], [0.7124999761581421, 0.21250000596046448, 0.20000000298023224, 0.20000000298023224], [0.737500011920929, 0.21250000596046448, 0.10000000149011612, 0.10000000149011612], [0.737500011920929, 0.21250000596046448, 0.20000000298023224, 0.20000000298023224], [0.762499988079071, 0.21250000596046448, 0.10000000149011612, 0.10000000149011612], [0.762499988079071, 0.21250000596046448, 0.20000000298023224, 0.20000000298023224], [0.7875000238418579, 0.21250000596046448, 0.10000000149011612, 0.10000000149011612], [0.7875000238418579, 0.21250000596046448, 0.20000000298023224, 0.20000000298023224], [0.8125, 0.21250000596046448, 0.10000000149011612, 0.10000000149011612], [0.8125, 0.21250000596046448, 0.20000000298023224, 0.20000000298023224], [0.8374999761581421, 0.21250000596046448, 0.10000000149011612, 0.10000000149011612], [0.8374999761581421, 0.21250000596046448, 0.20000000298023224, 0.20000000298023224], [0.862500011920929, 0.21250000596046448, 0.10000000149011612, 0.10000000149011612], [0.862500011920929, 0.21250000596046448, 0.20000000298023224, 0.20000000298023224], [0.887499988079071, 0.21250000596046448, 0.10000000149011612, 0.10000000149011612], [0.887499988079071, 0.21250000596046448, 0.20000000298023224, 0.20000000298023224], [0.9125000238418579, 0.21250000596046448, 0.10000000149011612, 0.10000000149011612], [0.9125000238418579, 0.21250000596046448, 0.20000000298023224, 0.20000000298023224], [0.9375, 0.21250000596046448, 0.10000000149011612, 0.10000000149011612], [0.9375, 0.21250000596046448, 0.20000000298023224, 0.20000000298023224], [0.9624999761581421, 0.21250000596046448, 0.10000000149011612, 0.10000000149011612], [0.9624999761581421, 0.21250000596046448, 0.20000000298023224, 0.20000000298023224], [0.987500011920929, 0.21250000596046448, 0.10000000149011612, 0.10000000149011612], [0.987500011920929, 0.21250000596046448, 0.20000000298023224, 0.20000000298023224], [0.012500000186264515, 0.23749999701976776, 0.10000000149011612, 0.10000000149011612], [0.012500000186264515, 0.23749999701976776, 0.20000000298023224, 0.20000000298023224], [0.03750000149011612, 0.23749999701976776, 0.10000000149011612, 0.10000000149011612], [0.03750000149011612, 0.23749999701976776, 0.20000000298023224, 0.20000000298023224], [0.0625, 0.23749999701976776, 0.10000000149011612, 0.10000000149011612], [0.0625, 0.23749999701976776, 0.20000000298023224, 0.20000000298023224], [0.08749999850988388, 0.23749999701976776, 0.10000000149011612, 0.10000000149011612], [0.08749999850988388, 0.23749999701976776, 0.20000000298023224, 0.20000000298023224], [0.11249999701976776, 0.23749999701976776, 0.10000000149011612, 0.10000000149011612], [0.11249999701976776, 0.23749999701976776, 0.20000000298023224, 0.20000000298023224], [0.13750000298023224, 0.23749999701976776, 0.10000000149011612, 0.10000000149011612], [0.13750000298023224, 0.23749999701976776, 0.20000000298023224, 0.20000000298023224], [0.16249999403953552, 0.23749999701976776, 0.10000000149011612, 0.10000000149011612], [0.16249999403953552, 0.23749999701976776, 0.20000000298023224, 0.20000000298023224], [0.1875, 0.23749999701976776, 0.10000000149011612, 0.10000000149011612], [0.1875, 0.23749999701976776, 0.20000000298023224, 0.20000000298023224], [0.21250000596046448, 0.23749999701976776, 0.10000000149011612, 0.10000000149011612], [0.21250000596046448, 0.23749999701976776, 0.20000000298023224, 0.20000000298023224], [0.23749999701976776, 0.23749999701976776, 0.10000000149011612, 0.10000000149011612], [0.23749999701976776, 0.23749999701976776, 0.20000000298023224, 0.20000000298023224], [0.26249998807907104, 0.23749999701976776, 0.10000000149011612, 0.10000000149011612], [0.26249998807907104, 0.23749999701976776, 0.20000000298023224, 0.20000000298023224], [0.2874999940395355, 0.23749999701976776, 0.10000000149011612, 0.10000000149011612], [0.2874999940395355, 0.23749999701976776, 0.20000000298023224, 0.20000000298023224], [0.3125, 0.23749999701976776, 0.10000000149011612, 0.10000000149011612], [0.3125, 0.23749999701976776, 0.20000000298023224, 0.20000000298023224], [0.3375000059604645, 0.23749999701976776, 0.10000000149011612, 0.10000000149011612], [0.3375000059604645, 0.23749999701976776, 0.20000000298023224, 0.20000000298023224], [0.36250001192092896, 0.23749999701976776, 0.10000000149011612, 0.10000000149011612], [0.36250001192092896, 0.23749999701976776, 0.20000000298023224, 0.20000000298023224], [0.38749998807907104, 0.23749999701976776, 0.10000000149011612, 0.10000000149011612], [0.38749998807907104, 0.23749999701976776, 0.20000000298023224, 0.20000000298023224], [0.4124999940395355, 0.23749999701976776, 0.10000000149011612, 0.10000000149011612], [0.4124999940395355, 0.23749999701976776, 0.20000000298023224, 0.20000000298023224], [0.4375, 0.23749999701976776, 0.10000000149011612, 0.10000000149011612], [0.4375, 0.23749999701976776, 0.20000000298023224, 0.20000000298023224], [0.4625000059604645, 0.23749999701976776, 0.10000000149011612, 0.10000000149011612], [0.4625000059604645, 0.23749999701976776, 0.20000000298023224, 0.20000000298023224], [0.48750001192092896, 0.23749999701976776, 0.10000000149011612, 0.10000000149011612], [0.48750001192092896, 0.23749999701976776, 0.20000000298023224, 0.20000000298023224], [0.512499988079071, 0.23749999701976776, 0.10000000149011612, 0.10000000149011612], [0.512499988079071, 0.23749999701976776, 0.20000000298023224, 0.20000000298023224], [0.5375000238418579, 0.23749999701976776, 0.10000000149011612, 0.10000000149011612], [0.5375000238418579, 0.23749999701976776, 0.20000000298023224, 0.20000000298023224], [0.5625, 0.23749999701976776, 0.10000000149011612, 0.10000000149011612], [0.5625, 0.23749999701976776, 0.20000000298023224, 0.20000000298023224], [0.5874999761581421, 0.23749999701976776, 0.10000000149011612, 0.10000000149011612], [0.5874999761581421, 0.23749999701976776, 0.20000000298023224, 0.20000000298023224], [0.612500011920929, 0.23749999701976776, 0.10000000149011612, 0.10000000149011612], [0.612500011920929, 0.23749999701976776, 0.20000000298023224, 0.20000000298023224], [0.637499988079071, 0.23749999701976776, 0.10000000149011612, 0.10000000149011612], [0.637499988079071, 0.23749999701976776, 0.20000000298023224, 0.20000000298023224], [0.6625000238418579, 0.23749999701976776, 0.10000000149011612, 0.10000000149011612], [0.6625000238418579, 0.23749999701976776, 0.20000000298023224, 0.20000000298023224], [0.6875, 0.23749999701976776, 0.10000000149011612, 0.10000000149011612], [0.6875, 0.23749999701976776, 0.20000000298023224, 0.20000000298023224], [0.7124999761581421, 0.23749999701976776, 0.10000000149011612, 0.10000000149011612], [0.7124999761581421, 0.23749999701976776, 0.20000000298023224, 0.20000000298023224], [0.737500011920929, 0.23749999701976776, 0.10000000149011612, 0.10000000149011612], [0.737500011920929, 0.23749999701976776, 0.20000000298023224, 0.20000000298023224], [0.762499988079071, 0.23749999701976776, 0.10000000149011612, 0.10000000149011612], [0.762499988079071, 0.23749999701976776, 0.20000000298023224, 0.20000000298023224], [0.7875000238418579, 0.23749999701976776, 0.10000000149011612, 0.10000000149011612], [0.7875000238418579, 0.23749999701976776, 0.20000000298023224, 0.20000000298023224], [0.8125, 0.23749999701976776, 0.10000000149011612, 0.10000000149011612], [0.8125, 0.23749999701976776, 0.20000000298023224, 0.20000000298023224], [0.8374999761581421, 0.23749999701976776, 0.10000000149011612, 0.10000000149011612], [0.8374999761581421, 0.23749999701976776, 0.20000000298023224, 0.20000000298023224], [0.862500011920929, 0.23749999701976776, 0.10000000149011612, 0.10000000149011612], [0.862500011920929, 0.23749999701976776, 0.20000000298023224, 0.20000000298023224], [0.887499988079071, 0.23749999701976776, 0.10000000149011612, 0.10000000149011612], [0.887499988079071, 0.23749999701976776, 0.20000000298023224, 0.20000000298023224], [0.9125000238418579, 0.23749999701976776, 0.10000000149011612, 0.10000000149011612], [0.9125000238418579, 0.23749999701976776, 0.20000000298023224, 0.20000000298023224], [0.9375, 0.23749999701976776, 0.10000000149011612, 0.10000000149011612], [0.9375, 0.23749999701976776, 0.20000000298023224, 0.20000000298023224], [0.9624999761581421, 0.23749999701976776, 0.10000000149011612, 0.10000000149011612], [0.9624999761581421, 0.23749999701976776, 0.20000000298023224, 0.20000000298023224], [0.987500011920929, 0.23749999701976776, 0.10000000149011612, 0.10000000149011612], [0.987500011920929, 0.23749999701976776, 0.20000000298023224, 0.20000000298023224], [0.012500000186264515, 0.26249998807907104, 0.10000000149011612, 0.10000000149011612], [0.012500000186264515, 0.26249998807907104, 0.20000000298023224, 0.20000000298023224], [0.03750000149011612, 0.26249998807907104, 0.10000000149011612, 0.10000000149011612], [0.03750000149011612, 0.26249998807907104, 0.20000000298023224, 0.20000000298023224], [0.0625, 0.26249998807907104, 0.10000000149011612, 0.10000000149011612], [0.0625, 0.26249998807907104, 0.20000000298023224, 0.20000000298023224], [0.08749999850988388, 0.26249998807907104, 0.10000000149011612, 0.10000000149011612], [0.08749999850988388, 0.26249998807907104, 0.20000000298023224, 0.20000000298023224], [0.11249999701976776, 0.26249998807907104, 0.10000000149011612, 0.10000000149011612], [0.11249999701976776, 0.26249998807907104, 0.20000000298023224, 0.20000000298023224], [0.13750000298023224, 0.26249998807907104, 0.10000000149011612, 0.10000000149011612], [0.13750000298023224, 0.26249998807907104, 0.20000000298023224, 0.20000000298023224], [0.16249999403953552, 0.26249998807907104, 0.10000000149011612, 0.10000000149011612], [0.16249999403953552, 0.26249998807907104, 0.20000000298023224, 0.20000000298023224], [0.1875, 0.26249998807907104, 0.10000000149011612, 0.10000000149011612], [0.1875, 0.26249998807907104, 0.20000000298023224, 0.20000000298023224], [0.21250000596046448, 0.26249998807907104, 0.10000000149011612, 0.10000000149011612], [0.21250000596046448, 0.26249998807907104, 0.20000000298023224, 0.20000000298023224], [0.23749999701976776, 0.26249998807907104, 0.10000000149011612, 0.10000000149011612], [0.23749999701976776, 0.26249998807907104, 0.20000000298023224, 0.20000000298023224], [0.26249998807907104, 0.26249998807907104, 0.10000000149011612, 0.10000000149011612], [0.26249998807907104, 0.26249998807907104, 0.20000000298023224, 0.20000000298023224], [0.2874999940395355, 0.26249998807907104, 0.10000000149011612, 0.10000000149011612], [0.2874999940395355, 0.26249998807907104, 0.20000000298023224, 0.20000000298023224], [0.3125, 0.26249998807907104, 0.10000000149011612, 0.10000000149011612], [0.3125, 0.26249998807907104, 0.20000000298023224, 0.20000000298023224], [0.3375000059604645, 0.26249998807907104, 0.10000000149011612, 0.10000000149011612], [0.3375000059604645, 0.26249998807907104, 0.20000000298023224, 0.20000000298023224], [0.36250001192092896, 0.26249998807907104, 0.10000000149011612, 0.10000000149011612], [0.36250001192092896, 0.26249998807907104, 0.20000000298023224, 0.20000000298023224], [0.38749998807907104, 0.26249998807907104, 0.10000000149011612, 0.10000000149011612], [0.38749998807907104, 0.26249998807907104, 0.20000000298023224, 0.20000000298023224], [0.4124999940395355, 0.26249998807907104, 0.10000000149011612, 0.10000000149011612], [0.4124999940395355, 0.26249998807907104, 0.20000000298023224, 0.20000000298023224], [0.4375, 0.26249998807907104, 0.10000000149011612, 0.10000000149011612], [0.4375, 0.26249998807907104, 0.20000000298023224, 0.20000000298023224], [0.4625000059604645, 0.26249998807907104, 0.10000000149011612, 0.10000000149011612], [0.4625000059604645, 0.26249998807907104, 0.20000000298023224, 0.20000000298023224], [0.48750001192092896, 0.26249998807907104, 0.10000000149011612, 0.10000000149011612], [0.48750001192092896, 0.26249998807907104, 0.20000000298023224, 0.20000000298023224], [0.512499988079071, 0.26249998807907104, 0.10000000149011612, 0.10000000149011612], [0.512499988079071, 0.26249998807907104, 0.20000000298023224, 0.20000000298023224], [0.5375000238418579, 0.26249998807907104, 0.10000000149011612, 0.10000000149011612], [0.5375000238418579, 0.26249998807907104, 0.20000000298023224, 0.20000000298023224], [0.5625, 0.26249998807907104, 0.10000000149011612, 0.10000000149011612], [0.5625, 0.26249998807907104, 0.20000000298023224, 0.20000000298023224], [0.5874999761581421, 0.26249998807907104, 0.10000000149011612, 0.10000000149011612], [0.5874999761581421, 0.26249998807907104, 0.20000000298023224, 0.20000000298023224], [0.612500011920929, 0.26249998807907104, 0.10000000149011612, 0.10000000149011612], [0.612500011920929, 0.26249998807907104, 0.20000000298023224, 0.20000000298023224], [0.637499988079071, 0.26249998807907104, 0.10000000149011612, 0.10000000149011612], [0.637499988079071, 0.26249998807907104, 0.20000000298023224, 0.20000000298023224], [0.6625000238418579, 0.26249998807907104, 0.10000000149011612, 0.10000000149011612], [0.6625000238418579, 0.26249998807907104, 0.20000000298023224, 0.20000000298023224], [0.6875, 0.26249998807907104, 0.10000000149011612, 0.10000000149011612], [0.6875, 0.26249998807907104, 0.20000000298023224, 0.20000000298023224], [0.7124999761581421, 0.26249998807907104, 0.10000000149011612, 0.10000000149011612], [0.7124999761581421, 0.26249998807907104, 0.20000000298023224, 0.20000000298023224], [0.737500011920929, 0.26249998807907104, 0.10000000149011612, 0.10000000149011612], [0.737500011920929, 0.26249998807907104, 0.20000000298023224, 0.20000000298023224], [0.762499988079071, 0.26249998807907104, 0.10000000149011612, 0.10000000149011612], [0.762499988079071, 0.26249998807907104, 0.20000000298023224, 0.20000000298023224], [0.7875000238418579, 0.26249998807907104, 0.10000000149011612, 0.10000000149011612], [0.7875000238418579, 0.26249998807907104, 0.20000000298023224, 0.20000000298023224], [0.8125, 0.26249998807907104, 0.10000000149011612, 0.10000000149011612], [0.8125, 0.26249998807907104, 0.20000000298023224, 0.20000000298023224], [0.8374999761581421, 0.26249998807907104, 0.10000000149011612, 0.10000000149011612], [0.8374999761581421, 0.26249998807907104, 0.20000000298023224, 0.20000000298023224], [0.862500011920929, 0.26249998807907104, 0.10000000149011612, 0.10000000149011612], [0.862500011920929, 0.26249998807907104, 0.20000000298023224, 0.20000000298023224], [0.887499988079071, 0.26249998807907104, 0.10000000149011612, 0.10000000149011612], [0.887499988079071, 0.26249998807907104, 0.20000000298023224, 0.20000000298023224], [0.9125000238418579, 0.26249998807907104, 0.10000000149011612, 0.10000000149011612], [0.9125000238418579, 0.26249998807907104, 0.20000000298023224, 0.20000000298023224], [0.9375, 0.26249998807907104, 0.10000000149011612, 0.10000000149011612], [0.9375, 0.26249998807907104, 0.20000000298023224, 0.20000000298023224], [0.9624999761581421, 0.26249998807907104, 0.10000000149011612, 0.10000000149011612], [0.9624999761581421, 0.26249998807907104, 0.20000000298023224, 0.20000000298023224], [0.987500011920929, 0.26249998807907104, 0.10000000149011612, 0.10000000149011612], [0.987500011920929, 0.26249998807907104, 0.20000000298023224, 0.20000000298023224], [0.012500000186264515, 0.2874999940395355, 0.10000000149011612, 0.10000000149011612], [0.012500000186264515, 0.2874999940395355, 0.20000000298023224, 0.20000000298023224], [0.03750000149011612, 0.2874999940395355, 0.10000000149011612, 0.10000000149011612], [0.03750000149011612, 0.2874999940395355, 0.20000000298023224, 0.20000000298023224], [0.0625, 0.2874999940395355, 0.10000000149011612, 0.10000000149011612], [0.0625, 0.2874999940395355, 0.20000000298023224, 0.20000000298023224], [0.08749999850988388, 0.2874999940395355, 0.10000000149011612, 0.10000000149011612], [0.08749999850988388, 0.2874999940395355, 0.20000000298023224, 0.20000000298023224], [0.11249999701976776, 0.2874999940395355, 0.10000000149011612, 0.10000000149011612], [0.11249999701976776, 0.2874999940395355, 0.20000000298023224, 0.20000000298023224], [0.13750000298023224, 0.2874999940395355, 0.10000000149011612, 0.10000000149011612], [0.13750000298023224, 0.2874999940395355, 0.20000000298023224, 0.20000000298023224], [0.16249999403953552, 0.2874999940395355, 0.10000000149011612, 0.10000000149011612], [0.16249999403953552, 0.2874999940395355, 0.20000000298023224, 0.20000000298023224], [0.1875, 0.2874999940395355, 0.10000000149011612, 0.10000000149011612], [0.1875, 0.2874999940395355, 0.20000000298023224, 0.20000000298023224], [0.21250000596046448, 0.2874999940395355, 0.10000000149011612, 0.10000000149011612], [0.21250000596046448, 0.2874999940395355, 0.20000000298023224, 0.20000000298023224], [0.23749999701976776, 0.2874999940395355, 0.10000000149011612, 0.10000000149011612], [0.23749999701976776, 0.2874999940395355, 0.20000000298023224, 0.20000000298023224], [0.26249998807907104, 0.2874999940395355, 0.10000000149011612, 0.10000000149011612], [0.26249998807907104, 0.2874999940395355, 0.20000000298023224, 0.20000000298023224], [0.2874999940395355, 0.2874999940395355, 0.10000000149011612, 0.10000000149011612], [0.2874999940395355, 0.2874999940395355, 0.20000000298023224, 0.20000000298023224], [0.3125, 0.2874999940395355, 0.10000000149011612, 0.10000000149011612], [0.3125, 0.2874999940395355, 0.20000000298023224, 0.20000000298023224], [0.3375000059604645, 0.2874999940395355, 0.10000000149011612, 0.10000000149011612], [0.3375000059604645, 0.2874999940395355, 0.20000000298023224, 0.20000000298023224], [0.36250001192092896, 0.2874999940395355, 0.10000000149011612, 0.10000000149011612], [0.36250001192092896, 0.2874999940395355, 0.20000000298023224, 0.20000000298023224], [0.38749998807907104, 0.2874999940395355, 0.10000000149011612, 0.10000000149011612], [0.38749998807907104, 0.2874999940395355, 0.20000000298023224, 0.20000000298023224], [0.4124999940395355, 0.2874999940395355, 0.10000000149011612, 0.10000000149011612], [0.4124999940395355, 0.2874999940395355, 0.20000000298023224, 0.20000000298023224], [0.4375, 0.2874999940395355, 0.10000000149011612, 0.10000000149011612], [0.4375, 0.2874999940395355, 0.20000000298023224, 0.20000000298023224], [0.4625000059604645, 0.2874999940395355, 0.10000000149011612, 0.10000000149011612], [0.4625000059604645, 0.2874999940395355, 0.20000000298023224, 0.20000000298023224], [0.48750001192092896, 0.2874999940395355, 0.10000000149011612, 0.10000000149011612], [0.48750001192092896, 0.2874999940395355, 0.20000000298023224, 0.20000000298023224], [0.512499988079071, 0.2874999940395355, 0.10000000149011612, 0.10000000149011612], [0.512499988079071, 0.2874999940395355, 0.20000000298023224, 0.20000000298023224], [0.5375000238418579, 0.2874999940395355, 0.10000000149011612, 0.10000000149011612], [0.5375000238418579, 0.2874999940395355, 0.20000000298023224, 0.20000000298023224], [0.5625, 0.2874999940395355, 0.10000000149011612, 0.10000000149011612], [0.5625, 0.2874999940395355, 0.20000000298023224, 0.20000000298023224], [0.5874999761581421, 0.2874999940395355, 0.10000000149011612, 0.10000000149011612], [0.5874999761581421, 0.2874999940395355, 0.20000000298023224, 0.20000000298023224], [0.612500011920929, 0.2874999940395355, 0.10000000149011612, 0.10000000149011612], [0.612500011920929, 0.2874999940395355, 0.20000000298023224, 0.20000000298023224], [0.637499988079071, 0.2874999940395355, 0.10000000149011612, 0.10000000149011612], [0.637499988079071, 0.2874999940395355, 0.20000000298023224, 0.20000000298023224], [0.6625000238418579, 0.2874999940395355, 0.10000000149011612, 0.10000000149011612], [0.6625000238418579, 0.2874999940395355, 0.20000000298023224, 0.20000000298023224], [0.6875, 0.2874999940395355, 0.10000000149011612, 0.10000000149011612], [0.6875, 0.2874999940395355, 0.20000000298023224, 0.20000000298023224], [0.7124999761581421, 0.2874999940395355, 0.10000000149011612, 0.10000000149011612], [0.7124999761581421, 0.2874999940395355, 0.20000000298023224, 0.20000000298023224], [0.737500011920929, 0.2874999940395355, 0.10000000149011612, 0.10000000149011612], [0.737500011920929, 0.2874999940395355, 0.20000000298023224, 0.20000000298023224], [0.762499988079071, 0.2874999940395355, 0.10000000149011612, 0.10000000149011612], [0.762499988079071, 0.2874999940395355, 0.20000000298023224, 0.20000000298023224], [0.7875000238418579, 0.2874999940395355, 0.10000000149011612, 0.10000000149011612], [0.7875000238418579, 0.2874999940395355, 0.20000000298023224, 0.20000000298023224], [0.8125, 0.2874999940395355, 0.10000000149011612, 0.10000000149011612], [0.8125, 0.2874999940395355, 0.20000000298023224, 0.20000000298023224], [0.8374999761581421, 0.2874999940395355, 0.10000000149011612, 0.10000000149011612], [0.8374999761581421, 0.2874999940395355, 0.20000000298023224, 0.20000000298023224], [0.862500011920929, 0.2874999940395355, 0.10000000149011612, 0.10000000149011612], [0.862500011920929, 0.2874999940395355, 0.20000000298023224, 0.20000000298023224], [0.887499988079071, 0.2874999940395355, 0.10000000149011612, 0.10000000149011612], [0.887499988079071, 0.2874999940395355, 0.20000000298023224, 0.20000000298023224], [0.9125000238418579, 0.2874999940395355, 0.10000000149011612, 0.10000000149011612], [0.9125000238418579, 0.2874999940395355, 0.20000000298023224, 0.20000000298023224], [0.9375, 0.2874999940395355, 0.10000000149011612, 0.10000000149011612], [0.9375, 0.2874999940395355, 0.20000000298023224, 0.20000000298023224], [0.9624999761581421, 0.2874999940395355, 0.10000000149011612, 0.10000000149011612], [0.9624999761581421, 0.2874999940395355, 0.20000000298023224, 0.20000000298023224], [0.987500011920929, 0.2874999940395355, 0.10000000149011612, 0.10000000149011612], [0.987500011920929, 0.2874999940395355, 0.20000000298023224, 0.20000000298023224], [0.012500000186264515, 0.3125, 0.10000000149011612, 0.10000000149011612], [0.012500000186264515, 0.3125, 0.20000000298023224, 0.20000000298023224], [0.03750000149011612, 0.3125, 0.10000000149011612, 0.10000000149011612], [0.03750000149011612, 0.3125, 0.20000000298023224, 0.20000000298023224], [0.0625, 0.3125, 0.10000000149011612, 0.10000000149011612], [0.0625, 0.3125, 0.20000000298023224, 0.20000000298023224], [0.08749999850988388, 0.3125, 0.10000000149011612, 0.10000000149011612], [0.08749999850988388, 0.3125, 0.20000000298023224, 0.20000000298023224], [0.11249999701976776, 0.3125, 0.10000000149011612, 0.10000000149011612], [0.11249999701976776, 0.3125, 0.20000000298023224, 0.20000000298023224], [0.13750000298023224, 0.3125, 0.10000000149011612, 0.10000000149011612], [0.13750000298023224, 0.3125, 0.20000000298023224, 0.20000000298023224], [0.16249999403953552, 0.3125, 0.10000000149011612, 0.10000000149011612], [0.16249999403953552, 0.3125, 0.20000000298023224, 0.20000000298023224], [0.1875, 0.3125, 0.10000000149011612, 0.10000000149011612], [0.1875, 0.3125, 0.20000000298023224, 0.20000000298023224], [0.21250000596046448, 0.3125, 0.10000000149011612, 0.10000000149011612], [0.21250000596046448, 0.3125, 0.20000000298023224, 0.20000000298023224], [0.23749999701976776, 0.3125, 0.10000000149011612, 0.10000000149011612], [0.23749999701976776, 0.3125, 0.20000000298023224, 0.20000000298023224], [0.26249998807907104, 0.3125, 0.10000000149011612, 0.10000000149011612], [0.26249998807907104, 0.3125, 0.20000000298023224, 0.20000000298023224], [0.2874999940395355, 0.3125, 0.10000000149011612, 0.10000000149011612], [0.2874999940395355, 0.3125, 0.20000000298023224, 0.20000000298023224], [0.3125, 0.3125, 0.10000000149011612, 0.10000000149011612], [0.3125, 0.3125, 0.20000000298023224, 0.20000000298023224], [0.3375000059604645, 0.3125, 0.10000000149011612, 0.10000000149011612], [0.3375000059604645, 0.3125, 0.20000000298023224, 0.20000000298023224], [0.36250001192092896, 0.3125, 0.10000000149011612, 0.10000000149011612], [0.36250001192092896, 0.3125, 0.20000000298023224, 0.20000000298023224], [0.38749998807907104, 0.3125, 0.10000000149011612, 0.10000000149011612], [0.38749998807907104, 0.3125, 0.20000000298023224, 0.20000000298023224], [0.4124999940395355, 0.3125, 0.10000000149011612, 0.10000000149011612], [0.4124999940395355, 0.3125, 0.20000000298023224, 0.20000000298023224], [0.4375, 0.3125, 0.10000000149011612, 0.10000000149011612], [0.4375, 0.3125, 0.20000000298023224, 0.20000000298023224], [0.4625000059604645, 0.3125, 0.10000000149011612, 0.10000000149011612], [0.4625000059604645, 0.3125, 0.20000000298023224, 0.20000000298023224], [0.48750001192092896, 0.3125, 0.10000000149011612, 0.10000000149011612], [0.48750001192092896, 0.3125, 0.20000000298023224, 0.20000000298023224], [0.512499988079071, 0.3125, 0.10000000149011612, 0.10000000149011612], [0.512499988079071, 0.3125, 0.20000000298023224, 0.20000000298023224], [0.5375000238418579, 0.3125, 0.10000000149011612, 0.10000000149011612], [0.5375000238418579, 0.3125, 0.20000000298023224, 0.20000000298023224], [0.5625, 0.3125, 0.10000000149011612, 0.10000000149011612], [0.5625, 0.3125, 0.20000000298023224, 0.20000000298023224], [0.5874999761581421, 0.3125, 0.10000000149011612, 0.10000000149011612], [0.5874999761581421, 0.3125, 0.20000000298023224, 0.20000000298023224], [0.612500011920929, 0.3125, 0.10000000149011612, 0.10000000149011612], [0.612500011920929, 0.3125, 0.20000000298023224, 0.20000000298023224], [0.637499988079071, 0.3125, 0.10000000149011612, 0.10000000149011612], [0.637499988079071, 0.3125, 0.20000000298023224, 0.20000000298023224], [0.6625000238418579, 0.3125, 0.10000000149011612, 0.10000000149011612], [0.6625000238418579, 0.3125, 0.20000000298023224, 0.20000000298023224], [0.6875, 0.3125, 0.10000000149011612, 0.10000000149011612], [0.6875, 0.3125, 0.20000000298023224, 0.20000000298023224], [0.7124999761581421, 0.3125, 0.10000000149011612, 0.10000000149011612], [0.7124999761581421, 0.3125, 0.20000000298023224, 0.20000000298023224], [0.737500011920929, 0.3125, 0.10000000149011612, 0.10000000149011612], [0.737500011920929, 0.3125, 0.20000000298023224, 0.20000000298023224], [0.762499988079071, 0.3125, 0.10000000149011612, 0.10000000149011612], [0.762499988079071, 0.3125, 0.20000000298023224, 0.20000000298023224], [0.7875000238418579, 0.3125, 0.10000000149011612, 0.10000000149011612], [0.7875000238418579, 0.3125, 0.20000000298023224, 0.20000000298023224], [0.8125, 0.3125, 0.10000000149011612, 0.10000000149011612], [0.8125, 0.3125, 0.20000000298023224, 0.20000000298023224], [0.8374999761581421, 0.3125, 0.10000000149011612, 0.10000000149011612], [0.8374999761581421, 0.3125, 0.20000000298023224, 0.20000000298023224], [0.862500011920929, 0.3125, 0.10000000149011612, 0.10000000149011612], [0.862500011920929, 0.3125, 0.20000000298023224, 0.20000000298023224], [0.887499988079071, 0.3125, 0.10000000149011612, 0.10000000149011612], [0.887499988079071, 0.3125, 0.20000000298023224, 0.20000000298023224], [0.9125000238418579, 0.3125, 0.10000000149011612, 0.10000000149011612], [0.9125000238418579, 0.3125, 0.20000000298023224, 0.20000000298023224], [0.9375, 0.3125, 0.10000000149011612, 0.10000000149011612], [0.9375, 0.3125, 0.20000000298023224, 0.20000000298023224], [0.9624999761581421, 0.3125, 0.10000000149011612, 0.10000000149011612], [0.9624999761581421, 0.3125, 0.20000000298023224, 0.20000000298023224], [0.987500011920929, 0.3125, 0.10000000149011612, 0.10000000149011612], [0.987500011920929, 0.3125, 0.20000000298023224, 0.20000000298023224], [0.012500000186264515, 0.3375000059604645, 0.10000000149011612, 0.10000000149011612], [0.012500000186264515, 0.3375000059604645, 0.20000000298023224, 0.20000000298023224], [0.03750000149011612, 0.3375000059604645, 0.10000000149011612, 0.10000000149011612], [0.03750000149011612, 0.3375000059604645, 0.20000000298023224, 0.20000000298023224], [0.0625, 0.3375000059604645, 0.10000000149011612, 0.10000000149011612], [0.0625, 0.3375000059604645, 0.20000000298023224, 0.20000000298023224], [0.08749999850988388, 0.3375000059604645, 0.10000000149011612, 0.10000000149011612], [0.08749999850988388, 0.3375000059604645, 0.20000000298023224, 0.20000000298023224], [0.11249999701976776, 0.3375000059604645, 0.10000000149011612, 0.10000000149011612], [0.11249999701976776, 0.3375000059604645, 0.20000000298023224, 0.20000000298023224], [0.13750000298023224, 0.3375000059604645, 0.10000000149011612, 0.10000000149011612], [0.13750000298023224, 0.3375000059604645, 0.20000000298023224, 0.20000000298023224], [0.16249999403953552, 0.3375000059604645, 0.10000000149011612, 0.10000000149011612], [0.16249999403953552, 0.3375000059604645, 0.20000000298023224, 0.20000000298023224], [0.1875, 0.3375000059604645, 0.10000000149011612, 0.10000000149011612], [0.1875, 0.3375000059604645, 0.20000000298023224, 0.20000000298023224], [0.21250000596046448, 0.3375000059604645, 0.10000000149011612, 0.10000000149011612], [0.21250000596046448, 0.3375000059604645, 0.20000000298023224, 0.20000000298023224], [0.23749999701976776, 0.3375000059604645, 0.10000000149011612, 0.10000000149011612], [0.23749999701976776, 0.3375000059604645, 0.20000000298023224, 0.20000000298023224], [0.26249998807907104, 0.3375000059604645, 0.10000000149011612, 0.10000000149011612], [0.26249998807907104, 0.3375000059604645, 0.20000000298023224, 0.20000000298023224], [0.2874999940395355, 0.3375000059604645, 0.10000000149011612, 0.10000000149011612], [0.2874999940395355, 0.3375000059604645, 0.20000000298023224, 0.20000000298023224], [0.3125, 0.3375000059604645, 0.10000000149011612, 0.10000000149011612], [0.3125, 0.3375000059604645, 0.20000000298023224, 0.20000000298023224], [0.3375000059604645, 0.3375000059604645, 0.10000000149011612, 0.10000000149011612], [0.3375000059604645, 0.3375000059604645, 0.20000000298023224, 0.20000000298023224], [0.36250001192092896, 0.3375000059604645, 0.10000000149011612, 0.10000000149011612], [0.36250001192092896, 0.3375000059604645, 0.20000000298023224, 0.20000000298023224], [0.38749998807907104, 0.3375000059604645, 0.10000000149011612, 0.10000000149011612], [0.38749998807907104, 0.3375000059604645, 0.20000000298023224, 0.20000000298023224], [0.4124999940395355, 0.3375000059604645, 0.10000000149011612, 0.10000000149011612], [0.4124999940395355, 0.3375000059604645, 0.20000000298023224, 0.20000000298023224], [0.4375, 0.3375000059604645, 0.10000000149011612, 0.10000000149011612], [0.4375, 0.3375000059604645, 0.20000000298023224, 0.20000000298023224], [0.4625000059604645, 0.3375000059604645, 0.10000000149011612, 0.10000000149011612], [0.4625000059604645, 0.3375000059604645, 0.20000000298023224, 0.20000000298023224], [0.48750001192092896, 0.3375000059604645, 0.10000000149011612, 0.10000000149011612], [0.48750001192092896, 0.3375000059604645, 0.20000000298023224, 0.20000000298023224], [0.512499988079071, 0.3375000059604645, 0.10000000149011612, 0.10000000149011612], [0.512499988079071, 0.3375000059604645, 0.20000000298023224, 0.20000000298023224], [0.5375000238418579, 0.3375000059604645, 0.10000000149011612, 0.10000000149011612], [0.5375000238418579, 0.3375000059604645, 0.20000000298023224, 0.20000000298023224], [0.5625, 0.3375000059604645, 0.10000000149011612, 0.10000000149011612], [0.5625, 0.3375000059604645, 0.20000000298023224, 0.20000000298023224], [0.5874999761581421, 0.3375000059604645, 0.10000000149011612, 0.10000000149011612], [0.5874999761581421, 0.3375000059604645, 0.20000000298023224, 0.20000000298023224], [0.612500011920929, 0.3375000059604645, 0.10000000149011612, 0.10000000149011612], [0.612500011920929, 0.3375000059604645, 0.20000000298023224, 0.20000000298023224], [0.637499988079071, 0.3375000059604645, 0.10000000149011612, 0.10000000149011612], [0.637499988079071, 0.3375000059604645, 0.20000000298023224, 0.20000000298023224], [0.6625000238418579, 0.3375000059604645, 0.10000000149011612, 0.10000000149011612], [0.6625000238418579, 0.3375000059604645, 0.20000000298023224, 0.20000000298023224], [0.6875, 0.3375000059604645, 0.10000000149011612, 0.10000000149011612], [0.6875, 0.3375000059604645, 0.20000000298023224, 0.20000000298023224], [0.7124999761581421, 0.3375000059604645, 0.10000000149011612, 0.10000000149011612], [0.7124999761581421, 0.3375000059604645, 0.20000000298023224, 0.20000000298023224], [0.737500011920929, 0.3375000059604645, 0.10000000149011612, 0.10000000149011612], [0.737500011920929, 0.3375000059604645, 0.20000000298023224, 0.20000000298023224], [0.762499988079071, 0.3375000059604645, 0.10000000149011612, 0.10000000149011612], [0.762499988079071, 0.3375000059604645, 0.20000000298023224, 0.20000000298023224], [0.7875000238418579, 0.3375000059604645, 0.10000000149011612, 0.10000000149011612], [0.7875000238418579, 0.3375000059604645, 0.20000000298023224, 0.20000000298023224], [0.8125, 0.3375000059604645, 0.10000000149011612, 0.10000000149011612], [0.8125, 0.3375000059604645, 0.20000000298023224, 0.20000000298023224], [0.8374999761581421, 0.3375000059604645, 0.10000000149011612, 0.10000000149011612], [0.8374999761581421, 0.3375000059604645, 0.20000000298023224, 0.20000000298023224], [0.862500011920929, 0.3375000059604645, 0.10000000149011612, 0.10000000149011612], [0.862500011920929, 0.3375000059604645, 0.20000000298023224, 0.20000000298023224], [0.887499988079071, 0.3375000059604645, 0.10000000149011612, 0.10000000149011612], [0.887499988079071, 0.3375000059604645, 0.20000000298023224, 0.20000000298023224], [0.9125000238418579, 0.3375000059604645, 0.10000000149011612, 0.10000000149011612], [0.9125000238418579, 0.3375000059604645, 0.20000000298023224, 0.20000000298023224], [0.9375, 0.3375000059604645, 0.10000000149011612, 0.10000000149011612], [0.9375, 0.3375000059604645, 0.20000000298023224, 0.20000000298023224], [0.9624999761581421, 0.3375000059604645, 0.10000000149011612, 0.10000000149011612], [0.9624999761581421, 0.3375000059604645, 0.20000000298023224, 0.20000000298023224], [0.987500011920929, 0.3375000059604645, 0.10000000149011612, 0.10000000149011612], [0.987500011920929, 0.3375000059604645, 0.20000000298023224, 0.20000000298023224], [0.012500000186264515, 0.36250001192092896, 0.10000000149011612, 0.10000000149011612], [0.012500000186264515, 0.36250001192092896, 0.20000000298023224, 0.20000000298023224], [0.03750000149011612, 0.36250001192092896, 0.10000000149011612, 0.10000000149011612], [0.03750000149011612, 0.36250001192092896, 0.20000000298023224, 0.20000000298023224], [0.0625, 0.36250001192092896, 0.10000000149011612, 0.10000000149011612], [0.0625, 0.36250001192092896, 0.20000000298023224, 0.20000000298023224], [0.08749999850988388, 0.36250001192092896, 0.10000000149011612, 0.10000000149011612], [0.08749999850988388, 0.36250001192092896, 0.20000000298023224, 0.20000000298023224], [0.11249999701976776, 0.36250001192092896, 0.10000000149011612, 0.10000000149011612], [0.11249999701976776, 0.36250001192092896, 0.20000000298023224, 0.20000000298023224], [0.13750000298023224, 0.36250001192092896, 0.10000000149011612, 0.10000000149011612], [0.13750000298023224, 0.36250001192092896, 0.20000000298023224, 0.20000000298023224], [0.16249999403953552, 0.36250001192092896, 0.10000000149011612, 0.10000000149011612], [0.16249999403953552, 0.36250001192092896, 0.20000000298023224, 0.20000000298023224], [0.1875, 0.36250001192092896, 0.10000000149011612, 0.10000000149011612], [0.1875, 0.36250001192092896, 0.20000000298023224, 0.20000000298023224], [0.21250000596046448, 0.36250001192092896, 0.10000000149011612, 0.10000000149011612], [0.21250000596046448, 0.36250001192092896, 0.20000000298023224, 0.20000000298023224], [0.23749999701976776, 0.36250001192092896, 0.10000000149011612, 0.10000000149011612], [0.23749999701976776, 0.36250001192092896, 0.20000000298023224, 0.20000000298023224], [0.26249998807907104, 0.36250001192092896, 0.10000000149011612, 0.10000000149011612], [0.26249998807907104, 0.36250001192092896, 0.20000000298023224, 0.20000000298023224], [0.2874999940395355, 0.36250001192092896, 0.10000000149011612, 0.10000000149011612], [0.2874999940395355, 0.36250001192092896, 0.20000000298023224, 0.20000000298023224], [0.3125, 0.36250001192092896, 0.10000000149011612, 0.10000000149011612], [0.3125, 0.36250001192092896, 0.20000000298023224, 0.20000000298023224], [0.3375000059604645, 0.36250001192092896, 0.10000000149011612, 0.10000000149011612], [0.3375000059604645, 0.36250001192092896, 0.20000000298023224, 0.20000000298023224], [0.36250001192092896, 0.36250001192092896, 0.10000000149011612, 0.10000000149011612], [0.36250001192092896, 0.36250001192092896, 0.20000000298023224, 0.20000000298023224], [0.38749998807907104, 0.36250001192092896, 0.10000000149011612, 0.10000000149011612], [0.38749998807907104, 0.36250001192092896, 0.20000000298023224, 0.20000000298023224], [0.4124999940395355, 0.36250001192092896, 0.10000000149011612, 0.10000000149011612], [0.4124999940395355, 0.36250001192092896, 0.20000000298023224, 0.20000000298023224], [0.4375, 0.36250001192092896, 0.10000000149011612, 0.10000000149011612], [0.4375, 0.36250001192092896, 0.20000000298023224, 0.20000000298023224], [0.4625000059604645, 0.36250001192092896, 0.10000000149011612, 0.10000000149011612], [0.4625000059604645, 0.36250001192092896, 0.20000000298023224, 0.20000000298023224], [0.48750001192092896, 0.36250001192092896, 0.10000000149011612, 0.10000000149011612], [0.48750001192092896, 0.36250001192092896, 0.20000000298023224, 0.20000000298023224], [0.512499988079071, 0.36250001192092896, 0.10000000149011612, 0.10000000149011612], [0.512499988079071, 0.36250001192092896, 0.20000000298023224, 0.20000000298023224], [0.5375000238418579, 0.36250001192092896, 0.10000000149011612, 0.10000000149011612], [0.5375000238418579, 0.36250001192092896, 0.20000000298023224, 0.20000000298023224], [0.5625, 0.36250001192092896, 0.10000000149011612, 0.10000000149011612], [0.5625, 0.36250001192092896, 0.20000000298023224, 0.20000000298023224], [0.5874999761581421, 0.36250001192092896, 0.10000000149011612, 0.10000000149011612], [0.5874999761581421, 0.36250001192092896, 0.20000000298023224, 0.20000000298023224], [0.612500011920929, 0.36250001192092896, 0.10000000149011612, 0.10000000149011612], [0.612500011920929, 0.36250001192092896, 0.20000000298023224, 0.20000000298023224], [0.637499988079071, 0.36250001192092896, 0.10000000149011612, 0.10000000149011612], [0.637499988079071, 0.36250001192092896, 0.20000000298023224, 0.20000000298023224], [0.6625000238418579, 0.36250001192092896, 0.10000000149011612, 0.10000000149011612], [0.6625000238418579, 0.36250001192092896, 0.20000000298023224, 0.20000000298023224], [0.6875, 0.36250001192092896, 0.10000000149011612, 0.10000000149011612], [0.6875, 0.36250001192092896, 0.20000000298023224, 0.20000000298023224], [0.7124999761581421, 0.36250001192092896, 0.10000000149011612, 0.10000000149011612], [0.7124999761581421, 0.36250001192092896, 0.20000000298023224, 0.20000000298023224], [0.737500011920929, 0.36250001192092896, 0.10000000149011612, 0.10000000149011612], [0.737500011920929, 0.36250001192092896, 0.20000000298023224, 0.20000000298023224], [0.762499988079071, 0.36250001192092896, 0.10000000149011612, 0.10000000149011612], [0.762499988079071, 0.36250001192092896, 0.20000000298023224, 0.20000000298023224], [0.7875000238418579, 0.36250001192092896, 0.10000000149011612, 0.10000000149011612], [0.7875000238418579, 0.36250001192092896, 0.20000000298023224, 0.20000000298023224], [0.8125, 0.36250001192092896, 0.10000000149011612, 0.10000000149011612], [0.8125, 0.36250001192092896, 0.20000000298023224, 0.20000000298023224], [0.8374999761581421, 0.36250001192092896, 0.10000000149011612, 0.10000000149011612], [0.8374999761581421, 0.36250001192092896, 0.20000000298023224, 0.20000000298023224], [0.862500011920929, 0.36250001192092896, 0.10000000149011612, 0.10000000149011612], [0.862500011920929, 0.36250001192092896, 0.20000000298023224, 0.20000000298023224], [0.887499988079071, 0.36250001192092896, 0.10000000149011612, 0.10000000149011612], [0.887499988079071, 0.36250001192092896, 0.20000000298023224, 0.20000000298023224], [0.9125000238418579, 0.36250001192092896, 0.10000000149011612, 0.10000000149011612], [0.9125000238418579, 0.36250001192092896, 0.20000000298023224, 0.20000000298023224], [0.9375, 0.36250001192092896, 0.10000000149011612, 0.10000000149011612], [0.9375, 0.36250001192092896, 0.20000000298023224, 0.20000000298023224], [0.9624999761581421, 0.36250001192092896, 0.10000000149011612, 0.10000000149011612], [0.9624999761581421, 0.36250001192092896, 0.20000000298023224, 0.20000000298023224], [0.987500011920929, 0.36250001192092896, 0.10000000149011612, 0.10000000149011612], [0.987500011920929, 0.36250001192092896, 0.20000000298023224, 0.20000000298023224], [0.012500000186264515, 0.38749998807907104, 0.10000000149011612, 0.10000000149011612], [0.012500000186264515, 0.38749998807907104, 0.20000000298023224, 0.20000000298023224], [0.03750000149011612, 0.38749998807907104, 0.10000000149011612, 0.10000000149011612], [0.03750000149011612, 0.38749998807907104, 0.20000000298023224, 0.20000000298023224], [0.0625, 0.38749998807907104, 0.10000000149011612, 0.10000000149011612], [0.0625, 0.38749998807907104, 0.20000000298023224, 0.20000000298023224], [0.08749999850988388, 0.38749998807907104, 0.10000000149011612, 0.10000000149011612], [0.08749999850988388, 0.38749998807907104, 0.20000000298023224, 0.20000000298023224], [0.11249999701976776, 0.38749998807907104, 0.10000000149011612, 0.10000000149011612], [0.11249999701976776, 0.38749998807907104, 0.20000000298023224, 0.20000000298023224], [0.13750000298023224, 0.38749998807907104, 0.10000000149011612, 0.10000000149011612], [0.13750000298023224, 0.38749998807907104, 0.20000000298023224, 0.20000000298023224], [0.16249999403953552, 0.38749998807907104, 0.10000000149011612, 0.10000000149011612], [0.16249999403953552, 0.38749998807907104, 0.20000000298023224, 0.20000000298023224], [0.1875, 0.38749998807907104, 0.10000000149011612, 0.10000000149011612], [0.1875, 0.38749998807907104, 0.20000000298023224, 0.20000000298023224], [0.21250000596046448, 0.38749998807907104, 0.10000000149011612, 0.10000000149011612], [0.21250000596046448, 0.38749998807907104, 0.20000000298023224, 0.20000000298023224], [0.23749999701976776, 0.38749998807907104, 0.10000000149011612, 0.10000000149011612], [0.23749999701976776, 0.38749998807907104, 0.20000000298023224, 0.20000000298023224], [0.26249998807907104, 0.38749998807907104, 0.10000000149011612, 0.10000000149011612], [0.26249998807907104, 0.38749998807907104, 0.20000000298023224, 0.20000000298023224], [0.2874999940395355, 0.38749998807907104, 0.10000000149011612, 0.10000000149011612], [0.2874999940395355, 0.38749998807907104, 0.20000000298023224, 0.20000000298023224], [0.3125, 0.38749998807907104, 0.10000000149011612, 0.10000000149011612], [0.3125, 0.38749998807907104, 0.20000000298023224, 0.20000000298023224], [0.3375000059604645, 0.38749998807907104, 0.10000000149011612, 0.10000000149011612], [0.3375000059604645, 0.38749998807907104, 0.20000000298023224, 0.20000000298023224], [0.36250001192092896, 0.38749998807907104, 0.10000000149011612, 0.10000000149011612], [0.36250001192092896, 0.38749998807907104, 0.20000000298023224, 0.20000000298023224], [0.38749998807907104, 0.38749998807907104, 0.10000000149011612, 0.10000000149011612], [0.38749998807907104, 0.38749998807907104, 0.20000000298023224, 0.20000000298023224], [0.4124999940395355, 0.38749998807907104, 0.10000000149011612, 0.10000000149011612], [0.4124999940395355, 0.38749998807907104, 0.20000000298023224, 0.20000000298023224], [0.4375, 0.38749998807907104, 0.10000000149011612, 0.10000000149011612], [0.4375, 0.38749998807907104, 0.20000000298023224, 0.20000000298023224], [0.4625000059604645, 0.38749998807907104, 0.10000000149011612, 0.10000000149011612], [0.4625000059604645, 0.38749998807907104, 0.20000000298023224, 0.20000000298023224], [0.48750001192092896, 0.38749998807907104, 0.10000000149011612, 0.10000000149011612], [0.48750001192092896, 0.38749998807907104, 0.20000000298023224, 0.20000000298023224], [0.512499988079071, 0.38749998807907104, 0.10000000149011612, 0.10000000149011612], [0.512499988079071, 0.38749998807907104, 0.20000000298023224, 0.20000000298023224], [0.5375000238418579, 0.38749998807907104, 0.10000000149011612, 0.10000000149011612], [0.5375000238418579, 0.38749998807907104, 0.20000000298023224, 0.20000000298023224], [0.5625, 0.38749998807907104, 0.10000000149011612, 0.10000000149011612], [0.5625, 0.38749998807907104, 0.20000000298023224, 0.20000000298023224], [0.5874999761581421, 0.38749998807907104, 0.10000000149011612, 0.10000000149011612], [0.5874999761581421, 0.38749998807907104, 0.20000000298023224, 0.20000000298023224], [0.612500011920929, 0.38749998807907104, 0.10000000149011612, 0.10000000149011612], [0.612500011920929, 0.38749998807907104, 0.20000000298023224, 0.20000000298023224], [0.637499988079071, 0.38749998807907104, 0.10000000149011612, 0.10000000149011612], [0.637499988079071, 0.38749998807907104, 0.20000000298023224, 0.20000000298023224], [0.6625000238418579, 0.38749998807907104, 0.10000000149011612, 0.10000000149011612], [0.6625000238418579, 0.38749998807907104, 0.20000000298023224, 0.20000000298023224], [0.6875, 0.38749998807907104, 0.10000000149011612, 0.10000000149011612], [0.6875, 0.38749998807907104, 0.20000000298023224, 0.20000000298023224], [0.7124999761581421, 0.38749998807907104, 0.10000000149011612, 0.10000000149011612], [0.7124999761581421, 0.38749998807907104, 0.20000000298023224, 0.20000000298023224], [0.737500011920929, 0.38749998807907104, 0.10000000149011612, 0.10000000149011612], [0.737500011920929, 0.38749998807907104, 0.20000000298023224, 0.20000000298023224], [0.762499988079071, 0.38749998807907104, 0.10000000149011612, 0.10000000149011612], [0.762499988079071, 0.38749998807907104, 0.20000000298023224, 0.20000000298023224], [0.7875000238418579, 0.38749998807907104, 0.10000000149011612, 0.10000000149011612], [0.7875000238418579, 0.38749998807907104, 0.20000000298023224, 0.20000000298023224], [0.8125, 0.38749998807907104, 0.10000000149011612, 0.10000000149011612], [0.8125, 0.38749998807907104, 0.20000000298023224, 0.20000000298023224], [0.8374999761581421, 0.38749998807907104, 0.10000000149011612, 0.10000000149011612], [0.8374999761581421, 0.38749998807907104, 0.20000000298023224, 0.20000000298023224], [0.862500011920929, 0.38749998807907104, 0.10000000149011612, 0.10000000149011612], [0.862500011920929, 0.38749998807907104, 0.20000000298023224, 0.20000000298023224], [0.887499988079071, 0.38749998807907104, 0.10000000149011612, 0.10000000149011612], [0.887499988079071, 0.38749998807907104, 0.20000000298023224, 0.20000000298023224], [0.9125000238418579, 0.38749998807907104, 0.10000000149011612, 0.10000000149011612], [0.9125000238418579, 0.38749998807907104, 0.20000000298023224, 0.20000000298023224], [0.9375, 0.38749998807907104, 0.10000000149011612, 0.10000000149011612], [0.9375, 0.38749998807907104, 0.20000000298023224, 0.20000000298023224], [0.9624999761581421, 0.38749998807907104, 0.10000000149011612, 0.10000000149011612], [0.9624999761581421, 0.38749998807907104, 0.20000000298023224, 0.20000000298023224], [0.987500011920929, 0.38749998807907104, 0.10000000149011612, 0.10000000149011612], [0.987500011920929, 0.38749998807907104, 0.20000000298023224, 0.20000000298023224], [0.012500000186264515, 0.4124999940395355, 0.10000000149011612, 0.10000000149011612], [0.012500000186264515, 0.4124999940395355, 0.20000000298023224, 0.20000000298023224], [0.03750000149011612, 0.4124999940395355, 0.10000000149011612, 0.10000000149011612], [0.03750000149011612, 0.4124999940395355, 0.20000000298023224, 0.20000000298023224], [0.0625, 0.4124999940395355, 0.10000000149011612, 0.10000000149011612], [0.0625, 0.4124999940395355, 0.20000000298023224, 0.20000000298023224], [0.08749999850988388, 0.4124999940395355, 0.10000000149011612, 0.10000000149011612], [0.08749999850988388, 0.4124999940395355, 0.20000000298023224, 0.20000000298023224], [0.11249999701976776, 0.4124999940395355, 0.10000000149011612, 0.10000000149011612], [0.11249999701976776, 0.4124999940395355, 0.20000000298023224, 0.20000000298023224], [0.13750000298023224, 0.4124999940395355, 0.10000000149011612, 0.10000000149011612], [0.13750000298023224, 0.4124999940395355, 0.20000000298023224, 0.20000000298023224], [0.16249999403953552, 0.4124999940395355, 0.10000000149011612, 0.10000000149011612], [0.16249999403953552, 0.4124999940395355, 0.20000000298023224, 0.20000000298023224], [0.1875, 0.4124999940395355, 0.10000000149011612, 0.10000000149011612], [0.1875, 0.4124999940395355, 0.20000000298023224, 0.20000000298023224], [0.21250000596046448, 0.4124999940395355, 0.10000000149011612, 0.10000000149011612], [0.21250000596046448, 0.4124999940395355, 0.20000000298023224, 0.20000000298023224], [0.23749999701976776, 0.4124999940395355, 0.10000000149011612, 0.10000000149011612], [0.23749999701976776, 0.4124999940395355, 0.20000000298023224, 0.20000000298023224], [0.26249998807907104, 0.4124999940395355, 0.10000000149011612, 0.10000000149011612], [0.26249998807907104, 0.4124999940395355, 0.20000000298023224, 0.20000000298023224], [0.2874999940395355, 0.4124999940395355, 0.10000000149011612, 0.10000000149011612], [0.2874999940395355, 0.4124999940395355, 0.20000000298023224, 0.20000000298023224], [0.3125, 0.4124999940395355, 0.10000000149011612, 0.10000000149011612], [0.3125, 0.4124999940395355, 0.20000000298023224, 0.20000000298023224], [0.3375000059604645, 0.4124999940395355, 0.10000000149011612, 0.10000000149011612], [0.3375000059604645, 0.4124999940395355, 0.20000000298023224, 0.20000000298023224], [0.36250001192092896, 0.4124999940395355, 0.10000000149011612, 0.10000000149011612], [0.36250001192092896, 0.4124999940395355, 0.20000000298023224, 0.20000000298023224], [0.38749998807907104, 0.4124999940395355, 0.10000000149011612, 0.10000000149011612], [0.38749998807907104, 0.4124999940395355, 0.20000000298023224, 0.20000000298023224], [0.4124999940395355, 0.4124999940395355, 0.10000000149011612, 0.10000000149011612], [0.4124999940395355, 0.4124999940395355, 0.20000000298023224, 0.20000000298023224], [0.4375, 0.4124999940395355, 0.10000000149011612, 0.10000000149011612], [0.4375, 0.4124999940395355, 0.20000000298023224, 0.20000000298023224], [0.4625000059604645, 0.4124999940395355, 0.10000000149011612, 0.10000000149011612], [0.4625000059604645, 0.4124999940395355, 0.20000000298023224, 0.20000000298023224], [0.48750001192092896, 0.4124999940395355, 0.10000000149011612, 0.10000000149011612], [0.48750001192092896, 0.4124999940395355, 0.20000000298023224, 0.20000000298023224], [0.512499988079071, 0.4124999940395355, 0.10000000149011612, 0.10000000149011612], [0.512499988079071, 0.4124999940395355, 0.20000000298023224, 0.20000000298023224], [0.5375000238418579, 0.4124999940395355, 0.10000000149011612, 0.10000000149011612], [0.5375000238418579, 0.4124999940395355, 0.20000000298023224, 0.20000000298023224], [0.5625, 0.4124999940395355, 0.10000000149011612, 0.10000000149011612], [0.5625, 0.4124999940395355, 0.20000000298023224, 0.20000000298023224], [0.5874999761581421, 0.4124999940395355, 0.10000000149011612, 0.10000000149011612], [0.5874999761581421, 0.4124999940395355, 0.20000000298023224, 0.20000000298023224], [0.612500011920929, 0.4124999940395355, 0.10000000149011612, 0.10000000149011612], [0.612500011920929, 0.4124999940395355, 0.20000000298023224, 0.20000000298023224], [0.637499988079071, 0.4124999940395355, 0.10000000149011612, 0.10000000149011612], [0.637499988079071, 0.4124999940395355, 0.20000000298023224, 0.20000000298023224], [0.6625000238418579, 0.4124999940395355, 0.10000000149011612, 0.10000000149011612], [0.6625000238418579, 0.4124999940395355, 0.20000000298023224, 0.20000000298023224], [0.6875, 0.4124999940395355, 0.10000000149011612, 0.10000000149011612], [0.6875, 0.4124999940395355, 0.20000000298023224, 0.20000000298023224], [0.7124999761581421, 0.4124999940395355, 0.10000000149011612, 0.10000000149011612], [0.7124999761581421, 0.4124999940395355, 0.20000000298023224, 0.20000000298023224], [0.737500011920929, 0.4124999940395355, 0.10000000149011612, 0.10000000149011612], [0.737500011920929, 0.4124999940395355, 0.20000000298023224, 0.20000000298023224], [0.762499988079071, 0.4124999940395355, 0.10000000149011612, 0.10000000149011612], [0.762499988079071, 0.4124999940395355, 0.20000000298023224, 0.20000000298023224], [0.7875000238418579, 0.4124999940395355, 0.10000000149011612, 0.10000000149011612], [0.7875000238418579, 0.4124999940395355, 0.20000000298023224, 0.20000000298023224], [0.8125, 0.4124999940395355, 0.10000000149011612, 0.10000000149011612], [0.8125, 0.4124999940395355, 0.20000000298023224, 0.20000000298023224], [0.8374999761581421, 0.4124999940395355, 0.10000000149011612, 0.10000000149011612], [0.8374999761581421, 0.4124999940395355, 0.20000000298023224, 0.20000000298023224], [0.862500011920929, 0.4124999940395355, 0.10000000149011612, 0.10000000149011612], [0.862500011920929, 0.4124999940395355, 0.20000000298023224, 0.20000000298023224], [0.887499988079071, 0.4124999940395355, 0.10000000149011612, 0.10000000149011612], [0.887499988079071, 0.4124999940395355, 0.20000000298023224, 0.20000000298023224], [0.9125000238418579, 0.4124999940395355, 0.10000000149011612, 0.10000000149011612], [0.9125000238418579, 0.4124999940395355, 0.20000000298023224, 0.20000000298023224], [0.9375, 0.4124999940395355, 0.10000000149011612, 0.10000000149011612], [0.9375, 0.4124999940395355, 0.20000000298023224, 0.20000000298023224], [0.9624999761581421, 0.4124999940395355, 0.10000000149011612, 0.10000000149011612], [0.9624999761581421, 0.4124999940395355, 0.20000000298023224, 0.20000000298023224], [0.987500011920929, 0.4124999940395355, 0.10000000149011612, 0.10000000149011612], [0.987500011920929, 0.4124999940395355, 0.20000000298023224, 0.20000000298023224], [0.012500000186264515, 0.4375, 0.10000000149011612, 0.10000000149011612], [0.012500000186264515, 0.4375, 0.20000000298023224, 0.20000000298023224], [0.03750000149011612, 0.4375, 0.10000000149011612, 0.10000000149011612], [0.03750000149011612, 0.4375, 0.20000000298023224, 0.20000000298023224], [0.0625, 0.4375, 0.10000000149011612, 0.10000000149011612], [0.0625, 0.4375, 0.20000000298023224, 0.20000000298023224], [0.08749999850988388, 0.4375, 0.10000000149011612, 0.10000000149011612], [0.08749999850988388, 0.4375, 0.20000000298023224, 0.20000000298023224], [0.11249999701976776, 0.4375, 0.10000000149011612, 0.10000000149011612], [0.11249999701976776, 0.4375, 0.20000000298023224, 0.20000000298023224], [0.13750000298023224, 0.4375, 0.10000000149011612, 0.10000000149011612], [0.13750000298023224, 0.4375, 0.20000000298023224, 0.20000000298023224], [0.16249999403953552, 0.4375, 0.10000000149011612, 0.10000000149011612], [0.16249999403953552, 0.4375, 0.20000000298023224, 0.20000000298023224], [0.1875, 0.4375, 0.10000000149011612, 0.10000000149011612], [0.1875, 0.4375, 0.20000000298023224, 0.20000000298023224], [0.21250000596046448, 0.4375, 0.10000000149011612, 0.10000000149011612], [0.21250000596046448, 0.4375, 0.20000000298023224, 0.20000000298023224], [0.23749999701976776, 0.4375, 0.10000000149011612, 0.10000000149011612], [0.23749999701976776, 0.4375, 0.20000000298023224, 0.20000000298023224], [0.26249998807907104, 0.4375, 0.10000000149011612, 0.10000000149011612], [0.26249998807907104, 0.4375, 0.20000000298023224, 0.20000000298023224], [0.2874999940395355, 0.4375, 0.10000000149011612, 0.10000000149011612], [0.2874999940395355, 0.4375, 0.20000000298023224, 0.20000000298023224], [0.3125, 0.4375, 0.10000000149011612, 0.10000000149011612], [0.3125, 0.4375, 0.20000000298023224, 0.20000000298023224], [0.3375000059604645, 0.4375, 0.10000000149011612, 0.10000000149011612], [0.3375000059604645, 0.4375, 0.20000000298023224, 0.20000000298023224], [0.36250001192092896, 0.4375, 0.10000000149011612, 0.10000000149011612], [0.36250001192092896, 0.4375, 0.20000000298023224, 0.20000000298023224], [0.38749998807907104, 0.4375, 0.10000000149011612, 0.10000000149011612], [0.38749998807907104, 0.4375, 0.20000000298023224, 0.20000000298023224], [0.4124999940395355, 0.4375, 0.10000000149011612, 0.10000000149011612], [0.4124999940395355, 0.4375, 0.20000000298023224, 0.20000000298023224], [0.4375, 0.4375, 0.10000000149011612, 0.10000000149011612], [0.4375, 0.4375, 0.20000000298023224, 0.20000000298023224], [0.4625000059604645, 0.4375, 0.10000000149011612, 0.10000000149011612], [0.4625000059604645, 0.4375, 0.20000000298023224, 0.20000000298023224], [0.48750001192092896, 0.4375, 0.10000000149011612, 0.10000000149011612], [0.48750001192092896, 0.4375, 0.20000000298023224, 0.20000000298023224], [0.512499988079071, 0.4375, 0.10000000149011612, 0.10000000149011612], [0.512499988079071, 0.4375, 0.20000000298023224, 0.20000000298023224], [0.5375000238418579, 0.4375, 0.10000000149011612, 0.10000000149011612], [0.5375000238418579, 0.4375, 0.20000000298023224, 0.20000000298023224], [0.5625, 0.4375, 0.10000000149011612, 0.10000000149011612], [0.5625, 0.4375, 0.20000000298023224, 0.20000000298023224], [0.5874999761581421, 0.4375, 0.10000000149011612, 0.10000000149011612], [0.5874999761581421, 0.4375, 0.20000000298023224, 0.20000000298023224], [0.612500011920929, 0.4375, 0.10000000149011612, 0.10000000149011612], [0.612500011920929, 0.4375, 0.20000000298023224, 0.20000000298023224], [0.637499988079071, 0.4375, 0.10000000149011612, 0.10000000149011612], [0.637499988079071, 0.4375, 0.20000000298023224, 0.20000000298023224], [0.6625000238418579, 0.4375, 0.10000000149011612, 0.10000000149011612], [0.6625000238418579, 0.4375, 0.20000000298023224, 0.20000000298023224], [0.6875, 0.4375, 0.10000000149011612, 0.10000000149011612], [0.6875, 0.4375, 0.20000000298023224, 0.20000000298023224], [0.7124999761581421, 0.4375, 0.10000000149011612, 0.10000000149011612], [0.7124999761581421, 0.4375, 0.20000000298023224, 0.20000000298023224], [0.737500011920929, 0.4375, 0.10000000149011612, 0.10000000149011612], [0.737500011920929, 0.4375, 0.20000000298023224, 0.20000000298023224], [0.762499988079071, 0.4375, 0.10000000149011612, 0.10000000149011612], [0.762499988079071, 0.4375, 0.20000000298023224, 0.20000000298023224], [0.7875000238418579, 0.4375, 0.10000000149011612, 0.10000000149011612], [0.7875000238418579, 0.4375, 0.20000000298023224, 0.20000000298023224], [0.8125, 0.4375, 0.10000000149011612, 0.10000000149011612], [0.8125, 0.4375, 0.20000000298023224, 0.20000000298023224], [0.8374999761581421, 0.4375, 0.10000000149011612, 0.10000000149011612], [0.8374999761581421, 0.4375, 0.20000000298023224, 0.20000000298023224], [0.862500011920929, 0.4375, 0.10000000149011612, 0.10000000149011612], [0.862500011920929, 0.4375, 0.20000000298023224, 0.20000000298023224], [0.887499988079071, 0.4375, 0.10000000149011612, 0.10000000149011612], [0.887499988079071, 0.4375, 0.20000000298023224, 0.20000000298023224], [0.9125000238418579, 0.4375, 0.10000000149011612, 0.10000000149011612], [0.9125000238418579, 0.4375, 0.20000000298023224, 0.20000000298023224], [0.9375, 0.4375, 0.10000000149011612, 0.10000000149011612], [0.9375, 0.4375, 0.20000000298023224, 0.20000000298023224], [0.9624999761581421, 0.4375, 0.10000000149011612, 0.10000000149011612], [0.9624999761581421, 0.4375, 0.20000000298023224, 0.20000000298023224], [0.987500011920929, 0.4375, 0.10000000149011612, 0.10000000149011612], [0.987500011920929, 0.4375, 0.20000000298023224, 0.20000000298023224], [0.012500000186264515, 0.4625000059604645, 0.10000000149011612, 0.10000000149011612], [0.012500000186264515, 0.4625000059604645, 0.20000000298023224, 0.20000000298023224], [0.03750000149011612, 0.4625000059604645, 0.10000000149011612, 0.10000000149011612], [0.03750000149011612, 0.4625000059604645, 0.20000000298023224, 0.20000000298023224], [0.0625, 0.4625000059604645, 0.10000000149011612, 0.10000000149011612], [0.0625, 0.4625000059604645, 0.20000000298023224, 0.20000000298023224], [0.08749999850988388, 0.4625000059604645, 0.10000000149011612, 0.10000000149011612], [0.08749999850988388, 0.4625000059604645, 0.20000000298023224, 0.20000000298023224], [0.11249999701976776, 0.4625000059604645, 0.10000000149011612, 0.10000000149011612], [0.11249999701976776, 0.4625000059604645, 0.20000000298023224, 0.20000000298023224], [0.13750000298023224, 0.4625000059604645, 0.10000000149011612, 0.10000000149011612], [0.13750000298023224, 0.4625000059604645, 0.20000000298023224, 0.20000000298023224], [0.16249999403953552, 0.4625000059604645, 0.10000000149011612, 0.10000000149011612], [0.16249999403953552, 0.4625000059604645, 0.20000000298023224, 0.20000000298023224], [0.1875, 0.4625000059604645, 0.10000000149011612, 0.10000000149011612], [0.1875, 0.4625000059604645, 0.20000000298023224, 0.20000000298023224], [0.21250000596046448, 0.4625000059604645, 0.10000000149011612, 0.10000000149011612], [0.21250000596046448, 0.4625000059604645, 0.20000000298023224, 0.20000000298023224], [0.23749999701976776, 0.4625000059604645, 0.10000000149011612, 0.10000000149011612], [0.23749999701976776, 0.4625000059604645, 0.20000000298023224, 0.20000000298023224], [0.26249998807907104, 0.4625000059604645, 0.10000000149011612, 0.10000000149011612], [0.26249998807907104, 0.4625000059604645, 0.20000000298023224, 0.20000000298023224], [0.2874999940395355, 0.4625000059604645, 0.10000000149011612, 0.10000000149011612], [0.2874999940395355, 0.4625000059604645, 0.20000000298023224, 0.20000000298023224], [0.3125, 0.4625000059604645, 0.10000000149011612, 0.10000000149011612], [0.3125, 0.4625000059604645, 0.20000000298023224, 0.20000000298023224], [0.3375000059604645, 0.4625000059604645, 0.10000000149011612, 0.10000000149011612], [0.3375000059604645, 0.4625000059604645, 0.20000000298023224, 0.20000000298023224], [0.36250001192092896, 0.4625000059604645, 0.10000000149011612, 0.10000000149011612], [0.36250001192092896, 0.4625000059604645, 0.20000000298023224, 0.20000000298023224], [0.38749998807907104, 0.4625000059604645, 0.10000000149011612, 0.10000000149011612], [0.38749998807907104, 0.4625000059604645, 0.20000000298023224, 0.20000000298023224], [0.4124999940395355, 0.4625000059604645, 0.10000000149011612, 0.10000000149011612], [0.4124999940395355, 0.4625000059604645, 0.20000000298023224, 0.20000000298023224], [0.4375, 0.4625000059604645, 0.10000000149011612, 0.10000000149011612], [0.4375, 0.4625000059604645, 0.20000000298023224, 0.20000000298023224], [0.4625000059604645, 0.4625000059604645, 0.10000000149011612, 0.10000000149011612], [0.4625000059604645, 0.4625000059604645, 0.20000000298023224, 0.20000000298023224], [0.48750001192092896, 0.4625000059604645, 0.10000000149011612, 0.10000000149011612], [0.48750001192092896, 0.4625000059604645, 0.20000000298023224, 0.20000000298023224], [0.512499988079071, 0.4625000059604645, 0.10000000149011612, 0.10000000149011612], [0.512499988079071, 0.4625000059604645, 0.20000000298023224, 0.20000000298023224], [0.5375000238418579, 0.4625000059604645, 0.10000000149011612, 0.10000000149011612], [0.5375000238418579, 0.4625000059604645, 0.20000000298023224, 0.20000000298023224], [0.5625, 0.4625000059604645, 0.10000000149011612, 0.10000000149011612], [0.5625, 0.4625000059604645, 0.20000000298023224, 0.20000000298023224], [0.5874999761581421, 0.4625000059604645, 0.10000000149011612, 0.10000000149011612], [0.5874999761581421, 0.4625000059604645, 0.20000000298023224, 0.20000000298023224], [0.612500011920929, 0.4625000059604645, 0.10000000149011612, 0.10000000149011612], [0.612500011920929, 0.4625000059604645, 0.20000000298023224, 0.20000000298023224], [0.637499988079071, 0.4625000059604645, 0.10000000149011612, 0.10000000149011612], [0.637499988079071, 0.4625000059604645, 0.20000000298023224, 0.20000000298023224], [0.6625000238418579, 0.4625000059604645, 0.10000000149011612, 0.10000000149011612], [0.6625000238418579, 0.4625000059604645, 0.20000000298023224, 0.20000000298023224], [0.6875, 0.4625000059604645, 0.10000000149011612, 0.10000000149011612], [0.6875, 0.4625000059604645, 0.20000000298023224, 0.20000000298023224], [0.7124999761581421, 0.4625000059604645, 0.10000000149011612, 0.10000000149011612], [0.7124999761581421, 0.4625000059604645, 0.20000000298023224, 0.20000000298023224], [0.737500011920929, 0.4625000059604645, 0.10000000149011612, 0.10000000149011612], [0.737500011920929, 0.4625000059604645, 0.20000000298023224, 0.20000000298023224], [0.762499988079071, 0.4625000059604645, 0.10000000149011612, 0.10000000149011612], [0.762499988079071, 0.4625000059604645, 0.20000000298023224, 0.20000000298023224], [0.7875000238418579, 0.4625000059604645, 0.10000000149011612, 0.10000000149011612], [0.7875000238418579, 0.4625000059604645, 0.20000000298023224, 0.20000000298023224], [0.8125, 0.4625000059604645, 0.10000000149011612, 0.10000000149011612], [0.8125, 0.4625000059604645, 0.20000000298023224, 0.20000000298023224], [0.8374999761581421, 0.4625000059604645, 0.10000000149011612, 0.10000000149011612], [0.8374999761581421, 0.4625000059604645, 0.20000000298023224, 0.20000000298023224], [0.862500011920929, 0.4625000059604645, 0.10000000149011612, 0.10000000149011612], [0.862500011920929, 0.4625000059604645, 0.20000000298023224, 0.20000000298023224], [0.887499988079071, 0.4625000059604645, 0.10000000149011612, 0.10000000149011612], [0.887499988079071, 0.4625000059604645, 0.20000000298023224, 0.20000000298023224], [0.9125000238418579, 0.4625000059604645, 0.10000000149011612, 0.10000000149011612], [0.9125000238418579, 0.4625000059604645, 0.20000000298023224, 0.20000000298023224], [0.9375, 0.4625000059604645, 0.10000000149011612, 0.10000000149011612], [0.9375, 0.4625000059604645, 0.20000000298023224, 0.20000000298023224], [0.9624999761581421, 0.4625000059604645, 0.10000000149011612, 0.10000000149011612], [0.9624999761581421, 0.4625000059604645, 0.20000000298023224, 0.20000000298023224], [0.987500011920929, 0.4625000059604645, 0.10000000149011612, 0.10000000149011612], [0.987500011920929, 0.4625000059604645, 0.20000000298023224, 0.20000000298023224], [0.012500000186264515, 0.48750001192092896, 0.10000000149011612, 0.10000000149011612], [0.012500000186264515, 0.48750001192092896, 0.20000000298023224, 0.20000000298023224], [0.03750000149011612, 0.48750001192092896, 0.10000000149011612, 0.10000000149011612], [0.03750000149011612, 0.48750001192092896, 0.20000000298023224, 0.20000000298023224], [0.0625, 0.48750001192092896, 0.10000000149011612, 0.10000000149011612], [0.0625, 0.48750001192092896, 0.20000000298023224, 0.20000000298023224], [0.08749999850988388, 0.48750001192092896, 0.10000000149011612, 0.10000000149011612], [0.08749999850988388, 0.48750001192092896, 0.20000000298023224, 0.20000000298023224], [0.11249999701976776, 0.48750001192092896, 0.10000000149011612, 0.10000000149011612], [0.11249999701976776, 0.48750001192092896, 0.20000000298023224, 0.20000000298023224], [0.13750000298023224, 0.48750001192092896, 0.10000000149011612, 0.10000000149011612], [0.13750000298023224, 0.48750001192092896, 0.20000000298023224, 0.20000000298023224], [0.16249999403953552, 0.48750001192092896, 0.10000000149011612, 0.10000000149011612], [0.16249999403953552, 0.48750001192092896, 0.20000000298023224, 0.20000000298023224], [0.1875, 0.48750001192092896, 0.10000000149011612, 0.10000000149011612], [0.1875, 0.48750001192092896, 0.20000000298023224, 0.20000000298023224], [0.21250000596046448, 0.48750001192092896, 0.10000000149011612, 0.10000000149011612], [0.21250000596046448, 0.48750001192092896, 0.20000000298023224, 0.20000000298023224], [0.23749999701976776, 0.48750001192092896, 0.10000000149011612, 0.10000000149011612], [0.23749999701976776, 0.48750001192092896, 0.20000000298023224, 0.20000000298023224], [0.26249998807907104, 0.48750001192092896, 0.10000000149011612, 0.10000000149011612], [0.26249998807907104, 0.48750001192092896, 0.20000000298023224, 0.20000000298023224], [0.2874999940395355, 0.48750001192092896, 0.10000000149011612, 0.10000000149011612], [0.2874999940395355, 0.48750001192092896, 0.20000000298023224, 0.20000000298023224], [0.3125, 0.48750001192092896, 0.10000000149011612, 0.10000000149011612], [0.3125, 0.48750001192092896, 0.20000000298023224, 0.20000000298023224], [0.3375000059604645, 0.48750001192092896, 0.10000000149011612, 0.10000000149011612], [0.3375000059604645, 0.48750001192092896, 0.20000000298023224, 0.20000000298023224], [0.36250001192092896, 0.48750001192092896, 0.10000000149011612, 0.10000000149011612], [0.36250001192092896, 0.48750001192092896, 0.20000000298023224, 0.20000000298023224], [0.38749998807907104, 0.48750001192092896, 0.10000000149011612, 0.10000000149011612], [0.38749998807907104, 0.48750001192092896, 0.20000000298023224, 0.20000000298023224], [0.4124999940395355, 0.48750001192092896, 0.10000000149011612, 0.10000000149011612], [0.4124999940395355, 0.48750001192092896, 0.20000000298023224, 0.20000000298023224], [0.4375, 0.48750001192092896, 0.10000000149011612, 0.10000000149011612], [0.4375, 0.48750001192092896, 0.20000000298023224, 0.20000000298023224], [0.4625000059604645, 0.48750001192092896, 0.10000000149011612, 0.10000000149011612], [0.4625000059604645, 0.48750001192092896, 0.20000000298023224, 0.20000000298023224], [0.48750001192092896, 0.48750001192092896, 0.10000000149011612, 0.10000000149011612], [0.48750001192092896, 0.48750001192092896, 0.20000000298023224, 0.20000000298023224], [0.512499988079071, 0.48750001192092896, 0.10000000149011612, 0.10000000149011612], [0.512499988079071, 0.48750001192092896, 0.20000000298023224, 0.20000000298023224], [0.5375000238418579, 0.48750001192092896, 0.10000000149011612, 0.10000000149011612], [0.5375000238418579, 0.48750001192092896, 0.20000000298023224, 0.20000000298023224], [0.5625, 0.48750001192092896, 0.10000000149011612, 0.10000000149011612], [0.5625, 0.48750001192092896, 0.20000000298023224, 0.20000000298023224], [0.5874999761581421, 0.48750001192092896, 0.10000000149011612, 0.10000000149011612], [0.5874999761581421, 0.48750001192092896, 0.20000000298023224, 0.20000000298023224], [0.612500011920929, 0.48750001192092896, 0.10000000149011612, 0.10000000149011612], [0.612500011920929, 0.48750001192092896, 0.20000000298023224, 0.20000000298023224], [0.637499988079071, 0.48750001192092896, 0.10000000149011612, 0.10000000149011612], [0.637499988079071, 0.48750001192092896, 0.20000000298023224, 0.20000000298023224], [0.6625000238418579, 0.48750001192092896, 0.10000000149011612, 0.10000000149011612], [0.6625000238418579, 0.48750001192092896, 0.20000000298023224, 0.20000000298023224], [0.6875, 0.48750001192092896, 0.10000000149011612, 0.10000000149011612], [0.6875, 0.48750001192092896, 0.20000000298023224, 0.20000000298023224], [0.7124999761581421, 0.48750001192092896, 0.10000000149011612, 0.10000000149011612], [0.7124999761581421, 0.48750001192092896, 0.20000000298023224, 0.20000000298023224], [0.737500011920929, 0.48750001192092896, 0.10000000149011612, 0.10000000149011612], [0.737500011920929, 0.48750001192092896, 0.20000000298023224, 0.20000000298023224], [0.762499988079071, 0.48750001192092896, 0.10000000149011612, 0.10000000149011612], [0.762499988079071, 0.48750001192092896, 0.20000000298023224, 0.20000000298023224], [0.7875000238418579, 0.48750001192092896, 0.10000000149011612, 0.10000000149011612], [0.7875000238418579, 0.48750001192092896, 0.20000000298023224, 0.20000000298023224], [0.8125, 0.48750001192092896, 0.10000000149011612, 0.10000000149011612], [0.8125, 0.48750001192092896, 0.20000000298023224, 0.20000000298023224], [0.8374999761581421, 0.48750001192092896, 0.10000000149011612, 0.10000000149011612], [0.8374999761581421, 0.48750001192092896, 0.20000000298023224, 0.20000000298023224], [0.862500011920929, 0.48750001192092896, 0.10000000149011612, 0.10000000149011612], [0.862500011920929, 0.48750001192092896, 0.20000000298023224, 0.20000000298023224], [0.887499988079071, 0.48750001192092896, 0.10000000149011612, 0.10000000149011612], [0.887499988079071, 0.48750001192092896, 0.20000000298023224, 0.20000000298023224], [0.9125000238418579, 0.48750001192092896, 0.10000000149011612, 0.10000000149011612], [0.9125000238418579, 0.48750001192092896, 0.20000000298023224, 0.20000000298023224], [0.9375, 0.48750001192092896, 0.10000000149011612, 0.10000000149011612], [0.9375, 0.48750001192092896, 0.20000000298023224, 0.20000000298023224], [0.9624999761581421, 0.48750001192092896, 0.10000000149011612, 0.10000000149011612], [0.9624999761581421, 0.48750001192092896, 0.20000000298023224, 0.20000000298023224], [0.987500011920929, 0.48750001192092896, 0.10000000149011612, 0.10000000149011612], [0.987500011920929, 0.48750001192092896, 0.20000000298023224, 0.20000000298023224], [0.012500000186264515, 0.512499988079071, 0.10000000149011612, 0.10000000149011612], [0.012500000186264515, 0.512499988079071, 0.20000000298023224, 0.20000000298023224], [0.03750000149011612, 0.512499988079071, 0.10000000149011612, 0.10000000149011612], [0.03750000149011612, 0.512499988079071, 0.20000000298023224, 0.20000000298023224], [0.0625, 0.512499988079071, 0.10000000149011612, 0.10000000149011612], [0.0625, 0.512499988079071, 0.20000000298023224, 0.20000000298023224], [0.08749999850988388, 0.512499988079071, 0.10000000149011612, 0.10000000149011612], [0.08749999850988388, 0.512499988079071, 0.20000000298023224, 0.20000000298023224], [0.11249999701976776, 0.512499988079071, 0.10000000149011612, 0.10000000149011612], [0.11249999701976776, 0.512499988079071, 0.20000000298023224, 0.20000000298023224], [0.13750000298023224, 0.512499988079071, 0.10000000149011612, 0.10000000149011612], [0.13750000298023224, 0.512499988079071, 0.20000000298023224, 0.20000000298023224], [0.16249999403953552, 0.512499988079071, 0.10000000149011612, 0.10000000149011612], [0.16249999403953552, 0.512499988079071, 0.20000000298023224, 0.20000000298023224], [0.1875, 0.512499988079071, 0.10000000149011612, 0.10000000149011612], [0.1875, 0.512499988079071, 0.20000000298023224, 0.20000000298023224], [0.21250000596046448, 0.512499988079071, 0.10000000149011612, 0.10000000149011612], [0.21250000596046448, 0.512499988079071, 0.20000000298023224, 0.20000000298023224], [0.23749999701976776, 0.512499988079071, 0.10000000149011612, 0.10000000149011612], [0.23749999701976776, 0.512499988079071, 0.20000000298023224, 0.20000000298023224], [0.26249998807907104, 0.512499988079071, 0.10000000149011612, 0.10000000149011612], [0.26249998807907104, 0.512499988079071, 0.20000000298023224, 0.20000000298023224], [0.2874999940395355, 0.512499988079071, 0.10000000149011612, 0.10000000149011612], [0.2874999940395355, 0.512499988079071, 0.20000000298023224, 0.20000000298023224], [0.3125, 0.512499988079071, 0.10000000149011612, 0.10000000149011612], [0.3125, 0.512499988079071, 0.20000000298023224, 0.20000000298023224], [0.3375000059604645, 0.512499988079071, 0.10000000149011612, 0.10000000149011612], [0.3375000059604645, 0.512499988079071, 0.20000000298023224, 0.20000000298023224], [0.36250001192092896, 0.512499988079071, 0.10000000149011612, 0.10000000149011612], [0.36250001192092896, 0.512499988079071, 0.20000000298023224, 0.20000000298023224], [0.38749998807907104, 0.512499988079071, 0.10000000149011612, 0.10000000149011612], [0.38749998807907104, 0.512499988079071, 0.20000000298023224, 0.20000000298023224], [0.4124999940395355, 0.512499988079071, 0.10000000149011612, 0.10000000149011612], [0.4124999940395355, 0.512499988079071, 0.20000000298023224, 0.20000000298023224], [0.4375, 0.512499988079071, 0.10000000149011612, 0.10000000149011612], [0.4375, 0.512499988079071, 0.20000000298023224, 0.20000000298023224], [0.4625000059604645, 0.512499988079071, 0.10000000149011612, 0.10000000149011612], [0.4625000059604645, 0.512499988079071, 0.20000000298023224, 0.20000000298023224], [0.48750001192092896, 0.512499988079071, 0.10000000149011612, 0.10000000149011612], [0.48750001192092896, 0.512499988079071, 0.20000000298023224, 0.20000000298023224], [0.512499988079071, 0.512499988079071, 0.10000000149011612, 0.10000000149011612], [0.512499988079071, 0.512499988079071, 0.20000000298023224, 0.20000000298023224], [0.5375000238418579, 0.512499988079071, 0.10000000149011612, 0.10000000149011612], [0.5375000238418579, 0.512499988079071, 0.20000000298023224, 0.20000000298023224], [0.5625, 0.512499988079071, 0.10000000149011612, 0.10000000149011612], [0.5625, 0.512499988079071, 0.20000000298023224, 0.20000000298023224], [0.5874999761581421, 0.512499988079071, 0.10000000149011612, 0.10000000149011612], [0.5874999761581421, 0.512499988079071, 0.20000000298023224, 0.20000000298023224], [0.612500011920929, 0.512499988079071, 0.10000000149011612, 0.10000000149011612], [0.612500011920929, 0.512499988079071, 0.20000000298023224, 0.20000000298023224], [0.637499988079071, 0.512499988079071, 0.10000000149011612, 0.10000000149011612], [0.637499988079071, 0.512499988079071, 0.20000000298023224, 0.20000000298023224], [0.6625000238418579, 0.512499988079071, 0.10000000149011612, 0.10000000149011612], [0.6625000238418579, 0.512499988079071, 0.20000000298023224, 0.20000000298023224], [0.6875, 0.512499988079071, 0.10000000149011612, 0.10000000149011612], [0.6875, 0.512499988079071, 0.20000000298023224, 0.20000000298023224], [0.7124999761581421, 0.512499988079071, 0.10000000149011612, 0.10000000149011612], [0.7124999761581421, 0.512499988079071, 0.20000000298023224, 0.20000000298023224], [0.737500011920929, 0.512499988079071, 0.10000000149011612, 0.10000000149011612], [0.737500011920929, 0.512499988079071, 0.20000000298023224, 0.20000000298023224], [0.762499988079071, 0.512499988079071, 0.10000000149011612, 0.10000000149011612], [0.762499988079071, 0.512499988079071, 0.20000000298023224, 0.20000000298023224], [0.7875000238418579, 0.512499988079071, 0.10000000149011612, 0.10000000149011612], [0.7875000238418579, 0.512499988079071, 0.20000000298023224, 0.20000000298023224], [0.8125, 0.512499988079071, 0.10000000149011612, 0.10000000149011612], [0.8125, 0.512499988079071, 0.20000000298023224, 0.20000000298023224], [0.8374999761581421, 0.512499988079071, 0.10000000149011612, 0.10000000149011612], [0.8374999761581421, 0.512499988079071, 0.20000000298023224, 0.20000000298023224], [0.862500011920929, 0.512499988079071, 0.10000000149011612, 0.10000000149011612], [0.862500011920929, 0.512499988079071, 0.20000000298023224, 0.20000000298023224], [0.887499988079071, 0.512499988079071, 0.10000000149011612, 0.10000000149011612], [0.887499988079071, 0.512499988079071, 0.20000000298023224, 0.20000000298023224], [0.9125000238418579, 0.512499988079071, 0.10000000149011612, 0.10000000149011612], [0.9125000238418579, 0.512499988079071, 0.20000000298023224, 0.20000000298023224], [0.9375, 0.512499988079071, 0.10000000149011612, 0.10000000149011612], [0.9375, 0.512499988079071, 0.20000000298023224, 0.20000000298023224], [0.9624999761581421, 0.512499988079071, 0.10000000149011612, 0.10000000149011612], [0.9624999761581421, 0.512499988079071, 0.20000000298023224, 0.20000000298023224], [0.987500011920929, 0.512499988079071, 0.10000000149011612, 0.10000000149011612], [0.987500011920929, 0.512499988079071, 0.20000000298023224, 0.20000000298023224], [0.012500000186264515, 0.5375000238418579, 0.10000000149011612, 0.10000000149011612], [0.012500000186264515, 0.5375000238418579, 0.20000000298023224, 0.20000000298023224], [0.03750000149011612, 0.5375000238418579, 0.10000000149011612, 0.10000000149011612], [0.03750000149011612, 0.5375000238418579, 0.20000000298023224, 0.20000000298023224], [0.0625, 0.5375000238418579, 0.10000000149011612, 0.10000000149011612], [0.0625, 0.5375000238418579, 0.20000000298023224, 0.20000000298023224], [0.08749999850988388, 0.5375000238418579, 0.10000000149011612, 0.10000000149011612], [0.08749999850988388, 0.5375000238418579, 0.20000000298023224, 0.20000000298023224], [0.11249999701976776, 0.5375000238418579, 0.10000000149011612, 0.10000000149011612], [0.11249999701976776, 0.5375000238418579, 0.20000000298023224, 0.20000000298023224], [0.13750000298023224, 0.5375000238418579, 0.10000000149011612, 0.10000000149011612], [0.13750000298023224, 0.5375000238418579, 0.20000000298023224, 0.20000000298023224], [0.16249999403953552, 0.5375000238418579, 0.10000000149011612, 0.10000000149011612], [0.16249999403953552, 0.5375000238418579, 0.20000000298023224, 0.20000000298023224], [0.1875, 0.5375000238418579, 0.10000000149011612, 0.10000000149011612], [0.1875, 0.5375000238418579, 0.20000000298023224, 0.20000000298023224], [0.21250000596046448, 0.5375000238418579, 0.10000000149011612, 0.10000000149011612], [0.21250000596046448, 0.5375000238418579, 0.20000000298023224, 0.20000000298023224], [0.23749999701976776, 0.5375000238418579, 0.10000000149011612, 0.10000000149011612], [0.23749999701976776, 0.5375000238418579, 0.20000000298023224, 0.20000000298023224], [0.26249998807907104, 0.5375000238418579, 0.10000000149011612, 0.10000000149011612], [0.26249998807907104, 0.5375000238418579, 0.20000000298023224, 0.20000000298023224], [0.2874999940395355, 0.5375000238418579, 0.10000000149011612, 0.10000000149011612], [0.2874999940395355, 0.5375000238418579, 0.20000000298023224, 0.20000000298023224], [0.3125, 0.5375000238418579, 0.10000000149011612, 0.10000000149011612], [0.3125, 0.5375000238418579, 0.20000000298023224, 0.20000000298023224], [0.3375000059604645, 0.5375000238418579, 0.10000000149011612, 0.10000000149011612], [0.3375000059604645, 0.5375000238418579, 0.20000000298023224, 0.20000000298023224], [0.36250001192092896, 0.5375000238418579, 0.10000000149011612, 0.10000000149011612], [0.36250001192092896, 0.5375000238418579, 0.20000000298023224, 0.20000000298023224], [0.38749998807907104, 0.5375000238418579, 0.10000000149011612, 0.10000000149011612], [0.38749998807907104, 0.5375000238418579, 0.20000000298023224, 0.20000000298023224], [0.4124999940395355, 0.5375000238418579, 0.10000000149011612, 0.10000000149011612], [0.4124999940395355, 0.5375000238418579, 0.20000000298023224, 0.20000000298023224], [0.4375, 0.5375000238418579, 0.10000000149011612, 0.10000000149011612], [0.4375, 0.5375000238418579, 0.20000000298023224, 0.20000000298023224], [0.4625000059604645, 0.5375000238418579, 0.10000000149011612, 0.10000000149011612], [0.4625000059604645, 0.5375000238418579, 0.20000000298023224, 0.20000000298023224], [0.48750001192092896, 0.5375000238418579, 0.10000000149011612, 0.10000000149011612], [0.48750001192092896, 0.5375000238418579, 0.20000000298023224, 0.20000000298023224], [0.512499988079071, 0.5375000238418579, 0.10000000149011612, 0.10000000149011612], [0.512499988079071, 0.5375000238418579, 0.20000000298023224, 0.20000000298023224], [0.5375000238418579, 0.5375000238418579, 0.10000000149011612, 0.10000000149011612], [0.5375000238418579, 0.5375000238418579, 0.20000000298023224, 0.20000000298023224], [0.5625, 0.5375000238418579, 0.10000000149011612, 0.10000000149011612], [0.5625, 0.5375000238418579, 0.20000000298023224, 0.20000000298023224], [0.5874999761581421, 0.5375000238418579, 0.10000000149011612, 0.10000000149011612], [0.5874999761581421, 0.5375000238418579, 0.20000000298023224, 0.20000000298023224], [0.612500011920929, 0.5375000238418579, 0.10000000149011612, 0.10000000149011612], [0.612500011920929, 0.5375000238418579, 0.20000000298023224, 0.20000000298023224], [0.637499988079071, 0.5375000238418579, 0.10000000149011612, 0.10000000149011612], [0.637499988079071, 0.5375000238418579, 0.20000000298023224, 0.20000000298023224], [0.6625000238418579, 0.5375000238418579, 0.10000000149011612, 0.10000000149011612], [0.6625000238418579, 0.5375000238418579, 0.20000000298023224, 0.20000000298023224], [0.6875, 0.5375000238418579, 0.10000000149011612, 0.10000000149011612], [0.6875, 0.5375000238418579, 0.20000000298023224, 0.20000000298023224], [0.7124999761581421, 0.5375000238418579, 0.10000000149011612, 0.10000000149011612], [0.7124999761581421, 0.5375000238418579, 0.20000000298023224, 0.20000000298023224], [0.737500011920929, 0.5375000238418579, 0.10000000149011612, 0.10000000149011612], [0.737500011920929, 0.5375000238418579, 0.20000000298023224, 0.20000000298023224], [0.762499988079071, 0.5375000238418579, 0.10000000149011612, 0.10000000149011612], [0.762499988079071, 0.5375000238418579, 0.20000000298023224, 0.20000000298023224], [0.7875000238418579, 0.5375000238418579, 0.10000000149011612, 0.10000000149011612], [0.7875000238418579, 0.5375000238418579, 0.20000000298023224, 0.20000000298023224], [0.8125, 0.5375000238418579, 0.10000000149011612, 0.10000000149011612], [0.8125, 0.5375000238418579, 0.20000000298023224, 0.20000000298023224], [0.8374999761581421, 0.5375000238418579, 0.10000000149011612, 0.10000000149011612], [0.8374999761581421, 0.5375000238418579, 0.20000000298023224, 0.20000000298023224], [0.862500011920929, 0.5375000238418579, 0.10000000149011612, 0.10000000149011612], [0.862500011920929, 0.5375000238418579, 0.20000000298023224, 0.20000000298023224], [0.887499988079071, 0.5375000238418579, 0.10000000149011612, 0.10000000149011612], [0.887499988079071, 0.5375000238418579, 0.20000000298023224, 0.20000000298023224], [0.9125000238418579, 0.5375000238418579, 0.10000000149011612, 0.10000000149011612], [0.9125000238418579, 0.5375000238418579, 0.20000000298023224, 0.20000000298023224], [0.9375, 0.5375000238418579, 0.10000000149011612, 0.10000000149011612], [0.9375, 0.5375000238418579, 0.20000000298023224, 0.20000000298023224], [0.9624999761581421, 0.5375000238418579, 0.10000000149011612, 0.10000000149011612], [0.9624999761581421, 0.5375000238418579, 0.20000000298023224, 0.20000000298023224], [0.987500011920929, 0.5375000238418579, 0.10000000149011612, 0.10000000149011612], [0.987500011920929, 0.5375000238418579, 0.20000000298023224, 0.20000000298023224], [0.012500000186264515, 0.5625, 0.10000000149011612, 0.10000000149011612], [0.012500000186264515, 0.5625, 0.20000000298023224, 0.20000000298023224], [0.03750000149011612, 0.5625, 0.10000000149011612, 0.10000000149011612], [0.03750000149011612, 0.5625, 0.20000000298023224, 0.20000000298023224], [0.0625, 0.5625, 0.10000000149011612, 0.10000000149011612], [0.0625, 0.5625, 0.20000000298023224, 0.20000000298023224], [0.08749999850988388, 0.5625, 0.10000000149011612, 0.10000000149011612], [0.08749999850988388, 0.5625, 0.20000000298023224, 0.20000000298023224], [0.11249999701976776, 0.5625, 0.10000000149011612, 0.10000000149011612], [0.11249999701976776, 0.5625, 0.20000000298023224, 0.20000000298023224], [0.13750000298023224, 0.5625, 0.10000000149011612, 0.10000000149011612], [0.13750000298023224, 0.5625, 0.20000000298023224, 0.20000000298023224], [0.16249999403953552, 0.5625, 0.10000000149011612, 0.10000000149011612], [0.16249999403953552, 0.5625, 0.20000000298023224, 0.20000000298023224], [0.1875, 0.5625, 0.10000000149011612, 0.10000000149011612], [0.1875, 0.5625, 0.20000000298023224, 0.20000000298023224], [0.21250000596046448, 0.5625, 0.10000000149011612, 0.10000000149011612], [0.21250000596046448, 0.5625, 0.20000000298023224, 0.20000000298023224], [0.23749999701976776, 0.5625, 0.10000000149011612, 0.10000000149011612], [0.23749999701976776, 0.5625, 0.20000000298023224, 0.20000000298023224], [0.26249998807907104, 0.5625, 0.10000000149011612, 0.10000000149011612], [0.26249998807907104, 0.5625, 0.20000000298023224, 0.20000000298023224], [0.2874999940395355, 0.5625, 0.10000000149011612, 0.10000000149011612], [0.2874999940395355, 0.5625, 0.20000000298023224, 0.20000000298023224], [0.3125, 0.5625, 0.10000000149011612, 0.10000000149011612], [0.3125, 0.5625, 0.20000000298023224, 0.20000000298023224], [0.3375000059604645, 0.5625, 0.10000000149011612, 0.10000000149011612], [0.3375000059604645, 0.5625, 0.20000000298023224, 0.20000000298023224], [0.36250001192092896, 0.5625, 0.10000000149011612, 0.10000000149011612], [0.36250001192092896, 0.5625, 0.20000000298023224, 0.20000000298023224], [0.38749998807907104, 0.5625, 0.10000000149011612, 0.10000000149011612], [0.38749998807907104, 0.5625, 0.20000000298023224, 0.20000000298023224], [0.4124999940395355, 0.5625, 0.10000000149011612, 0.10000000149011612], [0.4124999940395355, 0.5625, 0.20000000298023224, 0.20000000298023224], [0.4375, 0.5625, 0.10000000149011612, 0.10000000149011612], [0.4375, 0.5625, 0.20000000298023224, 0.20000000298023224], [0.4625000059604645, 0.5625, 0.10000000149011612, 0.10000000149011612], [0.4625000059604645, 0.5625, 0.20000000298023224, 0.20000000298023224], [0.48750001192092896, 0.5625, 0.10000000149011612, 0.10000000149011612], [0.48750001192092896, 0.5625, 0.20000000298023224, 0.20000000298023224], [0.512499988079071, 0.5625, 0.10000000149011612, 0.10000000149011612], [0.512499988079071, 0.5625, 0.20000000298023224, 0.20000000298023224], [0.5375000238418579, 0.5625, 0.10000000149011612, 0.10000000149011612], [0.5375000238418579, 0.5625, 0.20000000298023224, 0.20000000298023224], [0.5625, 0.5625, 0.10000000149011612, 0.10000000149011612], [0.5625, 0.5625, 0.20000000298023224, 0.20000000298023224], [0.5874999761581421, 0.5625, 0.10000000149011612, 0.10000000149011612], [0.5874999761581421, 0.5625, 0.20000000298023224, 0.20000000298023224], [0.612500011920929, 0.5625, 0.10000000149011612, 0.10000000149011612], [0.612500011920929, 0.5625, 0.20000000298023224, 0.20000000298023224], [0.637499988079071, 0.5625, 0.10000000149011612, 0.10000000149011612], [0.637499988079071, 0.5625, 0.20000000298023224, 0.20000000298023224], [0.6625000238418579, 0.5625, 0.10000000149011612, 0.10000000149011612], [0.6625000238418579, 0.5625, 0.20000000298023224, 0.20000000298023224], [0.6875, 0.5625, 0.10000000149011612, 0.10000000149011612], [0.6875, 0.5625, 0.20000000298023224, 0.20000000298023224], [0.7124999761581421, 0.5625, 0.10000000149011612, 0.10000000149011612], [0.7124999761581421, 0.5625, 0.20000000298023224, 0.20000000298023224], [0.737500011920929, 0.5625, 0.10000000149011612, 0.10000000149011612], [0.737500011920929, 0.5625, 0.20000000298023224, 0.20000000298023224], [0.762499988079071, 0.5625, 0.10000000149011612, 0.10000000149011612], [0.762499988079071, 0.5625, 0.20000000298023224, 0.20000000298023224], [0.7875000238418579, 0.5625, 0.10000000149011612, 0.10000000149011612], [0.7875000238418579, 0.5625, 0.20000000298023224, 0.20000000298023224], [0.8125, 0.5625, 0.10000000149011612, 0.10000000149011612], [0.8125, 0.5625, 0.20000000298023224, 0.20000000298023224], [0.8374999761581421, 0.5625, 0.10000000149011612, 0.10000000149011612], [0.8374999761581421, 0.5625, 0.20000000298023224, 0.20000000298023224], [0.862500011920929, 0.5625, 0.10000000149011612, 0.10000000149011612], [0.862500011920929, 0.5625, 0.20000000298023224, 0.20000000298023224], [0.887499988079071, 0.5625, 0.10000000149011612, 0.10000000149011612], [0.887499988079071, 0.5625, 0.20000000298023224, 0.20000000298023224], [0.9125000238418579, 0.5625, 0.10000000149011612, 0.10000000149011612], [0.9125000238418579, 0.5625, 0.20000000298023224, 0.20000000298023224], [0.9375, 0.5625, 0.10000000149011612, 0.10000000149011612], [0.9375, 0.5625, 0.20000000298023224, 0.20000000298023224], [0.9624999761581421, 0.5625, 0.10000000149011612, 0.10000000149011612], [0.9624999761581421, 0.5625, 0.20000000298023224, 0.20000000298023224], [0.987500011920929, 0.5625, 0.10000000149011612, 0.10000000149011612], [0.987500011920929, 0.5625, 0.20000000298023224, 0.20000000298023224], [0.012500000186264515, 0.5874999761581421, 0.10000000149011612, 0.10000000149011612], [0.012500000186264515, 0.5874999761581421, 0.20000000298023224, 0.20000000298023224], [0.03750000149011612, 0.5874999761581421, 0.10000000149011612, 0.10000000149011612], [0.03750000149011612, 0.5874999761581421, 0.20000000298023224, 0.20000000298023224], [0.0625, 0.5874999761581421, 0.10000000149011612, 0.10000000149011612], [0.0625, 0.5874999761581421, 0.20000000298023224, 0.20000000298023224], [0.08749999850988388, 0.5874999761581421, 0.10000000149011612, 0.10000000149011612], [0.08749999850988388, 0.5874999761581421, 0.20000000298023224, 0.20000000298023224], [0.11249999701976776, 0.5874999761581421, 0.10000000149011612, 0.10000000149011612], [0.11249999701976776, 0.5874999761581421, 0.20000000298023224, 0.20000000298023224], [0.13750000298023224, 0.5874999761581421, 0.10000000149011612, 0.10000000149011612], [0.13750000298023224, 0.5874999761581421, 0.20000000298023224, 0.20000000298023224], [0.16249999403953552, 0.5874999761581421, 0.10000000149011612, 0.10000000149011612], [0.16249999403953552, 0.5874999761581421, 0.20000000298023224, 0.20000000298023224], [0.1875, 0.5874999761581421, 0.10000000149011612, 0.10000000149011612], [0.1875, 0.5874999761581421, 0.20000000298023224, 0.20000000298023224], [0.21250000596046448, 0.5874999761581421, 0.10000000149011612, 0.10000000149011612], [0.21250000596046448, 0.5874999761581421, 0.20000000298023224, 0.20000000298023224], [0.23749999701976776, 0.5874999761581421, 0.10000000149011612, 0.10000000149011612], [0.23749999701976776, 0.5874999761581421, 0.20000000298023224, 0.20000000298023224], [0.26249998807907104, 0.5874999761581421, 0.10000000149011612, 0.10000000149011612], [0.26249998807907104, 0.5874999761581421, 0.20000000298023224, 0.20000000298023224], [0.2874999940395355, 0.5874999761581421, 0.10000000149011612, 0.10000000149011612], [0.2874999940395355, 0.5874999761581421, 0.20000000298023224, 0.20000000298023224], [0.3125, 0.5874999761581421, 0.10000000149011612, 0.10000000149011612], [0.3125, 0.5874999761581421, 0.20000000298023224, 0.20000000298023224], [0.3375000059604645, 0.5874999761581421, 0.10000000149011612, 0.10000000149011612], [0.3375000059604645, 0.5874999761581421, 0.20000000298023224, 0.20000000298023224], [0.36250001192092896, 0.5874999761581421, 0.10000000149011612, 0.10000000149011612], [0.36250001192092896, 0.5874999761581421, 0.20000000298023224, 0.20000000298023224], [0.38749998807907104, 0.5874999761581421, 0.10000000149011612, 0.10000000149011612], [0.38749998807907104, 0.5874999761581421, 0.20000000298023224, 0.20000000298023224], [0.4124999940395355, 0.5874999761581421, 0.10000000149011612, 0.10000000149011612], [0.4124999940395355, 0.5874999761581421, 0.20000000298023224, 0.20000000298023224], [0.4375, 0.5874999761581421, 0.10000000149011612, 0.10000000149011612], [0.4375, 0.5874999761581421, 0.20000000298023224, 0.20000000298023224], [0.4625000059604645, 0.5874999761581421, 0.10000000149011612, 0.10000000149011612], [0.4625000059604645, 0.5874999761581421, 0.20000000298023224, 0.20000000298023224], [0.48750001192092896, 0.5874999761581421, 0.10000000149011612, 0.10000000149011612], [0.48750001192092896, 0.5874999761581421, 0.20000000298023224, 0.20000000298023224], [0.512499988079071, 0.5874999761581421, 0.10000000149011612, 0.10000000149011612], [0.512499988079071, 0.5874999761581421, 0.20000000298023224, 0.20000000298023224], [0.5375000238418579, 0.5874999761581421, 0.10000000149011612, 0.10000000149011612], [0.5375000238418579, 0.5874999761581421, 0.20000000298023224, 0.20000000298023224], [0.5625, 0.5874999761581421, 0.10000000149011612, 0.10000000149011612], [0.5625, 0.5874999761581421, 0.20000000298023224, 0.20000000298023224], [0.5874999761581421, 0.5874999761581421, 0.10000000149011612, 0.10000000149011612], [0.5874999761581421, 0.5874999761581421, 0.20000000298023224, 0.20000000298023224], [0.612500011920929, 0.5874999761581421, 0.10000000149011612, 0.10000000149011612], [0.612500011920929, 0.5874999761581421, 0.20000000298023224, 0.20000000298023224], [0.637499988079071, 0.5874999761581421, 0.10000000149011612, 0.10000000149011612], [0.637499988079071, 0.5874999761581421, 0.20000000298023224, 0.20000000298023224], [0.6625000238418579, 0.5874999761581421, 0.10000000149011612, 0.10000000149011612], [0.6625000238418579, 0.5874999761581421, 0.20000000298023224, 0.20000000298023224], [0.6875, 0.5874999761581421, 0.10000000149011612, 0.10000000149011612], [0.6875, 0.5874999761581421, 0.20000000298023224, 0.20000000298023224], [0.7124999761581421, 0.5874999761581421, 0.10000000149011612, 0.10000000149011612], [0.7124999761581421, 0.5874999761581421, 0.20000000298023224, 0.20000000298023224], [0.737500011920929, 0.5874999761581421, 0.10000000149011612, 0.10000000149011612], [0.737500011920929, 0.5874999761581421, 0.20000000298023224, 0.20000000298023224], [0.762499988079071, 0.5874999761581421, 0.10000000149011612, 0.10000000149011612], [0.762499988079071, 0.5874999761581421, 0.20000000298023224, 0.20000000298023224], [0.7875000238418579, 0.5874999761581421, 0.10000000149011612, 0.10000000149011612], [0.7875000238418579, 0.5874999761581421, 0.20000000298023224, 0.20000000298023224], [0.8125, 0.5874999761581421, 0.10000000149011612, 0.10000000149011612], [0.8125, 0.5874999761581421, 0.20000000298023224, 0.20000000298023224], [0.8374999761581421, 0.5874999761581421, 0.10000000149011612, 0.10000000149011612], [0.8374999761581421, 0.5874999761581421, 0.20000000298023224, 0.20000000298023224], [0.862500011920929, 0.5874999761581421, 0.10000000149011612, 0.10000000149011612], [0.862500011920929, 0.5874999761581421, 0.20000000298023224, 0.20000000298023224], [0.887499988079071, 0.5874999761581421, 0.10000000149011612, 0.10000000149011612], [0.887499988079071, 0.5874999761581421, 0.20000000298023224, 0.20000000298023224], [0.9125000238418579, 0.5874999761581421, 0.10000000149011612, 0.10000000149011612], [0.9125000238418579, 0.5874999761581421, 0.20000000298023224, 0.20000000298023224], [0.9375, 0.5874999761581421, 0.10000000149011612, 0.10000000149011612], [0.9375, 0.5874999761581421, 0.20000000298023224, 0.20000000298023224], [0.9624999761581421, 0.5874999761581421, 0.10000000149011612, 0.10000000149011612], [0.9624999761581421, 0.5874999761581421, 0.20000000298023224, 0.20000000298023224], [0.987500011920929, 0.5874999761581421, 0.10000000149011612, 0.10000000149011612], [0.987500011920929, 0.5874999761581421, 0.20000000298023224, 0.20000000298023224], [0.012500000186264515, 0.612500011920929, 0.10000000149011612, 0.10000000149011612], [0.012500000186264515, 0.612500011920929, 0.20000000298023224, 0.20000000298023224], [0.03750000149011612, 0.612500011920929, 0.10000000149011612, 0.10000000149011612], [0.03750000149011612, 0.612500011920929, 0.20000000298023224, 0.20000000298023224], [0.0625, 0.612500011920929, 0.10000000149011612, 0.10000000149011612], [0.0625, 0.612500011920929, 0.20000000298023224, 0.20000000298023224], [0.08749999850988388, 0.612500011920929, 0.10000000149011612, 0.10000000149011612], [0.08749999850988388, 0.612500011920929, 0.20000000298023224, 0.20000000298023224], [0.11249999701976776, 0.612500011920929, 0.10000000149011612, 0.10000000149011612], [0.11249999701976776, 0.612500011920929, 0.20000000298023224, 0.20000000298023224], [0.13750000298023224, 0.612500011920929, 0.10000000149011612, 0.10000000149011612], [0.13750000298023224, 0.612500011920929, 0.20000000298023224, 0.20000000298023224], [0.16249999403953552, 0.612500011920929, 0.10000000149011612, 0.10000000149011612], [0.16249999403953552, 0.612500011920929, 0.20000000298023224, 0.20000000298023224], [0.1875, 0.612500011920929, 0.10000000149011612, 0.10000000149011612], [0.1875, 0.612500011920929, 0.20000000298023224, 0.20000000298023224], [0.21250000596046448, 0.612500011920929, 0.10000000149011612, 0.10000000149011612], [0.21250000596046448, 0.612500011920929, 0.20000000298023224, 0.20000000298023224], [0.23749999701976776, 0.612500011920929, 0.10000000149011612, 0.10000000149011612], [0.23749999701976776, 0.612500011920929, 0.20000000298023224, 0.20000000298023224], [0.26249998807907104, 0.612500011920929, 0.10000000149011612, 0.10000000149011612], [0.26249998807907104, 0.612500011920929, 0.20000000298023224, 0.20000000298023224], [0.2874999940395355, 0.612500011920929, 0.10000000149011612, 0.10000000149011612], [0.2874999940395355, 0.612500011920929, 0.20000000298023224, 0.20000000298023224], [0.3125, 0.612500011920929, 0.10000000149011612, 0.10000000149011612], [0.3125, 0.612500011920929, 0.20000000298023224, 0.20000000298023224], [0.3375000059604645, 0.612500011920929, 0.10000000149011612, 0.10000000149011612], [0.3375000059604645, 0.612500011920929, 0.20000000298023224, 0.20000000298023224], [0.36250001192092896, 0.612500011920929, 0.10000000149011612, 0.10000000149011612], [0.36250001192092896, 0.612500011920929, 0.20000000298023224, 0.20000000298023224], [0.38749998807907104, 0.612500011920929, 0.10000000149011612, 0.10000000149011612], [0.38749998807907104, 0.612500011920929, 0.20000000298023224, 0.20000000298023224], [0.4124999940395355, 0.612500011920929, 0.10000000149011612, 0.10000000149011612], [0.4124999940395355, 0.612500011920929, 0.20000000298023224, 0.20000000298023224], [0.4375, 0.612500011920929, 0.10000000149011612, 0.10000000149011612], [0.4375, 0.612500011920929, 0.20000000298023224, 0.20000000298023224], [0.4625000059604645, 0.612500011920929, 0.10000000149011612, 0.10000000149011612], [0.4625000059604645, 0.612500011920929, 0.20000000298023224, 0.20000000298023224], [0.48750001192092896, 0.612500011920929, 0.10000000149011612, 0.10000000149011612], [0.48750001192092896, 0.612500011920929, 0.20000000298023224, 0.20000000298023224], [0.512499988079071, 0.612500011920929, 0.10000000149011612, 0.10000000149011612], [0.512499988079071, 0.612500011920929, 0.20000000298023224, 0.20000000298023224], [0.5375000238418579, 0.612500011920929, 0.10000000149011612, 0.10000000149011612], [0.5375000238418579, 0.612500011920929, 0.20000000298023224, 0.20000000298023224], [0.5625, 0.612500011920929, 0.10000000149011612, 0.10000000149011612], [0.5625, 0.612500011920929, 0.20000000298023224, 0.20000000298023224], [0.5874999761581421, 0.612500011920929, 0.10000000149011612, 0.10000000149011612], [0.5874999761581421, 0.612500011920929, 0.20000000298023224, 0.20000000298023224], [0.612500011920929, 0.612500011920929, 0.10000000149011612, 0.10000000149011612], [0.612500011920929, 0.612500011920929, 0.20000000298023224, 0.20000000298023224], [0.637499988079071, 0.612500011920929, 0.10000000149011612, 0.10000000149011612], [0.637499988079071, 0.612500011920929, 0.20000000298023224, 0.20000000298023224], [0.6625000238418579, 0.612500011920929, 0.10000000149011612, 0.10000000149011612], [0.6625000238418579, 0.612500011920929, 0.20000000298023224, 0.20000000298023224], [0.6875, 0.612500011920929, 0.10000000149011612, 0.10000000149011612], [0.6875, 0.612500011920929, 0.20000000298023224, 0.20000000298023224], [0.7124999761581421, 0.612500011920929, 0.10000000149011612, 0.10000000149011612], [0.7124999761581421, 0.612500011920929, 0.20000000298023224, 0.20000000298023224], [0.737500011920929, 0.612500011920929, 0.10000000149011612, 0.10000000149011612], [0.737500011920929, 0.612500011920929, 0.20000000298023224, 0.20000000298023224], [0.762499988079071, 0.612500011920929, 0.10000000149011612, 0.10000000149011612], [0.762499988079071, 0.612500011920929, 0.20000000298023224, 0.20000000298023224], [0.7875000238418579, 0.612500011920929, 0.10000000149011612, 0.10000000149011612], [0.7875000238418579, 0.612500011920929, 0.20000000298023224, 0.20000000298023224], [0.8125, 0.612500011920929, 0.10000000149011612, 0.10000000149011612], [0.8125, 0.612500011920929, 0.20000000298023224, 0.20000000298023224], [0.8374999761581421, 0.612500011920929, 0.10000000149011612, 0.10000000149011612], [0.8374999761581421, 0.612500011920929, 0.20000000298023224, 0.20000000298023224], [0.862500011920929, 0.612500011920929, 0.10000000149011612, 0.10000000149011612], [0.862500011920929, 0.612500011920929, 0.20000000298023224, 0.20000000298023224], [0.887499988079071, 0.612500011920929, 0.10000000149011612, 0.10000000149011612], [0.887499988079071, 0.612500011920929, 0.20000000298023224, 0.20000000298023224], [0.9125000238418579, 0.612500011920929, 0.10000000149011612, 0.10000000149011612], [0.9125000238418579, 0.612500011920929, 0.20000000298023224, 0.20000000298023224], [0.9375, 0.612500011920929, 0.10000000149011612, 0.10000000149011612], [0.9375, 0.612500011920929, 0.20000000298023224, 0.20000000298023224], [0.9624999761581421, 0.612500011920929, 0.10000000149011612, 0.10000000149011612], [0.9624999761581421, 0.612500011920929, 0.20000000298023224, 0.20000000298023224], [0.987500011920929, 0.612500011920929, 0.10000000149011612, 0.10000000149011612], [0.987500011920929, 0.612500011920929, 0.20000000298023224, 0.20000000298023224], [0.012500000186264515, 0.637499988079071, 0.10000000149011612, 0.10000000149011612], [0.012500000186264515, 0.637499988079071, 0.20000000298023224, 0.20000000298023224], [0.03750000149011612, 0.637499988079071, 0.10000000149011612, 0.10000000149011612], [0.03750000149011612, 0.637499988079071, 0.20000000298023224, 0.20000000298023224], [0.0625, 0.637499988079071, 0.10000000149011612, 0.10000000149011612], [0.0625, 0.637499988079071, 0.20000000298023224, 0.20000000298023224], [0.08749999850988388, 0.637499988079071, 0.10000000149011612, 0.10000000149011612], [0.08749999850988388, 0.637499988079071, 0.20000000298023224, 0.20000000298023224], [0.11249999701976776, 0.637499988079071, 0.10000000149011612, 0.10000000149011612], [0.11249999701976776, 0.637499988079071, 0.20000000298023224, 0.20000000298023224], [0.13750000298023224, 0.637499988079071, 0.10000000149011612, 0.10000000149011612], [0.13750000298023224, 0.637499988079071, 0.20000000298023224, 0.20000000298023224], [0.16249999403953552, 0.637499988079071, 0.10000000149011612, 0.10000000149011612], [0.16249999403953552, 0.637499988079071, 0.20000000298023224, 0.20000000298023224], [0.1875, 0.637499988079071, 0.10000000149011612, 0.10000000149011612], [0.1875, 0.637499988079071, 0.20000000298023224, 0.20000000298023224], [0.21250000596046448, 0.637499988079071, 0.10000000149011612, 0.10000000149011612], [0.21250000596046448, 0.637499988079071, 0.20000000298023224, 0.20000000298023224], [0.23749999701976776, 0.637499988079071, 0.10000000149011612, 0.10000000149011612], [0.23749999701976776, 0.637499988079071, 0.20000000298023224, 0.20000000298023224], [0.26249998807907104, 0.637499988079071, 0.10000000149011612, 0.10000000149011612], [0.26249998807907104, 0.637499988079071, 0.20000000298023224, 0.20000000298023224], [0.2874999940395355, 0.637499988079071, 0.10000000149011612, 0.10000000149011612], [0.2874999940395355, 0.637499988079071, 0.20000000298023224, 0.20000000298023224], [0.3125, 0.637499988079071, 0.10000000149011612, 0.10000000149011612], [0.3125, 0.637499988079071, 0.20000000298023224, 0.20000000298023224], [0.3375000059604645, 0.637499988079071, 0.10000000149011612, 0.10000000149011612], [0.3375000059604645, 0.637499988079071, 0.20000000298023224, 0.20000000298023224], [0.36250001192092896, 0.637499988079071, 0.10000000149011612, 0.10000000149011612], [0.36250001192092896, 0.637499988079071, 0.20000000298023224, 0.20000000298023224], [0.38749998807907104, 0.637499988079071, 0.10000000149011612, 0.10000000149011612], [0.38749998807907104, 0.637499988079071, 0.20000000298023224, 0.20000000298023224], [0.4124999940395355, 0.637499988079071, 0.10000000149011612, 0.10000000149011612], [0.4124999940395355, 0.637499988079071, 0.20000000298023224, 0.20000000298023224], [0.4375, 0.637499988079071, 0.10000000149011612, 0.10000000149011612], [0.4375, 0.637499988079071, 0.20000000298023224, 0.20000000298023224], [0.4625000059604645, 0.637499988079071, 0.10000000149011612, 0.10000000149011612], [0.4625000059604645, 0.637499988079071, 0.20000000298023224, 0.20000000298023224], [0.48750001192092896, 0.637499988079071, 0.10000000149011612, 0.10000000149011612], [0.48750001192092896, 0.637499988079071, 0.20000000298023224, 0.20000000298023224], [0.512499988079071, 0.637499988079071, 0.10000000149011612, 0.10000000149011612], [0.512499988079071, 0.637499988079071, 0.20000000298023224, 0.20000000298023224], [0.5375000238418579, 0.637499988079071, 0.10000000149011612, 0.10000000149011612], [0.5375000238418579, 0.637499988079071, 0.20000000298023224, 0.20000000298023224], [0.5625, 0.637499988079071, 0.10000000149011612, 0.10000000149011612], [0.5625, 0.637499988079071, 0.20000000298023224, 0.20000000298023224], [0.5874999761581421, 0.637499988079071, 0.10000000149011612, 0.10000000149011612], [0.5874999761581421, 0.637499988079071, 0.20000000298023224, 0.20000000298023224], [0.612500011920929, 0.637499988079071, 0.10000000149011612, 0.10000000149011612], [0.612500011920929, 0.637499988079071, 0.20000000298023224, 0.20000000298023224], [0.637499988079071, 0.637499988079071, 0.10000000149011612, 0.10000000149011612], [0.637499988079071, 0.637499988079071, 0.20000000298023224, 0.20000000298023224], [0.6625000238418579, 0.637499988079071, 0.10000000149011612, 0.10000000149011612], [0.6625000238418579, 0.637499988079071, 0.20000000298023224, 0.20000000298023224], [0.6875, 0.637499988079071, 0.10000000149011612, 0.10000000149011612], [0.6875, 0.637499988079071, 0.20000000298023224, 0.20000000298023224], [0.7124999761581421, 0.637499988079071, 0.10000000149011612, 0.10000000149011612], [0.7124999761581421, 0.637499988079071, 0.20000000298023224, 0.20000000298023224], [0.737500011920929, 0.637499988079071, 0.10000000149011612, 0.10000000149011612], [0.737500011920929, 0.637499988079071, 0.20000000298023224, 0.20000000298023224], [0.762499988079071, 0.637499988079071, 0.10000000149011612, 0.10000000149011612], [0.762499988079071, 0.637499988079071, 0.20000000298023224, 0.20000000298023224], [0.7875000238418579, 0.637499988079071, 0.10000000149011612, 0.10000000149011612], [0.7875000238418579, 0.637499988079071, 0.20000000298023224, 0.20000000298023224], [0.8125, 0.637499988079071, 0.10000000149011612, 0.10000000149011612], [0.8125, 0.637499988079071, 0.20000000298023224, 0.20000000298023224], [0.8374999761581421, 0.637499988079071, 0.10000000149011612, 0.10000000149011612], [0.8374999761581421, 0.637499988079071, 0.20000000298023224, 0.20000000298023224], [0.862500011920929, 0.637499988079071, 0.10000000149011612, 0.10000000149011612], [0.862500011920929, 0.637499988079071, 0.20000000298023224, 0.20000000298023224], [0.887499988079071, 0.637499988079071, 0.10000000149011612, 0.10000000149011612], [0.887499988079071, 0.637499988079071, 0.20000000298023224, 0.20000000298023224], [0.9125000238418579, 0.637499988079071, 0.10000000149011612, 0.10000000149011612], [0.9125000238418579, 0.637499988079071, 0.20000000298023224, 0.20000000298023224], [0.9375, 0.637499988079071, 0.10000000149011612, 0.10000000149011612], [0.9375, 0.637499988079071, 0.20000000298023224, 0.20000000298023224], [0.9624999761581421, 0.637499988079071, 0.10000000149011612, 0.10000000149011612], [0.9624999761581421, 0.637499988079071, 0.20000000298023224, 0.20000000298023224], [0.987500011920929, 0.637499988079071, 0.10000000149011612, 0.10000000149011612], [0.987500011920929, 0.637499988079071, 0.20000000298023224, 0.20000000298023224], [0.012500000186264515, 0.6625000238418579, 0.10000000149011612, 0.10000000149011612], [0.012500000186264515, 0.6625000238418579, 0.20000000298023224, 0.20000000298023224], [0.03750000149011612, 0.6625000238418579, 0.10000000149011612, 0.10000000149011612], [0.03750000149011612, 0.6625000238418579, 0.20000000298023224, 0.20000000298023224], [0.0625, 0.6625000238418579, 0.10000000149011612, 0.10000000149011612], [0.0625, 0.6625000238418579, 0.20000000298023224, 0.20000000298023224], [0.08749999850988388, 0.6625000238418579, 0.10000000149011612, 0.10000000149011612], [0.08749999850988388, 0.6625000238418579, 0.20000000298023224, 0.20000000298023224], [0.11249999701976776, 0.6625000238418579, 0.10000000149011612, 0.10000000149011612], [0.11249999701976776, 0.6625000238418579, 0.20000000298023224, 0.20000000298023224], [0.13750000298023224, 0.6625000238418579, 0.10000000149011612, 0.10000000149011612], [0.13750000298023224, 0.6625000238418579, 0.20000000298023224, 0.20000000298023224], [0.16249999403953552, 0.6625000238418579, 0.10000000149011612, 0.10000000149011612], [0.16249999403953552, 0.6625000238418579, 0.20000000298023224, 0.20000000298023224], [0.1875, 0.6625000238418579, 0.10000000149011612, 0.10000000149011612], [0.1875, 0.6625000238418579, 0.20000000298023224, 0.20000000298023224], [0.21250000596046448, 0.6625000238418579, 0.10000000149011612, 0.10000000149011612], [0.21250000596046448, 0.6625000238418579, 0.20000000298023224, 0.20000000298023224], [0.23749999701976776, 0.6625000238418579, 0.10000000149011612, 0.10000000149011612], [0.23749999701976776, 0.6625000238418579, 0.20000000298023224, 0.20000000298023224], [0.26249998807907104, 0.6625000238418579, 0.10000000149011612, 0.10000000149011612], [0.26249998807907104, 0.6625000238418579, 0.20000000298023224, 0.20000000298023224], [0.2874999940395355, 0.6625000238418579, 0.10000000149011612, 0.10000000149011612], [0.2874999940395355, 0.6625000238418579, 0.20000000298023224, 0.20000000298023224], [0.3125, 0.6625000238418579, 0.10000000149011612, 0.10000000149011612], [0.3125, 0.6625000238418579, 0.20000000298023224, 0.20000000298023224], [0.3375000059604645, 0.6625000238418579, 0.10000000149011612, 0.10000000149011612], [0.3375000059604645, 0.6625000238418579, 0.20000000298023224, 0.20000000298023224], [0.36250001192092896, 0.6625000238418579, 0.10000000149011612, 0.10000000149011612], [0.36250001192092896, 0.6625000238418579, 0.20000000298023224, 0.20000000298023224], [0.38749998807907104, 0.6625000238418579, 0.10000000149011612, 0.10000000149011612], [0.38749998807907104, 0.6625000238418579, 0.20000000298023224, 0.20000000298023224], [0.4124999940395355, 0.6625000238418579, 0.10000000149011612, 0.10000000149011612], [0.4124999940395355, 0.6625000238418579, 0.20000000298023224, 0.20000000298023224], [0.4375, 0.6625000238418579, 0.10000000149011612, 0.10000000149011612], [0.4375, 0.6625000238418579, 0.20000000298023224, 0.20000000298023224], [0.4625000059604645, 0.6625000238418579, 0.10000000149011612, 0.10000000149011612], [0.4625000059604645, 0.6625000238418579, 0.20000000298023224, 0.20000000298023224], [0.48750001192092896, 0.6625000238418579, 0.10000000149011612, 0.10000000149011612], [0.48750001192092896, 0.6625000238418579, 0.20000000298023224, 0.20000000298023224], [0.512499988079071, 0.6625000238418579, 0.10000000149011612, 0.10000000149011612], [0.512499988079071, 0.6625000238418579, 0.20000000298023224, 0.20000000298023224], [0.5375000238418579, 0.6625000238418579, 0.10000000149011612, 0.10000000149011612], [0.5375000238418579, 0.6625000238418579, 0.20000000298023224, 0.20000000298023224], [0.5625, 0.6625000238418579, 0.10000000149011612, 0.10000000149011612], [0.5625, 0.6625000238418579, 0.20000000298023224, 0.20000000298023224], [0.5874999761581421, 0.6625000238418579, 0.10000000149011612, 0.10000000149011612], [0.5874999761581421, 0.6625000238418579, 0.20000000298023224, 0.20000000298023224], [0.612500011920929, 0.6625000238418579, 0.10000000149011612, 0.10000000149011612], [0.612500011920929, 0.6625000238418579, 0.20000000298023224, 0.20000000298023224], [0.637499988079071, 0.6625000238418579, 0.10000000149011612, 0.10000000149011612], [0.637499988079071, 0.6625000238418579, 0.20000000298023224, 0.20000000298023224], [0.6625000238418579, 0.6625000238418579, 0.10000000149011612, 0.10000000149011612], [0.6625000238418579, 0.6625000238418579, 0.20000000298023224, 0.20000000298023224], [0.6875, 0.6625000238418579, 0.10000000149011612, 0.10000000149011612], [0.6875, 0.6625000238418579, 0.20000000298023224, 0.20000000298023224], [0.7124999761581421, 0.6625000238418579, 0.10000000149011612, 0.10000000149011612], [0.7124999761581421, 0.6625000238418579, 0.20000000298023224, 0.20000000298023224], [0.737500011920929, 0.6625000238418579, 0.10000000149011612, 0.10000000149011612], [0.737500011920929, 0.6625000238418579, 0.20000000298023224, 0.20000000298023224], [0.762499988079071, 0.6625000238418579, 0.10000000149011612, 0.10000000149011612], [0.762499988079071, 0.6625000238418579, 0.20000000298023224, 0.20000000298023224], [0.7875000238418579, 0.6625000238418579, 0.10000000149011612, 0.10000000149011612], [0.7875000238418579, 0.6625000238418579, 0.20000000298023224, 0.20000000298023224], [0.8125, 0.6625000238418579, 0.10000000149011612, 0.10000000149011612], [0.8125, 0.6625000238418579, 0.20000000298023224, 0.20000000298023224], [0.8374999761581421, 0.6625000238418579, 0.10000000149011612, 0.10000000149011612], [0.8374999761581421, 0.6625000238418579, 0.20000000298023224, 0.20000000298023224], [0.862500011920929, 0.6625000238418579, 0.10000000149011612, 0.10000000149011612], [0.862500011920929, 0.6625000238418579, 0.20000000298023224, 0.20000000298023224], [0.887499988079071, 0.6625000238418579, 0.10000000149011612, 0.10000000149011612], [0.887499988079071, 0.6625000238418579, 0.20000000298023224, 0.20000000298023224], [0.9125000238418579, 0.6625000238418579, 0.10000000149011612, 0.10000000149011612], [0.9125000238418579, 0.6625000238418579, 0.20000000298023224, 0.20000000298023224], [0.9375, 0.6625000238418579, 0.10000000149011612, 0.10000000149011612], [0.9375, 0.6625000238418579, 0.20000000298023224, 0.20000000298023224], [0.9624999761581421, 0.6625000238418579, 0.10000000149011612, 0.10000000149011612], [0.9624999761581421, 0.6625000238418579, 0.20000000298023224, 0.20000000298023224], [0.987500011920929, 0.6625000238418579, 0.10000000149011612, 0.10000000149011612], [0.987500011920929, 0.6625000238418579, 0.20000000298023224, 0.20000000298023224], [0.012500000186264515, 0.6875, 0.10000000149011612, 0.10000000149011612], [0.012500000186264515, 0.6875, 0.20000000298023224, 0.20000000298023224], [0.03750000149011612, 0.6875, 0.10000000149011612, 0.10000000149011612], [0.03750000149011612, 0.6875, 0.20000000298023224, 0.20000000298023224], [0.0625, 0.6875, 0.10000000149011612, 0.10000000149011612], [0.0625, 0.6875, 0.20000000298023224, 0.20000000298023224], [0.08749999850988388, 0.6875, 0.10000000149011612, 0.10000000149011612], [0.08749999850988388, 0.6875, 0.20000000298023224, 0.20000000298023224], [0.11249999701976776, 0.6875, 0.10000000149011612, 0.10000000149011612], [0.11249999701976776, 0.6875, 0.20000000298023224, 0.20000000298023224], [0.13750000298023224, 0.6875, 0.10000000149011612, 0.10000000149011612], [0.13750000298023224, 0.6875, 0.20000000298023224, 0.20000000298023224], [0.16249999403953552, 0.6875, 0.10000000149011612, 0.10000000149011612], [0.16249999403953552, 0.6875, 0.20000000298023224, 0.20000000298023224], [0.1875, 0.6875, 0.10000000149011612, 0.10000000149011612], [0.1875, 0.6875, 0.20000000298023224, 0.20000000298023224], [0.21250000596046448, 0.6875, 0.10000000149011612, 0.10000000149011612], [0.21250000596046448, 0.6875, 0.20000000298023224, 0.20000000298023224], [0.23749999701976776, 0.6875, 0.10000000149011612, 0.10000000149011612], [0.23749999701976776, 0.6875, 0.20000000298023224, 0.20000000298023224], [0.26249998807907104, 0.6875, 0.10000000149011612, 0.10000000149011612], [0.26249998807907104, 0.6875, 0.20000000298023224, 0.20000000298023224], [0.2874999940395355, 0.6875, 0.10000000149011612, 0.10000000149011612], [0.2874999940395355, 0.6875, 0.20000000298023224, 0.20000000298023224], [0.3125, 0.6875, 0.10000000149011612, 0.10000000149011612], [0.3125, 0.6875, 0.20000000298023224, 0.20000000298023224], [0.3375000059604645, 0.6875, 0.10000000149011612, 0.10000000149011612], [0.3375000059604645, 0.6875, 0.20000000298023224, 0.20000000298023224], [0.36250001192092896, 0.6875, 0.10000000149011612, 0.10000000149011612], [0.36250001192092896, 0.6875, 0.20000000298023224, 0.20000000298023224], [0.38749998807907104, 0.6875, 0.10000000149011612, 0.10000000149011612], [0.38749998807907104, 0.6875, 0.20000000298023224, 0.20000000298023224], [0.4124999940395355, 0.6875, 0.10000000149011612, 0.10000000149011612], [0.4124999940395355, 0.6875, 0.20000000298023224, 0.20000000298023224], [0.4375, 0.6875, 0.10000000149011612, 0.10000000149011612], [0.4375, 0.6875, 0.20000000298023224, 0.20000000298023224], [0.4625000059604645, 0.6875, 0.10000000149011612, 0.10000000149011612], [0.4625000059604645, 0.6875, 0.20000000298023224, 0.20000000298023224], [0.48750001192092896, 0.6875, 0.10000000149011612, 0.10000000149011612], [0.48750001192092896, 0.6875, 0.20000000298023224, 0.20000000298023224], [0.512499988079071, 0.6875, 0.10000000149011612, 0.10000000149011612], [0.512499988079071, 0.6875, 0.20000000298023224, 0.20000000298023224], [0.5375000238418579, 0.6875, 0.10000000149011612, 0.10000000149011612], [0.5375000238418579, 0.6875, 0.20000000298023224, 0.20000000298023224], [0.5625, 0.6875, 0.10000000149011612, 0.10000000149011612], [0.5625, 0.6875, 0.20000000298023224, 0.20000000298023224], [0.5874999761581421, 0.6875, 0.10000000149011612, 0.10000000149011612], [0.5874999761581421, 0.6875, 0.20000000298023224, 0.20000000298023224], [0.612500011920929, 0.6875, 0.10000000149011612, 0.10000000149011612], [0.612500011920929, 0.6875, 0.20000000298023224, 0.20000000298023224], [0.637499988079071, 0.6875, 0.10000000149011612, 0.10000000149011612], [0.637499988079071, 0.6875, 0.20000000298023224, 0.20000000298023224], [0.6625000238418579, 0.6875, 0.10000000149011612, 0.10000000149011612], [0.6625000238418579, 0.6875, 0.20000000298023224, 0.20000000298023224], [0.6875, 0.6875, 0.10000000149011612, 0.10000000149011612], [0.6875, 0.6875, 0.20000000298023224, 0.20000000298023224], [0.7124999761581421, 0.6875, 0.10000000149011612, 0.10000000149011612], [0.7124999761581421, 0.6875, 0.20000000298023224, 0.20000000298023224], [0.737500011920929, 0.6875, 0.10000000149011612, 0.10000000149011612], [0.737500011920929, 0.6875, 0.20000000298023224, 0.20000000298023224], [0.762499988079071, 0.6875, 0.10000000149011612, 0.10000000149011612], [0.762499988079071, 0.6875, 0.20000000298023224, 0.20000000298023224], [0.7875000238418579, 0.6875, 0.10000000149011612, 0.10000000149011612], [0.7875000238418579, 0.6875, 0.20000000298023224, 0.20000000298023224], [0.8125, 0.6875, 0.10000000149011612, 0.10000000149011612], [0.8125, 0.6875, 0.20000000298023224, 0.20000000298023224], [0.8374999761581421, 0.6875, 0.10000000149011612, 0.10000000149011612], [0.8374999761581421, 0.6875, 0.20000000298023224, 0.20000000298023224], [0.862500011920929, 0.6875, 0.10000000149011612, 0.10000000149011612], [0.862500011920929, 0.6875, 0.20000000298023224, 0.20000000298023224], [0.887499988079071, 0.6875, 0.10000000149011612, 0.10000000149011612], [0.887499988079071, 0.6875, 0.20000000298023224, 0.20000000298023224], [0.9125000238418579, 0.6875, 0.10000000149011612, 0.10000000149011612], [0.9125000238418579, 0.6875, 0.20000000298023224, 0.20000000298023224], [0.9375, 0.6875, 0.10000000149011612, 0.10000000149011612], [0.9375, 0.6875, 0.20000000298023224, 0.20000000298023224], [0.9624999761581421, 0.6875, 0.10000000149011612, 0.10000000149011612], [0.9624999761581421, 0.6875, 0.20000000298023224, 0.20000000298023224], [0.987500011920929, 0.6875, 0.10000000149011612, 0.10000000149011612], [0.987500011920929, 0.6875, 0.20000000298023224, 0.20000000298023224], [0.012500000186264515, 0.7124999761581421, 0.10000000149011612, 0.10000000149011612], [0.012500000186264515, 0.7124999761581421, 0.20000000298023224, 0.20000000298023224], [0.03750000149011612, 0.7124999761581421, 0.10000000149011612, 0.10000000149011612], [0.03750000149011612, 0.7124999761581421, 0.20000000298023224, 0.20000000298023224], [0.0625, 0.7124999761581421, 0.10000000149011612, 0.10000000149011612], [0.0625, 0.7124999761581421, 0.20000000298023224, 0.20000000298023224], [0.08749999850988388, 0.7124999761581421, 0.10000000149011612, 0.10000000149011612], [0.08749999850988388, 0.7124999761581421, 0.20000000298023224, 0.20000000298023224], [0.11249999701976776, 0.7124999761581421, 0.10000000149011612, 0.10000000149011612], [0.11249999701976776, 0.7124999761581421, 0.20000000298023224, 0.20000000298023224], [0.13750000298023224, 0.7124999761581421, 0.10000000149011612, 0.10000000149011612], [0.13750000298023224, 0.7124999761581421, 0.20000000298023224, 0.20000000298023224], [0.16249999403953552, 0.7124999761581421, 0.10000000149011612, 0.10000000149011612], [0.16249999403953552, 0.7124999761581421, 0.20000000298023224, 0.20000000298023224], [0.1875, 0.7124999761581421, 0.10000000149011612, 0.10000000149011612], [0.1875, 0.7124999761581421, 0.20000000298023224, 0.20000000298023224], [0.21250000596046448, 0.7124999761581421, 0.10000000149011612, 0.10000000149011612], [0.21250000596046448, 0.7124999761581421, 0.20000000298023224, 0.20000000298023224], [0.23749999701976776, 0.7124999761581421, 0.10000000149011612, 0.10000000149011612], [0.23749999701976776, 0.7124999761581421, 0.20000000298023224, 0.20000000298023224], [0.26249998807907104, 0.7124999761581421, 0.10000000149011612, 0.10000000149011612], [0.26249998807907104, 0.7124999761581421, 0.20000000298023224, 0.20000000298023224], [0.2874999940395355, 0.7124999761581421, 0.10000000149011612, 0.10000000149011612], [0.2874999940395355, 0.7124999761581421, 0.20000000298023224, 0.20000000298023224], [0.3125, 0.7124999761581421, 0.10000000149011612, 0.10000000149011612], [0.3125, 0.7124999761581421, 0.20000000298023224, 0.20000000298023224], [0.3375000059604645, 0.7124999761581421, 0.10000000149011612, 0.10000000149011612], [0.3375000059604645, 0.7124999761581421, 0.20000000298023224, 0.20000000298023224], [0.36250001192092896, 0.7124999761581421, 0.10000000149011612, 0.10000000149011612], [0.36250001192092896, 0.7124999761581421, 0.20000000298023224, 0.20000000298023224], [0.38749998807907104, 0.7124999761581421, 0.10000000149011612, 0.10000000149011612], [0.38749998807907104, 0.7124999761581421, 0.20000000298023224, 0.20000000298023224], [0.4124999940395355, 0.7124999761581421, 0.10000000149011612, 0.10000000149011612], [0.4124999940395355, 0.7124999761581421, 0.20000000298023224, 0.20000000298023224], [0.4375, 0.7124999761581421, 0.10000000149011612, 0.10000000149011612], [0.4375, 0.7124999761581421, 0.20000000298023224, 0.20000000298023224], [0.4625000059604645, 0.7124999761581421, 0.10000000149011612, 0.10000000149011612], [0.4625000059604645, 0.7124999761581421, 0.20000000298023224, 0.20000000298023224], [0.48750001192092896, 0.7124999761581421, 0.10000000149011612, 0.10000000149011612], [0.48750001192092896, 0.7124999761581421, 0.20000000298023224, 0.20000000298023224], [0.512499988079071, 0.7124999761581421, 0.10000000149011612, 0.10000000149011612], [0.512499988079071, 0.7124999761581421, 0.20000000298023224, 0.20000000298023224], [0.5375000238418579, 0.7124999761581421, 0.10000000149011612, 0.10000000149011612], [0.5375000238418579, 0.7124999761581421, 0.20000000298023224, 0.20000000298023224], [0.5625, 0.7124999761581421, 0.10000000149011612, 0.10000000149011612], [0.5625, 0.7124999761581421, 0.20000000298023224, 0.20000000298023224], [0.5874999761581421, 0.7124999761581421, 0.10000000149011612, 0.10000000149011612], [0.5874999761581421, 0.7124999761581421, 0.20000000298023224, 0.20000000298023224], [0.612500011920929, 0.7124999761581421, 0.10000000149011612, 0.10000000149011612], [0.612500011920929, 0.7124999761581421, 0.20000000298023224, 0.20000000298023224], [0.637499988079071, 0.7124999761581421, 0.10000000149011612, 0.10000000149011612], [0.637499988079071, 0.7124999761581421, 0.20000000298023224, 0.20000000298023224], [0.6625000238418579, 0.7124999761581421, 0.10000000149011612, 0.10000000149011612], [0.6625000238418579, 0.7124999761581421, 0.20000000298023224, 0.20000000298023224], [0.6875, 0.7124999761581421, 0.10000000149011612, 0.10000000149011612], [0.6875, 0.7124999761581421, 0.20000000298023224, 0.20000000298023224], [0.7124999761581421, 0.7124999761581421, 0.10000000149011612, 0.10000000149011612], [0.7124999761581421, 0.7124999761581421, 0.20000000298023224, 0.20000000298023224], [0.737500011920929, 0.7124999761581421, 0.10000000149011612, 0.10000000149011612], [0.737500011920929, 0.7124999761581421, 0.20000000298023224, 0.20000000298023224], [0.762499988079071, 0.7124999761581421, 0.10000000149011612, 0.10000000149011612], [0.762499988079071, 0.7124999761581421, 0.20000000298023224, 0.20000000298023224], [0.7875000238418579, 0.7124999761581421, 0.10000000149011612, 0.10000000149011612], [0.7875000238418579, 0.7124999761581421, 0.20000000298023224, 0.20000000298023224], [0.8125, 0.7124999761581421, 0.10000000149011612, 0.10000000149011612], [0.8125, 0.7124999761581421, 0.20000000298023224, 0.20000000298023224], [0.8374999761581421, 0.7124999761581421, 0.10000000149011612, 0.10000000149011612], [0.8374999761581421, 0.7124999761581421, 0.20000000298023224, 0.20000000298023224], [0.862500011920929, 0.7124999761581421, 0.10000000149011612, 0.10000000149011612], [0.862500011920929, 0.7124999761581421, 0.20000000298023224, 0.20000000298023224], [0.887499988079071, 0.7124999761581421, 0.10000000149011612, 0.10000000149011612], [0.887499988079071, 0.7124999761581421, 0.20000000298023224, 0.20000000298023224], [0.9125000238418579, 0.7124999761581421, 0.10000000149011612, 0.10000000149011612], [0.9125000238418579, 0.7124999761581421, 0.20000000298023224, 0.20000000298023224], [0.9375, 0.7124999761581421, 0.10000000149011612, 0.10000000149011612], [0.9375, 0.7124999761581421, 0.20000000298023224, 0.20000000298023224], [0.9624999761581421, 0.7124999761581421, 0.10000000149011612, 0.10000000149011612], [0.9624999761581421, 0.7124999761581421, 0.20000000298023224, 0.20000000298023224], [0.987500011920929, 0.7124999761581421, 0.10000000149011612, 0.10000000149011612], [0.987500011920929, 0.7124999761581421, 0.20000000298023224, 0.20000000298023224], [0.012500000186264515, 0.737500011920929, 0.10000000149011612, 0.10000000149011612], [0.012500000186264515, 0.737500011920929, 0.20000000298023224, 0.20000000298023224], [0.03750000149011612, 0.737500011920929, 0.10000000149011612, 0.10000000149011612], [0.03750000149011612, 0.737500011920929, 0.20000000298023224, 0.20000000298023224], [0.0625, 0.737500011920929, 0.10000000149011612, 0.10000000149011612], [0.0625, 0.737500011920929, 0.20000000298023224, 0.20000000298023224], [0.08749999850988388, 0.737500011920929, 0.10000000149011612, 0.10000000149011612], [0.08749999850988388, 0.737500011920929, 0.20000000298023224, 0.20000000298023224], [0.11249999701976776, 0.737500011920929, 0.10000000149011612, 0.10000000149011612], [0.11249999701976776, 0.737500011920929, 0.20000000298023224, 0.20000000298023224], [0.13750000298023224, 0.737500011920929, 0.10000000149011612, 0.10000000149011612], [0.13750000298023224, 0.737500011920929, 0.20000000298023224, 0.20000000298023224], [0.16249999403953552, 0.737500011920929, 0.10000000149011612, 0.10000000149011612], [0.16249999403953552, 0.737500011920929, 0.20000000298023224, 0.20000000298023224], [0.1875, 0.737500011920929, 0.10000000149011612, 0.10000000149011612], [0.1875, 0.737500011920929, 0.20000000298023224, 0.20000000298023224], [0.21250000596046448, 0.737500011920929, 0.10000000149011612, 0.10000000149011612], [0.21250000596046448, 0.737500011920929, 0.20000000298023224, 0.20000000298023224], [0.23749999701976776, 0.737500011920929, 0.10000000149011612, 0.10000000149011612], [0.23749999701976776, 0.737500011920929, 0.20000000298023224, 0.20000000298023224], [0.26249998807907104, 0.737500011920929, 0.10000000149011612, 0.10000000149011612], [0.26249998807907104, 0.737500011920929, 0.20000000298023224, 0.20000000298023224], [0.2874999940395355, 0.737500011920929, 0.10000000149011612, 0.10000000149011612], [0.2874999940395355, 0.737500011920929, 0.20000000298023224, 0.20000000298023224], [0.3125, 0.737500011920929, 0.10000000149011612, 0.10000000149011612], [0.3125, 0.737500011920929, 0.20000000298023224, 0.20000000298023224], [0.3375000059604645, 0.737500011920929, 0.10000000149011612, 0.10000000149011612], [0.3375000059604645, 0.737500011920929, 0.20000000298023224, 0.20000000298023224], [0.36250001192092896, 0.737500011920929, 0.10000000149011612, 0.10000000149011612], [0.36250001192092896, 0.737500011920929, 0.20000000298023224, 0.20000000298023224], [0.38749998807907104, 0.737500011920929, 0.10000000149011612, 0.10000000149011612], [0.38749998807907104, 0.737500011920929, 0.20000000298023224, 0.20000000298023224], [0.4124999940395355, 0.737500011920929, 0.10000000149011612, 0.10000000149011612], [0.4124999940395355, 0.737500011920929, 0.20000000298023224, 0.20000000298023224], [0.4375, 0.737500011920929, 0.10000000149011612, 0.10000000149011612], [0.4375, 0.737500011920929, 0.20000000298023224, 0.20000000298023224], [0.4625000059604645, 0.737500011920929, 0.10000000149011612, 0.10000000149011612], [0.4625000059604645, 0.737500011920929, 0.20000000298023224, 0.20000000298023224], [0.48750001192092896, 0.737500011920929, 0.10000000149011612, 0.10000000149011612], [0.48750001192092896, 0.737500011920929, 0.20000000298023224, 0.20000000298023224], [0.512499988079071, 0.737500011920929, 0.10000000149011612, 0.10000000149011612], [0.512499988079071, 0.737500011920929, 0.20000000298023224, 0.20000000298023224], [0.5375000238418579, 0.737500011920929, 0.10000000149011612, 0.10000000149011612], [0.5375000238418579, 0.737500011920929, 0.20000000298023224, 0.20000000298023224], [0.5625, 0.737500011920929, 0.10000000149011612, 0.10000000149011612], [0.5625, 0.737500011920929, 0.20000000298023224, 0.20000000298023224], [0.5874999761581421, 0.737500011920929, 0.10000000149011612, 0.10000000149011612], [0.5874999761581421, 0.737500011920929, 0.20000000298023224, 0.20000000298023224], [0.612500011920929, 0.737500011920929, 0.10000000149011612, 0.10000000149011612], [0.612500011920929, 0.737500011920929, 0.20000000298023224, 0.20000000298023224], [0.637499988079071, 0.737500011920929, 0.10000000149011612, 0.10000000149011612], [0.637499988079071, 0.737500011920929, 0.20000000298023224, 0.20000000298023224], [0.6625000238418579, 0.737500011920929, 0.10000000149011612, 0.10000000149011612], [0.6625000238418579, 0.737500011920929, 0.20000000298023224, 0.20000000298023224], [0.6875, 0.737500011920929, 0.10000000149011612, 0.10000000149011612], [0.6875, 0.737500011920929, 0.20000000298023224, 0.20000000298023224], [0.7124999761581421, 0.737500011920929, 0.10000000149011612, 0.10000000149011612], [0.7124999761581421, 0.737500011920929, 0.20000000298023224, 0.20000000298023224], [0.737500011920929, 0.737500011920929, 0.10000000149011612, 0.10000000149011612], [0.737500011920929, 0.737500011920929, 0.20000000298023224, 0.20000000298023224], [0.762499988079071, 0.737500011920929, 0.10000000149011612, 0.10000000149011612], [0.762499988079071, 0.737500011920929, 0.20000000298023224, 0.20000000298023224], [0.7875000238418579, 0.737500011920929, 0.10000000149011612, 0.10000000149011612], [0.7875000238418579, 0.737500011920929, 0.20000000298023224, 0.20000000298023224], [0.8125, 0.737500011920929, 0.10000000149011612, 0.10000000149011612], [0.8125, 0.737500011920929, 0.20000000298023224, 0.20000000298023224], [0.8374999761581421, 0.737500011920929, 0.10000000149011612, 0.10000000149011612], [0.8374999761581421, 0.737500011920929, 0.20000000298023224, 0.20000000298023224], [0.862500011920929, 0.737500011920929, 0.10000000149011612, 0.10000000149011612], [0.862500011920929, 0.737500011920929, 0.20000000298023224, 0.20000000298023224], [0.887499988079071, 0.737500011920929, 0.10000000149011612, 0.10000000149011612], [0.887499988079071, 0.737500011920929, 0.20000000298023224, 0.20000000298023224], [0.9125000238418579, 0.737500011920929, 0.10000000149011612, 0.10000000149011612], [0.9125000238418579, 0.737500011920929, 0.20000000298023224, 0.20000000298023224], [0.9375, 0.737500011920929, 0.10000000149011612, 0.10000000149011612], [0.9375, 0.737500011920929, 0.20000000298023224, 0.20000000298023224], [0.9624999761581421, 0.737500011920929, 0.10000000149011612, 0.10000000149011612], [0.9624999761581421, 0.737500011920929, 0.20000000298023224, 0.20000000298023224], [0.987500011920929, 0.737500011920929, 0.10000000149011612, 0.10000000149011612], [0.987500011920929, 0.737500011920929, 0.20000000298023224, 0.20000000298023224], [0.012500000186264515, 0.762499988079071, 0.10000000149011612, 0.10000000149011612], [0.012500000186264515, 0.762499988079071, 0.20000000298023224, 0.20000000298023224], [0.03750000149011612, 0.762499988079071, 0.10000000149011612, 0.10000000149011612], [0.03750000149011612, 0.762499988079071, 0.20000000298023224, 0.20000000298023224], [0.0625, 0.762499988079071, 0.10000000149011612, 0.10000000149011612], [0.0625, 0.762499988079071, 0.20000000298023224, 0.20000000298023224], [0.08749999850988388, 0.762499988079071, 0.10000000149011612, 0.10000000149011612], [0.08749999850988388, 0.762499988079071, 0.20000000298023224, 0.20000000298023224], [0.11249999701976776, 0.762499988079071, 0.10000000149011612, 0.10000000149011612], [0.11249999701976776, 0.762499988079071, 0.20000000298023224, 0.20000000298023224], [0.13750000298023224, 0.762499988079071, 0.10000000149011612, 0.10000000149011612], [0.13750000298023224, 0.762499988079071, 0.20000000298023224, 0.20000000298023224], [0.16249999403953552, 0.762499988079071, 0.10000000149011612, 0.10000000149011612], [0.16249999403953552, 0.762499988079071, 0.20000000298023224, 0.20000000298023224], [0.1875, 0.762499988079071, 0.10000000149011612, 0.10000000149011612], [0.1875, 0.762499988079071, 0.20000000298023224, 0.20000000298023224], [0.21250000596046448, 0.762499988079071, 0.10000000149011612, 0.10000000149011612], [0.21250000596046448, 0.762499988079071, 0.20000000298023224, 0.20000000298023224], [0.23749999701976776, 0.762499988079071, 0.10000000149011612, 0.10000000149011612], [0.23749999701976776, 0.762499988079071, 0.20000000298023224, 0.20000000298023224], [0.26249998807907104, 0.762499988079071, 0.10000000149011612, 0.10000000149011612], [0.26249998807907104, 0.762499988079071, 0.20000000298023224, 0.20000000298023224], [0.2874999940395355, 0.762499988079071, 0.10000000149011612, 0.10000000149011612], [0.2874999940395355, 0.762499988079071, 0.20000000298023224, 0.20000000298023224], [0.3125, 0.762499988079071, 0.10000000149011612, 0.10000000149011612], [0.3125, 0.762499988079071, 0.20000000298023224, 0.20000000298023224], [0.3375000059604645, 0.762499988079071, 0.10000000149011612, 0.10000000149011612], [0.3375000059604645, 0.762499988079071, 0.20000000298023224, 0.20000000298023224], [0.36250001192092896, 0.762499988079071, 0.10000000149011612, 0.10000000149011612], [0.36250001192092896, 0.762499988079071, 0.20000000298023224, 0.20000000298023224], [0.38749998807907104, 0.762499988079071, 0.10000000149011612, 0.10000000149011612], [0.38749998807907104, 0.762499988079071, 0.20000000298023224, 0.20000000298023224], [0.4124999940395355, 0.762499988079071, 0.10000000149011612, 0.10000000149011612], [0.4124999940395355, 0.762499988079071, 0.20000000298023224, 0.20000000298023224], [0.4375, 0.762499988079071, 0.10000000149011612, 0.10000000149011612], [0.4375, 0.762499988079071, 0.20000000298023224, 0.20000000298023224], [0.4625000059604645, 0.762499988079071, 0.10000000149011612, 0.10000000149011612], [0.4625000059604645, 0.762499988079071, 0.20000000298023224, 0.20000000298023224], [0.48750001192092896, 0.762499988079071, 0.10000000149011612, 0.10000000149011612], [0.48750001192092896, 0.762499988079071, 0.20000000298023224, 0.20000000298023224], [0.512499988079071, 0.762499988079071, 0.10000000149011612, 0.10000000149011612], [0.512499988079071, 0.762499988079071, 0.20000000298023224, 0.20000000298023224], [0.5375000238418579, 0.762499988079071, 0.10000000149011612, 0.10000000149011612], [0.5375000238418579, 0.762499988079071, 0.20000000298023224, 0.20000000298023224], [0.5625, 0.762499988079071, 0.10000000149011612, 0.10000000149011612], [0.5625, 0.762499988079071, 0.20000000298023224, 0.20000000298023224], [0.5874999761581421, 0.762499988079071, 0.10000000149011612, 0.10000000149011612], [0.5874999761581421, 0.762499988079071, 0.20000000298023224, 0.20000000298023224], [0.612500011920929, 0.762499988079071, 0.10000000149011612, 0.10000000149011612], [0.612500011920929, 0.762499988079071, 0.20000000298023224, 0.20000000298023224], [0.637499988079071, 0.762499988079071, 0.10000000149011612, 0.10000000149011612], [0.637499988079071, 0.762499988079071, 0.20000000298023224, 0.20000000298023224], [0.6625000238418579, 0.762499988079071, 0.10000000149011612, 0.10000000149011612], [0.6625000238418579, 0.762499988079071, 0.20000000298023224, 0.20000000298023224], [0.6875, 0.762499988079071, 0.10000000149011612, 0.10000000149011612], [0.6875, 0.762499988079071, 0.20000000298023224, 0.20000000298023224], [0.7124999761581421, 0.762499988079071, 0.10000000149011612, 0.10000000149011612], [0.7124999761581421, 0.762499988079071, 0.20000000298023224, 0.20000000298023224], [0.737500011920929, 0.762499988079071, 0.10000000149011612, 0.10000000149011612], [0.737500011920929, 0.762499988079071, 0.20000000298023224, 0.20000000298023224], [0.762499988079071, 0.762499988079071, 0.10000000149011612, 0.10000000149011612], [0.762499988079071, 0.762499988079071, 0.20000000298023224, 0.20000000298023224], [0.7875000238418579, 0.762499988079071, 0.10000000149011612, 0.10000000149011612], [0.7875000238418579, 0.762499988079071, 0.20000000298023224, 0.20000000298023224], [0.8125, 0.762499988079071, 0.10000000149011612, 0.10000000149011612], [0.8125, 0.762499988079071, 0.20000000298023224, 0.20000000298023224], [0.8374999761581421, 0.762499988079071, 0.10000000149011612, 0.10000000149011612], [0.8374999761581421, 0.762499988079071, 0.20000000298023224, 0.20000000298023224], [0.862500011920929, 0.762499988079071, 0.10000000149011612, 0.10000000149011612], [0.862500011920929, 0.762499988079071, 0.20000000298023224, 0.20000000298023224], [0.887499988079071, 0.762499988079071, 0.10000000149011612, 0.10000000149011612], [0.887499988079071, 0.762499988079071, 0.20000000298023224, 0.20000000298023224], [0.9125000238418579, 0.762499988079071, 0.10000000149011612, 0.10000000149011612], [0.9125000238418579, 0.762499988079071, 0.20000000298023224, 0.20000000298023224], [0.9375, 0.762499988079071, 0.10000000149011612, 0.10000000149011612], [0.9375, 0.762499988079071, 0.20000000298023224, 0.20000000298023224], [0.9624999761581421, 0.762499988079071, 0.10000000149011612, 0.10000000149011612], [0.9624999761581421, 0.762499988079071, 0.20000000298023224, 0.20000000298023224], [0.987500011920929, 0.762499988079071, 0.10000000149011612, 0.10000000149011612], [0.987500011920929, 0.762499988079071, 0.20000000298023224, 0.20000000298023224], [0.012500000186264515, 0.7875000238418579, 0.10000000149011612, 0.10000000149011612], [0.012500000186264515, 0.7875000238418579, 0.20000000298023224, 0.20000000298023224], [0.03750000149011612, 0.7875000238418579, 0.10000000149011612, 0.10000000149011612], [0.03750000149011612, 0.7875000238418579, 0.20000000298023224, 0.20000000298023224], [0.0625, 0.7875000238418579, 0.10000000149011612, 0.10000000149011612], [0.0625, 0.7875000238418579, 0.20000000298023224, 0.20000000298023224], [0.08749999850988388, 0.7875000238418579, 0.10000000149011612, 0.10000000149011612], [0.08749999850988388, 0.7875000238418579, 0.20000000298023224, 0.20000000298023224], [0.11249999701976776, 0.7875000238418579, 0.10000000149011612, 0.10000000149011612], [0.11249999701976776, 0.7875000238418579, 0.20000000298023224, 0.20000000298023224], [0.13750000298023224, 0.7875000238418579, 0.10000000149011612, 0.10000000149011612], [0.13750000298023224, 0.7875000238418579, 0.20000000298023224, 0.20000000298023224], [0.16249999403953552, 0.7875000238418579, 0.10000000149011612, 0.10000000149011612], [0.16249999403953552, 0.7875000238418579, 0.20000000298023224, 0.20000000298023224], [0.1875, 0.7875000238418579, 0.10000000149011612, 0.10000000149011612], [0.1875, 0.7875000238418579, 0.20000000298023224, 0.20000000298023224], [0.21250000596046448, 0.7875000238418579, 0.10000000149011612, 0.10000000149011612], [0.21250000596046448, 0.7875000238418579, 0.20000000298023224, 0.20000000298023224], [0.23749999701976776, 0.7875000238418579, 0.10000000149011612, 0.10000000149011612], [0.23749999701976776, 0.7875000238418579, 0.20000000298023224, 0.20000000298023224], [0.26249998807907104, 0.7875000238418579, 0.10000000149011612, 0.10000000149011612], [0.26249998807907104, 0.7875000238418579, 0.20000000298023224, 0.20000000298023224], [0.2874999940395355, 0.7875000238418579, 0.10000000149011612, 0.10000000149011612], [0.2874999940395355, 0.7875000238418579, 0.20000000298023224, 0.20000000298023224], [0.3125, 0.7875000238418579, 0.10000000149011612, 0.10000000149011612], [0.3125, 0.7875000238418579, 0.20000000298023224, 0.20000000298023224], [0.3375000059604645, 0.7875000238418579, 0.10000000149011612, 0.10000000149011612], [0.3375000059604645, 0.7875000238418579, 0.20000000298023224, 0.20000000298023224], [0.36250001192092896, 0.7875000238418579, 0.10000000149011612, 0.10000000149011612], [0.36250001192092896, 0.7875000238418579, 0.20000000298023224, 0.20000000298023224], [0.38749998807907104, 0.7875000238418579, 0.10000000149011612, 0.10000000149011612], [0.38749998807907104, 0.7875000238418579, 0.20000000298023224, 0.20000000298023224], [0.4124999940395355, 0.7875000238418579, 0.10000000149011612, 0.10000000149011612], [0.4124999940395355, 0.7875000238418579, 0.20000000298023224, 0.20000000298023224], [0.4375, 0.7875000238418579, 0.10000000149011612, 0.10000000149011612], [0.4375, 0.7875000238418579, 0.20000000298023224, 0.20000000298023224], [0.4625000059604645, 0.7875000238418579, 0.10000000149011612, 0.10000000149011612], [0.4625000059604645, 0.7875000238418579, 0.20000000298023224, 0.20000000298023224], [0.48750001192092896, 0.7875000238418579, 0.10000000149011612, 0.10000000149011612], [0.48750001192092896, 0.7875000238418579, 0.20000000298023224, 0.20000000298023224], [0.512499988079071, 0.7875000238418579, 0.10000000149011612, 0.10000000149011612], [0.512499988079071, 0.7875000238418579, 0.20000000298023224, 0.20000000298023224], [0.5375000238418579, 0.7875000238418579, 0.10000000149011612, 0.10000000149011612], [0.5375000238418579, 0.7875000238418579, 0.20000000298023224, 0.20000000298023224], [0.5625, 0.7875000238418579, 0.10000000149011612, 0.10000000149011612], [0.5625, 0.7875000238418579, 0.20000000298023224, 0.20000000298023224], [0.5874999761581421, 0.7875000238418579, 0.10000000149011612, 0.10000000149011612], [0.5874999761581421, 0.7875000238418579, 0.20000000298023224, 0.20000000298023224], [0.612500011920929, 0.7875000238418579, 0.10000000149011612, 0.10000000149011612], [0.612500011920929, 0.7875000238418579, 0.20000000298023224, 0.20000000298023224], [0.637499988079071, 0.7875000238418579, 0.10000000149011612, 0.10000000149011612], [0.637499988079071, 0.7875000238418579, 0.20000000298023224, 0.20000000298023224], [0.6625000238418579, 0.7875000238418579, 0.10000000149011612, 0.10000000149011612], [0.6625000238418579, 0.7875000238418579, 0.20000000298023224, 0.20000000298023224], [0.6875, 0.7875000238418579, 0.10000000149011612, 0.10000000149011612], [0.6875, 0.7875000238418579, 0.20000000298023224, 0.20000000298023224], [0.7124999761581421, 0.7875000238418579, 0.10000000149011612, 0.10000000149011612], [0.7124999761581421, 0.7875000238418579, 0.20000000298023224, 0.20000000298023224], [0.737500011920929, 0.7875000238418579, 0.10000000149011612, 0.10000000149011612], [0.737500011920929, 0.7875000238418579, 0.20000000298023224, 0.20000000298023224], [0.762499988079071, 0.7875000238418579, 0.10000000149011612, 0.10000000149011612], [0.762499988079071, 0.7875000238418579, 0.20000000298023224, 0.20000000298023224], [0.7875000238418579, 0.7875000238418579, 0.10000000149011612, 0.10000000149011612], [0.7875000238418579, 0.7875000238418579, 0.20000000298023224, 0.20000000298023224], [0.8125, 0.7875000238418579, 0.10000000149011612, 0.10000000149011612], [0.8125, 0.7875000238418579, 0.20000000298023224, 0.20000000298023224], [0.8374999761581421, 0.7875000238418579, 0.10000000149011612, 0.10000000149011612], [0.8374999761581421, 0.7875000238418579, 0.20000000298023224, 0.20000000298023224], [0.862500011920929, 0.7875000238418579, 0.10000000149011612, 0.10000000149011612], [0.862500011920929, 0.7875000238418579, 0.20000000298023224, 0.20000000298023224], [0.887499988079071, 0.7875000238418579, 0.10000000149011612, 0.10000000149011612], [0.887499988079071, 0.7875000238418579, 0.20000000298023224, 0.20000000298023224], [0.9125000238418579, 0.7875000238418579, 0.10000000149011612, 0.10000000149011612], [0.9125000238418579, 0.7875000238418579, 0.20000000298023224, 0.20000000298023224], [0.9375, 0.7875000238418579, 0.10000000149011612, 0.10000000149011612], [0.9375, 0.7875000238418579, 0.20000000298023224, 0.20000000298023224], [0.9624999761581421, 0.7875000238418579, 0.10000000149011612, 0.10000000149011612], [0.9624999761581421, 0.7875000238418579, 0.20000000298023224, 0.20000000298023224], [0.987500011920929, 0.7875000238418579, 0.10000000149011612, 0.10000000149011612], [0.987500011920929, 0.7875000238418579, 0.20000000298023224, 0.20000000298023224], [0.012500000186264515, 0.8125, 0.10000000149011612, 0.10000000149011612], [0.012500000186264515, 0.8125, 0.20000000298023224, 0.20000000298023224], [0.03750000149011612, 0.8125, 0.10000000149011612, 0.10000000149011612], [0.03750000149011612, 0.8125, 0.20000000298023224, 0.20000000298023224], [0.0625, 0.8125, 0.10000000149011612, 0.10000000149011612], [0.0625, 0.8125, 0.20000000298023224, 0.20000000298023224], [0.08749999850988388, 0.8125, 0.10000000149011612, 0.10000000149011612], [0.08749999850988388, 0.8125, 0.20000000298023224, 0.20000000298023224], [0.11249999701976776, 0.8125, 0.10000000149011612, 0.10000000149011612], [0.11249999701976776, 0.8125, 0.20000000298023224, 0.20000000298023224], [0.13750000298023224, 0.8125, 0.10000000149011612, 0.10000000149011612], [0.13750000298023224, 0.8125, 0.20000000298023224, 0.20000000298023224], [0.16249999403953552, 0.8125, 0.10000000149011612, 0.10000000149011612], [0.16249999403953552, 0.8125, 0.20000000298023224, 0.20000000298023224], [0.1875, 0.8125, 0.10000000149011612, 0.10000000149011612], [0.1875, 0.8125, 0.20000000298023224, 0.20000000298023224], [0.21250000596046448, 0.8125, 0.10000000149011612, 0.10000000149011612], [0.21250000596046448, 0.8125, 0.20000000298023224, 0.20000000298023224], [0.23749999701976776, 0.8125, 0.10000000149011612, 0.10000000149011612], [0.23749999701976776, 0.8125, 0.20000000298023224, 0.20000000298023224], [0.26249998807907104, 0.8125, 0.10000000149011612, 0.10000000149011612], [0.26249998807907104, 0.8125, 0.20000000298023224, 0.20000000298023224], [0.2874999940395355, 0.8125, 0.10000000149011612, 0.10000000149011612], [0.2874999940395355, 0.8125, 0.20000000298023224, 0.20000000298023224], [0.3125, 0.8125, 0.10000000149011612, 0.10000000149011612], [0.3125, 0.8125, 0.20000000298023224, 0.20000000298023224], [0.3375000059604645, 0.8125, 0.10000000149011612, 0.10000000149011612], [0.3375000059604645, 0.8125, 0.20000000298023224, 0.20000000298023224], [0.36250001192092896, 0.8125, 0.10000000149011612, 0.10000000149011612], [0.36250001192092896, 0.8125, 0.20000000298023224, 0.20000000298023224], [0.38749998807907104, 0.8125, 0.10000000149011612, 0.10000000149011612], [0.38749998807907104, 0.8125, 0.20000000298023224, 0.20000000298023224], [0.4124999940395355, 0.8125, 0.10000000149011612, 0.10000000149011612], [0.4124999940395355, 0.8125, 0.20000000298023224, 0.20000000298023224], [0.4375, 0.8125, 0.10000000149011612, 0.10000000149011612], [0.4375, 0.8125, 0.20000000298023224, 0.20000000298023224], [0.4625000059604645, 0.8125, 0.10000000149011612, 0.10000000149011612], [0.4625000059604645, 0.8125, 0.20000000298023224, 0.20000000298023224], [0.48750001192092896, 0.8125, 0.10000000149011612, 0.10000000149011612], [0.48750001192092896, 0.8125, 0.20000000298023224, 0.20000000298023224], [0.512499988079071, 0.8125, 0.10000000149011612, 0.10000000149011612], [0.512499988079071, 0.8125, 0.20000000298023224, 0.20000000298023224], [0.5375000238418579, 0.8125, 0.10000000149011612, 0.10000000149011612], [0.5375000238418579, 0.8125, 0.20000000298023224, 0.20000000298023224], [0.5625, 0.8125, 0.10000000149011612, 0.10000000149011612], [0.5625, 0.8125, 0.20000000298023224, 0.20000000298023224], [0.5874999761581421, 0.8125, 0.10000000149011612, 0.10000000149011612], [0.5874999761581421, 0.8125, 0.20000000298023224, 0.20000000298023224], [0.612500011920929, 0.8125, 0.10000000149011612, 0.10000000149011612], [0.612500011920929, 0.8125, 0.20000000298023224, 0.20000000298023224], [0.637499988079071, 0.8125, 0.10000000149011612, 0.10000000149011612], [0.637499988079071, 0.8125, 0.20000000298023224, 0.20000000298023224], [0.6625000238418579, 0.8125, 0.10000000149011612, 0.10000000149011612], [0.6625000238418579, 0.8125, 0.20000000298023224, 0.20000000298023224], [0.6875, 0.8125, 0.10000000149011612, 0.10000000149011612], [0.6875, 0.8125, 0.20000000298023224, 0.20000000298023224], [0.7124999761581421, 0.8125, 0.10000000149011612, 0.10000000149011612], [0.7124999761581421, 0.8125, 0.20000000298023224, 0.20000000298023224], [0.737500011920929, 0.8125, 0.10000000149011612, 0.10000000149011612], [0.737500011920929, 0.8125, 0.20000000298023224, 0.20000000298023224], [0.762499988079071, 0.8125, 0.10000000149011612, 0.10000000149011612], [0.762499988079071, 0.8125, 0.20000000298023224, 0.20000000298023224], [0.7875000238418579, 0.8125, 0.10000000149011612, 0.10000000149011612], [0.7875000238418579, 0.8125, 0.20000000298023224, 0.20000000298023224], [0.8125, 0.8125, 0.10000000149011612, 0.10000000149011612], [0.8125, 0.8125, 0.20000000298023224, 0.20000000298023224], [0.8374999761581421, 0.8125, 0.10000000149011612, 0.10000000149011612], [0.8374999761581421, 0.8125, 0.20000000298023224, 0.20000000298023224], [0.862500011920929, 0.8125, 0.10000000149011612, 0.10000000149011612], [0.862500011920929, 0.8125, 0.20000000298023224, 0.20000000298023224], [0.887499988079071, 0.8125, 0.10000000149011612, 0.10000000149011612], [0.887499988079071, 0.8125, 0.20000000298023224, 0.20000000298023224], [0.9125000238418579, 0.8125, 0.10000000149011612, 0.10000000149011612], [0.9125000238418579, 0.8125, 0.20000000298023224, 0.20000000298023224], [0.9375, 0.8125, 0.10000000149011612, 0.10000000149011612], [0.9375, 0.8125, 0.20000000298023224, 0.20000000298023224], [0.9624999761581421, 0.8125, 0.10000000149011612, 0.10000000149011612], [0.9624999761581421, 0.8125, 0.20000000298023224, 0.20000000298023224], [0.987500011920929, 0.8125, 0.10000000149011612, 0.10000000149011612], [0.987500011920929, 0.8125, 0.20000000298023224, 0.20000000298023224], [0.012500000186264515, 0.8374999761581421, 0.10000000149011612, 0.10000000149011612], [0.012500000186264515, 0.8374999761581421, 0.20000000298023224, 0.20000000298023224], [0.03750000149011612, 0.8374999761581421, 0.10000000149011612, 0.10000000149011612], [0.03750000149011612, 0.8374999761581421, 0.20000000298023224, 0.20000000298023224], [0.0625, 0.8374999761581421, 0.10000000149011612, 0.10000000149011612], [0.0625, 0.8374999761581421, 0.20000000298023224, 0.20000000298023224], [0.08749999850988388, 0.8374999761581421, 0.10000000149011612, 0.10000000149011612], [0.08749999850988388, 0.8374999761581421, 0.20000000298023224, 0.20000000298023224], [0.11249999701976776, 0.8374999761581421, 0.10000000149011612, 0.10000000149011612], [0.11249999701976776, 0.8374999761581421, 0.20000000298023224, 0.20000000298023224], [0.13750000298023224, 0.8374999761581421, 0.10000000149011612, 0.10000000149011612], [0.13750000298023224, 0.8374999761581421, 0.20000000298023224, 0.20000000298023224], [0.16249999403953552, 0.8374999761581421, 0.10000000149011612, 0.10000000149011612], [0.16249999403953552, 0.8374999761581421, 0.20000000298023224, 0.20000000298023224], [0.1875, 0.8374999761581421, 0.10000000149011612, 0.10000000149011612], [0.1875, 0.8374999761581421, 0.20000000298023224, 0.20000000298023224], [0.21250000596046448, 0.8374999761581421, 0.10000000149011612, 0.10000000149011612], [0.21250000596046448, 0.8374999761581421, 0.20000000298023224, 0.20000000298023224], [0.23749999701976776, 0.8374999761581421, 0.10000000149011612, 0.10000000149011612], [0.23749999701976776, 0.8374999761581421, 0.20000000298023224, 0.20000000298023224], [0.26249998807907104, 0.8374999761581421, 0.10000000149011612, 0.10000000149011612], [0.26249998807907104, 0.8374999761581421, 0.20000000298023224, 0.20000000298023224], [0.2874999940395355, 0.8374999761581421, 0.10000000149011612, 0.10000000149011612], [0.2874999940395355, 0.8374999761581421, 0.20000000298023224, 0.20000000298023224], [0.3125, 0.8374999761581421, 0.10000000149011612, 0.10000000149011612], [0.3125, 0.8374999761581421, 0.20000000298023224, 0.20000000298023224], [0.3375000059604645, 0.8374999761581421, 0.10000000149011612, 0.10000000149011612], [0.3375000059604645, 0.8374999761581421, 0.20000000298023224, 0.20000000298023224], [0.36250001192092896, 0.8374999761581421, 0.10000000149011612, 0.10000000149011612], [0.36250001192092896, 0.8374999761581421, 0.20000000298023224, 0.20000000298023224], [0.38749998807907104, 0.8374999761581421, 0.10000000149011612, 0.10000000149011612], [0.38749998807907104, 0.8374999761581421, 0.20000000298023224, 0.20000000298023224], [0.4124999940395355, 0.8374999761581421, 0.10000000149011612, 0.10000000149011612], [0.4124999940395355, 0.8374999761581421, 0.20000000298023224, 0.20000000298023224], [0.4375, 0.8374999761581421, 0.10000000149011612, 0.10000000149011612], [0.4375, 0.8374999761581421, 0.20000000298023224, 0.20000000298023224], [0.4625000059604645, 0.8374999761581421, 0.10000000149011612, 0.10000000149011612], [0.4625000059604645, 0.8374999761581421, 0.20000000298023224, 0.20000000298023224], [0.48750001192092896, 0.8374999761581421, 0.10000000149011612, 0.10000000149011612], [0.48750001192092896, 0.8374999761581421, 0.20000000298023224, 0.20000000298023224], [0.512499988079071, 0.8374999761581421, 0.10000000149011612, 0.10000000149011612], [0.512499988079071, 0.8374999761581421, 0.20000000298023224, 0.20000000298023224], [0.5375000238418579, 0.8374999761581421, 0.10000000149011612, 0.10000000149011612], [0.5375000238418579, 0.8374999761581421, 0.20000000298023224, 0.20000000298023224], [0.5625, 0.8374999761581421, 0.10000000149011612, 0.10000000149011612], [0.5625, 0.8374999761581421, 0.20000000298023224, 0.20000000298023224], [0.5874999761581421, 0.8374999761581421, 0.10000000149011612, 0.10000000149011612], [0.5874999761581421, 0.8374999761581421, 0.20000000298023224, 0.20000000298023224], [0.612500011920929, 0.8374999761581421, 0.10000000149011612, 0.10000000149011612], [0.612500011920929, 0.8374999761581421, 0.20000000298023224, 0.20000000298023224], [0.637499988079071, 0.8374999761581421, 0.10000000149011612, 0.10000000149011612], [0.637499988079071, 0.8374999761581421, 0.20000000298023224, 0.20000000298023224], [0.6625000238418579, 0.8374999761581421, 0.10000000149011612, 0.10000000149011612], [0.6625000238418579, 0.8374999761581421, 0.20000000298023224, 0.20000000298023224], [0.6875, 0.8374999761581421, 0.10000000149011612, 0.10000000149011612], [0.6875, 0.8374999761581421, 0.20000000298023224, 0.20000000298023224], [0.7124999761581421, 0.8374999761581421, 0.10000000149011612, 0.10000000149011612], [0.7124999761581421, 0.8374999761581421, 0.20000000298023224, 0.20000000298023224], [0.737500011920929, 0.8374999761581421, 0.10000000149011612, 0.10000000149011612], [0.737500011920929, 0.8374999761581421, 0.20000000298023224, 0.20000000298023224], [0.762499988079071, 0.8374999761581421, 0.10000000149011612, 0.10000000149011612], [0.762499988079071, 0.8374999761581421, 0.20000000298023224, 0.20000000298023224], [0.7875000238418579, 0.8374999761581421, 0.10000000149011612, 0.10000000149011612], [0.7875000238418579, 0.8374999761581421, 0.20000000298023224, 0.20000000298023224], [0.8125, 0.8374999761581421, 0.10000000149011612, 0.10000000149011612], [0.8125, 0.8374999761581421, 0.20000000298023224, 0.20000000298023224], [0.8374999761581421, 0.8374999761581421, 0.10000000149011612, 0.10000000149011612], [0.8374999761581421, 0.8374999761581421, 0.20000000298023224, 0.20000000298023224], [0.862500011920929, 0.8374999761581421, 0.10000000149011612, 0.10000000149011612], [0.862500011920929, 0.8374999761581421, 0.20000000298023224, 0.20000000298023224], [0.887499988079071, 0.8374999761581421, 0.10000000149011612, 0.10000000149011612], [0.887499988079071, 0.8374999761581421, 0.20000000298023224, 0.20000000298023224], [0.9125000238418579, 0.8374999761581421, 0.10000000149011612, 0.10000000149011612], [0.9125000238418579, 0.8374999761581421, 0.20000000298023224, 0.20000000298023224], [0.9375, 0.8374999761581421, 0.10000000149011612, 0.10000000149011612], [0.9375, 0.8374999761581421, 0.20000000298023224, 0.20000000298023224], [0.9624999761581421, 0.8374999761581421, 0.10000000149011612, 0.10000000149011612], [0.9624999761581421, 0.8374999761581421, 0.20000000298023224, 0.20000000298023224], [0.987500011920929, 0.8374999761581421, 0.10000000149011612, 0.10000000149011612], [0.987500011920929, 0.8374999761581421, 0.20000000298023224, 0.20000000298023224], [0.012500000186264515, 0.862500011920929, 0.10000000149011612, 0.10000000149011612], [0.012500000186264515, 0.862500011920929, 0.20000000298023224, 0.20000000298023224], [0.03750000149011612, 0.862500011920929, 0.10000000149011612, 0.10000000149011612], [0.03750000149011612, 0.862500011920929, 0.20000000298023224, 0.20000000298023224], [0.0625, 0.862500011920929, 0.10000000149011612, 0.10000000149011612], [0.0625, 0.862500011920929, 0.20000000298023224, 0.20000000298023224], [0.08749999850988388, 0.862500011920929, 0.10000000149011612, 0.10000000149011612], [0.08749999850988388, 0.862500011920929, 0.20000000298023224, 0.20000000298023224], [0.11249999701976776, 0.862500011920929, 0.10000000149011612, 0.10000000149011612], [0.11249999701976776, 0.862500011920929, 0.20000000298023224, 0.20000000298023224], [0.13750000298023224, 0.862500011920929, 0.10000000149011612, 0.10000000149011612], [0.13750000298023224, 0.862500011920929, 0.20000000298023224, 0.20000000298023224], [0.16249999403953552, 0.862500011920929, 0.10000000149011612, 0.10000000149011612], [0.16249999403953552, 0.862500011920929, 0.20000000298023224, 0.20000000298023224], [0.1875, 0.862500011920929, 0.10000000149011612, 0.10000000149011612], [0.1875, 0.862500011920929, 0.20000000298023224, 0.20000000298023224], [0.21250000596046448, 0.862500011920929, 0.10000000149011612, 0.10000000149011612], [0.21250000596046448, 0.862500011920929, 0.20000000298023224, 0.20000000298023224], [0.23749999701976776, 0.862500011920929, 0.10000000149011612, 0.10000000149011612], [0.23749999701976776, 0.862500011920929, 0.20000000298023224, 0.20000000298023224], [0.26249998807907104, 0.862500011920929, 0.10000000149011612, 0.10000000149011612], [0.26249998807907104, 0.862500011920929, 0.20000000298023224, 0.20000000298023224], [0.2874999940395355, 0.862500011920929, 0.10000000149011612, 0.10000000149011612], [0.2874999940395355, 0.862500011920929, 0.20000000298023224, 0.20000000298023224], [0.3125, 0.862500011920929, 0.10000000149011612, 0.10000000149011612], [0.3125, 0.862500011920929, 0.20000000298023224, 0.20000000298023224], [0.3375000059604645, 0.862500011920929, 0.10000000149011612, 0.10000000149011612], [0.3375000059604645, 0.862500011920929, 0.20000000298023224, 0.20000000298023224], [0.36250001192092896, 0.862500011920929, 0.10000000149011612, 0.10000000149011612], [0.36250001192092896, 0.862500011920929, 0.20000000298023224, 0.20000000298023224], [0.38749998807907104, 0.862500011920929, 0.10000000149011612, 0.10000000149011612], [0.38749998807907104, 0.862500011920929, 0.20000000298023224, 0.20000000298023224], [0.4124999940395355, 0.862500011920929, 0.10000000149011612, 0.10000000149011612], [0.4124999940395355, 0.862500011920929, 0.20000000298023224, 0.20000000298023224], [0.4375, 0.862500011920929, 0.10000000149011612, 0.10000000149011612], [0.4375, 0.862500011920929, 0.20000000298023224, 0.20000000298023224], [0.4625000059604645, 0.862500011920929, 0.10000000149011612, 0.10000000149011612], [0.4625000059604645, 0.862500011920929, 0.20000000298023224, 0.20000000298023224], [0.48750001192092896, 0.862500011920929, 0.10000000149011612, 0.10000000149011612], [0.48750001192092896, 0.862500011920929, 0.20000000298023224, 0.20000000298023224], [0.512499988079071, 0.862500011920929, 0.10000000149011612, 0.10000000149011612], [0.512499988079071, 0.862500011920929, 0.20000000298023224, 0.20000000298023224], [0.5375000238418579, 0.862500011920929, 0.10000000149011612, 0.10000000149011612], [0.5375000238418579, 0.862500011920929, 0.20000000298023224, 0.20000000298023224], [0.5625, 0.862500011920929, 0.10000000149011612, 0.10000000149011612], [0.5625, 0.862500011920929, 0.20000000298023224, 0.20000000298023224], [0.5874999761581421, 0.862500011920929, 0.10000000149011612, 0.10000000149011612], [0.5874999761581421, 0.862500011920929, 0.20000000298023224, 0.20000000298023224], [0.612500011920929, 0.862500011920929, 0.10000000149011612, 0.10000000149011612], [0.612500011920929, 0.862500011920929, 0.20000000298023224, 0.20000000298023224], [0.637499988079071, 0.862500011920929, 0.10000000149011612, 0.10000000149011612], [0.637499988079071, 0.862500011920929, 0.20000000298023224, 0.20000000298023224], [0.6625000238418579, 0.862500011920929, 0.10000000149011612, 0.10000000149011612], [0.6625000238418579, 0.862500011920929, 0.20000000298023224, 0.20000000298023224], [0.6875, 0.862500011920929, 0.10000000149011612, 0.10000000149011612], [0.6875, 0.862500011920929, 0.20000000298023224, 0.20000000298023224], [0.7124999761581421, 0.862500011920929, 0.10000000149011612, 0.10000000149011612], [0.7124999761581421, 0.862500011920929, 0.20000000298023224, 0.20000000298023224], [0.737500011920929, 0.862500011920929, 0.10000000149011612, 0.10000000149011612], [0.737500011920929, 0.862500011920929, 0.20000000298023224, 0.20000000298023224], [0.762499988079071, 0.862500011920929, 0.10000000149011612, 0.10000000149011612], [0.762499988079071, 0.862500011920929, 0.20000000298023224, 0.20000000298023224], [0.7875000238418579, 0.862500011920929, 0.10000000149011612, 0.10000000149011612], [0.7875000238418579, 0.862500011920929, 0.20000000298023224, 0.20000000298023224], [0.8125, 0.862500011920929, 0.10000000149011612, 0.10000000149011612], [0.8125, 0.862500011920929, 0.20000000298023224, 0.20000000298023224], [0.8374999761581421, 0.862500011920929, 0.10000000149011612, 0.10000000149011612], [0.8374999761581421, 0.862500011920929, 0.20000000298023224, 0.20000000298023224], [0.862500011920929, 0.862500011920929, 0.10000000149011612, 0.10000000149011612], [0.862500011920929, 0.862500011920929, 0.20000000298023224, 0.20000000298023224], [0.887499988079071, 0.862500011920929, 0.10000000149011612, 0.10000000149011612], [0.887499988079071, 0.862500011920929, 0.20000000298023224, 0.20000000298023224], [0.9125000238418579, 0.862500011920929, 0.10000000149011612, 0.10000000149011612], [0.9125000238418579, 0.862500011920929, 0.20000000298023224, 0.20000000298023224], [0.9375, 0.862500011920929, 0.10000000149011612, 0.10000000149011612], [0.9375, 0.862500011920929, 0.20000000298023224, 0.20000000298023224], [0.9624999761581421, 0.862500011920929, 0.10000000149011612, 0.10000000149011612], [0.9624999761581421, 0.862500011920929, 0.20000000298023224, 0.20000000298023224], [0.987500011920929, 0.862500011920929, 0.10000000149011612, 0.10000000149011612], [0.987500011920929, 0.862500011920929, 0.20000000298023224, 0.20000000298023224], [0.012500000186264515, 0.887499988079071, 0.10000000149011612, 0.10000000149011612], [0.012500000186264515, 0.887499988079071, 0.20000000298023224, 0.20000000298023224], [0.03750000149011612, 0.887499988079071, 0.10000000149011612, 0.10000000149011612], [0.03750000149011612, 0.887499988079071, 0.20000000298023224, 0.20000000298023224], [0.0625, 0.887499988079071, 0.10000000149011612, 0.10000000149011612], [0.0625, 0.887499988079071, 0.20000000298023224, 0.20000000298023224], [0.08749999850988388, 0.887499988079071, 0.10000000149011612, 0.10000000149011612], [0.08749999850988388, 0.887499988079071, 0.20000000298023224, 0.20000000298023224], [0.11249999701976776, 0.887499988079071, 0.10000000149011612, 0.10000000149011612], [0.11249999701976776, 0.887499988079071, 0.20000000298023224, 0.20000000298023224], [0.13750000298023224, 0.887499988079071, 0.10000000149011612, 0.10000000149011612], [0.13750000298023224, 0.887499988079071, 0.20000000298023224, 0.20000000298023224], [0.16249999403953552, 0.887499988079071, 0.10000000149011612, 0.10000000149011612], [0.16249999403953552, 0.887499988079071, 0.20000000298023224, 0.20000000298023224], [0.1875, 0.887499988079071, 0.10000000149011612, 0.10000000149011612], [0.1875, 0.887499988079071, 0.20000000298023224, 0.20000000298023224], [0.21250000596046448, 0.887499988079071, 0.10000000149011612, 0.10000000149011612], [0.21250000596046448, 0.887499988079071, 0.20000000298023224, 0.20000000298023224], [0.23749999701976776, 0.887499988079071, 0.10000000149011612, 0.10000000149011612], [0.23749999701976776, 0.887499988079071, 0.20000000298023224, 0.20000000298023224], [0.26249998807907104, 0.887499988079071, 0.10000000149011612, 0.10000000149011612], [0.26249998807907104, 0.887499988079071, 0.20000000298023224, 0.20000000298023224], [0.2874999940395355, 0.887499988079071, 0.10000000149011612, 0.10000000149011612], [0.2874999940395355, 0.887499988079071, 0.20000000298023224, 0.20000000298023224], [0.3125, 0.887499988079071, 0.10000000149011612, 0.10000000149011612], [0.3125, 0.887499988079071, 0.20000000298023224, 0.20000000298023224], [0.3375000059604645, 0.887499988079071, 0.10000000149011612, 0.10000000149011612], [0.3375000059604645, 0.887499988079071, 0.20000000298023224, 0.20000000298023224], [0.36250001192092896, 0.887499988079071, 0.10000000149011612, 0.10000000149011612], [0.36250001192092896, 0.887499988079071, 0.20000000298023224, 0.20000000298023224], [0.38749998807907104, 0.887499988079071, 0.10000000149011612, 0.10000000149011612], [0.38749998807907104, 0.887499988079071, 0.20000000298023224, 0.20000000298023224], [0.4124999940395355, 0.887499988079071, 0.10000000149011612, 0.10000000149011612], [0.4124999940395355, 0.887499988079071, 0.20000000298023224, 0.20000000298023224], [0.4375, 0.887499988079071, 0.10000000149011612, 0.10000000149011612], [0.4375, 0.887499988079071, 0.20000000298023224, 0.20000000298023224], [0.4625000059604645, 0.887499988079071, 0.10000000149011612, 0.10000000149011612], [0.4625000059604645, 0.887499988079071, 0.20000000298023224, 0.20000000298023224], [0.48750001192092896, 0.887499988079071, 0.10000000149011612, 0.10000000149011612], [0.48750001192092896, 0.887499988079071, 0.20000000298023224, 0.20000000298023224], [0.512499988079071, 0.887499988079071, 0.10000000149011612, 0.10000000149011612], [0.512499988079071, 0.887499988079071, 0.20000000298023224, 0.20000000298023224], [0.5375000238418579, 0.887499988079071, 0.10000000149011612, 0.10000000149011612], [0.5375000238418579, 0.887499988079071, 0.20000000298023224, 0.20000000298023224], [0.5625, 0.887499988079071, 0.10000000149011612, 0.10000000149011612], [0.5625, 0.887499988079071, 0.20000000298023224, 0.20000000298023224], [0.5874999761581421, 0.887499988079071, 0.10000000149011612, 0.10000000149011612], [0.5874999761581421, 0.887499988079071, 0.20000000298023224, 0.20000000298023224], [0.612500011920929, 0.887499988079071, 0.10000000149011612, 0.10000000149011612], [0.612500011920929, 0.887499988079071, 0.20000000298023224, 0.20000000298023224], [0.637499988079071, 0.887499988079071, 0.10000000149011612, 0.10000000149011612], [0.637499988079071, 0.887499988079071, 0.20000000298023224, 0.20000000298023224], [0.6625000238418579, 0.887499988079071, 0.10000000149011612, 0.10000000149011612], [0.6625000238418579, 0.887499988079071, 0.20000000298023224, 0.20000000298023224], [0.6875, 0.887499988079071, 0.10000000149011612, 0.10000000149011612], [0.6875, 0.887499988079071, 0.20000000298023224, 0.20000000298023224], [0.7124999761581421, 0.887499988079071, 0.10000000149011612, 0.10000000149011612], [0.7124999761581421, 0.887499988079071, 0.20000000298023224, 0.20000000298023224], [0.737500011920929, 0.887499988079071, 0.10000000149011612, 0.10000000149011612], [0.737500011920929, 0.887499988079071, 0.20000000298023224, 0.20000000298023224], [0.762499988079071, 0.887499988079071, 0.10000000149011612, 0.10000000149011612], [0.762499988079071, 0.887499988079071, 0.20000000298023224, 0.20000000298023224], [0.7875000238418579, 0.887499988079071, 0.10000000149011612, 0.10000000149011612], [0.7875000238418579, 0.887499988079071, 0.20000000298023224, 0.20000000298023224], [0.8125, 0.887499988079071, 0.10000000149011612, 0.10000000149011612], [0.8125, 0.887499988079071, 0.20000000298023224, 0.20000000298023224], [0.8374999761581421, 0.887499988079071, 0.10000000149011612, 0.10000000149011612], [0.8374999761581421, 0.887499988079071, 0.20000000298023224, 0.20000000298023224], [0.862500011920929, 0.887499988079071, 0.10000000149011612, 0.10000000149011612], [0.862500011920929, 0.887499988079071, 0.20000000298023224, 0.20000000298023224], [0.887499988079071, 0.887499988079071, 0.10000000149011612, 0.10000000149011612], [0.887499988079071, 0.887499988079071, 0.20000000298023224, 0.20000000298023224], [0.9125000238418579, 0.887499988079071, 0.10000000149011612, 0.10000000149011612], [0.9125000238418579, 0.887499988079071, 0.20000000298023224, 0.20000000298023224], [0.9375, 0.887499988079071, 0.10000000149011612, 0.10000000149011612], [0.9375, 0.887499988079071, 0.20000000298023224, 0.20000000298023224], [0.9624999761581421, 0.887499988079071, 0.10000000149011612, 0.10000000149011612], [0.9624999761581421, 0.887499988079071, 0.20000000298023224, 0.20000000298023224], [0.987500011920929, 0.887499988079071, 0.10000000149011612, 0.10000000149011612], [0.987500011920929, 0.887499988079071, 0.20000000298023224, 0.20000000298023224], [0.012500000186264515, 0.9125000238418579, 0.10000000149011612, 0.10000000149011612], [0.012500000186264515, 0.9125000238418579, 0.20000000298023224, 0.20000000298023224], [0.03750000149011612, 0.9125000238418579, 0.10000000149011612, 0.10000000149011612], [0.03750000149011612, 0.9125000238418579, 0.20000000298023224, 0.20000000298023224], [0.0625, 0.9125000238418579, 0.10000000149011612, 0.10000000149011612], [0.0625, 0.9125000238418579, 0.20000000298023224, 0.20000000298023224], [0.08749999850988388, 0.9125000238418579, 0.10000000149011612, 0.10000000149011612], [0.08749999850988388, 0.9125000238418579, 0.20000000298023224, 0.20000000298023224], [0.11249999701976776, 0.9125000238418579, 0.10000000149011612, 0.10000000149011612], [0.11249999701976776, 0.9125000238418579, 0.20000000298023224, 0.20000000298023224], [0.13750000298023224, 0.9125000238418579, 0.10000000149011612, 0.10000000149011612], [0.13750000298023224, 0.9125000238418579, 0.20000000298023224, 0.20000000298023224], [0.16249999403953552, 0.9125000238418579, 0.10000000149011612, 0.10000000149011612], [0.16249999403953552, 0.9125000238418579, 0.20000000298023224, 0.20000000298023224], [0.1875, 0.9125000238418579, 0.10000000149011612, 0.10000000149011612], [0.1875, 0.9125000238418579, 0.20000000298023224, 0.20000000298023224], [0.21250000596046448, 0.9125000238418579, 0.10000000149011612, 0.10000000149011612], [0.21250000596046448, 0.9125000238418579, 0.20000000298023224, 0.20000000298023224], [0.23749999701976776, 0.9125000238418579, 0.10000000149011612, 0.10000000149011612], [0.23749999701976776, 0.9125000238418579, 0.20000000298023224, 0.20000000298023224], [0.26249998807907104, 0.9125000238418579, 0.10000000149011612, 0.10000000149011612], [0.26249998807907104, 0.9125000238418579, 0.20000000298023224, 0.20000000298023224], [0.2874999940395355, 0.9125000238418579, 0.10000000149011612, 0.10000000149011612], [0.2874999940395355, 0.9125000238418579, 0.20000000298023224, 0.20000000298023224], [0.3125, 0.9125000238418579, 0.10000000149011612, 0.10000000149011612], [0.3125, 0.9125000238418579, 0.20000000298023224, 0.20000000298023224], [0.3375000059604645, 0.9125000238418579, 0.10000000149011612, 0.10000000149011612], [0.3375000059604645, 0.9125000238418579, 0.20000000298023224, 0.20000000298023224], [0.36250001192092896, 0.9125000238418579, 0.10000000149011612, 0.10000000149011612], [0.36250001192092896, 0.9125000238418579, 0.20000000298023224, 0.20000000298023224], [0.38749998807907104, 0.9125000238418579, 0.10000000149011612, 0.10000000149011612], [0.38749998807907104, 0.9125000238418579, 0.20000000298023224, 0.20000000298023224], [0.4124999940395355, 0.9125000238418579, 0.10000000149011612, 0.10000000149011612], [0.4124999940395355, 0.9125000238418579, 0.20000000298023224, 0.20000000298023224], [0.4375, 0.9125000238418579, 0.10000000149011612, 0.10000000149011612], [0.4375, 0.9125000238418579, 0.20000000298023224, 0.20000000298023224], [0.4625000059604645, 0.9125000238418579, 0.10000000149011612, 0.10000000149011612], [0.4625000059604645, 0.9125000238418579, 0.20000000298023224, 0.20000000298023224], [0.48750001192092896, 0.9125000238418579, 0.10000000149011612, 0.10000000149011612], [0.48750001192092896, 0.9125000238418579, 0.20000000298023224, 0.20000000298023224], [0.512499988079071, 0.9125000238418579, 0.10000000149011612, 0.10000000149011612], [0.512499988079071, 0.9125000238418579, 0.20000000298023224, 0.20000000298023224], [0.5375000238418579, 0.9125000238418579, 0.10000000149011612, 0.10000000149011612], [0.5375000238418579, 0.9125000238418579, 0.20000000298023224, 0.20000000298023224], [0.5625, 0.9125000238418579, 0.10000000149011612, 0.10000000149011612], [0.5625, 0.9125000238418579, 0.20000000298023224, 0.20000000298023224], [0.5874999761581421, 0.9125000238418579, 0.10000000149011612, 0.10000000149011612], [0.5874999761581421, 0.9125000238418579, 0.20000000298023224, 0.20000000298023224], [0.612500011920929, 0.9125000238418579, 0.10000000149011612, 0.10000000149011612], [0.612500011920929, 0.9125000238418579, 0.20000000298023224, 0.20000000298023224], [0.637499988079071, 0.9125000238418579, 0.10000000149011612, 0.10000000149011612], [0.637499988079071, 0.9125000238418579, 0.20000000298023224, 0.20000000298023224], [0.6625000238418579, 0.9125000238418579, 0.10000000149011612, 0.10000000149011612], [0.6625000238418579, 0.9125000238418579, 0.20000000298023224, 0.20000000298023224], [0.6875, 0.9125000238418579, 0.10000000149011612, 0.10000000149011612], [0.6875, 0.9125000238418579, 0.20000000298023224, 0.20000000298023224], [0.7124999761581421, 0.9125000238418579, 0.10000000149011612, 0.10000000149011612], [0.7124999761581421, 0.9125000238418579, 0.20000000298023224, 0.20000000298023224], [0.737500011920929, 0.9125000238418579, 0.10000000149011612, 0.10000000149011612], [0.737500011920929, 0.9125000238418579, 0.20000000298023224, 0.20000000298023224], [0.762499988079071, 0.9125000238418579, 0.10000000149011612, 0.10000000149011612], [0.762499988079071, 0.9125000238418579, 0.20000000298023224, 0.20000000298023224], [0.7875000238418579, 0.9125000238418579, 0.10000000149011612, 0.10000000149011612], [0.7875000238418579, 0.9125000238418579, 0.20000000298023224, 0.20000000298023224], [0.8125, 0.9125000238418579, 0.10000000149011612, 0.10000000149011612], [0.8125, 0.9125000238418579, 0.20000000298023224, 0.20000000298023224], [0.8374999761581421, 0.9125000238418579, 0.10000000149011612, 0.10000000149011612], [0.8374999761581421, 0.9125000238418579, 0.20000000298023224, 0.20000000298023224], [0.862500011920929, 0.9125000238418579, 0.10000000149011612, 0.10000000149011612], [0.862500011920929, 0.9125000238418579, 0.20000000298023224, 0.20000000298023224], [0.887499988079071, 0.9125000238418579, 0.10000000149011612, 0.10000000149011612], [0.887499988079071, 0.9125000238418579, 0.20000000298023224, 0.20000000298023224], [0.9125000238418579, 0.9125000238418579, 0.10000000149011612, 0.10000000149011612], [0.9125000238418579, 0.9125000238418579, 0.20000000298023224, 0.20000000298023224], [0.9375, 0.9125000238418579, 0.10000000149011612, 0.10000000149011612], [0.9375, 0.9125000238418579, 0.20000000298023224, 0.20000000298023224], [0.9624999761581421, 0.9125000238418579, 0.10000000149011612, 0.10000000149011612], [0.9624999761581421, 0.9125000238418579, 0.20000000298023224, 0.20000000298023224], [0.987500011920929, 0.9125000238418579, 0.10000000149011612, 0.10000000149011612], [0.987500011920929, 0.9125000238418579, 0.20000000298023224, 0.20000000298023224], [0.012500000186264515, 0.9375, 0.10000000149011612, 0.10000000149011612], [0.012500000186264515, 0.9375, 0.20000000298023224, 0.20000000298023224], [0.03750000149011612, 0.9375, 0.10000000149011612, 0.10000000149011612], [0.03750000149011612, 0.9375, 0.20000000298023224, 0.20000000298023224], [0.0625, 0.9375, 0.10000000149011612, 0.10000000149011612], [0.0625, 0.9375, 0.20000000298023224, 0.20000000298023224], [0.08749999850988388, 0.9375, 0.10000000149011612, 0.10000000149011612], [0.08749999850988388, 0.9375, 0.20000000298023224, 0.20000000298023224], [0.11249999701976776, 0.9375, 0.10000000149011612, 0.10000000149011612], [0.11249999701976776, 0.9375, 0.20000000298023224, 0.20000000298023224], [0.13750000298023224, 0.9375, 0.10000000149011612, 0.10000000149011612], [0.13750000298023224, 0.9375, 0.20000000298023224, 0.20000000298023224], [0.16249999403953552, 0.9375, 0.10000000149011612, 0.10000000149011612], [0.16249999403953552, 0.9375, 0.20000000298023224, 0.20000000298023224], [0.1875, 0.9375, 0.10000000149011612, 0.10000000149011612], [0.1875, 0.9375, 0.20000000298023224, 0.20000000298023224], [0.21250000596046448, 0.9375, 0.10000000149011612, 0.10000000149011612], [0.21250000596046448, 0.9375, 0.20000000298023224, 0.20000000298023224], [0.23749999701976776, 0.9375, 0.10000000149011612, 0.10000000149011612], [0.23749999701976776, 0.9375, 0.20000000298023224, 0.20000000298023224], [0.26249998807907104, 0.9375, 0.10000000149011612, 0.10000000149011612], [0.26249998807907104, 0.9375, 0.20000000298023224, 0.20000000298023224], [0.2874999940395355, 0.9375, 0.10000000149011612, 0.10000000149011612], [0.2874999940395355, 0.9375, 0.20000000298023224, 0.20000000298023224], [0.3125, 0.9375, 0.10000000149011612, 0.10000000149011612], [0.3125, 0.9375, 0.20000000298023224, 0.20000000298023224], [0.3375000059604645, 0.9375, 0.10000000149011612, 0.10000000149011612], [0.3375000059604645, 0.9375, 0.20000000298023224, 0.20000000298023224], [0.36250001192092896, 0.9375, 0.10000000149011612, 0.10000000149011612], [0.36250001192092896, 0.9375, 0.20000000298023224, 0.20000000298023224], [0.38749998807907104, 0.9375, 0.10000000149011612, 0.10000000149011612], [0.38749998807907104, 0.9375, 0.20000000298023224, 0.20000000298023224], [0.4124999940395355, 0.9375, 0.10000000149011612, 0.10000000149011612], [0.4124999940395355, 0.9375, 0.20000000298023224, 0.20000000298023224], [0.4375, 0.9375, 0.10000000149011612, 0.10000000149011612], [0.4375, 0.9375, 0.20000000298023224, 0.20000000298023224], [0.4625000059604645, 0.9375, 0.10000000149011612, 0.10000000149011612], [0.4625000059604645, 0.9375, 0.20000000298023224, 0.20000000298023224], [0.48750001192092896, 0.9375, 0.10000000149011612, 0.10000000149011612], [0.48750001192092896, 0.9375, 0.20000000298023224, 0.20000000298023224], [0.512499988079071, 0.9375, 0.10000000149011612, 0.10000000149011612], [0.512499988079071, 0.9375, 0.20000000298023224, 0.20000000298023224], [0.5375000238418579, 0.9375, 0.10000000149011612, 0.10000000149011612], [0.5375000238418579, 0.9375, 0.20000000298023224, 0.20000000298023224], [0.5625, 0.9375, 0.10000000149011612, 0.10000000149011612], [0.5625, 0.9375, 0.20000000298023224, 0.20000000298023224], [0.5874999761581421, 0.9375, 0.10000000149011612, 0.10000000149011612], [0.5874999761581421, 0.9375, 0.20000000298023224, 0.20000000298023224], [0.612500011920929, 0.9375, 0.10000000149011612, 0.10000000149011612], [0.612500011920929, 0.9375, 0.20000000298023224, 0.20000000298023224], [0.637499988079071, 0.9375, 0.10000000149011612, 0.10000000149011612], [0.637499988079071, 0.9375, 0.20000000298023224, 0.20000000298023224], [0.6625000238418579, 0.9375, 0.10000000149011612, 0.10000000149011612], [0.6625000238418579, 0.9375, 0.20000000298023224, 0.20000000298023224], [0.6875, 0.9375, 0.10000000149011612, 0.10000000149011612], [0.6875, 0.9375, 0.20000000298023224, 0.20000000298023224], [0.7124999761581421, 0.9375, 0.10000000149011612, 0.10000000149011612], [0.7124999761581421, 0.9375, 0.20000000298023224, 0.20000000298023224], [0.737500011920929, 0.9375, 0.10000000149011612, 0.10000000149011612], [0.737500011920929, 0.9375, 0.20000000298023224, 0.20000000298023224], [0.762499988079071, 0.9375, 0.10000000149011612, 0.10000000149011612], [0.762499988079071, 0.9375, 0.20000000298023224, 0.20000000298023224], [0.7875000238418579, 0.9375, 0.10000000149011612, 0.10000000149011612], [0.7875000238418579, 0.9375, 0.20000000298023224, 0.20000000298023224], [0.8125, 0.9375, 0.10000000149011612, 0.10000000149011612], [0.8125, 0.9375, 0.20000000298023224, 0.20000000298023224], [0.8374999761581421, 0.9375, 0.10000000149011612, 0.10000000149011612], [0.8374999761581421, 0.9375, 0.20000000298023224, 0.20000000298023224], [0.862500011920929, 0.9375, 0.10000000149011612, 0.10000000149011612], [0.862500011920929, 0.9375, 0.20000000298023224, 0.20000000298023224], [0.887499988079071, 0.9375, 0.10000000149011612, 0.10000000149011612], [0.887499988079071, 0.9375, 0.20000000298023224, 0.20000000298023224], [0.9125000238418579, 0.9375, 0.10000000149011612, 0.10000000149011612], [0.9125000238418579, 0.9375, 0.20000000298023224, 0.20000000298023224], [0.9375, 0.9375, 0.10000000149011612, 0.10000000149011612], [0.9375, 0.9375, 0.20000000298023224, 0.20000000298023224], [0.9624999761581421, 0.9375, 0.10000000149011612, 0.10000000149011612], [0.9624999761581421, 0.9375, 0.20000000298023224, 0.20000000298023224], [0.987500011920929, 0.9375, 0.10000000149011612, 0.10000000149011612], [0.987500011920929, 0.9375, 0.20000000298023224, 0.20000000298023224], [0.012500000186264515, 0.9624999761581421, 0.10000000149011612, 0.10000000149011612], [0.012500000186264515, 0.9624999761581421, 0.20000000298023224, 0.20000000298023224], [0.03750000149011612, 0.9624999761581421, 0.10000000149011612, 0.10000000149011612], [0.03750000149011612, 0.9624999761581421, 0.20000000298023224, 0.20000000298023224], [0.0625, 0.9624999761581421, 0.10000000149011612, 0.10000000149011612], [0.0625, 0.9624999761581421, 0.20000000298023224, 0.20000000298023224], [0.08749999850988388, 0.9624999761581421, 0.10000000149011612, 0.10000000149011612], [0.08749999850988388, 0.9624999761581421, 0.20000000298023224, 0.20000000298023224], [0.11249999701976776, 0.9624999761581421, 0.10000000149011612, 0.10000000149011612], [0.11249999701976776, 0.9624999761581421, 0.20000000298023224, 0.20000000298023224], [0.13750000298023224, 0.9624999761581421, 0.10000000149011612, 0.10000000149011612], [0.13750000298023224, 0.9624999761581421, 0.20000000298023224, 0.20000000298023224], [0.16249999403953552, 0.9624999761581421, 0.10000000149011612, 0.10000000149011612], [0.16249999403953552, 0.9624999761581421, 0.20000000298023224, 0.20000000298023224], [0.1875, 0.9624999761581421, 0.10000000149011612, 0.10000000149011612], [0.1875, 0.9624999761581421, 0.20000000298023224, 0.20000000298023224], [0.21250000596046448, 0.9624999761581421, 0.10000000149011612, 0.10000000149011612], [0.21250000596046448, 0.9624999761581421, 0.20000000298023224, 0.20000000298023224], [0.23749999701976776, 0.9624999761581421, 0.10000000149011612, 0.10000000149011612], [0.23749999701976776, 0.9624999761581421, 0.20000000298023224, 0.20000000298023224], [0.26249998807907104, 0.9624999761581421, 0.10000000149011612, 0.10000000149011612], [0.26249998807907104, 0.9624999761581421, 0.20000000298023224, 0.20000000298023224], [0.2874999940395355, 0.9624999761581421, 0.10000000149011612, 0.10000000149011612], [0.2874999940395355, 0.9624999761581421, 0.20000000298023224, 0.20000000298023224], [0.3125, 0.9624999761581421, 0.10000000149011612, 0.10000000149011612], [0.3125, 0.9624999761581421, 0.20000000298023224, 0.20000000298023224], [0.3375000059604645, 0.9624999761581421, 0.10000000149011612, 0.10000000149011612], [0.3375000059604645, 0.9624999761581421, 0.20000000298023224, 0.20000000298023224], [0.36250001192092896, 0.9624999761581421, 0.10000000149011612, 0.10000000149011612], [0.36250001192092896, 0.9624999761581421, 0.20000000298023224, 0.20000000298023224], [0.38749998807907104, 0.9624999761581421, 0.10000000149011612, 0.10000000149011612], [0.38749998807907104, 0.9624999761581421, 0.20000000298023224, 0.20000000298023224], [0.4124999940395355, 0.9624999761581421, 0.10000000149011612, 0.10000000149011612], [0.4124999940395355, 0.9624999761581421, 0.20000000298023224, 0.20000000298023224], [0.4375, 0.9624999761581421, 0.10000000149011612, 0.10000000149011612], [0.4375, 0.9624999761581421, 0.20000000298023224, 0.20000000298023224], [0.4625000059604645, 0.9624999761581421, 0.10000000149011612, 0.10000000149011612], [0.4625000059604645, 0.9624999761581421, 0.20000000298023224, 0.20000000298023224], [0.48750001192092896, 0.9624999761581421, 0.10000000149011612, 0.10000000149011612], [0.48750001192092896, 0.9624999761581421, 0.20000000298023224, 0.20000000298023224], [0.512499988079071, 0.9624999761581421, 0.10000000149011612, 0.10000000149011612], [0.512499988079071, 0.9624999761581421, 0.20000000298023224, 0.20000000298023224], [0.5375000238418579, 0.9624999761581421, 0.10000000149011612, 0.10000000149011612], [0.5375000238418579, 0.9624999761581421, 0.20000000298023224, 0.20000000298023224], [0.5625, 0.9624999761581421, 0.10000000149011612, 0.10000000149011612], [0.5625, 0.9624999761581421, 0.20000000298023224, 0.20000000298023224], [0.5874999761581421, 0.9624999761581421, 0.10000000149011612, 0.10000000149011612], [0.5874999761581421, 0.9624999761581421, 0.20000000298023224, 0.20000000298023224], [0.612500011920929, 0.9624999761581421, 0.10000000149011612, 0.10000000149011612], [0.612500011920929, 0.9624999761581421, 0.20000000298023224, 0.20000000298023224], [0.637499988079071, 0.9624999761581421, 0.10000000149011612, 0.10000000149011612], [0.637499988079071, 0.9624999761581421, 0.20000000298023224, 0.20000000298023224], [0.6625000238418579, 0.9624999761581421, 0.10000000149011612, 0.10000000149011612], [0.6625000238418579, 0.9624999761581421, 0.20000000298023224, 0.20000000298023224], [0.6875, 0.9624999761581421, 0.10000000149011612, 0.10000000149011612], [0.6875, 0.9624999761581421, 0.20000000298023224, 0.20000000298023224], [0.7124999761581421, 0.9624999761581421, 0.10000000149011612, 0.10000000149011612], [0.7124999761581421, 0.9624999761581421, 0.20000000298023224, 0.20000000298023224], [0.737500011920929, 0.9624999761581421, 0.10000000149011612, 0.10000000149011612], [0.737500011920929, 0.9624999761581421, 0.20000000298023224, 0.20000000298023224], [0.762499988079071, 0.9624999761581421, 0.10000000149011612, 0.10000000149011612], [0.762499988079071, 0.9624999761581421, 0.20000000298023224, 0.20000000298023224], [0.7875000238418579, 0.9624999761581421, 0.10000000149011612, 0.10000000149011612], [0.7875000238418579, 0.9624999761581421, 0.20000000298023224, 0.20000000298023224], [0.8125, 0.9624999761581421, 0.10000000149011612, 0.10000000149011612], [0.8125, 0.9624999761581421, 0.20000000298023224, 0.20000000298023224], [0.8374999761581421, 0.9624999761581421, 0.10000000149011612, 0.10000000149011612], [0.8374999761581421, 0.9624999761581421, 0.20000000298023224, 0.20000000298023224], [0.862500011920929, 0.9624999761581421, 0.10000000149011612, 0.10000000149011612], [0.862500011920929, 0.9624999761581421, 0.20000000298023224, 0.20000000298023224], [0.887499988079071, 0.9624999761581421, 0.10000000149011612, 0.10000000149011612], [0.887499988079071, 0.9624999761581421, 0.20000000298023224, 0.20000000298023224], [0.9125000238418579, 0.9624999761581421, 0.10000000149011612, 0.10000000149011612], [0.9125000238418579, 0.9624999761581421, 0.20000000298023224, 0.20000000298023224], [0.9375, 0.9624999761581421, 0.10000000149011612, 0.10000000149011612], [0.9375, 0.9624999761581421, 0.20000000298023224, 0.20000000298023224], [0.9624999761581421, 0.9624999761581421, 0.10000000149011612, 0.10000000149011612], [0.9624999761581421, 0.9624999761581421, 0.20000000298023224, 0.20000000298023224], [0.987500011920929, 0.9624999761581421, 0.10000000149011612, 0.10000000149011612], [0.987500011920929, 0.9624999761581421, 0.20000000298023224, 0.20000000298023224], [0.012500000186264515, 0.987500011920929, 0.10000000149011612, 0.10000000149011612], [0.012500000186264515, 0.987500011920929, 0.20000000298023224, 0.20000000298023224], [0.03750000149011612, 0.987500011920929, 0.10000000149011612, 0.10000000149011612], [0.03750000149011612, 0.987500011920929, 0.20000000298023224, 0.20000000298023224], [0.0625, 0.987500011920929, 0.10000000149011612, 0.10000000149011612], [0.0625, 0.987500011920929, 0.20000000298023224, 0.20000000298023224], [0.08749999850988388, 0.987500011920929, 0.10000000149011612, 0.10000000149011612], [0.08749999850988388, 0.987500011920929, 0.20000000298023224, 0.20000000298023224], [0.11249999701976776, 0.987500011920929, 0.10000000149011612, 0.10000000149011612], [0.11249999701976776, 0.987500011920929, 0.20000000298023224, 0.20000000298023224], [0.13750000298023224, 0.987500011920929, 0.10000000149011612, 0.10000000149011612], [0.13750000298023224, 0.987500011920929, 0.20000000298023224, 0.20000000298023224], [0.16249999403953552, 0.987500011920929, 0.10000000149011612, 0.10000000149011612], [0.16249999403953552, 0.987500011920929, 0.20000000298023224, 0.20000000298023224], [0.1875, 0.987500011920929, 0.10000000149011612, 0.10000000149011612], [0.1875, 0.987500011920929, 0.20000000298023224, 0.20000000298023224], [0.21250000596046448, 0.987500011920929, 0.10000000149011612, 0.10000000149011612], [0.21250000596046448, 0.987500011920929, 0.20000000298023224, 0.20000000298023224], [0.23749999701976776, 0.987500011920929, 0.10000000149011612, 0.10000000149011612], [0.23749999701976776, 0.987500011920929, 0.20000000298023224, 0.20000000298023224], [0.26249998807907104, 0.987500011920929, 0.10000000149011612, 0.10000000149011612], [0.26249998807907104, 0.987500011920929, 0.20000000298023224, 0.20000000298023224], [0.2874999940395355, 0.987500011920929, 0.10000000149011612, 0.10000000149011612], [0.2874999940395355, 0.987500011920929, 0.20000000298023224, 0.20000000298023224], [0.3125, 0.987500011920929, 0.10000000149011612, 0.10000000149011612], [0.3125, 0.987500011920929, 0.20000000298023224, 0.20000000298023224], [0.3375000059604645, 0.987500011920929, 0.10000000149011612, 0.10000000149011612], [0.3375000059604645, 0.987500011920929, 0.20000000298023224, 0.20000000298023224], [0.36250001192092896, 0.987500011920929, 0.10000000149011612, 0.10000000149011612], [0.36250001192092896, 0.987500011920929, 0.20000000298023224, 0.20000000298023224], [0.38749998807907104, 0.987500011920929, 0.10000000149011612, 0.10000000149011612], [0.38749998807907104, 0.987500011920929, 0.20000000298023224, 0.20000000298023224], [0.4124999940395355, 0.987500011920929, 0.10000000149011612, 0.10000000149011612], [0.4124999940395355, 0.987500011920929, 0.20000000298023224, 0.20000000298023224], [0.4375, 0.987500011920929, 0.10000000149011612, 0.10000000149011612], [0.4375, 0.987500011920929, 0.20000000298023224, 0.20000000298023224], [0.4625000059604645, 0.987500011920929, 0.10000000149011612, 0.10000000149011612], [0.4625000059604645, 0.987500011920929, 0.20000000298023224, 0.20000000298023224], [0.48750001192092896, 0.987500011920929, 0.10000000149011612, 0.10000000149011612], [0.48750001192092896, 0.987500011920929, 0.20000000298023224, 0.20000000298023224], [0.512499988079071, 0.987500011920929, 0.10000000149011612, 0.10000000149011612], [0.512499988079071, 0.987500011920929, 0.20000000298023224, 0.20000000298023224], [0.5375000238418579, 0.987500011920929, 0.10000000149011612, 0.10000000149011612], [0.5375000238418579, 0.987500011920929, 0.20000000298023224, 0.20000000298023224], [0.5625, 0.987500011920929, 0.10000000149011612, 0.10000000149011612], [0.5625, 0.987500011920929, 0.20000000298023224, 0.20000000298023224], [0.5874999761581421, 0.987500011920929, 0.10000000149011612, 0.10000000149011612], [0.5874999761581421, 0.987500011920929, 0.20000000298023224, 0.20000000298023224], [0.612500011920929, 0.987500011920929, 0.10000000149011612, 0.10000000149011612], [0.612500011920929, 0.987500011920929, 0.20000000298023224, 0.20000000298023224], [0.637499988079071, 0.987500011920929, 0.10000000149011612, 0.10000000149011612], [0.637499988079071, 0.987500011920929, 0.20000000298023224, 0.20000000298023224], [0.6625000238418579, 0.987500011920929, 0.10000000149011612, 0.10000000149011612], [0.6625000238418579, 0.987500011920929, 0.20000000298023224, 0.20000000298023224], [0.6875, 0.987500011920929, 0.10000000149011612, 0.10000000149011612], [0.6875, 0.987500011920929, 0.20000000298023224, 0.20000000298023224], [0.7124999761581421, 0.987500011920929, 0.10000000149011612, 0.10000000149011612], [0.7124999761581421, 0.987500011920929, 0.20000000298023224, 0.20000000298023224], [0.737500011920929, 0.987500011920929, 0.10000000149011612, 0.10000000149011612], [0.737500011920929, 0.987500011920929, 0.20000000298023224, 0.20000000298023224], [0.762499988079071, 0.987500011920929, 0.10000000149011612, 0.10000000149011612], [0.762499988079071, 0.987500011920929, 0.20000000298023224, 0.20000000298023224], [0.7875000238418579, 0.987500011920929, 0.10000000149011612, 0.10000000149011612], [0.7875000238418579, 0.987500011920929, 0.20000000298023224, 0.20000000298023224], [0.8125, 0.987500011920929, 0.10000000149011612, 0.10000000149011612], [0.8125, 0.987500011920929, 0.20000000298023224, 0.20000000298023224], [0.8374999761581421, 0.987500011920929, 0.10000000149011612, 0.10000000149011612], [0.8374999761581421, 0.987500011920929, 0.20000000298023224, 0.20000000298023224], [0.862500011920929, 0.987500011920929, 0.10000000149011612, 0.10000000149011612], [0.862500011920929, 0.987500011920929, 0.20000000298023224, 0.20000000298023224], [0.887499988079071, 0.987500011920929, 0.10000000149011612, 0.10000000149011612], [0.887499988079071, 0.987500011920929, 0.20000000298023224, 0.20000000298023224], [0.9125000238418579, 0.987500011920929, 0.10000000149011612, 0.10000000149011612], [0.9125000238418579, 0.987500011920929, 0.20000000298023224, 0.20000000298023224], [0.9375, 0.987500011920929, 0.10000000149011612, 0.10000000149011612], [0.9375, 0.987500011920929, 0.20000000298023224, 0.20000000298023224], [0.9624999761581421, 0.987500011920929, 0.10000000149011612, 0.10000000149011612], [0.9624999761581421, 0.987500011920929, 0.20000000298023224, 0.20000000298023224], [0.987500011920929, 0.987500011920929, 0.10000000149011612, 0.10000000149011612], [0.987500011920929, 0.987500011920929, 0.20000000298023224, 0.20000000298023224], [0.02500000037252903, 0.02500000037252903, 0.4000000059604645, 0.4000000059604645], [0.02500000037252903, 0.02500000037252903, 0.800000011920929, 0.800000011920929], [0.07500000298023224, 0.02500000037252903, 0.4000000059604645, 0.4000000059604645], [0.07500000298023224, 0.02500000037252903, 0.800000011920929, 0.800000011920929], [0.125, 0.02500000037252903, 0.4000000059604645, 0.4000000059604645], [0.125, 0.02500000037252903, 0.800000011920929, 0.800000011920929], [0.17499999701976776, 0.02500000037252903, 0.4000000059604645, 0.4000000059604645], [0.17499999701976776, 0.02500000037252903, 0.800000011920929, 0.800000011920929], [0.22499999403953552, 0.02500000037252903, 0.4000000059604645, 0.4000000059604645], [0.22499999403953552, 0.02500000037252903, 0.800000011920929, 0.800000011920929], [0.2750000059604645, 0.02500000037252903, 0.4000000059604645, 0.4000000059604645], [0.2750000059604645, 0.02500000037252903, 0.800000011920929, 0.800000011920929], [0.32499998807907104, 0.02500000037252903, 0.4000000059604645, 0.4000000059604645], [0.32499998807907104, 0.02500000037252903, 0.800000011920929, 0.800000011920929], [0.375, 0.02500000037252903, 0.4000000059604645, 0.4000000059604645], [0.375, 0.02500000037252903, 0.800000011920929, 0.800000011920929], [0.42500001192092896, 0.02500000037252903, 0.4000000059604645, 0.4000000059604645], [0.42500001192092896, 0.02500000037252903, 0.800000011920929, 0.800000011920929], [0.4749999940395355, 0.02500000037252903, 0.4000000059604645, 0.4000000059604645], [0.4749999940395355, 0.02500000037252903, 0.800000011920929, 0.800000011920929], [0.5249999761581421, 0.02500000037252903, 0.4000000059604645, 0.4000000059604645], [0.5249999761581421, 0.02500000037252903, 0.800000011920929, 0.800000011920929], [0.574999988079071, 0.02500000037252903, 0.4000000059604645, 0.4000000059604645], [0.574999988079071, 0.02500000037252903, 0.800000011920929, 0.800000011920929], [0.625, 0.02500000037252903, 0.4000000059604645, 0.4000000059604645], [0.625, 0.02500000037252903, 0.800000011920929, 0.800000011920929], [0.675000011920929, 0.02500000037252903, 0.4000000059604645, 0.4000000059604645], [0.675000011920929, 0.02500000037252903, 0.800000011920929, 0.800000011920929], [0.7250000238418579, 0.02500000037252903, 0.4000000059604645, 0.4000000059604645], [0.7250000238418579, 0.02500000037252903, 0.800000011920929, 0.800000011920929], [0.7749999761581421, 0.02500000037252903, 0.4000000059604645, 0.4000000059604645], [0.7749999761581421, 0.02500000037252903, 0.800000011920929, 0.800000011920929], [0.824999988079071, 0.02500000037252903, 0.4000000059604645, 0.4000000059604645], [0.824999988079071, 0.02500000037252903, 0.800000011920929, 0.800000011920929], [0.875, 0.02500000037252903, 0.4000000059604645, 0.4000000059604645], [0.875, 0.02500000037252903, 0.800000011920929, 0.800000011920929], [0.925000011920929, 0.02500000037252903, 0.4000000059604645, 0.4000000059604645], [0.925000011920929, 0.02500000037252903, 0.800000011920929, 0.800000011920929], [0.9750000238418579, 0.02500000037252903, 0.4000000059604645, 0.4000000059604645], [0.9750000238418579, 0.02500000037252903, 0.800000011920929, 0.800000011920929], [0.02500000037252903, 0.07500000298023224, 0.4000000059604645, 0.4000000059604645], [0.02500000037252903, 0.07500000298023224, 0.800000011920929, 0.800000011920929], [0.07500000298023224, 0.07500000298023224, 0.4000000059604645, 0.4000000059604645], [0.07500000298023224, 0.07500000298023224, 0.800000011920929, 0.800000011920929], [0.125, 0.07500000298023224, 0.4000000059604645, 0.4000000059604645], [0.125, 0.07500000298023224, 0.800000011920929, 0.800000011920929], [0.17499999701976776, 0.07500000298023224, 0.4000000059604645, 0.4000000059604645], [0.17499999701976776, 0.07500000298023224, 0.800000011920929, 0.800000011920929], [0.22499999403953552, 0.07500000298023224, 0.4000000059604645, 0.4000000059604645], [0.22499999403953552, 0.07500000298023224, 0.800000011920929, 0.800000011920929], [0.2750000059604645, 0.07500000298023224, 0.4000000059604645, 0.4000000059604645], [0.2750000059604645, 0.07500000298023224, 0.800000011920929, 0.800000011920929], [0.32499998807907104, 0.07500000298023224, 0.4000000059604645, 0.4000000059604645], [0.32499998807907104, 0.07500000298023224, 0.800000011920929, 0.800000011920929], [0.375, 0.07500000298023224, 0.4000000059604645, 0.4000000059604645], [0.375, 0.07500000298023224, 0.800000011920929, 0.800000011920929], [0.42500001192092896, 0.07500000298023224, 0.4000000059604645, 0.4000000059604645], [0.42500001192092896, 0.07500000298023224, 0.800000011920929, 0.800000011920929], [0.4749999940395355, 0.07500000298023224, 0.4000000059604645, 0.4000000059604645], [0.4749999940395355, 0.07500000298023224, 0.800000011920929, 0.800000011920929], [0.5249999761581421, 0.07500000298023224, 0.4000000059604645, 0.4000000059604645], [0.5249999761581421, 0.07500000298023224, 0.800000011920929, 0.800000011920929], [0.574999988079071, 0.07500000298023224, 0.4000000059604645, 0.4000000059604645], [0.574999988079071, 0.07500000298023224, 0.800000011920929, 0.800000011920929], [0.625, 0.07500000298023224, 0.4000000059604645, 0.4000000059604645], [0.625, 0.07500000298023224, 0.800000011920929, 0.800000011920929], [0.675000011920929, 0.07500000298023224, 0.4000000059604645, 0.4000000059604645], [0.675000011920929, 0.07500000298023224, 0.800000011920929, 0.800000011920929], [0.7250000238418579, 0.07500000298023224, 0.4000000059604645, 0.4000000059604645], [0.7250000238418579, 0.07500000298023224, 0.800000011920929, 0.800000011920929], [0.7749999761581421, 0.07500000298023224, 0.4000000059604645, 0.4000000059604645], [0.7749999761581421, 0.07500000298023224, 0.800000011920929, 0.800000011920929], [0.824999988079071, 0.07500000298023224, 0.4000000059604645, 0.4000000059604645], [0.824999988079071, 0.07500000298023224, 0.800000011920929, 0.800000011920929], [0.875, 0.07500000298023224, 0.4000000059604645, 0.4000000059604645], [0.875, 0.07500000298023224, 0.800000011920929, 0.800000011920929], [0.925000011920929, 0.07500000298023224, 0.4000000059604645, 0.4000000059604645], [0.925000011920929, 0.07500000298023224, 0.800000011920929, 0.800000011920929], [0.9750000238418579, 0.07500000298023224, 0.4000000059604645, 0.4000000059604645], [0.9750000238418579, 0.07500000298023224, 0.800000011920929, 0.800000011920929], [0.02500000037252903, 0.125, 0.4000000059604645, 0.4000000059604645], [0.02500000037252903, 0.125, 0.800000011920929, 0.800000011920929], [0.07500000298023224, 0.125, 0.4000000059604645, 0.4000000059604645], [0.07500000298023224, 0.125, 0.800000011920929, 0.800000011920929], [0.125, 0.125, 0.4000000059604645, 0.4000000059604645], [0.125, 0.125, 0.800000011920929, 0.800000011920929], [0.17499999701976776, 0.125, 0.4000000059604645, 0.4000000059604645], [0.17499999701976776, 0.125, 0.800000011920929, 0.800000011920929], [0.22499999403953552, 0.125, 0.4000000059604645, 0.4000000059604645], [0.22499999403953552, 0.125, 0.800000011920929, 0.800000011920929], [0.2750000059604645, 0.125, 0.4000000059604645, 0.4000000059604645], [0.2750000059604645, 0.125, 0.800000011920929, 0.800000011920929], [0.32499998807907104, 0.125, 0.4000000059604645, 0.4000000059604645], [0.32499998807907104, 0.125, 0.800000011920929, 0.800000011920929], [0.375, 0.125, 0.4000000059604645, 0.4000000059604645], [0.375, 0.125, 0.800000011920929, 0.800000011920929], [0.42500001192092896, 0.125, 0.4000000059604645, 0.4000000059604645], [0.42500001192092896, 0.125, 0.800000011920929, 0.800000011920929], [0.4749999940395355, 0.125, 0.4000000059604645, 0.4000000059604645], [0.4749999940395355, 0.125, 0.800000011920929, 0.800000011920929], [0.5249999761581421, 0.125, 0.4000000059604645, 0.4000000059604645], [0.5249999761581421, 0.125, 0.800000011920929, 0.800000011920929], [0.574999988079071, 0.125, 0.4000000059604645, 0.4000000059604645], [0.574999988079071, 0.125, 0.800000011920929, 0.800000011920929], [0.625, 0.125, 0.4000000059604645, 0.4000000059604645], [0.625, 0.125, 0.800000011920929, 0.800000011920929], [0.675000011920929, 0.125, 0.4000000059604645, 0.4000000059604645], [0.675000011920929, 0.125, 0.800000011920929, 0.800000011920929], [0.7250000238418579, 0.125, 0.4000000059604645, 0.4000000059604645], [0.7250000238418579, 0.125, 0.800000011920929, 0.800000011920929], [0.7749999761581421, 0.125, 0.4000000059604645, 0.4000000059604645], [0.7749999761581421, 0.125, 0.800000011920929, 0.800000011920929], [0.824999988079071, 0.125, 0.4000000059604645, 0.4000000059604645], [0.824999988079071, 0.125, 0.800000011920929, 0.800000011920929], [0.875, 0.125, 0.4000000059604645, 0.4000000059604645], [0.875, 0.125, 0.800000011920929, 0.800000011920929], [0.925000011920929, 0.125, 0.4000000059604645, 0.4000000059604645], [0.925000011920929, 0.125, 0.800000011920929, 0.800000011920929], [0.9750000238418579, 0.125, 0.4000000059604645, 0.4000000059604645], [0.9750000238418579, 0.125, 0.800000011920929, 0.800000011920929], [0.02500000037252903, 0.17499999701976776, 0.4000000059604645, 0.4000000059604645], [0.02500000037252903, 0.17499999701976776, 0.800000011920929, 0.800000011920929], [0.07500000298023224, 0.17499999701976776, 0.4000000059604645, 0.4000000059604645], [0.07500000298023224, 0.17499999701976776, 0.800000011920929, 0.800000011920929], [0.125, 0.17499999701976776, 0.4000000059604645, 0.4000000059604645], [0.125, 0.17499999701976776, 0.800000011920929, 0.800000011920929], [0.17499999701976776, 0.17499999701976776, 0.4000000059604645, 0.4000000059604645], [0.17499999701976776, 0.17499999701976776, 0.800000011920929, 0.800000011920929], [0.22499999403953552, 0.17499999701976776, 0.4000000059604645, 0.4000000059604645], [0.22499999403953552, 0.17499999701976776, 0.800000011920929, 0.800000011920929], [0.2750000059604645, 0.17499999701976776, 0.4000000059604645, 0.4000000059604645], [0.2750000059604645, 0.17499999701976776, 0.800000011920929, 0.800000011920929], [0.32499998807907104, 0.17499999701976776, 0.4000000059604645, 0.4000000059604645], [0.32499998807907104, 0.17499999701976776, 0.800000011920929, 0.800000011920929], [0.375, 0.17499999701976776, 0.4000000059604645, 0.4000000059604645], [0.375, 0.17499999701976776, 0.800000011920929, 0.800000011920929], [0.42500001192092896, 0.17499999701976776, 0.4000000059604645, 0.4000000059604645], [0.42500001192092896, 0.17499999701976776, 0.800000011920929, 0.800000011920929], [0.4749999940395355, 0.17499999701976776, 0.4000000059604645, 0.4000000059604645], [0.4749999940395355, 0.17499999701976776, 0.800000011920929, 0.800000011920929], [0.5249999761581421, 0.17499999701976776, 0.4000000059604645, 0.4000000059604645], [0.5249999761581421, 0.17499999701976776, 0.800000011920929, 0.800000011920929], [0.574999988079071, 0.17499999701976776, 0.4000000059604645, 0.4000000059604645], [0.574999988079071, 0.17499999701976776, 0.800000011920929, 0.800000011920929], [0.625, 0.17499999701976776, 0.4000000059604645, 0.4000000059604645], [0.625, 0.17499999701976776, 0.800000011920929, 0.800000011920929], [0.675000011920929, 0.17499999701976776, 0.4000000059604645, 0.4000000059604645], [0.675000011920929, 0.17499999701976776, 0.800000011920929, 0.800000011920929], [0.7250000238418579, 0.17499999701976776, 0.4000000059604645, 0.4000000059604645], [0.7250000238418579, 0.17499999701976776, 0.800000011920929, 0.800000011920929], [0.7749999761581421, 0.17499999701976776, 0.4000000059604645, 0.4000000059604645], [0.7749999761581421, 0.17499999701976776, 0.800000011920929, 0.800000011920929], [0.824999988079071, 0.17499999701976776, 0.4000000059604645, 0.4000000059604645], [0.824999988079071, 0.17499999701976776, 0.800000011920929, 0.800000011920929], [0.875, 0.17499999701976776, 0.4000000059604645, 0.4000000059604645], [0.875, 0.17499999701976776, 0.800000011920929, 0.800000011920929], [0.925000011920929, 0.17499999701976776, 0.4000000059604645, 0.4000000059604645], [0.925000011920929, 0.17499999701976776, 0.800000011920929, 0.800000011920929], [0.9750000238418579, 0.17499999701976776, 0.4000000059604645, 0.4000000059604645], [0.9750000238418579, 0.17499999701976776, 0.800000011920929, 0.800000011920929], [0.02500000037252903, 0.22499999403953552, 0.4000000059604645, 0.4000000059604645], [0.02500000037252903, 0.22499999403953552, 0.800000011920929, 0.800000011920929], [0.07500000298023224, 0.22499999403953552, 0.4000000059604645, 0.4000000059604645], [0.07500000298023224, 0.22499999403953552, 0.800000011920929, 0.800000011920929], [0.125, 0.22499999403953552, 0.4000000059604645, 0.4000000059604645], [0.125, 0.22499999403953552, 0.800000011920929, 0.800000011920929], [0.17499999701976776, 0.22499999403953552, 0.4000000059604645, 0.4000000059604645], [0.17499999701976776, 0.22499999403953552, 0.800000011920929, 0.800000011920929], [0.22499999403953552, 0.22499999403953552, 0.4000000059604645, 0.4000000059604645], [0.22499999403953552, 0.22499999403953552, 0.800000011920929, 0.800000011920929], [0.2750000059604645, 0.22499999403953552, 0.4000000059604645, 0.4000000059604645], [0.2750000059604645, 0.22499999403953552, 0.800000011920929, 0.800000011920929], [0.32499998807907104, 0.22499999403953552, 0.4000000059604645, 0.4000000059604645], [0.32499998807907104, 0.22499999403953552, 0.800000011920929, 0.800000011920929], [0.375, 0.22499999403953552, 0.4000000059604645, 0.4000000059604645], [0.375, 0.22499999403953552, 0.800000011920929, 0.800000011920929], [0.42500001192092896, 0.22499999403953552, 0.4000000059604645, 0.4000000059604645], [0.42500001192092896, 0.22499999403953552, 0.800000011920929, 0.800000011920929], [0.4749999940395355, 0.22499999403953552, 0.4000000059604645, 0.4000000059604645], [0.4749999940395355, 0.22499999403953552, 0.800000011920929, 0.800000011920929], [0.5249999761581421, 0.22499999403953552, 0.4000000059604645, 0.4000000059604645], [0.5249999761581421, 0.22499999403953552, 0.800000011920929, 0.800000011920929], [0.574999988079071, 0.22499999403953552, 0.4000000059604645, 0.4000000059604645], [0.574999988079071, 0.22499999403953552, 0.800000011920929, 0.800000011920929], [0.625, 0.22499999403953552, 0.4000000059604645, 0.4000000059604645], [0.625, 0.22499999403953552, 0.800000011920929, 0.800000011920929], [0.675000011920929, 0.22499999403953552, 0.4000000059604645, 0.4000000059604645], [0.675000011920929, 0.22499999403953552, 0.800000011920929, 0.800000011920929], [0.7250000238418579, 0.22499999403953552, 0.4000000059604645, 0.4000000059604645], [0.7250000238418579, 0.22499999403953552, 0.800000011920929, 0.800000011920929], [0.7749999761581421, 0.22499999403953552, 0.4000000059604645, 0.4000000059604645], [0.7749999761581421, 0.22499999403953552, 0.800000011920929, 0.800000011920929], [0.824999988079071, 0.22499999403953552, 0.4000000059604645, 0.4000000059604645], [0.824999988079071, 0.22499999403953552, 0.800000011920929, 0.800000011920929], [0.875, 0.22499999403953552, 0.4000000059604645, 0.4000000059604645], [0.875, 0.22499999403953552, 0.800000011920929, 0.800000011920929], [0.925000011920929, 0.22499999403953552, 0.4000000059604645, 0.4000000059604645], [0.925000011920929, 0.22499999403953552, 0.800000011920929, 0.800000011920929], [0.9750000238418579, 0.22499999403953552, 0.4000000059604645, 0.4000000059604645], [0.9750000238418579, 0.22499999403953552, 0.800000011920929, 0.800000011920929], [0.02500000037252903, 0.2750000059604645, 0.4000000059604645, 0.4000000059604645], [0.02500000037252903, 0.2750000059604645, 0.800000011920929, 0.800000011920929], [0.07500000298023224, 0.2750000059604645, 0.4000000059604645, 0.4000000059604645], [0.07500000298023224, 0.2750000059604645, 0.800000011920929, 0.800000011920929], [0.125, 0.2750000059604645, 0.4000000059604645, 0.4000000059604645], [0.125, 0.2750000059604645, 0.800000011920929, 0.800000011920929], [0.17499999701976776, 0.2750000059604645, 0.4000000059604645, 0.4000000059604645], [0.17499999701976776, 0.2750000059604645, 0.800000011920929, 0.800000011920929], [0.22499999403953552, 0.2750000059604645, 0.4000000059604645, 0.4000000059604645], [0.22499999403953552, 0.2750000059604645, 0.800000011920929, 0.800000011920929], [0.2750000059604645, 0.2750000059604645, 0.4000000059604645, 0.4000000059604645], [0.2750000059604645, 0.2750000059604645, 0.800000011920929, 0.800000011920929], [0.32499998807907104, 0.2750000059604645, 0.4000000059604645, 0.4000000059604645], [0.32499998807907104, 0.2750000059604645, 0.800000011920929, 0.800000011920929], [0.375, 0.2750000059604645, 0.4000000059604645, 0.4000000059604645], [0.375, 0.2750000059604645, 0.800000011920929, 0.800000011920929], [0.42500001192092896, 0.2750000059604645, 0.4000000059604645, 0.4000000059604645], [0.42500001192092896, 0.2750000059604645, 0.800000011920929, 0.800000011920929], [0.4749999940395355, 0.2750000059604645, 0.4000000059604645, 0.4000000059604645], [0.4749999940395355, 0.2750000059604645, 0.800000011920929, 0.800000011920929], [0.5249999761581421, 0.2750000059604645, 0.4000000059604645, 0.4000000059604645], [0.5249999761581421, 0.2750000059604645, 0.800000011920929, 0.800000011920929], [0.574999988079071, 0.2750000059604645, 0.4000000059604645, 0.4000000059604645], [0.574999988079071, 0.2750000059604645, 0.800000011920929, 0.800000011920929], [0.625, 0.2750000059604645, 0.4000000059604645, 0.4000000059604645], [0.625, 0.2750000059604645, 0.800000011920929, 0.800000011920929], [0.675000011920929, 0.2750000059604645, 0.4000000059604645, 0.4000000059604645], [0.675000011920929, 0.2750000059604645, 0.800000011920929, 0.800000011920929], [0.7250000238418579, 0.2750000059604645, 0.4000000059604645, 0.4000000059604645], [0.7250000238418579, 0.2750000059604645, 0.800000011920929, 0.800000011920929], [0.7749999761581421, 0.2750000059604645, 0.4000000059604645, 0.4000000059604645], [0.7749999761581421, 0.2750000059604645, 0.800000011920929, 0.800000011920929], [0.824999988079071, 0.2750000059604645, 0.4000000059604645, 0.4000000059604645], [0.824999988079071, 0.2750000059604645, 0.800000011920929, 0.800000011920929], [0.875, 0.2750000059604645, 0.4000000059604645, 0.4000000059604645], [0.875, 0.2750000059604645, 0.800000011920929, 0.800000011920929], [0.925000011920929, 0.2750000059604645, 0.4000000059604645, 0.4000000059604645], [0.925000011920929, 0.2750000059604645, 0.800000011920929, 0.800000011920929], [0.9750000238418579, 0.2750000059604645, 0.4000000059604645, 0.4000000059604645], [0.9750000238418579, 0.2750000059604645, 0.800000011920929, 0.800000011920929], [0.02500000037252903, 0.32499998807907104, 0.4000000059604645, 0.4000000059604645], [0.02500000037252903, 0.32499998807907104, 0.800000011920929, 0.800000011920929], [0.07500000298023224, 0.32499998807907104, 0.4000000059604645, 0.4000000059604645], [0.07500000298023224, 0.32499998807907104, 0.800000011920929, 0.800000011920929], [0.125, 0.32499998807907104, 0.4000000059604645, 0.4000000059604645], [0.125, 0.32499998807907104, 0.800000011920929, 0.800000011920929], [0.17499999701976776, 0.32499998807907104, 0.4000000059604645, 0.4000000059604645], [0.17499999701976776, 0.32499998807907104, 0.800000011920929, 0.800000011920929], [0.22499999403953552, 0.32499998807907104, 0.4000000059604645, 0.4000000059604645], [0.22499999403953552, 0.32499998807907104, 0.800000011920929, 0.800000011920929], [0.2750000059604645, 0.32499998807907104, 0.4000000059604645, 0.4000000059604645], [0.2750000059604645, 0.32499998807907104, 0.800000011920929, 0.800000011920929], [0.32499998807907104, 0.32499998807907104, 0.4000000059604645, 0.4000000059604645], [0.32499998807907104, 0.32499998807907104, 0.800000011920929, 0.800000011920929], [0.375, 0.32499998807907104, 0.4000000059604645, 0.4000000059604645], [0.375, 0.32499998807907104, 0.800000011920929, 0.800000011920929], [0.42500001192092896, 0.32499998807907104, 0.4000000059604645, 0.4000000059604645], [0.42500001192092896, 0.32499998807907104, 0.800000011920929, 0.800000011920929], [0.4749999940395355, 0.32499998807907104, 0.4000000059604645, 0.4000000059604645], [0.4749999940395355, 0.32499998807907104, 0.800000011920929, 0.800000011920929], [0.5249999761581421, 0.32499998807907104, 0.4000000059604645, 0.4000000059604645], [0.5249999761581421, 0.32499998807907104, 0.800000011920929, 0.800000011920929], [0.574999988079071, 0.32499998807907104, 0.4000000059604645, 0.4000000059604645], [0.574999988079071, 0.32499998807907104, 0.800000011920929, 0.800000011920929], [0.625, 0.32499998807907104, 0.4000000059604645, 0.4000000059604645], [0.625, 0.32499998807907104, 0.800000011920929, 0.800000011920929], [0.675000011920929, 0.32499998807907104, 0.4000000059604645, 0.4000000059604645], [0.675000011920929, 0.32499998807907104, 0.800000011920929, 0.800000011920929], [0.7250000238418579, 0.32499998807907104, 0.4000000059604645, 0.4000000059604645], [0.7250000238418579, 0.32499998807907104, 0.800000011920929, 0.800000011920929], [0.7749999761581421, 0.32499998807907104, 0.4000000059604645, 0.4000000059604645], [0.7749999761581421, 0.32499998807907104, 0.800000011920929, 0.800000011920929], [0.824999988079071, 0.32499998807907104, 0.4000000059604645, 0.4000000059604645], [0.824999988079071, 0.32499998807907104, 0.800000011920929, 0.800000011920929], [0.875, 0.32499998807907104, 0.4000000059604645, 0.4000000059604645], [0.875, 0.32499998807907104, 0.800000011920929, 0.800000011920929], [0.925000011920929, 0.32499998807907104, 0.4000000059604645, 0.4000000059604645], [0.925000011920929, 0.32499998807907104, 0.800000011920929, 0.800000011920929], [0.9750000238418579, 0.32499998807907104, 0.4000000059604645, 0.4000000059604645], [0.9750000238418579, 0.32499998807907104, 0.800000011920929, 0.800000011920929], [0.02500000037252903, 0.375, 0.4000000059604645, 0.4000000059604645], [0.02500000037252903, 0.375, 0.800000011920929, 0.800000011920929], [0.07500000298023224, 0.375, 0.4000000059604645, 0.4000000059604645], [0.07500000298023224, 0.375, 0.800000011920929, 0.800000011920929], [0.125, 0.375, 0.4000000059604645, 0.4000000059604645], [0.125, 0.375, 0.800000011920929, 0.800000011920929], [0.17499999701976776, 0.375, 0.4000000059604645, 0.4000000059604645], [0.17499999701976776, 0.375, 0.800000011920929, 0.800000011920929], [0.22499999403953552, 0.375, 0.4000000059604645, 0.4000000059604645], [0.22499999403953552, 0.375, 0.800000011920929, 0.800000011920929], [0.2750000059604645, 0.375, 0.4000000059604645, 0.4000000059604645], [0.2750000059604645, 0.375, 0.800000011920929, 0.800000011920929], [0.32499998807907104, 0.375, 0.4000000059604645, 0.4000000059604645], [0.32499998807907104, 0.375, 0.800000011920929, 0.800000011920929], [0.375, 0.375, 0.4000000059604645, 0.4000000059604645], [0.375, 0.375, 0.800000011920929, 0.800000011920929], [0.42500001192092896, 0.375, 0.4000000059604645, 0.4000000059604645], [0.42500001192092896, 0.375, 0.800000011920929, 0.800000011920929], [0.4749999940395355, 0.375, 0.4000000059604645, 0.4000000059604645], [0.4749999940395355, 0.375, 0.800000011920929, 0.800000011920929], [0.5249999761581421, 0.375, 0.4000000059604645, 0.4000000059604645], [0.5249999761581421, 0.375, 0.800000011920929, 0.800000011920929], [0.574999988079071, 0.375, 0.4000000059604645, 0.4000000059604645], [0.574999988079071, 0.375, 0.800000011920929, 0.800000011920929], [0.625, 0.375, 0.4000000059604645, 0.4000000059604645], [0.625, 0.375, 0.800000011920929, 0.800000011920929], [0.675000011920929, 0.375, 0.4000000059604645, 0.4000000059604645], [0.675000011920929, 0.375, 0.800000011920929, 0.800000011920929], [0.7250000238418579, 0.375, 0.4000000059604645, 0.4000000059604645], [0.7250000238418579, 0.375, 0.800000011920929, 0.800000011920929], [0.7749999761581421, 0.375, 0.4000000059604645, 0.4000000059604645], [0.7749999761581421, 0.375, 0.800000011920929, 0.800000011920929], [0.824999988079071, 0.375, 0.4000000059604645, 0.4000000059604645], [0.824999988079071, 0.375, 0.800000011920929, 0.800000011920929], [0.875, 0.375, 0.4000000059604645, 0.4000000059604645], [0.875, 0.375, 0.800000011920929, 0.800000011920929], [0.925000011920929, 0.375, 0.4000000059604645, 0.4000000059604645], [0.925000011920929, 0.375, 0.800000011920929, 0.800000011920929], [0.9750000238418579, 0.375, 0.4000000059604645, 0.4000000059604645], [0.9750000238418579, 0.375, 0.800000011920929, 0.800000011920929], [0.02500000037252903, 0.42500001192092896, 0.4000000059604645, 0.4000000059604645], [0.02500000037252903, 0.42500001192092896, 0.800000011920929, 0.800000011920929], [0.07500000298023224, 0.42500001192092896, 0.4000000059604645, 0.4000000059604645], [0.07500000298023224, 0.42500001192092896, 0.800000011920929, 0.800000011920929], [0.125, 0.42500001192092896, 0.4000000059604645, 0.4000000059604645], [0.125, 0.42500001192092896, 0.800000011920929, 0.800000011920929], [0.17499999701976776, 0.42500001192092896, 0.4000000059604645, 0.4000000059604645], [0.17499999701976776, 0.42500001192092896, 0.800000011920929, 0.800000011920929], [0.22499999403953552, 0.42500001192092896, 0.4000000059604645, 0.4000000059604645], [0.22499999403953552, 0.42500001192092896, 0.800000011920929, 0.800000011920929], [0.2750000059604645, 0.42500001192092896, 0.4000000059604645, 0.4000000059604645], [0.2750000059604645, 0.42500001192092896, 0.800000011920929, 0.800000011920929], [0.32499998807907104, 0.42500001192092896, 0.4000000059604645, 0.4000000059604645], [0.32499998807907104, 0.42500001192092896, 0.800000011920929, 0.800000011920929], [0.375, 0.42500001192092896, 0.4000000059604645, 0.4000000059604645], [0.375, 0.42500001192092896, 0.800000011920929, 0.800000011920929], [0.42500001192092896, 0.42500001192092896, 0.4000000059604645, 0.4000000059604645], [0.42500001192092896, 0.42500001192092896, 0.800000011920929, 0.800000011920929], [0.4749999940395355, 0.42500001192092896, 0.4000000059604645, 0.4000000059604645], [0.4749999940395355, 0.42500001192092896, 0.800000011920929, 0.800000011920929], [0.5249999761581421, 0.42500001192092896, 0.4000000059604645, 0.4000000059604645], [0.5249999761581421, 0.42500001192092896, 0.800000011920929, 0.800000011920929], [0.574999988079071, 0.42500001192092896, 0.4000000059604645, 0.4000000059604645], [0.574999988079071, 0.42500001192092896, 0.800000011920929, 0.800000011920929], [0.625, 0.42500001192092896, 0.4000000059604645, 0.4000000059604645], [0.625, 0.42500001192092896, 0.800000011920929, 0.800000011920929], [0.675000011920929, 0.42500001192092896, 0.4000000059604645, 0.4000000059604645], [0.675000011920929, 0.42500001192092896, 0.800000011920929, 0.800000011920929], [0.7250000238418579, 0.42500001192092896, 0.4000000059604645, 0.4000000059604645], [0.7250000238418579, 0.42500001192092896, 0.800000011920929, 0.800000011920929], [0.7749999761581421, 0.42500001192092896, 0.4000000059604645, 0.4000000059604645], [0.7749999761581421, 0.42500001192092896, 0.800000011920929, 0.800000011920929], [0.824999988079071, 0.42500001192092896, 0.4000000059604645, 0.4000000059604645], [0.824999988079071, 0.42500001192092896, 0.800000011920929, 0.800000011920929], [0.875, 0.42500001192092896, 0.4000000059604645, 0.4000000059604645], [0.875, 0.42500001192092896, 0.800000011920929, 0.800000011920929], [0.925000011920929, 0.42500001192092896, 0.4000000059604645, 0.4000000059604645], [0.925000011920929, 0.42500001192092896, 0.800000011920929, 0.800000011920929], [0.9750000238418579, 0.42500001192092896, 0.4000000059604645, 0.4000000059604645], [0.9750000238418579, 0.42500001192092896, 0.800000011920929, 0.800000011920929], [0.02500000037252903, 0.4749999940395355, 0.4000000059604645, 0.4000000059604645], [0.02500000037252903, 0.4749999940395355, 0.800000011920929, 0.800000011920929], [0.07500000298023224, 0.4749999940395355, 0.4000000059604645, 0.4000000059604645], [0.07500000298023224, 0.4749999940395355, 0.800000011920929, 0.800000011920929], [0.125, 0.4749999940395355, 0.4000000059604645, 0.4000000059604645], [0.125, 0.4749999940395355, 0.800000011920929, 0.800000011920929], [0.17499999701976776, 0.4749999940395355, 0.4000000059604645, 0.4000000059604645], [0.17499999701976776, 0.4749999940395355, 0.800000011920929, 0.800000011920929], [0.22499999403953552, 0.4749999940395355, 0.4000000059604645, 0.4000000059604645], [0.22499999403953552, 0.4749999940395355, 0.800000011920929, 0.800000011920929], [0.2750000059604645, 0.4749999940395355, 0.4000000059604645, 0.4000000059604645], [0.2750000059604645, 0.4749999940395355, 0.800000011920929, 0.800000011920929], [0.32499998807907104, 0.4749999940395355, 0.4000000059604645, 0.4000000059604645], [0.32499998807907104, 0.4749999940395355, 0.800000011920929, 0.800000011920929], [0.375, 0.4749999940395355, 0.4000000059604645, 0.4000000059604645], [0.375, 0.4749999940395355, 0.800000011920929, 0.800000011920929], [0.42500001192092896, 0.4749999940395355, 0.4000000059604645, 0.4000000059604645], [0.42500001192092896, 0.4749999940395355, 0.800000011920929, 0.800000011920929], [0.4749999940395355, 0.4749999940395355, 0.4000000059604645, 0.4000000059604645], [0.4749999940395355, 0.4749999940395355, 0.800000011920929, 0.800000011920929], [0.5249999761581421, 0.4749999940395355, 0.4000000059604645, 0.4000000059604645], [0.5249999761581421, 0.4749999940395355, 0.800000011920929, 0.800000011920929], [0.574999988079071, 0.4749999940395355, 0.4000000059604645, 0.4000000059604645], [0.574999988079071, 0.4749999940395355, 0.800000011920929, 0.800000011920929], [0.625, 0.4749999940395355, 0.4000000059604645, 0.4000000059604645], [0.625, 0.4749999940395355, 0.800000011920929, 0.800000011920929], [0.675000011920929, 0.4749999940395355, 0.4000000059604645, 0.4000000059604645], [0.675000011920929, 0.4749999940395355, 0.800000011920929, 0.800000011920929], [0.7250000238418579, 0.4749999940395355, 0.4000000059604645, 0.4000000059604645], [0.7250000238418579, 0.4749999940395355, 0.800000011920929, 0.800000011920929], [0.7749999761581421, 0.4749999940395355, 0.4000000059604645, 0.4000000059604645], [0.7749999761581421, 0.4749999940395355, 0.800000011920929, 0.800000011920929], [0.824999988079071, 0.4749999940395355, 0.4000000059604645, 0.4000000059604645], [0.824999988079071, 0.4749999940395355, 0.800000011920929, 0.800000011920929], [0.875, 0.4749999940395355, 0.4000000059604645, 0.4000000059604645], [0.875, 0.4749999940395355, 0.800000011920929, 0.800000011920929], [0.925000011920929, 0.4749999940395355, 0.4000000059604645, 0.4000000059604645], [0.925000011920929, 0.4749999940395355, 0.800000011920929, 0.800000011920929], [0.9750000238418579, 0.4749999940395355, 0.4000000059604645, 0.4000000059604645], [0.9750000238418579, 0.4749999940395355, 0.800000011920929, 0.800000011920929], [0.02500000037252903, 0.5249999761581421, 0.4000000059604645, 0.4000000059604645], [0.02500000037252903, 0.5249999761581421, 0.800000011920929, 0.800000011920929], [0.07500000298023224, 0.5249999761581421, 0.4000000059604645, 0.4000000059604645], [0.07500000298023224, 0.5249999761581421, 0.800000011920929, 0.800000011920929], [0.125, 0.5249999761581421, 0.4000000059604645, 0.4000000059604645], [0.125, 0.5249999761581421, 0.800000011920929, 0.800000011920929], [0.17499999701976776, 0.5249999761581421, 0.4000000059604645, 0.4000000059604645], [0.17499999701976776, 0.5249999761581421, 0.800000011920929, 0.800000011920929], [0.22499999403953552, 0.5249999761581421, 0.4000000059604645, 0.4000000059604645], [0.22499999403953552, 0.5249999761581421, 0.800000011920929, 0.800000011920929], [0.2750000059604645, 0.5249999761581421, 0.4000000059604645, 0.4000000059604645], [0.2750000059604645, 0.5249999761581421, 0.800000011920929, 0.800000011920929], [0.32499998807907104, 0.5249999761581421, 0.4000000059604645, 0.4000000059604645], [0.32499998807907104, 0.5249999761581421, 0.800000011920929, 0.800000011920929], [0.375, 0.5249999761581421, 0.4000000059604645, 0.4000000059604645], [0.375, 0.5249999761581421, 0.800000011920929, 0.800000011920929], [0.42500001192092896, 0.5249999761581421, 0.4000000059604645, 0.4000000059604645], [0.42500001192092896, 0.5249999761581421, 0.800000011920929, 0.800000011920929], [0.4749999940395355, 0.5249999761581421, 0.4000000059604645, 0.4000000059604645], [0.4749999940395355, 0.5249999761581421, 0.800000011920929, 0.800000011920929], [0.5249999761581421, 0.5249999761581421, 0.4000000059604645, 0.4000000059604645], [0.5249999761581421, 0.5249999761581421, 0.800000011920929, 0.800000011920929], [0.574999988079071, 0.5249999761581421, 0.4000000059604645, 0.4000000059604645], [0.574999988079071, 0.5249999761581421, 0.800000011920929, 0.800000011920929], [0.625, 0.5249999761581421, 0.4000000059604645, 0.4000000059604645], [0.625, 0.5249999761581421, 0.800000011920929, 0.800000011920929], [0.675000011920929, 0.5249999761581421, 0.4000000059604645, 0.4000000059604645], [0.675000011920929, 0.5249999761581421, 0.800000011920929, 0.800000011920929], [0.7250000238418579, 0.5249999761581421, 0.4000000059604645, 0.4000000059604645], [0.7250000238418579, 0.5249999761581421, 0.800000011920929, 0.800000011920929], [0.7749999761581421, 0.5249999761581421, 0.4000000059604645, 0.4000000059604645], [0.7749999761581421, 0.5249999761581421, 0.800000011920929, 0.800000011920929], [0.824999988079071, 0.5249999761581421, 0.4000000059604645, 0.4000000059604645], [0.824999988079071, 0.5249999761581421, 0.800000011920929, 0.800000011920929], [0.875, 0.5249999761581421, 0.4000000059604645, 0.4000000059604645], [0.875, 0.5249999761581421, 0.800000011920929, 0.800000011920929], [0.925000011920929, 0.5249999761581421, 0.4000000059604645, 0.4000000059604645], [0.925000011920929, 0.5249999761581421, 0.800000011920929, 0.800000011920929], [0.9750000238418579, 0.5249999761581421, 0.4000000059604645, 0.4000000059604645], [0.9750000238418579, 0.5249999761581421, 0.800000011920929, 0.800000011920929], [0.02500000037252903, 0.574999988079071, 0.4000000059604645, 0.4000000059604645], [0.02500000037252903, 0.574999988079071, 0.800000011920929, 0.800000011920929], [0.07500000298023224, 0.574999988079071, 0.4000000059604645, 0.4000000059604645], [0.07500000298023224, 0.574999988079071, 0.800000011920929, 0.800000011920929], [0.125, 0.574999988079071, 0.4000000059604645, 0.4000000059604645], [0.125, 0.574999988079071, 0.800000011920929, 0.800000011920929], [0.17499999701976776, 0.574999988079071, 0.4000000059604645, 0.4000000059604645], [0.17499999701976776, 0.574999988079071, 0.800000011920929, 0.800000011920929], [0.22499999403953552, 0.574999988079071, 0.4000000059604645, 0.4000000059604645], [0.22499999403953552, 0.574999988079071, 0.800000011920929, 0.800000011920929], [0.2750000059604645, 0.574999988079071, 0.4000000059604645, 0.4000000059604645], [0.2750000059604645, 0.574999988079071, 0.800000011920929, 0.800000011920929], [0.32499998807907104, 0.574999988079071, 0.4000000059604645, 0.4000000059604645], [0.32499998807907104, 0.574999988079071, 0.800000011920929, 0.800000011920929], [0.375, 0.574999988079071, 0.4000000059604645, 0.4000000059604645], [0.375, 0.574999988079071, 0.800000011920929, 0.800000011920929], [0.42500001192092896, 0.574999988079071, 0.4000000059604645, 0.4000000059604645], [0.42500001192092896, 0.574999988079071, 0.800000011920929, 0.800000011920929], [0.4749999940395355, 0.574999988079071, 0.4000000059604645, 0.4000000059604645], [0.4749999940395355, 0.574999988079071, 0.800000011920929, 0.800000011920929], [0.5249999761581421, 0.574999988079071, 0.4000000059604645, 0.4000000059604645], [0.5249999761581421, 0.574999988079071, 0.800000011920929, 0.800000011920929], [0.574999988079071, 0.574999988079071, 0.4000000059604645, 0.4000000059604645], [0.574999988079071, 0.574999988079071, 0.800000011920929, 0.800000011920929], [0.625, 0.574999988079071, 0.4000000059604645, 0.4000000059604645], [0.625, 0.574999988079071, 0.800000011920929, 0.800000011920929], [0.675000011920929, 0.574999988079071, 0.4000000059604645, 0.4000000059604645], [0.675000011920929, 0.574999988079071, 0.800000011920929, 0.800000011920929], [0.7250000238418579, 0.574999988079071, 0.4000000059604645, 0.4000000059604645], [0.7250000238418579, 0.574999988079071, 0.800000011920929, 0.800000011920929], [0.7749999761581421, 0.574999988079071, 0.4000000059604645, 0.4000000059604645], [0.7749999761581421, 0.574999988079071, 0.800000011920929, 0.800000011920929], [0.824999988079071, 0.574999988079071, 0.4000000059604645, 0.4000000059604645], [0.824999988079071, 0.574999988079071, 0.800000011920929, 0.800000011920929], [0.875, 0.574999988079071, 0.4000000059604645, 0.4000000059604645], [0.875, 0.574999988079071, 0.800000011920929, 0.800000011920929], [0.925000011920929, 0.574999988079071, 0.4000000059604645, 0.4000000059604645], [0.925000011920929, 0.574999988079071, 0.800000011920929, 0.800000011920929], [0.9750000238418579, 0.574999988079071, 0.4000000059604645, 0.4000000059604645], [0.9750000238418579, 0.574999988079071, 0.800000011920929, 0.800000011920929], [0.02500000037252903, 0.625, 0.4000000059604645, 0.4000000059604645], [0.02500000037252903, 0.625, 0.800000011920929, 0.800000011920929], [0.07500000298023224, 0.625, 0.4000000059604645, 0.4000000059604645], [0.07500000298023224, 0.625, 0.800000011920929, 0.800000011920929], [0.125, 0.625, 0.4000000059604645, 0.4000000059604645], [0.125, 0.625, 0.800000011920929, 0.800000011920929], [0.17499999701976776, 0.625, 0.4000000059604645, 0.4000000059604645], [0.17499999701976776, 0.625, 0.800000011920929, 0.800000011920929], [0.22499999403953552, 0.625, 0.4000000059604645, 0.4000000059604645], [0.22499999403953552, 0.625, 0.800000011920929, 0.800000011920929], [0.2750000059604645, 0.625, 0.4000000059604645, 0.4000000059604645], [0.2750000059604645, 0.625, 0.800000011920929, 0.800000011920929], [0.32499998807907104, 0.625, 0.4000000059604645, 0.4000000059604645], [0.32499998807907104, 0.625, 0.800000011920929, 0.800000011920929], [0.375, 0.625, 0.4000000059604645, 0.4000000059604645], [0.375, 0.625, 0.800000011920929, 0.800000011920929], [0.42500001192092896, 0.625, 0.4000000059604645, 0.4000000059604645], [0.42500001192092896, 0.625, 0.800000011920929, 0.800000011920929], [0.4749999940395355, 0.625, 0.4000000059604645, 0.4000000059604645], [0.4749999940395355, 0.625, 0.800000011920929, 0.800000011920929], [0.5249999761581421, 0.625, 0.4000000059604645, 0.4000000059604645], [0.5249999761581421, 0.625, 0.800000011920929, 0.800000011920929], [0.574999988079071, 0.625, 0.4000000059604645, 0.4000000059604645], [0.574999988079071, 0.625, 0.800000011920929, 0.800000011920929], [0.625, 0.625, 0.4000000059604645, 0.4000000059604645], [0.625, 0.625, 0.800000011920929, 0.800000011920929], [0.675000011920929, 0.625, 0.4000000059604645, 0.4000000059604645], [0.675000011920929, 0.625, 0.800000011920929, 0.800000011920929], [0.7250000238418579, 0.625, 0.4000000059604645, 0.4000000059604645], [0.7250000238418579, 0.625, 0.800000011920929, 0.800000011920929], [0.7749999761581421, 0.625, 0.4000000059604645, 0.4000000059604645], [0.7749999761581421, 0.625, 0.800000011920929, 0.800000011920929], [0.824999988079071, 0.625, 0.4000000059604645, 0.4000000059604645], [0.824999988079071, 0.625, 0.800000011920929, 0.800000011920929], [0.875, 0.625, 0.4000000059604645, 0.4000000059604645], [0.875, 0.625, 0.800000011920929, 0.800000011920929], [0.925000011920929, 0.625, 0.4000000059604645, 0.4000000059604645], [0.925000011920929, 0.625, 0.800000011920929, 0.800000011920929], [0.9750000238418579, 0.625, 0.4000000059604645, 0.4000000059604645], [0.9750000238418579, 0.625, 0.800000011920929, 0.800000011920929], [0.02500000037252903, 0.675000011920929, 0.4000000059604645, 0.4000000059604645], [0.02500000037252903, 0.675000011920929, 0.800000011920929, 0.800000011920929], [0.07500000298023224, 0.675000011920929, 0.4000000059604645, 0.4000000059604645], [0.07500000298023224, 0.675000011920929, 0.800000011920929, 0.800000011920929], [0.125, 0.675000011920929, 0.4000000059604645, 0.4000000059604645], [0.125, 0.675000011920929, 0.800000011920929, 0.800000011920929], [0.17499999701976776, 0.675000011920929, 0.4000000059604645, 0.4000000059604645], [0.17499999701976776, 0.675000011920929, 0.800000011920929, 0.800000011920929], [0.22499999403953552, 0.675000011920929, 0.4000000059604645, 0.4000000059604645], [0.22499999403953552, 0.675000011920929, 0.800000011920929, 0.800000011920929], [0.2750000059604645, 0.675000011920929, 0.4000000059604645, 0.4000000059604645], [0.2750000059604645, 0.675000011920929, 0.800000011920929, 0.800000011920929], [0.32499998807907104, 0.675000011920929, 0.4000000059604645, 0.4000000059604645], [0.32499998807907104, 0.675000011920929, 0.800000011920929, 0.800000011920929], [0.375, 0.675000011920929, 0.4000000059604645, 0.4000000059604645], [0.375, 0.675000011920929, 0.800000011920929, 0.800000011920929], [0.42500001192092896, 0.675000011920929, 0.4000000059604645, 0.4000000059604645], [0.42500001192092896, 0.675000011920929, 0.800000011920929, 0.800000011920929], [0.4749999940395355, 0.675000011920929, 0.4000000059604645, 0.4000000059604645], [0.4749999940395355, 0.675000011920929, 0.800000011920929, 0.800000011920929], [0.5249999761581421, 0.675000011920929, 0.4000000059604645, 0.4000000059604645], [0.5249999761581421, 0.675000011920929, 0.800000011920929, 0.800000011920929], [0.574999988079071, 0.675000011920929, 0.4000000059604645, 0.4000000059604645], [0.574999988079071, 0.675000011920929, 0.800000011920929, 0.800000011920929], [0.625, 0.675000011920929, 0.4000000059604645, 0.4000000059604645], [0.625, 0.675000011920929, 0.800000011920929, 0.800000011920929], [0.675000011920929, 0.675000011920929, 0.4000000059604645, 0.4000000059604645], [0.675000011920929, 0.675000011920929, 0.800000011920929, 0.800000011920929], [0.7250000238418579, 0.675000011920929, 0.4000000059604645, 0.4000000059604645], [0.7250000238418579, 0.675000011920929, 0.800000011920929, 0.800000011920929], [0.7749999761581421, 0.675000011920929, 0.4000000059604645, 0.4000000059604645], [0.7749999761581421, 0.675000011920929, 0.800000011920929, 0.800000011920929], [0.824999988079071, 0.675000011920929, 0.4000000059604645, 0.4000000059604645], [0.824999988079071, 0.675000011920929, 0.800000011920929, 0.800000011920929], [0.875, 0.675000011920929, 0.4000000059604645, 0.4000000059604645], [0.875, 0.675000011920929, 0.800000011920929, 0.800000011920929], [0.925000011920929, 0.675000011920929, 0.4000000059604645, 0.4000000059604645], [0.925000011920929, 0.675000011920929, 0.800000011920929, 0.800000011920929], [0.9750000238418579, 0.675000011920929, 0.4000000059604645, 0.4000000059604645], [0.9750000238418579, 0.675000011920929, 0.800000011920929, 0.800000011920929], [0.02500000037252903, 0.7250000238418579, 0.4000000059604645, 0.4000000059604645], [0.02500000037252903, 0.7250000238418579, 0.800000011920929, 0.800000011920929], [0.07500000298023224, 0.7250000238418579, 0.4000000059604645, 0.4000000059604645], [0.07500000298023224, 0.7250000238418579, 0.800000011920929, 0.800000011920929], [0.125, 0.7250000238418579, 0.4000000059604645, 0.4000000059604645], [0.125, 0.7250000238418579, 0.800000011920929, 0.800000011920929], [0.17499999701976776, 0.7250000238418579, 0.4000000059604645, 0.4000000059604645], [0.17499999701976776, 0.7250000238418579, 0.800000011920929, 0.800000011920929], [0.22499999403953552, 0.7250000238418579, 0.4000000059604645, 0.4000000059604645], [0.22499999403953552, 0.7250000238418579, 0.800000011920929, 0.800000011920929], [0.2750000059604645, 0.7250000238418579, 0.4000000059604645, 0.4000000059604645], [0.2750000059604645, 0.7250000238418579, 0.800000011920929, 0.800000011920929], [0.32499998807907104, 0.7250000238418579, 0.4000000059604645, 0.4000000059604645], [0.32499998807907104, 0.7250000238418579, 0.800000011920929, 0.800000011920929], [0.375, 0.7250000238418579, 0.4000000059604645, 0.4000000059604645], [0.375, 0.7250000238418579, 0.800000011920929, 0.800000011920929], [0.42500001192092896, 0.7250000238418579, 0.4000000059604645, 0.4000000059604645], [0.42500001192092896, 0.7250000238418579, 0.800000011920929, 0.800000011920929], [0.4749999940395355, 0.7250000238418579, 0.4000000059604645, 0.4000000059604645], [0.4749999940395355, 0.7250000238418579, 0.800000011920929, 0.800000011920929], [0.5249999761581421, 0.7250000238418579, 0.4000000059604645, 0.4000000059604645], [0.5249999761581421, 0.7250000238418579, 0.800000011920929, 0.800000011920929], [0.574999988079071, 0.7250000238418579, 0.4000000059604645, 0.4000000059604645], [0.574999988079071, 0.7250000238418579, 0.800000011920929, 0.800000011920929], [0.625, 0.7250000238418579, 0.4000000059604645, 0.4000000059604645], [0.625, 0.7250000238418579, 0.800000011920929, 0.800000011920929], [0.675000011920929, 0.7250000238418579, 0.4000000059604645, 0.4000000059604645], [0.675000011920929, 0.7250000238418579, 0.800000011920929, 0.800000011920929], [0.7250000238418579, 0.7250000238418579, 0.4000000059604645, 0.4000000059604645], [0.7250000238418579, 0.7250000238418579, 0.800000011920929, 0.800000011920929], [0.7749999761581421, 0.7250000238418579, 0.4000000059604645, 0.4000000059604645], [0.7749999761581421, 0.7250000238418579, 0.800000011920929, 0.800000011920929], [0.824999988079071, 0.7250000238418579, 0.4000000059604645, 0.4000000059604645], [0.824999988079071, 0.7250000238418579, 0.800000011920929, 0.800000011920929], [0.875, 0.7250000238418579, 0.4000000059604645, 0.4000000059604645], [0.875, 0.7250000238418579, 0.800000011920929, 0.800000011920929], [0.925000011920929, 0.7250000238418579, 0.4000000059604645, 0.4000000059604645], [0.925000011920929, 0.7250000238418579, 0.800000011920929, 0.800000011920929], [0.9750000238418579, 0.7250000238418579, 0.4000000059604645, 0.4000000059604645], [0.9750000238418579, 0.7250000238418579, 0.800000011920929, 0.800000011920929], [0.02500000037252903, 0.7749999761581421, 0.4000000059604645, 0.4000000059604645], [0.02500000037252903, 0.7749999761581421, 0.800000011920929, 0.800000011920929], [0.07500000298023224, 0.7749999761581421, 0.4000000059604645, 0.4000000059604645], [0.07500000298023224, 0.7749999761581421, 0.800000011920929, 0.800000011920929], [0.125, 0.7749999761581421, 0.4000000059604645, 0.4000000059604645], [0.125, 0.7749999761581421, 0.800000011920929, 0.800000011920929], [0.17499999701976776, 0.7749999761581421, 0.4000000059604645, 0.4000000059604645], [0.17499999701976776, 0.7749999761581421, 0.800000011920929, 0.800000011920929], [0.22499999403953552, 0.7749999761581421, 0.4000000059604645, 0.4000000059604645], [0.22499999403953552, 0.7749999761581421, 0.800000011920929, 0.800000011920929], [0.2750000059604645, 0.7749999761581421, 0.4000000059604645, 0.4000000059604645], [0.2750000059604645, 0.7749999761581421, 0.800000011920929, 0.800000011920929], [0.32499998807907104, 0.7749999761581421, 0.4000000059604645, 0.4000000059604645], [0.32499998807907104, 0.7749999761581421, 0.800000011920929, 0.800000011920929], [0.375, 0.7749999761581421, 0.4000000059604645, 0.4000000059604645], [0.375, 0.7749999761581421, 0.800000011920929, 0.800000011920929], [0.42500001192092896, 0.7749999761581421, 0.4000000059604645, 0.4000000059604645], [0.42500001192092896, 0.7749999761581421, 0.800000011920929, 0.800000011920929], [0.4749999940395355, 0.7749999761581421, 0.4000000059604645, 0.4000000059604645], [0.4749999940395355, 0.7749999761581421, 0.800000011920929, 0.800000011920929], [0.5249999761581421, 0.7749999761581421, 0.4000000059604645, 0.4000000059604645], [0.5249999761581421, 0.7749999761581421, 0.800000011920929, 0.800000011920929], [0.574999988079071, 0.7749999761581421, 0.4000000059604645, 0.4000000059604645], [0.574999988079071, 0.7749999761581421, 0.800000011920929, 0.800000011920929], [0.625, 0.7749999761581421, 0.4000000059604645, 0.4000000059604645], [0.625, 0.7749999761581421, 0.800000011920929, 0.800000011920929], [0.675000011920929, 0.7749999761581421, 0.4000000059604645, 0.4000000059604645], [0.675000011920929, 0.7749999761581421, 0.800000011920929, 0.800000011920929], [0.7250000238418579, 0.7749999761581421, 0.4000000059604645, 0.4000000059604645], [0.7250000238418579, 0.7749999761581421, 0.800000011920929, 0.800000011920929], [0.7749999761581421, 0.7749999761581421, 0.4000000059604645, 0.4000000059604645], [0.7749999761581421, 0.7749999761581421, 0.800000011920929, 0.800000011920929], [0.824999988079071, 0.7749999761581421, 0.4000000059604645, 0.4000000059604645], [0.824999988079071, 0.7749999761581421, 0.800000011920929, 0.800000011920929], [0.875, 0.7749999761581421, 0.4000000059604645, 0.4000000059604645], [0.875, 0.7749999761581421, 0.800000011920929, 0.800000011920929], [0.925000011920929, 0.7749999761581421, 0.4000000059604645, 0.4000000059604645], [0.925000011920929, 0.7749999761581421, 0.800000011920929, 0.800000011920929], [0.9750000238418579, 0.7749999761581421, 0.4000000059604645, 0.4000000059604645], [0.9750000238418579, 0.7749999761581421, 0.800000011920929, 0.800000011920929], [0.02500000037252903, 0.824999988079071, 0.4000000059604645, 0.4000000059604645], [0.02500000037252903, 0.824999988079071, 0.800000011920929, 0.800000011920929], [0.07500000298023224, 0.824999988079071, 0.4000000059604645, 0.4000000059604645], [0.07500000298023224, 0.824999988079071, 0.800000011920929, 0.800000011920929], [0.125, 0.824999988079071, 0.4000000059604645, 0.4000000059604645], [0.125, 0.824999988079071, 0.800000011920929, 0.800000011920929], [0.17499999701976776, 0.824999988079071, 0.4000000059604645, 0.4000000059604645], [0.17499999701976776, 0.824999988079071, 0.800000011920929, 0.800000011920929], [0.22499999403953552, 0.824999988079071, 0.4000000059604645, 0.4000000059604645], [0.22499999403953552, 0.824999988079071, 0.800000011920929, 0.800000011920929], [0.2750000059604645, 0.824999988079071, 0.4000000059604645, 0.4000000059604645], [0.2750000059604645, 0.824999988079071, 0.800000011920929, 0.800000011920929], [0.32499998807907104, 0.824999988079071, 0.4000000059604645, 0.4000000059604645], [0.32499998807907104, 0.824999988079071, 0.800000011920929, 0.800000011920929], [0.375, 0.824999988079071, 0.4000000059604645, 0.4000000059604645], [0.375, 0.824999988079071, 0.800000011920929, 0.800000011920929], [0.42500001192092896, 0.824999988079071, 0.4000000059604645, 0.4000000059604645], [0.42500001192092896, 0.824999988079071, 0.800000011920929, 0.800000011920929], [0.4749999940395355, 0.824999988079071, 0.4000000059604645, 0.4000000059604645], [0.4749999940395355, 0.824999988079071, 0.800000011920929, 0.800000011920929], [0.5249999761581421, 0.824999988079071, 0.4000000059604645, 0.4000000059604645], [0.5249999761581421, 0.824999988079071, 0.800000011920929, 0.800000011920929], [0.574999988079071, 0.824999988079071, 0.4000000059604645, 0.4000000059604645], [0.574999988079071, 0.824999988079071, 0.800000011920929, 0.800000011920929], [0.625, 0.824999988079071, 0.4000000059604645, 0.4000000059604645], [0.625, 0.824999988079071, 0.800000011920929, 0.800000011920929], [0.675000011920929, 0.824999988079071, 0.4000000059604645, 0.4000000059604645], [0.675000011920929, 0.824999988079071, 0.800000011920929, 0.800000011920929], [0.7250000238418579, 0.824999988079071, 0.4000000059604645, 0.4000000059604645], [0.7250000238418579, 0.824999988079071, 0.800000011920929, 0.800000011920929], [0.7749999761581421, 0.824999988079071, 0.4000000059604645, 0.4000000059604645], [0.7749999761581421, 0.824999988079071, 0.800000011920929, 0.800000011920929], [0.824999988079071, 0.824999988079071, 0.4000000059604645, 0.4000000059604645], [0.824999988079071, 0.824999988079071, 0.800000011920929, 0.800000011920929], [0.875, 0.824999988079071, 0.4000000059604645, 0.4000000059604645], [0.875, 0.824999988079071, 0.800000011920929, 0.800000011920929], [0.925000011920929, 0.824999988079071, 0.4000000059604645, 0.4000000059604645], [0.925000011920929, 0.824999988079071, 0.800000011920929, 0.800000011920929], [0.9750000238418579, 0.824999988079071, 0.4000000059604645, 0.4000000059604645], [0.9750000238418579, 0.824999988079071, 0.800000011920929, 0.800000011920929], [0.02500000037252903, 0.875, 0.4000000059604645, 0.4000000059604645], [0.02500000037252903, 0.875, 0.800000011920929, 0.800000011920929], [0.07500000298023224, 0.875, 0.4000000059604645, 0.4000000059604645], [0.07500000298023224, 0.875, 0.800000011920929, 0.800000011920929], [0.125, 0.875, 0.4000000059604645, 0.4000000059604645], [0.125, 0.875, 0.800000011920929, 0.800000011920929], [0.17499999701976776, 0.875, 0.4000000059604645, 0.4000000059604645], [0.17499999701976776, 0.875, 0.800000011920929, 0.800000011920929], [0.22499999403953552, 0.875, 0.4000000059604645, 0.4000000059604645], [0.22499999403953552, 0.875, 0.800000011920929, 0.800000011920929], [0.2750000059604645, 0.875, 0.4000000059604645, 0.4000000059604645], [0.2750000059604645, 0.875, 0.800000011920929, 0.800000011920929], [0.32499998807907104, 0.875, 0.4000000059604645, 0.4000000059604645], [0.32499998807907104, 0.875, 0.800000011920929, 0.800000011920929], [0.375, 0.875, 0.4000000059604645, 0.4000000059604645], [0.375, 0.875, 0.800000011920929, 0.800000011920929], [0.42500001192092896, 0.875, 0.4000000059604645, 0.4000000059604645], [0.42500001192092896, 0.875, 0.800000011920929, 0.800000011920929], [0.4749999940395355, 0.875, 0.4000000059604645, 0.4000000059604645], [0.4749999940395355, 0.875, 0.800000011920929, 0.800000011920929], [0.5249999761581421, 0.875, 0.4000000059604645, 0.4000000059604645], [0.5249999761581421, 0.875, 0.800000011920929, 0.800000011920929], [0.574999988079071, 0.875, 0.4000000059604645, 0.4000000059604645], [0.574999988079071, 0.875, 0.800000011920929, 0.800000011920929], [0.625, 0.875, 0.4000000059604645, 0.4000000059604645], [0.625, 0.875, 0.800000011920929, 0.800000011920929], [0.675000011920929, 0.875, 0.4000000059604645, 0.4000000059604645], [0.675000011920929, 0.875, 0.800000011920929, 0.800000011920929], [0.7250000238418579, 0.875, 0.4000000059604645, 0.4000000059604645], [0.7250000238418579, 0.875, 0.800000011920929, 0.800000011920929], [0.7749999761581421, 0.875, 0.4000000059604645, 0.4000000059604645], [0.7749999761581421, 0.875, 0.800000011920929, 0.800000011920929], [0.824999988079071, 0.875, 0.4000000059604645, 0.4000000059604645], [0.824999988079071, 0.875, 0.800000011920929, 0.800000011920929], [0.875, 0.875, 0.4000000059604645, 0.4000000059604645], [0.875, 0.875, 0.800000011920929, 0.800000011920929], [0.925000011920929, 0.875, 0.4000000059604645, 0.4000000059604645], [0.925000011920929, 0.875, 0.800000011920929, 0.800000011920929], [0.9750000238418579, 0.875, 0.4000000059604645, 0.4000000059604645], [0.9750000238418579, 0.875, 0.800000011920929, 0.800000011920929], [0.02500000037252903, 0.925000011920929, 0.4000000059604645, 0.4000000059604645], [0.02500000037252903, 0.925000011920929, 0.800000011920929, 0.800000011920929], [0.07500000298023224, 0.925000011920929, 0.4000000059604645, 0.4000000059604645], [0.07500000298023224, 0.925000011920929, 0.800000011920929, 0.800000011920929], [0.125, 0.925000011920929, 0.4000000059604645, 0.4000000059604645], [0.125, 0.925000011920929, 0.800000011920929, 0.800000011920929], [0.17499999701976776, 0.925000011920929, 0.4000000059604645, 0.4000000059604645], [0.17499999701976776, 0.925000011920929, 0.800000011920929, 0.800000011920929], [0.22499999403953552, 0.925000011920929, 0.4000000059604645, 0.4000000059604645], [0.22499999403953552, 0.925000011920929, 0.800000011920929, 0.800000011920929], [0.2750000059604645, 0.925000011920929, 0.4000000059604645, 0.4000000059604645], [0.2750000059604645, 0.925000011920929, 0.800000011920929, 0.800000011920929], [0.32499998807907104, 0.925000011920929, 0.4000000059604645, 0.4000000059604645], [0.32499998807907104, 0.925000011920929, 0.800000011920929, 0.800000011920929], [0.375, 0.925000011920929, 0.4000000059604645, 0.4000000059604645], [0.375, 0.925000011920929, 0.800000011920929, 0.800000011920929], [0.42500001192092896, 0.925000011920929, 0.4000000059604645, 0.4000000059604645], [0.42500001192092896, 0.925000011920929, 0.800000011920929, 0.800000011920929], [0.4749999940395355, 0.925000011920929, 0.4000000059604645, 0.4000000059604645], [0.4749999940395355, 0.925000011920929, 0.800000011920929, 0.800000011920929], [0.5249999761581421, 0.925000011920929, 0.4000000059604645, 0.4000000059604645], [0.5249999761581421, 0.925000011920929, 0.800000011920929, 0.800000011920929], [0.574999988079071, 0.925000011920929, 0.4000000059604645, 0.4000000059604645], [0.574999988079071, 0.925000011920929, 0.800000011920929, 0.800000011920929], [0.625, 0.925000011920929, 0.4000000059604645, 0.4000000059604645], [0.625, 0.925000011920929, 0.800000011920929, 0.800000011920929], [0.675000011920929, 0.925000011920929, 0.4000000059604645, 0.4000000059604645], [0.675000011920929, 0.925000011920929, 0.800000011920929, 0.800000011920929], [0.7250000238418579, 0.925000011920929, 0.4000000059604645, 0.4000000059604645], [0.7250000238418579, 0.925000011920929, 0.800000011920929, 0.800000011920929], [0.7749999761581421, 0.925000011920929, 0.4000000059604645, 0.4000000059604645], [0.7749999761581421, 0.925000011920929, 0.800000011920929, 0.800000011920929], [0.824999988079071, 0.925000011920929, 0.4000000059604645, 0.4000000059604645], [0.824999988079071, 0.925000011920929, 0.800000011920929, 0.800000011920929], [0.875, 0.925000011920929, 0.4000000059604645, 0.4000000059604645], [0.875, 0.925000011920929, 0.800000011920929, 0.800000011920929], [0.925000011920929, 0.925000011920929, 0.4000000059604645, 0.4000000059604645], [0.925000011920929, 0.925000011920929, 0.800000011920929, 0.800000011920929], [0.9750000238418579, 0.925000011920929, 0.4000000059604645, 0.4000000059604645], [0.9750000238418579, 0.925000011920929, 0.800000011920929, 0.800000011920929], [0.02500000037252903, 0.9750000238418579, 0.4000000059604645, 0.4000000059604645], [0.02500000037252903, 0.9750000238418579, 0.800000011920929, 0.800000011920929], [0.07500000298023224, 0.9750000238418579, 0.4000000059604645, 0.4000000059604645], [0.07500000298023224, 0.9750000238418579, 0.800000011920929, 0.800000011920929], [0.125, 0.9750000238418579, 0.4000000059604645, 0.4000000059604645], [0.125, 0.9750000238418579, 0.800000011920929, 0.800000011920929], [0.17499999701976776, 0.9750000238418579, 0.4000000059604645, 0.4000000059604645], [0.17499999701976776, 0.9750000238418579, 0.800000011920929, 0.800000011920929], [0.22499999403953552, 0.9750000238418579, 0.4000000059604645, 0.4000000059604645], [0.22499999403953552, 0.9750000238418579, 0.800000011920929, 0.800000011920929], [0.2750000059604645, 0.9750000238418579, 0.4000000059604645, 0.4000000059604645], [0.2750000059604645, 0.9750000238418579, 0.800000011920929, 0.800000011920929], [0.32499998807907104, 0.9750000238418579, 0.4000000059604645, 0.4000000059604645], [0.32499998807907104, 0.9750000238418579, 0.800000011920929, 0.800000011920929], [0.375, 0.9750000238418579, 0.4000000059604645, 0.4000000059604645], [0.375, 0.9750000238418579, 0.800000011920929, 0.800000011920929], [0.42500001192092896, 0.9750000238418579, 0.4000000059604645, 0.4000000059604645], [0.42500001192092896, 0.9750000238418579, 0.800000011920929, 0.800000011920929], [0.4749999940395355, 0.9750000238418579, 0.4000000059604645, 0.4000000059604645], [0.4749999940395355, 0.9750000238418579, 0.800000011920929, 0.800000011920929], [0.5249999761581421, 0.9750000238418579, 0.4000000059604645, 0.4000000059604645], [0.5249999761581421, 0.9750000238418579, 0.800000011920929, 0.800000011920929], [0.574999988079071, 0.9750000238418579, 0.4000000059604645, 0.4000000059604645], [0.574999988079071, 0.9750000238418579, 0.800000011920929, 0.800000011920929], [0.625, 0.9750000238418579, 0.4000000059604645, 0.4000000059604645], [0.625, 0.9750000238418579, 0.800000011920929, 0.800000011920929], [0.675000011920929, 0.9750000238418579, 0.4000000059604645, 0.4000000059604645], [0.675000011920929, 0.9750000238418579, 0.800000011920929, 0.800000011920929], [0.7250000238418579, 0.9750000238418579, 0.4000000059604645, 0.4000000059604645], [0.7250000238418579, 0.9750000238418579, 0.800000011920929, 0.800000011920929], [0.7749999761581421, 0.9750000238418579, 0.4000000059604645, 0.4000000059604645], [0.7749999761581421, 0.9750000238418579, 0.800000011920929, 0.800000011920929], [0.824999988079071, 0.9750000238418579, 0.4000000059604645, 0.4000000059604645], [0.824999988079071, 0.9750000238418579, 0.800000011920929, 0.800000011920929], [0.875, 0.9750000238418579, 0.4000000059604645, 0.4000000059604645], [0.875, 0.9750000238418579, 0.800000011920929, 0.800000011920929], [0.925000011920929, 0.9750000238418579, 0.4000000059604645, 0.4000000059604645], [0.925000011920929, 0.9750000238418579, 0.800000011920929, 0.800000011920929], [0.9750000238418579, 0.9750000238418579, 0.4000000059604645, 0.4000000059604645], [0.9750000238418579, 0.9750000238418579, 0.800000011920929, 0.800000011920929]] diff --git a/GHA/preprocess/third_libs/OpenSeeFace/remedian.py b/GHA/preprocess/third_libs/OpenSeeFace/remedian.py new file mode 100644 index 0000000000000000000000000000000000000000..809be88b9f92e07c3f2ba5e508a503f2ca4de031 --- /dev/null +++ b/GHA/preprocess/third_libs/OpenSeeFace/remedian.py @@ -0,0 +1,82 @@ +""" +Watch over a stream of numbers, incrementally learning their median. + +Implemented via nested lists. New numbers are added to `lst[i]` and +when it fills up, it posts its median to `lst[i+1]`. Wen `lst[i+1]` +fills up, it posts the medians of its medians to `lst[i+2]`. Etc. +When a remedian is queried for the current median, it returns the +median of the last list with any numbers. + +This approach is quite space efficient . E.g. four nested lists, +each with 64 items, require memory for 4*64 items yet can hold the +median of the median of the median of the median of over 17 million +numbers. + +Example usage: + + z=remedian() + for i in range(1000): + z + i + if not i % 100: + print(i, z.median()) + +Based on [The Remedian:A Robust Averaging Method for Large Data +Sets](http://web.ipac.caltech.edu/staff/fmasci/home/astro_refs/Remedian.pdf). +by Peter J. Rousseeuw and Gilbert W. Bassett Jr. Journal of the +American Statistical Association March 1990, Vol. 85, No. 409, +Theory and Methods + +The code [remedianeg.py](remedianeg.py) compares this rig to just +using Python's built-in sort then reporing the middle number. +Assuming lists of length 64 and use of pypy3: + +- Remedian is getting nearly as fast (within 20%) as raw sort after 500 items; +- While at the same time, avoids having to store all the numbers in RAM; +- Further, remedian's computed median is within 1% (or less) of the medians found via Python's sort. + +_____ + +## Programmer's Guide + +""" + +# If `ordered` is `False`, do not sort `lst` +def median(lst,ordered=False): + assert lst,"median needs a non-empty list" + n = len(lst) + p = q = n//2 + if n < 3: + p,q = 0, n-1 + else: + lst = lst if ordered else sorted(lst) + if not n % 2: # for even-length lists, use mean of mid 2 nums + q = p -1 + return lst[p] if p==q else (lst[p]+lst[q])/2 + +class remedian: + + # Initialization + def __init__(i,inits=[], k=64, # after some experimentation, 64 works ok + about = None): + i.all,i.k = [],k + i.more,i._median=None,None + [i + x for x in inits] + + # When full, push the median of current values to next list, then reset. + def __add__(i,x): + i._median = None + i.all.append(x) + if len(i.all) == i.k: + i.more = i.more or remedian(k=i.k) + i.more + i._medianPrim(i.all) + i.all = [] # reset + + # If there is a next list, ask its median. Else, work it out locally. + def median(i): + return i.more.median() if i.more else i._medianPrim(i.all) + + # Only recompute median if we do not know it already. + def _medianPrim(i,all): + if i._median == None: + i._median = median(all,ordered=False) + return i._median diff --git a/GHA/preprocess/third_libs/OpenSeeFace/retinaface.py b/GHA/preprocess/third_libs/OpenSeeFace/retinaface.py new file mode 100644 index 0000000000000000000000000000000000000000..52da9f48735b5c0cddc040cbd08643182d100df2 --- /dev/null +++ b/GHA/preprocess/third_libs/OpenSeeFace/retinaface.py @@ -0,0 +1,149 @@ +import sys +import numpy as np +import cv2 +import onnxruntime +import time +import queue +import threading +import json +import copy + +def py_cpu_nms(dets, thresh): + """ Pure Python NMS baseline. + Copyright (c) 2015 Microsoft + Licensed under The MIT License + Written by Ross Girshick + """ + x1 = dets[:, 0] + y1 = dets[:, 1] + x2 = dets[:, 2] + y2 = dets[:, 3] + scores = dets[:, 4] + + areas = (x2 - x1 + 1) * (y2 - y1 + 1) + order = scores.argsort()[::-1] + + keep = [] + while order.size > 0: + i = order[0] + keep.append(i) + xx1 = np.maximum(x1[i], x1[order[1:]]) + yy1 = np.maximum(y1[i], y1[order[1:]]) + xx2 = np.minimum(x2[i], x2[order[1:]]) + yy2 = np.minimum(y2[i], y2[order[1:]]) + + w = np.maximum(0.0, xx2 - xx1 + 1) + h = np.maximum(0.0, yy2 - yy1 + 1) + inter = w * h + ovr = inter / (areas[i] + areas[order[1:]] - inter) + + inds = np.where(ovr <= thresh)[0] + order = order[inds + 1] + + return keep + +def decode(loc, priors, variances): + data = ( + priors[:, :2] + loc[:, :2] * variances[0] * priors[:, 2:], + priors[:, 2:] * np.exp(loc[:, 2:] * variances[1]) + ) + boxes = np.concatenate(data, 1) + boxes[:, :2] -= boxes[:, 2:] / 2 + boxes[:, 2:] += boxes[:, :2] + return boxes + +def worker_thread(rfd, frame): + results = rfd.detect_retina(frame, is_background=True) + rfd.results.put(results, False) + rfd.finished = True + rfd.running = False + +class RetinaFaceDetector(): + def __init__(self, model_path="models/retinaface_640x640_opt.onnx", json_path="models/priorbox_640x640.json", threads=4, min_conf=0.4, nms_threshold=0.4, top_k=1, res=(640, 640)): + options = onnxruntime.SessionOptions() + options.inter_op_num_threads = 1 + options.intra_op_num_threads = threads + options.execution_mode = onnxruntime.ExecutionMode.ORT_SEQUENTIAL + options.graph_optimization_level = onnxruntime.GraphOptimizationLevel.ORT_ENABLE_ALL + options.log_severity_level = 3 + self.session = onnxruntime.InferenceSession(model_path, sess_options=options) + self.res_w, self.res_h = res + with open(json_path, "r") as prior_file: + self.priorbox = np.array(json.loads(prior_file.read())) + self.min_conf = min_conf + self.nms_threshold = nms_threshold + self.top_k = top_k + self.finished = False + self.running = False + self.results = queue.Queue() + + def detect_retina(self, frame, is_background=False): + h, w, _ = frame.shape + im = None + im = cv2.resize(frame, (self.res_w, self.res_h), interpolation=cv2.INTER_LINEAR) + resize_w = w / self.res_w + resize_w = 1 / resize_w + resize_h = h / self.res_h + resize_h = 1 / resize_h + im = np.float32(im) + scale = np.array((self.res_w / resize_w, self.res_h / resize_h, self.res_w / resize_w, self.res_h / resize_h)) + im -= (104, 117, 123) + im = im.transpose(2, 0, 1) + im = np.expand_dims(im, 0) + output = self.session.run([], {"input0": im}) + loc, conf = output[0][0], output[1][0] + boxes = decode(loc, self.priorbox, [0.1, 0.2]) + boxes = boxes * scale + scores = conf[:, 1] + + inds = np.where(scores > self.min_conf)[0] + boxes = boxes[inds] + scores = scores[inds] + + dets = np.hstack((boxes, scores[:, np.newaxis])).astype(np.float32, copy=False) + keep = py_cpu_nms(dets, self.nms_threshold) + dets = dets[keep, :] + dets = dets[:self.top_k, 0:4] + dets[:, 2:4] = dets[:, 2:4] - dets[:, 0:2] + + if True:#is_background: + upsize = dets[:, 2:4] * np.array([[0.15, 0.2]]) + dets[:, 0:2] -= upsize + dets[:, 2:4] += upsize * 2 + + return list(map(tuple, dets)) + + def background_detect(self, frame): + if self.running or self.finished: + return + self.running = True + im = copy.copy(frame) + thread = threading.Thread(target=worker_thread, args=(self, im)) + thread.start() + + def get_results(self): + if self.finished: + results = [] + try: + while True: + detection = self.results.get(False) + results.append(detection) + except: + "No error" + self.finished = False + return list(*results) + else: + return [] + +if __name__== "__main__": + retina = RetinaFaceDetector(top_k=40, min_conf=0.2) + im = cv2.imread(sys.argv[1], cv2.IMREAD_COLOR) + start = time.perf_counter() + faces = retina.detect_retina(im) + end = 1000 * (time.perf_counter() - start) + print(f"Runtime: {end:.3f}ms") + for (x,y,w,h) in faces: + im = cv2.rectangle(im, (int(x),int(y)), (int(x+w),int(y+w)), (0,0,255), 1) + cv2.imshow("Frame", im) + while cv2.waitKey(0) & 0xff != ord('q'): + "" diff --git a/GHA/preprocess/third_libs/OpenSeeFace/tracker.py b/GHA/preprocess/third_libs/OpenSeeFace/tracker.py new file mode 100644 index 0000000000000000000000000000000000000000..c0599a96b9fe67192a6c5c86ff01d7a8efe3704d --- /dev/null +++ b/GHA/preprocess/third_libs/OpenSeeFace/tracker.py @@ -0,0 +1,1211 @@ +import os +import numpy as np +import math +import cv2 +import onnxruntime +import time +import queue +import threading +import copy +from .retinaface import RetinaFaceDetector +from .remedian import remedian + +def resolve(name): + f = os.path.join(os.path.dirname(__file__), name) + return f + +def clamp_to_im(pt, w, h): + x = pt[0] + y = pt[1] + if x < 0: + x = 0 + if y < 0: + y = 0 + if x >= w: + x = w-1 + if y >= h: + y = h-1 + return (int(x), int(y+1)) + +def rotate(origin, point, a): + a = -a + ox, oy = origin + px, py = point + + qx = ox + math.cos(a) * (px - ox) - math.sin(a) * (py - oy) + qy = oy + math.sin(a) * (px - ox) + math.cos(a) * (py - oy) + return qx, qy + +def angle(p1, p2): + p1 = np.array(p1) + p2 = np.array(p2) + a = np.arctan2(*(p2 - p1)[::-1]) + return (a % (2 * np.pi)) + +def compensate(p1, p2): + a = angle(p1, p2) + return rotate(p1, p2, a), a + +def rotate_image(image, a, center): + (h, w) = image.shape[:2] + a = np.rad2deg(a) + M = cv2.getRotationMatrix2D((float(center[0]), float(center[1])), a, 1.0) + rotated = cv2.warpAffine(image, M, (w, h)) + return rotated + +def intersects(r1, r2, amount=0.3): + area1 = r1[2] * r1[3] + area2 = r2[2] * r2[3] + inter = 0.0 + total = area1 + area2 + + r1_x1, r1_y1, w, h = r1 + r1_x2 = r1_x1 + w + r1_y2 = r1_y1 + h + r2_x1, r2_y1, w, h = r2 + r2_x2 = r2_x1 + w + r2_y2 = r2_y1 + h + + left = max(r1_x1, r2_x1) + right = min(r1_x2, r2_x2) + top = max(r1_y1, r2_y1) + bottom = min(r1_y2, r2_y2) + if left < right and top < bottom: + inter = (right - left) * (bottom - top) + total -= inter + + if inter / total >= amount: + return True + + return False + + #return not (r1_x1 > r2_x2 or r1_x2 < r2_x1 or r1_y1 > r2_y2 or r1_y2 < r2_y1) + +def group_rects(rects): + rect_groups = {} + for rect in rects: + rect_groups[str(rect)] = [-1, -1, []] + group_id = 0 + for i, rect in enumerate(rects): + name = str(rect) + group = group_id + group_id += 1 + if rect_groups[name][0] < 0: + rect_groups[name] = [group, -1, []] + else: + group = rect_groups[name][0] + for j, other_rect in enumerate(rects): + if i == j: + continue; + inter = intersects(rect, other_rect) + if intersects(rect, other_rect): + rect_groups[str(other_rect)] = [group, -1, []] + return rect_groups + +def logit(p, factor=16.0): + if p >= 1.0: + p = 0.9999999 + if p <= 0.0: + p = 0.0000001 + p = p/(1-p) + return float(np.log(p)) / float(factor) + +def logit_arr(p, factor=16.0): + p = np.clip(p, 0.0000001, 0.9999999) + return np.log(p / (1 - p)) / float(factor) + +def matrix_to_quaternion(m): + t = 0.0 + q = [0.0, 0.0, 0, 0.0] + if m[2,2] < 0: + if m[0,0] > m[1,1]: + t = 1 + m[0,0] - m[1,1] - m[2,2] + q = [t, m[0,1]+m[1,0], m[2,0]+m[0,2], m[1,2]-m[2,1]] + else: + t = 1 - m[0,0] + m[1,1] - m[2,2] + q = [m[0,1]+m[1,0], t, m[1,2]+m[2,1], m[2,0]-m[0,2]] + else: + if m[0,0] < -m[1,1]: + t = 1 - m[0,0] - m[1,1] + m[2,2] + q = [m[2,0]+m[0,2], m[1,2]+m[2,1], t, m[0,1]-m[1,0]] + else: + t = 1 + m[0,0] + m[1,1] + m[2,2] + q = [m[1,2]-m[2,1], m[2,0]-m[0,2], m[0,1]-m[1,0], t] + q = np.array(q, np.float32) * 0.5 / np.sqrt(t) + return q + +def worker_thread(session, frame, input, crop_info, queue, input_name, idx, tracker): + output = session.run([], {input_name: input})[0] + conf, lms = tracker.landmarks(output[0], crop_info) + if conf > tracker.threshold: + try: + eye_state = tracker.get_eye_state(frame, lms, single=True) + except: + eye_state = [(1.0, 0.0, 0.0, 0.0), (1.0, 0.0, 0.0, 0.0)] + queue.put((session, conf, (lms, eye_state), crop_info, idx)) + else: + queue.put((session,)) + +class Feature(): + def __init__(self, threshold=0.15, alpha=0.2, hard_factor=0.15, decay=0.001, max_feature_updates=0): + self.median = remedian() + self.min = None + self.max = None + self.hard_min = None + self.hard_max = None + self.threshold = threshold + self.alpha = alpha + self.hard_factor = hard_factor + self.decay = decay + self.last = 0 + self.current_median = 0 + self.update_count = 0 + self.max_feature_updates = max_feature_updates + self.first_seen = -1 + self.updating = True + + def update(self, x, now=0): + if self.max_feature_updates > 0: + if self.first_seen == -1: + self.first_seen = now; + new = self.update_state(x, now=now) + filtered = self.last * self.alpha + new * (1 - self.alpha) + self.last = filtered + return filtered + + def update_state(self, x, now=0): + updating = self.updating and (self.max_feature_updates == 0 or now - self.first_seen < self.max_feature_updates) + if updating: + self.median + x + self.current_median = self.median.median() + else: + self.updating = False + median = self.current_median + + if self.min is None: + if x < median and (median - x) / median > self.threshold: + if updating: + self.min = x + self.hard_min = self.min + self.hard_factor * (median - self.min) + return -1 + return 0 + else: + if x < self.min: + if updating: + self.min = x + self.hard_min = self.min + self.hard_factor * (median - self.min) + return -1 + if self.max is None: + if x > median and (x - median) / median > self.threshold: + if updating: + self.max = x + self.hard_max = self.max - self.hard_factor * (self.max - median) + return 1 + return 0 + else: + if x > self.max: + if updating: + self.max = x + self.hard_max = self.max - self.hard_factor * (self.max - median) + return 1 + + if updating: + if self.min < self.hard_min: + self.min = self.hard_min * self.decay + self.min * (1 - self.decay) + if self.max > self.hard_max: + self.max = self.hard_max * self.decay + self.max * (1 - self.decay) + + if x < median: + return - (1 - (x - self.min) / (median - self.min)) + elif x > median: + return (x - median) / (self.max - median) + + return 0 + +class FeatureExtractor(): + def __init__(self, max_feature_updates=0): + self.eye_l = Feature(max_feature_updates=max_feature_updates) + self.eye_r = Feature(max_feature_updates=max_feature_updates) + self.eyebrow_updown_l = Feature(max_feature_updates=max_feature_updates) + self.eyebrow_updown_r = Feature(max_feature_updates=max_feature_updates) + self.eyebrow_quirk_l = Feature(threshold=0.05, max_feature_updates=max_feature_updates) + self.eyebrow_quirk_r = Feature(threshold=0.05, max_feature_updates=max_feature_updates) + self.eyebrow_steepness_l = Feature(threshold=0.05, max_feature_updates=max_feature_updates) + self.eyebrow_steepness_r = Feature(threshold=0.05, max_feature_updates=max_feature_updates) + self.mouth_corner_updown_l = Feature(max_feature_updates=max_feature_updates) + self.mouth_corner_updown_r = Feature(max_feature_updates=max_feature_updates) + self.mouth_corner_inout_l = Feature(threshold=0.02, max_feature_updates=max_feature_updates) + self.mouth_corner_inout_r = Feature(threshold=0.02, max_feature_updates=max_feature_updates) + self.mouth_open = Feature(max_feature_updates=max_feature_updates) + self.mouth_wide = Feature(threshold=0.02, max_feature_updates=max_feature_updates) + + def align_points(self, a, b, pts): + a = tuple(a) + b = tuple(b) + alpha = angle(a, b) + alpha = np.rad2deg(alpha) + if alpha >= 90: + alpha = - (alpha - 180) + if alpha <= -90: + alpha = - (alpha + 180) + alpha = np.deg2rad(alpha) + aligned_pts = [] + for pt in pts: + aligned_pts.append(np.array(rotate(a, pt, alpha))) + return alpha, np.array(aligned_pts) + + def update(self, pts, full=True): + features = {} + now = time.perf_counter() + + norm_distance_x = np.mean([pts[0, 0] - pts[16, 0], pts[1, 0] - pts[15, 0]]) + norm_distance_y = np.mean([pts[27, 1] - pts[28, 1], pts[28, 1] - pts[29, 1], pts[29, 1] - pts[30, 1]]) + + a1, f_pts = self.align_points(pts[42], pts[45], pts[[43, 44, 47, 46]]) + f = abs((np.mean([f_pts[0,1], f_pts[1,1]]) - np.mean([f_pts[2,1], f_pts[3,1]])) / norm_distance_y) + features["eye_l"] = self.eye_l.update(f, now) + + a2, f_pts = self.align_points(pts[36], pts[39], pts[[37, 38, 41, 40]]) + f = abs((np.mean([f_pts[0,1], f_pts[1,1]]) - np.mean([f_pts[2,1], f_pts[3,1]])) / norm_distance_y) + features["eye_r"] = self.eye_r.update(f, now) + + if full: + a3, _ = self.align_points(pts[0], pts[16], []) + a4, _ = self.align_points(pts[31], pts[35], []) + norm_angle = np.mean(list(map(np.rad2deg, [a1, a2, a3, a4]))) + + a, f_pts = self.align_points(pts[22], pts[26], pts[[22, 23, 24, 25, 26]]) + features["eyebrow_steepness_l"] = self.eyebrow_steepness_l.update(-np.rad2deg(a) - norm_angle, now) + f = np.max(np.abs(np.array(f_pts[1:4]) - f_pts[0, 1])) / norm_distance_y + features["eyebrow_quirk_l"] = self.eyebrow_quirk_l.update(f, now) + + a, f_pts = self.align_points(pts[17], pts[21], pts[[17, 18, 19, 20, 21]]) + features["eyebrow_steepness_r"] = self.eyebrow_steepness_r.update(np.rad2deg(a) - norm_angle, now) + f = np.max(np.abs(np.array(f_pts[1:4]) - f_pts[0, 1])) / norm_distance_y + features["eyebrow_quirk_r"] = self.eyebrow_quirk_r.update(f, now) + else: + features["eyebrow_steepness_l"] = 0. + features["eyebrow_steepness_r"] = 0. + features["eyebrow_quirk_l"] = 0. + features["eyebrow_quirk_r"] = 0. + + f = (np.mean([pts[22, 1], pts[26, 1]]) - pts[27, 1]) / norm_distance_y + features["eyebrow_updown_l"] = self.eyebrow_updown_l.update(f, now) + + f = (np.mean([pts[17, 1], pts[21, 1]]) - pts[27, 1]) / norm_distance_y + features["eyebrow_updown_r"] = self.eyebrow_updown_r.update(f, now) + + upper_mouth_line = np.mean([pts[49, 1], pts[50, 1], pts[51, 1]]) + center_line = np.mean([pts[50, 0], pts[60, 0], pts[27, 0], pts[30, 0], pts[64, 0], pts[55, 0]]) + + f = (upper_mouth_line - pts[62, 1]) / norm_distance_y + features["mouth_corner_updown_l"] = self.mouth_corner_updown_l.update(f, now) + if full: + f = abs(center_line - pts[62, 0]) / norm_distance_x + features["mouth_corner_inout_l"] = self.mouth_corner_inout_l.update(f, now) + else: + features["mouth_corner_inout_l"] = 0. + + f = (upper_mouth_line - pts[58, 1]) / norm_distance_y + features["mouth_corner_updown_r"] = self.mouth_corner_updown_r.update(f, now) + if full: + f = abs(center_line - pts[58, 0]) / norm_distance_x + features["mouth_corner_inout_r"] = self.mouth_corner_inout_r.update(f, now) + else: + features["mouth_corner_inout_r"] = 0. + + f = abs(np.mean(pts[[59,60,61], 1], axis=0) - np.mean(pts[[63,64,65], 1], axis=0)) / norm_distance_y + features["mouth_open"] = self.mouth_open.update(f, now) + + f = abs(pts[58, 0] - pts[62, 0]) / norm_distance_x + features["mouth_wide"] = self.mouth_wide.update(f, now) + + return features + +class FaceInfo(): + def __init__(self, id, tracker): + self.id = id + self.frame_count = -1 + self.tracker = tracker + self.contour_pts = [0,1,8,15,16,27,28,29,30,31,32,33,34,35] + self.face_3d = copy.copy(self.tracker.face_3d) + if self.tracker.model_type == -1: + self.contour_pts = [0,2,8,14,16,27,30,33] + self.reset() + self.alive = False + self.coord = None + self.base_scale_v = self.tracker.face_3d[27:30, 1] - self.tracker.face_3d[28:31, 1] + self.base_scale_h = np.abs(self.tracker.face_3d[[0, 36, 42], 0] - self.tracker.face_3d[[16, 39, 45], 0]) + + self.limit_3d_adjustment = True + self.update_count_delta = 75. + self.update_count_max = 7500. + + if self.tracker.max_feature_updates > 0: + self.features = FeatureExtractor(self.tracker.max_feature_updates) + + def reset(self): + self.alive = False + self.conf = None + self.lms = None + self.eye_state = None + self.rotation = None + self.translation = None + self.success = None + self.quaternion = None + self.euler = None + self.pnp_error = None + self.pts_3d = None + self.eye_blink = None + self.bbox = None + self.pnp_error = 0 + if self.tracker.max_feature_updates < 1: + self.features = FeatureExtractor(0) + self.current_features = {} + self.contour = np.zeros((21,3)) + self.update_counts = np.zeros((66,2)) + self.update_contour() + self.fail_count = 0 + + def update(self, result, coord, frame_count): + self.frame_count = frame_count + if result is None: + self.reset() + else: + self.conf, (self.lms, self.eye_state) = result + self.coord = coord + self.alive = True + + def update_contour(self): + self.contour = np.array(self.face_3d[self.contour_pts]) + + def normalize_pts3d(self, pts_3d): + # Calculate angle using nose + pts_3d[:, 0:2] -= pts_3d[30, 0:2] + alpha = angle(pts_3d[30, 0:2], pts_3d[27, 0:2]) + alpha -= np.deg2rad(90) + + R = np.matrix([[np.cos(alpha), -np.sin(alpha)], [np.sin(alpha), np.cos(alpha)]]) + pts_3d[:, 0:2] = (pts_3d - pts_3d[30])[:, 0:2].dot(R) + pts_3d[30, 0:2] + + # Vertical scale + pts_3d[:, 1] /= np.mean((pts_3d[27:30, 1] - pts_3d[28:31, 1]) / self.base_scale_v) + + # Horizontal scale + pts_3d[:, 0] /= np.mean(np.abs(pts_3d[[0, 36, 42], 0] - pts_3d[[16, 39, 45], 0]) / self.base_scale_h) + + return pts_3d + + def adjust_3d(self): + if self.conf < 0.4 or self.pnp_error > 300: + return + + if self.tracker.model_type != -1 and not self.tracker.static_model: + max_runs = 1 + eligible = np.delete(np.arange(0, 66), [30]) + changed_any = False + update_type = -1 + d_o = np.ones((66,)) + d_c = np.ones((66,)) + for runs in range(max_runs): + r = 1.0 + np.random.random_sample((66,3)) * 0.02 - 0.01 + r[30, :] = 1.0 + if self.euler[0] > -165 and self.euler[0] < 145: + continue + elif self.euler[1] > -10 and self.euler[1] < 20: + r[:, 2] = 1.0 + update_type = 0 + else: + r[:, 0:2] = 1.0 + if self.euler[2] > 120 or self.euler[2] < 60: + continue + # Enable only one side of the points, depending on direction + elif self.euler[1] < -10: + update_type = 1 + r[[0, 1, 2, 3, 4, 5, 6, 7, 17, 18, 19, 20, 21, 31, 32, 36, 37, 38, 39, 40, 41, 48, 49, 56, 57, 58, 59, 65], 2] = 1.0 + eligible = [8, 9, 10, 11, 12, 13, 14, 15, 16, 22, 23, 24, 25, 26, 27, 28, 29, 33, 34, 35, 42, 43, 44, 45, 46, 47, 50, 51, 52, 53, 54, 55, 60, 61, 62, 63, 64] + else: + update_type = 1 + r[[9, 10, 11, 12, 13, 14, 15, 16, 22, 23, 24, 25, 26, 34, 35, 42, 43, 44, 45, 46, 47, 51, 52, 53, 54, 61, 62, 63], 2] = 1.0 + eligible = [0, 1, 2, 3, 4, 5, 6, 7, 8, 17, 18, 19, 20, 21, 27, 28, 29, 31, 32, 33, 36, 37, 38, 39, 40, 41, 48, 49, 50, 55, 56, 57, 58, 59, 60, 64, 65] + + if self.limit_3d_adjustment: + eligible = np.nonzero(self.update_counts[:, update_type] < self.update_counts[:, abs(update_type - 1)] + self.update_count_delta)[0] + if eligible.shape[0] <= 0: + break + + if runs == 0: + updated = copy.copy(self.face_3d[0:66]) + o_projected = np.ones((66,2)) + o_projected[eligible] = np.squeeze(np.array(cv2.projectPoints(self.face_3d[eligible], self.rotation, self.translation, self.tracker.camera, self.tracker.dist_coeffs)[0]), 1) + c = updated * r + c_projected = np.zeros((66,2)) + c_projected[eligible] = np.squeeze(np.array(cv2.projectPoints(c[eligible], self.rotation, self.translation, self.tracker.camera, self.tracker.dist_coeffs)[0]), 1) + changed = False + + d_o[eligible] = np.linalg.norm(o_projected[eligible] - self.lms[eligible, 0:2], axis=1) + d_c[eligible] = np.linalg.norm(c_projected[eligible] - self.lms[eligible, 0:2], axis=1) + indices = np.nonzero(d_c < d_o)[0] + if indices.shape[0] > 0: + if self.limit_3d_adjustment: + indices = np.intersect1d(indices, eligible) + if indices.shape[0] > 0: + self.update_counts[indices, update_type] += 1 + updated[indices] = c[indices] + o_projected[indices] = c_projected[indices] + changed = True + changed_any = changed_any or changed + + if not changed: + break + + if changed_any: + # Update weighted by point confidence + weights = np.zeros((66,3)) + weights[:, :] = self.lms[0:66, 2:3] + weights[weights > 0.7] = 1.0 + weights = 1.0 - weights + update_indices = np.arange(0, 66) + if self.limit_3d_adjustment: + update_indices = np.nonzero(self.update_counts[:, update_type] <= self.update_count_max)[0] + self.face_3d[update_indices] = self.face_3d[update_indices] * weights[update_indices] + updated[update_indices] * (1. - weights[update_indices]) + self.update_contour() + + self.pts_3d = self.normalize_pts3d(self.pts_3d) + if self.tracker.feature_level == 2: + self.current_features = self.features.update(self.pts_3d[:, 0:2]) + self.eye_blink = [] + self.eye_blink.append(1 - min(max(0, -self.current_features["eye_r"]), 1)) + self.eye_blink.append(1 - min(max(0, -self.current_features["eye_l"]), 1)) + elif self.tracker.feature_level == 1: + self.current_features = self.features.update(self.pts_3d[:, 0:2], False) + self.eye_blink = [] + self.eye_blink.append(1 - min(max(0, -self.current_features["eye_r"]), 1)) + self.eye_blink.append(1 - min(max(0, -self.current_features["eye_l"]), 1)) + +def get_model_base_path(model_dir): + model_base_path = resolve(os.path.join("models")) + if model_dir is None: + if not os.path.exists(model_base_path): + model_base_path = resolve(os.path.join("..", "models")) + else: + model_base_path = model_dir + return model_base_path + +class Tracker(): + def __init__(self, width, height, model_type=3, detection_threshold=0.6, threshold=None, max_faces=1, discard_after=5, scan_every=3, bbox_growth=0.0, max_threads=4, silent=False, model_dir=None, no_gaze=False, use_retinaface=False, max_feature_updates=0, static_model=False, feature_level=2, try_hard=False): + options = onnxruntime.SessionOptions() + options.inter_op_num_threads = 1 + options.intra_op_num_threads = min(max_threads,4) + options.execution_mode = onnxruntime.ExecutionMode.ORT_SEQUENTIAL + options.graph_optimization_level = onnxruntime.GraphOptimizationLevel.ORT_ENABLE_ALL + options.log_severity_level = 3 + self.model_type = model_type + self.models = [ + "lm_model0_opt.onnx", + "lm_model1_opt.onnx", + "lm_model2_opt.onnx", + "lm_model3_opt.onnx", + "lm_model4_opt.onnx" + ] + model = "lm_modelT_opt.onnx" + if model_type >= 0: + model = self.models[self.model_type] + if model_type == -2: + model = "lm_modelV_opt.onnx" + if model_type == -3: + model = "lm_modelU_opt.onnx" + model_base_path = get_model_base_path(model_dir) + + if threshold is None: + threshold = 0.6 + if model_type < 0: + threshold = 0.87 + + self.retinaface = RetinaFaceDetector(model_path=os.path.join(model_base_path, "retinaface_640x640_opt.onnx"), json_path=os.path.join(model_base_path, "priorbox_640x640.json"), threads=max(max_threads,4), top_k=max_faces, res=(640, 640)) + self.retinaface_scan = RetinaFaceDetector(model_path=os.path.join(model_base_path, "retinaface_640x640_opt.onnx"), json_path=os.path.join(model_base_path, "priorbox_640x640.json"), threads=2, top_k=max_faces, res=(640, 640)) + self.use_retinaface = use_retinaface + + # Single face instance with multiple threads + self.session = onnxruntime.InferenceSession(os.path.join(model_base_path, model), sess_options=options) + + # Multiple faces with single threads + self.sessions = [] + self.max_workers = max(min(max_threads, max_faces), 1) + extra_threads = max_threads % self.max_workers + for i in range(self.max_workers): + options = onnxruntime.SessionOptions() + options.inter_op_num_threads = 1 + options.intra_op_num_threads = min(max(max_threads // self.max_workers, 4), 1) + if options.intra_op_num_threads < 1: + options.intra_op_num_threads = 1 + elif i < extra_threads: + options.intra_op_num_threads += 1 + options.execution_mode = onnxruntime.ExecutionMode.ORT_SEQUENTIAL + options.graph_optimization_level = onnxruntime.GraphOptimizationLevel.ORT_ENABLE_ALL + self.sessions.append(onnxruntime.InferenceSession(os.path.join(model_base_path, model), sess_options=options)) + self.input_name = self.session.get_inputs()[0].name + + options = onnxruntime.SessionOptions() + options.inter_op_num_threads = 1 + options.intra_op_num_threads = max(max_threads,4) + options.execution_mode = onnxruntime.ExecutionMode.ORT_SEQUENTIAL + options.graph_optimization_level = onnxruntime.GraphOptimizationLevel.ORT_ENABLE_ALL + options.log_severity_level = 3 + self.gaze_model = onnxruntime.InferenceSession(os.path.join(model_base_path, "mnv3_gaze32_split_opt.onnx"), sess_options=options) + options.intra_op_num_threads = 1 + self.gaze_model_single = onnxruntime.InferenceSession(os.path.join(model_base_path, "mnv3_gaze32_split_opt.onnx"), sess_options=options) + + self.detection = onnxruntime.InferenceSession(os.path.join(model_base_path, "mnv3_detection_opt.onnx"), sess_options=options) + self.faces = [] + + # Image normalization constants + self.mean = np.float32(np.array([0.485, 0.456, 0.406])) + self.std = np.float32(np.array([0.229, 0.224, 0.225])) + self.mean = self.mean / self.std + self.std = self.std * 255.0 + + self.mean = - self.mean + self.std = 1.0 / self.std + self.mean_32 = np.tile(self.mean, [32, 32, 1]) + self.std_32 = np.tile(self.std, [32, 32, 1]) + self.mean_224 = np.tile(self.mean, [224, 224, 1]) + self.std_224 = np.tile(self.std, [224, 224, 1]) + + # PnP solving + self.face_3d = np.array([ + [ 0.4551769692672 , 0.300895790030204, -0.764429433974752], + [ 0.448998827123556, 0.166995837790733, -0.765143004071253], + [ 0.437431554952677, 0.022655479179981, -0.739267175112735], + [ 0.415033422928434, -0.088941454648772, -0.747947437846473], + [ 0.389123587370091, -0.232380029794684, -0.704788385327458], + [ 0.334630113904382, -0.361265387599081, -0.615587579236862], + [ 0.263725112132858, -0.460009725616771, -0.491479221041573], + [ 0.16241621322721 , -0.558037146073869, -0.339445180872282], + [ 0. , -0.621079019321682, -0.287294770748887], + [-0.16241621322721 , -0.558037146073869, -0.339445180872282], + [-0.263725112132858, -0.460009725616771, -0.491479221041573], + [-0.334630113904382, -0.361265387599081, -0.615587579236862], + [-0.389123587370091, -0.232380029794684, -0.704788385327458], + [-0.415033422928434, -0.088941454648772, -0.747947437846473], + [-0.437431554952677, 0.022655479179981, -0.739267175112735], + [-0.448998827123556, 0.166995837790733, -0.765143004071253], + [-0.4551769692672 , 0.300895790030204, -0.764429433974752], + [ 0.385529968662985, 0.402800553948697, -0.310031082540741], + [ 0.322196658344302, 0.464439136821772, -0.250558059367669], + [ 0.25409760441282 , 0.46420381416882 , -0.208177722146526], + [ 0.186875436782135, 0.44706071961879 , -0.145299823706503], + [ 0.120880983543622, 0.423566314072968, -0.110757158774771], + [-0.120880983543622, 0.423566314072968, -0.110757158774771], + [-0.186875436782135, 0.44706071961879 , -0.145299823706503], + [-0.25409760441282 , 0.46420381416882 , -0.208177722146526], + [-0.322196658344302, 0.464439136821772, -0.250558059367669], + [-0.385529968662985, 0.402800553948697, -0.310031082540741], + [ 0. , 0.293332603215811, -0.137582088779393], + [ 0. , 0.194828701837823, -0.069158109325951], + [ 0. , 0.103844017393155, -0.009151819844964], + [ 0. , 0. , 0. ], + [ 0.080626352317973, -0.041276068128093, -0.134161035564826], + [ 0.046439347377934, -0.057675223874769, -0.102990627164664], + [ 0. , -0.068753126205604, -0.090545348482397], + [-0.046439347377934, -0.057675223874769, -0.102990627164664], + [-0.080626352317973, -0.041276068128093, -0.134161035564826], + [ 0.315905195966084, 0.298337502555443, -0.285107407636464], + [ 0.275252345439353, 0.312721904921771, -0.244558251170671], + [ 0.176394511553111, 0.311907184376107, -0.219205360345231], + [ 0.131229723798772, 0.284447361805627, -0.234239149487417], + [ 0.184124948330084, 0.260179585304867, -0.226590776513707], + [ 0.279433549294448, 0.267363071770222, -0.248441437111633], + [-0.131229723798772, 0.284447361805627, -0.234239149487417], + [-0.176394511553111, 0.311907184376107, -0.219205360345231], + [-0.275252345439353, 0.312721904921771, -0.244558251170671], + [-0.315905195966084, 0.298337502555443, -0.285107407636464], + [-0.279433549294448, 0.267363071770222, -0.248441437111633], + [-0.184124948330084, 0.260179585304867, -0.226590776513707], + [ 0.121155252430729, -0.208988660580347, -0.160606287940521], + [ 0.041356305910044, -0.194484199722098, -0.096159882202821], + [ 0. , -0.205180167345702, -0.083299217789729], + [-0.041356305910044, -0.194484199722098, -0.096159882202821], + [-0.121155252430729, -0.208988660580347, -0.160606287940521], + [-0.132325402795928, -0.290857984604968, -0.187067868218105], + [-0.064137791831655, -0.325377847425684, -0.158924039726607], + [ 0. , -0.343742581679188, -0.113925986025684], + [ 0.064137791831655, -0.325377847425684, -0.158924039726607], + [ 0.132325402795928, -0.290857984604968, -0.187067868218105], + [ 0.181481567104525, -0.243239316141725, -0.231284988892766], + [ 0.083999507750469, -0.239717753728704, -0.155256465640701], + [ 0. , -0.256058040176369, -0.0950619498899 ], + [-0.083999507750469, -0.239717753728704, -0.155256465640701], + [-0.181481567104525, -0.243239316141725, -0.231284988892766], + [-0.074036069749345, -0.250689938345682, -0.177346470406188], + [ 0. , -0.264945854681568, -0.112349967428413], + [ 0.074036069749345, -0.250689938345682, -0.177346470406188], + # Pupils and eyeball centers + [ 0.257990002632141, 0.276080012321472, -0.219998998939991], + [-0.257990002632141, 0.276080012321472, -0.219998998939991], + [ 0.257990002632141, 0.276080012321472, -0.324570998549461], + [-0.257990002632141, 0.276080012321472, -0.324570998549461] + ], np.float32) + + self.camera = np.array([[width, 0, width/2], [0, width, height/2], [0, 0, 1]], np.float32) + self.inverse_camera = np.linalg.inv(self.camera) + self.dist_coeffs = np.zeros((4,1)) + + self.frame_count = 0 + self.width = width + self.height = height + self.threshold = threshold + self.detection_threshold = detection_threshold + self.max_faces = max_faces + self.max_threads = max_threads + self.discard = 0 + self.discard_after = discard_after + self.detected = 0 + self.wait_count = 0 + self.scan_every = scan_every + self.bbox_growth = bbox_growth + self.silent = silent + self.try_hard = try_hard + + self.res = 224. + self.mean_res = self.mean_224 + self.std_res = self.std_224 + if model_type < 0: + self.res = 56. + self.mean_res = np.tile(self.mean, [56, 56, 1]) + self.std_res = np.tile(self.std, [56, 56, 1]) + if model_type < -1: + self.res = 112. + self.mean_res = np.tile(self.mean, [112, 112, 1]) + self.std_res = np.tile(self.std, [112, 112, 1]) + self.res_i = int(self.res) + self.out_res = 27. + if model_type < 0: + self.out_res = 6. + if model_type < -1: + self.out_res = 13. + self.out_res_i = int(self.out_res) + 1 + self.logit_factor = 16. + if model_type < 0: + self.logit_factor = 8. + if model_type < -1: + self.logit_factor = 16. + + self.no_gaze = no_gaze + self.debug_gaze = False + self.feature_level = feature_level + if model_type == -1: + self.feature_level = min(feature_level, 1) + self.max_feature_updates = max_feature_updates + self.static_model = static_model + self.face_info = [FaceInfo(id, self) for id in range(max_faces)] + self.fail_count = 0 + + def detect_faces(self, frame): + im = cv2.resize(frame, (224, 224), interpolation=cv2.INTER_LINEAR)[:,:,::-1] * self.std_224 + self.mean_224 + im = np.expand_dims(im, 0) + im = np.transpose(im, (0,3,1,2)) + outputs, maxpool = self.detection.run([], {'input': im}) + outputs = np.array(outputs) + maxpool = np.array(maxpool) + outputs[0, 0, outputs[0, 0] != maxpool[0, 0]] = 0 + detections = np.flip(np.argsort(outputs[0,0].flatten())) + results = [] + for det in detections[0:self.max_faces]: + y, x = det // 56, det % 56 + c = outputs[0, 0, y, x] + r = outputs[0, 1, y, x] * 112. + x *= 4 + y *= 4 + r *= 1.0 + if c < self.detection_threshold: + break + results.append((x - r, y - r, 2 * r, 2 * r * 1.0)) + results = np.array(results).astype(np.float32) + if results.shape[0] > 0: + results[:, [0,2]] *= frame.shape[1] / 224. + results[:, [1,3]] *= frame.shape[0] / 224. + return results + + def landmarks(self, tensor, crop_info): + crop_x1, crop_y1, scale_x, scale_y, _ = crop_info + avg_conf = 0 + res = self.res - 1 + c0, c1, c2 = 66, 132, 198 + if self.model_type == -1: + c0, c1, c2 = 30, 60, 90 + t_main = tensor[0:c0].reshape((c0,self.out_res_i * self.out_res_i)) + t_m = t_main.argmax(1) + indices = np.expand_dims(t_m, 1) + t_conf = np.take_along_axis(t_main, indices, 1).reshape((c0,)) + t_off_x = np.take_along_axis(tensor[c0:c1].reshape((c0,self.out_res_i * self.out_res_i)), indices, 1).reshape((c0,)) + t_off_y = np.take_along_axis(tensor[c1:c2].reshape((c0,self.out_res_i * self.out_res_i)), indices, 1).reshape((c0,)) + t_off_x = res * logit_arr(t_off_x, self.logit_factor) + t_off_y = res * logit_arr(t_off_y, self.logit_factor) + t_x = crop_y1 + scale_y * (res * np.floor(t_m / self.out_res_i) / self.out_res + t_off_x) + t_y = crop_x1 + scale_x * (res * np.floor(np.mod(t_m, self.out_res_i)) / self.out_res + t_off_y) + avg_conf = np.average(t_conf) + lms = np.stack([t_x, t_y, t_conf], 1) + lms[np.isnan(lms).any(axis=1)] = np.array([0.,0.,0.], dtype=np.float32) + if self.model_type == -1: + lms = lms[[0,0,1,1,1,2,2,2,3,3,3,4,4,4,5,5,6,7,7,8,8,9,10,10,11,11,12,21,21,21,22,23,23,23,23,23,13,14,14,15,16,16,17,18,18,19,20,20,24,25,25,25,26,26,27,27,27,24,24,28,28,28,26,29,29,29]] + #lms[[1,3,4,6,7,9,10,12,13,15,18,20,23,25,38,40,44,46]] += lms[[2,2,5,5,8,8,11,11,14,16,19,21,24,26,39,39,45,45]] + #lms[[3,4,6,7,9,10,12,13]] += lms[[5,5,8,8,11,11,14,14]] + #lms[[1,15,18,20,23,25,38,40,44,46]] /= 2.0 + #lms[[3,4,6,7,9,10,12,13]] /= 3.0 + part_avg = np.mean(np.partition(lms[:,2],3)[0:3]) + if part_avg < 0.65: + avg_conf = part_avg + return (avg_conf, np.array(lms)) + + def estimate_depth(self, face_info): + lms = np.concatenate((face_info.lms, np.array([[face_info.eye_state[0][1], face_info.eye_state[0][2], face_info.eye_state[0][3]], [face_info.eye_state[1][1], face_info.eye_state[1][2], face_info.eye_state[1][3]]], np.float32)), 0) + + image_pts = np.array(lms)[face_info.contour_pts, 0:2] + + success = False + if not face_info.rotation is None: + success, face_info.rotation, face_info.translation = cv2.solvePnP(face_info.contour, image_pts, self.camera, self.dist_coeffs, useExtrinsicGuess=True, rvec=np.transpose(face_info.rotation), tvec=np.transpose(face_info.translation), flags=cv2.SOLVEPNP_ITERATIVE) + else: + rvec = np.array([0, 0, 0], np.float32) + tvec = np.array([0, 0, 0], np.float32) + success, face_info.rotation, face_info.translation = cv2.solvePnP(face_info.contour, image_pts, self.camera, self.dist_coeffs, useExtrinsicGuess=True, rvec=rvec, tvec=tvec, flags=cv2.SOLVEPNP_ITERATIVE) + + rotation = face_info.rotation + translation = face_info.translation + + pts_3d = np.zeros((70,3), np.float32) + if not success: + face_info.rotation = np.array([0.0, 0.0, 0.0], np.float32) + face_info.translation = np.array([0.0, 0.0, 0.0], np.float32) + return False, np.zeros(4), np.zeros(3), 99999., pts_3d, lms + else: + face_info.rotation = np.transpose(face_info.rotation) + face_info.translation = np.transpose(face_info.translation) + + rmat, _ = cv2.Rodrigues(rotation) + inverse_rotation = np.linalg.inv(rmat) + t_reference = face_info.face_3d.dot(rmat.transpose()) + t_reference = t_reference + face_info.translation + t_reference = t_reference.dot(self.camera.transpose()) + t_depth = t_reference[:, 2] + t_depth[t_depth == 0] = 0.000001 + t_depth_e = np.expand_dims(t_depth[:],1) + t_reference = t_reference[:] / t_depth_e + pts_3d[0:66] = np.stack([lms[0:66,0], lms[0:66,1], np.ones((66,))], 1) * t_depth_e[0:66] + pts_3d[0:66] = (pts_3d[0:66].dot(self.inverse_camera.transpose()) - face_info.translation).dot(inverse_rotation.transpose()) + pnp_error = np.power(lms[0:17,0:2] - t_reference[0:17,0:2], 2).sum() + pnp_error += np.power(lms[30,0:2] - t_reference[30,0:2], 2).sum() + if np.isnan(pnp_error): + pnp_error = 9999999. + for i, pt in enumerate(face_info.face_3d[66:70]): + if i == 2: + # Right eyeball + # Eyeballs have an average diameter of 12.5mm and and the distance between eye corners is 30-35mm, so a conversion factor of 0.385 can be applied + eye_center = (pts_3d[36] + pts_3d[39]) / 2.0 + d_corner = np.linalg.norm(pts_3d[36] - pts_3d[39]) + depth = 0.385 * d_corner + pt_3d = np.array([eye_center[0], eye_center[1], eye_center[2] - depth]) + pts_3d[68] = pt_3d + continue + if i == 3: + # Left eyeball + eye_center = (pts_3d[42] + pts_3d[45]) / 2.0 + d_corner = np.linalg.norm(pts_3d[42] - pts_3d[45]) + depth = 0.385 * d_corner + pt_3d = np.array([eye_center[0], eye_center[1], eye_center[2] - depth]) + pts_3d[69] = pt_3d + continue + if i == 0: + d1 = np.linalg.norm(lms[66,0:2] - lms[36,0:2]) + d2 = np.linalg.norm(lms[66,0:2] - lms[39,0:2]) + d = d1 + d2 + pt = (pts_3d[36] * d1 + pts_3d[39] * d2) / d + if i == 1: + d1 = np.linalg.norm(lms[67,0:2] - lms[42,0:2]) + d2 = np.linalg.norm(lms[67,0:2] - lms[45,0:2]) + d = d1 + d2 + pt = (pts_3d[42] * d1 + pts_3d[45] * d2) / d + if i < 2: + reference = rmat.dot(pt) + reference = reference + face_info.translation + reference = self.camera.dot(reference) + depth = reference[2] + pt_3d = np.array([lms[66+i][0] * depth, lms[66+i][1] * depth, depth], np.float32) + pt_3d = self.inverse_camera.dot(pt_3d) + pt_3d = pt_3d - face_info.translation + pt_3d = inverse_rotation.dot(pt_3d) + pts_3d[66+i,:] = pt_3d[:] + pts_3d[np.isnan(pts_3d).any(axis=1)] = np.array([0.,0.,0.], dtype=np.float32) + + pnp_error = np.sqrt(pnp_error / (2.0 * image_pts.shape[0])) + if pnp_error > 300: + face_info.fail_count += 1 + if face_info.fail_count > 5: + # Something went wrong with adjusting the 3D model + if not self.silent: + print(f"Detected anomaly when 3D fitting face {face_info.id}. Resetting.") + face_info.face_3d = copy.copy(self.face_3d) + face_info.rotation = None + face_info.translation = np.array([0.0, 0.0, 0.0], np.float32) + face_info.update_counts = np.zeros((66,2)) + face_info.update_contour() + else: + face_info.fail_count = 0 + + euler = cv2.RQDecomp3x3(rmat)[0] + return True, matrix_to_quaternion(rmat), euler, pnp_error, pts_3d, lms + + def preprocess(self, im, crop): + x1, y1, x2, y2 = crop + im = np.float32(im[y1:y2, x1:x2]) + im = cv2.resize(im, (self.res_i, self.res_i), interpolation=cv2.INTER_LINEAR) * self.std_res + self.mean_res + im = np.expand_dims(im, 0) + im = np.transpose(im, (0,3,1,2)) + return im + + def equalize(self, im): + im_yuv = cv2.cvtColor(im, cv2.COLOR_BGR2YUV) + im_yuv[:,:,0] = cv2.equalizeHist(im_yuv[:,:,0]) + return cv2.cvtColor(im_yuv, cv2.COLOR_YUV2BGR) + + def corners_to_eye(self, corners, w, h, flip): + ((cx1, cy1), (cx2, cy2)) = corners + c1 = np.array([cx1, cy1]) + c2 = np.array([cx2, cy2]) + c2, a = compensate(c1, c2) + center = (c1 + c2) / 2.0 + radius = np.linalg.norm(c1 - c2) / 2.0 + radius = np.array([radius * 1.4, radius * 1.2]) + upper_left = clamp_to_im(center - radius, w, h) + lower_right = clamp_to_im(center + radius, w, h) + return upper_left, lower_right, center, radius, c1, a + + def prepare_eye(self, frame, full_frame, lms, flip): + outer_pt = tuple(lms[0]) + inner_pt = tuple(lms[1]) + h, w, _ = frame.shape + (x1, y1), (x2, y2), center, radius, reference, a = self.corners_to_eye((outer_pt, inner_pt), w, h, flip) + im = rotate_image(frame[:, :, ::], a, reference) + im = im[int(y1):int(y2), int(x1):int(x2),:] + if np.prod(im.shape) < 1: + return None, None, None, None, None, None + if flip: + im = cv2.flip(im, 1) + scale = np.array([(x2 - x1), (y2 - y1)]) / 32. + im = cv2.resize(im, (32, 32), interpolation=cv2.INTER_LINEAR) + #im = self.equalize(im) + if self.debug_gaze: + if not flip: + full_frame[0:32, 0:32] = im + else: + full_frame[0:32, 32:64] = im + im = im.astype(np.float32)[:,:,::-1] * self.std_32 + self.mean_32 + im = np.expand_dims(im, 0) + im = np.transpose(im, (0,3,2,1)) + return im, x1, y1, scale, reference, a + + def extract_face(self, frame, lms): + lms = np.array(lms)[:,0:2][:,::-1] + x1, y1 = tuple(lms.min(0)) + x2, y2 = tuple(lms.max(0)) + radius_x = 1.2 * (x2 - x1) / 2.0 + radius_y = 1.2 * (y2 - y1) / 2.0 + radius = np.array((radius_x, radius_y)) + center = (np.array((x1, y1)) + np.array((x2, y2))) / 2.0 + w, h, _ = frame.shape + x1, y1 = clamp_to_im(center - radius, h, w) + x2, y2 = clamp_to_im(center + radius + 1, h, w) + offset = np.array((x1, y1)) + lms = (lms[:, 0:2] - offset).astype(np.int) + frame = frame[y1:y2, x1:x2] + return frame, lms, offset + + def get_eye_state(self, frame, lms, single=False): + if self.no_gaze: + return [(1.0, 0.0, 0.0, 0.0), (1.0, 0.0, 0.0, 0.0)] + lms = np.array(lms) + e_x = [0,0] + e_y = [0,0] + scale = [0,0] + reference = [None, None] + angles = [0, 0] + face_frame, lms, offset = self.extract_face(frame, lms) + (right_eye, e_x[0], e_y[0], scale[0], reference[0], angles[0]) = self.prepare_eye(face_frame, frame, np.array([lms[36,0:2], lms[39,0:2]]), False) + (left_eye, e_x[1], e_y[1], scale[1], reference[1], angles[1]) = self.prepare_eye(face_frame, frame, np.array([lms[42,0:2], lms[45,0:2]]), True) + if right_eye is None or left_eye is None: + return [(1.0, 0.0, 0.0, 0.0), (1.0, 0.0, 0.0, 0.0)] + both_eyes = np.concatenate((right_eye, left_eye)) + results = None + if single: + results = self.gaze_model_single.run([], {self.input_name: both_eyes}) + else: + results = self.gaze_model.run([], {self.input_name: both_eyes}) + open = [0, 0] + open[0] = 1#results[1][0].argmax() + open[1] = 1#results[1][1].argmax() + results = np.array(results[0]) + + eye_state = [] + for i in range(2): + m = int(results[i][0].argmax()) + x = m // 8 + y = m % 8 + conf = float(results[i][0][x,y]) + + off_x = 32.0 * logit(results[i][1][x, y], 8.0) + off_y = 32.0 * logit(results[i][2][x, y], 8.0) + if i == 1: + eye_x = 32.0 * float(x) / 8.0 + off_x + else: + eye_x = 32.0 * float(x) / 8.0 + off_x + eye_y = 32.0 * float(y) / 8.0 + off_y + + if self.debug_gaze: + if i == 0: + frame[int(eye_y), int(eye_x)] = (0, 0, 255) + frame[int(eye_y+1), int(eye_x)] = (0, 0, 255) + frame[int(eye_y+1), int(eye_x+1)] = (0, 0, 255) + frame[int(eye_y), int(eye_x+1)] = (0, 0, 255) + else: + frame[int(eye_y), 32+int(eye_x)] = (0, 0, 255) + frame[int(eye_y+1), 32+int(eye_x)] = (0, 0, 255) + frame[int(eye_y+1), 32+int(eye_x+1)] = (0, 0, 255) + frame[int(eye_y), 32+int(eye_x+1)] = (0, 0, 255) + + if i == 0: + eye_x = e_x[i] + scale[i][0] * eye_x + else: + eye_x = e_x[i] + scale[i][0] * (32. - eye_x) + eye_y = e_y[i] + scale[i][1] * eye_y + eye_x, eye_y = rotate(reference[i], (eye_x, eye_y), -angles[i]) + + eye_x = eye_x + offset[0] + eye_y = eye_y + offset[1] + eye_state.append([open[i], eye_y, eye_x, conf]) + + eye_state = np.array(eye_state) + eye_state[np.isnan(eye_state).any(axis=1)] = np.array([1.,0.,0.,0.], dtype=np.float32) + return eye_state + + def assign_face_info(self, results): + if self.max_faces == 1 and len(results) == 1: + conf, (lms, eye_state), conf_adjust = results[0] + self.face_info[0].update((conf - conf_adjust, (lms, eye_state)), np.array(lms)[:, 0:2].mean(0), self.frame_count) + return + result_coords = [] + adjusted_results = [] + for conf, (lms, eye_state), conf_adjust in results: + adjusted_results.append((conf - conf_adjust, (lms, eye_state))) + result_coords.append(np.array(lms)[:, 0:2].mean(0)) + results = adjusted_results + candidates = [[]] * self.max_faces + max_dist = 2 * np.linalg.norm(np.array([self.width, self.height])) + for i, face_info in enumerate(self.face_info): + for j, coord in enumerate(result_coords): + if face_info.coord is None: + candidates[i].append((max_dist, i, j)) + else: + candidates[i].append((np.linalg.norm(face_info.coord - coord), i, j)) + for i, candidate in enumerate(candidates): + candidates[i] = sorted(candidate) + found = 0 + target = len(results) + used_results = {} + used_faces = {} + while found < target: + min_list = min(candidates) + candidate = min_list.pop(0) + face_idx = candidate[1] + result_idx = candidate[2] + if not result_idx in used_results and not face_idx in used_faces: + self.face_info[face_idx].update(results[result_idx], result_coords[result_idx], self.frame_count) + min_list.clear() + used_results[result_idx] = True + used_faces[face_idx] = True + found += 1 + if len(min_list) == 0: + min_list.append((2 * max_dist, face_idx, result_idx)) + for face_info in self.face_info: + if face_info.frame_count != self.frame_count: + face_info.update(None, None, self.frame_count) + + def predict(self, frame, additional_faces=[]): + self.frame_count += 1 + start = time.perf_counter() + im = frame + + duration_fd = 0.0 + duration_pp = 0.0 + duration_model = 0.0 + duration_pnp = 0.0 + + new_faces = [] + new_faces.extend(self.faces) + bonus_cutoff = len(self.faces) + new_faces.extend(additional_faces) + self.wait_count += 1 + if self.detected == 0: + start_fd = time.perf_counter() + if self.use_retinaface > 0 or self.try_hard: + retinaface_detections = self.retinaface.detect_retina(frame) + new_faces.extend(retinaface_detections) + if self.use_retinaface == 0 or self.try_hard: + new_faces.extend(self.detect_faces(frame)) + if self.try_hard: + new_faces.extend([(0, 0, self.width, self.height)]) + duration_fd = 1000 * (time.perf_counter() - start_fd) + self.wait_count = 0 + elif self.detected < self.max_faces: + if self.use_retinaface > 0: + new_faces.extend(self.retinaface_scan.get_results()) + if self.wait_count >= self.scan_every: + if self.use_retinaface > 0: + self.retinaface_scan.background_detect(frame) + else: + start_fd = time.perf_counter() + new_faces.extend(self.detect_faces(frame)) + duration_fd = 1000 * (time.perf_counter() - start_fd) + self.wait_count = 0 + else: + self.wait_count = 0 + + if len(new_faces) < 1: + duration = (time.perf_counter() - start) * 1000 + if not self.silent: + print(f"Took {duration:.2f}ms") + return [] + + crops = [] + crop_info = [] + num_crops = 0 + for j, (x,y,w,h) in enumerate(new_faces): + crop_x1 = x - int(w * 0.1) + crop_y1 = y - int(h * 0.125) + crop_x2 = x + w + int(w * 0.1) + crop_y2 = y + h + int(h * 0.125) + + crop_x1, crop_y1 = clamp_to_im((crop_x1, crop_y1), self.width, self.height) + crop_x2, crop_y2 = clamp_to_im((crop_x2, crop_y2), self.width, self.height) + + scale_x = float(crop_x2 - crop_x1) / self.res + scale_y = float(crop_y2 - crop_y1) / self.res + + if crop_x2 - crop_x1 < 4 or crop_y2 - crop_y1 < 4: + continue + + start_pp = time.perf_counter() + crop = self.preprocess(im, (crop_x1, crop_y1, crop_x2, crop_y2)) + duration_pp += 1000 * (time.perf_counter() - start_pp) + crops.append(crop) + crop_info.append((crop_x1, crop_y1, scale_x, scale_y, 0.0 if j >= bonus_cutoff else 0.1)) + num_crops += 1 + + start_model = time.perf_counter() + outputs = {} + if num_crops == 1: + output = self.session.run([], {self.input_name: crops[0]})[0] + conf, lms = self.landmarks(output[0], crop_info[0]) + if conf > self.threshold: + try: + eye_state = self.get_eye_state(frame, lms) + except: + eye_state = [(1.0, 0.0, 0.0, 0.0), (1.0, 0.0, 0.0, 0.0)] + outputs[crop_info[0]] = (conf, (lms, eye_state), 0) + else: + started = 0 + results = queue.Queue() + for i in range(min(num_crops, self.max_workers)): + thread = threading.Thread(target=worker_thread, args=(self.sessions[started], frame, crops[started], crop_info[started], results, self.input_name, started, self)) + started += 1 + thread.start() + returned = 0 + while returned < num_crops: + result = results.get(True) + if len(result) != 1: + session, conf, lms, sample_crop_info, idx = result + outputs[sample_crop_info] = (conf, lms, idx) + else: + session = result[0] + returned += 1 + if started < num_crops: + thread = threading.Thread(target=worker_thread, args=(session, frame, crops[started], crop_info[started], results, self.input_name, started, self)) + started += 1 + thread.start() + + actual_faces = [] + good_crops = [] + for crop in crop_info: + if crop not in outputs: + continue + conf, lms, i = outputs[crop] + x1, y1, _ = lms[0].min(0) + x2, y2, _ = lms[0].max(0) + bb = (x1, y1, x2 - x1, y2 - y1) + outputs[crop] = (conf, lms, i, bb) + actual_faces.append(bb) + good_crops.append(crop) + groups = group_rects(actual_faces) + + best_results = {} + for crop in good_crops: + conf, lms, i, bb = outputs[crop] + if conf < self.threshold: + continue; + group_id = groups[str(bb)][0] + if not group_id in best_results: + best_results[group_id] = [-1, [], 0] + if conf > self.threshold and best_results[group_id][0] < conf + crop[4]: + best_results[group_id][0] = conf + crop[4] + best_results[group_id][1] = lms + best_results[group_id][2] = crop[4] + + sorted_results = sorted(best_results.values(), key=lambda x: x[0], reverse=True)[:self.max_faces] + self.assign_face_info(sorted_results) + duration_model = 1000 * (time.perf_counter() - start_model) + + results = [] + detected = [] + start_pnp = time.perf_counter() + for face_info in self.face_info: + results.append(face_info) + if face_info.alive and face_info.conf > self.threshold: + face_info.success, face_info.quaternion, face_info.euler, face_info.pnp_error, face_info.pts_3d, face_info.lms = self.estimate_depth(face_info) + face_info.adjust_3d() + lms = face_info.lms[:, 0:2] + x1, y1 = tuple(lms[0:66].min(0)) + x2, y2 = tuple(lms[0:66].max(0)) + bbox = (y1, x1, y2 - y1, x2 - x1) + face_info.bbox = bbox + detected.append(bbox) + duration_pnp += 1000 * (time.perf_counter() - start_pnp) + + if len(detected) > 0: + self.detected = len(detected) + self.faces = detected + self.discard = 0 + else: + self.detected = 0 + self.discard += 1 + if self.discard > self.discard_after: + self.faces = [] + else: + if self.bbox_growth > 0: + faces = [] + for (x,y,w,h) in self.faces: + x -= w * self.bbox_growth + y -= h * self.bbox_growth + w += 2 * w * self.bbox_growth + h += 2 * h * self.bbox_growth + faces.append((x,y,w,h)) + self.faces = faces + self.faces = [x for x in self.faces if not np.isnan(np.array(x)).any()] + self.detected = len(self.faces) + + duration = (time.perf_counter() - start) * 1000 + if not self.silent: + print(f"Took {duration:.2f}ms (detect: {duration_fd:.2f}ms, crop: {duration_pp:.2f}ms, track: {duration_model:.2f}ms, 3D points: {duration_pnp:.2f}ms)") + + results = sorted(results, key=lambda x: x.id) + + return results diff --git a/GHA/pytorch3d b/GHA/pytorch3d new file mode 160000 index 0000000000000000000000000000000000000000..8ed0c7a00200df5ca08385b0f7c186b155175756 --- /dev/null +++ b/GHA/pytorch3d @@ -0,0 +1 @@ +Subproject commit 8ed0c7a00200df5ca08385b0f7c186b155175756 diff --git a/GHA/reenactment.py b/GHA/reenactment.py new file mode 100644 index 0000000000000000000000000000000000000000..bb69cf47db5893c973987446d284515113e64889 --- /dev/null +++ b/GHA/reenactment.py @@ -0,0 +1,47 @@ +import os +import torch +import argparse + +from config.config import config_reenactment + +from lib.dataset.Dataset import ReenactmentDataset +from lib.dataset.DataLoaderX import DataLoaderX +from lib.module.GaussianHeadModule import GaussianHeadModule +from lib.module.SuperResolutionModule import SuperResolutionModule +from lib.module.CameraModule import CameraModule +from lib.recorder.Recorder import ReenactmentRecorder +from lib.apps.Reenactment import Reenactment + +if __name__ == '__main__': + parser = argparse.ArgumentParser() + parser.add_argument('--config', type=str, default='config/reenactment_N031.yaml') + parser.add_argument('--offline_rendering_param_fpath', type=str, default=None) + arg = parser.parse_args() + + cfg = config_reenactment() + cfg.load(arg.config) + cfg = cfg.get_cfg() + + dataset = ReenactmentDataset(cfg.dataset) + dataloader = DataLoaderX(dataset, batch_size=1, shuffle=False, pin_memory=True) + + device = torch.device('cuda:%d' % cfg.gpu_id) + + gaussianhead_state_dict = torch.load(cfg.load_gaussianhead_checkpoint, map_location=lambda storage, loc: storage) + gaussianhead = GaussianHeadModule(cfg.gaussianheadmodule, + xyz=gaussianhead_state_dict['xyz'], + feature=gaussianhead_state_dict['feature'], + landmarks_3d_neutral=gaussianhead_state_dict['landmarks_3d_neutral']).to(device) + gaussianhead.load_state_dict(gaussianhead_state_dict) + + supres = SuperResolutionModule(cfg.supresmodule).to(device) + supres.load_state_dict(torch.load(cfg.load_supres_checkpoint, map_location=lambda storage, loc: storage)) + + camera = CameraModule() + recorder = ReenactmentRecorder(cfg.recorder) + + app = Reenactment(dataloader, gaussianhead, supres, camera, recorder, cfg.gpu_id, dataset.freeview) + if arg.offline_rendering_param_fpath is None: + app.run(stop_fid=800) + else: + app.run_for_offline_stitching(arg.offline_rendering_param_fpath) diff --git a/GHA/train_gaussianhead.py b/GHA/train_gaussianhead.py new file mode 100644 index 0000000000000000000000000000000000000000..cb9ed22cc8f475fe6010a06d59f824f2a526adf5 --- /dev/null +++ b/GHA/train_gaussianhead.py @@ -0,0 +1,91 @@ +import os +import torch +import argparse + +from config.config import config_train + +from lib.dataset.Dataset import GaussianDataset +from lib.dataset.DataLoaderX import DataLoaderX +from lib.module.MeshHeadModule import MeshHeadModule +from lib.module.GaussianHeadModule import GaussianHeadModule +from lib.module.SuperResolutionModule import SuperResolutionModule +from lib.module.CameraModule import CameraModule +from lib.recorder.Recorder import GaussianHeadTrainRecorder +from lib.trainer.GaussianHeadTrainer import GaussianHeadTrainer + +if __name__ == '__main__': + parser = argparse.ArgumentParser() + parser.add_argument('--config', type=str, default='config/train_s2_N031.yaml') + arg = parser.parse_args() + + cfg = config_train() + cfg.load(arg.config) + cfg = cfg.get_cfg() + + dataset = GaussianDataset(cfg.dataset) + dataloader = DataLoaderX(dataset, batch_size=cfg.batch_size, shuffle=True, pin_memory=True, drop_last=True, num_workers=8) + + device = torch.device('cuda:%d' % cfg.gpu_id) + torch.cuda.set_device(cfg.gpu_id) + + if os.path.exists(cfg.load_gaussianhead_checkpoint): + gaussianhead_state_dict = torch.load(cfg.load_gaussianhead_checkpoint, map_location=lambda storage, loc: storage) + gaussianhead = GaussianHeadModule(cfg.gaussianheadmodule, + xyz=gaussianhead_state_dict['xyz'], + feature=gaussianhead_state_dict['feature'], + landmarks_3d_neutral=gaussianhead_state_dict['landmarks_3d_neutral']).to(device) + gaussianhead.load_state_dict(gaussianhead_state_dict) + else: + meshhead_state_dict = torch.load(cfg.load_meshhead_checkpoint, map_location=lambda storage, loc: storage) + meshhead = MeshHeadModule(cfg.meshheadmodule, meshhead_state_dict['landmarks_3d_neutral']).to(device) + meshhead.load_state_dict(meshhead_state_dict) + meshhead.subdivide() + with torch.no_grad(): + data = meshhead.reconstruct_neutral() + + gaussianhead = GaussianHeadModule(cfg.gaussianheadmodule, + xyz=data['verts'].cpu(), + feature=torch.atanh(data['verts_feature'].cpu()), + landmarks_3d_neutral=meshhead.landmarks_3d_neutral.detach().cpu(), + add_mouth_points=True).to(device) + gaussianhead.exp_color_mlp.load_state_dict(meshhead.exp_color_mlp.state_dict()) + gaussianhead.pose_color_mlp.load_state_dict(meshhead.pose_color_mlp.state_dict()) + gaussianhead.exp_deform_mlp.load_state_dict(meshhead.exp_deform_mlp.state_dict()) + gaussianhead.pose_deform_mlp.load_state_dict(meshhead.pose_deform_mlp.state_dict()) + + supres = SuperResolutionModule(cfg.supresmodule).to(device) + if os.path.exists(cfg.load_supres_checkpoint): + supres.load_state_dict(torch.load(cfg.load_supres_checkpoint, map_location=lambda storage, loc: storage)) + + camera = CameraModule() + recorder = GaussianHeadTrainRecorder(cfg.recorder) + + optimized_parameters = [{'params' : supres.parameters(), 'lr' : cfg.lr_net}, + {'params' : gaussianhead.xyz, 'lr' : cfg.lr_net * 0.1}, + {'params' : gaussianhead.feature, 'lr' : cfg.lr_net * 0.1}, + {'params' : gaussianhead.exp_color_mlp.parameters(), 'lr' : cfg.lr_net}, + {'params' : gaussianhead.pose_color_mlp.parameters(), 'lr' : cfg.lr_net}, + {'params' : gaussianhead.exp_deform_mlp.parameters(), 'lr' : cfg.lr_net}, + {'params' : gaussianhead.pose_deform_mlp.parameters(), 'lr' : cfg.lr_net}, + {'params' : gaussianhead.exp_attributes_mlp.parameters(), 'lr' : cfg.lr_net}, + {'params' : gaussianhead.pose_attributes_mlp.parameters(), 'lr' : cfg.lr_net}, + {'params' : gaussianhead.scales, 'lr' : cfg.lr_net * 0.3}, + {'params' : gaussianhead.rotation, 'lr' : cfg.lr_net * 0.1}, + {'params' : gaussianhead.opacity, 'lr' : cfg.lr_net}] + + if os.path.exists(cfg.load_delta_poses_checkpoint): + delta_poses = torch.load(cfg.load_delta_poses_checkpoint) + else: + delta_poses = torch.zeros([dataset.num_exp_id, 6]).to(device) + + if cfg.optimize_pose: + delta_poses = delta_poses.requires_grad_(True) + optimized_parameters.append({'params' : delta_poses, 'lr' : cfg.lr_pose}) + else: + delta_poses = delta_poses.requires_grad_(False) + + optimizer = torch.optim.Adam(optimized_parameters) + + trainer = GaussianHeadTrainer(dataloader, delta_poses, gaussianhead, supres, camera, optimizer, recorder, cfg.gpu_id) + trainer.train(0, 1000) + diff --git a/GHA/train_meshhead.py b/GHA/train_meshhead.py new file mode 100644 index 0000000000000000000000000000000000000000..99b63a195e02baba7d46260c07bfdc6e303fb350 --- /dev/null +++ b/GHA/train_meshhead.py @@ -0,0 +1,46 @@ +import os +import torch +import argparse + +from config.config import config_train + +from lib.dataset.Dataset import MeshDataset +from lib.dataset.DataLoaderX import DataLoaderX +from lib.module.MeshHeadModule import MeshHeadModule +from lib.module.CameraModule import CameraModule +from lib.recorder.Recorder import MeshHeadTrainRecorder +from lib.trainer.MeshHeadTrainer import MeshHeadTrainer + +if __name__ == '__main__': + parser = argparse.ArgumentParser() + parser.add_argument('--config', type=str, default='config/train_s1_N031.yaml') + arg = parser.parse_args() + + cfg = config_train() + cfg.load(arg.config) + cfg = cfg.get_cfg() + + dataset = MeshDataset(cfg.dataset) + dataloader = DataLoaderX(dataset, batch_size=cfg.batch_size, shuffle=True, pin_memory=True, drop_last=True, num_workers=8) + + device = torch.device('cuda:%d' % cfg.gpu_id) + torch.cuda.set_device(cfg.gpu_id) + + meshhead = MeshHeadModule(cfg.meshheadmodule, dataset.init_landmarks_3d_neutral).to(device) + if os.path.exists(cfg.load_meshhead_checkpoint): + meshhead.load_state_dict(torch.load(cfg.load_meshhead_checkpoint, map_location=lambda storage, loc: storage)) + else: + meshhead.pre_train_sphere(300, device) + + camera = CameraModule() + recorder = MeshHeadTrainRecorder(cfg.recorder) + + optimizer = torch.optim.Adam([{'params' : meshhead.landmarks_3d_neutral, 'lr' : cfg.lr_lmk}, + {'params' : meshhead.geo_mlp.parameters(), 'lr' : cfg.lr_net}, + {'params' : meshhead.exp_color_mlp.parameters(), 'lr' : cfg.lr_net}, + {'params' : meshhead.pose_color_mlp.parameters(), 'lr' : cfg.lr_net}, + {'params' : meshhead.exp_deform_mlp.parameters(), 'lr' : cfg.lr_net}, + {'params' : meshhead.pose_deform_mlp.parameters(), 'lr' : cfg.lr_net}]) + trainer = MeshHeadTrainer(dataloader, meshhead, camera, optimizer, recorder, cfg.gpu_id) + trainer.train(0, 50) + diff --git a/GHA/use_new_param.sh b/GHA/use_new_param.sh new file mode 100644 index 0000000000000000000000000000000000000000..0af8e6c689d260a487da97c7d0c54f46ccc16b00 --- /dev/null +++ b/GHA/use_new_param.sh @@ -0,0 +1 @@ +python reenactment.py --config ./config/reenactment_1004.yaml --offline_rendering_param_fpath ../data/1004_render/head_zoomin_render_param.npz \ No newline at end of file diff --git a/GHA/use_new_param_nzc.sh b/GHA/use_new_param_nzc.sh new file mode 100644 index 0000000000000000000000000000000000000000..215cd4fa54b38c556f62eb086a7f21bc37b170ba --- /dev/null +++ b/GHA/use_new_param_nzc.sh @@ -0,0 +1 @@ +python reenactment.py --config ./config/reenactment_face0313.yaml --offline_rendering_param_fpath ../data/body_face_stitching_sr_v2/head_zoomin_render_param.npz \ No newline at end of file diff --git a/__pycache__/avatar_generator.cpython-310.pyc b/__pycache__/avatar_generator.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6c015af2475caecef94a1258f34783b13fdea264 Binary files /dev/null and b/__pycache__/avatar_generator.cpython-310.pyc differ diff --git a/lfs.sh b/lfs.sh new file mode 100644 index 0000000000000000000000000000000000000000..0ac54cc116db0b68dce7684072e8da544598539b --- /dev/null +++ b/lfs.sh @@ -0,0 +1,18 @@ +git lfs track AnimatableGaussians/network/styleunet/build/lib.linux-x86_64-cpython-310/fused.cpython-310-x86_64-linux-gnu.so +git lfs track AnimatableGaussians/network/styleunet/build/lib.linux-x86_64-cpython-310/upfirdn2d.cpython-310-x86_64-linux-gnu.so +git lfs track AnimatableGaussians/network/styleunet/build/temp.linux-x86_64-cpython-310/fused_bias_act.o +git lfs track AnimatableGaussians/network/styleunet/build/temp.linux-x86_64-cpython-310/upfirdn2d.o +git lfs track AnimatableGaussians/network/styleunet/build/temp.win-amd64-cpython-38/Release/fused_bias_act.obj +git lfs track AnimatableGaussians/network/styleunet/build/temp.win-amd64-cpython-38/Release/upfirdn2d.obj +git lfs track AnimatableGaussians/utils/posevocab_custom_ops/build/lib.linux-x86_64-cpython-38/posevocab_custom_ops.cpython-38-x86_64-linux-gnu.so +git lfs track AnimatableGaussians/utils/posevocab_custom_ops/build/temp.linux-x86_64-cpython-38/bind.o +git lfs track AnimatableGaussians/utils/root_finding/build/lib.linux-x86_64-cpython-38/root_finding.cpython-38-x86_64-linux-gnu.so +git lfs track AnimatableGaussians/utils/root_finding/build/temp.linux-x86_64-cpython-38/bind.o + +git lfs track AnimatableGaussians/assets/avatarrex_dataset_demo.gif +git lfs track AnimatableGaussians/network/styleunet/build/temp.win-amd64-cpython-38/Release/fused_bias_act_kernel.obj +git lfs track AnimatableGaussians/network/styleunet/build/temp.win-amd64-cpython-38/Release/upfirdn2d_kernel.obj +git lfs track AnimatableGaussians/network/styleunet/dist/fused-0.0.0-py3.10-linux-x86_64.egg +git lfs track AnimatableGaussians/network/styleunet/dist/upfirdn2d-0.0.0-py3.10-linux-x86_64.egg +git lfs track AnimatableGaussians/utils/posevocab_custom_ops/dist/posevocab_custom_ops-0.0.0-py3.8-linux-x86_64.egg +git lfs track AnimatableGaussians/utils/root_finding/dist/root_finding-0.0.0-py3.8-linux-x86_64.egg \ No newline at end of file diff --git a/other_requirement.sh b/other_requirement.sh index 6998e0fa060573a75221f11e2031f5430e79bf04..e29bfa89b3992252967fbc02b56d6fa440a9b3e6 100644 --- a/other_requirement.sh +++ b/other_requirement.sh @@ -1,5 +1,5 @@ -# pip install kaolin==0.16.0 -f https://nvidia-kaolin.s3.us-east-2.amazonaws.com/torch-2.4.0_cu121.html - +pip install kaolin==0.16.0 -f https://nvidia-kaolin.s3.us-east-2.amazonaws.com/torch-2.4.0_cu121.html +pip install moviepy --user cd AnimatableGaussians # install diff-gaussian-rasterization-depth-alpha diff --git a/requirement.txt b/requirement.txt index 338a1c29b0905d8e5b88b94ce76f74a187c42d99..4f17456e06442daaa9b631d93b42ab49a57d3bd7 100644 --- a/requirement.txt +++ b/requirement.txt @@ -45,8 +45,10 @@ scikit-image scipy sympy==1.12 tensorboardx==2.6.2.2 +tensorboard tifffile==2023.7.10 tornado==6.1 usd-core werkzeug==3.0.1 +yacs git+https://github.com/facebookresearch/pytorch3d.git